Ilya Zakharevich on Mon, 6 May 2002 15:31:17 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PATCH 2.2.2] Configure support for src/system


This patch to Configure 

 a) supports src/systems directory (on OS/2);

 b) removes (the silliness of) compiling the plotSYSTEM.c to plot.o;
    now the name of the object file matches the name of the C file.

"b" is very convenient for the followup patch.  "a" is not the most
comprehensive OS/2-dynaloading-support patch; to get the full functionality of
install() - getting symbols from the PARI library itself - one needs also
to compile (manually) PARI as a DLL.

Enjoy,
Ilya

--- ./Configure-pre-system	Sat May  4 01:38:18 2002
+++ ./Configure	Sun May  5 14:21:50 2002
@@ -1193,6 +1193,10 @@ if test "$has_dlopen" = no; then
     LIBS="-ldl $LIBS"
   fi
 fi
+if test "$has_dlopen" = no -a X"$osname" = Xos2; then
+  echo "Will use the builtin dlopen() support for OS/2..."
+  has_dlopen=builtin
+fi
 
 ####################### CONFIGURE - MAKE ####################################
 dflt=$prefix; rep=
--- ./config/Makefile.SH-pre-system	Fri Jan 11 01:12:12 2002
+++ ./config/Makefile.SH	Sun May  5 14:27:04 2002
@@ -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,6 +32,10 @@ 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
 
 case "$ASMARCH" in
   m68k) hlist=pari68k
@@ -52,30 +56,13 @@ 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
@@ -87,6 +74,14 @@ gnuplot)
     os2) libgnuplot=$gnuplot/gnuplot.a;;
     *) libgnuplot=$gnuplot/libgnuplot.a;;
   esac
+  graph="$graph plotgnuplot"
+  ;;
+gnuplot-dynamic)
+  PLOTFILE=plotgnuplot.c
+  PLOTCFLAGS="-DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=NULL"
+  PLOTLIBS=
+  plotrunpath=
+  graph="$graph plotgnuplot"
   ;;
 X11)
   PLOTFILE=plotX.c
@@ -94,9 +89,29 @@ X11)
   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
@@ -131,6 +146,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
 #
@@ -144,7 +164,7 @@ ASFLAGS    = $ASFLAGS
 AR	   = ar
 
 CC         = $CC
-CPPFLAGS   = -I. -I$src/headers
+CPPFLAGS   = $CPPFLAGS
 CFLAGS     = $cflags
 LD         = $LD
 LDFLAGS    = $LDFLAGS
@@ -510,7 +530,7 @@ if test -s $src_dir/kernel/$ASMARCH/Make
   . $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
 
@@ -518,11 +538,6 @@ for dir in basemath modules language gp 
   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"
@@ -531,10 +546,13 @@ for dir in basemath modules language gp 
     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
--- ./config/paricfg.h.SH-pre-system	Wed Oct 17 04:51:32 2001
+++ ./config/paricfg.h.SH	Sun May  5 14:23:16 2002
@@ -141,7 +141,7 @@ yes) echo '#define USE_SIGRELSE 1' >> $f
 esac
 
 case $has_dlopen in
-yes) cat >> $file << EOT
+yes|builtin) cat >> $file << EOT
 #define HAS_DLOPEN
 #define DL_DFLT_NAME "libpari.$sodest"
 EOT