=================================================================== RCS file: /home/cvs/OpenXM_contrib/pari-2.2/config/Attic/Makefile.SH,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -p -r1.1.1.1 -r1.2 --- OpenXM_contrib/pari-2.2/config/Attic/Makefile.SH 2001/10/02 11:16:55 1.1.1.1 +++ OpenXM_contrib/pari-2.2/config/Attic/Makefile.SH 2002/09/11 07:26:39 1.2 @@ -22,7 +22,7 @@ kernel="kernel mp" inline="mpinl" khlist="pariinl" -graph="plot plotport" +graph="plotport" gp="gp gp_init gp_rl highlvl whatnow" case "$osname" in cygwin*) graphdyn="plot-dyn plotport-dyn"; @@ -32,8 +32,21 @@ esac language=`ls $src_dir/language/*.c | sed 's,.*/\(.*\)\.c,\1,'` basemath=`ls $src_dir/basemath/*.c | sed 's,.*/\(.*\)\.c,\1,'` modules=`ls $src_dir/modules/*.c | sed 's,.*/\(.*\)\.c,\1,'` +case "$osname" in + os2) systems=os2;; + *) systems=;; +esac -if test m68k = "$ASMARCH"; then hlist=pari68k; else hlist=pariport; fi +if test -s $src_dir/kernel/$ASMARCH/MakeVar.SH; then + . $src_dir/kernel/$ASMARCH/MakeVar.SH +fi + +case "$ASMARCH" in + m68k) hlist=pari68k + kerntest=kernel.old;; # OLD_CODES should be defined + *) hlist=pariport + kerntest=kernel;; +esac hlist="pari paritype paricast paricom parierr parigen paristio parisys $hlist" HEADERS='' @@ -47,33 +60,14 @@ done # We don't want to recompile everything when only changing a prototype hlist="$hlist paridecl" -KERNOBJS='' -for f in $kernel; do - KERNOBJS="$KERNOBJS $f\$(_O)" -done -OBJS=$KERNOBJS -for f in $basemath $modules $language; do - 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)" -done - case "$which_graphic_lib" in none) - PLOTFILE=plotnull.c PLOTCFLAGS= PLOTLIBS= plotrunpath= + graph="$graph plotnull" ;; gnuplot) - PLOTFILE=plotgnuplot.c PLOTCFLAGS= GNUPLOT_OBJS="bitmap\$(_O) term\$(_O) util\$(_O) version\$(_O) stdfn\$(_O)" PLOTLIBS="$gnuplot_libs" @@ -82,16 +76,69 @@ gnuplot) os2) libgnuplot=$gnuplot/gnuplot.a;; *) libgnuplot=$gnuplot/libgnuplot.a;; esac + graph="$graph plotgnuplot" ;; +gnuplot-dynamic) + PLOTCFLAGS="-DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=NULL" + PLOTLIBS= + plotrunpath= + graph="$graph plotgnuplot" + ;; +builtin.X11-gnuplot) + cflags="$cflags -DBOTH_GNUPLOT_AND_X11" + PLOTCFLAGS=-I$Xincroot + GNUPLOT_OBJS="bitmap\$(_O) term\$(_O) util\$(_O) version\$(_O) stdfn\$(_O)" + if test "$osname" = concentrix; then + PLOTLIBS="$gnuplot_libs -lX11" + else + PLOTLIBS="$gnuplot_libs -L$X11 -lX11 $extralib" + fi + plotrunpath=$X11 + case "$osname" in + os2) libgnuplot=$gnuplot/gnuplot.a;; + *) libgnuplot=$gnuplot/libgnuplot.a;; + esac + graph="$graph plotgnuplot plotX" + ;; +builtin.X11-gnuplot-dynamic) + cflags="$cflags -DBOTH_GNUPLOT_AND_X11" + PLOTCFLAGS="-I$Xincroot -DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=NULL" + if test "$osname" = concentrix; then + PLOTLIBS="-lX11" + else + PLOTLIBS="-L$X11 -lX11 $extralib" + fi + plotrunpath=$X11 + graph="$graph plotgnuplot plotX" + ;; X11) - PLOTFILE=plotX.c PLOTCFLAGS=-I$Xincroot PLOTLIBS="-L$X11 -lX11 $extralib" if test "$osname" = concentrix; then PLOTLIBS="-lX11"; fi plotrunpath=$X11 + graph="$graph plotX" ;; esac +KERNOBJS='' +for f in $kernel; do + KERNOBJS="$KERNOBJS $f\$(_O)" +done +OBJS=$KERNOBJS +for f in $basemath $modules $language $systems; do + 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)" +done + case "$runpathprefix" in -R) RUNPTH_FINAL="-R$runpath" if test -n "$plotrunpath"; then @@ -109,7 +156,7 @@ if test -z "$DLLD"; then else exec="gp-sta gp-dyn" fi -doexec="env \"LD_LIBRARY_PATH=.;\$\$LD_LIBRARY_PATH\" $src/test/dotest $sizeof_long" +doexec="env \"LD_LIBRARY_PATH=.;\$\$LD_LIBRARY_PATH\" \$(SHELL) $src/test/dotest $sizeof_long" case "$sizeof_long" in 4) numbits=32;; 8) numbits=64;; @@ -126,6 +173,11 @@ case "$static" in y) dft=sta; libdft= ;; esac +CPPFLAGS="-I. -I$src/headers" +if test "$has_dlopen" = builtin -a X"$osname" = Xos2; then + CPPFLAGS="$CPPFLAGS -I$src/systems/os2" +fi + cat > $file << EOT # Makefile for Pari/GP -- $pretty # @@ -139,7 +191,7 @@ ASFLAGS = $ASFLAGS AR = ar CC = $CC -CPPFLAGS = -I. -I$src/headers +CPPFLAGS = $CPPFLAGS CFLAGS = $cflags LD = $LD LDFLAGS = $LDFLAGS @@ -148,14 +200,28 @@ DLLDFLAGS = $DLLDFLAGS EXTRADLLDFLAGS = $EXTRADLLDFLAGS CPP = $CPP +# HIGHLY EXPERIMENTAL (only tested with gmp-4.0 on ix86 and Ultra): +# If you've configured and compiled GMP and would like to tune PARI using +# the nice cycle counting functions in GMP, uncomment the 4 lines below +# (correct the first one to the path to your gmp source tree). +# +#GMP = /some/directory/gmp-4.0/tune +#GMPFLAGS= -DGMP_TIMER +#GMPO1 = \$(GMP)/time.o \$(GMP)/freq.o +#GMPOBJS=\$(GMPO1) \$(GMPO2) +# +#You may need to add a few object files to GMPOBJS. On UltraSparc, +#uncomment the following line: +#GMPO2 = \$(GMP)/sparcv9.o + _O = .o _A = .a 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_DYN = \$(LIBPARI_SO)$sodest +LIBPARI_SONAME= \$(LIBPARI_SO)$soname RUNPTH = $RUNPTH RUNPTH_FINAL = $RUNPTH_FINAL @@ -189,7 +255,6 @@ INSTALL_PROGRAM = \$(INSTALL) INSTALL_DATA = \$(INSTALL) -m 644 # Graphic library. -PLOTFILE = $PLOTFILE PLOTCFLAGS = $PLOTCFLAGS PLOTLIBS = $PLOTLIBS GNUPLOT_OBJS = $GNUPLOT_OBJS @@ -219,10 +284,8 @@ OBJSGP = $OBJSGP OBJSDGP = $OBJSDGP dft: gp $pari_elc - - gp: gp-$dft ../gp$suffix$exe_suff $libdft - - ../gp$suffix$exe_suff: gp-$dft -\$(RM) \$@ @@ -245,9 +308,23 @@ kerntest: $KERNOBJS mp\$(_O) kerntest\$(_O) test-kernel:: kerntest @./kerntest > gp.out;\ - diff -c gp.out $src/test/$numbits/kernel > kern.dif;\ + diff -c gp.out $src/test/$numbits/$kerntest > kern.dif;\ if test -s kern.dif; then echo "KERNEL BUG"; else echo OK; fi + +tune.o: $src/test/tune.c + \$(CC) \$(CFLAGS) \$(GMPFLAGS) \$(CPPFLAGS) -o \$@ \$< -c + +tune: tune-sta + -\$(RM) tune + -\$(LN) tune-sta tune + -\$(LN) $ln_objdir/tune ../tune + +tune-dyn: tune.o lib-dyn + \$(CC) \$(LDFLAGS) \$(RUNPTH) -o \$@ \$< \$(GMPOBJS) -L. \$(LDDYN) \$(LIBS) +tune-sta: tune.o lib-sta + \$(CC) \$(LDFLAGS) -o \$@ \$< \$(GMPOBJS) ./\$(LIBPARI_STA) \$(LIBS) EOT + if test -n "$ranlib"; then cat >> $file << EOT @@ -262,9 +339,12 @@ EOT cat >> $file << EOT -bench: $exec dobench -test-compat: $exec dotest-compat -test-graphic: $exec dotest-graphic +bench: $exec + @$doexec +test-compat: $exec + @$doexec -c +test-graphic: $exec + @$doexec -g cleantest: \$(RM) *.dif gp.out pari.ps @@ -277,7 +357,7 @@ dotest-graphic:: @$doexec -g cleanobj: cleantest - -\$(RM) *\$(_O) *.s pariinl.h \$(LIBPARI_STA) libpari.* $exec + -\$(RM) *\$(_O) *.s pariinl.h libpari* tune* $exec clean: cleanobj @@ -302,7 +382,7 @@ install-bin-dyn: gp-dyn -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 + -strip \$(BINDIR)/gp-$version -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff install-bin-sta: gp-sta @@ -311,7 +391,7 @@ install-bin-sta: gp-sta \$(INSTALL_PROGRAM) gp-sta$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 \$(BINDIR)/gp-$version +# -strip \$(BINDIR)/gp-$version install-man:: -mkdir -p \$(MANDIR) @@ -355,7 +435,6 @@ install-doc:: -\$(INSTALL_DATA) $doc/appa.tex \$(DOCDIR) -\$(INSTALL_DATA) $doc/appb.tex \$(DOCDIR) -\$(INSTALL_DATA) $doc/appc.tex \$(DOCDIR) - -\$(INSTALL_DATA) $doc/paricfg.tex.in \$(DOCDIR) -\$(INSTALL_DATA) $doc/parimacro.tex \$(DOCDIR) -\$(INSTALL_DATA) $doc/pdfmacs.tex \$(DOCDIR) -\$(INSTALL_DATA) $doc/refcard.tex \$(DOCDIR) @@ -475,7 +554,7 @@ if test -s $src_dir/kernel/$ASMARCH/Makefile.SH; then . $src_dir/kernel/$ASMARCH/Makefile.SH fi HUGELINE= -for dir in basemath modules language gp graph gpdyn graphdyn; do +for dir in basemath modules language gp graph gpdyn graphdyn systems; do eval list='$'$dir for f in $list; do @@ -483,11 +562,6 @@ for dir in basemath modules language gp graph gpdyn gr depend= cflags= case "$f" in - plot) - source="$src/graph/\$(PLOTFILE)" - cflags="\$(PLOTCFLAGS)" - depend="$src/graph/rect.h" - ;; gp|gp_rl) cflags="-I$src/language \$(RLINCLUDE)" depend="$src/language/anal.h $src/gp/gp.h ./paricfg.h" @@ -496,11 +570,14 @@ for dir in basemath modules language gp graph gpdyn gr cflags="-I$src/graph" depend="$src/graph/rect.h" ;; - plot-dyn) - source="$src/graph/\$(PLOTFILE)" + plot*-dyn) cflags="\$(DYNFLAGS) \$(PLOTCFLAGS)" depend="$src/graph/rect.h \$(LIBPARI).dll libpari_dll.h libpari_globals.h \$(LIBPARI).dll" ;; + plot*) + cflags="\$(PLOTCFLAGS)" + depend="$src/graph/rect.h" + ;; gp-dyn|gp_rl-dyn) source=$src\/`echo $dir | sed -e "s/dyn//"`\/`echo $f | cut -f1 -d-`.c cflags="\$(DYNFLAGS) -I$src/language \$(RLINCLUDE)" @@ -534,3 +611,5 @@ if test -n "$DYNFLAGS"; then echo "include Makefile.DLLs" >> $file cp $config_dir/Makefile.DLLs $objdir fi + +echo ".PHONY: gp dft" >> $file