From 01755b62f6542d25a885a4fe26ce9fc1ac6decaf Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 2 Jun 2017 21:59:21 +0100 Subject: Fix quoting of CXXFLAGS and LDFLAGS in Makefiles Previously, it was impossible to include an @ sign in these flags (for example, to link to support --with-ssl-headers=/usr/local/opt/openssl@1.1/include/) because it was interpreted as a list variable name by Perl. Now the variables are evaluated single-quoted before being substituted into the Makefile output. (cherry picked from commit 2e9c90d3f32c69cc89d01fb64ced9fca80aae985) --- infrastructure/makebuildenv.pl.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in index e4379824..d5ac9f2f 100755 --- a/infrastructure/makebuildenv.pl.in +++ b/infrastructure/makebuildenv.pl.in @@ -391,6 +391,9 @@ if ($target_windows) print "done\n\nGenerating Makefiles...\n"; my $makefile_ifdef_prefix = $bsd_make ? "." : ""; +my $autoconf_cppflags = '@CPPFLAGS@'; +my $autoconf_cxxflags = '@CXXFLAGS_STRICT@'; +my $autoconf_ldflags = '@LDFLAGS@'; open MASTER_MAKEFILE, ">Makefile" or die "Makefile: $!"; print MASTER_MAKEFILE <<__E; @@ -412,13 +415,13 @@ WINDRES = @WINDRES@ # Work around a mistake in QDBM (using includes for a file not in the # system path) by adding it to the include path with -I. -DEFAULT_CFLAGS = \@CPPFLAGS@ $default_cflags \@CXXFLAGS_STRICT@ \\ +DEFAULT_CFLAGS = $autoconf_cppflags $default_cflags $autoconf_cxxflags \\ $extra_platform_defines $platform_compile_line_extra \\ -DBOX_VERSION="\\"$product_version\\"" -Iqdbm -DEFAULT_CXXFLAGS = \@CPPFLAGS@ $default_cxxflags \@CXXFLAGS_STRICT@ \\ +DEFAULT_CXXFLAGS = $autoconf_cppflags $default_cxxflags $autoconf_cxxflags \\ $extra_platform_defines $platform_compile_line_extra \\ -DBOX_VERSION="\\"$product_version\\"" -LDFLAGS += \@LDFLAGS@ \@LDADD_RDYNAMIC@ $platform_link_line_extra +LDFLAGS += $autoconf_ldflags \@LDADD_RDYNAMIC@ $platform_link_line_extra RELEASE_CFLAGS = \$(DEFAULT_CFLAGS) -DBOX_RELEASE_BUILD $release_flags RELEASE_CXXFLAGS = \$(DEFAULT_CXXFLAGS) -DBOX_RELEASE_BUILD $release_flags -- cgit v1.2.3