diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-11-02 01:29:55 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-11-02 01:29:55 +0100 |
commit | 1ee6cc6917cab1ac1728210b9ccc50922921a7d6 (patch) | |
tree | b09418a1cf83f8b39070052a86ba8b09294daa1b /tune/many.pl | |
parent | f7349743ef6d0dca00f2b039b67dc7bfd98fdcb5 (diff) | |
download | gmp-1ee6cc6917cab1ac1728210b9ccc50922921a7d6.tar.gz |
* tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
longer done by configure.
Diffstat (limited to 'tune/many.pl')
-rwxr-xr-x | tune/many.pl | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/tune/many.pl b/tune/many.pl index e51a11386..f9f5ccca9 100755 --- a/tune/many.pl +++ b/tune/many.pl @@ -718,9 +718,12 @@ my %pictable = my $builddir = $ENV{builddir}; -$builddir = "" if (! defined $builddir); +$builddir = "." if (! defined $builddir); -open(MAKEFILE, "<${builddir}Makefile") +my $top_builddir = "${builddir}/.."; + + +open(MAKEFILE, "<${builddir}/Makefile") or die "Cannot open Makefile: $!\nIs this a tune build directory?"; my ($srcdir, $top_srcdir); while (<MAKEFILE>) { @@ -750,6 +753,28 @@ print TRY my $TRY_EXTRA_ROUTINES = "#define EXTRA_ROUTINES \\\n"; my $TRY_EXTRA_PROTOS = "#define EXTRA_PROTOS \\\n"; +open(FD,"<${top_builddir}/libtool") or die "Cannot open \"${top_builddir}/libtool\": $!\n"; +my $pic_flag; +while (<FD>) { + if (/^pic_flag="?([^"]*)"?$/) { + $pic_flag=$1; + last; + } +} +close FD; +if (! defined $pic_flag) { + die "Cannot find pic_flag in ${top_builddir}/libtool"; +} + +my $CFLAGS_PIC = $pic_flag; + +my $ASMFLAGS_PIC = ""; +foreach (split /[ \t]/, $pic_flag) { + if (/^-D/) { + $ASMFLAGS_PIC .= " " . $_; + } +} + open(MAKEFILE, ">Makefile.many") or die; print MAKEFILE "# Makefile.many generated by many.pl - DO NOT EDIT, CHANGES WILL BE LOST\n" . @@ -758,12 +783,15 @@ print MAKEFILE "\n" . "#--------- begin included copy of basic Makefile ----------\n" . "\n"; -open(FD,"<${builddir}Makefile") or die "Cannot open \"Makefile\": $!\n"; +open(FD,"<${builddir}/Makefile") or die "Cannot open \"${builddir}/Makefile\": $!\n"; print MAKEFILE <FD>; close FD; print MAKEFILE "\n" . "#--------- end included copy of basic Makefile ----------\n" . + "\n" . + "CFLAGS_PIC = $CFLAGS_PIC\n" . + "ASMFLAGS_PIC = $ASMFLAGS_PIC\n" . "\n"; my $CLEAN=""; |