# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #16820]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16820 >


The use of ar rcs to build a library and reconstruct the symbol table
is non-portable.  (Mac OS X, for example, doesn't support the
's' option to ar.)

A more portable -- but still Unix-specific -- approach is to run ar to
build the archive and then run ranlib.  For many many modern systems,
ranlib is not needed.  For those, the perl5 $Config{ranlib} entry ought to
be a simple ':' (i.e. a shell true command).

The following patch changes the main makefile to use ar and ranlib, just
as perl5 has successfully done for years.

diff -r -u parrot-orig/config/gen/makefiles/root.in 
parrot-andy/config/gen/makefiles/root.in
--- parrot-orig/config/gen/makefiles/root.in    Wed Aug 28 02:29:41 2002
+++ parrot-andy/config/gen/makefiles/root.in    Wed Aug 28 16:33:42 2002
@@ -3,7 +3,8 @@
 A = ${a}
 RM_F = ${rm_f}
 RM_RF = ${rm_rf}
-AR_CRS = ar crs
+AR_CR = ${ar} cr
+RANLIB = ${ranlib}
 LD = ${ld}
 LD_SHARED = ${ld_shared}
 LD_OUT = ${ld_out}
@@ -189,7 +190,8 @@
 
 # XXX Unix-only for now
 blib/lib/libparrot$(A) : blib/lib $(O_DIRS) $(O_FILES)
-       $(AR_CRS) $@ $(O_FILES)
+       $(AR_CR) $@ $(O_FILES)
+       $(RANLIB) $@ $(O_FILES)
 
 blib/lib/libparrot$(SO) : blib/lib $(O_DIRS) $(O_FILES)
        $(LD) $(LD_SHARED) $(LD_SHARED_FLAGS) $(LDFLAGS) 
$(LD_OUT)blib/lib/libparrot$(SO) $(O_FILES) $(C_LIBS)
diff -r -u parrot-orig/config/init/data.pl parrot-andy/config/init/data.pl
--- parrot-orig/config/init/data.pl     Tue Aug 27 01:03:31 2002
+++ parrot-andy/config/init/data.pl     Wed Aug 28 16:32:51 2002
@@ -49,6 +49,8 @@
     test_prog     => 'parrot',
     rm_f          => 'rm -f',
     rm_rf         => 'rm -rf',
+    ar            => $Config{ar},
+    ranlib        => $Config{ranlib},
     make          => $Config{make},
     make_set_make => $Config{make_set_make},
     

-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042



Reply via email to