summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorjtb <jtb@pkgsrc.org>2003-07-07 21:57:49 +0000
committerjtb <jtb@pkgsrc.org>2003-07-07 21:57:49 +0000
commitc05c722de7325e3c378b7c716dedae8d1d22457f (patch)
tree5f41dd68a75cd9d12dace58281a059ec4601f148 /math
parentf1f0d57d57de719908a0842bfb8c1539ecc2b152 (diff)
downloadpkgsrc-c05c722de7325e3c378b7c716dedae8d1d22457f.tar.gz
Update to pari-2.1.5.
pkgsrc changes: * Build a shared libpari using libtool * convert to buildlink2 Changes in Pari itself: * a long list of bugfixes -- see CHANGES.
Diffstat (limited to 'math')
-rw-r--r--math/pari/Makefile10
-rw-r--r--math/pari/PLIST8
-rw-r--r--math/pari/buildlink2.mk20
-rw-r--r--math/pari/distinfo24
-rw-r--r--math/pari/patches/patch-aa160
-rw-r--r--math/pari/patches/patch-ab283
-rw-r--r--math/pari/patches/patch-ae31
-rw-r--r--math/pari/patches/patch-af19
-rw-r--r--math/pari/patches/patch-ag28
-rw-r--r--math/pari/patches/patch-ah29
-rw-r--r--math/pari/patches/patch-ai38
-rw-r--r--math/pari/patches/patch-aj29
-rw-r--r--math/pari/patches/patch-ak24
-rw-r--r--math/pari/patches/patch-al52
-rw-r--r--math/pari/patches/patch-am102
-rw-r--r--math/pari/patches/patch-an19
-rw-r--r--math/pari/patches/patch-ao20
-rw-r--r--math/pari/patches/patch-ap22
-rw-r--r--math/pari/patches/patch-aq17
19 files changed, 829 insertions, 106 deletions
diff --git a/math/pari/Makefile b/math/pari/Makefile
index 97c6ca54518..5d1390a64bf 100644
--- a/math/pari/Makefile
+++ b/math/pari/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.12 2003/06/02 01:18:25 jschauma Exp $
+# $NetBSD: Makefile,v 1.13 2003/07/07 21:57:49 jtb Exp $
-DISTNAME= pari-2.1.1
-PKGREVISION= 1
+DISTNAME= pari-2.1.5
CATEGORIES= math
MASTER_SITES= ftp://www.gn-50uma.de/gn/gn-50uma.de/pari-2.1/ \
http://www.gn-50uma.de/ftp/pari-2.1/
@@ -11,9 +10,9 @@ HOMEPAGE= http://www.parigp-home.de
COMMENT= software package for computer-aided number theory
BUILD_DEPENDS+= teTeX-[0-9]*:../../print/teTeX
-BUILD_DEPENDS+= emacs-[0-9]*:../../editors/emacs
USE_BUILDLINK2= yes
+USE_LIBTOOL= yes
USE_X11= yes
USE_GNU_READLINE= # rl_save_prompt
@@ -24,8 +23,9 @@ CONFIGURE_ARGS+= --graphic=X11
CONFIGURE_ENV+= LOCALBASE=${LOCALBASE}
CONFIGURE_ENV+= X11BASE=${X11BASE}
+TEST_TARGET= test-compat bench
+
.include "../../devel/ncurses/buildlink2.mk"
.include "../../devel/readline/buildlink2.mk"
.include "../../lang/perl5/buildlink2.mk"
-
.include "../../mk/bsd.pkg.mk"
diff --git a/math/pari/PLIST b/math/pari/PLIST
index 83b3e3186df..05150f3edbb 100644
--- a/math/pari/PLIST
+++ b/math/pari/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2002/06/26 10:29:49 seb Exp $
+@comment $NetBSD: PLIST,v 1.4 2003/07/07 21:57:50 jtb Exp $
bin/gp
bin/gp-2.1
bin/gphelp
@@ -17,6 +17,10 @@ include/pari/paristio.h
include/pari/parisys.h
include/pari/paritype.h
lib/libpari.a
+lib/libpari.la
+lib/libpari.so
+lib/libpari.so.0
+lib/libpari.so.0.0
man/man1/gp.1
man/man1/gphelp.1
man/man1/pari.1
@@ -35,6 +39,7 @@ share/pari/doc/Makefile
share/pari/doc/appa.tex
share/pari/doc/appb.tex
share/pari/doc/appc.tex
+share/pari/doc/paricfg.tex
share/pari/doc/paricfg.tex.in
share/pari/doc/parimacro.tex
share/pari/doc/pdfmacs.tex
@@ -53,7 +58,6 @@ share/pari/doc/usersch4.tex
share/pari/doc/usersch5.tex
share/pari/emacs/pari-translator.el
share/pari/emacs/pari.el
-share/pari/emacs/pari.elc
share/pari/emacs/pariemacs.txt
share/pari/emacs/with-syntax.el
share/pari/examples/EXPLAIN
diff --git a/math/pari/buildlink2.mk b/math/pari/buildlink2.mk
new file mode 100644
index 00000000000..8eb08c69b9c
--- /dev/null
+++ b/math/pari/buildlink2.mk
@@ -0,0 +1,20 @@
+# $NetBSD: buildlink2.mk,v 1.1 2003/07/07 21:57:50 jtb Exp $
+
+.if !defined(PARI_BUILDLINK2_MK)
+PARI_BUILDLINK2_MK= # defined
+
+BUILDLINK_PACKAGES+= pari
+BUILDLINK_DEPENDS.pari?= pari>=2.1.5
+BUILDLINK_PKGSRCDIR.pari?= ../../math/pari
+BUILDLINK_DEPMETHOD.pari?= build
+
+EVAL_PREFIX+= BUILDLINK_PREFIX.pari=pari
+BUILDLINK_PREFIX.pari_DEFAULT= ${LOCALBASE}
+BUILDLINK_FILES.pari= include/pari/*
+BUILDLINK_FILES.pari+= lib/libpari.*
+
+BUILDLINK_TARGETS+= pari-buildlink
+
+pari-buildlink: _BUILDLINK_USE
+
+.endif # PARI_BUILDLINK2_MK
diff --git a/math/pari/distinfo b/math/pari/distinfo
index db09901d7e6..430521bb7c8 100644
--- a/math/pari/distinfo
+++ b/math/pari/distinfo
@@ -1,9 +1,21 @@
-$NetBSD: distinfo,v 1.8 2002/09/23 22:24:16 jlam Exp $
+$NetBSD: distinfo,v 1.9 2003/07/07 21:57:50 jtb Exp $
-SHA1 (pari-2.1.1.tar.gz) = 358e90e2caf1afbd4440e3a43af827feec019b8d
-Size (pari-2.1.1.tar.gz) = 1530823 bytes
-SHA1 (patch-aa) = e6f0e39f6d3fb18032626dcc6e497be2ff355992
-SHA1 (patch-ab) = 97951552f9b9836d0375fd41c7abd18a5ce90238
+SHA1 (pari-2.1.5.tar.gz) = fd9a969d2f6afbfd1ebf3293fb90df23f602a7fb
+Size (pari-2.1.5.tar.gz) = 1540679 bytes
+SHA1 (patch-aa) = acfeea76059cb4f22e315f0095d032dd9ff2bbf7
+SHA1 (patch-ab) = 60b0ba8f17aa8c07a1e57f61c6e0fa9e19892b57
SHA1 (patch-ac) = 84af235f319ae108aadeedea5a25e005540160ac
SHA1 (patch-ad) = 82c0532ba6bc23b1c91865591c2bdfbee144bcf9
-SHA1 (patch-ae) = 360d354635deb09be42be616be1900bb68c9a3c4
+SHA1 (patch-ae) = 0b8cd90077b3722c53175685e23915770d53b2b8
+SHA1 (patch-af) = e5be2dc087a5c6290ccbdbacc09bf8078abc11ba
+SHA1 (patch-ag) = 2d20a9d84c869ff9854b43e62cc4b716241e459b
+SHA1 (patch-ah) = a5517f6f83812de3a7e3c5f6842df12a40871951
+SHA1 (patch-ai) = 3e82dd6786bca74c0a1fa4bcff770216efa6d281
+SHA1 (patch-aj) = 46bb1f1d1f98e28070f5c75c90d94ec359f9683f
+SHA1 (patch-ak) = 62d2663b06cd709ac04e2b097687201826049e73
+SHA1 (patch-al) = 4ad12d0f0cf111ae7167a8ac211831d9d4d4f47d
+SHA1 (patch-am) = f37571baaf6b4ff3f805a5917f55a61324347842
+SHA1 (patch-an) = 881878c2903b4f1114b41349b103bb70574fcecb
+SHA1 (patch-ao) = d6f818278f2ef0599479d2a58efc412a9eedc779
+SHA1 (patch-ap) = 985c5c49efb52c04f53f098480f0de1209fa16ef
+SHA1 (patch-aq) = 43a6f7a4b74a2affbdffca7bf781009e3e1dece0
diff --git a/math/pari/patches/patch-aa b/math/pari/patches/patch-aa
index cc822d2b446..b46575e4db2 100644
--- a/math/pari/patches/patch-aa
+++ b/math/pari/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
+$NetBSD: patch-aa,v 1.8 2003/07/07 21:57:50 jtb Exp $
---- Configure.orig Fri Apr 27 09:51:44 2001
+--- Configure.orig
+++ Configure
-@@ -169,35 +169,9 @@
+@@ -187,35 +187,7 @@
pth="\
/bin\
/usr/bin\
@@ -26,8 +26,7 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
- /bsd43/bin\
- /opt/ansic/bin\
- /usr/ccs/bin\
-+ $LOCALBASE/bin\
- /usr/lib\
+- /usr/lib\
- /usr/ucblib\
- /lib\
- /usr/ccs/lib\
@@ -36,11 +35,11 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
- /usr/libexec\
- /usr/openwin/bin\
- /usr/local/bin\
-+ $LOCALBASE/lib\
++ $LOCALBASE/bin\
"
# /usr/openwin/bin added for xmkmf
-@@ -272,7 +246,7 @@
+@@ -290,7 +262,7 @@
==========================================================================
I know of the following Operating Systems
EOM
@@ -49,16 +48,56 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
. ./display
echo $n ..."Any of these apply ? $c"
dflt=$osname; . ./myread
-@@ -308,7 +282,7 @@
- # Modifications for pretty name and asm file
+@@ -302,20 +274,26 @@
+ # The asm file used (if any)
#
- case "$osname" in
-- cygwin*|linux|freebsd|os2) pretty="$pretty running $osname";;
-+ cygwin*|linux|freebsd|netbsd|os2) pretty="$pretty running $osname";;
- nextstep) pretty="$pretty running $osname";
- if test "$arch" = m68k; then asmarch=none; fi ;;
+ case "$arch" in
+- sparc) asmarch=sparcv8_micro; pretty=Sparc ;;
++ sparc) asmarch=sparcv8_micro; pretty=SPARC ;;
+ sparcv7) asmarch=$arch; pretty=SparcV7 ;;
+ sparcv8_micro) asmarch=$arch; pretty=MicroSparc ;;
+ sparcv8_super) asmarch=$arch; pretty=SuperSparc ;;
+ sparcv9) asmarch=sparcv8_micro; pretty=UltraSparc ;;
++ sparc64) asmarch=none; pretty=UltraSPARC ;;
+ m68k) asmarch=$arch; pretty="MC680x0, x>=2" ;;
+ i?86) asmarch=ix86 ; pretty=$arch ;;
+- hppa) asmarch=none ; pretty=HP
++ hppa) asmarch=none ; pretty=HPPA
+ case "$osname-`uname -r`" in
+ hpux-?.09.*) asmarch=none ;;
+ hpux-?.10.*) asmarch=$arch ;;
+ esac ;;
+ alpha) asmarch=$arch; pretty=Alpha ;;
+- mips) asmarch=none; pretty=Mips ;;
++ arm) asmarch=$arch; pretty=ARM ;;
++ mips) asmarch=none; pretty=MIPS ;;
++ powerpc) asmarch=none; pretty=PowerPC ;;
++ sh3) asmarch=none; pretty=SH-3 ;;
++ sh5) asmarch=none; pretty=SH-5 ;;
++ vax) asmarch=none; pretty=VAX ;;
+ fx2800) asmarch=none; pretty="Alliant FX/2800" ;;
+ none) asmarch=none; pretty="unknown" ;;
+ *) asmarch=none; pretty=$arch
+@@ -329,6 +307,9 @@
+ nextstep|cygwin*|linux|freebsd|os2)
+ pretty="$pretty running $osname";
+ if test "$arch" = m68k; then asmarch=none; fi ;;
++ netbsd)
++ pretty="$pretty running NetBSD";
++ if test "$arch" = m68k; then asmarch=none; fi ;;
esac
-@@ -362,7 +336,7 @@
+
+ if test "$kernel" = no; then
+@@ -351,7 +332,7 @@
+ fi
+ fi
+ case "$asmarch" in
+- none) prettyk="C portable";;
++ none) prettyk="portable C";;
+ sparcv7) prettyk=SparcV7;;
+ sparcv8_super) prettyk=SuperSparc;;
+ sparcv8_micro) prettyk=MicroSparc;;
+@@ -375,7 +356,7 @@
case "$osname-$arch" in
os2-*) ln_s=cp; make_sh=sh; exe_suff=.exe; extraflag="-Zexe" ;;
cygwin*) ln_s="ln -s"; make_sh="/bin/sh"; exe_suff=.exe; extraflag="" ;;
@@ -67,7 +106,7 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
esac
####################### CONFIGURE - LIBRARIES ###############################
-@@ -405,20 +379,8 @@
+@@ -418,20 +399,8 @@
fi;;
os2) libpth=`echo $LIBRARY_PATH | sed 's/;/ /g' | sed 's,\\\\,/,g'`;;
*) libpth="\
@@ -85,11 +124,29 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
- /usr/ccs/lib\
- /usc/ucblib\
- /usr/shlib\
-+ $LOCALBASE/lib\
++ $LOCALBASE/lib\
.\
";;
esac
-@@ -528,21 +490,11 @@
+@@ -518,17 +487,9 @@
+ # Readline -- TermCap
+ lib=$rl_fullname; sym=tgetent; . ./locatesymbol
+ if test -n "$try"; then # tgetent needed
+- lib=ncurses; . ./locatelib
+- if test -n "$try"; then # ncurses found. Does it contain tgetent ?
+- lib=$try; . ./locatesymbol
+- fi
+- if test -n "$try"; then
+- rl_ncurses=$ncurses
+- else
+ lib=termcap; . ./locatelib
+ rl_termcap=$termcap
+ fi
+- fi
+ # Readline -- Allocation
+ lib=$rl_fullname; sym=alloca; . ./locatesymbol
+ if test -n "$try"; then # alloca needed
+@@ -546,24 +507,15 @@
$cygtop/H-${arch}-cygwin32/${arch}-cygwin32/include\
";;
*) incpth="\
@@ -113,7 +170,11 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
CPPF_defined=
case $x in
?:/*|/*) rl_include=`echo $x | sed 's,/readline.h,,'`
-@@ -580,7 +532,7 @@
++ echo $x $rl_include
+ if (grep CPPFunction $x > /dev/null 2>&1); then CPPF_defined=yes; fi
+ if (grep rl_message $x > /dev/null 2>&1); then rl_message=yes; fi
+ if (grep rl_completion_matches $x > /dev/null 2>&1); then
+@@ -601,7 +553,7 @@
# in case headers are not installed correctly
RLINCLUDE="-I$rl_include -DREADLINE_LIBRARY"
fi
@@ -122,7 +183,7 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
if test -n "$rl_ncurses"; then
echo ..."Library ncurses needed by readline"
RLLIBS="$RLLIBS -lncurses"
-@@ -638,33 +590,7 @@
+@@ -662,33 +614,7 @@
# X11 -- Headers
if test ! -f $Xincroot/X11/Xos.h; then
x11pth="\
@@ -157,66 +218,39 @@ $NetBSD: patch-aa,v 1.7 2002/09/23 22:24:16 jlam Exp $
";
pth=`echo $x11pth | s,/lib,/include,g`
x=`./locate X11/Xos.h '' $pth`
-@@ -806,7 +732,7 @@
- if test -n "$__gnuc__"; then
- __GNUC__="-D__GNUC__"
- warn="-Wall -Wno-implicit"
-- OPTFLAGS="-O3 -DGCC_INLINE $warn"
-+ OPTFLAGS="-DGCC_INLINE $warn"
- DBGFLAGS="-g $warn"
- # Some architectures need -fPIC for building dynamic lib
- case "$osname-$arch" in hpux-*) DLCFLAGS=-fPIC;; esac
-@@ -926,6 +852,7 @@
+@@ -877,7 +803,7 @@
+ esac
+ PRFFLAGS="$PRFFLAGS $OPTFLAGS"
+ fi
+-cflags="$cflags $DLCFLAGS"
++cflags="$CFLAGS $cflags $DLCFLAGS"
+
+ case "$osname" in
+ nextstep) cflags="-traditional-cpp $cflags";;
+@@ -962,6 +888,7 @@
linux-*|cygwin*)
LD=$CC; LDFLAGS="$cflags -Xlinker -export-dynamic"
runpathprefix='-Xlinker -rpath -Xlinker ';;
-+ netbsd-*) LD=$CC;;
++ netbsd*) LD=$CC; LDFLAGS="-Wl,-E";;
osf1-alpha)
LD=$ld; LIBS="$LIBS -lots -lc"; runpathprefix='-rpath '
LDFLAGS='-std0 -call_shared /usr/lib/cmplrs/cc/crt0.o'
-@@ -970,6 +897,7 @@
- # aix-*) DLSUFFIX=a ;; dynamic linking does not work!
- sunos-*) sodest=$VersionMajor$VersionMinor.$patch
- soname=$sodest;;
-+ netbsd-*) DLLD=;;
- *-alpha|solaris-*|linux-*|freebsd-*)
- case $libpari_base in
- pari) sodest=$version.$patch;; # released versions
-@@ -1006,6 +934,7 @@
- aix-*) DLLDFLAGS="-r" ;;
- hpux-*) DLLDFLAGS="-b -E" ;;
- freebsd-*) DLLDFLAGS="-Bshareable -x" ;;
-+ netbsd-*) DLLD=;;
- linux-*) DLLDFLAGS="-shared -soname \$(LIBPARI_SONAME)" ;;
- irix-*) DLLDFLAGS="-shared -elf -no_unresolved -all" ;;
- *-alpha) DLLDFLAGS="-shared"; EXTRADLLDFLAGS='${LIBS}'
-@@ -1141,11 +1070,9 @@
- dflt=$share_prefix; . ./myread; share_prefix=$ans
-
- if test -z "$share_prefix"; then
-- dfltman=$prefix/man/man1
+@@ -1207,8 +1134,8 @@
+ dfltman=$prefix/man/man1
dfltall=$prefix/lib/pari
else
- dfltman=$share_prefix/man/man1
- dfltall=$share_prefix/doc/pari
++ dfltman=$prefix/man/man1
+ dfltall=$share_prefix/pari
fi
echo $n ..."\"gp\" executable ? $c"
-@@ -1158,7 +1085,7 @@
- dflt=$prefix/include/pari; . ./myread; includedir=$ans
-
- echo $n ..."manual pages ? $c"
--dflt=$dfltman; . ./myread; mandir=$ans
-+dflt=$prefix/man/man1; . ./myread; mandir=$ans
-
- echo $n ..."documentation, examples, and emacs macros ? $c"
- dflt=$dfltall; . ./myread; miscdir=$ans
-@@ -1222,6 +1149,7 @@
+@@ -1289,6 +1216,7 @@
case "$osname" in
*cygwin*) LDDYN="-L$libdir -lpari_dll" ; runpath="$libdir" ;
DYNLIBS=-lpari_dll ; DYNFLAGS=-Dlibpari_USE_DLL ;;
-+ netbsd) LDDYN="-Wl,-R$libdir -L$libdir -l$libpari_base" ; runpath="$libdir" ;;
++ netbsd) LDDYN="-Wl,-R$libdir -L$libdir -l$libpari_base" ; runpath="$libdir" ;;
*) LDDYN="-L$libdir -l$libpari_base" ; runpath="$libdir" ;;
esac
diff --git a/math/pari/patches/patch-ab b/math/pari/patches/patch-ab
index 172e024de67..fc88a52068a 100644
--- a/math/pari/patches/patch-ab
+++ b/math/pari/patches/patch-ab
@@ -1,8 +1,19 @@
-$NetBSD: patch-ab,v 1.3 2001/05/19 17:31:05 jtb Exp $
+$NetBSD: patch-ab,v 1.4 2003/07/07 21:57:50 jtb Exp $
---- config/Makefile.SH.orig Wed Apr 18 11:40:57 2001
+--- config/Makefile.SH.orig
+++ config/Makefile.SH
-@@ -81,7 +81,7 @@
+@@ -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
@@ -11,7 +22,77 @@ $NetBSD: patch-ab,v 1.3 2001/05/19 17:31:05 jtb Exp $
if test "$osname" = concentrix; then PLOTLIBS="-lX11"; fi
plotrunpath=$X11
;;
-@@ -175,8 +175,10 @@
+@@ -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
@@ -24,29 +105,95 @@ $NetBSD: patch-ab,v 1.3 2001/05/19 17:31:05 jtb Exp $
# Graphic library.
PLOTFILE = $PLOTFILE
-@@ -272,21 +274,17 @@
+@@ -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: 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 \$(BINDIR)/gp-$version
- -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff
-
- install-bin-sta: gp-sta
- -mkdir -p \$(BINDIR)
+- -\$(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
+- \$(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.
-@@ -294,15 +292,14 @@
+ # \$(STRIP) \$(STRIPFLAGS) \$(BINDIR)/gp-$version
install-man::
-mkdir -p \$(MANDIR)
@@ -66,22 +213,110 @@ $NetBSD: patch-ab,v 1.3 2001/05/19 17:31:05 jtb Exp $
\$(INSTALL_DATA) $misc/README \$(MISCDIR)
\$(INSTALL_DATA) $misc/color.dft \$(MISCDIR)
\$(INSTALL_DATA) $misc/gpalias \$(MISCDIR)
-@@ -328,7 +325,7 @@
+- \$(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 \$(ALLDIR) \$(BINDIR) \$(DOCDIR)
+ -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)
-@@ -372,8 +369,7 @@
- install-lib-sta: \$(LIBPARI_STA)
+@@ -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)
+- -\$(RM) \$(LIBDIR)/\$(LIBPARI_STA)
- \$(INSTALL_DATA) \$(LIBPARI_STA) \$(LIBDIR)/\$(LIBPARI_STA).$version
- -\$(LN) \$(LIBPARI_STA).$version \$(LIBDIR)/\$(LIBPARI_STA)
-+ \$(INSTALL_DATA) \$(LIBPARI_STA) \$(LIBDIR)
++ \$(LIBTOOL) --mode=install \$(INSTALL_DATA) \$(LIBPARI) \$(LIBDIR)/
- install-lib-dyn: \$(LIBPARI_DYN)
- -mkdir -p \$(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
diff --git a/math/pari/patches/patch-ae b/math/pari/patches/patch-ae
index bf33fdd5c24..3ca93e0f86f 100644
--- a/math/pari/patches/patch-ae
+++ b/math/pari/patches/patch-ae
@@ -1,16 +1,35 @@
-$NetBSD: patch-ae,v 1.1 2001/05/19 17:31:05 jtb Exp $
+$NetBSD: patch-ae,v 1.2 2003/07/07 21:57:51 jtb Exp $
---- config/arch-osname.orig Sun Apr 1 22:10:23 2001
+--- config/arch-osname.orig
+++ config/arch-osname
-@@ -11,6 +11,13 @@
+@@ -11,6 +11,32 @@
fx2800) arch=fx2800; osname=concentrix;;
hp*) arch=hppa; osname=hpux;;
freebsd|os2) arch=ix86;;
-+ netbsd) case "`uname -m`" in
++ netbsd) case "`uname -p`" in
+ alpha) arch=alpha;;
++ arm*) arch=arm;;
++ hppa) arch=hppa;;
+ i386) arch=ix86;;
-+ sun3) arch=m68k;;
-+ *68k) arch=m68k;;
++ m68k) arch=m68k;;
++ mips*) arch=mips;;
++ powerpc) arch=powerpc;;
++ sh3*) arch=sh3;;
++ sh5*) arch=sh5;;
++ sparc)
++ case "`/sbin/sysctl hw.model`" in
++# *SuperSparc*) arch=sparcv8_super;;
++# *TMS390Z5[05]*) arch=sparcv8_super;; # SuperSparc I or II
++# *TMS390S1[05]*) arch=sparcv8_micro;; # MicroSparc I
++# *MB86904*) arch=sparcv8_micro;; # MicroSparc II
++# *MB86907*) arch=sparcv8_micro;; # TurboSparc
++# *MB86934*) arch=sparcv8_super;; # SparcLite
++# *RT625*) arch=sparcv8_super;; # HyperSparc
++# *CY605*) arch=sparcv8_super;;
++ *) arch=sparc;;
++ esac;;
++ sparc64) arch=sparc64;;
++ vax) arch=vax;;
+ *) arch=none;;
+ esac;;
ultrix) arch=mips;;
diff --git a/math/pari/patches/patch-af b/math/pari/patches/patch-af
new file mode 100644
index 00000000000..355a96d9552
--- /dev/null
+++ b/math/pari/patches/patch-af
@@ -0,0 +1,19 @@
+$NetBSD: patch-af,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/none/Makefile.SH.orig
++++ src/kernel/none/Makefile.SH
+@@ -4,11 +4,11 @@
+ cat >> $file << EOT
+ pariinl.h: $src/kernel/none/level0.h $src/kernel/none/level1.h
+ cat $src/kernel/none/level0.h $src/kernel/none/level1.h > \$@
+-kernel.o: .headers $src/kernel/none/level0.h
++kernel\$(_O): .headers $src/kernel/none/level0.h
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o kernel.o $src/kernel/none/level0.c
+-mp.o: .headers $src/kernel/none/mp.c
++mp\$(_O): .headers $src/kernel/none/mp.c
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mp.o $src/kernel/none/mp.c
+-mpinl.o: .headers $src/kernel/none/level1.h
++mpinl\$(_O): .headers $src/kernel/none/level1.h
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mpinl.o $src/kernel/none/level1.c
+
+ EOT
diff --git a/math/pari/patches/patch-ag b/math/pari/patches/patch-ag
new file mode 100644
index 00000000000..36c6d8cbdf1
--- /dev/null
+++ b/math/pari/patches/patch-ag
@@ -0,0 +1,28 @@
+$NetBSD: patch-ag,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv7/Makefile.SH.orig
++++ src/kernel/sparcv7/Makefile.SH
+@@ -3,7 +3,7 @@
+ level0=$src/kernel/none/asm0.h
+ level1=$src/kernel/none/level1.h
+ kernel1=$src/kernel/$asmarch/level0.S
+-if test "$osname" = "nextstep" -o "$osname" = "linux" -o "$gnuas" = "yes";
++if test "$osname" = "nextstep" -o "$osname" = "linux" -o "$osname" = "netbsd" -o "$gnuas" = "yes";
+ then
+ cat >> $file << EOT
+ kernel1.s: $kernel1
+@@ -15,11 +15,11 @@
+ cat >> $file << EOT
+ pariinl.h: $level0 $level1
+ cat $level0 $level1 > \$@
+-kernel.o: $kernel1
+- \$(AS) \$(ASFLAGS) -o \$@ $kernel1
++kernel\$(_O): $kernel1
++ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $kernel1
+ mp.o: .headers $src/kernel/none/mp.c
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $src/kernel/none/mp.c
+-mpinl.o: .headers $level1
++mpinl\$(_O): .headers $level1
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $src/kernel/none/level1.c
+
+ EOT
diff --git a/math/pari/patches/patch-ah b/math/pari/patches/patch-ah
new file mode 100644
index 00000000000..0df793073c1
--- /dev/null
+++ b/math/pari/patches/patch-ah
@@ -0,0 +1,29 @@
+$NetBSD: patch-ah,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv7/level0.S.orig
++++ src/kernel/sparcv7/level0.S
+@@ -13,7 +13,7 @@
+ with the package; see the file 'COPYING'. If not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+-#if defined(NO_UNDERSCORE) || defined(linux)
++#if defined(NO_UNDERSCORE) || defined(linux) || defined(__NetBSD__)
+ # define C(entrypoint) entrypoint
+ #elif defined(sun) || defined(NeXT)
+ # ifdef __STDC__
+@@ -22,13 +22,13 @@
+ # define C(entrypoint) _/**/entrypoint
+ # endif
+ #endif
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ # define GLOBL .global
+ #elif defined(NeXT)
+ # define GLOBL .globl
+ #endif
+
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ .seg "text"
+ #elif defined(NeXT)
+ .text
diff --git a/math/pari/patches/patch-ai b/math/pari/patches/patch-ai
new file mode 100644
index 00000000000..a5dd517a2df
--- /dev/null
+++ b/math/pari/patches/patch-ai
@@ -0,0 +1,38 @@
+$NetBSD: patch-ai,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv8/level0.S.orig
++++ src/kernel/sparcv8/level0.S
+@@ -19,7 +19,7 @@
+ /* addll addllx subll subllx shiftl shiftlr mulll addmul */
+
+ #ifndef __GNUC__
+-#if defined(NO_UNDERSCORE) || defined(linux)
++#if defined(NO_UNDERSCORE) || defined(linux) || defined(__NetBSD__)
+ # define C(entrypoint) entrypoint
+ #elif defined(sun) || defined(NeXT)
+ # ifdef __STDC__
+@@ -28,13 +28,13 @@
+ # define C(entrypoint) _/**/entrypoint
+ # endif
+ #endif
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ # define GLOBL .global
+ #elif defined(NeXT)
+ # define GLOBL .globl
+ #endif
+
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ .seg "text"
+ #elif defined(NeXT)
+ .text
+@@ -111,7 +111,7 @@
+ retl
+ st %o4,[%o3+%lo(C(hiremainder))]
+
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ .seg "bss"
+ .align 4
+ C(hiremainder): .skip 4
diff --git a/math/pari/patches/patch-aj b/math/pari/patches/patch-aj
new file mode 100644
index 00000000000..fb7f670ca9d
--- /dev/null
+++ b/math/pari/patches/patch-aj
@@ -0,0 +1,29 @@
+$NetBSD: patch-aj,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv8/level0_sparcv8_micro.S.orig
++++ src/kernel/sparcv8/level0_sparcv8_micro.S
+@@ -22,7 +22,7 @@
+ /* If libpari.so is compiled with gcc, you should compile all */
+ /* files with gcc */
+
+-#if defined(NO_UNDERSCORE) || defined(linux)
++#if defined(NO_UNDERSCORE) || defined(linux) || defined(__NetBSD__)
+ # define C(entrypoint) entrypoint
+ #elif defined(sun) || defined(NeXT)
+ # ifdef __STDC__
+@@ -31,13 +31,13 @@
+ # define C(entrypoint) _/**/entrypoint
+ # endif
+ #endif
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ # define GLOBL .global
+ #elif defined(NeXT)
+ # define GLOBL .globl
+ #endif
+
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ .seg "data"
+ .align 4
+ C(tabshi): .word 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0
diff --git a/math/pari/patches/patch-ak b/math/pari/patches/patch-ak
new file mode 100644
index 00000000000..06b8e2cc362
--- /dev/null
+++ b/math/pari/patches/patch-ak
@@ -0,0 +1,24 @@
+$NetBSD: patch-ak,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv8/level0_sparcv8_super.S.orig
++++ src/kernel/sparcv8/level0_sparcv8_super.S
+@@ -28,16 +28,16 @@
+ # else
+ # define C(entrypoint) _/**/entrypoint
+ # endif
+-#elif defined(linux)
++#elif defined(linux) || defined(__NetBSD__)
+ # define C(entrypoint) entrypoint
+ #endif
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ # define GLOBL .global
+ #elif defined(NeXT)
+ # define GLOBL .globl
+ #endif
+
+-#if defined(sun) || defined(linux)
++#if defined(sun) || defined(linux) || defined(__NetBSD__)
+ .seg "data"
+ .align 4
+ C(tabshi): .word 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0
diff --git a/math/pari/patches/patch-al b/math/pari/patches/patch-al
new file mode 100644
index 00000000000..257e38990cc
--- /dev/null
+++ b/math/pari/patches/patch-al
@@ -0,0 +1,52 @@
+$NetBSD: patch-al,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/kernel/sparcv8/Makefile.SH.orig
++++ src/kernel/sparcv8/Makefile.SH
+@@ -5,7 +5,7 @@
+ # that can (resp. cannot) be inline.
+ # Problem: "divll" uses "overflow", so kernel2.o is not the same when
+ # compiled with gcc or with cc. We should try to find a workaround.
+-# For NextStep or Linux
++# For NextStep, Linux, or NetBSD
+ # We don't accept "asm inline" since it does not work (Ptitboul)
+
+ if test "$gnuas" = "yes"; then do_cpp=yes; fi
+@@ -14,7 +14,7 @@
+ kernel1=$ker/level0_$asmarch.S
+ kernel2=$ker/level0.S
+
+-if test "$osname" = "nextstep" -o "$osname" = "linux"
++if test "$osname" = "nextstep" -o "$osname" = "linux" -o "$osname" = "netbsd"
+ then
+ level0=$src/kernel/none/asm0.h
+ else
+@@ -22,7 +22,7 @@
+ fi
+ level1=$src/kernel/none/level1.h
+
+-if test "$osname" = "nextstep" -o "$osname" = "linux" -o "$do_cpp" = "yes"
++if test "$osname" = "nextstep" -o "$osname" = "linux" -o "$osname" = "netbsd" -o "$do_cpp" = "yes"
+ then
+ cat >> $file << EOT
+ kernel1.s: $kernel1
+@@ -37,14 +37,14 @@
+ cat >> $file << EOT
+ pariinl.h: $level0 $level1
+ cat $level0 $level1 > \$@
+-kernel.o: $kernel1
+- \$(AS) \$(ASFLAGS) -o \$@ $kernel1
+-kernel2.o: $kernel2
+- \$(AS) \$(ASFLAGS) -o \$@ $kernel2
++kernel\$(_O): $kernel1
++ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $kernel1
++kernel2\$(_O): $kernel2
++ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $kernel2
+ # Level 1 kernel is the generic one
+-mp.o: .headers $src/kernel/none/mp.c
++mp\$(_O): .headers $src/kernel/none/mp.c
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $src/kernel/none/mp.c
+-mpinl.o: .headers $level1
++mpinl\$(_O): .headers $level1
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o \$@ $src/kernel/none/level1.c
+
+ EOT
diff --git a/math/pari/patches/patch-am b/math/pari/patches/patch-am
new file mode 100644
index 00000000000..e0eec5c7302
--- /dev/null
+++ b/math/pari/patches/patch-am
@@ -0,0 +1,102 @@
+$NetBSD: patch-am,v 1.1 2003/07/07 21:57:51 jtb Exp $
+
+--- src/test/dotest.orig
++++ src/test/dotest
+@@ -57,14 +57,8 @@
+ fi
+ $RM -f $file_bench
+
+-dotestSUF=${dotestSUF:-"sta dyn"}
+-for arg in $dotestSUF; do
+- case "$arg" in
+- sta|dyn) if test $x $execdir/gp-$arg; then SUF="$SUF $arg"; fi ;;
+- esac
+-done
+ file_test=gp.out
+-for suf in $SUF; do eval time$suf=0 files$suf=; done
++eval time=0 files=
+ for testdata in $testlist; do
+ O=$IFS;IFS=_;set $testdata;IFS=$O;testname=$1;testmul=$2
+ file_in=$testdir/in/$testname
+@@ -74,45 +68,39 @@
+ else
+ testmul=${testmul:-1000}
+ wr "* Testing $testname $c"
+- for suf in $SUF; do
+- wr " for gp-$suf..$c"
+- case "$suf" in
+- exe) file_diff=$testname.dif;;
+- *) file_diff=$testname-$suf.dif
+- gp=$execdir/gp-$suf;;
+- esac
++ wr " for gp..$c"
++ file_diff=$testname.dif
++ gp=$execdir/gp
+ $gp -q -test < $file_in > $file_test 2>&1
+ diff -c $file_out $file_test > $file_diff
+ pat=`grep "^[-+!] " $file_diff | grep -v "Total time"`
+ time=`tail -2 $file_test | sed -n 's,.*Total time spent: \(.*\),\1,p'`
+ if test -n "$time"; then
+- eval t='$'time$suf
++ eval t='$'time
+ if test -n "$exprbug"; then
+ t=`expr $time \'\*\' $testmul / 1000 + $t`
+ else
+ t=`expr $time '*' $testmul / 1000 + $t`
+ fi
+- eval time$suf=$t
++ eval time=$t
+ fi
+ if test -z "$pat"; then
+ wr "TIME=$time";
+ else
+- eval BUG$suf=BUG
+- eval files$suf=\"'$'files$suf $file_diff\"
++ eval BUG=BUG
++ eval files=\"'$'files $file_diff\"
+ wr "BUG [${time:-0}]"
+ fi
+- done
+ wrln
+ fi
+ done
+ $RM $file_test
+ BUG=
+-for suf in $SUF; do
+- B=`eval echo '$'BUG$suf`; BUG="$BUG$B"
+- t=`eval echo '$'time$suf`
+- if test -n "$B"; then B=' [BUG]'; fi
+- wrln "+++$B Total bench for gp-$suf is $t"
+-done
++B=`eval echo '$'BUG`; BUG="$BUG$B"
++t=`eval echo '$'time`
++if test -n "$B"; then B=' [BUG]'; fi
++wrln "+++$B Total bench for gp is $t"
++
+ if test -z "$BUG"; then exit 0; fi
+
+ pwd=`pwd`
+@@ -120,19 +108,17 @@
+ wrln "PROBLEMS WERE NOTED. The following files list them in diff format: "
+ wrln "Directory: $pwd"
+ bugp=; buge=;
+-for suf in $SUF; do
+- B=`eval echo '$'BUG$suf`; BUG="$BUG$B"
++B=`eval echo '$'BUG`; BUG="$BUG$B"
+ if test -n "$B"; then
+- flist=`eval echo '$'files$suf`
++ flist=`eval echo '$'files`
+ for f in $flist; do
+ wrln " $f"
+ case "$f" in
+- *program*) bugp="$suf$bugp";;
+- *elliptic*) buge="$suf$buge";;
++ *program*) bugp="$bugp";;
++ *elliptic*) buge="$buge";;
+ esac
+ done
+ fi
+-done
+
+ case "x$buge" in
+ x) file_diff=;;
diff --git a/math/pari/patches/patch-an b/math/pari/patches/patch-an
new file mode 100644
index 00000000000..a65dc285be5
--- /dev/null
+++ b/math/pari/patches/patch-an
@@ -0,0 +1,19 @@
+$NetBSD: patch-an,v 1.1 2003/07/07 21:57:52 jtb Exp $
+
+--- src/kernel/ix86/Makefile.SH.orig
++++ src/kernel/ix86/Makefile.SH 2003-07-04
+@@ -6,11 +6,11 @@
+ cat $src/kernel/ix86/level0.h $src/kernel/none/level1.h > \$@
+ level0.s: ../src/kernel/ix86/l0asm.c ../src/kernel/ix86/l0asm.h
+ \$(CPP) ../src/kernel/ix86/l0asm.c | sed -e '/^#/d' -e '/^ *#line/d' -e 's/% */%/g' > level0.s
+-kernel.o: level0.s
++kernel\$(_O): level0.s
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o kernel.o level0.s
+-mp.o: .headers $src/kernel/none/mp.c
++mp\$(_O): .headers $src/kernel/none/mp.c
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mp.o $src/kernel/none/mp.c
+-mpinl.o: .headers $src/kernel/none/level1.h
++mpinl\$(_O): .headers $src/kernel/none/level1.h
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mpinl.o $src/kernel/none/level1.c
+
+ EOT
diff --git a/math/pari/patches/patch-ao b/math/pari/patches/patch-ao
new file mode 100644
index 00000000000..f0ea95a4978
--- /dev/null
+++ b/math/pari/patches/patch-ao
@@ -0,0 +1,20 @@
+$NetBSD: patch-ao,v 1.1 2003/07/07 21:57:52 jtb Exp $
+
+--- src/kernel/alpha/Makefile.SH.orig
++++ src/kernel/alpha/Makefile.SH
+@@ -4,11 +4,11 @@
+ cat >> $file << EOT
+ pariinl.h: $src/kernel/none/asm0.h $src/kernel/none/level1.h
+ cat $src/kernel/none/asm0.h $src/kernel/none/level1.h > \$@
+-kernel.o: $src/kernel/$asmarch/level0.s
+- \$(AS) \$(ASFLAGS) -o kernel.o $src/kernel/$asmarch/level0.s
+-mp.o: .headers $src/kernel/none/mp.c
++kernel\$(_O): $src/kernel/$asmarch/level0.s
++ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o kernel.o $src/kernel/$asmarch/level0.s
++mp\$(_O): .headers $src/kernel/none/mp.c
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mp.o $src/kernel/none/mp.c
+-mpinl.o: .headers $src/kernel/none/level1.h
++mpinl\$(_O): .headers $src/kernel/none/level1.h
+ \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) -o mpinl.o $src/kernel/none/level1.c
+
+ EOT
diff --git a/math/pari/patches/patch-ap b/math/pari/patches/patch-ap
new file mode 100644
index 00000000000..7f074f71ee7
--- /dev/null
+++ b/math/pari/patches/patch-ap
@@ -0,0 +1,22 @@
+$NetBSD: patch-ap,v 1.1 2003/07/07 21:57:52 jtb Exp $
+
+--- src/gp/gp_rl.c.orig
++++ src/gp/gp_rl.c
+@@ -103,7 +103,7 @@
+ }
+ *opt = c;
+ SAVE_PROMPT();
+- rl_message("%s: %s.", (long)msg, (long)(c? "on": "off"));
++ rl_message("%s: %s.", (char *)msg, (char *)(c? "on": "off"));
+ c = rl_read_key();
+ RESTORE_PROMPT();
+ rl_clear_message();
+@@ -583,7 +583,7 @@
+ rl_point = 0; rl_end = 0; pari_outfile = rl_outstream;
+ if (count < 0) flag |= h_LONG; /* long help */
+ SAVE_PROMPT();
+- rl_message("",0,0);
++ rl_message('\0',0,0);
+ aide(rl_line_buffer + off, flag);
+ RESTORE_PROMPT();
+ rl_point = p; rl_end = e; pari_outfile = save;
diff --git a/math/pari/patches/patch-aq b/math/pari/patches/patch-aq
new file mode 100644
index 00000000000..285604f704c
--- /dev/null
+++ b/math/pari/patches/patch-aq
@@ -0,0 +1,17 @@
+$NetBSD: patch-aq,v 1.1 2003/07/07 21:57:52 jtb Exp $
+
+--- src/language/init.c.orig
++++ src/language/init.c
+@@ -114,9 +114,9 @@
+ struct rlimit rip;
+
+ if (getrlimit(RLIMIT_STACK, &rip) || rip.rlim_cur == RLIM_INFINITY) return;
+-/* DEC cc doesn't like this line:
+- * PARI_stack_limit = stack_base - ((rip.rlim_cur/16)*15); */
+- PARI_stack_limit = (void*)((long)stack_base - (rip.rlim_cur/16)*15);
++/* DEC cc doesn't like this line: */
++ PARI_stack_limit = stack_base - ((rip.rlim_cur/16)*15);
++/* PARI_stack_limit = (void*)((long)stack_base - (rip.rlim_cur/16)*15); */
+ }
+ #endif /* STACK_CHECK */
+