In perl.git, the branch smoke-me/Makefile-miniperl-unification has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/beccd652461b282e761982c74609fb71d8feb08c?hp=1530a57dfaff29c214be6c42259309d263abc973>

- Log -----------------------------------------------------------------
commit beccd652461b282e761982c74609fb71d8feb08c
Author: Nicholas Clark <[email protected]>
Date:   Mon Apr 30 09:34:38 2012 +0200

    In Makefile.SH, eliminate the MINIPERL_NONSHR target only used by AIX.
    
    The intent of the MINIPERL_NONSHR target was to provide a route to bootstrap
    building the shared libperl for AIX, solving the chicken & egg problem that
    (mini)perl is linked against the shared library, so the shared library must
    come first, but to build the shared library requires running a Perl script
    to generate the export list, hence miniperl comes first. However, the need
    for this special has long been superseded by events, so remove it and use
    the regular miniperl.
    
    Specifically, for 5.005 and earlier
    
    1) both miniperl and perl are small stubs with just the main() function,
       linked with the shared libperl
    2) on AIX the export list was generated by a shell script
    
    so no bootstrapping problem.
    
    However, the export list had to be manually updated in the shell script, so
    with commit 549a6b102c2ac8c4 in Jul 1999, the Win32 solution was generalised
    to work on both AIX and Win32. This uses Perl script, makedef.pl to
    parse various files and generate the current export list automatically.
    This introduces a bootstrapping problem - miniperl is needed to generate
    libperl.a, but libperl.a is needed to generate miniperl. This commit solves
    the problem by introducing a new target, MINIPERL_NONSHR, which builds a
    special staticly-linked miniperl (named miniperl_nonshr) in order to run
    makedef.pl, which in turn permits libperl.a and the regular miniperl to be
    built, and the build to proceed.
    
    All was well until commits 52bb0670c0d245e3 and 8d55947163edbb9f (Dec 1999)
    changed the default for CORE::glob() to use the XS module File::Glob, and
    linked miniperl against an opmini.o, built from op.c but with compiler flags
    to use the old glob-via-csh code. The change made for AIX was to build
    *miniperl_nonshr* with the bootstrapping glob code, but leave the build of
    miniperl unchanged. This broke the build on AIX - miniperl would build just
    fine, but would fail to build any XS extensions, as the ExtUtils::MakeMaker
    code requires working globbing.
    
    The AIX build was fixed with commit 18c4b137c9980e71 (Feb 2000) by changing
    Makefile.SH so that AIX used the same rules to build miniperl as NeXT.
    The rules for NeXT generated miniperl from an explicit list of object files,
    instead of using libperl.a. The result of this change was that on AIX,
    miniperl was now identical to miniperl_noshr. Both correctly use the csh
    globbing code, but now neither require the shared libperl.a to work.
    
    This makes miniperl_noshr redundant. So eliminate it.
    
    Curiously, as a side effect of commit 908fcb8bef8cbab8 (Dec 2006) which
    moved DynaLoader.o into libperl.so, the default platform build rules for
    miniperl were changed to use an explicit list of object files, instead of
    C<-lperl>, which had the side effect of building miniperl non-shared.
    Hence all platforms now have a non-shared miniperl when building perl with
    a shared perl library.

M       Makefile.SH

commit 5e0b8f356431c5ccb6299e18a5f31df7cec20a84
Author: Nicholas Clark <[email protected]>
Date:   Fri Apr 27 22:20:10 2012 +0200

    Fix a dependency issue when building a shared libperl on AIX.
    
    AIX requires a list of exported symbols in the file perl.exp, which is
    generated by makedef.pl. For the non-shared libperl case, the macro
    PERLEXPORT is set to this, and $(PERLEXPORT) is a pre-requisite for building
    dynamic extensions. However, historically, when building a shared libperl,
    Makefile.SH was not setting PERLEXPORT, and instead setting LIBPERLEXPORT.
    However, there was no dependency on this macro for building dynamic
    extensions. Hence the build can fail if make chooses to build dynamic
    extensions before perl.exp
    
    The simplest fix seems to be to use the same name, PERLEXPORT, in both
    cases. PERLEXPORT isn't referenced anywhere in the Makefile other than as
    pre-requisite for dynamic extensions and the main perl binary.
    
    The use of LIBPERLEXPORT dates back to commit 549a6b102c2ac8c4 in Jul 1999,
    "Fixed AIX dynamic loading and AIX shared Perl library." It's surprising
    that this problem hasn't bitten anyone previously.

M       Makefile.SH

commit 5727d1bdefa186b731719f70282f016d60e534c9
Author: Nicholas Clark <[email protected]>
Date:   Fri Apr 27 17:56:34 2012 +0200

    No need to prefix the $(CC) invocation that links miniperl with $(LDLIBPTH).
    
    $(LDLIBPTH) is used to prefix the appropriate LD_LIBRARY_PATH=... before
    commands in the Makefile when perl is build with a shared perl library so
    that the uninstalled ./perl will be able to find it.
    
    Commit c4f23d77f4b3486a (in May 1998) added the code for LDLIBPTH, but
    also added it to the default command line used to invoke $(CC) to link
    miniperl. This command doesn't need to run ./perl, hence the use of
    $(LDLIBPTH) is superfluous here. Removing it makes the code simpler.

M       Makefile.SH
-----------------------------------------------------------------------

Summary of changes:
 Makefile.SH |   39 ++++-----------------------------------
 1 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/Makefile.SH b/Makefile.SH
index ba5ab79..713f5c2 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -27,7 +27,6 @@ case "$0" in
 esac
 
 linklibperl='$(LIBPERL)'
-linklibperl_nonshr=''
 shrpldflags='$(LDDLFLAGS)'
 ldlibpth=''
 DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
@@ -86,7 +85,6 @@ true)
                        esac
                        shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
                        linklibperl="-L $archlibexp/CORE -L `pwd | sed 
's/\/UU$//'` -lperl"
-                       linklibperl_nonshr='-lperl_nonshr'
                        ;;
                *)
                        shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
@@ -98,7 +96,6 @@ true)
                        esac
                        shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
                        linklibperl="-L $archlibexp/CORE -L `pwd | sed 
's/\/UU$//'` -lperl"
-                       linklibperl_nonshr='-lperl_nonshr'
                        ;;
                esac
                ;;
@@ -277,7 +274,6 @@ DLSUFFIX = .$dlext
 PLDLFLAGS = $pldlflags
 LIBPERL = $libperl
 LLIBPERL= $linklibperl
-LLIBPERL_NONSHR= $linklibperl_nonshr
 SHRPENV = $shrpenv
 
 # Static targets are ordinarily built without CCCDLFLAGS.  However,
@@ -694,38 +690,11 @@ LIBS                      = $perllibs
 CCDLFLAGS              = `echo $ccdlflags|sed -e 
's@-bE:.*/perl\.exp@-bE:perl.exp@'`
 
 !GROK!THIS!
-       case "$useshrplib" in
-       define|true|[yY]*)
-               $spitshell >>$Makefile <<'!NO!SUBS!'
-
-LIBPERL_NONSHR         = libperl_nonshr$(LIB_EXT)
-MINIPERL_NONSHR                = miniperl_nonshr$(EXE_EXT)
-
-$(LIBPERL_NONSHR): $(obj)
-       $(RMS) $(LIBPERL_NONSHR)
-       $(AR) rcu $(LIBPERL_NONSHR) $(obj)
-
-$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)  
perlmini$(OBJ_EXT)
-       $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
-           opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
-
-MINIPERLEXP            = $(MINIPERL_NONSHR)
-
-LIBPERLEXPORT          = perl.exp
-
-!NO!SUBS!
-               
-               ;;
-       *)      
-               $spitshell >>$Makefile <<'!NO!SUBS!'
+       $spitshell >>$Makefile <<'!NO!SUBS!'
 MINIPERLEXP            = $(MINIPERL_EXE)
 
 PERLEXPORT             = perl.exp
 
-!NO!SUBS!
-       ;;
-       esac
-       $spitshell >>$Makefile <<'!NO!SUBS!'
 perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
        ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix 
CC_FLAGS="$(OPTIMIZE)" > perl.exp
 
@@ -789,7 +758,7 @@ $(MINIDTRACE_O): perldtrace.d $(minindt_obj) 
perlmini$(OBJ_EXT)
                ;;
     esac
        $spitshell >>$Makefile <<'!NO!SUBS!'
-$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
+$(LIBPERL): $& $(obj) $(DYNALOADER) $(PERLEXPORT)
 !NO!SUBS!
        case "$useshrplib" in
        true)
@@ -869,7 +838,7 @@ $(MINIPERL_EXE): $& $(mini_obj)
                $spitshell >>$Makefile <<'!NO!SUBS!'
 $(MINIPERL_EXE): $& $(mini_obj)
        -@rm -f miniperl.xok
-       $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+       $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
            $(mini_obj) $(libs)
        $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e 
'<?>' || $(MAKE) minitest
 !NO!SUBS!
@@ -1299,7 +1268,7 @@ _cleaner2:
        rm -f core *perl.core t/core t/*perl.core core.* t/core.*
        rm -f t/$(PERL_EXE) t/rantests
        rm -rf t/tmp*
-       rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
+       rm -f so_locations $(LIBPERL_NONSHR)
        rm -rf $(addedbyconf)
        rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
        rm -f $(private)

--
Perl5 Master Repository

Reply via email to