develooper Front page | perl.perl5.changes | Postings from January 2009

[perl.git] branch maint-5.10, updated. GitLive-maint-5.10-11-gaa7fc7f

From:
David Mitchell
Date:
January 2, 2009 11:54
Subject:
[perl.git] branch maint-5.10, updated. GitLive-maint-5.10-11-gaa7fc7f
In perl.git, the branch maint-5.10 has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/aa7fc7f9b08b17f291a5fa6017801d139f40d5ec?hp=555150c2496300f6ed410a006ba97c436a476f01>

- Log -----------------------------------------------------------------
commit aa7fc7f9b08b17f291a5fa6017801d139f40d5ec
Author: Jerry D. Hedden <jdhedden@cpan.org>
Date:   Mon Aug 25 06:47:24 2008 -0400

    Add cygperl*.dll to packlist
    From: "Jerry D. Hedden" <jdhedden@cpan.org>
    Message-ID: <1ff86f510808250747s1e0c42demb2d4ac8dc5d33925@mail.gmail.com>
    
    p4raw-id: //depot/perl@34226
    
    (cherry picked from commit 2a21c44486d05ca8bdd9ae5994c23a5fdc81d55f)

M	installperl

commit 78c8eff51957fbb4f17f43a5bee7ab1835c83bd0
Author: Reini Urban <rurban@x-ray.at>
Date:   Sun Aug 24 12:47:23 2008 +0200

    Re: Fix 34200 on Cygwin
    Message-ID: <48B1201B.3080705@x-ray.at>
    
    p4raw-id: //depot/perl@34219
    
    (cherry picked from commit b5920ff0f6b65443a39b58d7cf4cd21351bedd92)

M	installperl
M	lib/ExtUtils/CBuilder/Platform/cygwin.pm
M	lib/ExtUtils/t/Embed.t

commit 54ec72d6d5cf78a54c84b41cdcd72bdd2a0370c9
Author: Reini Urban <rurban@x-ray.at>
Date:   Mon Jul 28 14:55:40 2008 +0200

    Cygwin build harmonization, remove cygwin/Makefile.SHs
    From: "Reini Urban" <rurban@x-ray.at>
    Message-ID: <6910a60807280355g129511d9v61c9763c3fd12a27@mail.gmail.com>
    
    p4raw-id: //depot/perl@34218
    
    cherry-picked from 56e771c1bc71c994cd5a877d8b2eadd47e254ff8

M	Configure

commit a7d53ce290526ba26db5de06199dfd5beea427ea
Author: Reini Urban <rurban@x-ray.at>
Date:   Mon Jul 28 14:55:40 2008 +0200

    Cygwin build harmonization, remove cygwin/Makefile.SHs
    From: "Reini Urban" <rurban@x-ray.at>
    Message-ID: <6910a60807280355g129511d9v61c9763c3fd12a27@mail.gmail.com>
    
    p4raw-id: //depot/perl@34200
    
    (cherry-picked from 5f9145a3c5d730d3a29901fe5c70a26f92663207)

M	MANIFEST
M	Makefile.SH
D	cygwin/Makefile.SHs
M	installperl
M	lib/ExtUtils/CBuilder/Platform/cygwin.pm
M	lib/ExtUtils/t/Embed.t
-----------------------------------------------------------------------

Summary of changes:
 Configure                                |   17 ++-
 MANIFEST                                 |    1 -
 Makefile.SH                              |   29 +++---
 cygwin/Makefile.SHs                      |  170 ------------------------------
 installperl                              |   28 ++++-
 lib/ExtUtils/CBuilder/Platform/cygwin.pm |    8 +-
 lib/ExtUtils/t/Embed.t                   |    8 +-
 7 files changed, 56 insertions(+), 205 deletions(-)
 delete mode 100644 cygwin/Makefile.SHs

diff --git a/Configure b/Configure
index d13f03d..6e5e74c 100755
--- a/Configure
+++ b/Configure
@@ -25,7 +25,7 @@
 
 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
 #
-# Generated on Tue Jul  8 22:01:30 CEST 2008 [metaconfig 3.5 PL0]
+# Generated on Fri Aug 22 17:08:28 CEST 2008 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -8153,9 +8153,9 @@ true)
 		# a version-specific architecture-dependent library, the version
 		# number isn't really that important, except for making cc/ld happy.
 		#
-		# A name such as libperl.so.3.1
+		# A name such as libperl.so.10.1
 		majmin="libperl.$so.$patchlevel.$subversion"
-		# A name such as libperl.so.301
+		# A name such as libperl.so.100
 		majonly=`echo $patchlevel $subversion |
 			$awk '{printf "%d%02d", $1, $2}'`
 		majonly=libperl.$so.$majonly
@@ -8169,8 +8169,12 @@ true)
 		linux*|gnu*)  # ld won't link with a bare -lperl otherwise.
 			dflt=libperl.$so
 			;;
-		cygwin*) # ld links against an importlib
-			dflt=libperl$lib_ext
+		cygwin*) # ld links now against the dll directly
+			majmin="cygperl5_${patchlevel}_${subversion}.${so}"
+			majonly=`echo $patchlevel $subversion |
+				$awk '{printf "%03d%03d", $1, $2}'`
+			majonly=cygperl5.$majonly.$so
+			dflt=$majmin
 			;;
 		*)	# Try to guess based on whether libc has major.minor.
 			case "$libc" in
@@ -8266,6 +8270,9 @@ if "$useshrplib"; then
 		# hpux doesn't like the default, either.
 		tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
 		;;
+	cygwin)
+		# cygwin needs only ldlibpth
+		;;
 	*)
 		tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
 		;;
diff --git a/MANIFEST b/MANIFEST
index 3d6fa8d..41a2ea2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -42,7 +42,6 @@ Cross/TODO		Cross-compilation
 Cross/warp		Cross-compilation
 cv.h			Code value header
 cygwin/cygwin.c		Additional code for Cygwin port
-cygwin/Makefile.SHs	Shared library generation for Cygwin port
 deb.c			Debugging routines
 djgpp/config.over	DOS/DJGPP port
 djgpp/configure.bat	DOS/DJGPP port
diff --git a/Makefile.SH b/Makefile.SH
index c45d143..31c9d8c 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -80,7 +80,8 @@ true)
 			     -install_name \$(shrpdir)/\$@"
 		;;
 	cygwin*)
-		linklibperl="-lperl"
+		shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
+		linklibperl="-L. -lperl"
 		;;
 	sunos*)
 		linklibperl="-lperl"
@@ -581,19 +582,9 @@ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
 perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
 	sh writemain $(DYNALOADER) $(static_ext) > perlmain.c
 
-!NO!SUBS!
-case "$osname" in
-cygwin)
-	;; # Let cygwin/Makefile.SHs do its work.
-*)
-	$spitshell >>Makefile <<'!NO!SUBS!'
 perlmain$(OBJ_EXT): perlmain.c
 	$(CCCMD) $(PLDLFLAGS) $*.c
 
-!NO!SUBS!
-	;;
-esac
-$spitshell >>Makefile <<'!NO!SUBS!'
 # The file ext.libs is a list of libraries that must be linked in
 # for static extensions, e.g. -lm -lgdbm, etc.  The individual
 # static extension Makefile's add to it.
@@ -668,9 +659,22 @@ perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
 # XXX for 5.10.x, if merging #34200, s/Makefile/\$Makefile/ in the
 # chunk that goes below (dropped from #34306)
 	;;
+cygwin)
+	$spitshell >>Makefile <<'!NO!SUBS!'
+cygwin.c: cygwin/cygwin.c
+	$(LNS) cygwin/cygwin.c
+
+LIBPERL_NONSHR		= libperl$(LIB_EXT)
+
+$(LIBPERL_NONSHR): $(obj)
+	$(RMS) $(LIBPERL_NONSHR)
+	$(AR) rcu $(LIBPERL_NONSHR) $(obj)
+
+!NO!SUBS!
+	;;
 esac
 
-if test -r $Makefile_s ; then
+if test -s $Makefile_s ; then
 	. $Makefile_s
 	$spitshell >>$Makefile <<!GROK!THIS!
 
@@ -1250,7 +1254,6 @@ _cleaner2:
 	-rmdir lib/threads lib/XS
 	-rmdir lib/CPANPLUS/Dist/Build/t/dummy-*
 	-rmdir lib/CPANPLUS/t/dummy-cpanplus lib/CPANPLUS/t/dummy-localmirror
-	-rm -f cygcrypt-0.dll cygwin1.dll
 	-rm -f lib/ExtUtils/CBuilder/t/libcompilet.dll.a
 	-rm -f lib/ExtUtils/ParseXS/t/libXSTest.dll.a
 
diff --git a/cygwin/Makefile.SHs b/cygwin/Makefile.SHs
deleted file mode 100644
index 5fc13fd..0000000
--- a/cygwin/Makefile.SHs
+++ /dev/null
@@ -1,170 +0,0 @@
-# This file is read by Makefile.SH to produce rules for $(LIBPERL) (and
-# some additional rules as well).
-
-# Rerun `sh Makefile.SH; make depend' after making any change.
-
-# Additional rules supported: libperl.a (for static linking),
-# ld2 and perlld removed
-#
-
-#! /bin/sh
-case $PERL_CONFIG_SH in
-'')
-	if test -f config.sh; then TOP=.;
-	elif test -f ../config.sh; then TOP=..;
-	elif test -f ../../config.sh; then TOP=../..;
-	elif test -f ../../../config.sh; then TOP=../../..;
-	elif test -f ../../../../config.sh; then TOP=../../../..;
-	else
-		echo "Can't find config.sh."; exit 1
-	fi
-	. $TOP/config.sh
-	;;
-esac
-
-addtopath=`pwd | sed -e 's/ /\\\ /g'`
-$spitshell >>Makefile <<!GROK!THIS!
-
-cygwin.c: cygwin/cygwin.c
-	\$(LNS) cygwin/cygwin.c
-
-!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,``echo $vers|sed -e s,_[0-9]$,,`
-# append "d" suffix to -DDEBUGGING build: cygperl5_10d.dll
-case $config_args in
-  *DEBUGGING*)
-      dllname="${dllname}"d
-      ;;
-esac
-
-$spitshell >>Makefile <<!GROK!THIS!
-LIBPERL = $libperl
-LLIBPERL= $linklibperl
-DLLNAME= $dllname
-CLDFLAGS= -L$addtopath $ldflags
-LDDLFLAGS = --shared -L$addtopath $ldflags
-PLDLFLAGS = 
-CAT = $cat
-AWK = $awk
-!GROK!THIS!
-
-case "$useshrplib" in
-true)
-	$spitshell >>Makefile <<'!NO!SUBS!'
-cwobj = $(obj)
-
-# override default rule (NB: make croaks!) to force dll usage
-perlmain$(OBJ_EXT): perlmain.c
-	$(CCCMD) $(PLDLFLAGS) -DUSEIMPORTLIB $*.c
-
-# library used to make statically linked executables
-# miniperl is linked against it to avoid libperl.dll locking
-$(LIBPERL)$(LIB_EXT): $& $(cwobj)
-	$(AR) rcu $@ $(cwobj)
-
-# dll and import library
-$(LIBPERL).dll$(LIB_EXT): $& $(cwobj)
-	$(LDLIBPTH) $(CC) $(SHRPLDFLAGS) -o $(DLLNAME)$(DLSUFFIX) -Wl,--out-implib=$@ \
-	$(cwobj) $(libs)
-
-# How to build executables.
-
-# The miniperl -w -MExporter line is a basic cheap test to catch errors
-# before make goes on to run preplibrary and then MakeMaker on extensions.
-# This is very handy because later errors are often caused by miniperl
-# build problems but that's not obvious to the novice.
-# The Module used here must not depend on Config or any extensions.
-
-miniperl.exe \
-miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
-	$(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(libs)
-	$(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
-
-perl.exe \
-perl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-!NO!SUBS!
-	;;
-*)
-$spitshell >>Makefile <<'!NO!SUBS!'
-cwobj = $(obj)
-
-# perl library
-$(LIBPERL)$(LIB_EXT): $& $(cwobj)
-	$(AR) rcu $@ $(cwobj)
-
-# How to build executables.
-
-# The miniperl -w -MExporter line is a basic cheap test to catch errors
-# before make goes on to run preplibrary and then MakeMaker on extensions.
-# This is very handy because later errors are often caused by miniperl
-# build problems but that's not obvious to the novice.
-# The Module used here must not depend on Config or any extensions.
-
-miniperl.exe \
-miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
-	$(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
-	$(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
-
-perl.exe \
-perl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) -Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic `cat ext.libs` $(libs)
-
-pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
-	$(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
-
-!NO!SUBS!
-	;;
-esac
-
-# libperl.a is _the_ library both in dll and static cases
-# $(LIBPERL)$(LIB_EXT) expands to this name dependless of build model
-#
-# NOTE: The "-Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic" is required to give
-# the import library linking priority over the dynamic library, since both
-# the .dll and .a are in the same directory.  When the new standard for
-# naming import/dynamic/static libraries emerges this should be updated.
-#
-$spitshell >>Makefile <<'!NO!SUBS!'
-
-
-!NO!SUBS!
-
-# suid perl is removed - i've never seen suid scripts for win32
-
-##############################################
-# additional targets
-
-$spitshell >>Makefile <<'!NO!SUBS!'
-
-DIST_DIRECTORY = .dist
-
-distdir: miniperl
-	-mkdir $(DIST_DIRECTORY)
-	./miniperl -Ilib '-MExtUtils::Manifest' \
-	-e "ExtUtils::Manifest::manicopy(ExtUtils::Manifest::maniread(),'$(DIST_DIRECTORY)')"
-
-test_prep: 
-
-!NO!SUBS!
diff --git a/installperl b/installperl
index ab21fb5..da8f45e 100755
--- a/installperl
+++ b/installperl
@@ -263,11 +263,8 @@ if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin) {
 
     if ($Is_Cygwin) {
 	$perldll = $libperl;
-	my $v_e_r_s = substr($ver,0,-2); $v_e_r_s =~ tr/./_/;
-	$perldll =~ s/(\..*)?$/$v_e_r_s.$dlext/;
-	$perldll =~ s/^lib/cyg/;
     } else {
-	$perldll = 'perl510.' . $dlext;
+	$perldll = 'perl5'.$Config{patchlevel}.'.'.$dlext;
     }
 
     if ($dlsrc ne "dl_none.xs") {
@@ -348,7 +345,7 @@ if ($d_dosuid) {
 # Install library files.
 
 my ($do_installarchlib, $do_installprivlib) = (0, 0);
-my $vershort = $Is_Cygwin ? substr($ver,0,-2) : $ver;
+my $vershort = ($Is_Cygwin and !$Config{usedevel}) ? substr($ver,0,-2) : $ver;
 
 mkpath($installprivlib, $opts{verbose}, 0777);
 mkpath($installarchlib, $opts{verbose}, 0777);
@@ -377,7 +374,26 @@ if ($Is_VMS) {  # We did core file selection during build
     $coredir =~ tr/./_/;
     map { s|^$coredir/||i; } @corefiles = <$coredir/*.*>;
 }
-else {
+elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy
+    @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
+    my $coredll = "$installarchlib/CORE/$libperl";
+    safe_unlink($coredll);
+    ( $Config{'d_link'} eq 'define' &&
+      eval {
+          CORE::link("$installbin/$libperl", $coredll);
+          $packlist->{$coredll} = { from => "$installbin/$libperl",
+                                    type => 'link' };
+      }
+    ) ||
+    eval {
+        symlink("$installbin/$libperl", $coredll);
+        $packlist->{$coredll} = { from => "$installbin/$libperl",
+                                  type => 'link' };
+    } ||
+    ( copy("$installbin/$libperl", $coredll) &&
+      push(@corefiles, $coredll)
+    )
+} else {
     # [als] hard-coded 'libperl' name... not good!
     @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
 
diff --git a/lib/ExtUtils/CBuilder/Platform/cygwin.pm b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
index f37edab..9df4b7e 100644
--- a/lib/ExtUtils/CBuilder/Platform/cygwin.pm
+++ b/lib/ExtUtils/CBuilder/Platform/cygwin.pm
@@ -10,17 +10,15 @@ $VERSION = '0.24';
 
 sub link_executable {
   my $self = shift;
-  # $Config{ld} is set up as a special script for building
-  # perl-linkable libraries.  We don't want that here.
-  local $self->{config}{ld} = 'gcc';
+  # $Config{ld} is okay. revert the stupid Unix cc=ld override
+  local $self->{config}{cc} = $self->{config}{ld};
   return $self->SUPER::link_executable(@_);
 }
 
 sub link {
   my ($self, %args) = @_;
-
   $args{extra_linker_flags} = [
-    File::Spec->catdir($self->perl_inc(), 'libperl.dll.a'),
+    $self->perl_inc().'/'.($self->{config}{useshrplib} ? 'libperl.dll.a' : 'libperl.a'),
     $self->split_like_shell($args{extra_linker_flags})
   ];
 
diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t
index 79f6dbc..2aece54 100644
--- a/lib/ExtUtils/t/Embed.t
+++ b/lib/ExtUtils/t/Embed.t
@@ -105,10 +105,8 @@ if ($^O eq 'VMS') {
         s!-bE:(\S+)!-bE:$perl_exp!;
     }
    }
-   elsif ($^O eq 'cygwin') { # Cygwin needs the shared libperl copied
-     my $v_e_r_s = substr($Config{version},0,-2);
-     $v_e_r_s =~ tr/./_/;
-     system("cp ../cygperl$v_e_r_s.dll ./");    # for test 1
+   elsif ($^O eq 'cygwin') { # Cygwin needs no special treatment like below
+       ;
    }
    elsif ($Config{'libperl'} !~ /\Alibperl\./) {
      # Everyone needs libperl copied if it's not found by '-lperl'.
@@ -137,7 +135,7 @@ print "# $_\n" foreach @out;
 
 if ($^O eq 'VMS' && !$status) {
   print "# @cmd2\n";
-  $status = system(join(' ',@cmd2)); 
+  $status = system(join(' ',@cmd2));
 }
 print (($status? 'not ': '')."ok 1\n");
 

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About