[Box Backup-commit] COMMIT r977 - box/trunk/infrastructure
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Thu Oct 12 20:42:19 BST 2006
Author: chris
Date: 2006-10-12 20:42:19 +0100 (Thu, 12 Oct 2006)
New Revision: 977
Modified:
box/trunk/infrastructure/BoxPlatform.pm.in
Log:
* Determine whether we are building for Windows or not, and export
that information
* Search for VERSION.txt in a few more places, for example when
running Perl scripts like getversion.pl
Modified: box/trunk/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/trunk/infrastructure/BoxPlatform.pm.in 2006-10-12 19:41:06 UTC (rev 976)
+++ box/trunk/infrastructure/BoxPlatform.pm.in 2006-10-12 19:42:19 UTC (rev 977)
@@ -1,15 +1,27 @@
package BoxPlatform;
use Exporter;
@ISA = qw/Exporter/;
- at EXPORT = qw/$build_os $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/;
+ at EXPORT = qw/$build_os $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
{
# which OS are we building under?
- $build_os = `uname`;
- chomp $build_os;
+ $target_os = '@target_os@';
+ $target_windows = 0;
+ $target_windows = 1 if $target_os =~ m'^mingw32'
+ or $target_os eq "winnt";
+ if ($^O eq "MSWin32" and not -x "/usr/bin/uname")
+ {
+ $build_os = "winnt";
+ }
+ else
+ {
+ $build_os = `uname`;
+ chomp $build_os;
+ }
+
# Cygwin Builds usually something like CYGWIN_NT-5.0, CYGWIN_NT-5.1
# Box Backup tried on Win2000,XP only :)
$build_os = 'CYGWIN' if $build_os =~ m/CYGWIN/;
@@ -22,11 +34,18 @@
$platform_compile_line_extra =~ s/ -O2//;
$platform_link_line_extra = '@LDFLAGS@';
$platform_lib_files = '@LIBS@';
- $target_os = '@target_os@';
$platform_exe_ext = '@EXEEXT@';
# get version
- open VERSION,"VERSION.txt" or die "VERSION.txt: $!";
+ if (! -r "VERSION.txt" and -r "../../VERSION.txt")
+ {
+ open VERSION,"../../VERSION.txt" or die "../../VERSION.txt: $!";
+ }
+ else
+ {
+ open VERSION,"VERSION.txt" or die "VERSION.txt: $!";
+ }
+
$product_version = <VERSION>;
chomp $product_version;
$product_name = <VERSION>;
More information about the Boxbackup-commit
mailing list