From 40b7091ec578d99cd187e2949b83c3b1b76367fe Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 8 Jul 2017 11:20:21 +0200 Subject: [PATCH] configure: Allow specifying different CFLAGS for the cross compiler. Signed-off-by: Alexandre Julliard --- Makefile.in | 1 + configure | 3 +++ configure.ac | 1 + tools/makedep.c | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 22b2ae7230..6f1af8cfa7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,6 +43,7 @@ CPPBIN = @CPPBIN@ CROSSCC = @CROSSCC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ +CROSSCFLAGS = @CROSSCFLAGS@ EXTRACFLAGS = @EXTRACFLAGS@ MSVCRTFLAGS = @BUILTINFLAG@ TARGETFLAGS = @TARGETFLAGS@ diff --git a/configure b/configure index 9858031e32..c421bafcab 100755 --- a/configure +++ b/configure @@ -690,6 +690,7 @@ X_PRE_LIBS X_CFLAGS XMKMF PTHREAD_LIBS +CROSSCFLAGS CROSSCC CROSSTARGET PRELINK @@ -9105,6 +9106,8 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CC="$ac_save_CC" + CROSSCFLAGS=${CROSSCFLAGS:-$CFLAGS} + fi fi diff --git a/configure.ac b/configure.ac index d8309ea1d6..23937f1643 100644 --- a/configure.ac +++ b/configure.ac @@ -983,6 +983,7 @@ then done], [AC_MSG_RESULT([no])]) CC="$ac_save_CC" + AC_SUBST(CROSSCFLAGS,${CROSSCFLAGS:-$CFLAGS}) fi fi diff --git a/tools/makedep.c b/tools/makedep.c index add722f80a..fe670af63b 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2669,7 +2669,7 @@ static struct strarray output_sources( const struct makefile *make ) if (make->use_msvcrt) output_filenames( msvcrt_flags ); output_filename( "-DWINE_CROSSTEST" ); output_filenames( cpp_flags ); - output_filename( "$(CFLAGS)" ); + output_filename( "$(CROSSCFLAGS)" ); output( "\n" ); } if (make->testdll && !strcmp( ext, "c" ) && !(source->file->flags & FLAG_GENERATED))