summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-02-18 11:39:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-02-18 11:39:35 +0100
commit43cc2e07ee8d2db389449db54b9d21d46b85e7f6 (patch)
treedcdf24ed951b152bc68ba45a60b1d2a9955aa3e4
parente2884ab9c17b797f39833bf0381bd2fa1b5ea205 (diff)
Move AC_PROG_CC earlier so workaround against polluting CFLAGS actually works
Change-Id: Ife389d5a366fd626d3efe2dbe0735f166b0b75be
-rw-r--r--configure.ac18
1 files changed, 10 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 2e6eedb45e6d..315bffaf9ae6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -910,6 +910,16 @@ AC_SUBST(WITH_MINGW)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
+dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
+dnl Needs to precede the AC_SEARCH_LIBS call below, which apparently calls
+dnl AC_PROG_CC internally.
+if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
+ # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
+ save_CFLAGS=$CFLAGS
+ AC_PROG_CC
+ CFLAGS=$save_CFLAGS
+fi
+
if test $_os != "WINNT"; then
save_LIBS="$LIBS"
AC_SEARCH_LIBS([dlsym], [dl],
@@ -2746,14 +2756,6 @@ if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
fi
fi
-dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
-if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
- # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
- save_CFLAGS=$CFLAGS
- AC_PROG_CC
- CFLAGS=$save_CFLAGS
-fi
-
COMPATH=`dirname "$CC"`
if test "$COMPATH" = "."; then
AC_PATH_PROGS(COMPATH, $CC)