From: Reini Urban Date: Tue, 14 Aug 2007 08:51:50 +0000 (+0200) Subject: get rid of cygwin perlld and ld2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f3b19ea9f1065e1d9d263b4c07fca1ba8f29276;p=p5sagit%2Fp5-mst-13.2.git get rid of cygwin perlld and ld2 Message-Id: <46C15106.9080003@x-ray.at> p4raw-id: //depot/perl@31710 --- diff --git a/cflags.SH b/cflags.SH index af1b43b..2e7ecf3 100755 --- a/cflags.SH +++ b/cflags.SH @@ -304,6 +304,7 @@ case "$cc" in done ;; esac +cppflags=`echo $cppflags|sed 's/-Wdeclaration-after-statement/ /'` case "$cc" in *g++*) diff --git a/cygwin/Makefile.SHs b/cygwin/Makefile.SHs index 186f2aa..4673d8a 100644 --- a/cygwin/Makefile.SHs +++ b/cygwin/Makefile.SHs @@ -3,8 +3,8 @@ # Rerun `sh Makefile.SH; make depend' after making any change. -# Additional rules supported: libperls.a (for static linking), -# ld2, perlld (dynamic linking tools) +# Additional rules supported: libperl.a (for static linking), +# ld2 and perlld removed # #! /bin/sh @@ -28,63 +28,21 @@ $spitshell >>Makefile <ld2 - @chmod a+x ld2 - @echo "installing ld2 into $installbin" -# install is included in Cygwin distributions, and we make a note of the -# requirement in the README.cygwin file. However, let's give them -# a warning. - @test -d ${installbin} || mkdir -p ${installbin} - @/usr/bin/install -c -m 755 ld2 ${installbin}/ld2 - @if test ! -f ${installbin}/ld2; then \ - echo "*************************************************" ; \ - echo "Make will probably fail in a few more steps." ; \ - echo "When it does, copy \"ld2\" to a directory in" ; \ - echo "your path, other than \".\"." ; \ - echo "\"/usr/local/bin\" or something similar will do." ; \ - echo "Then restart make." ; \ - echo "*************************************************" ; \ - fi - -!GROK!THIS! - -$spitshell >>Makefile <perlld - !GROK!THIS! # make sure that all library names are not malformed libperl=`echo $libperl|sed -e s,\\\..*,,` - linklibperl=-l`echo $libperl|sed -e s,^lib,,` +vers=`echo $version|tr '.' '_'` +dllname=`echo $libperl|sed -e s,^lib,cyg,`$vers $spitshell >>Makefile <' || $(MAKE) minitest perl.exe \ @@ -201,12 +159,6 @@ distdir: miniperl ./miniperl -Ilib '-MExtUtils::Manifest' \ -e "ExtUtils::Manifest::manicopy(ExtUtils::Manifest::maniread(),'$(DIST_DIRECTORY)')" -cygwin1.dll: /bin/cygwin1.dll - cp /bin/cygwin1.dll . - -cygcrypt-0.dll: /bin/cygcrypt-0.dll - cp /bin/cygcrypt-0.dll . - -test_prep: cygwin1.dll cygcrypt-0.dll +test_prep: !NO!SUBS! diff --git a/cygwin/ld2.in b/cygwin/ld2.in index fb41257..e69de29 100644 --- a/cygwin/ld2.in +++ b/cygwin/ld2.in @@ -1,20 +0,0 @@ -#!/bin/sh -# -# ld wrapper for building dynamic lib version of perl; -# passes all args to perlld -# - -# miniperl is first candidate because it does not lock libperl.dll -for trythis in @buildpath@/miniperl @buildpath@/perl perl -do - if [ -x $trythis ] - then - $trythis @buildpath@/perlld "$@" - exit $? - fi -done -# hard luck! -echo I see no perl executable around here. Perl -echo is required to build dynamic libraries. Please -echo reinstall Perl or build this one with static. -exit 1 diff --git a/cygwin/perlld.in b/cygwin/perlld.in index 85dc263..e69de29 100644 --- a/cygwin/perlld.in +++ b/cygwin/perlld.in @@ -1,89 +0,0 @@ -# -# Perl script being a wrapper around the gnu ld. When a dll is specified to -# to be built, special processing is done, else the standard ld is called. -# - -# these are pretty mandatory -my $CC = '@CC@'; -my $EXPORT_ALL = @EXPORT_ALL@; - -# if some of extensions are undefined, -# no corresponding output will be done. -# most probably, you'd like to have an export library -# my $DEF_EXT = '@DEF_EXT@'; -# my $EXP_EXT = '@EXP_EXT@'; -my $LIB_EXT = '@LIB_EXT@'; - -#my $DEBUG ="perlld.out"; -my $DEBUG =undef; - -my $args = join(" ",@ARGV); # get args -my $verbose =grep(/^\-(v|\-verbose)$/, @ARGV); - -sub shellexec; - -if ($DEBUG) { - open DEBUGFILE, ">>$DEBUG"; - print DEBUGFILE "\n--- " .localtime() ."\nargs:\n$args\n\nenvironment:\n"; - foreach (keys(%ENV)) { print DEBUGFILE $_, "=", $ENV{$_}, "\n"; }; -} - -if ($args !~ /\-o (\S+)/) { - print DEBUGFILE "+ no dll output -- passing to gcc\n\n" if $DEBUG; - shellexec("$CC $args\n"); -} else { - my ($path, $command, $dllname, $libname) =''; - - $dllname =$1; - print DEBUGFILE "output file: $dllname\n" if $DEBUG; - # remove -o from args - $args =~ s/(^| )\-o \S+/$1/; - - # Check for path: - if( $dllname =~ /.*[\/\\]/){ - $dllname = $'; - $path = $&; - $path =~ s,[/\\](\.[/\\])*,/,g; - } - if ($dllname =~ /\./) { $libname =$`; } else { $libname =$dllname; }; - my $v_e_r_s = '@VERSION@'; - $v_e_r_s =~ tr/./_/; - if ( $dllname =~ /libperl.*/) { - $dllname ="cygperl$v_e_r_s.dll"; - } else { - $dllname ="$libname.dll"; - } - $libname ="lib$libname" unless ($libname =~ /^lib/); - print DEBUGFILE "dll name: $dllname\nimport library: $libname\npath: $path\n" if $DEBUG; - - $command ="$CC -shared -o $dllname"; -# $command .=" --verbose" if $verbose; - - $command .=" -Wl,--output-def=$libname$DEF_EXT" if $DEF_EXT; - $command .=" -Wl,--output-exp=$libname$EXP_EXT" if $EXP_EXT; - $command .=" -Wl,--out-implib=$libname.dll$LIB_EXT" if $LIB_EXT; - $command .=" -Wl,--export-all-symbols" if $EXPORT_ALL; - $command .=" -Wl,--enable-auto-import -Wl,--stack,8388608"; # always - $command .=" -Wl,--enable-auto-image-base"; # always - - # other args are passed through - shellexec("$command \\\n$args\n"); - - if ($path) { - $command ="mv $dllname"; - $command .=" $libname.dll$LIB_EXT" if $LIB_EXT; - shellexec("$command $path\n"); - }; -}; -close DEBUGFILE if $DEBUG; - -#--------------------------------------------------------------------------- -sub shellexec { - my $command = shift; - print $command; - print DEBUGFILE $command if $DEBUG; - system($command) == 0 - or die "perlld: *** system() failed to execute\n$command\n"; -}; - -1; diff --git a/hints/cygwin.sh b/hints/cygwin.sh index e0cdc05..a61ef7b 100644 --- a/hints/cygwin.sh +++ b/hints/cygwin.sh @@ -38,7 +38,8 @@ archname='cygwin' # dynamic loading # - otherwise -fpic cccdlflags=' ' -ld='ld2' +lddlflags=' --shared' +ld='g++' case "$osvers" in @@ -57,9 +58,10 @@ static_ext="$static_ext Win32CORE" d_eofnblk='define' # suppress auto-import warnings -ldflags="$ldflags -Wl,--enable-auto-import" +ldflags="$ldflags -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -Wl,--enable-auto-import" +lddlflags="$lddlflags $ldflags" # strip exe's and dll's #ldflags="$ldflags -s" -#ccdlflags="$ccdlflags -s" +ccdlflags="$ccdlflags -s" #lddlflags="$lddlflags -s"