mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey config/Makefile.in config/configure.in...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey config/Makefile.in config/configure.in...
Date: Wed, 25 Jan 2006 22:29:54 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/01/25 22:29:53

Modified files:
        config         : Makefile.in configure.in 
        distrib        : ChangeLog 
        src/daemon/common: commonComplexOptions.ml 
                           commonComplexOptions.mli 
        src/daemon/driver: driverCommands.ml driverControlers.ml 
                           driverInteractive.ml driverMain.ml 
        src/utils/lib  : autoconf.ml.new.in 

Log message:
        patch #4820

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/config/Makefile.in.diff?tr1=1.141&tr2=1.142&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/config/configure.in.diff?tr1=1.245&tr2=1.246&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.684&tr2=1.685&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.ml.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.mli.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml.diff?tr1=1.115&tr2=1.116&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml.diff?tr1=1.57&tr2=1.58&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml.diff?tr1=1.56&tr2=1.57&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverMain.ml.diff?tr1=1.90&tr2=1.91&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/lib/autoconf.ml.new.in.diff?tr1=1.20&tr2=1.21&r1=text&r2=text

Patches:
Index: mldonkey/config/Makefile.in
diff -u mldonkey/config/Makefile.in:1.141 mldonkey/config/Makefile.in:1.142
--- mldonkey/config/Makefile.in:1.141   Fri Jan  6 22:23:08 2006
+++ mldonkey/config/Makefile.in Wed Jan 25 22:29:53 2006
@@ -151,19 +151,6 @@
 LIBS_flags += -cclib -lz
 CDK_SRCS +=  $(CDK)/zlib.ml $(CDK)/zip.ml $(CDK)/gzip.ml $(CDK)/zlibstubs.c 
$(CDK)/tar.ml
 
-ifeq ("$(GD)", "yes")
-  LIBS_flags += -cclib -lgd -cclib -lfreetype -cclib -lm
-  LIBS_flags += -ccopt -W -ccopt -Wall -ccopt -Wno-unused
-  ifeq ("$(GD_JPG)", "yes")
-    LIBS_flags += -cclib -ljpeg
-  endif
-  ifeq ("$(GD_PNG)", "yes")
-    LIBS_flags += -cclib -lpng
-    LIBS_flags += -ccopt -DHAVE_JPEG
-  endif
-  CDK_SRCS +=  $(CDK)/gd.ml $(CDK)/gdstubs.c
-endif
-
 CDK_SRCS += $(LIB)/autoconf.ml
 
 
@@ -173,18 +160,8 @@
   $(CDK)/netbase.ml $(CDK)/filepath.ml $(CDK)/string2.ml \
   $(CDK)/filename2.ml $(CDK)/list2.ml $(CDK)/hashtbl2.ml \
   $(CDK)/file.ml $(CDK)/unix2.ml \
-  $(CDK)/heap_c.c $(CDK)/array2.ml $(CDK)/sort2.ml \
-  \
-  $(XML)/xml_types.ml \
-  $(XML)/xml_parser.mly $(XML)/xml_lexer.mll $(XML)/xml_dtd.ml \
-  $(XML)/xmlParser.ml $(XML)/xml.ml \
-  \
-  $(RSS)/rss_messages.ml $(RSS)/rss_date.ml \
-  $(RSS)/rss_types.ml  $(RSS)/rss_io.ml  $(RSS)/rss.ml
+  $(CDK)/heap_c.c $(CDK)/array2.ml $(CDK)/sort2.ml
   
-#  $(CDK)/xmllex.mll $(CDK)/xmlyacc.mly $(CDK)/xml.ml \
-#  $(LIB)/htmlgen.ml
-
 ifneq ("$(PTHREAD_CFLAGS)" , "")
   CFLAGS += $(PTHREAD_CFLAGS)
   LIBS_flags += -ccopt "$(PTHREAD_CFLAGS)"
@@ -212,6 +189,7 @@
   $(LIB)/indexer.ml $(LIB)/indexer1.ml $(LIB)/indexer2.ml $(LIB)/host.ml  \
   $(LIB)/misc2.ml $(LIB)/misc.ml $(LIB)/unix32.ml  $(LIB)/md4.ml \
   $(LIB)/avifile.ml $(LIB)/http_lexer.mll $(LIB)/url.ml \
+  $(RSS)/rss_date.ml \
   $(LIB)/date.ml  $(LIB)/fst_hash.c \
   $(LIB)/md4_comp.c $(LIB)/md4_c.c \
   $(LIB)/gettext.ml4 $(LIB)/md5_c.c $(LIB)/sha1_c.c \
@@ -240,7 +218,16 @@
         $(CHAT)/chat_options.ml\
         $(CHAT)/chat_config.ml
 
-COMMON_SRCS+=$(COMMON)/commonTypes.ml \
+XML_SRCS= \
+  $(XML)/xml_types.ml $(XML)/xml_parser.mly $(XML)/xml_lexer.mll \
+  $(XML)/xml_dtd.ml $(XML)/xmlParser.ml $(XML)/xml.ml
+
+RSS_SRCS= \
+  $(RSS)/rss_messages.ml $(RSS)/rss_types.ml  $(RSS)/rss_io.ml  $(RSS)/rss.ml
+
+COMMON_SRCS = \
+  $(XML_SRCS) $(RSS_SRCS) \
+  $(COMMON)/commonTypes.ml \
   $(COMMON)/guiTypes.ml \
   $(COMMON)/guiProto.ml \
   $(COMMON)/commonEvent.ml \
@@ -258,8 +245,7 @@
   $(COMMON)/commonHasher.ml \
   $(COMMON)/commonHosts.ml \
   $(COMMON)/commonIndexing.ml \
-  $(COMMON)/commonHasher_c.c \
-  $(COMMON)/commonGraphics.ml
+  $(COMMON)/commonHasher_c.c
 
 COMMON_CLIENT_SRCS= \
   $(COMMON)/commonUser.ml \
@@ -549,7 +535,27 @@
 CORE_SRCS += $(OPENFT_SRCS)
 endif
 
-DRIVER_SRCS= \
+ifeq ("$(GD)", "yes")
+  GD_LIBS_flags += -cclib -lgd -cclib -lfreetype -cclib -lm
+  GD_LIBS_flags += -ccopt -W -ccopt -Wall -ccopt -Wno-unused
+  ifeq ("$(GD_JPG)", "yes")
+    GD_LIBS_flags += -cclib -ljpeg
+  endif
+  ifeq ("$(GD_PNG)", "yes")
+    GD_LIBS_flags += -cclib -lpng
+    GD_LIBS_flags += -ccopt -DHAVE_JPEG
+  endif
+  DRIVER_SRCS= \
+    $(CDK)/gd.ml \
+    $(CDK)/gdstubs.c \
+    $(DRIVER)/driverGraphics_gd.ml
+else
+  DRIVER_SRCS= \
+    $(DRIVER)/driverGraphics_nogd.ml
+endif
+
+DRIVER_SRCS+= \
+  $(DRIVER)/driverGraphics.ml  \
   $(DRIVER)/driverInteractive.ml  \
   $(DRIVER)/driverCommands.ml  \
   $(DRIVER)/driverLink.ml \
@@ -1512,17 +1518,17 @@
 TMPSOURCES += $($1_ML4:.ml4=.ml) $($1_MLT:.mlt=.ml) $($1_MLP:.mlcpp=.ml) 
$($1_MLL:.mll=.ml) $($1_MLY:.mly=.ml) $($1_MLY:.mly=.mli) $($1_ZOG:.zog=.ml) 
  
 $2: $($1_OBJS) $($1_CMXS) $($1_CMXAS)
-       $(OCAMLOPT) -cc "$(CXX)" -linkall $(PLUGIN_FLAG) -o address@hidden  
$($1_OBJS) $(LIBS_opt) $(LIBS_flags) $($3_LIBS_opt) $($3_LIBS_flags) -I build 
$($1_CMXAS) $($1_CMXS) 
+       $(OCAMLOPT) -cc "$(CXX)" -linkall $(PLUGIN_FLAG) -o address@hidden 
$($1_OBJS) $(LIBS_opt) $(LIBS_flags) $($3_LIBS_opt) $($3_LIBS_flags) 
$($5_LIBS_opt) $($5_LIBS_flags) -I build $($1_CMXAS) $($1_CMXS) 
  
-$2.byte: $($1_OBJS) $($1_CMOS)  $($1_CMAS)
-       $(OCAMLC) -cc "$(CXX)" -linkall -o address@hidden  $($1_OBJS) 
$(LIBS_byte) $(LIBS_flags)  $($3_LIBS_byte) $($3_LIBS_flags) -I build 
$($1_CMAS) $($1_CMOS) 
+$2.byte: $($1_OBJS) $($1_CMOS) $($1_CMAS)
+       $(OCAMLC) -cc "$(CXX)" -linkall -o address@hidden $($1_OBJS) 
$(LIBS_byte) $(LIBS_flags) $($3_LIBS_byte) $($3_LIBS_flags) $($5_LIBS_byte) 
$($5_LIBS_flags) -I build $($1_CMAS) $($1_CMOS) 
  
-$2.static:  $($1_OBJS) $($1_CMXS)  $($1_CMXAS)
-       $(OCAMLOPT) -cc "$(CXX)" -linkall $(PLUGIN_FLAG) -ccopt -static -o 
address@hidden $($1_OBJS) $(LIBS_opt) $(LIBS_flags)  $($3_LIBS_flags)  
$($3_STATIC_LIBS_opt) -I build $($1_CMXAS) $($1_CMXS)
+$2.static: $($1_OBJS) $($1_CMXS) $($1_CMXAS)
+       $(OCAMLOPT) -cc "$(CXX)" -linkall $(PLUGIN_FLAG) -ccopt -static -o 
address@hidden $($1_OBJS) $(LIBS_opt) $(LIBS_flags) $($3_LIBS_flags) 
$($3_STATIC_LIBS_opt) $($5_LIBS_flags) $($5_STATIC_LIBS_opt) -I build 
$($1_CMXAS) $($1_CMXS)
 ]])
 
-EXPAND(mldonkey,mldonkey,NO,mldonkey)
-EXPAND(mldonkey+gui,mldonkey+gui,GTK,mldonkey+gui)
+EXPAND(mldonkey,mldonkey,NO,mldonkey,GD)
+EXPAND(mldonkey+gui,mldonkey+gui,GTK,mldonkey+gui,GD)
 EXPAND(MLPROGRESS, mlprogress,GTK, MLPROGRESS)
 EXPAND(MLDONKEYGUI,mlgui,GTK,MLDONKEYGUI)
 
@@ -1530,18 +1536,18 @@
  EXPAND(MLDONKEYGUI2,mlgui2,GTK,MLDONKEYGUI2)
 endif
 
-EXPAND(mldc,mldc,NO,mldc)
-EXPAND(mldc+gui,mldc+gui,GTK,mldc+gui)
-EXPAND(mlnap,mlnap,NO,mlnap)
-EXPAND(mlnap+gui,mlnap+gui,GTK,mlnap+gui)
-EXPAND(MLNET,mlnet,NO,MLNET)
-EXPAND(mlnet+gui,mlnet+gui,GTK,mlnet+gui)
-EXPAND(mlgnut,mlgnut,NO,mlgnut)
-EXPAND(mlbt,mlbt,NO,mlbt)
-EXPAND(mlgnut+gui,mlgnut+gui,GTK,mlgnut+gui)
-EXPAND(mlbt+gui,mlbt+gui,GTK,mlbt+gui)
-EXPAND(mlslsk,mlslsk,NO,mlslsk)
-EXPAND(mlslsk+gui,mlslsk+gui,GTK,mlslsk+gui)
+EXPAND(mldc,mldc,NO,mldc,GD)
+EXPAND(mldc+gui,mldc+gui,GTK,mldc+gui,GD)
+EXPAND(mlnap,mlnap,NO,mlnap,GD)
+EXPAND(mlnap+gui,mlnap+gui,GTK,mlnap+gui,GD)
+EXPAND(MLNET,mlnet,NO,MLNET,GD)
+EXPAND(mlnet+gui,mlnet+gui,GTK,mlnet+gui,GD)
+EXPAND(mlgnut,mlgnut,NO,mlgnut,GD)
+EXPAND(mlbt,mlbt,NO,mlbt,GD)
+EXPAND(mlgnut+gui,mlgnut+gui,GTK,mlgnut+gui,GD)
+EXPAND(mlbt+gui,mlbt+gui,GTK,mlbt+gui,GD)
+EXPAND(mlslsk,mlslsk,NO,mlslsk,GD)
+EXPAND(mlslsk+gui,mlslsk+gui,GTK,mlslsk+gui,GD)
 EXPAND(MLDONKEY_IM,mlim,GTK,MLDONKEY_IM)
 EXPAND(STARTER,mlguistarter,GTK)
 EXPAND(MLCHAT,mlchat,GTK,MLCHAT)
@@ -1668,7 +1674,7 @@
        rm -f *.cm? donkey_* *.byte *.cm?? $(TARGETS) *~ TAGS *.o core *.static 
*.a
        rm -f build/*.a build/*.cma build/*.cmxa
        rm -f *_plugin
-       rm -f mldonkey mlgui mlnet.exe mlgui.exe
+       rm -f mldonkey mlgui mlnet.exe mlgui.exe mldonkeytop mldonkeytop.exe
        rm -f svg_converter svg_converter.byte mld_hash make_torrent 
copysources get_range subconv dp500
        rm -f svg_converter.exe mld_hash.exe make_torrent.exe copysources.exe 
get_range.exe subconv.exe dp500.exe
        (for i in $(SUBDIRS); do \
@@ -1693,7 +1699,7 @@
        rm -f packages/rpm/Makefile
        rm -f packages/slackware/mldonkey.options
        rm -f packages/windows/mlnet.nsi
-       rm -f src/daemon/common/commonGraphics.ml
+       rm -f src/daemon/driver/driverGraphics.ml
        rm -f src/utils/lib/autoconf.ml
        rm -f src/utils/lib/autoconf.ml.new
        rm -f src/utils/lib/gAutoconf.ml
Index: mldonkey/config/configure.in
diff -u mldonkey/config/configure.in:1.245 mldonkey/config/configure.in:1.246
--- mldonkey/config/configure.in:1.245  Thu Jan 19 10:19:28 2006
+++ mldonkey/config/configure.in        Wed Jan 25 22:29:53 2006
@@ -54,6 +54,8 @@
     ;;
   *netbsd*)
     SYSTEM=netbsd
+    CPPFLAGS="${CPPFLAGS} -I/usr/pkg/include"
+    LDFLAGS="${LDFLAGS} -L/usr/pkg/lib"
     ;;
   *linux*)
     SYSTEM=linux
@@ -107,7 +109,7 @@
       AC_CHECK_PROG(CUT, cut, cut)
       if test "$ac_cv_prog_CUT" = "cut"; then
         SUB_VERSION3="CVS"
-       if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "darwin"]; then
+       if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "darwin"] || [ 
test "$SYSTEM" = "netbsd"]; then
          SCM_VERSION=`$STAT -f "%Sm" ./CVS/Entries | $SED -e 's/\(.*\) \(.*\) 
\(.*\) \(.*\)/\4-\1-\2 \3/'`
        else
          if [ test "$SYSTEM" = "openbsd"]; then
@@ -237,8 +239,8 @@
 GD=yes
 AC_ARG_ENABLE(gd,       [  --disable-gd            disable the use of gd], 
[GD="$enableval"])
 
-USE_BZIP2=yes
-AC_ARG_ENABLE(bzip2,       [  --disable-bzip2         disable the use of 
bzip2], [USE_BZIP2="$enableval"])
+BZIP2=yes
+AC_ARG_ENABLE(bzip2,       [  --disable-bzip2         disable the use of 
bzip2], [BZIP2="$enableval"])
 
 ifelse(AC_ACVERSION, [2.13], [],
 [dnl Large file enabled
@@ -546,21 +548,17 @@
 AC_CHECK_HEADERS(zlib.h,,[AC_MSG_FAILURE([Zlib missing, did you install zlib 
and zlib-developer packages?])])
 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
 
-BZIP2=no
-HAS_BZIP2=false
-if test "$USE_BZIP2" != "no"; then
-  AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],)])
+if test "$BZIP2" != "no"; then
+  
AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])])
 fi
 
 if test "$BZIP2" = "yes"; then
-  HAS_BZIP2=true
   cp -f ../src/utils/lib/misc2_bz2.ml ../src/utils/lib/misc2.ml
   cp -f ../src/utils/cdk/tar_bz2.ml ../src/utils/cdk/tar.ml
   cp -f ../src/utils/cdk/tar_bz2.mli ../src/utils/cdk/tar.mli
   AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
   AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
 else
-  AC_MSG_WARN(Your system lacks bzip2 support)
   cp -f ../src/utils/lib/misc2_no_bz2.ml ../src/utils/lib/misc2.ml
   cp -f ../src/utils/cdk/tar_no_bz2.ml ../src/utils/cdk/tar.ml
   cp -f ../src/utils/cdk/tar_no_bz2.mli ../src/utils/cdk/tar.mli
@@ -956,9 +954,6 @@
 
 # testing for gd support
 
-HAS_GD=false
-HAS_GD_JPG=false
-HAS_GD_PNG=false
 GD_JPG=no
 GD_PNG=no
 if test "$GD" != "no"; then
@@ -968,11 +963,26 @@
 
   AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
   if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
-    GDLIBCONFIG=`$GDLIBCONFIG --libs`
-    GDLIBS="$LIBS -lgd $GDLIBCONFIG"
+    GDLIBLIBS=`$GDLIBCONFIG --libs`
+    GDLIBS="$LIBS -lgd $GDLIBLIBS"
     LIBS=$GDLIBS
+    AC_MSG_CHECKING(for libgd > 2.0.14)
+    GDVERSION=`$GDLIBCONFIG --version`
+    GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
+    GDMINORVERSION=`$GDLIBCONFIG --minorversion`
+    GDREVISION=`$GDLIBCONFIG --revision`
+    if [ [ $GDMAJORVERSION = 2 ] && [ $GDMINORVERSION = 0 ] && [ $GDREVISION 
-gt 14 ]]; then
+       AC_MSG_RESULT($GDVERSION)
+       LIBGD=yes
+    else
+       AC_MSG_RESULT(no (found $GDVERSION))
+       LIBGD=no
+    fi
+  else
+    LIBGD=yes
   fi
 
+  if test "$LIBGD" = "yes"; then
   AC_MSG_CHECKING(for gdImageCreate in -lgd)
   AC_TRY_LINK([#include <gd.h>],
   [gdImageCreate (0,0);],
@@ -984,6 +994,7 @@
     AC_MSG_NOTICE([not found, trying another method])
     AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
   fi
+  fi
 
   if test "$LIBGD" = "yes"; then
 
@@ -1010,13 +1021,11 @@
       AC_MSG_CHECKING(for png support in libgd)
       if test "$LIBGD_PNG" = "yes"; then
         GD=yes
-        HAS_GD_PNG=true
        GD_PNG=yes
         AC_MSG_RESULT(yes)
        AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 
1,)])
         AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in 
libgd.])
       else
-        HAS_GD_PNG=false
         AC_MSG_RESULT(no)
       fi
     fi
@@ -1044,12 +1053,10 @@
       AC_MSG_CHECKING(for jpeg support in libgd)
       if test "$LIBGD_JPG" = "yes"; then
         GD=yes
-       HAS_GD_JPG=true
        GD_JPG=yes
         AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in 
libgd.])
         AC_MSG_RESULT(yes)
       else
-       HAS_GD_JPG=false
         AC_MSG_RESULT(no)
       fi
     fi
@@ -1059,11 +1066,9 @@
   LIBS=$SAVE_LIBS
 fi
 if test "$GD" != "no"; then
-  HAS_GD=true
-  cp -f ../src/daemon/common/commonGraphics.gd.ml 
../src/daemon/common/commonGraphics.ml
+  GDGRAPHICS=DriverGraphics_gd
 else
-  HAS_GD=false
-  cp -f ../src/daemon/common/commonGraphics.nogd.ml 
../src/daemon/common/commonGraphics.ml
+  GDGRAPHICS=DriverGraphics_nogd
 fi
 
 MD4ARCH=$arch
@@ -1123,10 +1128,6 @@
 AC_SUBST(LABLGL_CMXA)
 AC_SUBST(MD4ARCH)
 AC_SUBST(MD4COMP)
-AC_SUBST(BZIP2)
-AC_SUBST(GD)
-AC_SUBST(GD_JPG)
-AC_SUBST(GD_PNG)
 AC_SUBST(ICONV)
 
 AC_SUBST(OPEN_NAPSTER)
@@ -1165,10 +1166,11 @@
 AC_SUBST(GTKCFLAGS)
 AC_SUBST(GTKLLIBS)
 AC_SUBST(GTKLFLAGS)
-AC_SUBST(HAS_GD)
-AC_SUBST(HAS_GD_PNG)
-AC_SUBST(HAS_GD_JPG)
-AC_SUBST(HAS_BZIP2)
+AC_SUBST(GD)
+AC_SUBST(GD_JPG)
+AC_SUBST(GD_PNG)
+AC_SUBST(GDGRAPHICS)
+AC_SUBST(BZIP2)
 
 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
 AC_SUBST(BUILD_SYSTEM)
@@ -1182,6 +1184,7 @@
   Makefile.config \
   mldonkey.rc \
   $AUTOCONF.new $GTK_AUTOCONF.new \
+   ../src/daemon/driver/driverGraphics.ml \
    ../packages/rpm/mldonkey.spec \
    ../packages/rpm/Makefile \
    ../packages/slackware/mldonkey.options \
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.684 mldonkey/distrib/ChangeLog:1.685
--- mldonkey/distrib/ChangeLog:1.684    Thu Jan 19 10:19:28 2006
+++ mldonkey/distrib/ChangeLog  Wed Jan 25 22:29:53 2006
@@ -14,6 +14,14 @@
 ChangeLog
 =========
 
+2006/01/25
+4820: Move CommonGraphics to DriverGraphics, check libgd version
+      Configure: Check if libgd > 2.0.14 is installed
+      NetBSD: added paths for libgd package
+      NetBSD: adjusted stat command to properly read SCM date
+      move build-, run-, and diskinfo command to driver module
+      (thanks to SchAmane)
+
 2006/01/19: version 2.7.3 = tag release-2-7-3
 4791: web_infos: New type geoip.dat, save files to local disk,
       re-download only if file on server is newer
Index: mldonkey/src/daemon/common/commonComplexOptions.ml
diff -u mldonkey/src/daemon/common/commonComplexOptions.ml:1.48 
mldonkey/src/daemon/common/commonComplexOptions.ml:1.49
--- mldonkey/src/daemon/common/commonComplexOptions.ml:1.48     Thu Jan 19 
02:13:19 2006
+++ mldonkey/src/daemon/common/commonComplexOptions.ml  Wed Jan 25 22:29:53 2006
@@ -1089,191 +1089,6 @@
   end;
   lprintf_nl () "Options backup as %s correctly saved" format
              
-let buildinfo html buf =
-  let s =
-  (
-        "MLNet Multi-Network p2p client version " ^ Autoconf.current_version
-      ^ (if Autoconf.scm_version <> "" then "\nSCM version info: " ^ 
Autoconf.scm_version else "")
-      ^ "\nNetworks: " ^ !networks_string
-      ^ "\nOcaml version: " ^ Sys.ocaml_version
-      ^ "\nBuild on: " ^ Autoconf.build_system ^ " (" ^ Unix2.endianness () ^ 
")"
-      ^ (if Autoconf.glibc_version = "" then "" 
-          else
-            let real_glibc_version = MlUnix.glibc_version_num () in
-            if real_glibc_version = "" || real_glibc_version = 
Autoconf.glibc_version 
-              then " with glibc " ^ Autoconf.glibc_version
-            else 
-              Printf.sprintf " (Warning: glibc version mismatch, %s present on 
your system, MlDonkey was compiled with %s)"
-              real_glibc_version Autoconf.glibc_version)  
-      ^ (if Autoconf.configure_arguments <> "" then
-           "\nConfigure arguments: " ^ Autoconf.configure_arguments else "")
-      ^ (if !patches_string <> "" then "\n" ^ !patches_string else "")
-      ^ "\nFeatures:"
-          ^ (if BasicSocket.has_threads () then " threads" else " no-threads")
-          ^ (let s = Zlib.zlib_version_num () in Printf.sprintf " zlib%s" (if 
s <> "" then "-" ^ s else ""))
-          ^ (if Autoconf.has_bzip2 then
-              begin
-                let s =
-                  (* catch the exception in the case Bzip2.bzlib_version_num 
returns an empty string *)
-                  try
-                    List.hd(String2.split_simplify
-                  (Misc2.bzlib_version_num ()) ',') 
-                  with e -> ""
-                in
-                Printf.sprintf " bzip2%s" (if s <> "" then "-" ^ s else "")
-              end
-            else " no-bzip2")
-          ^ (if Autoconf.has_gd && Autoconf.has_gd_png && Autoconf.has_gd_jpg 
then
-              Printf.sprintf " gd(jpg/png%s)"
-                (let s = CommonGraphics.png_version_num () in
-                   if s <> "" then "-" ^ s else "")
-            else "")
-          ^ (if Autoconf.has_gd && Autoconf.has_gd_png && not 
Autoconf.has_gd_jpg then
-              Printf.sprintf " gd(png%s)"
-                (let s = CommonGraphics.png_version_num () in
-                   if s <> "" then "-" ^ s else "")
-            else "")
-         ^ (if Autoconf.has_gd && not Autoconf.has_gd_png && 
Autoconf.has_gd_jpg then " gd(jpg)" else "")
-         ^ (if not Autoconf.has_gd then " no-gd" else "")
-          ^ (if Autoconf.has_iconv then " iconv" else " no-iconv")
-          ^ (if Autoconf.check_bounds then " check-bounds" else " 
no-check-bounds")
-  )
-  in
-  if html then
-    begin
-      Printf.bprintf buf "\\<div class=\\\"cs\\\"\\>";
-      html_mods_table_header buf "versionTable" "results" [];
-      Printf.bprintf buf "\\<tr\\>";
-      html_mods_td buf [ ("", "srh", "Buildinfo"); ];
-      Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
-      html_mods_td buf [ ("", "sr", Str.global_replace (Str.regexp "\n") 
"\\<br\\>" s); ];
-      Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>";
-    end
-  else
-    Printf.bprintf buf "Buildinfo:\n%s\n" s
-  
-let runinfo html buf =
-  let s =
-  (
-        "Enabled Networks: " 
-      ^   (if Autoconf.donkey = "yes" && !!enable_donkey then " Donkey" else 
"")
-      ^   (if Autoconf.donkey = "yes" && !!enable_overnet then " Overnet" else 
"")
-      ^   (if Autoconf.donkey = "yes" && !!enable_kademlia then " Kademlia" 
else "")             
-      ^   (if Autoconf.bittorrent = "yes" && !!enable_bittorrent then " 
BitTorrent" else "")
-      ^   (if Autoconf.fasttrack = "yes" && !!enable_fasttrack then " 
Fasttrack" else "")
-      ^   (if Autoconf.gnutella = "yes" && !!enable_gnutella then " Gnutella" 
else "")
-      ^   (if Autoconf.gnutella2 = "yes" && !!enable_gnutella2 then " G2" else 
"")
-      ^   (if Autoconf.filetp = "yes" && !!enable_fileTP then " FileTP" else 
"")
-      ^  "\nServer usage: " ^ (if !!enable_servers then "enabled" else 
"disabled (you are not able to connect to ED2K Servers)")
-      ^  (if !Geoip.active then "\nThis product includes GeoLite data created 
by MaxMind, available from http://maxmind.com/"; else "")
-      ^  (let r1,r2 = Ip_set.block_stats () in if r1 = 0 then
-           "\nIP blocking disabled" else Printf.sprintf "\nIP blocking 
enabled: %d ranges loaded - optimized to %d" r1 r2)
-      ^ (let uname = Unix32.uname () in
-          if uname <> "" then Printf.sprintf "\nSystem info: %s" uname else "")
-      ^ "\nUptime: " ^ Date.time_to_string (last_time () - start_time) 
"verbose"
-      ^ " - Language: " ^ Charset.default_language
-      ^ " - locale: " ^ Charset.locstr
-      ^ " - UTC offset: " ^ Rss_date.mk_timezone (Unix.time ())
-      ^ "\n max_string_length: " ^ string_of_int Sys.max_string_length
-      ^ " - word_size: " ^ string_of_int Sys.word_size
-      ^ " - max_array_length: " ^ string_of_int Sys.max_array_length
-      ^ "\n max file descriptors: " ^ string_of_int (Unix2.c_getdtablesize ())
-      ^ " - max useable file size: " ^ 
-           (match Unix2.c_sizeofoff_t () with
-            | 4 -> "2GB"
-            |  _ -> Printf.sprintf "2^%d-1 bits (do the maths ;-p)" 
((Unix2.c_sizeofoff_t () *8)-1)
-            )
-  )    
-  in
-  if html then
-    begin
-      Printf.bprintf buf "\\<div class=\\\"cs\\\"\\>";
-      html_mods_table_header buf "versionTable" "results" [];
-      Printf.bprintf buf "\\<tr\\>";
-      html_mods_td buf [ ("", "srh", "Runinfo"); ];
-      Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
-      html_mods_td buf [ ("", "sr", Str.global_replace (Str.regexp "\n") 
"\\<br\\>" s); ];
-      Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>";
-    end
-  else
-    Printf.bprintf buf "Runinfo:\n%s\n" s
-
-let diskinfo html buf =
-  let list = ref [] in
-  ignore (search_incoming_files ());
-  ignore (search_incoming_directories ());
-  List.iter (fun dir ->
-     list := (dir.shdir_dirname, (Printf.sprintf "shared (%s)" 
dir.shdir_strategy))
-     :: !list) !!shared_directories;
-  list := (!!temp_directory, "temp/downloading") :: !list;
-  list := (Sys.getcwd (), "core/ini files") :: !list;
-
-  let len_dir = ref 9 in
-  let len_strategy = ref 29 in (* "shared (incoming_directories)" *)
-  List.iter ( fun (dir, strategy) ->
-    len_dir := maxi !len_dir (String.length dir);
-    len_strategy := maxi !len_strategy (String.length strategy)
-  ) !list;
-  let fill_dir = String.make (!len_dir - 9) ' ' in
-  let fill_dir_line = String.make (!len_dir - 9) '-' in
-  let fill_strategy = String.make (!len_strategy - 4) ' ' in
-  let fill_strategy_line = String.make (!len_strategy - 4) '-' in
-  let counter = ref 0 in
-  if html then
-      html_mods_table_header buf "sharesTable" "shares" [
-       ( "0", "srh", "Directory", "Directory" ) ;
-       ( "0", "srh", "Directory type", "Type" ) ;
-       ( "1", "srh ar", "HDD used", "used" ) ;
-       ( "1", "srh ar", "HDD free", "free" ) ;
-       ( "1", "srh ar", "% free", "% free" ) ;
-       ( "0", "srh", "Filesystem", "FS" ) ]
-  else
-    begin
-      Printf.bprintf buf "Diskinfo:\n";
-      Printf.bprintf buf "Directory%s|Type%s|    used|    
free|%%free|Filesystem\n"
-        fill_dir fill_strategy;
-      Printf.bprintf buf 
"---------%s+----%s+--------+--------+-----+----------\n"
-        fill_dir_line fill_strategy_line;
-    end;
-  List.iter (fun (dir, strategy) ->
-       incr counter;
-       let diskused =
-         match Unix32.diskused dir with
-         | None -> Printf.sprintf "---"
-         | Some du -> size_of_int64 du
-       in
-       let diskfree =
-         match Unix32.diskfree dir with
-         | None -> Printf.sprintf "---"
-         | Some df -> size_of_int64 df
-       in
-       let percentfree =
-         match Unix32.percentfree dir with
-         | None -> Printf.sprintf "---"
-         | Some p -> Printf.sprintf "%d%%" p
-       in
-       let filesystem = Unix32.filesystem dir in
-       if html then
-         begin
-           Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>
-       \\<td class=\\\"sr\\\"\\>%s\\</td\\>
-       \\<td class=\\\"sr\\\"\\>%s\\</td\\>
-       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
-       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
-       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
-       \\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
-           (if !counter mod 2 == 0 then "dl-1" else "dl-2")
-           dir strategy diskused diskfree percentfree filesystem
-         end
-       else
-         Printf.bprintf buf "%-*s|%-*s|%8s|%8s|%5s|%-s\n"
-           (maxi !len_dir (!len_dir - String.length dir)) dir
-           (maxi !len_strategy (!len_strategy - String.length strategy)) 
strategy
-           diskused diskfree percentfree filesystem
-       ) !list;
-  if html then
-    Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>"
-
 let _ =
   option_hook ip_blocking (fun _ ->
     (try
Index: mldonkey/src/daemon/common/commonComplexOptions.mli
diff -u mldonkey/src/daemon/common/commonComplexOptions.mli:1.15 
mldonkey/src/daemon/common/commonComplexOptions.mli:1.16
--- mldonkey/src/daemon/common/commonComplexOptions.mli:1.15    Wed Jan  4 
14:04:42 2006
+++ mldonkey/src/daemon/common/commonComplexOptions.mli Wed Jan 25 22:29:53 2006
@@ -21,9 +21,6 @@
 val save : unit -> unit
 val save_sources : unit -> unit
 val backup_options : unit -> unit
-val buildinfo : bool -> Buffer.t -> unit
-val runinfo : bool -> Buffer.t -> unit
-val diskinfo : bool -> Buffer.t -> unit
   
 val done_files :  CommonTypes.file list Options.option_record
 val files :  CommonTypes.file list Options.option_record
@@ -43,6 +40,8 @@
   
 val incoming_files : unit -> CommonTypes.shared_directory
 val incoming_directories : unit -> CommonTypes.shared_directory
+val search_incoming_files : unit -> CommonTypes.shared_directory
+val search_incoming_directories : unit -> CommonTypes.shared_directory
   
 val sharing_only_directory : CommonTypes.sharing_strategy
 
Index: mldonkey/src/daemon/driver/driverCommands.ml
diff -u mldonkey/src/daemon/driver/driverCommands.ml:1.115 
mldonkey/src/daemon/driver/driverCommands.ml:1.116
--- mldonkey/src/daemon/driver/driverCommands.ml:1.115  Thu Jan 12 09:03:11 2006
+++ mldonkey/src/daemon/driver/driverCommands.ml        Wed Jan 25 22:29:53 2006
@@ -452,27 +452,27 @@
 
     "sysinfo", Arg_none (fun o ->
        let buf = o.conn_buf in
-        ignore(CommonComplexOptions.buildinfo (o.conn_output = HTML) buf);
-        ignore(CommonComplexOptions.runinfo (o.conn_output = HTML) buf);
-        ignore(CommonComplexOptions.diskinfo (o.conn_output = HTML) buf);
+        ignore(buildinfo (o.conn_output = HTML) buf);
+        ignore(runinfo (o.conn_output = HTML) buf);
+        ignore(diskinfo (o.conn_output = HTML) buf);
         ""
     ), ":\t\t\t\tprint mldonkey core build, runtime and disk information";
 
     "buildinfo", Arg_none (fun o ->
        let buf = o.conn_buf in
-        ignore(CommonComplexOptions.buildinfo (o.conn_output = HTML) buf);
+        ignore(buildinfo (o.conn_output = HTML) buf);
         ""
     ), ":\t\t\t\tprint mldonkey core build information";
 
     "runinfo", Arg_none (fun o ->
        let buf = o.conn_buf in
-        ignore(CommonComplexOptions.runinfo (o.conn_output = HTML) buf);
+        ignore(runinfo (o.conn_output = HTML) buf);
         ""
     ), ":\t\t\t\tprint mldonkey runtime information";
 
     "diskinfo", Arg_none (fun o ->
        let buf = o.conn_buf in
-        ignore(CommonComplexOptions.diskinfo (o.conn_output = HTML) buf);
+        ignore(diskinfo (o.conn_output = HTML) buf);
         ""
     ), ":\t\t\t\tprint mldonkey disk information";
 
@@ -1162,7 +1162,7 @@
         let buf = o.conn_buf in
        if Autoconf.has_gd then
          begin
-           CommonGraphics.really_remove_files ();
+           DriverGraphics.G.really_remove_files ();
            Printf.bprintf buf "Gd files were removed"
          end
        else
Index: mldonkey/src/daemon/driver/driverControlers.ml
diff -u mldonkey/src/daemon/driver/driverControlers.ml:1.57 
mldonkey/src/daemon/driver/driverControlers.ml:1.58
--- mldonkey/src/daemon/driver/driverControlers.ml:1.57 Wed Jan  4 14:04:42 2006
+++ mldonkey/src/daemon/driver/driverControlers.ml      Wed Jan 25 22:29:53 2006
@@ -25,7 +25,6 @@
 open CommonSearch
 open CommonTypes
 open CommonGlobals
-open CommonGraphics
 open CommonShared
 open GuiTypes
 open CommonComplexOptions
@@ -33,6 +32,7 @@
 open Options
 open BasicSocket
 open TcpBufferedSocket
+open DriverGraphics
 open DriverInteractive
 open CommonOptions
 
@@ -1147,106 +1147,106 @@
             html_open_page buf t r true;
             Buffer.add_string buf !!motd_html;
            Buffer.add_string buf "<p><pre>";
-           ignore (CommonComplexOptions.buildinfo false buf);
+           ignore (buildinfo false buf);
            Buffer.add_string buf "\n";
-           ignore (CommonComplexOptions.runinfo false buf);
+           ignore (runinfo false buf);
            Buffer.add_string buf "</pre>\n"
 
         | "bw_updown.png" ->
             (match http_error_no_gd "png" with
               false ->
-                do_draw_pic "Traffic" "s(kb)" "t(h:m:s)" download_history 
upload_history;
+                G.do_draw_pic "Traffic" "s(kb)" "t(h:m:s)" download_history 
upload_history;
                 http_send_bin r buf "bw_updown.png"
             | true -> raise Not_found)
 
         | "bw_updown.jpg" ->
             (match http_error_no_gd "jpg" with
               false ->
-                do_draw_pic "Traffic" "s(kb)" "t(h:m:s)" download_history 
upload_history;
+                G.do_draw_pic "Traffic" "s(kb)" "t(h:m:s)" download_history 
upload_history;
                 http_send_bin r buf "bw_updown.jpg"
             | true -> raise Not_found)
 
         | "bw_download.png" ->
             (match http_error_no_gd "png" with
               false ->
-                do_draw_down_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_history;
+                G.do_draw_down_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_history;
                 http_send_bin r buf "bw_download.png"
             | true -> raise Not_found)
 
         | "bw_download.jpg" ->
             (match http_error_no_gd "jpg" with
               false ->
-                do_draw_down_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_history;
+                G.do_draw_down_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_history;
                 http_send_bin r buf "bw_download.jpg"
             | true -> raise Not_found)
 
         | "bw_upload.png" ->
             (match http_error_no_gd "png" with
               false ->
-                do_draw_up_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_history;
+                G.do_draw_up_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_history;
                 http_send_bin r buf "bw_upload.png"
             | true -> raise Not_found)
 
         | "bw_upload.jpg" ->
             (match http_error_no_gd "jpg" with
             | false ->
-                do_draw_up_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_history;
+                G.do_draw_up_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_history;
                 http_send_bin r buf "bw_upload.jpg"
             | true -> raise Not_found)
 
         | "bw_h_updown.png" ->
             (match http_error_no_gd "png" with
             | false ->
-                do_draw_h_pic "Traffic" "s(kb)" "t(h:m:s)" download_h_history 
upload_h_history;
+                G.do_draw_h_pic "Traffic" "s(kb)" "t(h:m:s)" 
download_h_history upload_h_history;
                 http_send_bin r buf "bw_h_updown.png"
             | true -> raise Not_found)
 
         | "bw_h_updown.jpg" ->
             (match http_error_no_gd "jpg" with
             | false ->
-                do_draw_h_pic "Traffic" "s(kb)" "t(h:m:s)" download_h_history 
upload_h_history;
+                G.do_draw_h_pic "Traffic" "s(kb)" "t(h:m:s)" 
download_h_history upload_h_history;
                 http_send_bin r buf "bw_h_updown.jpg"
             | true -> raise Not_found)
 
         | "bw_h_download.png" ->
             (match http_error_no_gd "png" with
             | false ->
-                do_draw_down_h_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_h_history;
+                G.do_draw_down_h_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_h_history;
                 http_send_bin r buf "bw_h_download.png"
             | true -> raise Not_found)
 
         | "bw_h_download.jpg" ->
             (match http_error_no_gd "jpg" with
             | false ->
-                do_draw_down_h_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_h_history;
+                G.do_draw_down_h_pic "Traffic" "download" "s(kb)" "t(h:m:s)" 
download_h_history;
                 http_send_bin r buf "bw_h_download.jpg"
             | true -> raise Not_found)
 
         | "bw_h_upload.png" ->
             (match http_error_no_gd "png" with
             | false ->
-                do_draw_up_h_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_h_history;
+                G.do_draw_up_h_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_h_history;
                 http_send_bin r buf "bw_h_upload.png"
             | true -> raise Not_found)
 
         | "bw_h_upload.jpg" ->
             (match http_error_no_gd "jpg" with
             | false ->
-                do_draw_up_h_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_h_history;
+                G.do_draw_up_h_pic "Traffic" "upload" "s(kb)" "t(h:m:s)" 
upload_h_history;
                 http_send_bin r buf "bw_h_upload.jpg"
             | true -> raise Not_found)
 
         | "tag.png" ->
             (match http_error_no_gd "png" with
             | false ->
-                do_draw_tag !!html_mods_vd_gfx_tag_title download_history 
upload_history;
+                G.do_draw_tag !!html_mods_vd_gfx_tag_title download_history 
upload_history;
                 http_send_bin r buf "tag.png"
             | true -> raise Not_found)
 
         | "tag.jpg" ->
             (match http_error_no_gd "jpg" with
             | false ->
-                do_draw_tag !!html_mods_vd_gfx_tag_title download_history 
upload_history;
+                G.do_draw_tag !!html_mods_vd_gfx_tag_title download_history 
upload_history;
                 http_send_bin r buf "tag.jpg"
             | true -> raise Not_found)
 
Index: mldonkey/src/daemon/driver/driverInteractive.ml
diff -u mldonkey/src/daemon/driver/driverInteractive.ml:1.56 
mldonkey/src/daemon/driver/driverInteractive.ml:1.57
--- mldonkey/src/daemon/driver/driverInteractive.ml:1.56        Thu Jan 19 
00:44:47 2006
+++ mldonkey/src/daemon/driver/driverInteractive.ml     Wed Jan 25 22:29:53 2006
@@ -1617,5 +1617,189 @@
     )
   else
     (* fake call if no gd *)
-    CommonGraphics.do_draw_pic "" "" "" download_history download_history
+    DriverGraphics.G.do_draw_pic "" "" "" download_history download_history
 
+let buildinfo html buf =
+  let s =
+  (
+        "MLNet Multi-Network p2p client version " ^ Autoconf.current_version
+      ^ (if Autoconf.scm_version <> "" then "\nSCM version info: " ^ 
Autoconf.scm_version else "")
+      ^ "\nNetworks: " ^ !networks_string
+      ^ "\nOcaml version: " ^ Sys.ocaml_version
+      ^ "\nBuild on: " ^ Autoconf.build_system ^ " (" ^ Unix2.endianness () ^ 
")"
+      ^ (if Autoconf.glibc_version = "" then "" 
+          else
+            let real_glibc_version = MlUnix.glibc_version_num () in
+            if real_glibc_version = "" || real_glibc_version = 
Autoconf.glibc_version 
+              then " with glibc " ^ Autoconf.glibc_version
+            else 
+              Printf.sprintf " (Warning: glibc version mismatch, %s present on 
your system, MlDonkey was compiled with %s)"
+              real_glibc_version Autoconf.glibc_version)  
+      ^ (if Autoconf.configure_arguments <> "" then
+           "\nConfigure arguments: " ^ Autoconf.configure_arguments else "")
+      ^ (if !patches_string <> "" then "\n" ^ !patches_string else "")
+      ^ "\nFeatures:"
+          ^ (if BasicSocket.has_threads () then " threads" else " no-threads")
+          ^ (let s = Zlib.zlib_version_num () in Printf.sprintf " zlib%s" (if 
s <> "" then "-" ^ s else ""))
+          ^ (if Autoconf.bzip2 then
+              begin
+                let s =
+                  (* catch the exception in the case Bzip2.bzlib_version_num 
returns an empty string *)
+                  try
+                    List.hd(String2.split_simplify
+                  (Misc2.bzlib_version_num ()) ',') 
+                  with e -> ""
+                in
+                Printf.sprintf " bzip2%s" (if s <> "" then "-" ^ s else "")
+              end
+            else " no-bzip2")
+          ^ (if Autoconf.has_gd && Autoconf.has_gd_png && Autoconf.has_gd_jpg 
then
+              Printf.sprintf " gd(jpg/png%s)"
+                (let s = DriverGraphics.G.png_version_num () in
+                   if s <> "" then "-" ^ s else "")
+            else "")
+          ^ (if Autoconf.has_gd && Autoconf.has_gd_png && not 
Autoconf.has_gd_jpg then
+              Printf.sprintf " gd(png%s)"
+                (let s = DriverGraphics.G.png_version_num () in
+                   if s <> "" then "-" ^ s else "")
+            else "")
+         ^ (if Autoconf.has_gd && not Autoconf.has_gd_png && 
Autoconf.has_gd_jpg then " gd(jpg)" else "")
+         ^ (if not Autoconf.has_gd then " no-gd" else "")
+          ^ (if Autoconf.has_iconv then " iconv" else " no-iconv")
+          ^ (if Autoconf.check_bounds then " check-bounds" else " 
no-check-bounds")
+  )
+  in
+  if html then
+    begin
+      Printf.bprintf buf "\\<div class=\\\"cs\\\"\\>";
+      html_mods_table_header buf "versionTable" "results" [];
+      Printf.bprintf buf "\\<tr\\>";
+      html_mods_td buf [ ("", "srh", "Buildinfo"); ];
+      Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
+      html_mods_td buf [ ("", "sr", Str.global_replace (Str.regexp "\n") 
"\\<br\\>" s); ];
+      Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>";
+    end
+  else
+    Printf.bprintf buf "Buildinfo:\n%s\n" s
+  
+let runinfo html buf =
+  let s =
+  (
+        "Enabled Networks: " 
+      ^   (if Autoconf.donkey = "yes" && !!enable_donkey then " Donkey" else 
"")
+      ^   (if Autoconf.donkey = "yes" && !!enable_overnet then " Overnet" else 
"")
+      ^   (if Autoconf.donkey = "yes" && !!enable_kademlia then " Kademlia" 
else "")             
+      ^   (if Autoconf.bittorrent = "yes" && !!enable_bittorrent then " 
BitTorrent" else "")
+      ^   (if Autoconf.fasttrack = "yes" && !!enable_fasttrack then " 
Fasttrack" else "")
+      ^   (if Autoconf.gnutella = "yes" && !!enable_gnutella then " Gnutella" 
else "")
+      ^   (if Autoconf.gnutella2 = "yes" && !!enable_gnutella2 then " G2" else 
"")
+      ^   (if Autoconf.filetp = "yes" && !!enable_fileTP then " FileTP" else 
"")
+      ^  "\nServer usage: " ^ (if !!enable_servers then "enabled" else 
"disabled (you are not able to connect to ED2K Servers)")
+      ^  (if !Geoip.active then "\nThis product includes GeoLite data created 
by MaxMind, available from http://maxmind.com/"; else "")
+      ^  (let r1,r2 = Ip_set.block_stats () in if r1 = 0 then
+           "\nIP blocking disabled" else Printf.sprintf "\nIP blocking 
enabled: %d ranges loaded - optimized to %d" r1 r2)
+      ^ (let uname = Unix32.uname () in
+          if uname <> "" then Printf.sprintf "\nSystem info: %s" uname else "")
+      ^ "\nUptime: " ^ Date.time_to_string (last_time () - start_time) 
"verbose"
+      ^ " - Language: " ^ Charset.default_language
+      ^ " - locale: " ^ Charset.locstr
+      ^ " - UTC offset: " ^ Rss_date.mk_timezone (Unix.time ())
+      ^ "\n max_string_length: " ^ string_of_int Sys.max_string_length
+      ^ " - word_size: " ^ string_of_int Sys.word_size
+      ^ " - max_array_length: " ^ string_of_int Sys.max_array_length
+      ^ "\n max file descriptors: " ^ string_of_int (Unix2.c_getdtablesize ())
+      ^ " - max useable file size: " ^ 
+           (match Unix2.c_sizeofoff_t () with
+            | 4 -> "2GB"
+            |  _ -> Printf.sprintf "2^%d-1 bits (do the maths ;-p)" 
((Unix2.c_sizeofoff_t () *8)-1)
+            )
+  )    
+  in
+  if html then
+    begin
+      Printf.bprintf buf "\\<div class=\\\"cs\\\"\\>";
+      html_mods_table_header buf "versionTable" "results" [];
+      Printf.bprintf buf "\\<tr\\>";
+      html_mods_td buf [ ("", "srh", "Runinfo"); ];
+      Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
+      html_mods_td buf [ ("", "sr", Str.global_replace (Str.regexp "\n") 
"\\<br\\>" s); ];
+      Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>";
+    end
+  else
+    Printf.bprintf buf "Runinfo:\n%s\n" s
+
+let diskinfo html buf =
+  let list = ref [] in
+  ignore (search_incoming_files ());
+  ignore (search_incoming_directories ());
+  List.iter (fun dir ->
+     list := (dir.shdir_dirname, (Printf.sprintf "shared (%s)" 
dir.shdir_strategy))
+     :: !list) !!shared_directories;
+  list := (!!temp_directory, "temp/downloading") :: !list;
+  list := (Sys.getcwd (), "core/ini files") :: !list;
+
+  let len_dir = ref 9 in
+  let len_strategy = ref 29 in (* "shared (incoming_directories)" *)
+  List.iter ( fun (dir, strategy) ->
+    len_dir := maxi !len_dir (String.length dir);
+    len_strategy := maxi !len_strategy (String.length strategy)
+  ) !list;
+  let fill_dir = String.make (!len_dir - 9) ' ' in
+  let fill_dir_line = String.make (!len_dir - 9) '-' in
+  let fill_strategy = String.make (!len_strategy - 4) ' ' in
+  let fill_strategy_line = String.make (!len_strategy - 4) '-' in
+  let counter = ref 0 in
+  if html then
+      html_mods_table_header buf "sharesTable" "shares" [
+       ( "0", "srh", "Directory", "Directory" ) ;
+       ( "0", "srh", "Directory type", "Type" ) ;
+       ( "1", "srh ar", "HDD used", "used" ) ;
+       ( "1", "srh ar", "HDD free", "free" ) ;
+       ( "1", "srh ar", "% free", "% free" ) ;
+       ( "0", "srh", "Filesystem", "FS" ) ]
+  else
+    begin
+      Printf.bprintf buf "Diskinfo:\n";
+      Printf.bprintf buf "Directory%s|Type%s|    used|    
free|%%free|Filesystem\n"
+        fill_dir fill_strategy;
+      Printf.bprintf buf 
"---------%s+----%s+--------+--------+-----+----------\n"
+        fill_dir_line fill_strategy_line;
+    end;
+  List.iter (fun (dir, strategy) ->
+       incr counter;
+       let diskused =
+         match Unix32.diskused dir with
+         | None -> Printf.sprintf "---"
+         | Some du -> size_of_int64 du
+       in
+       let diskfree =
+         match Unix32.diskfree dir with
+         | None -> Printf.sprintf "---"
+         | Some df -> size_of_int64 df
+       in
+       let percentfree =
+         match Unix32.percentfree dir with
+         | None -> Printf.sprintf "---"
+         | Some p -> Printf.sprintf "%d%%" p
+       in
+       let filesystem = Unix32.filesystem dir in
+       if html then
+         begin
+           Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>
+       \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+       \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+       \\<td class=\\\"sr ar\\\"\\>%s\\</td\\>
+       \\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
+           (if !counter mod 2 == 0 then "dl-1" else "dl-2")
+           dir strategy diskused diskfree percentfree filesystem
+         end
+       else
+         Printf.bprintf buf "%-*s|%-*s|%8s|%8s|%5s|%-s\n"
+           (maxi !len_dir (!len_dir - String.length dir)) dir
+           (maxi !len_strategy (!len_strategy - String.length strategy)) 
strategy
+           diskused diskfree percentfree filesystem
+       ) !list;
+  if html then
+    Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>"
Index: mldonkey/src/daemon/driver/driverMain.ml
diff -u mldonkey/src/daemon/driver/driverMain.ml:1.90 
mldonkey/src/daemon/driver/driverMain.ml:1.91
--- mldonkey/src/daemon/driver/driverMain.ml:1.90       Thu Jan 19 02:13:19 2006
+++ mldonkey/src/daemon/driver/driverMain.ml    Wed Jan 25 22:29:53 2006
@@ -631,7 +631,7 @@
            lprintf_nl () "Exception %s in do_at_exit while closing sockets."
              (Printexc2.to_string e);
       );
-      CommonGraphics.remove_files ();
+      DriverGraphics.G.remove_files ();
       (* In case we have no more space on filesystem for
          config files, remove the security space file *)
       Sys.remove security_space_filename;
Index: mldonkey/src/utils/lib/autoconf.ml.new.in
diff -u mldonkey/src/utils/lib/autoconf.ml.new.in:1.20 
mldonkey/src/utils/lib/autoconf.ml.new.in:1.21
--- mldonkey/src/utils/lib/autoconf.ml.new.in:1.20      Wed Nov 30 23:46:25 2005
+++ mldonkey/src/utils/lib/autoconf.ml.new.in   Wed Jan 25 22:29:53 2006
@@ -36,11 +36,11 @@
 
 let has_iconv = if "@ICONV@" = "yes" then true else false
 
-let has_gd = @HAS_GD@
-let has_gd_png = @HAS_GD_PNG@
-let has_gd_jpg = @HAS_GD_JPG@
+let has_gd = if "@GD@" = "yes" then true else false
+let has_gd_png = if "@GD_PNG@" = "yes" then true else false
+let has_gd_jpg = if "@GD_JPG@" = "yes" then true else false
 
-let has_bzip2 = @HAS_BZIP2@
+let bzip2 = if "@BZIP2@" = "yes" then true else false
 
 let zlib__uncompress_string2 s = Zlib.uncompress_string2 s
 let zlib__compress_string s = Zlib.compress_string s




reply via email to

[Prev in Thread] Current Thread [Next in Thread]