# 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
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,``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
+# added -mms-bitfields to be able to link to MSVC win32 bitfields libs
+# (4 byte instead of 2 byte alignment)
$spitshell >>Makefile <<!GROK!THIS!
LIBPERL = $libperl
LLIBPERL= $linklibperl
+DLLNAME= $dllname
CLDFLAGS= -L$addtopath $ldflags
+LDDLFLAGS = --shared -L$addtopath $ldflags
+CCFLAGS=$ccflags -mms-bitfields
+PLDLFLAGS =
CAT = $cat
AWK = $awk
!GROK!THIS!
$(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.
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 \
./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!