diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-08-31 21:57:48 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-08-31 21:57:48 +0000 |
commit | 8f9b028e742dd186757714f23e25d551bfa30556 (patch) | |
tree | 807d2a4295fc2069b5f441e9d7fe083d1b29f083 | |
parent | de770199ef641369de102f1d9be740e19a0e191b (diff) |
* infrastructure/BoxPlatform.pm.in
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
(refs #3)
-rw-r--r-- | infrastructure/BoxPlatform.pm.in | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/infrastructure/BoxPlatform.pm.in b/infrastructure/BoxPlatform.pm.in index afcbee6e..828516e2 100644 --- a/infrastructure/BoxPlatform.pm.in +++ b/infrastructure/BoxPlatform.pm.in @@ -1,14 +1,26 @@ package BoxPlatform; use Exporter; @ISA = qw/Exporter/; -@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/; +@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 :) @@ -22,11 +34,18 @@ BEGIN $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>; |