summaryrefslogtreecommitdiff
path: root/cygwin
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2007-08-14 10:51:50 +0200
committerAbhijit Menon-Sen <ams@wiw.org>2007-08-14 06:58:22 +0000
commit4f3b19ea9f1065e1d9d263b4c07fca1ba8f29276 (patch)
tree186a52607cc07837a9a13b6d574441b8b28aef57 /cygwin
parentefa159bc522e3471f3ab132c384ad0ce9d768b61 (diff)
downloadperl-4f3b19ea9f1065e1d9d263b4c07fca1ba8f29276.tar.gz
get rid of cygwin perlld and ld2
Message-Id: <46C15106.9080003@x-ray.at> p4raw-id: //depot/perl@31710
Diffstat (limited to 'cygwin')
-rw-r--r--cygwin/Makefile.SHs70
-rw-r--r--cygwin/ld2.in20
-rw-r--r--cygwin/perlld.in89
3 files changed, 11 insertions, 168 deletions
diff --git a/cygwin/Makefile.SHs b/cygwin/Makefile.SHs
index 186f2aa33a..4673d8ae1e 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 <<!GROK!THIS!
cygwin.c: cygwin/cygwin.c
\$(LNS) cygwin/cygwin.c
-# shell script feeding perlld to decent perl
-ld2: $& Makefile perlld ${src}/cygwin/ld2.in
- @echo "extracting ld2 (with variable substitutions)"
- @$sed s,@buildpath@,$addtopath,g <${src}/cygwin/ld2.in >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 <<!GROK!THIS!
-
-# perlld parameters
-#
-# these ones are mandatory
-VERSION = '$version'
-
-# following are optional.
-EXPORT_ALL = 1
-
-# if some of extensions are empty,
-# no corresponding output will be done.
-# most probably, you'd like to have an export library
-DEF_EXT = .def
-EXP_EXT = .exp
-
-perlld: $& Makefile ${src}/cygwin/perlld.in
- @echo "extracting perlld (with variable substitutions)"
- @$sed -e s,@CC@,\${CC}, -e s,@EXPORT_ALL@,\${EXPORT_ALL},g \\
- -e s,@DEF_EXT@,\${DEF_EXT},g -e s,@EXP_EXT@,\${EXP_EXT},g \\
- -e s,@LIB_EXT@,\${LIB_EXT},g -e s,@VERSION@,\${VERSION},g \\
- ${src}/cygwin/perlld.in >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 <<!GROK!THIS!
LIBPERL = $libperl
LLIBPERL= $linklibperl
+DLLNAME= $dllname
CLDFLAGS= -L$addtopath $ldflags
+LDDLFLAGS = --shared -L$addtopath $ldflags
+PLDLFLAGS =
CAT = $cat
AWK = $awk
!GROK!THIS!
@@ -104,8 +62,8 @@ $(LIBPERL)$(LIB_EXT): $& $(cwobj)
$(AR) rcu $@ $(cwobj)
# dll and import library
-$(LIBPERL).dll$(LIB_EXT): $& $(cwobj) ld2
- $(LDLIBPTH) ld2 $(SHRPLDFLAGS) -o $(LIBPERL)$(DLSUFFIX) \
+$(LIBPERL).dll$(LIB_EXT): $& $(cwobj)
+ $(LDLIBPTH) $(CC) $(SHRPLDFLAGS) -o $(DLLNAME)$(DLSUFFIX) -Wl,--out-implib=$@ \
$(cwobj) $(libs)
# How to build executables.
@@ -118,7 +76,7 @@ $(LIBPERL).dll$(LIB_EXT): $& $(cwobj) ld2
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) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(libs)
$(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(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 fb41257410..e69de29bb2 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 85dc2632d8..e69de29bb2 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;