Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / Makefile.SH
index 267a533..6c6fcc4 100644 (file)
@@ -29,29 +29,20 @@ ldlibpth=''
 case "$useshrplib" in
 true)
        # Prefix all runs of 'miniperl' and 'perl' with 
-       # $ldlibpth so that ./perl finds *this* libperl.so.
+       # $ldlibpth so that ./perl finds *this* shared libperl.
        ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH"
 
        pldlflags="$cccdlflags"
-       # NeXT-4 specific stuff.  Can't we do this in the hint file?
        case "${osname}${osvers}" in
        next4*)
                ld=libtool
                lddlflags="-dynamic -undefined warning -framework System \
                -compatibility_version 1 -current_version $patchlevel \
                -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
-               # NeXT uses a different name.
-               ldlibpth="DYLD_LIBRARY_PATH=`pwd`:$DYLD_LIBRARY_PATH"
                ;;
-       rhapsody*)
-               ldlibpth="DYLD_LIBRARY_PATH=`pwd`/Perl:$DYLD_LIBRARY_PATH"
-               ;;
-       cygwin*)        ldlibpth="PATH='`pwd`:$PATH'"
+       cygwin*)
                linklibperl="-lperl"
                ;;
-       os2*)   # OS/2 doesn't need anything special for LD_LIBRARY_PATH.
-               ldlibpth=''
-               ;;
        sunos*)
                linklibperl="-lperl"
                ;;
@@ -68,15 +59,27 @@ true)
                esac
                shrpldflags="$shrpldflags $ldflags $libs $cryptlib"
                linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
-               ldlibpth="LIBPATH=`pwd`:${LIBPATH}"
                ;;
        hpux*)
                linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
-               ldlibpth="SHLIB_PATH=`pwd`:${SHLIB_PATH}"
-               ;;
-       beos*)  ldlibpth="LIBRARY_PATH=`pwd`:$LIBRARY_PATH"
                ;;
        esac
+       case "$ldlibpthname" in
+       '') ;;
+       *)
+           case "$osname" in
+           os2)
+               ldlibpth=''
+               ;;
+           rhapsody)
+               eval "ldlibpth=\"$ldlibpthname=`pwd`/Perl:\$$ldlibpthname\""
+               ;;
+           *)
+               eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
+               ;;
+           esac
+           ;;
+        esac
        ;;
 *)     pldlflags=''
        ;;
@@ -152,7 +155,7 @@ LLIBPERL= $linklibperl
 SHRPENV = $shrpenv
 
 # The following is used to include the current directory in
-# LD_LIBRARY_PATH if you are building a shared libperl.so.
+# the dynamic loader path you are building a shared libperl.
 LDLIBPTH = $ldlibpth
 
 dynamic_ext = $dynamic_list
@@ -300,7 +303,7 @@ ext.libs: $(static_ext)
 # Load up custom Makefile.SH fragment for shared loading and executables:
 case "$osname" in
 cygwin*)
-       Makefile_s="cygwin32/Makefile.SHs"
+       Makefile_s="cygwin/Makefile.SHs"
        ;;
 *)
        Makefile_s="$osname/Makefile.SHs"
@@ -329,7 +332,7 @@ $(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
        $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
 
 $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT)
-       $(CC) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
+       $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
 
 MINIPERLEXP            = $(MINIPERL_NONSHR)
 
@@ -354,6 +357,16 @@ perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
 
 !NO!SUBS!
        ;;
+os2)
+       $spitshell >>Makefile <<'!NO!SUBS!'
+MINIPERLEXP            = miniperl
+
+perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
+       ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp
+       sh mv-if-diff perl.exp.tmp perl5.def
+
+!NO!SUBS!
+       ;;
 esac
 
 if test -r $Makefile_s ; then
@@ -500,7 +513,6 @@ install.html: all installhtml
 # normally shouldn't remake perly.[ch].
 
 run_byacc:     FORCE
-       @ echo 'Expect' 113 shift/reduce and 1 reduce/reduce conflict
        $(BYACC) -d perly.y
        chmod 664 perly.c
        sh $(shellflags) ./perly.fixer y.tab.c perly.c
@@ -609,7 +621,7 @@ _cleaner:
        -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
        $(LDLIBPTH) sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \
        done
-       rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1 so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
+       rm -f *.orig */*.orig *~ */*~ core core.perl.*.? core.miniperl.*.? perl.core miniperl.core t/core t/core.perl.*.? t/perl.core t/tmp???? t/c t/perl so_locations t/nonexistent1 $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
        rm -rf $(addedbyconf)
        rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
        rm -f $(private)