Skip to content

Commit

Permalink
Fix quoting of CXXFLAGS and LDFLAGS in Makefiles
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
qris committed Jun 2, 2017
1 parent 98b7796 commit 2e9c90d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions infrastructure/makebuildenv.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,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;
Expand All @@ -411,13 +414,13 @@ WINDRES = @WINDRES@

# Work around a mistake in QDBM (using <angled> 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
Expand Down

0 comments on commit 2e9c90d

Please sign in to comment.