dll_post="`echo $perl_fullversion | sum | sed -e 's/^0*//' | awk '{print $1}'`"
dll_post="`printf '%x' $dll_post | tr '[a-z]' '[A-Z]'`"
+aout_extra_libs=''
+aout_extra_sep=''
+for xxx in $aout_extra_static_ext; do
+ aout_extra_dir=`echo "$xxx" | sed -e 's/::/\//g'`
+ aout_extra_lib="lib/auto/$aout_extra_dir/"`basename "$aout_extra_dir"`
+ aout_extra_libs="$aout_extra_libs$aout_extra_sep$aout_extra_lib$aout_lib_ext"
+ aout_extra_sep=' '
+done
+
$spitshell >>Makefile <<!GROK!THIS!
PERL_FULLVERSION = $perl_fullversion
AOUT_CCCMD_DLL = \$(CC) -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK
AOUT_CLDFLAGS_DLL = -Zexe -Zmt -Zcrtdll -Zstack 32000
-LD_OPT = $optimize
+LD_OPT = \$(OPTIMIZE)
PERL_DLL_BASE = perl$dll_post
PERL_DLL = \$(PERL_DLL_BASE)\$(DLSUFFIX)
TEST_PERL_DLL = perl_dll_t
CONFIG_ARGS = $config_args
+AOUT_EXTRA_LIBS = $aout_extra_libs
!GROK!THIS!
$(SHRPENV) $(CC) $(SYS_CLDFLAGS) $(CCDLFLAGS) -o perl_sys perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs)
installcmd :
- perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR)
- perl os2/perl2cmd.pl $(INSTALLCMDDIR)
+ @perl -e 'die qq{Give the option INSTALLCMDDIR=... to make!} if $$ARGV[0] eq ""' $(INSTALLCMDDIR)
+ ./miniperl -Ilib os2/perl2cmd.pl $(INSTALLCMDDIR)
# Aout section:
aout_obj = $(addsuffix $(AOUT_OBJ_EXT),$(basename $(obj)))
AOUT_DYNALOADER = $(addsuffix $(AOUT_LIB_EXT),$(basename $(DYNALOADER)))
-aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(dynamic_ext)))
-aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(dynamic_ext)))
+aout_ext = $(dynamic_ext) $(AOUT_EXTRA_LIBS)
+aout_static_ext = $(addsuffix $(AOUT_LIB_EXT),$(basename $(aout_ext)))
+aout_static_lib = $(addsuffix $(LIB_EXT),$(basename $(aout_ext)))
aout_static_ext_dll = $(addsuffix $(AOUT_LIB_EXT),$(basename $(static_ext)))
DYNALOADER_OBJ = ext/DynaLoader/DynaLoader$(OBJ_EXT)
!NO!SUBS!
-# Now we need to find directories in ./ext/ which are two level deep
+# Now we need to find directories in ./ext/ which are up to 3 level deep
+# Currently (2001/06) there is no directories 4 levels deep.
+# (Only directories so that there is no Makefile.PL some levels up matter.)
dirs=''
+ddirs=''
preci='ext/%/Makefile.aout '
for d in ext/*
do
- # echo "Checking '$d'..."
- f="`echo $d/*/Makefile.PL`"
- # SDBFile/sdbm, skip kid makefile
- if test ! -e "$d/Makefile.PL" -a ! "$f" = ""; then
- dirs="$dirs $d"
- preci="$preci $d/%/Makefile.aout"
+ # echo "...Checking '$d'..."
+ # skip the kid if the parent exists: cmp SDBFile/sdbm, done by MakeMaker
+ if test ! -e "$d/Makefile.PL"; then
+ # Need to treat subdirectories manually
+ # echo "...Checking subdirs of '$d'..."
+ d_treated=''
+ for dd in $d/*
+ do
+ if test ! -d $dd; then
+ continue
+ fi
+ if test -e "$dd/Makefile.PL"; then
+ if test "X$d_treated" = "X"; then
+ d_treated=1
+ # echo "...Found parentless 2-level deep Makefile.PL's in $d/*/:" $d/*/Makefile.PL
+ dirs="$dirs $d"
+ preci="$preci $d/%/Makefile.aout"
+ fi
+ else
+ # Need to treat subsubdirectories manually
+ dd_treated=''
+ for ddd in $dd/*
+ do
+ if test ! -d $ddd; then
+ continue
+ fi
+ if test -e "$ddd/Makefile.PL"; then
+ if test "X$dd_treated" = "X"; then
+ dd_treated=1
+ # echo "...Found parentless 3-level deep Makefile.PL's in $dd/*/:" $dd/*/Makefile.PL
+ ddirs="$ddirs $dd"
+ preci="$preci $dd/%/Makefile.aout"
+ fi
+ fi
+ done
+ fi
+ done
fi
done
!GROK!THIS!
+for d in $ddirs
+do
+ # Remove the leading component ext/
+ dd=`dirname $d`
+ pp=`basename $dd`
+ p=$pp/`basename $d`
+ $spitshell >>Makefile <<!GROK!THIS!
+lib/auto/$p/*/%.a : $d/%/Makefile.aout
+ @cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..."
+ cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
+
+$d/%/Makefile.aout : miniperl_
+ cd \$(dir \$@) ; ../../../../miniperl_ -I ../../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl
+
+!GROK!THIS!
+
+done
+
for d in $dirs
do
p=`basename $d`
$spitshell >>Makefile <<!GROK!THIS!
-lib/auto/$p/*/%.a : ext/$p/%/Makefile.aout
- @cd ext/$p/\$(basename \$(notdir \$@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..."
- cd ext/$p/\$(basename \$(notdir \$@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
+lib/auto/$p/*/%.a : $d/%/Makefile.aout
+ @cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout config || echo "\$(MAKE) config failed, continuing anyway..."
+ cd $d/\$(basename \$(notdir \$@)) ; make -f Makefile.aout LINKTYPE=static CCCDLFLAGS=
$d/%/Makefile.aout : miniperl_
cd \$(dir \$@) ; ../../../miniperl_ -I ../../../lib Makefile.PL MAKEFILE=Makefile.aout INSTALLDIRS=perl