2 # ********** **********
3 # ********** Autoconf, configure internals **********
4 # ********** **********
8 AC_INIT(Makefile.config.in)
9 AC_CONFIG_HEADER(config.h)
12 CONFIGURE_ARGUMENTS=$ac_configure_args
13 echo "Arguments to configure: $CONFIGURE_ARGUMENTS"
19 # ********** **********
20 # ********** MLDonkey version **********
21 # ********** **********
25 SUB_VERSION=4 # range 0-7 due to eMule limitations
27 # ********** **********
28 # ********** check for C compiler **********
29 # ********** **********
32 CC_VERSION=`$CC -dumpversion`
36 # ********** **********
37 # ********** System checks **********
38 # ********** **********
51 PTHREAD_LIBS="-lpthreadGC2 -lwsock32"
52 PTHREAD_MINGW_CFLAGS="-DPTW32_STATIC_LIB"
53 AC_MSG_CHECKING(for mingw-runtime version)
55 cat >mingw_rt_ver.c <<'END'
58 main(int argc, char *argv[[]]) {
60 int required_runtime_major=3; /********** change required mingw-runtime **********/
61 int required_runtime_minor=10; /********** version here **********/
63 #ifdef __MINGW32_MAJOR_VERSION
64 # ifdef __MINGW32_MINOR_VERSION
65 switch(argv[[1]][[0]]) {
67 printf("%d.%d", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION);
70 if ((__MINGW32_MAJOR_VERSION == required_runtime_major && __MINGW32_MINOR_VERSION < required_runtime_minor) ||
71 (__MINGW32_MAJOR_VERSION < required_runtime_major)) {
78 printf("%d.%d", required_runtime_major, required_runtime_minor);
83 printf("__MINGW32_MINOR_VERSION not defined in _mingw.h");
87 printf("__MINGW32_MAJOR_VERSION not defined in _mingw.h");
93 $CC -o mingw_rt_ver ./mingw_rt_ver.c
94 MINGW_RT_VER="`./mingw_rt_ver x`"
95 MINGW_RT_VER_OK="`./mingw_rt_ver y`"
96 MINGW_RT_VER_REQ="`./mingw_rt_ver z`"
97 rm -f mingw_rt_ver mingw_rt_ver.*
98 AC_MSG_RESULT($MINGW_RT_VER)
99 if test "$MINGW_RT_VER_OK" = "no"; then
100 echo "******** mingw-runtime version $MINGW_RT_VER_REQ is required *********" 1>&2;
111 *freebsd*|*dragonfly*)
113 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
114 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
118 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
119 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
148 *darwin*|*rhapsody*|*macosx*)
150 AC_CHECK_PROG(SED, sed, sed)
151 if test "$ac_cv_prog_SED" = "sed"; then
152 FIX_BROKEN_CPP="| sed -n '/^\#pragma/!p'"
154 AC_CHECK_PROG(GREP, grep, grep)
155 if test "$ac_cv_prog_GREP" = "grep"; then
156 FIX_BROKEN_CPP="| grep -v '^\#pragma'"
159 if test "xFIX_BROKEN_CPP" = "x"; then
160 echo "Apple cpp produces broken files, your system lacks sed or grep to fix it"
165 if test "x$SYSTEM" = "xunknown"; then
166 echo "Unknown build system, please report to the MLDonkey development team at http://mldonkey.sourceforge.net/forums/"
171 alpha*-*-osf*) arch=alpha; system=digital;;
172 alpha*-*-linux*) arch=alpha; system=linux;;
173 alpha*-*-freebsd*) arch=alpha; system=freebsd;;
174 alpha*-*-netbsd*) arch=alpha; system=netbsd;;
175 alpha*-*-openbsd*) arch=alpha; system=openbsd;;
176 sparc-*-sunos4.*) arch=sparc; system=sunos;;
177 sparc-*-solaris2.*) arch=sparc; system=solaris;;
178 sparc-*-*bsd*) arch=sparc; system=bsd;;
179 sparc-*-linux*) arch=sparc; system=linux;;
180 i?86-*-linux*) arch=i386; system=linux;;
181 i386-*-*bsd*) arch=i386; system=bsd;;
182 i486-*-*bsd*) arch=i486; system=bsd;;
183 i586-*-*bsd*) arch=i586; system=bsd;;
184 i686-*-*bsd*) arch=i686; system=bsd;;
185 i?86-*-nextstep*) arch=i386; system=nextstep;;
186 i?86-*-solaris*) arch=i386; system=solaris;;
187 i?86-*-beos*) arch=i386; system=beos;;
188 i?86-*-cygwin*) arch=i386; system=cygwin;;
189 mips-*-irix6*) arch=mips; system=irix;;
190 hppa1.1-*-hpux*) arch=hppa; system=hpux;;
191 hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
192 rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
193 powerpc-*-aix*) arch=power; model=ppc; system=aix;;
194 powerpc-*-linux*) arch=power; model=ppc; system=elf;;
195 powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
196 powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
197 arm*-*-linux*) arch=arm; system=linux;;
198 ia64-*-linux*) arch=ia64; system=linux;;
203 i386-pc-linux*|i386-*-*bsd*) MD4COMP=as; MD4ARCH=i386;;
204 i486-pc-linux*|i486-*-*bsd*) MD4COMP=as; MD4ARCH=i486;;
205 i586-pc-linux*|i586-*-*bsd*) MD4COMP=as; MD4ARCH=i586;;
206 i686-pc-linux*|i686-*-*bsd*) MD4COMP=as; MD4ARCH=i686;;
207 i386-pc-mingw32*) MD4COMP=cc; MD4ARCH=i386;;
208 i486-pc-mingw32*) MD4COMP=cc; MD4ARCH=i486;;
209 i586-pc-mingw32*) MD4COMP=cc; MD4ARCH=i586;;
210 i686-pc-mingw32*) MD4COMP=cc; MD4ARCH=i686;;
216 # ********** **********
217 # ********** Parse checkout date (CVS) or revision (SVN) if available **********
218 # ********** **********
220 if test -d .svn; then
221 AC_MSG_NOTICE(checking SVN revision)
222 AC_CHECK_PROG(SVNVERSION,svnversion,svnversion)
223 if test "$ac_cv_prog_SVNVERSION" = "svnversion"; then
225 SCM_VERSION=`svnversion -n .`
226 else AC_MSG_NOTICE(cannot checking SVN revision... no SVNVERSION)
227 SCM_VERSION="cannot find out SVN revision (no SVNVERSION)"
231 if test -f ./CVS/Entries ; then
232 AC_MSG_NOTICE(checking CVS checkout date)
233 AC_CHECK_PROGS(STAT, stat gstat, stat)
234 if [ test "$ac_cv_prog_STAT" = "stat" ] || [ test "$ac_cv_prog_STAT" = "gstat" ]; then
235 AC_CHECK_PROG(SED, sed, sed)
236 if test "$ac_cv_prog_SED" = "sed"; then
237 AC_CHECK_PROG(CUT, cut, cut)
238 if test "$ac_cv_prog_CUT" = "cut"; then
240 if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "netbsd"] || ( [ test "$SYSTEM" = "macos" ] && [ test "$ac_cv_prog_STAT" != "gstat" ] ); then
241 SCM_VERSION=`$STAT -f "%Sm" ./CVS/Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\4-\1-\2 \3/'`
243 if [ test "$SYSTEM" = "openbsd"]; then
244 AC_CHECK_PROG(GREP, grep, grep)
245 if test "$ac_cv_prog_GREP" = "grep"; then
246 SCM_VERSION=`$STAT -f %a ./CVS/Entries | $GREP -v Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\1-\2-\4 \3/'`
249 if [ test "$SYSTEM" = "mingw"] || [ test "$SYSTEM" = "cygwin"]; then
250 AC_CHECK_PROG(GREP, grep, grep)
251 if test "$ac_cv_prog_GREP" = "grep"; then
252 SCM_VERSION=`$STAT ./CVS/Entries | $GREP Modify | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\5-\2-\3 \4/'`
255 SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c 1-19`
256 fi #if [ test "$SYSTEM" = "mingw"] || ...
257 fi #if [ test "$SYSTEM" = "openbsd"]
258 fi #if [ test "$SYSTEM" = "freebsd"] || ...
260 AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
261 SCM_VERSION="cannot find out SCM Version (no CUT)"
264 AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
265 SCM_VERSION="cannot find out SCM Version (no SED)"
268 AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
269 SCM_VERSION="cannot find out SCM Version (no STAT)"
273 # ********** **********
274 # ********** build MLDonkey version, Required Ocaml and LablGTK versions **********
275 # ********** **********
277 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
278 if test -f ./subrelease; then
279 MLDONKEY_VERSION=$MLDONKEY_VERSION`cat ./subrelease`
281 if test ! -z "$SUB_VERSION3"; then
282 MLDONKEY_VERSION=$MLDONKEY_VERSION.$SUB_VERSION3
285 REQUIRED_OCAML=3.12.0
286 DOWNLOAD_OCAML_MAJOR=3.12
287 DOWNLOAD_OCAML=3.12.0
289 REQUIRED_LABLGTK=1.2.7
295 # ********** **********
296 # ********** Network and Feature configure switch variables **********
297 # ********** **********
299 # ********** currently not working Networks, can't be enabled
305 # ********** working Networks, enabled by default
315 # ********** predefined configure variations
320 # ********** Features, enabled by default
323 DONKEY_SUI_FILE=DonkeySui2
340 # ********** **********
341 # ********** Network and Feature configure switches and dependency **********
342 # ********** **********
344 AC_ARG_ENABLE(multinet, [ --disable-multinet allows you to only compile support for eDonkey (incl. Overnet and Kademlia)], [MULTINET="$enableval"])
345 AC_ARG_ENABLE(minimum, [ --enable-minimum compile MLDonkey with minimum features and Networks (eDonkey, iconv and thread enabled)], [MINIMUM="$enableval"])
346 AC_ARG_ENABLE(minimum, [ --enable-minimum=all disable all optional features and Networks excepting eDonkey], [MINIMUM="$enableval"])
348 if [ test ! "$MULTINET" = "yes" ] || [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
356 if [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
362 if [ test "$MINIMUM" = "all" ]; then
367 #AC_ARG_ENABLE(soulseek, [ --disable-soulseek allows you to remove support for SoulSeek], [SOULSEEK="$enableval"])
368 #AC_ARG_ENABLE(opennap, [ --disable-opennap allows you to remove support for Open Napster], [OPEN_NAPSTER="$enableval"])
369 AC_ARG_ENABLE(directconnect, [ --disable-directconnect allows you to remove support for Direct Connect], [DIRECT_CONNECT="$enableval"])
370 #AC_ARG_ENABLE(openft, [ --disable-openft allows you to remove support for OpenFT], [OPENFT="$enableval"])
372 AC_ARG_ENABLE(donkey, [ --disable-donkey allows you to remove support for eDonkey], [DONKEY="$enableval"])
373 AC_ARG_ENABLE(donkeysui, [ --disable-donkeysui allows you to remove support for eMule SecureUserIdent], [DONKEY_SUI="$enableval"])
374 AC_ARG_ENABLE(bittorrent, [ --disable-bittorrent allows you to remove support for Bittorent], [BITTORRENT="$enableval"])
375 AC_ARG_ENABLE(filetp, [ --disable-filetp allows you to remove support for fileTP], [FILETP="$enableval"])
376 AC_ARG_ENABLE(gnutella, [ --disable-gnutella allows you to remove support for Gnutella], [GNUTELLA="$enableval"])
377 AC_ARG_ENABLE(gnutella2, [ --disable-gnutella2 allows you to remove support for Gnutella2], [GNUTELLA2="$enableval"])
378 AC_ARG_ENABLE(fasttrack, [ --disable-fasttrack allows you to remove support for FastTrack], [FASTTRACK="$enableval"])
380 AC_ARG_ENABLE(batch, [ --enable-batch reply YES to all queries in this script], [BATCH="$enableval"])
381 AC_ARG_ENABLE(force-ocaml, [ --enable-force-ocaml force usage of self-compiled Ocaml], [FORCE_OCAML="$enableval"])
382 AC_ARG_ENABLE(ocamlver, [ --enable-ocamlver=VER force usage of specific Ocaml version (3.08.1|CVS), ], [REQUIRED_OCAML="$enableval"])
383 AC_ARG_ENABLE(mingw, [ --enable-mingw forces compilation with MINGW on Cygwin], [FORCE_MINGW="$enableval"])
384 AC_ARG_ENABLE(checks, [ --enable-checks force mldonkey to perform bound checks on array/string access], [CHECKBOUNDS="$enableval"])
385 if test "$CHECKBOUNDS" = "yes"; then
389 AC_ARG_ENABLE(profile, [ --enable-profile allows you to profile mlnet using gprof (enables debug)], [PROFILE="$enableval"])
390 AC_ARG_ENABLE(debug, [ --enable-debug allows you to compile mlnet with debug symbols], [DEBUG="$enableval"])
391 if test "$PROFILE" = "yes"; then
394 AC_ARG_ENABLE(gui, [ --disable-gui allows you to disable GUI build (default)], [GUI="$enableval"])
395 AC_ARG_ENABLE(gui, [ --enable-gui=oldgui|newgui1|newgui2
396 allows you to choose a GUI (default: newgui2 - is a GTK2 GUI, other GUIs use GTK1)], [GUI="$enableval"])
397 if test "$GUI" = "yes"; then
400 if test ! "$GUI" = "newgui2"; then
401 if test ! "$GUI" = "newgui1"; then
402 if test ! "$GUI" = "oldgui"; then
408 AC_ARG_ENABLE(pthread, [ --disable-pthread allows you to disable pthread support in mldonkey, hurts performance!], [USE_PTHREAD="$enableval"])
409 AC_ARG_ENABLE(pthread-lib, [ --enable-pthread-lib legacy option], [USE_PTHREAD="$enableval"])
410 AC_ARG_ENABLE(iconv, [ --disable-iconv disable the use of iconv], [ICONV="$enableval"])
411 AC_ARG_ENABLE(gd, [ --disable-gd disable the use of gd], [GD="$enableval"])
412 AC_ARG_ENABLE(bzip2, [ --disable-bzip2 disable the use of bzip2], [BZIP2="$enableval"])
413 AC_ARG_ENABLE(magic, [ --disable-magic disable the use of libmagic (GNU file)], [MAGIC="$enableval"])
415 if test "$FORCE_MINGW" = "yes"; then
417 CPP="$CPP -mno-cygwin"
425 echo -e "\n--------------------------------"
426 echo " Checking system tools."
427 echo "--------------------------------"
430 AC_CHECK_PROG(GNU_MAKE, gmake, gmake)
431 AC_CHECK_PROG(GNU_MAKE, make, make)
433 if test "x$GNU_MAKE" != "x"; then
434 AC_MSG_CHECKING( [if $GNU_MAKE is GNU make] )
435 $GNU_MAKE --version > /dev/null 2>&1
436 if test "$?" != "0"; then
438 AC_MSG_ERROR(GNU make not found)
443 AC_MSG_ERROR(GNU make not found)
446 AC_CHECK_PROG(COMPRESS, bzip2, bzip2)
447 AC_CHECK_PROG(COMPRESS, gzip, gzip)
449 if test "$ac_cv_prog_COMPRESS" = "bzip2"; then
455 AC_PATH_PROG(PERL, perl, perl)
456 AC_CHECK_PROG(RPMBUILD,rpmbuild,rpmbuild)
457 AC_CHECK_PROG(RPMBUILD,rpm,rpm)
459 AC_CHECK_PROG(WGET, wget, wget)
460 if test -z "$ac_cv_prog_WGET"; then
461 $CC -o wget wget.c || echo "Cannot compile wget.c"
462 AC_PATH_PROG(WGET, wget,,$SOURCE_DIR/config)
463 ac_cv_prog_WGET="$ac_cv_path_WGET"
465 WGET="$ac_cv_prog_WGET"
467 echo "----------------------------------------"
468 echo " Checking system tools finished."
469 echo -e "----------------------------------------\n"
471 echo "--------------------------------"
472 echo " Checking Ocaml compiler."
473 echo "--------------------------------"
475 CONFIG_DIR=$SOURCE_DIR/config
476 PATCH_DIR=$SOURCE_DIR/patches
477 LOCAL_DIR=$PATCH_DIR/local
478 BUILD_DIR=$PATCH_DIR/build
480 AC_ARG_ENABLE(local-prefix, [ --enable-local-prefix=DIR allows you to specify where you want temporary tools to be installed (DIR must be absolute)], [LOCAL_DIR="$enableval"])
483 LOCAL_OCAML=$LOCAL_DIR/bin
485 AC_PATH_PROG(OCAMLC,ocamlc.opt,"",[$LOCAL_DIR/bin:$PATH])
486 AC_CHECK_TOOL(OCAMLC,ocamlc,ocamlrun ocamlc)
487 AC_PATH_PROG(CAMLP4, camlp4,"",[$LOCAL_DIR/bin:$PATH])
490 if [ test -z "$OCAMLC" ] || [ test -z "$CAMLP4" ] || [ test "$REQUIRED_OCAML" = "CVS" ]; then
493 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
494 case "$OCAMLVERSION" in
495 "$REQUIRED_OCAML"*|3.12.*|3.11.*|3.10.*|3.09.*|3.08.4*|3.08.3*) ;;
503 if [ test "$BUILD_OCAML" = "yes" ] || [ test "$FORCE_OCAML" = "yes" ]; then
505 if [ test "$SYSTEM" = "mingw" ]; then
506 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
507 echo "******** no valid Ocaml compiler found on your system *********" 1>&2;
508 echo "******** on MinGW there is no possibility to let configure *********" 1>&2;
509 echo "******** build the Ocaml compiler with the included script *********" 1>&2;
510 echo "******** check http://mldonkey.sourceforge.net/Windows *********" 1>&2;
511 echo "******** for instuctions how to compile Ocaml under MinGW *********" 1>&2;
515 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
516 if [ test "$WGET" = "" ] && [ test "$REQUIRED_OCAML" != "CVS" ]; then
517 echo "******** wget is missing *********" 1>&2;
518 echo "******** cannot download Ocaml *********" 1>&2;
521 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
522 echo "Do you want this script to try to download and install ocaml"
523 echo "LOCALLY in mldonkey directory ?"
524 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
528 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
532 cvs -d:pserver:anoncvs:""@camlcvs.inria.fr:/caml login
533 cvs -z3 -d:pserver:anoncvs@camlcvs.inria.fr:/caml co -P ocaml
536 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
538 $WGET http://caml.inria.fr/pub/distrib/ocaml-"$DOWNLOAD_OCAML_MAJOR"/ocaml-"$REQUIRED_OCAML".tar.gz
540 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
541 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-"$REQUIRED_OCAML".tar.gz
543 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
544 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.10/ocaml-"$REQUIRED_OCAML".tar.gz
546 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
547 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.09/ocaml-"$REQUIRED_OCAML".tar.gz
549 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
550 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.08/ocaml-"$REQUIRED_OCAML".tar.gz
552 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
553 echo "******** download Ocaml $REQUIRED_OCAML not successful, try do download it manually *********" 1>&2;
554 echo "******** from http://caml.inria.fr/pub/distrib/ *********" 1>&2;
555 echo "******** and copy the tar.gz into $PATCH_DIR *********" 1>&2;
559 echo Uncompressing ...
562 rm -rf ocaml-"$REQUIRED_OCAML"
563 gzip -cd $PATCH_DIR/ocaml-"$REQUIRED_OCAML".tar.gz | tar vxf -
564 cd ocaml-"$REQUIRED_OCAML"
565 if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
567 patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
571 ./configure -prefix $LOCAL_DIR -host $host -cc $CC
573 cp -f Makefile Makefile.old
574 sed "s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" Makefile.old > Makefile
576 cp -f $PATCH_DIR/Makefile.ocamldoc ocamldoc/Makefile
578 $GNU_MAKE world opt opt.opt
581 if ! test -f $LOCAL_DIR/lib/ocaml/threads; then
582 if ! test -f $LOCAL_DIR/lib/ocaml/vmthreads; then
583 ln -s vmthreads $LOCAL_DIR/lib/ocaml/threads
587 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
590 rm -rf ocaml-"$REQUIRED_OCAML"
593 echo Ocaml locally installed for mldonkey
595 if test -f "$LOCAL_OCAML"/ocamlc.opt; then
596 OCAMLC=$LOCAL_OCAML/ocamlc.opt
597 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc.opt
599 if test -f "$LOCAL_OCAML"/ocamlc; then
600 OCAMLC=$LOCAL_OCAML/ocamlc
601 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc
603 echo "Ocaml installation failed"; exit 1
612 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc.opt ; then
613 OCAML_PATH="$LOCAL_OCAML"/
614 OCAMLOPT=$LOCAL_OCAML/ocamlopt.opt
615 OCAMLDOC=$LOCAL_OCAML/ocamldoc
616 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
617 OCAMLDEP=$LOCAL_OCAML/ocamldep
618 OCAMLLEX=$LOCAL_OCAML/ocamllex.opt
619 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
620 CAMLP4=$LOCAL_OCAML/camlp4
622 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc ; then
623 OCAML_PATH="$LOCAL_OCAML"/
624 if test -f "$LOCAL_OCAML/ocamlopt"; then
625 OCAMLOPT=$LOCAL_OCAML/ocamlopt
629 OCAMLDOC=$LOCAL_OCAML/ocamldoc
630 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
631 OCAMLDEP=$LOCAL_OCAML/ocamldep
632 OCAMLLEX=$LOCAL_OCAML/ocamllex
633 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
634 CAMLP4=$LOCAL_OCAML/camlp4
636 AC_CHECK_PROG(OCAMLOPT, ocamlopt.opt, ocamlopt.opt)
637 AC_CHECK_PROG(OCAMLOPT, ocamlopt, ocamlopt, no)
638 AC_CHECK_PROG(OCAMLDEP, ocamldep, ocamldep)
639 AC_CHECK_PROG(OCAMLLEX, ocamllex.opt, ocamllex.opt)
640 AC_CHECK_PROG(OCAMLLEX, ocamllex, ocamllex)
641 AC_CHECK_PROG(OCAMLYACC, ocamlyacc, ocamlyacc)
642 AC_CHECK_PROG(OCAMLDOC, ocamldoc, ocamldoc)
643 AC_CHECK_PROG(OCAMLMKTOP, ocamlmktop, ocamlmktop)
644 AC_CHECK_PROG(CAMLP4, camlp4, camlp4)
648 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
649 OCAMLLIB=`$OCAMLC -where`
651 case "$OCAMLVERSION" in
654 "$REQUIRED_OCAML"*|3.09.*|3.08.4*|3.08.3*) ;;
656 if [ test "$REQUIRED_OCAML" != "CVS" ]; then
661 if test "$REBUILD_OCAML" = "yes"; then
662 echo "******** Version $REQUIRED_OCAML of Objective-Caml is required *********" 1>&2;
663 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
667 if test "$OCAMLOPT" = "no"; then
674 OCAMLOPTVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
676 test "$OCAMLOPTVERSION" = "$OCAMLVERSION" || {
677 echo "******** Version $REQUIRED_OCAML of ocamlopt is required *********" 1>&2;
678 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
683 echo "-------------------------------------------"
684 echo " Checking Ocaml $OCAMLVERSION finished."
685 echo "-------------------------------------------"
688 if test "$PROFILE" = "yes"; then
689 OCAMLOPT="$OCAMLOPT -p"
692 if test "$FORCE_MINGW" = "yes"; then
693 OCAMLC="$OCAMLC -ccopt -mno-cygwin"
694 OCAMLOPT="$OCAMLOPT -ccopt -mno-cygwin"
695 OCAMLMKTOP="$OCAMLMKTOP -ccopt -mno-cygwin"
697 if test "$DEBUG" = "yes"; then
699 OCAMLOPT="$OCAMLOPT -g"
702 echo -e "\n----------------------------------"
703 echo " Checking system headers."
704 echo "----------------------------------"
706 ifelse(AC_ACVERSION, [2.13], [],
707 [dnl Large file enabled
712 # various header files
713 AC_CHECK_FUNCS(setrlimit getrlimit strerror_r strerror posix_fallocate)
714 AC_CHECK_HEADERS(byteswap.h,,)
715 AC_CHECK_HEADERS([sys/utsname.h])
716 AC_CHECK_HEADERS(arpa/inet.h,,)
717 AC_CHECK_HEADERS([sys/types.h sys/time.h sys/resource.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
718 [#ifdef HAVE_SYS_TYPES_H
719 #include <sys/types.h>
721 #ifdef HAVE_SYS_TIME_H
722 #include <sys/time.h>
724 #ifdef HAVE_NETINET_IN_SYSTM_H
725 #include <netinet/in_systm.h>
727 #ifdef HAVE_NETINET_IN_H
728 #include <netinet/in.h>
733 AC_CHECK_HEADERS(sys/poll.h,,)
734 AC_CHECK_FUNCS(poll,,)
736 AC_CHECK_HEADERS(sys/vfs.h,,)
737 AC_CHECK_HEADERS(sys/statvfs.h,,)
738 AC_CHECK_HEADERS([sys/param.h sys/mount.h],,,
739 [#if HAVE_SYS_PARAM_H
740 #include <sys/param.h>
743 echo "-------------------------------------------"
744 echo " Checking system headers finished."
745 echo -e "-------------------------------------------\n"
746 echo "-----------------------------------"
747 echo " Checking system libraries."
748 echo "-----------------------------------"
749 echo "----- checking zlib (required)"
750 AC_CHECK_LIB(z,inflate,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
751 AC_CHECK_HEADERS(zlib.h,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
752 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
754 if test "$BZIP2" != "no"; then
755 echo "----- checking bzlib (optional)"
756 AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])],[BZIP2=no])
759 if test "$BZIP2" = "yes"; then
760 AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
761 AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
763 AC_MSG_NOTICE(bzlib not available)
766 if test "$MAGIC" != "no"; then
767 echo "----- checking libmagic (GNU file) (optional)"
768 AC_CHECK_HEADERS(magic.h,
769 [AC_CHECK_LIB(magic,magic_file,
770 [AC_CHECK_DECL([MAGIC_ERROR], [MAGIC=yes], [MAGIC=no],[#include <magic.h>])],
775 if test "$MAGIC" = "yes"; then
778 MAGICLIB=Magic_nomagic
779 AC_MSG_NOTICE(libmagic not available)
784 if test "$GD" != "no"; then
785 echo "----- checking gd (optional)"
790 SAVE_LDFLAGS=$LDFLAGS
791 AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
792 if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
793 GD_LIBS=`$GDLIBCONFIG --libs`
794 $GDLIBCONFIG --static-libs > /dev/null 2>&1
795 if test "$?" = "0"; then
796 GD_STATIC_LIBS=`$GDLIBCONFIG --static-libs`
798 GD_LIBS2="$LIBS -lgd $GD_LIBS"
800 GD_CFLAGS=`$GDLIBCONFIG --cflags`
801 CFLAGS="$CFLAGS $GD_CFLAGS"
802 GD_LDFLAGS=`$GDLIBCONFIG --ldflags`
803 LDFLAGS="$LDFLAGS $GD_LDFLAGS"
804 AC_MSG_CHECKING(for libgd > 2.0.14)
805 GDVERSION=`$GDLIBCONFIG --version`
806 GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
807 GDMINORVERSION=`$GDLIBCONFIG --minorversion`
808 GDREVISION=`$GDLIBCONFIG --revision`
809 if [ [ $GDMAJORVERSION = 2 ] && [ $GDMINORVERSION = 0 ] && [ $GDREVISION -gt 14 ]]; then
810 AC_MSG_RESULT($GDVERSION)
813 AC_MSG_RESULT(no (found $GDVERSION))
820 if test "$LIBGD" = "yes"; then
821 AC_CHECK_HEADERS(gd.h,[LIBGD=yes],[LIBGD=no])
824 if test "$LIBGD" = "yes"; then
825 AC_MSG_CHECKING(for gdImageCreate in -lgd)
826 AC_TRY_LINK([#include <gd.h>],
827 [gdImageCreate (0,0);],
828 [LIBGD=yes], [LIBGD=no])
829 AC_MSG_RESULT($LIBGD)
832 if test "$LIBGD" = "no"; then
833 AC_MSG_NOTICE([not found, trying another method])
834 AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
838 if test "$LIBGD" = "yes"; then
840 # saving current variables
842 SAVE_CFLAGS_PNG=$CFLAGS
843 SAVE_LDFLAGS_PNG=$LDFLAGS
844 AC_CHECK_PROG(PNGLIBCONFIG, libpng-config, libpng-config)
845 if test "$ac_cv_prog_PNGLIBCONFIG" = "libpng-config"; then
846 # check libpng-config contents and update system variables
847 PNG_LIBS=`$PNGLIBCONFIG --libs`
848 LIBS="$LIBS $PNG_LIBS"
849 PNG_CFLAGS=`$PNGLIBCONFIG --cflags`
850 CFLAGS="$CFLAGS $PNG_CFLAGS"
851 PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
852 LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
854 AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
857 CFLAGS=$SAVE_CFLAGS_PNG
858 LDFLAGS=$SAVE_LDFLAGS_PNG
860 if test "$LIBPNG" = "no"; then
861 AC_MSG_NOTICE(png support not available)
865 AC_MSG_CHECKING(for gdImagePng in -lgd)
866 AC_TRY_LINK([#include <gd.h>],
868 [LIBGD_PNG=yes], [LIBGD_PNG=no])
869 AC_MSG_RESULT($LIBGD_PNG)
872 if test "$LIBGD_PNG" = "no"; then
873 AC_MSG_NOTICE([not found, trying another method])
874 AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
877 AC_MSG_CHECKING(for png support in libgd)
878 if test "$LIBGD_PNG" = "yes"; then
882 AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
883 AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
890 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [LIBJPEG=yes])
892 if test "$LIBJPEG" = "no"; then
893 AC_MSG_NOTICE(jpeg support not available)
897 AC_MSG_CHECKING(for gdImageJpeg in -lgd)
898 AC_TRY_LINK([#include <gd.h>],
899 [gdImageJpeg (0,0,0);],
900 [LIBGD_JPG=yes], [LIBGD_JPG=no])
901 AC_MSG_RESULT($LIBGD_JPG)
904 if test "$LIBGD_JPG" = "no"; then
905 AC_MSG_NOTICE([not found, trying another method])
906 AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
909 AC_MSG_CHECKING(for jpeg support in libgd)
910 if test "$LIBGD_JPG" = "yes"; then
913 AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in libgd.])
920 AC_MSG_NOTICE(libgd not available)
924 LDFLAGS=$SAVE_LDFLAGS
927 if test "$GD" != "no"; then
928 GDGRAPHICS=DriverGraphics_gd
930 GDGRAPHICS=DriverGraphics_nogd
933 if test "$ICONV" = "yes"; then
934 echo "----- checking iconv (optional)"
936 if test "$am_cv_func_iconv" != "yes"; then
937 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
940 LIBS="$LIBS $LIBICONV"
941 AC_CHECK_FUNCS([locale_charset],,
942 AC_TRY_LINK([#include <langinfo.h>],
943 [char* cs = nl_langinfo(CODESET);],
944 AC_MSG_NOTICE(found nl_langinfo(CODESET)),
945 [echo "Your iconv implementation is incomplete"; exit 1]))
946 AC_CHECK_LIB(charset,locale_charset)
947 AC_CHECK_HEADERS([libcharset.h])
948 AC_CHECK_HEADERS([langinfo.h])
949 AC_CHECK_HEADERS([locale.h])
952 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
956 if test "$USE_PTHREAD" = "no"; then
958 echo "You disabled thread support, this will hurt MLDonkey performance!"
960 echo "----- checking thread support (optional, strongly advised)"
964 # On linux plaforms, we will have to check that includes from kernel are
965 # available. glibc version test was shamelessly taken from
966 # http://public.activestate.com/gsar/APC/perl-5.8.x/Configure
970 echo "----- GNU C Library version"
971 AC_CHECK_HEADERS(linux/limits.h,, [
972 OLD_CPPFLAGS=$CPPFLAGS
973 CPPFLAGS="-I /usr/src/linux/include"
974 AC_CHECK_HEADER(linux/types.h,[CONFIG_INCLUDES="-I /usr/src/linux/include"])
975 CPPFLAGS=$OLD_CPPFLAGS]
977 AC_CHECK_HEADERS(gnu/libc-version.h,[AC_MSG_CHECKING(for GNU C Library version)
980 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
981 alone are insufficient to distinguish different versions, such as
982 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
983 libc version 2.1.0. A. Dougherty, June 3, 2002.
989 # ifdef __GLIBC_MINOR__
990 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
991 # include <gnu/libc-version.h>
992 printf("%s\n", gnu_get_libc_version());
994 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
997 printf("%d\n", __GLIBC__);
1007 GLIBC_VERSION="`./try`"
1008 AC_MSG_RESULT($GLIBC_VERSION)
1014 echo "---------------------------------------------"
1015 echo " Checking system libraries finished."
1016 echo -e "---------------------------------------------\n"
1020 echo "--------------------------------------"
1021 echo " Checking activated networks."
1022 echo "--------------------------------------"
1024 if test "$DONKEY" = "yes"; then
1025 AC_MSG_CHECKING(eDonkey)
1026 if test -d ../src/networks/donkey; then
1028 if test "$DONKEY_SUI" = "yes"; then
1031 AC_CHECK_TOOL(NEWCXX, [$CXX], [no])
1032 AC_MSG_CHECKING(eMule SUI)
1033 if test x"$NEWCXX" = x"no"
1040 ACX_CHECK_CXX_FLAGS(-fno-omit-frame-pointer,cv_no_omit_frame_pointer, CRYPTOPPFLAGS="-fno-omit-frame-pointer")
1041 ACX_CHECK_CXX_FLAGS(-mno-omit-leaf-frame-pointer,cv_no_omit_leaf_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -mno-omit-leaf-frame-pointer")
1043 CXX_VERSION=`$CXX -dumpversion`
1044 DONKEY_SUI_FILE=DonkeySui1
1045 AC_DEFINE(HAVE_CRYPTOPP, 1,)
1048 # AC_MSG_CHECKING(eDonkey server)
1049 # if test -d ../src/networks/server; then
1065 if test "$BITTORRENT" = "yes"; then
1066 AC_MSG_CHECKING(BitTorrent)
1067 if test -d ../src/networks/bittorrent; then
1075 if test "$FILETP" = "yes"; then
1076 AC_MSG_CHECKING(FileTP)
1077 if test -d ../src/networks/fileTP; then
1085 if test "$GNUTELLA" = "yes"; then
1086 AC_MSG_CHECKING(Gnutella)
1087 if test -d ../src/networks/gnutella; then
1095 if test "$GNUTELLA2" = "yes"; then
1097 if test -d ../src/networks/gnutella2; then
1105 if test "$FASTTRACK" = "yes"; then
1106 AC_MSG_CHECKING(Fasttrack)
1107 if test -d ../src/networks/fasttrack; then
1115 if test "$DIRECT_CONNECT" = "yes"; then
1116 AC_MSG_CHECKING(DirectConnect)
1117 if test "$BZIP2" = "yes"; then
1118 if test -d ../src/networks/direct_connect; then
1126 AC_MSG_RESULT(no - bzip2 support missing)
1130 if test "$SOULSEEK" = "yes"; then
1131 AC_MSG_CHECKING(Soulseek)
1132 if test -d ../src/networks/soulseek; then
1140 if test "$OPEN_NAPSTER" = "yes"; then
1141 AC_MSG_CHECKING(OpenNapster)
1142 if test -d ../src/networks/opennap; then
1150 if test "$OPENFT" = "yes"; then
1151 AC_MSG_CHECKING(OpenFT)
1152 if test -d ../src/networks/openFT; then
1159 echo "-----------------------------------------------"
1160 echo " Checking activated networks finished."
1161 echo "-----------------------------------------------"
1163 OCAMLLIB=`$OCAMLC -where`
1165 if test -f $OCAMLLIB/lablgl.cma; then
1166 LABLGL_CMA=lablgl.cma
1169 if test -f $OCAMLLIB/lablgl.$OCAMLLIB_EXT; then
1170 LABLGL_CMXA=lablgl.$OCAMLLIB_EXT
1173 # Check for GTK only if we want to build the GUI
1174 if test ! "$GUI" = "no"; then
1175 echo "---------------------------------------------------------"
1176 echo "Checking the libraries required to build the GTK GUI."
1177 echo "---------------------------------------------------------"
1178 if test "$GUI" = "newgui2"; then
1181 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1182 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1185 PKG_RSVG=librsvg-2.0
1186 AC_MSG_CHECKING(for librsvg - version >= $REQUIRED_RSVG)
1187 if pkg-config --atleast-version $REQUIRED_RSVG $PKG_RSVG; then
1188 GTK_CONFIG="pkg-config $PKG_GTK $PKG_RSVG"
1189 case "$OCAMLVERSION" in
1191 REQUIRED_LABLGTK=2.12.0
1194 REQUIRED_LABLGTK=2.14.1
1197 LABLGTK_NAME=lablgtk2
1208 if test "$OS_FILES2" = "mingw"; then
1210 PKG_GTK=gtk+-1.3-win32-production
1211 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1212 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1213 GTK_CONFIG="pkg-config $PKG_GTK"
1220 AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config, no)
1221 if test "$GTK_CONFIG" = "no"; then
1231 if test "$GTK_CONFIG" = "no"; then
1234 AC_MSG_CHECKING(for native code $LABLGTK_NAME)
1235 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1236 if test "$GUI" = "newgui2"; then
1237 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then
1243 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablrsvg.cma; then
1244 echo "---------------------------------------------------------"
1245 echo "lablrsvg is not installed properly. See the INSTALL.txt"
1246 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1247 echo "probably forgot to call 'make opt' before 'make install'."
1248 echo "---------------------------------------------------------"
1250 echo "---------------------------------------------------------"
1251 echo "lablrsvg is not installed. See the INSTALL.txt file of"
1252 echo "mldonkey to see how to compile $LABLGTK_NAME. Librsvg"
1253 echo "may not be installed when you compiled $LABLGTK_NAME."
1254 echo "---------------------------------------------------------"
1264 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.cma; then
1265 echo "-------------------------------------------------------------"
1266 echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
1267 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1268 echo "probably forgot to call 'make opt' before 'make install'."
1269 echo "-------------------------------------------------------------"
1271 echo "Do you want this script to try to download and install $LABLGTK_NAME"
1272 echo "LOCALLY in mldonkey directory ?"
1273 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
1278 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1279 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then
1280 echo Downloading ...
1281 $WGET http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgtk-"$REQUIRED_LABLGTK".tar.gz
1283 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then exit 1; fi
1287 echo Uncompressing ...
1288 gzip -cd $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".tar.gz | tar xf -
1289 (cd lablgtk-"$REQUIRED_LABLGTK"
1290 if test -f $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch; then
1292 patch -p0 < $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch
1294 PATH=$OCAML_PATH:$PATH
1298 if test "$GUI" = "newgui2"; then
1299 ./configure --prefix=$LOCAL_DIR
1310 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1313 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1316 echo "Installation of $LABLGTK_NAME failed"
1326 if test "$GUI" = "newgui2" ; then
1327 GUIS="mldonkey_gui\$(EXE)"
1328 GTKCFLAGS="`pkg-config --cflags-only-I gtk+-2.0`"
1329 GTKLLIBS="`pkg-config --libs-only-L gtk+-2.0`"
1330 GTKLFLAGS="`pkg-config --libs-only-l gtk+-2.0` -lX11"
1332 GUIS="mldonkey_gui\$(EXE) mldonkey_gui2\$(EXE)"
1335 if test "$LABLGTK_CONFIG" = "no"; then
1338 MORE_TARGETS="$MORE_TARGETS $GUIS"
1339 AC_MSG_CHECKING(GToolbox.popup_menu args)
1340 OCAML_LIB_DIR="`$OCAMLC -where`"
1341 GTOOLBOX="$OCAML_LIB_DIR/$LABLGTK_NAME/gToolbox.mli"
1342 grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
1343 if test "$GTOOLBOX_ARGS" = "new"; then
1344 GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
1347 GTOOLBOX_POPUPMENU=' ~x: button ~y: time '
1350 echo "---------------------------------------------------------"
1351 echo "End of GTK GUI configuration."
1352 echo "---------------------------------------------------------"
1355 if test "$OS_FILES" = "mingw"; then
1356 OCAMLDEP_OPTIONS="-slash"
1367 AC_SUBST(FIX_BROKEN_CPP)
1368 AC_SUBST(CONFIG_INCLUDES)
1375 AC_SUBST(OCAMLDEP_OPTIONS)
1379 AC_SUBST(OCAMLMKTOP)
1381 AC_SUBST(MORE_TARGETS)
1382 AC_SUBST(MORE_SUBDIRS)
1383 AC_SUBST(LABLGL_CMA)
1384 AC_SUBST(LABLGL_CMXA)
1388 AC_SUBST(OPEN_NAPSTER)
1389 AC_SUBST(DIRECT_CONNECT)
1392 AC_SUBST(BITTORRENT)
1398 AC_SUBST(DONKEY_SUI)
1399 AC_SUBST(CRYPTOPPFLAGS)
1400 AC_SUBST(DONKEY_SUI_FILE)
1401 AC_SUBST(DONKEY_SERVER)
1403 AC_SUBST(REQUIRED_OCAML)
1404 AC_SUBST(REQUIRED_LABLGTK)
1407 AC_SUBST(COMPRESS_EXT)
1408 AC_SUBST(CHECKBOUNDS)
1409 AC_SUBST(MLDONKEY_VERSION)
1410 AC_SUBST(SCM_VERSION)
1411 AC_SUBST(MAJOR_VERSION)
1412 AC_SUBST(MINOR_VERSION)
1413 AC_SUBST(SUB_VERSION)
1414 AC_SUBST(GTOOLBOX_POPUPMENU)
1417 AC_SUBST(TARGET_TYPE)
1425 AC_SUBST(GDGRAPHICS)
1427 AC_SUBST(GD_STATIC_LIBS)
1429 AC_SUBST(GD_LDFLAGS)
1433 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
1434 AC_SUBST(BUILD_SYSTEM)
1435 AC_SUBST(GLIBC_VERSION)
1436 AC_SUBST(CC_VERSION)
1437 AC_SUBST(CXX_VERSION)
1438 AC_SUBST(CONFIGURE_ARGUMENTS)
1439 AC_SUBST(CONFIGURE_RUN)
1441 AUTOCONF=../src/utils/lib/autoconf.ml
1442 GTK_AUTOCONF=../src/utils/lib/gAutoconf.ml
1446 $AUTOCONF.new $GTK_AUTOCONF.new \
1447 ../src/utils/lib/magic.ml \
1448 ../src/networks/donkey/donkeySui.ml \
1449 ../src/daemon/driver/driverGraphics.ml \
1450 ../packages/rpm/mldonkey.spec \
1451 ../packages/rpm/Makefile \
1452 ../packages/slackware/mldonkey.options)
1453 diff $AUTOCONF.new $AUTOCONF 2> /dev/null > /dev/null || cp -f $AUTOCONF.new $AUTOCONF
1454 diff $GTK_AUTOCONF.new $GTK_AUTOCONF 2> /dev/null > /dev/null || cp -f $GTK_AUTOCONF.new $GTK_AUTOCONF
1458 echo -e "\nBuilding dependencies (if it blocks, try '$GNU_MAKE depend' to see the problem)"
1459 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: '$GNU_MAKE depend'"
1461 echo -e -n "\nConfiguring MLDonkey" $MLDONKEY_VERSION
1462 if test ! -z "$SCM_VERSION"; then
1463 echo -n " - SCM: $SCM_VERSION"
1467 echo -e "\nNetwork modules:"
1468 echo -n " - eDonkey "
1469 if test "$DONKEY" = "yes"; then
1470 if test "$DONKEY_SUI" = "yes"; then
1471 echo "enabled (eMule SUI enabled)"
1473 echo "enabled (eMule SUI disabled)"
1479 echo -n " - BitTorrent "
1480 if test "$BITTORRENT" = "yes"; then
1486 echo -n " - FileTP (aka wget) "
1487 if test "$FILETP" = "yes"; then
1493 echo -n " - Fasttrack "
1494 if test "$FASTTRACK" = "yes"; then
1500 echo -n " - Gnutella "
1501 if test "$GNUTELLA" = "yes"; then
1502 echo "enabled (warning: this network module is unmaintained)"
1504 echo " disabled - unmaintained"
1507 echo -n " - Gnutella2 "
1508 if test "$GNUTELLA2" = "yes"; then
1509 echo "enabled (warning: this network module is unmaintained)"
1511 echo " disabled - unmaintained"
1514 echo -n " - Direct Connect "
1515 if test "$DIRECT_CONNECT" = "yes"; then
1521 echo -n " - Open Napster "
1522 if test "$OPEN_NAPSTER" = "yes"; then
1523 echo "enabled - currently not usable"
1525 echo " disabled - currently not usable"
1528 echo -n " - Soulseek "
1529 if test "$SOULSEEK" = "yes"; then
1530 echo "enabled - currently not usable"
1532 echo " disabled - currently not usable"
1535 echo -n " - OpenFT "
1536 if test "$OPENFT" = "yes"; then
1537 echo "enabled - currently not usable"
1539 echo " disabled - currently not usable"
1542 echo -e "\nCore features:"
1544 echo " - zlib (required) enabled"
1546 echo -n " - threads "
1547 if test "$USE_PTHREAD" = "yes"; then
1554 if test "$BZIP2" = "yes"; then
1561 if test "$ICONV" = "yes"; then
1567 echo -n " - libmagic "
1568 if test "$MAGIC" = "yes"; then
1574 echo -n " - graphical stats "
1575 if test "$GD" = "yes"; then
1577 echo -n " - png support "
1578 if test "$GD_PNG" = "yes"; then
1584 echo -n " - jpg support "
1585 if test "$GD_JPG" = "yes"; then
1594 if test "$LABLGTK_CONFIG" = "yes"; then
1595 echo -n -e "\n - GUI support "
1596 if test "$GUI" = "newgui1"; then
1599 if test "$GUI" = "newgui2"; then
1607 if test "$OLDGUI_NO_31" = "yes"; then
1608 echo " - GUI support GTK1 oldgui does not work with Ocaml 3.1*, disabled"
1611 if test "$TARGET_TYPE" = "byte"; then
1612 OCAML_TYPE="- byte code"
1613 COMPILE_TARGET=".byte"
1615 echo -e "\nCompilers:"
1616 echo -e " - Ocaml version $OCAMLVERSION $OCAML_TYPE"
1617 echo -e " - $CC version $CC_VERSION"
1618 if test "x$CXX" != "x"; then
1619 echo -e " - $CXX version $CXX_VERSION"
1621 echo -e "\nNow execute '$GNU_MAKE' to start compiling. Good luck!"
1623 echo -e "\nTo compile a static code execute: $GNU_MAKE mlnet$COMPILE_TARGET.static"
1624 echo "To produce a release tarball execute: $GNU_MAKE release.mlnet.static"
1625 echo "To clean the build directory execute: $GNU_MAKE maintainerclean"
1626 if test "$DONKEY_SUI" = "yes"; then
1627 echo -e "\nCompiling CryptoPP.cc can take several minutes, on slow machines up to half an hour."