| Ilya Zakharevich on Wed, 16 Oct 2002 22:51:58 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| [PATCH CVS] gnuplot-dynamic as the default |
This patch
a) Makes gnuplot-dynamic build the default (so when X is not found,
the graphic engine is gnuplot-dynamic; when X is found the engine is
X11.builtin-gnuplot-dynamic);
b) Adds the possibility to configure the DLL name for
gnuplot-dynamic at Configure-time (append ",DLL_NAME" to the
--graphics argument). The name should in format suitable for
dl_open() call. E.g., on OS/2 I distribute a pre-compiled
Gnuplot engine DLL, so one can build things with
sh Configure --graphic=gnuplot-dynamic,gnpltdrw
Enjoy,
Ilya
--- ./Configure-pre Tue Oct 15 17:33:44 2002
+++ ./Configure Tue Oct 15 23:46:48 2002
@@ -58,7 +58,8 @@ optimization=full
prefix=/usr/local
share_prefix=
target_host=
-which_graphic_lib=none
+which_graphic_lib=gnuplot-dynamic
+graphic_lib_dll=NULL
test -n "$GP_INSTALL_PREFIX" && prefix=$GP_INSTALL_PREFIX
while test $# -gt 0; do
case "$1" in
@@ -922,14 +923,14 @@ if test "$optimization" != profiling; th
# ======== GRAPHICS environment search ==============
-# At this moment $which_graphic_lib is either none, or the argument to
+# At this moment $which_graphic_lib is either gnuplot-dynamic, or the argument to
# --graphic option; $graph_cmd is "" unless --graphic option was specified.
# LIB: X11
pth=$x11pth
lib=X11; . ./locatelib
if test -f $Xincroot/X11/Xos.h -a -z "$graph_cmd"; then
- which_graphic_lib=X11
+ which_graphic_lib=builtin.X11-gnuplot-dynamic
test -n "$extralib" && echo ..."Extra Libraries are $extralib"
echo ..."Found X11 header files in $Xincroot/X11"
fi
@@ -954,16 +955,18 @@ if test "$optimization" != profiling; th
/*|[c-z]:/*) gnuplot_libs="$gnuplot_libs -l$lib";;
esac
done
- if test "$which_graphic_lib" = gnuplot; then
+ case "$which_graphic_lib" in
+ *gnuplot)
if test -z "$gnuplot_libs"; then
echo "...I expect that no libraries are needed for gnuplot"
else
echo "...I expect that libraries $gnuplot_libs are needed for gnuplot"
- fi
- fi
+ fi ;;
+ esac
;;
*)
- if test "$which_graphic_lib" = gnuplot; then
+ case "$which_graphic_lib" in
+ *gnuplot)
pth=`echo $pth | sed -e "s,$TOP,.,g"`
echo "###"
echo "### Could not find gnuplot library in $pth"
@@ -978,7 +981,8 @@ if test "$optimization" != profiling; th
echo "### $tlib to ./gnuplot-$osname-$arch or ./gnuplot subdirs"
echo "### or to similarly-named directories up the directory tree."
echo "###"
- fi
+ ;;
+ esac
;;
esac
@@ -1154,11 +1158,18 @@ EOM
==========================================================================
GP contains high resolution plotting functions. Choose among
none $addX11 $addgnuplot gnuplot-dynamic
+The `*-dynamic' version may be trailed by `,dll_base_name'.
EOT
echo $n ..."Use which graphic library (\"none\" means no hi-res plot) ? $c"
rep="none $addX11 $addgnuplot gnuplot-dynamic";
dflt=$which_graphic_lib; . ./myread
which_graphic_lib=$ans
+ case "$which_graphic_lib" in
+ *,*)
+ graphic_lib_dll=`echo "$which_graphic_lib" | sed -e 's/[-a-z]*,//'`
+ which_graphic_lib=`echo "$which_graphic_lib" | sed -e 's/,.*//'`
+ ;;
+ esac
case "$which_graphic_lib" in
*X11*)
@@ -1215,6 +1226,12 @@ EOT
*)gnuplot=;;
esac
else # fastread = yes
+ case "$which_graphic_lib" in
+ *,*)
+ graphic_lib_dll=`echo "$which_graphic_lib" | sed -e 's/[-a-z]*,//'`
+ which_graphic_lib=`echo "$which_graphic_lib" | sed -e 's/,.*//'`
+ ;;
+ esac
# TEST: --graphic was not given, X11 not found, and gnuplot library found
if test "$which_graphic_lib" = none -a -z "$graph_cmd" -a -n "$gnuplot"; then
which_graphic_lib=gnuplot
@@ -1371,7 +1388,7 @@ for variable in\
rl_completion_matches rl_completion_func_t\
RLINCLUDE RLLIBS\
sizeof_long doubleformat\
- gnuplot extralib X11 Xincroot which_graphic_lib gnuplot_libs\
+ gnuplot extralib X11 Xincroot which_graphic_lib gnuplot_libs graphic_lib_dll\
$_has_list; do
eval "echo $variable=\'"'$'"$variable\'" \>\> $dflt_conf_file
done
--- ./config/Makefile.SH-pre Tue Oct 15 17:33:44 2002
+++ ./config/Makefile.SH Tue Oct 15 23:32:52 2002
@@ -60,6 +60,11 @@ done
# We don't want to recompile everything when only changing a prototype
hlist="$hlist paridecl"
+case "$graphic_lib_dll" in
+ NULL) _graphic_lib_dll="$graphic_lib_dll" ;;
+ *) _graphic_lib_dll="\\\"$graphic_lib_dll\\\"" ;;
+esac
+
case "$which_graphic_lib" in
none)
PLOTCFLAGS=
@@ -79,7 +84,7 @@ gnuplot)
graph="$graph plotgnuplot"
;;
gnuplot-dynamic)
- PLOTCFLAGS="-DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=NULL"
+ PLOTCFLAGS="-DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=$_graphic_lib_dll"
PLOTLIBS=
plotrunpath=
graph="$graph plotgnuplot"
@@ -102,7 +107,7 @@ builtin.X11-gnuplot)
;;
builtin.X11-gnuplot-dynamic)
cflags="$cflags -DBOTH_GNUPLOT_AND_X11"
- PLOTCFLAGS="-I$Xincroot -DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=NULL"
+ PLOTCFLAGS="-I$Xincroot -DDYNAMIC_PLOTTING -DDYNAMIC_PLOTTING_RUNTIME_LINK=_graphic_lib_dll"
if test "$osname" = concentrix; then
PLOTLIBS="-lX11"
else