Changeset 977


Ignore:
Timestamp:
12/10/2006 20:42:19 (5 years ago)
Author:
chris
Message:
  • 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/infrastructure/BoxPlatform.pm.in

    r722 r977  
    22use Exporter; 
    33@ISA = qw/Exporter/; 
    4 @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/; 
     4@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/; 
    55 
    66BEGIN 
     
    88 
    99        # which OS are we building under? 
    10         $build_os = `uname`; 
    11         chomp $build_os; 
     10        $target_os = '@target_os@'; 
     11        $target_windows = 0; 
     12        $target_windows = 1 if $target_os =~ m'^mingw32'  
     13                or $target_os eq "winnt"; 
     14 
     15        if ($^O eq "MSWin32" and not -x "/usr/bin/uname") 
     16        { 
     17                $build_os = "winnt"; 
     18        } 
     19        else 
     20        { 
     21                $build_os = `uname`; 
     22                chomp $build_os; 
     23        } 
    1224 
    1325        # Cygwin Builds usually something like CYGWIN_NT-5.0, CYGWIN_NT-5.1 
     
    2335        $platform_link_line_extra = '@LDFLAGS@'; 
    2436        $platform_lib_files = '@LIBS@'; 
    25         $target_os = '@target_os@'; 
    2637        $platform_exe_ext = '@EXEEXT@'; 
    2738 
    2839        # get version 
    29         open VERSION,"VERSION.txt" or die "VERSION.txt: $!"; 
     40        if (! -r "VERSION.txt" and -r "../../VERSION.txt") 
     41        { 
     42                open VERSION,"../../VERSION.txt" or die "../../VERSION.txt: $!"; 
     43        } 
     44        else 
     45        { 
     46                open VERSION,"VERSION.txt" or die "VERSION.txt: $!"; 
     47        } 
     48 
    3049        $product_version = <VERSION>; 
    3150        chomp $product_version; 
Note: See TracChangeset for help on using the changeset viewer.