[Box Backup-dev] COMMIT r586 - box/chris/general/infrastructure

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 27 May 2006 09:43:52 +0000 (GMT)


Author: chris
Date: 2006-05-27 09:43:43 +0000 (Sat, 27 May 2006)
New Revision: 586

Modified:
   box/chris/general/infrastructure/BoxPlatform.pm.in
   box/chris/general/infrastructure/makebuildenv.pl
Log:
* infrastructure/makebuildenv.pl
* infrastructure/BoxPlatform.pm.in
- Added a simple variable to check whether building under Win32


Modified: box/chris/general/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/chris/general/infrastructure/BoxPlatform.pm.in	2006-05-27 09:42:31 UTC (rev 585)
+++ box/chris/general/infrastructure/BoxPlatform.pm.in	2006-05-27 09:43:43 UTC (rev 586)
@@ -1,7 +1,7 @@
 package BoxPlatform;
 use Exporter;
 @ISA = qw/Exporter/;
-@EXPORT = qw/$build_os $build_cpu $target_os $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files $platform_exe_ext/;
+@EXPORT = qw/$build_os $build_cpu $target_os $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files $platform_exe_ext $target_windows/;
 
 BEGIN
 {
@@ -27,6 +27,10 @@
 	$target_os = '@target_os@';
 	$platform_exe_ext = '@EXEEXT@';
 
+	$target_windows = 0;
+	$target_windows = 1 if $target_os =~ m'^mingw32' 
+		or $target_os eq "winnt";
+
 	# get version
 	open VERSION,"VERSION.txt" or die "VERSION.txt: $!";
 	$product_version = <VERSION>;

Modified: box/chris/general/infrastructure/makebuildenv.pl
===================================================================
--- box/chris/general/infrastructure/makebuildenv.pl	2006-05-27 09:42:31 UTC (rev 585)
+++ box/chris/general/infrastructure/makebuildenv.pl	2006-05-27 09:43:43 UTC (rev 586)
@@ -39,7 +39,7 @@
 my %env_flags;
 
 my $windows_include_path = "-I../../lib/win32 ";
-if ($target_os !~ m'^mingw32' && $target_os ne "winnt")
+if (not $target_windows)
 {
 	$windows_include_path = "";
 	$env_flags{'IGNORE_lib/win32'} = 1;
@@ -484,7 +484,7 @@
 	my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
 
 	my $release_flags = "-O2";
-	if ($target_os =~ m'^mingw32')
+	if ($target_windows)
 	{
 		$release_flags = "-O0 -g";
 	}
@@ -572,7 +572,7 @@
 		my $is_rc  = $file =~ m/\A(.+)\.rc\Z/i;
 		my $base = $1;
 
-		if ($target_os =~ m'^mingw32')
+		if ($target_windows)
 		{
 			next if not $is_cpp and not $is_rc;
 		}
@@ -683,7 +683,7 @@
 	print MAKE " ",$lib_files unless $target_is_library;
 	print MAKE "\n";
 	
-	if ($target_os =~ m'^mingw32')
+	if ($target_windows)
 	{
 		foreach my $dep (@all_deps_for_module)
 		{