$NetBSD: patch-ab,v 1.4 2003/07/07 21:57:50 jtb Exp $ --- config/Makefile.SH.orig +++ config/Makefile.SH @@ -60,10 +60,8 @@ OBJS="$OBJS $f\$(_O)" done OBJSGP='' -OBJSDGP='' for f in $gp $graph; do OBJSGP="$OBJSGP $f\$(_O)" - OBJSDGP="$OBJSDGP $f-dyn\$(_O)" done for f in $inline; do OBJS="$OBJS $f\$(_O)" @@ -90,7 +88,7 @@ X11) PLOTFILE=plotX.c PLOTCFLAGS=-I$Xincroot - PLOTLIBS="-L$X11 -lX11 $extralib" + PLOTLIBS="-Wl,-R$X11 -L$X11 -lX11 $extralib" if test "$osname" = concentrix; then PLOTLIBS="-lX11"; fi plotrunpath=$X11 ;; @@ -108,27 +106,14 @@ RUNPTH="$runpathprefix $TOP/$objdir:$tmp";; esac -if test -z "$DLLD"; then - exec="gp-sta"; static=y -else - exec="gp-sta gp-dyn" -fi doexec="env \"LD_LIBRARY_PATH=.;\$\$LD_LIBRARY_PATH\" $src/test/dotest $sizeof_long" case "$sizeof_long" in 4) numbits=32;; 8) numbits=64;; esac -if test -z "$emacs"; then - install_emacs_files= - pari_elc= -else - install_emacs_files=install_emacs_files - pari_elc=$emx/pari.elc -fi -case "$static" in - n) dft=dyn; libdft=lib-dyn;; - y) dft=sta; libdft= ;; -esac + +install_emacs_files=install_emacs_files +pari_elc= cat > $file << EOT # Makefile for Pari/GP -- $pretty @@ -142,33 +127,22 @@ ASFLAGS = $ASFLAGS AR = ar -CC = $CC +CC = \$(LIBTOOL) --mode=compile $CC CPPFLAGS = -I. -I$src/headers CFLAGS = $cflags -LD = $LD +LD = \$(LIBTOOL) --mode=link $CC LDFLAGS = $LDFLAGS -DLLD = $DLLD -DLLDFLAGS = $DLLDFLAGS EXTRADLLDFLAGS = $EXTRADLLDFLAGS CPP = $CPP -_O = .o -_A = .a +_O = .lo +_A = .la LIB_PREFIX = lib -LIBPARI = \$(LIB_PREFIX)$libpari_base -LIBPARI_STA= \$(LIBPARI)\$(_A) -LIBPARI_SO = \$(LIBPARI).$DLSUFFIX -LIBPARI_DYN = \$(LIBPARI_SO).$sodest -LIBPARI_SONAME= \$(LIBPARI_SO).$soname +LIBPARI = \$(LIB_PREFIX)$libpari_base\$(_A) RUNPTH = $RUNPTH RUNPTH_FINAL = $RUNPTH_FINAL -LDDYN = $LDDYN -DLCFLAGS = $DLCFLAGS LIBS = $LIBS -DYNLIBS = $DYNLIBS -DYNFLAGS = $DYNFLAGS -DYNRELOC = $DYNRELOC RM = rm -f MV = mv -f @@ -192,8 +166,10 @@ MISCDIR = \$(ALLDIR)/misc INSTALL = $cfg/install -INSTALL_PROGRAM = \$(INSTALL) -INSTALL_DATA = \$(INSTALL) -m 644 +INSTALL_PROGRAM = \$(BSD_INSTALL_PROGRAM) +INSTALL_SCRIPT = \$(BSD_INSTALL_SCRIPT) +INSTALL_DATA = \$(BSD_INSTALL_DATA) +INSTALL_MAN = \$(BSD_INSTALL_MAN) # Graphic library. PLOTFILE = $PLOTFILE @@ -223,26 +199,17 @@ OBJS = $OBJS OBJSGP = $OBJSGP -OBJSDGP = $OBJSDGP - -dft: gp $pari_elc - - -gp: gp-$dft ../gp$suffix$exe_suff $libdft - - +all: lib gp -../gp$suffix$exe_suff: gp-$dft - -\$(RM) \$@ - -\$(LN) $ln_objdir/gp-$dft$exe_suff \$@ +lib: \$(LIBPARI) -all: $exec lib-sta +\$(LIBPARI): \$(OBJS) + \$(LD) -o \$@ \$(OBJS) -rpath \$(LIBDIR) --version-info 0:0 -lib-sta: \$(LIBPARI_STA) -lib-dyn: \$(LIBPARI_DYN) - -\$(LIBPARI_STA): \$(OBJS) - -\$(RM) \$@ - \$(AR) r \$@ \$(OBJS) +gp: \$(OBJSGP) \$(LIBPARI) + \$(RM) \$@ + \$(LD) -o \$@ \$(LDFLAGS) \$(OBJSGP) \$(RUNPTH) \$(PLOTLIBS) \$(LIBS) \$(RLLIBS) \$(LIBPARI) kerntest\$(_O): ../src/test/kerntest.c \$(CC) -c \$(CFLAGS) -I$src/language \$(CPPFLAGS) -o \$@ \$< @@ -260,12 +227,6 @@ EOT fi -cat >> $file << EOT - -gp-sta: \$(OBJS) \$(OBJSGP) \$(GNUPLOT_OBJS) - \$(RM) \$@ - \$(LD) -o \$@ \$(LDFLAGS) \$(OBJS) \$(OBJSGP) \$(GNUPLOT_OBJS) \$(RUNPTH) \$(RLLIBS) \$(PLOTLIBS) \$(LIBS) -EOT cat >> $file << EOT @@ -284,14 +245,14 @@ @$doexec -g cleanobj: cleantest - -\$(RM) *\$(_O) *.s pariinl.h \$(LIBPARI_STA) libpari.* $exec + -\$(RM) *\$(_O) *.s pariinl.h \$(LIBPARI) libpari.* $exec clean: cleanobj .headers: $HEADERS @touch \$@ -install: install-lib-$dft install-include install-bin install-man install-misc install-data install-doc install-examples +install: install-lib install-include install-bin install-man install-misc install-data install-doc install-examples install-include: -mkdir -p \$(INCLUDEDIR) @@ -300,45 +261,33 @@ \$(INSTALL_DATA) \$\$i.h \$(INCLUDEDIR); done -for i in $hlist; do \\ \$(INSTALL_DATA) $src/headers/\$\$i.h \$(INCLUDEDIR); done - -\$(RM) \$(INCLUDEDIR)/genpari.h -\$(LN) pari.h \$(INCLUDEDIR)/genpari.h -install-bin: install-bin-$dft - -install-bin-dyn: gp-dyn +install-bin: gp -mkdir -p \$(BINDIR) - -\$(RM) \$(BINDIR)/gp-$version \$(BINDIR)/gp$exe_suff - -\$(LD) -o \$(BINDIR)/gp-$version \$(LDFLAGS) \$(OBJSGP) \$(RUNPTH_FINAL) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS) - -\$(STRIP) \$(STRIPFLAGS) \$(BINDIR)/gp-$version - -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff - -install-bin-sta: gp-sta - -mkdir -p \$(BINDIR) - -\$(RM) \$(BINDIR)/gp-$version \$(BINDIR)/gp$exe_suff - \$(INSTALL_PROGRAM) gp-sta$exe_suff \$(BINDIR)/gp-$version$exe_suff + \$(LIBTOOL) --mode=install \$(INSTALL_PROGRAM) gp$exe_suff \$(BINDIR)/gp-$version$exe_suff -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff # Can't strip it if we want install() to work on Linux or OSF. # \$(STRIP) \$(STRIPFLAGS) \$(BINDIR)/gp-$version install-man:: -mkdir -p \$(MANDIR) - \$(INSTALL_DATA) $doc/gphelp.1 \$(MANDIR) - \$(INSTALL_DATA) $doc/gp.1 \$(MANDIR) - -\$(RM) \$(MANDIR)/pari.1 + \$(INSTALL_MAN) $doc/gphelp.1 \$(MANDIR) + \$(INSTALL_MAN) $doc/gp.1 \$(MANDIR) -\$(LN) gp.1 \$(MANDIR)/pari.1 install-misc: $install_emacs_files install-top -mkdir -p \$(MISCDIR) \$(BINDIR) - \$(INSTALL_PROGRAM) $misc/tex2mail \$(BINDIR) - \$(INSTALL_DATA) $doc/tex2mail.1 \$(MANDIR) + \$(INSTALL_SCRIPT) $misc/tex2mail \$(BINDIR) + \$(INSTALL_MAN) $doc/tex2mail.1 \$(MANDIR) \$(INSTALL_DATA) $misc/README \$(MISCDIR) \$(INSTALL_DATA) $misc/color.dft \$(MISCDIR) \$(INSTALL_DATA) $misc/gpalias \$(MISCDIR) - \$(INSTALL_PROGRAM) $misc/gpflog \$(MISCDIR) + \$(INSTALL_SCRIPT) $misc/gpflog \$(MISCDIR) \$(INSTALL_DATA) $misc/gprc.dft \$(MISCDIR) \$(INSTALL_DATA) $misc/new.dic \$(MISCDIR) \$(INSTALL_DATA) $misc/pari.xpm \$(MISCDIR) - \$(INSTALL_PROGRAM) $misc/xgp \$(MISCDIR) + \$(INSTALL_SCRIPT) $misc/xgp \$(MISCDIR) install-top:: -mkdir -p \$(READMEDIR) @@ -356,7 +305,7 @@ install-doc:: -mkdir -p \$(BINDIR) \$(DOCDIR) -cd $doc; \$(MAKE) all - -\$(INSTALL_PROGRAM) $doc/gphelp \$(BINDIR) + -\$(INSTALL_SCRIPT) $doc/gphelp \$(BINDIR) -\$(INSTALL_DATA) $doc/Makefile \$(DOCDIR) -\$(INSTALL_DATA) $doc/translations \$(DOCDIR) -\$(INSTALL_DATA) $doc/appa.tex \$(DOCDIR) @@ -398,61 +347,11 @@ -mkdir -p \$(DATADIR) -for f in $data/*; do \$(INSTALL_DATA) \$\$f \$(DATADIR); done 2>/dev/null -install-lib-sta: \$(LIBPARI_STA) +install-lib: \$(LIBPARI) -mkdir -p \$(LIBDIR) - -\$(RM) \$(LIBDIR)/\$(LIBPARI_STA) - \$(INSTALL_DATA) \$(LIBPARI_STA) \$(LIBDIR)/\$(LIBPARI_STA).$version - -\$(LN) \$(LIBPARI_STA).$version \$(LIBDIR)/\$(LIBPARI_STA) + \$(LIBTOOL) --mode=install \$(INSTALL_DATA) \$(LIBPARI) \$(LIBDIR)/ -install-lib-dyn: \$(LIBPARI_DYN) - -mkdir -p \$(LIBDIR) - -\$(RM) \$(LIBDIR)/\$(LIBPARI_DYN) - \$(INSTALL_PROGRAM) \$(LIBPARI_DYN) \$(LIBDIR)/\$(LIBPARI_DYN) EOT -if test "$soname" != "$sodest"; then - cat >> $file << EOT - -\$(RM) \$(LIBDIR)/\$(LIBPARI_SONAME) - -\$(RM) \$(LIBDIR)/\$(LIBPARI_SO) - -\$(LN) \$(LIBPARI_DYN) \$(LIBDIR)/\$(LIBPARI_SONAME) - -\$(LN) \$(LIBPARI_DYN) \$(LIBDIR)/\$(LIBPARI_SO) - -EOT -fi - -if test -z "$DLLD"; then - cat >> $file << EOT - -\$(LIBPARI_DYN):: - @echo "Configure could not find a way to build a shared library on this machine." - -EOT -else - if test -z "$DYNLIBS"; then - cat >> $file << EOT -gp-dyn: \$(OBJSGP) \$(LIBPARI_DYN) \$(GNUPLOT_OBJS) - \$(RM) \$@ - \$(LD) -o \$@ \$(LDFLAGS) \$(OBJSGP) \$(GNUPLOT_OBJS) \$(RUNPTH) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS) - -\$(LIBPARI_DYN): \$(OBJS) - -\$(RM) \$(LIBPARI_DYN) - \$(DLLD) -o \$@ \$(DLLDFLAGS) \$(OBJS) \$(EXTRADLLDFLAGS) -EOT - if test "$soname" != "$sodest"; then - cat >> $file << EOT - -\$(RM) \$(LIBPARI_SONAME) - -\$(RM) \$(LIBPARI_SO) - -\$(LN) \$(LIBPARI_DYN) \$(LIBPARI_SONAME) - -\$(LN) \$(LIBPARI_DYN) \$(LIBPARI_SO) -EOT - fi - else - cat >> $file << EOT -gp-dyn: \$(OBJSDGP) \$(LIBPARI_DYN) - \$(RM) \$@ - \$(LD) -o \$@ \$(LDFLAGS) \$(OBJSDGP) \$(RUNPTH) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS) \$(DYNLIBS) -EOT - fi -fi if test -n "$GNUPLOT_OBJS"; then cat >> $file << EOT @@ -462,21 +361,14 @@ EOT fi -if test -n "$emacs"; then - cat >> $file << EOT -$pari_elc: $emx/pari.el - @echo "Byte-Compiling pari.el..." - -cd $emx; $emacs -batch -l compile - -$install_emacs_files: $pari_elc +cat >> $file << EOT +$install_emacs_files: -mkdir -p \$(EMACSDIR) - -\$(INSTALL_DATA) $pari_elc \$(EMACSDIR) \$(INSTALL_DATA) $emx/pari.el \$(EMACSDIR) \$(INSTALL_DATA) $emx/pariemacs.txt \$(EMACSDIR) \$(INSTALL_DATA) $emx/with-syntax.el \$(EMACSDIR) \$(INSTALL_DATA) $emx/pari-translator.el \$(EMACSDIR) EOT -fi if test -s $src_dir/kernel/$ASMARCH/Makefile.SH; then . $src_dir/kernel/$ASMARCH/Makefile.SH