summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-14 15:56:00 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-14 17:02:05 +0000
commited4b23548d28941f9b2c75207832afcb6c6ad0b3 (patch)
treed49f2043fac5586b1904312cea131237a57a73dc /configure.ac
parent5401ccd65d295092a740ca1c01604bbca2c9eca4 (diff)
Keep original CFLAGS etc. unmodified in configure.ac
...even if they are modified for the remaineder of configure.ac itself in the MSVC 2015-specific code checking for UCRT. Otherwise, the flags determined by LinkTarget.mk would lack any debug and optimization flags when building with MSVC 2015. Change-Id: Ib78418e0ad04bf2eae16a14b5c0904ba4f582eca Reviewed-on: https://gerrit.libreoffice.org/34248 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac137
1 files changed, 73 insertions, 64 deletions
diff --git a/configure.ac b/configure.ac
index 7667baedae3b..244ea87ba894 100644
--- a/configure.ac
+++ b/configure.ac
@@ -911,6 +911,75 @@ AC_SUBST(SDKDIRNAME)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
+# Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
+# By default use the ones specified by our build system,
+# but explicit override is possible.
+AC_MSG_CHECKING(for explicit AFLAGS)
+if test -n "$AFLAGS"; then
+ AC_MSG_RESULT([$AFLAGS])
+ x_AFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_AFLAGS=[\#]
+fi
+AC_MSG_CHECKING(for explicit CFLAGS)
+if test -n "$CFLAGS"; then
+ AC_MSG_RESULT([$CFLAGS])
+ x_CFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_CFLAGS=[\#]
+fi
+AC_MSG_CHECKING(for explicit CXXFLAGS)
+if test -n "$CXXFLAGS"; then
+ AC_MSG_RESULT([$CXXFLAGS])
+ x_CXXFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_CXXFLAGS=[\#]
+fi
+AC_MSG_CHECKING(for explicit OBJCFLAGS)
+if test -n "$OBJCFLAGS"; then
+ AC_MSG_RESULT([$OBJCFLAGS])
+ x_OBJCFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_OBJCFLAGS=[\#]
+fi
+AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
+if test -n "$OBJCXXFLAGS"; then
+ AC_MSG_RESULT([$OBJCXXFLAGS])
+ x_OBJCXXFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_OBJCXXFLAGS=[\#]
+fi
+AC_MSG_CHECKING(for explicit LDFLAGS)
+if test -n "$LDFLAGS"; then
+ AC_MSG_RESULT([$LDFLAGS])
+ x_LDFLAGS=
+else
+ AC_MSG_RESULT(no)
+ x_LDFLAGS=[\#]
+fi
+AC_SUBST(AFLAGS)
+AC_SUBST(CFLAGS)
+AC_SUBST(CXXFLAGS)
+AC_SUBST(OBJCFLAGS)
+AC_SUBST(OBJCXXFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(x_AFLAGS)
+AC_SUBST(x_CFLAGS)
+AC_SUBST(x_CXXFLAGS)
+AC_SUBST(x_OBJCFLAGS)
+AC_SUBST(x_OBJCXXFLAGS)
+AC_SUBST(x_LDFLAGS)
+
+dnl These are potentially set for MSVC, in the code checking for UCRT below:
+my_original_CFLAGS=$CFLAGS
+my_original_CXXFLAGS=$CXXFLAGS
+my_original_CPPFLAGS=$CPPFLAGS
+
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.
@@ -3939,70 +4008,6 @@ if test "$enable_release_build" != yes -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE
fi
AC_SUBST(XCODE_DEBUG_INFORMATION_FORMAT)
-# Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
-# By default use the ones specified by our build system,
-# but explicit override is possible.
-AC_MSG_CHECKING(for explicit AFLAGS)
-if test -n "$AFLAGS"; then
- AC_MSG_RESULT([$AFLAGS])
- x_AFLAGS=
-else
- AC_MSG_RESULT(no)
- x_AFLAGS=[\#]
-fi
-AC_MSG_CHECKING(for explicit CFLAGS)
-if test -n "$CFLAGS"; then
- AC_MSG_RESULT([$CFLAGS])
- x_CFLAGS=
-else
- AC_MSG_RESULT(no)
- x_CFLAGS=[\#]
-fi
-AC_MSG_CHECKING(for explicit CXXFLAGS)
-if test -n "$CXXFLAGS"; then
- AC_MSG_RESULT([$CXXFLAGS])
- x_CXXFLAGS=
-else
- AC_MSG_RESULT(no)
- x_CXXFLAGS=[\#]
-fi
-AC_MSG_CHECKING(for explicit OBJCFLAGS)
-if test -n "$OBJCFLAGS"; then
- AC_MSG_RESULT([$OBJCFLAGS])
- x_OBJCFLAGS=
-else
- AC_MSG_RESULT(no)
- x_OBJCFLAGS=[\#]
-fi
-AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
-if test -n "$OBJCXXFLAGS"; then
- AC_MSG_RESULT([$OBJCXXFLAGS])
- x_OBJCXXFLAGS=
-else
- AC_MSG_RESULT(no)
- x_OBJCXXFLAGS=[\#]
-fi
-AC_MSG_CHECKING(for explicit LDFLAGS)
-if test -n "$LDFLAGS"; then
- AC_MSG_RESULT([$LDFLAGS])
- x_LDFLAGS=
-else
- AC_MSG_RESULT(no)
- x_LDFLAGS=[\#]
-fi
-AC_SUBST(AFLAGS)
-AC_SUBST(CFLAGS)
-AC_SUBST(CXXFLAGS)
-AC_SUBST(OBJCFLAGS)
-AC_SUBST(OBJCXXFLAGS)
-AC_SUBST(LDFLAGS)
-AC_SUBST(x_AFLAGS)
-AC_SUBST(x_CFLAGS)
-AC_SUBST(x_CXXFLAGS)
-AC_SUBST(x_OBJCFLAGS)
-AC_SUBST(x_OBJCXXFLAGS)
-AC_SUBST(x_LDFLAGS)
-
#
# determine CPUNAME, OS, ...
# The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
@@ -12556,6 +12561,10 @@ if test -f config_host_lang.mk; then
config_lang_md5=`$MD5SUM config_host_lang.mk | sed "s/ .*//"`
fi
+CFLAGS=$my_original_CFLAGS
+CXXFLAGS=$my_original_CXXFLAGS
+CPPFLAGS=$my_original_CPPFLAGS
+
AC_CONFIG_FILES([config_host.mk
config_host_lang.mk
Makefile