[Box Backup-commit] COMMIT r2168 - box/trunk/infrastructure

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Wed, 28 May 2008 13:04:00 +0100 (BST)


Author: chris
Date: 2008-05-28 13:03:59 +0100 (Wed, 28 May 2008)
New Revision: 2168

Modified:
   box/trunk/infrastructure/BoxPlatform.pm.in
   box/trunk/infrastructure/makebuildenv.pl.in
Log:
Remove redundant copies of flags from make command line.

Place CXXFLAGS and LDFLAGS in Makefiles so that they can be overridden 
by users who know what they are doing.

Add LDADD_RDYNAMIC to LDFLAGS to enable -rdynamic for symbolic stack 
traces.


Modified: box/trunk/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/trunk/infrastructure/BoxPlatform.pm.in	2008-05-28 12:02:47 UTC (rev 2167)
+++ box/trunk/infrastructure/BoxPlatform.pm.in	2008-05-28 12:03:59 UTC (rev 2168)
@@ -32,9 +32,8 @@
 		$build_os ne "SunOS" && $build_os ne 'GNU/kFreeBSD');
 
 	# blank extra flags by default
-	$platform_compile_line_extra = '@CPPFLAGS@ @CXXFLAGS@ @CXXFLAGS_STRICT@';
-	$platform_compile_line_extra =~ s/ -O2//;
-	$platform_link_line_extra = '@LDFLAGS@';
+	$platform_compile_line_extra = '';
+	$platform_link_line_extra = '';
 	$platform_lib_files = '@LIBS@';
 	$platform_exe_ext = '@EXEEXT@';
 

Modified: box/trunk/infrastructure/makebuildenv.pl.in
===================================================================
--- box/trunk/infrastructure/makebuildenv.pl.in	2008-05-28 12:02:47 UTC (rev 2167)
+++ box/trunk/infrastructure/makebuildenv.pl.in	2008-05-28 12:03:59 UTC (rev 2168)
@@ -515,6 +515,9 @@
 	open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n";
 	my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
 
+	my $default_cxxflags = '@CXXFLAGS@';
+	my $default_cxxflags =~ s/ -O2//g;
+
 	my $release_flags = "-O2";
 	if ($target_windows)
 	{
@@ -532,14 +535,20 @@
 RANLIB = @RANLIB@
 PERL = @PERL@
 WINDRES = windres
+
+CXXFLAGS = @CPPFLAGS@ $default_cxxflags @CXXFLAGS_STRICT@ \\
+	$include_paths $extra_platform_defines \\
+	-DBOX_VERSION="\\"$product_version\\""
+LDFLAGS = @LDFLAGS@ @LDADD_RDYNAMIC@
+
 .ifdef RELEASE
-CXXFLAGS = -DNDEBUG $release_flags @CXXFLAGS_STRICT@ $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+CXXFLAGS += -DNDEBUG $release_flags
 OUTBASE = ../../release
 OUTDIR = ../../release/$mod
 DEPENDMAKEFLAGS = -D RELEASE
 VARIENT = RELEASE
 .else
-CXXFLAGS = -g @CXXFLAGS_STRICT@ $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+CXXFLAGS += -g
 OUTBASE = ../../debug
 OUTDIR = ../../debug/$mod
 DEPENDMAKEFLAGS =
@@ -797,7 +806,9 @@
 		}
 	
 		# link line...
-		print MAKE "\t\$(_LINK) $link_line_extra -o $end_target $o_file_list $lib_files$lo $platform_lib_files\n";
+		print MAKE "\t\$(_LINK) \$(LDFLAGS) $link_line_extra " .
+			"-o $end_target $o_file_list " .
+			"$lib_files$lo $platform_lib_files\n";
 	}
 	# tests need to copy the test file over
 	if($type eq 'test')