version 1.1.1.1, 2000/09/09 14:12:20 |
version 1.1.1.2, 2003/08/25 16:06:11 |
|
|
# Note that this script can't be run directly from MPW perl |
# Note that this script can't be run directly from MPW perl |
# because it has the wrong end-of-line characters. See README. |
# because it has the wrong end-of-line characters. See README. |
|
|
# Copyright (C) 2000 Free Software Foundation, Inc. |
# Copyright 2000, 2001, 2002 Free Software Foundation, Inc. |
# |
# |
# This file is part of the GNU MP Library. |
# This file is part of the GNU MP Library. |
# |
# |
|
|
( |
( |
'cc' => 'MrC', |
'cc' => 'MrC', |
'coptions' => ['-ansi on -i : -i :: -i ::mpn:powerpc32 -i ::mpz', |
'coptions' => ['-ansi on -i : -i :: -i ::mpn:powerpc32 -i ::mpz', |
'-opt speed -inline on -d random=rand -d srandom=srand'], |
'-opt speed -inline on'], |
'link' => 'PPCLink', |
'link' => 'PPCLink', |
'linkoptions' => '-sym on -xm library', |
'linkoptions' => '-sym on -xm library', |
'tooloptions' => "-t 'MPST' -c 'MPS'", |
'tooloptions' => "-t 'MPST' -c 'MPS'", |
|
|
'coptions' => [ |
'coptions' => [ |
'-opt all -w nounusedvar,noextended', |
'-opt all -w nounusedvar,noextended', |
'-i :: -i ::mpn:powerpc32 -i ::mpz', |
'-i :: -i ::mpn:powerpc32 -i ::mpz', |
'-sym full -d random=rand -d srandom=srand', |
'-sym full', |
], |
], |
'link' => 'MWLinkPPC', |
'link' => 'MWLinkPPC', |
'linkoptions' => '-sym fullpath -library', |
'linkoptions' => '-sym fullpath -library', |
|
|
], |
], |
); |
); |
|
|
|
# We only set the variables that have a value |
|
my %vars = |
|
( |
|
'BITS_PER_MP_LIMB' => 32, |
|
'HAVE_HOST_CPU_FAMILY_power' => 0, |
|
'HAVE_HOST_CPU_FAMILY_powerpc' => 1, |
|
'GMP_NAIL_BITS' => 0, |
|
'DEFN_LONG_LONG_LIMB' => '', |
|
'LIBGMP_DLL' => 0, |
|
); |
|
|
my $make_in = 'Makefile.in'; |
my $make_in = 'Makefile.in'; |
my $make = 'Makefile'; |
my $make = 'Makefile'; |
my $configure = mf("../configure"); |
my $configure = mf("../configure"); |
my $configure_in = mf("../configure.in"); |
my $configure_in = mf("../configure.in"); |
my $config_in = mf("../config.in"); |
my $config_in = mf("../config.in"); |
|
my $gmp_h = mf('../gmp.h'); |
|
my $gmp_h_in = mf('../gmp-h.in'); |
my $mpn_asm_dir = "../mpn/powerpc32"; |
my $mpn_asm_dir = "../mpn/powerpc32"; |
my $mpn_gen_dir = "../mpn/generic"; |
my $mpn_gen_dir = "../mpn/generic"; |
my $config_h = 'config.h'; |
my $config_h = 'config.h'; |
Line 164 while (<CONFIG_IN>) { |
|
Line 176 while (<CONFIG_IN>) { |
|
print STDERR "Warning: Found asm file \"$1\" but no corresponding C file - ignoring\n"; |
print STDERR "Warning: Found asm file \"$1\" but no corresponding C file - ignoring\n"; |
} |
} |
|
|
} elsif (/^\s*#\s*undef\s+PACKAGE/) { |
} elsif (/^\s*#\s*undef\s+inline\b/) { |
|
print CONFIG_H "\#define inline\n"; |
|
} elsif (/^\s*#\s*undef\s+HAVE_STDARG\b/) { |
|
print CONFIG_H "\#define HAVE_STDARG 1\n"; |
|
} elsif (/^\s*#\s*undef\s+HAVE_STRCHR\b/) { |
|
print CONFIG_H "\#define HAVE_STRCHR 1\n"; |
|
} elsif (/^\s*#\s*undef\s+HAVE_HOST_CPU_FAMILY_powerpc\b/) { |
|
print CONFIG_H "\#define HAVE_HOST_CPU_FAMILY_powerpc 1\n"; |
|
} elsif (/^\s*#\s*undef\s+WANT_TMP_NOTREENTRANT\b/) { |
|
print CONFIG_H "\#define WANT_TMP_NOTREENTRANT 1\n"; |
|
} elsif (/^\s*#\s*undef\s+PACKAGE\b/) { |
print CONFIG_H "\#define PACKAGE \"$package\"\n"; |
print CONFIG_H "\#define PACKAGE \"$package\"\n"; |
} elsif (/^\s*#\s*undef\s+VERSION/) { |
} elsif (/^\s*#\s*undef\s+VERSION\b/) { |
print CONFIG_H "\#define VERSION \"$version\"\n"; |
print CONFIG_H "\#define VERSION \"$version\"\n"; |
} elsif (/^\s*#\s*undef\s+STDC_HEADERS/) { |
} elsif (/^\s*#\s*undef\s+STDC_HEADERS\b/) { |
print CONFIG_H "\#define STDC_HEADERS 1\n"; |
print CONFIG_H "\#define STDC_HEADERS 1\n"; |
} else { # Blank line, leave it |
} else { # Blank line, leave it |
print CONFIG_H "$_\n"; |
print CONFIG_H "$_\n"; |
Line 177 while (<CONFIG_IN>) { |
|
Line 199 while (<CONFIG_IN>) { |
|
|
|
close CONFIG_H; |
close CONFIG_H; |
close CONFIG_IN; |
close CONFIG_IN; |
|
|
|
########################################################################### |
|
# |
|
# Create gmp.h from ../gmp-h.in |
|
# |
|
########################################################################### |
|
|
|
open(GMP_H_IN, $gmp_h_in) |
|
or die "Can't open \"$gmp_h_in\"\n"; |
|
open(GMP_H, ">$gmp_h") |
|
or die "Can't create \"$gmp_h\"\n"; |
|
|
|
while (<GMP_H_IN>) { |
|
chomp; # Remove whatever ending it was |
|
|
|
# Do the variable substitution |
|
|
|
s/\@([^\@]+)\@/exists $vars{$1} ? $vars{$1} : ''/ge; |
|
|
|
print GMP_H "$_\n"; |
|
} |
|
|
|
close GMP_H; |
|
close GMP_H_IN; |
|
|
########################################################################### |
########################################################################### |
# |
# |