From 90508cd3bf2479850a3a17103bddf12bf1282cb7 Mon Sep 17 00:00:00 2001 From: kakaroto Date: Sat, 7 Jan 2012 11:39:07 +0000 Subject: [PATCH] Eina: Set EINA_CFLAGS/EINA_LDFLAGS before looking for system headers We must check for cflags/ldflags and evil/escape libs before looking for headers (like sys/mman.h) because they could be provided by one of those libs. We must also set CFLAGS/LDFLAGS/LIBS variables to the EINA_CFLAGS/EINA_LDFLAGS/EINA_LIBS vars so they get picked up properly git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@66954 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 107 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/configure.ac b/configure.ac index 078f3d9..8fb7436 100644 --- a/configure.ac +++ b/configure.ac @@ -352,49 +352,6 @@ PKG_CHECK_MODULES([ECORE_EVAS], AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"]) - -### Checks for header files -AC_HEADER_ASSERT -AC_HEADER_TIME -EFL_CHECK_PATH_MAX -AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h]) - -if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then - EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H" - AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the header file.]) -fi -AC_SUBST([EINA_CONFIGURE_HAVE_INTTYPES_H]) - -if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then - EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H" - AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the header file.]) -fi -AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H]) - -### Checks for types - -AC_CHECK_SIZEOF([wchar_t]) -EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t -AC_SUBST([EINA_SIZEOF_WCHAR_T]) -AC_CHECK_TYPES([siginfo_t], [], [], - [[#include - #if HAVE_SIGINFO_H - # include - #endif - ]]) - -### Check if dirent.h is usable - -AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"], - [[#include - ]]) - -if test "x${have_dirent}" = "xyes" ; then - EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H" - AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid header file.]) -fi -AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H]) - ### Checks for compiler characteristics AC_C_CONST AC_C_BIGENDIAN @@ -430,6 +387,15 @@ m4_ifdef([v_mic], EFL_COMPILER_FLAG([-Wshadow]) +case "$host_vendor" in + ps3*) + PKG_CHECK_MODULES([ESCAPE], [escape]) + AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if evil package is installed]) + requirement_eina="escape" + EINA_CFLAGS="${ESCAPE_CFLAGS} ${EINA_CFLAGS}" + ;; +esac + AC_SUBST([EINA_CPPFLAGS]) AC_SUBST([EINA_CFLAGS]) @@ -458,21 +424,62 @@ case "${host_os}" in EINA_LIBS="-ldl -lrt -lm" ;; esac -AC_SUBST([EINA_LIBS]) -AC_SUBST([lt_enable_auto_import]) - case "$host_vendor" in ps3*) - PKG_CHECK_MODULES([ESCAPE], [escape]) - AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if evil package is installed]) - requirement_eina="escape" + # Escape had already been checked to exist EINA_LIBS="${ESCAPE_LIBS}" - EINA_CFLAGS="${ESCAPE_CFLAGS} ${EINA_CFLAGS}" ;; esac +AC_SUBST([EINA_LIBS]) +AC_SUBST([lt_enable_auto_import]) EFL_LINKER_FLAG([-fno-strict-aliasing]) +CFLAGS=${EINA_CFLAGS} +LDFLAGS=${EINA_LDFLAGS} +LIBS=${EINA_LIBS} + +### Checks for header files +AC_HEADER_ASSERT +AC_HEADER_TIME +EFL_CHECK_PATH_MAX +AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h]) + +if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then + EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H" + AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the header file.]) +fi +AC_SUBST([EINA_CONFIGURE_HAVE_INTTYPES_H]) + +if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then + EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H" + AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the header file.]) +fi +AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H]) + +### Checks for types + +AC_CHECK_SIZEOF([wchar_t]) +EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t +AC_SUBST([EINA_SIZEOF_WCHAR_T]) +AC_CHECK_TYPES([siginfo_t], [], [], + [[#include + #if HAVE_SIGINFO_H + # include + #endif + ]]) + +### Check if dirent.h is usable + +AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"], + [[#include + ]]) + +if test "x${have_dirent}" = "xyes" ; then + EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H" + AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid header file.]) +fi +AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H]) ### Checks for library functions AC_ISC_POSIX -- 2.7.4