diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2002-02-01 20:00:55 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-03 15:26:33 +0000 |
commit | 806ca1c22d6bc2cc9ece12ac5288fbb5d07e10bc (patch) | |
tree | 0b54d5757c8637095e213dca43a9d9c18ab6b5b8 /os2 | |
parent | dcb5229a5a0880d660b2e3833b135cbf1ba57ca4 (diff) | |
download | perl-806ca1c22d6bc2cc9ece12ac5288fbb5d07e10bc.tar.gz |
OS2::Process's constants
Message-ID: <20020202010055.A12924@math.ohio-state.edu>
p4raw-id: //depot/perl@14528
Diffstat (limited to 'os2')
-rw-r--r-- | os2/OS2/Process/Makefile.PL | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/os2/OS2/Process/Makefile.PL b/os2/OS2/Process/Makefile.PL index 9c97ad0c10..c1417579c7 100644 --- a/os2/OS2/Process/Makefile.PL +++ b/os2/OS2/Process/Makefile.PL @@ -1,4 +1,7 @@ use ExtUtils::MakeMaker; + +create_constants(); # Make a module + # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( @@ -12,3 +15,30 @@ WriteMakefile( # _16_Win16SetTitle => 'pmshapi.93', }, ); + +sub create_constants { + return if -d 'Process_constants'; + my $src_dir; + my @try = qw(.. ../.. ../../.. ../../../..); + for (@try) { + $src_dir = $_, last if -d "$_/utils" and -r "$_/utils/h2xs"; + } + warn("Can't find \$PERL_SRC/utils/h2xs in @try, falling back to no constants"), + return unless defined $src_dir; + # Can't name it *::Constants, otherwise constants.xs would overwrite it... + # This produces warnings from PSZ-conversion on WS_* constants. + system $^X, "-I$src_dir/lib", "$src_dir/utils/h2xs", '-fn', 'OS2::Process::Const', + '--skip-exporter', '--skip-autoloader', # too large memory overhead + '--skip-strict', '--skip-warnings', # likewise + '--skip-ppport', # will not work without dynaloading. + # Most useful for OS2::Process: + '-M^(HWND|WM|SC|SWP|WC|PROG|QW|EDI|WS)_', + '-F', '-DINCL_NLS -DINCL_BASE -DINCL_PM', # Define more symbols + 'os2emx.h' # EMX version of OS/2 API + and warn("Can't build module with contants, falling back to no constants"), + return; + rename 'OS2/Process/Const', 'Process_constants' + or warn("Error renaming module, falling back to no constants: $!"), + return; + return 1; +} |