AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-AC_ISC_POSIX
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_HEADER_STDC
-AC_C_CONST
-AC_C___ATTRIBUTE__
-
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_SUBST(efreet_mime_release_info)
AC_SUBST(efreet_trash_release_info)
-EFL_CHECK_PATH_MAX
+### Needed information
+
+
+### Additional options to configure
+
+AC_ARG_ENABLE([strict-spec],
+ [AC_HELP_STRING([--enable-strict-spec], [Enable strict spec compliance @<:@default=disabled@:>@])],
+ [
+ if test "x${enableval}" = "xyes" ; then
+ enable_strict_spec="yes"
+ else
+ enable_strict_spec="no"
+ fi
+ ],
+ [enable_strict_spec="no"])
+
+if test "x${enable_strict_spec}" = "xyes" ; then
+ AC_DEFINE([STRICT_SPEC], [1], [Strict Spec Compliance])
+fi
+
+AC_ARG_ENABLE([sloppy-spec],
+ [AC_HELP_STRING([--disable-sloppy-spec], [Enable sloppy spec compliance @<:@default=enabled@:>@])],
+ [
+ if test "x${enableval}" = "xyes" ; then
+ enable_sloppy_spec="yes"
+ else
+ enable_sloppy_spec="no"
+ fi
+ ],
+ [enable_sloppy_spec="yes"])
+
+if test "x${enable_sloppy_spec}" = "xyes" ; then
+ AC_DEFINE([SLOPPY_SPEC], [1], [Sloppy Spec Compliance])
+fi
+
+#AC_ARG_ENABLE(hidden-visibility,
+# [AC_HELP_STRING([--enable-hidden-visibility],[Enable hidden visibility])],
+# [enable_hidden_visibility=$enableval], [enable_hidden_visibility="auto"])
+#if test "x$enable_hidden_visibility" = "xyes" ; then
+# CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
+#else
+# AC_DEFINE(DEFAULT_VISIBLITY, 1, [Default visibility])
+#fi
+#AM_CONDITIONAL(DEFAULT_VISIBILITY, test "x$enable_hidden_visibility" != "xyes")
+AM_CONDITIONAL(DEFAULT_VISIBILITY, 0)
+
+
+### Checks for programs
+AC_PROG_CC
+
+# pkg-config
PKG_PROG_PKG_CONFIG
# Check whether pkg-config supports Requires.private
fi
AC_SUBST(pkgconfig_requires_private)
+# doxygen program for documentation building
+EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
+
+
+### Checks for libraries
+
+# Evil library for compilation on Windows CE
+
EFL_EFREET_BUILD=""
EFL_EFREET_MIME_BUILD=""
EFL_EFREET_TRASH_BUILD=""
-win32_libs=""
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
PKG_CHECK_MODULES([EVIL], [evil])
- AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
+ AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
+ requirement_efreet="evil"
EFL_EFREET_BUILD="-DEFL_EFREET_BUILD"
EFL_EFREET_MIME_BUILD="-DEFL_EFREET_MIME_BUILD"
EFL_EFREET_TRASH_BUILD="-DEFL_EFREET_TRASH_BUILD"
- win32_libs="-lws2_32"
;;
esac
AC_SUBST(EFL_EFREET_BUILD)
AC_SUBST(EFL_EFREET_MIME_BUILD)
AC_SUBST(EFL_EFREET_TRASH_BUILD)
-AC_SUBST(win32_libs)
-AC_FUNC_ALLOCA
+PKG_CHECK_MODULES(EFREET, [eina-0 eet ecore >= 0.9.9 ecore-file >= 0.9.9])
+PKG_CHECK_MODULES(EINA, [eina-0])
+
+requirement_efreet="ecore-file ecore eet eina-0 ${requirement_efreet}"
+
+### Checks for header files
AC_CHECK_HEADERS([arpa/inet.h])
-PKG_CHECK_MODULES(EFREET, [eet eina-0 ecore >= 0.9.9 ecore-file >= 0.9.9])
-PKG_CHECK_MODULES(EINA, [eina-0])
+### Checks for types
-requirements="ecore-file ecore eina-0"
-AC_ARG_ENABLE(strict-spec,
- [AC_HELP_STRING([--enable-strict-spec],[Enable strict spec compliance])],
- [enable_strict_spec=$enableval], [enable_strict_spec="auto"])
-if test "x$enable_strict_spec" = "xyes" ; then
- AC_DEFINE(STRICT_SPEC, 1, [Strict Spec Compliance])
-fi
+### Checks for structures
+
-AC_ARG_ENABLE(sloppy-spec,
- [AC_HELP_STRING([--disable-sloppy-spec],[Enable sloppy spec compliance])],
- [enable_sloppy_spec=$enableval], [enable_sloppy_spec="yes"])
-if test "x$enable_sloppy_spec" = "xyes" ; then
- AC_DEFINE(SLOPPY_SPEC, 1, [Sloppy Spec Compliance])
+### Checks for compiler characteristics
+
+AC_C_CONST
+AC_ISC_POSIX
+AC_C___ATTRIBUTE__
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+
+case "${host_os}" in
+ mingw*)
+ EFREET_CFLAGS="${EFREET_CFLAGS} ${EVIL_CFLAGS}"
+ ;;
+esac
+
+if ! test "x${VMIC}" = "x" ; then
+ EFL_COMPILER_FLAG([-Wall])
+ EFL_COMPILER_FLAG([-W])
fi
-#AC_ARG_ENABLE(hidden-visibility,
-# [AC_HELP_STRING([--enable-hidden-visibility],[Enable hidden visibility])],
-# [enable_hidden_visibility=$enableval], [enable_hidden_visibility="auto"])
-#if test "x$enable_hidden_visibility" = "xyes" ; then
-# CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
-#else
-# AC_DEFINE(DEFAULT_VISIBLITY, 1, [Default visibility])
-#fi
-#AM_CONDITIONAL(DEFAULT_VISIBILITY, test "x$enable_hidden_visibility" != "xyes")
-AM_CONDITIONAL(DEFAULT_VISIBILITY, 0)
-EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
+EFL_COMPILER_FLAG([-Wshadow])
+
+EFL_CHECK_PATH_MAX
+
+
+### Checks for linker characteristics
+lt_enable_auto_import=""
+WIN32_LIBS=""
+case "${host_os}" in
+ mingw*)
+ WIN32_LIBS="-lws2_32"
+ lt_enable_auto_import="-Wl,--enable-auto-import"
+ ;;
+esac
+AC_SUBST(WIN32_LIBS)
+AC_SUBST(lt_enable_auto_import)
+
+
+### Checks for library functions
+AC_FUNC_ALLOCA
+AC_CHECK_FUNCS(strlcpy)
+
+AC_SUBST(requirement_efreet)
-AC_SUBST(requirements)
AC_OUTPUT([
efreet.spec
efreet.pc
src/tests/data/sub/Makefile
src/tests/compare/Makefile
src/bin/Makefile
-], []
-)
+])
#####################################################################
echo
echo "Configuration Options Summary:"
echo
+echo " Specification compliance:"
+echo " Strict.............: ${enable_strict_spec}"
+echo " Sloppy.............: ${enable_sloppy_spec}"
+echo
echo " Documentation........: ${build_doc}"
echo
echo "Compilation............: make (or gmake)"
--- /dev/null
+dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
+dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that checks if a compiler flag is supported by the compiler.
+
+dnl Usage: EFL_COMPILER_FLAG(flag)
+dnl flag is added to CFLAGS if supported.
+
+AC_DEFUN([EFL_COMPILER_FLAG],
+[
+
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${CFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ CFLAGS="${CFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])
+
+dnl Macro that checks if a linker flag is supported by the compiler.
+
+dnl Usage: EFL_LINKER_FLAG(flag)
+dnl flag is added to CFLAGS if supported (will be passed to ld anyway).
+
+AC_DEFUN([EFL_LINKER_FLAG],
+[
+
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${CFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ CFLAGS="${CFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])