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=3 # 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;
108 *freebsd*|*dragonfly*)
110 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
111 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
115 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
116 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
145 *darwin*|*rhapsody*|*macosx*)
147 AC_CHECK_PROG(SED, sed, sed)
148 if test "$ac_cv_prog_SED" = "sed"; then
149 FIX_BROKEN_CPP="| sed -n '/^\#pragma/!p'"
151 AC_CHECK_PROG(GREP, grep, grep)
152 if test "$ac_cv_prog_GREP" = "grep"; then
153 FIX_BROKEN_CPP="| grep -v '^\#pragma'"
156 if test "xFIX_BROKEN_CPP" = "x"; then
157 echo "Apple cpp produces broken files, your system lacks sed or grep to fix it"
162 if test "x$SYSTEM" = "xunknown"; then
163 echo "Unknown build system, please report to the MLDonkey development team at http://mldonkey.sourceforge.net/forums/"
168 alpha*-*-osf*) arch=alpha; system=digital;;
169 alpha*-*-linux*) arch=alpha; system=linux;;
170 alpha*-*-freebsd*) arch=alpha; system=freebsd;;
171 alpha*-*-netbsd*) arch=alpha; system=netbsd;;
172 alpha*-*-openbsd*) arch=alpha; system=openbsd;;
173 sparc-*-sunos4.*) arch=sparc; system=sunos;;
174 sparc-*-solaris2.*) arch=sparc; system=solaris;;
175 sparc-*-*bsd*) arch=sparc; system=bsd;;
176 sparc-*-linux*) arch=sparc; system=linux;;
177 i?86-*-linux*) arch=i386; system=linux;;
178 i386-*-*bsd*) arch=i386; system=bsd;;
179 i486-*-*bsd*) arch=i486; system=bsd;;
180 i586-*-*bsd*) arch=i586; system=bsd;;
181 i686-*-*bsd*) arch=i686; system=bsd;;
182 i?86-*-nextstep*) arch=i386; system=nextstep;;
183 i?86-*-solaris*) arch=i386; system=solaris;;
184 i?86-*-beos*) arch=i386; system=beos;;
185 i?86-*-cygwin*) arch=i386; system=cygwin;;
186 mips-*-irix6*) arch=mips; system=irix;;
187 hppa1.1-*-hpux*) arch=hppa; system=hpux;;
188 hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
189 rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
190 powerpc-*-aix*) arch=power; model=ppc; system=aix;;
191 powerpc-*-linux*) arch=power; model=ppc; system=elf;;
192 powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
193 powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
194 arm*-*-linux*) arch=arm; system=linux;;
195 ia64-*-linux*) arch=ia64; system=linux;;
200 i386-pc-linux*|i386-*-*bsd*) MD4COMP=as; MD4ARCH=i386;;
201 i486-pc-linux*|i486-*-*bsd*) MD4COMP=as; MD4ARCH=i486;;
202 i586-pc-linux*|i586-*-*bsd*) MD4COMP=as; MD4ARCH=i586;;
203 i686-pc-linux*|i686-*-*bsd*) MD4COMP=as; MD4ARCH=i686;;
204 i386-pc-mingw32*) MD4COMP=cc; MD4ARCH=i386;;
205 i486-pc-mingw32*) MD4COMP=cc; MD4ARCH=i486;;
206 i586-pc-mingw32*) MD4COMP=cc; MD4ARCH=i586;;
207 i686-pc-mingw32*) MD4COMP=cc; MD4ARCH=i686;;
213 # ********** **********
214 # ********** Parse checkout date (CVS) or revision (SVN) if available **********
215 # ********** **********
217 if test -d .svn; then
218 AC_MSG_NOTICE(checking SVN revision)
219 AC_CHECK_PROG(SVNVERSION,svnversion,svnversion)
220 if test "$ac_cv_prog_SVNVERSION" = "svnversion"; then
222 SCM_VERSION=`svnversion -n .`
223 else AC_MSG_NOTICE(cannot checking SVN revision... no SVNVERSION)
224 SCM_VERSION="cannot find out SVN revision (no SVNVERSION)"
228 if test -f ./CVS/Entries ; then
229 AC_MSG_NOTICE(checking CVS checkout date)
230 AC_CHECK_PROGS(STAT, stat gstat, stat)
231 if [ test "$ac_cv_prog_STAT" = "stat" ] || [ test "$ac_cv_prog_STAT" = "gstat" ]; then
232 AC_CHECK_PROG(SED, sed, sed)
233 if test "$ac_cv_prog_SED" = "sed"; then
234 AC_CHECK_PROG(CUT, cut, cut)
235 if test "$ac_cv_prog_CUT" = "cut"; then
237 if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "netbsd"] || ( [ test "$SYSTEM" = "macos" ] && [ test "$ac_cv_prog_STAT" != "gstat" ] ); then
238 SCM_VERSION=`$STAT -f "%Sm" ./CVS/Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\4-\1-\2 \3/'`
240 if [ test "$SYSTEM" = "openbsd"]; then
241 AC_CHECK_PROG(GREP, grep, grep)
242 if test "$ac_cv_prog_GREP" = "grep"; then
243 SCM_VERSION=`$STAT -f %a ./CVS/Entries | $GREP -v Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\1-\2-\4 \3/'`
246 if [ test "$SYSTEM" = "mingw"] || [ test "$SYSTEM" = "cygwin"]; then
247 AC_CHECK_PROG(GREP, grep, grep)
248 if test "$ac_cv_prog_GREP" = "grep"; then
249 SCM_VERSION=`$STAT ./CVS/Entries | $GREP Modify | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\5-\2-\3 \4/'`
252 SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c 1-19`
253 fi #if [ test "$SYSTEM" = "mingw"] || ...
254 fi #if [ test "$SYSTEM" = "openbsd"]
255 fi #if [ test "$SYSTEM" = "freebsd"] || ...
257 AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
258 SCM_VERSION="cannot find out SCM Version (no CUT)"
261 AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
262 SCM_VERSION="cannot find out SCM Version (no SED)"
265 AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
266 SCM_VERSION="cannot find out SCM Version (no STAT)"
270 # ********** **********
271 # ********** build MLDonkey version, Required Ocaml and LablGTK versions **********
272 # ********** **********
274 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
275 if test -f ./subrelease; then
276 MLDONKEY_VERSION=$MLDONKEY_VERSION`cat ./subrelease`
278 if test ! -z "$SUB_VERSION3"; then
279 MLDONKEY_VERSION=$MLDONKEY_VERSION.$SUB_VERSION3
282 REQUIRED_OCAML=3.11.2
283 DOWNLOAD_OCAML_MAJOR=3.11
284 DOWNLOAD_OCAML=3.11.2
286 REQUIRED_LABLGTK=1.2.7
292 # ********** **********
293 # ********** Network and Feature configure switch variables **********
294 # ********** **********
296 # ********** currently not working Networks, can't be enabled
302 # ********** working Networks, enabled by default
312 # ********** predefined configure variations
317 # ********** Features, enabled by default
320 DONKEY_SUI_FILE=DonkeySui2
337 # ********** **********
338 # ********** Network and Feature configure switches and dependency **********
339 # ********** **********
341 AC_ARG_ENABLE(multinet, [ --disable-multinet allows you to only compile support for eDonkey (incl. Overnet and Kademlia)], [MULTINET="$enableval"])
342 AC_ARG_ENABLE(minimum, [ --enable-minimum compile MLDonkey with minimum features and Networks (eDonkey, iconv and thread enabled)], [MINIMUM="$enableval"])
343 AC_ARG_ENABLE(minimum, [ --enable-minimum=all disable all optional features and Networks excepting eDonkey], [MINIMUM="$enableval"])
345 if [ test ! "$MULTINET" = "yes" ] || [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
353 if [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
359 if [ test "$MINIMUM" = "all" ]; then
364 #AC_ARG_ENABLE(soulseek, [ --disable-soulseek allows you to remove support for SoulSeek], [SOULSEEK="$enableval"])
365 #AC_ARG_ENABLE(opennap, [ --disable-opennap allows you to remove support for Open Napster], [OPEN_NAPSTER="$enableval"])
366 AC_ARG_ENABLE(directconnect, [ --disable-directconnect allows you to remove support for Direct Connect], [DIRECT_CONNECT="$enableval"])
367 #AC_ARG_ENABLE(openft, [ --disable-openft allows you to remove support for OpenFT], [OPENFT="$enableval"])
369 AC_ARG_ENABLE(donkey, [ --disable-donkey allows you to remove support for eDonkey], [DONKEY="$enableval"])
370 AC_ARG_ENABLE(donkeysui, [ --disable-donkeysui allows you to remove support for eMule SecureUserIdent], [DONKEY_SUI="$enableval"])
371 AC_ARG_ENABLE(bittorrent, [ --disable-bittorrent allows you to remove support for Bittorent], [BITTORRENT="$enableval"])
372 AC_ARG_ENABLE(filetp, [ --disable-filetp allows you to remove support for fileTP], [FILETP="$enableval"])
373 AC_ARG_ENABLE(gnutella, [ --disable-gnutella allows you to remove support for Gnutella], [GNUTELLA="$enableval"])
374 AC_ARG_ENABLE(gnutella2, [ --disable-gnutella2 allows you to remove support for Gnutella2], [GNUTELLA2="$enableval"])
375 AC_ARG_ENABLE(fasttrack, [ --disable-fasttrack allows you to remove support for FastTrack], [FASTTRACK="$enableval"])
377 AC_ARG_ENABLE(batch, [ --enable-batch reply YES to all queries in this script], [BATCH="$enableval"])
378 AC_ARG_ENABLE(force-ocaml, [ --enable-force-ocaml force usage of self-compiled Ocaml], [FORCE_OCAML="$enableval"])
379 AC_ARG_ENABLE(ocamlver, [ --enable-ocamlver=VER force usage of specific Ocaml version (3.08.1|CVS), ], [REQUIRED_OCAML="$enableval"])
380 AC_ARG_ENABLE(mingw, [ --enable-mingw forces compilation with MINGW on Cygwin], [FORCE_MINGW="$enableval"])
381 AC_ARG_ENABLE(checks, [ --enable-checks force mldonkey to perform bound checks on array/string access], [CHECKBOUNDS="$enableval"])
382 if test "$CHECKBOUNDS" = "yes"; then
386 AC_ARG_ENABLE(profile, [ --enable-profile allows you to profile mlnet using gprof], [PROFILE="$enableval"])
387 AC_ARG_ENABLE(debug, [ --enable-debug allows you to compile mlnet with debug symbols], [DEBUG="$enableval"])
388 AC_ARG_ENABLE(gui, [ --disable-gui allows you to disable GUI build (default)], [GUI="$enableval"])
389 AC_ARG_ENABLE(gui, [ --enable-gui=oldgui|newgui1|newgui2
390 allows you to choose a GUI (default: newgui2 - is a GTK2 GUI, other GUIs use GTK1)], [GUI="$enableval"])
391 if test "$GUI" = "yes"; then
394 if test ! "$GUI" = "newgui2"; then
395 if test ! "$GUI" = "newgui1"; then
396 if test ! "$GUI" = "oldgui"; then
402 AC_ARG_ENABLE(pthread, [ --disable-pthread allows you to disable pthread support in mldonkey, hurts performance!], [USE_PTHREAD="$enableval"])
403 AC_ARG_ENABLE(pthread-lib, [ --enable-pthread-lib legacy option], [USE_PTHREAD="$enableval"])
404 AC_ARG_ENABLE(iconv, [ --disable-iconv disable the use of iconv], [ICONV="$enableval"])
405 AC_ARG_ENABLE(gd, [ --disable-gd disable the use of gd], [GD="$enableval"])
406 AC_ARG_ENABLE(bzip2, [ --disable-bzip2 disable the use of bzip2], [BZIP2="$enableval"])
407 AC_ARG_ENABLE(magic, [ --disable-magic disable the use of libmagic (GNU file)], [MAGIC="$enableval"])
409 if test "$FORCE_MINGW" = "yes"; then
411 CPP="$CPP -mno-cygwin"
419 echo -e "\n--------------------------------"
420 echo " Checking system tools."
421 echo "--------------------------------"
424 AC_CHECK_PROG(GNU_MAKE, gmake, gmake)
425 AC_CHECK_PROG(GNU_MAKE, make, make)
427 if test "x$GNU_MAKE" != "x"; then
428 AC_MSG_CHECKING( [if $GNU_MAKE is GNU make] )
429 $GNU_MAKE --version > /dev/null 2>&1
430 if test "$?" != "0"; then
432 AC_MSG_ERROR(GNU make not found)
437 AC_MSG_ERROR(GNU make not found)
440 AC_CHECK_PROG(COMPRESS, bzip2, bzip2)
441 AC_CHECK_PROG(COMPRESS, gzip, gzip)
443 if test "$ac_cv_prog_COMPRESS" = "bzip2"; then
449 AC_PATH_PROG(PERL, perl, perl)
450 AC_CHECK_PROG(RPMBUILD,rpmbuild,rpmbuild)
451 AC_CHECK_PROG(RPMBUILD,rpm,rpm)
453 AC_CHECK_PROG(WGET, wget, wget)
454 if test -z "$ac_cv_prog_WGET"; then
455 $CC -o wget wget.c || echo "Cannot compile wget.c"
456 AC_PATH_PROG(WGET, wget,,$SOURCE_DIR/config)
457 ac_cv_prog_WGET="$ac_cv_path_WGET"
459 WGET="$ac_cv_prog_WGET"
461 echo "----------------------------------------"
462 echo " Checking system tools finished."
463 echo -e "----------------------------------------\n"
465 echo "--------------------------------"
466 echo " Checking Ocaml compiler."
467 echo "--------------------------------"
469 CONFIG_DIR=$SOURCE_DIR/config
470 PATCH_DIR=$SOURCE_DIR/patches
471 LOCAL_DIR=$PATCH_DIR/local
472 BUILD_DIR=$PATCH_DIR/build
474 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"])
477 LOCAL_OCAML=$LOCAL_DIR/bin
479 AC_PATH_PROG(OCAMLC,ocamlc.opt,"",[$LOCAL_DIR/bin:$PATH])
480 AC_CHECK_TOOL(OCAMLC,ocamlc,ocamlrun ocamlc)
481 AC_PATH_PROG(CAMLP4, camlp4,"",[$LOCAL_DIR/bin:$PATH])
484 if [ test -z "$OCAMLC" ] || [ test -z "$CAMLP4" ] || [ test "$REQUIRED_OCAML" = "CVS" ]; then
487 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
488 case "$OCAMLVERSION" in
489 "$REQUIRED_OCAML"*|3.12.*|3.11.*|3.10.*|3.09.*|3.08.4*|3.08.3*) ;;
497 if [ test "$BUILD_OCAML" = "yes" ] || [ test "$FORCE_OCAML" = "yes" ]; then
499 if [ test "$SYSTEM" = "mingw" ]; then
500 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
501 echo "******** no valid Ocaml compiler found on your system *********" 1>&2;
502 echo "******** on MinGW there is no possibility to let configure *********" 1>&2;
503 echo "******** build the Ocaml compiler with the included script *********" 1>&2;
504 echo "******** check http://mldonkey.sourceforge.net/Windows *********" 1>&2;
505 echo "******** for instuctions how to compile Ocaml under MinGW *********" 1>&2;
509 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
510 if [ test "$WGET" = "" ] && [ test "$REQUIRED_OCAML" != "CVS" ]; then
511 echo "******** wget is missing *********" 1>&2;
512 echo "******** cannot download Ocaml *********" 1>&2;
515 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
516 echo "Do you want this script to try to download and install ocaml"
517 echo "LOCALLY in mldonkey directory ?"
518 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
522 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
526 cvs -d:pserver:anoncvs:""@camlcvs.inria.fr:/caml login
527 cvs -z3 -d:pserver:anoncvs@camlcvs.inria.fr:/caml co -P ocaml
530 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
532 $WGET http://caml.inria.fr/pub/distrib/ocaml-"$DOWNLOAD_OCAML_MAJOR"/ocaml-"$REQUIRED_OCAML".tar.gz
534 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
535 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.12/ocaml-"$REQUIRED_OCAML".tar.gz
537 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
538 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.10/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.09/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.08/ocaml-"$REQUIRED_OCAML".tar.gz
546 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
547 echo "******** download Ocaml $REQUIRED_OCAML not successful, try do download it manually *********" 1>&2;
548 echo "******** from http://caml.inria.fr/pub/distrib/ *********" 1>&2;
549 echo "******** and copy the tar.gz into $PATCH_DIR *********" 1>&2;
553 echo Uncompressing ...
556 rm -rf ocaml-"$REQUIRED_OCAML"
557 gzip -cd $PATCH_DIR/ocaml-"$REQUIRED_OCAML".tar.gz | tar vxf -
558 cd ocaml-"$REQUIRED_OCAML"
559 if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
561 patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
565 ./configure -prefix $LOCAL_DIR -host $host -cc $CC
567 cp -f Makefile Makefile.old
568 sed "s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" Makefile.old > Makefile
570 cp -f $PATCH_DIR/Makefile.ocamldoc ocamldoc/Makefile
572 $GNU_MAKE world opt opt.opt
575 if ! test -f $LOCAL_DIR/lib/ocaml/threads; then
576 if ! test -f $LOCAL_DIR/lib/ocaml/vmthreads; then
577 ln -s vmthreads $LOCAL_DIR/lib/ocaml/threads
581 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
584 rm -rf ocaml-"$REQUIRED_OCAML"
587 echo Ocaml locally installed for mldonkey
589 if test -f "$LOCAL_OCAML"/ocamlc.opt; then
590 OCAMLC=$LOCAL_OCAML/ocamlc.opt
591 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc.opt
593 if test -f "$LOCAL_OCAML"/ocamlc; then
594 OCAMLC=$LOCAL_OCAML/ocamlc
595 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc
597 echo "Ocaml installation failed"; exit 1
606 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc.opt ; then
607 OCAML_PATH="$LOCAL_OCAML"/
608 OCAMLOPT=$LOCAL_OCAML/ocamlopt.opt
609 OCAMLDOC=$LOCAL_OCAML/ocamldoc
610 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
611 OCAMLDEP=$LOCAL_OCAML/ocamldep
612 OCAMLLEX=$LOCAL_OCAML/ocamllex.opt
613 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
614 CAMLP4=$LOCAL_OCAML/camlp4
616 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc ; then
617 OCAML_PATH="$LOCAL_OCAML"/
618 if test -f "$LOCAL_OCAML/ocamlopt"; then
619 OCAMLOPT=$LOCAL_OCAML/ocamlopt
623 OCAMLDOC=$LOCAL_OCAML/ocamldoc
624 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
625 OCAMLDEP=$LOCAL_OCAML/ocamldep
626 OCAMLLEX=$LOCAL_OCAML/ocamllex
627 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
628 CAMLP4=$LOCAL_OCAML/camlp4
630 AC_CHECK_PROG(OCAMLOPT, ocamlopt.opt, ocamlopt.opt)
631 AC_CHECK_PROG(OCAMLOPT, ocamlopt, ocamlopt, no)
632 AC_CHECK_PROG(OCAMLDEP, ocamldep, ocamldep)
633 AC_CHECK_PROG(OCAMLLEX, ocamllex.opt, ocamllex.opt)
634 AC_CHECK_PROG(OCAMLLEX, ocamllex, ocamllex)
635 AC_CHECK_PROG(OCAMLYACC, ocamlyacc, ocamlyacc)
636 AC_CHECK_PROG(OCAMLDOC, ocamldoc, ocamldoc)
637 AC_CHECK_PROG(OCAMLMKTOP, ocamlmktop, ocamlmktop)
638 AC_CHECK_PROG(CAMLP4, camlp4, camlp4)
642 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
643 OCAMLLIB=`$OCAMLC -where`
645 case "$OCAMLVERSION" in
647 if test "$GUI" = "oldgui"; then
652 "$REQUIRED_OCAML"*|3.09.*|3.08.4*|3.08.3*) ;;
654 if [ test "$REQUIRED_OCAML" != "CVS" ]; then
659 if test "$REBUILD_OCAML" = "yes"; then
660 echo "******** Version $REQUIRED_OCAML of Objective-Caml is required *********" 1>&2;
661 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
665 if test "$OCAMLOPT" = "no"; then
672 OCAMLOPTVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
674 test "$OCAMLOPTVERSION" = "$OCAMLVERSION" || {
675 echo "******** Version $REQUIRED_OCAML of ocamlopt is required *********" 1>&2;
676 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
681 echo "-------------------------------------------"
682 echo " Checking Ocaml $OCAMLVERSION finished."
683 echo "-------------------------------------------"
686 if test "$PROFILE" = "yes"; then
687 OCAMLOPT="$OCAMLOPT -p"
690 if test "$FORCE_MINGW" = "yes"; then
691 OCAMLC="$OCAMLC -ccopt -mno-cygwin"
692 OCAMLOPT="$OCAMLOPT -ccopt -mno-cygwin"
693 OCAMLMKTOP="$OCAMLMKTOP -ccopt -mno-cygwin"
695 if test "$DEBUG" = "yes"; then
699 echo -e "\n----------------------------------"
700 echo " Checking system headers."
701 echo "----------------------------------"
703 ifelse(AC_ACVERSION, [2.13], [],
704 [dnl Large file enabled
709 # various header files
710 AC_CHECK_FUNCS(setrlimit getrlimit strerror_r strerror posix_fallocate)
711 AC_CHECK_HEADERS(byteswap.h,,)
712 AC_CHECK_HEADERS([sys/utsname.h])
713 AC_CHECK_HEADERS(arpa/inet.h,,)
714 AC_CHECK_HEADERS([sys/types.h sys/time.h sys/resource.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
715 [#ifdef HAVE_SYS_TYPES_H
716 #include <sys/types.h>
718 #ifdef HAVE_SYS_TIME_H
719 #include <sys/time.h>
721 #ifdef HAVE_NETINET_IN_SYSTM_H
722 #include <netinet/in_systm.h>
724 #ifdef HAVE_NETINET_IN_H
725 #include <netinet/in.h>
730 AC_CHECK_HEADERS(sys/poll.h,,)
731 AC_CHECK_FUNCS(poll,,)
733 AC_CHECK_HEADERS(sys/vfs.h,,)
734 AC_CHECK_HEADERS(sys/statvfs.h,,)
735 AC_CHECK_HEADERS([sys/param.h sys/mount.h],,,
736 [#if HAVE_SYS_PARAM_H
737 #include <sys/param.h>
740 echo "-------------------------------------------"
741 echo " Checking system headers finished."
742 echo -e "-------------------------------------------\n"
743 echo "-----------------------------------"
744 echo " Checking system libraries."
745 echo "-----------------------------------"
746 echo "----- checking zlib (required)"
747 AC_CHECK_LIB(z,inflate,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
748 AC_CHECK_HEADERS(zlib.h,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
749 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
751 if test "$BZIP2" != "no"; then
752 echo "----- checking bzlib (optional)"
753 AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])],[BZIP2=no])
756 if test "$BZIP2" = "yes"; then
757 AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
758 AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
760 AC_MSG_NOTICE(bzlib not available)
763 if test "$MAGIC" != "no"; then
764 echo "----- checking libmagic (GNU file) (optional)"
765 AC_CHECK_HEADERS(magic.h,
766 [AC_CHECK_LIB(magic,magic_file,
767 [AC_CHECK_DECL([MAGIC_ERROR], [MAGIC=yes], [MAGIC=no],[#include <magic.h>])],
772 if test "$MAGIC" = "yes"; then
775 MAGICLIB=Magic_nomagic
776 AC_MSG_NOTICE(libmagic not available)
781 if test "$GD" != "no"; then
782 echo "----- checking gd (optional)"
787 SAVE_LDFLAGS=$LDFLAGS
788 AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
789 if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
790 GD_LIBS=`$GDLIBCONFIG --libs`
791 $GDLIBCONFIG --static-libs > /dev/null 2>&1
792 if test "$?" = "0"; then
793 GD_STATIC_LIBS=`$GDLIBCONFIG --static-libs`
795 GD_LIBS2="$LIBS -lgd $GD_LIBS"
797 GD_CFLAGS=`$GDLIBCONFIG --cflags`
798 CFLAGS="$CFLAGS $GD_CFLAGS"
799 GD_LDFLAGS=`$GDLIBCONFIG --ldflags`
800 LDFLAGS="$LDFLAGS $GD_LDFLAGS"
801 AC_MSG_CHECKING(for libgd > 2.0.14)
802 GDVERSION=`$GDLIBCONFIG --version`
803 GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
804 GDMINORVERSION=`$GDLIBCONFIG --minorversion`
805 GDREVISION=`$GDLIBCONFIG --revision`
806 if [ [ $GDMAJORVERSION = 2 ] && [ $GDMINORVERSION = 0 ] && [ $GDREVISION -gt 14 ]]; then
807 AC_MSG_RESULT($GDVERSION)
810 AC_MSG_RESULT(no (found $GDVERSION))
817 if test "$LIBGD" = "yes"; then
818 AC_CHECK_HEADERS(gd.h,[LIBGD=yes],[LIBGD=no])
821 if test "$LIBGD" = "yes"; then
822 AC_MSG_CHECKING(for gdImageCreate in -lgd)
823 AC_TRY_LINK([#include <gd.h>],
824 [gdImageCreate (0,0);],
825 [LIBGD=yes], [LIBGD=no])
826 AC_MSG_RESULT($LIBGD)
829 if test "$LIBGD" = "no"; then
830 AC_MSG_NOTICE([not found, trying another method])
831 AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
835 if test "$LIBGD" = "yes"; then
837 # saving current variables
839 SAVE_CFLAGS_PNG=$CFLAGS
840 SAVE_LDFLAGS_PNG=$LDFLAGS
841 AC_CHECK_PROG(PNGLIBCONFIG, libpng-config, libpng-config)
842 if test "$ac_cv_prog_PNGLIBCONFIG" = "libpng-config"; then
843 # check libpng-config contents and update system variables
844 PNG_LIBS=`$PNGLIBCONFIG --libs`
845 LIBS="$LIBS $PNG_LIBS"
846 PNG_CFLAGS=`$PNGLIBCONFIG --cflags`
847 CFLAGS="$CFLAGS $PNG_CFLAGS"
848 PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
849 LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
851 AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
854 CFLAGS=$SAVE_CFLAGS_PNG
855 LDFLAGS=$SAVE_LDFLAGS_PNG
857 if test "$LIBPNG" = "no"; then
858 AC_MSG_NOTICE(png support not available)
862 AC_MSG_CHECKING(for gdImagePng in -lgd)
863 AC_TRY_LINK([#include <gd.h>],
865 [LIBGD_PNG=yes], [LIBGD_PNG=no])
866 AC_MSG_RESULT($LIBGD_PNG)
869 if test "$LIBGD_PNG" = "no"; then
870 AC_MSG_NOTICE([not found, trying another method])
871 AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
874 AC_MSG_CHECKING(for png support in libgd)
875 if test "$LIBGD_PNG" = "yes"; then
879 AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
880 AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
887 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [LIBJPEG=yes])
889 if test "$LIBJPEG" = "no"; then
890 AC_MSG_NOTICE(jpeg support not available)
894 AC_MSG_CHECKING(for gdImageJpeg in -lgd)
895 AC_TRY_LINK([#include <gd.h>],
896 [gdImageJpeg (0,0,0);],
897 [LIBGD_JPG=yes], [LIBGD_JPG=no])
898 AC_MSG_RESULT($LIBGD_JPG)
901 if test "$LIBGD_JPG" = "no"; then
902 AC_MSG_NOTICE([not found, trying another method])
903 AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
906 AC_MSG_CHECKING(for jpeg support in libgd)
907 if test "$LIBGD_JPG" = "yes"; then
910 AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in libgd.])
917 AC_MSG_NOTICE(libgd not available)
921 LDFLAGS=$SAVE_LDFLAGS
924 if test "$GD" != "no"; then
925 GDGRAPHICS=DriverGraphics_gd
927 GDGRAPHICS=DriverGraphics_nogd
930 if test "$ICONV" = "yes"; then
931 echo "----- checking iconv (optional)"
933 if test "$am_cv_func_iconv" != "yes"; then
934 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
937 LIBS="$LIBS $LIBICONV"
938 AC_CHECK_FUNCS([locale_charset],,
939 AC_TRY_LINK([#include <langinfo.h>],
940 [char* cs = nl_langinfo(CODESET);],
941 AC_MSG_NOTICE(found nl_langinfo(CODESET)),
942 [echo "Your iconv implementation is incomplete"; exit 1]))
943 AC_CHECK_LIB(charset,locale_charset)
944 AC_CHECK_HEADERS([libcharset.h])
945 AC_CHECK_HEADERS([langinfo.h])
946 AC_CHECK_HEADERS([locale.h])
949 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
953 if test "$USE_PTHREAD" = "no"; then
955 echo "You disabled thread support, this will hurt MLDonkey performance!"
957 echo "----- checking thread support (optional, strongly advised)"
961 # On linux plaforms, we will have to check that includes from kernel are
962 # available. glibc version test was shamelessly taken from
963 # http://public.activestate.com/gsar/APC/perl-5.8.x/Configure
967 echo "----- GNU C Library version"
968 AC_CHECK_HEADERS(linux/limits.h,, [
969 OLD_CPPFLAGS=$CPPFLAGS
970 CPPFLAGS="-I /usr/src/linux/include"
971 AC_CHECK_HEADER(linux/types.h,[CONFIG_INCLUDES="-I /usr/src/linux/include"])
972 CPPFLAGS=$OLD_CPPFLAGS]
974 AC_CHECK_HEADERS(gnu/libc-version.h,[AC_MSG_CHECKING(for GNU C Library version)
977 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
978 alone are insufficient to distinguish different versions, such as
979 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
980 libc version 2.1.0. A. Dougherty, June 3, 2002.
986 # ifdef __GLIBC_MINOR__
987 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
988 # include <gnu/libc-version.h>
989 printf("%s\n", gnu_get_libc_version());
991 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
994 printf("%d\n", __GLIBC__);
1004 GLIBC_VERSION="`./try`"
1005 AC_MSG_RESULT($GLIBC_VERSION)
1011 echo "---------------------------------------------"
1012 echo " Checking system libraries finished."
1013 echo -e "---------------------------------------------\n"
1017 echo "--------------------------------------"
1018 echo " Checking activated networks."
1019 echo "--------------------------------------"
1021 if test "$DONKEY" = "yes"; then
1022 AC_MSG_CHECKING(eDonkey)
1023 if test -d ../src/networks/donkey; then
1025 if test "$DONKEY_SUI" = "yes"; then
1028 AC_CHECK_TOOL(NEWCXX, [$CXX], [no])
1029 AC_MSG_CHECKING(eMule SUI)
1030 if test x"$NEWCXX" = x"no"
1037 ACX_CHECK_CXX_FLAGS(-fno-omit-frame-pointer,no_omit_frame_pointer, CRYPTOPPFLAGS="-fno-omit-frame-pointer")
1038 ACX_CHECK_CXX_FLAGS(-mno-omit-leaf-frame-pointer,no_omit_leaf_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -mno-omit-leaf-frame-pointer")
1040 CXX_VERSION=`$CXX -dumpversion`
1041 DONKEY_SUI_FILE=DonkeySui1
1042 AC_DEFINE(HAVE_CRYPTOPP, 1,)
1045 # AC_MSG_CHECKING(eDonkey server)
1046 # if test -d ../src/networks/server; then
1062 if test "$BITTORRENT" = "yes"; then
1063 AC_MSG_CHECKING(BitTorrent)
1064 if test -d ../src/networks/bittorrent; then
1072 if test "$FILETP" = "yes"; then
1073 AC_MSG_CHECKING(FileTP)
1074 if test -d ../src/networks/fileTP; then
1082 if test "$GNUTELLA" = "yes"; then
1083 AC_MSG_CHECKING(Gnutella)
1084 if test -d ../src/networks/gnutella; then
1092 if test "$GNUTELLA2" = "yes"; then
1094 if test -d ../src/networks/gnutella2; then
1102 if test "$FASTTRACK" = "yes"; then
1103 AC_MSG_CHECKING(Fasttrack)
1104 if test -d ../src/networks/fasttrack; then
1112 if test "$DIRECT_CONNECT" = "yes"; then
1113 AC_MSG_CHECKING(DirectConnect)
1114 if test "$BZIP2" = "yes"; then
1115 if test -d ../src/networks/direct_connect; then
1123 AC_MSG_RESULT(no - bzip2 support missing)
1127 if test "$SOULSEEK" = "yes"; then
1128 AC_MSG_CHECKING(Soulseek)
1129 if test -d ../src/networks/soulseek; then
1137 if test "$OPEN_NAPSTER" = "yes"; then
1138 AC_MSG_CHECKING(OpenNapster)
1139 if test -d ../src/networks/opennap; then
1147 if test "$OPENFT" = "yes"; then
1148 AC_MSG_CHECKING(OpenFT)
1149 if test -d ../src/networks/openFT; then
1156 echo "-----------------------------------------------"
1157 echo " Checking activated networks finished."
1158 echo "-----------------------------------------------"
1160 OCAMLLIB=`$OCAMLC -where`
1162 if test -f $OCAMLLIB/lablgl.cma; then
1163 LABLGL_CMA=lablgl.cma
1166 if test -f $OCAMLLIB/lablgl.$OCAMLLIB_EXT; then
1167 LABLGL_CMXA=lablgl.$OCAMLLIB_EXT
1170 # Check for GTK only if we want to build the GUI
1171 if test ! "$GUI" = "no"; then
1172 echo "---------------------------------------------------------"
1173 echo "Checking the libraries required to build the GTK GUI."
1174 echo "---------------------------------------------------------"
1175 if test "$GUI" = "newgui2"; then
1178 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1179 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1182 PKG_RSVG=librsvg-2.0
1183 AC_MSG_CHECKING(for librsvg - version >= $REQUIRED_RSVG)
1184 if pkg-config --atleast-version $REQUIRED_RSVG $PKG_RSVG; then
1185 GTK_CONFIG="pkg-config $PKG_GTK $PKG_RSVG"
1186 case "$OCAMLVERSION" in
1188 REQUIRED_LABLGTK=2.12.0
1191 REQUIRED_LABLGTK=2.14.1
1194 LABLGTK_NAME=lablgtk2
1205 if test "$OS_FILES2" = "mingw"; then
1207 PKG_GTK=gtk+-1.3-win32-production
1208 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1209 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1210 GTK_CONFIG="pkg-config $PKG_GTK"
1217 AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config, no)
1218 if test "$GTK_CONFIG" = "no"; then
1228 if test "$GTK_CONFIG" = "no"; then
1231 AC_MSG_CHECKING(for native code $LABLGTK_NAME)
1232 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1233 if test "$GUI" = "newgui2"; then
1234 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then
1240 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablrsvg.cma; then
1241 echo "---------------------------------------------------------"
1242 echo "lablrsvg is not installed properly. See the INSTALL.txt"
1243 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1244 echo "probably forgot to call 'make opt' before 'make install'."
1245 echo "---------------------------------------------------------"
1247 echo "---------------------------------------------------------"
1248 echo "lablrsvg is not installed. See the INSTALL.txt file of"
1249 echo "mldonkey to see how to compile $LABLGTK_NAME. Librsvg"
1250 echo "may not be installed when you compiled $LABLGTK_NAME."
1251 echo "---------------------------------------------------------"
1261 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.cma; then
1262 echo "-------------------------------------------------------------"
1263 echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
1264 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1265 echo "probably forgot to call 'make opt' before 'make install'."
1266 echo "-------------------------------------------------------------"
1268 echo "Do you want this script to try to download and install $LABLGTK_NAME"
1269 echo "LOCALLY in mldonkey directory ?"
1270 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
1275 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1276 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then
1277 echo Downloading ...
1278 $WGET http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgtk-"$REQUIRED_LABLGTK".tar.gz
1280 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then exit 1; fi
1284 echo Uncompressing ...
1285 gzip -cd $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".tar.gz | tar xf -
1286 (cd lablgtk-"$REQUIRED_LABLGTK"
1287 if test -f $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch; then
1289 patch -p0 < $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch
1291 PATH=$OCAML_PATH:$PATH
1295 if test "$GUI" = "newgui2"; then
1296 ./configure --prefix=$LOCAL_DIR
1307 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1310 if test -f `$OCAMLC -where`/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1313 echo "Installation of $LABLGTK_NAME failed"
1323 if test "$GUI" = "newgui2" ; then
1324 GUIS="mldonkey_gui\$(EXE)"
1325 GTKCFLAGS="`pkg-config --cflags-only-I gtk+-2.0`"
1326 GTKLLIBS="`pkg-config --libs-only-L gtk+-2.0`"
1327 GTKLFLAGS="`pkg-config --libs-only-l gtk+-2.0` -lX11"
1329 GUIS="mldonkey_gui\$(EXE) mldonkey_gui2\$(EXE)"
1332 if test "$LABLGTK_CONFIG" = "no"; then
1335 MORE_TARGETS="$MORE_TARGETS $GUIS"
1336 AC_MSG_CHECKING(GToolbox.popup_menu args)
1337 OCAML_LIB_DIR="`$OCAMLC -where`"
1338 GTOOLBOX="$OCAML_LIB_DIR/$LABLGTK_NAME/gToolbox.mli"
1339 grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
1340 if test "$GTOOLBOX_ARGS" = "new"; then
1341 GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
1344 GTOOLBOX_POPUPMENU=' ~x: button ~y: time '
1347 echo "---------------------------------------------------------"
1348 echo "End of GTK GUI configuration."
1349 echo "---------------------------------------------------------"
1352 if test "$OS_FILES" = "mingw"; then
1353 OCAMLDEP_OPTIONS="-slash"
1364 AC_SUBST(FIX_BROKEN_CPP)
1365 AC_SUBST(CONFIG_INCLUDES)
1372 AC_SUBST(OCAMLDEP_OPTIONS)
1376 AC_SUBST(OCAMLMKTOP)
1378 AC_SUBST(MORE_TARGETS)
1379 AC_SUBST(MORE_SUBDIRS)
1380 AC_SUBST(LABLGL_CMA)
1381 AC_SUBST(LABLGL_CMXA)
1385 AC_SUBST(OPEN_NAPSTER)
1386 AC_SUBST(DIRECT_CONNECT)
1389 AC_SUBST(BITTORRENT)
1395 AC_SUBST(DONKEY_SUI)
1396 AC_SUBST(CRYPTOPPFLAGS)
1397 AC_SUBST(DONKEY_SUI_FILE)
1398 AC_SUBST(DONKEY_SERVER)
1400 AC_SUBST(REQUIRED_OCAML)
1401 AC_SUBST(REQUIRED_LABLGTK)
1404 AC_SUBST(COMPRESS_EXT)
1405 AC_SUBST(CHECKBOUNDS)
1406 AC_SUBST(MLDONKEY_VERSION)
1407 AC_SUBST(SCM_VERSION)
1408 AC_SUBST(MAJOR_VERSION)
1409 AC_SUBST(MINOR_VERSION)
1410 AC_SUBST(SUB_VERSION)
1411 AC_SUBST(GTOOLBOX_POPUPMENU)
1414 AC_SUBST(TARGET_TYPE)
1422 AC_SUBST(GDGRAPHICS)
1424 AC_SUBST(GD_STATIC_LIBS)
1426 AC_SUBST(GD_LDFLAGS)
1430 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
1431 AC_SUBST(BUILD_SYSTEM)
1432 AC_SUBST(GLIBC_VERSION)
1433 AC_SUBST(CC_VERSION)
1434 AC_SUBST(CXX_VERSION)
1435 AC_SUBST(CONFIGURE_ARGUMENTS)
1436 AC_SUBST(CONFIGURE_RUN)
1438 AUTOCONF=../src/utils/lib/autoconf.ml
1439 GTK_AUTOCONF=../src/utils/lib/gAutoconf.ml
1443 $AUTOCONF.new $GTK_AUTOCONF.new \
1444 ../src/utils/lib/magic.ml \
1445 ../src/networks/donkey/donkeySui.ml \
1446 ../src/daemon/driver/driverGraphics.ml \
1447 ../packages/rpm/mldonkey.spec \
1448 ../packages/rpm/Makefile \
1449 ../packages/slackware/mldonkey.options)
1450 diff $AUTOCONF.new $AUTOCONF 2> /dev/null > /dev/null || cp -f $AUTOCONF.new $AUTOCONF
1451 diff $GTK_AUTOCONF.new $GTK_AUTOCONF 2> /dev/null > /dev/null || cp -f $GTK_AUTOCONF.new $GTK_AUTOCONF
1455 echo -e "\nBuilding dependencies (if it blocks, try '$GNU_MAKE depend' to see the problem)"
1456 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: '$GNU_MAKE depend'"
1458 echo -e -n "\nConfiguring MLDonkey" $MLDONKEY_VERSION
1459 if test ! -z "$SCM_VERSION"; then
1460 echo -n " - SCM: $SCM_VERSION"
1464 echo -e "\nNetwork modules:"
1465 echo -n " - eDonkey "
1466 if test "$DONKEY" = "yes"; then
1467 if test "$DONKEY_SUI" = "yes"; then
1468 echo "enabled (eMule SUI enabled)"
1470 echo "enabled (eMule SUI disabled)"
1476 echo -n " - BitTorrent "
1477 if test "$BITTORRENT" = "yes"; then
1483 echo -n " - FileTP (aka wget) "
1484 if test "$FILETP" = "yes"; then
1490 echo -n " - Fasttrack "
1491 if test "$FASTTRACK" = "yes"; then
1497 echo -n " - Gnutella "
1498 if test "$GNUTELLA" = "yes"; then
1499 echo "enabled (warning: this network module is unmaintained)"
1501 echo " disabled - unmaintained"
1504 echo -n " - Gnutella2 "
1505 if test "$GNUTELLA2" = "yes"; then
1506 echo "enabled (warning: this network module is unmaintained)"
1508 echo " disabled - unmaintained"
1511 echo -n " - Direct Connect "
1512 if test "$DIRECT_CONNECT" = "yes"; then
1518 echo -n " - Open Napster "
1519 if test "$OPEN_NAPSTER" = "yes"; then
1520 echo "enabled - currently not usable"
1522 echo " disabled - currently not usable"
1525 echo -n " - Soulseek "
1526 if test "$SOULSEEK" = "yes"; then
1527 echo "enabled - currently not usable"
1529 echo " disabled - currently not usable"
1532 echo -n " - OpenFT "
1533 if test "$OPENFT" = "yes"; then
1534 echo "enabled - currently not usable"
1536 echo " disabled - currently not usable"
1539 echo -e "\nCore features:"
1541 echo " - zlib (required) enabled"
1543 echo -n " - threads "
1544 if test "$USE_PTHREAD" = "yes"; then
1551 if test "$BZIP2" = "yes"; then
1558 if test "$ICONV" = "yes"; then
1564 echo -n " - libmagic "
1565 if test "$MAGIC" = "yes"; then
1571 echo -n " - graphical stats "
1572 if test "$GD" = "yes"; then
1574 echo -n " - png support "
1575 if test "$GD_PNG" = "yes"; then
1581 echo -n " - jpg support "
1582 if test "$GD_JPG" = "yes"; then
1591 if test "$LABLGTK_CONFIG" = "yes"; then
1592 echo -n -e "\n - GUI support "
1593 if test "$GUI" = "newgui1"; then
1596 if test "$GUI" = "newgui2"; then
1604 if test "$OLDGUI_NO_310" = "yes"; then
1605 echo " - GUI support GTK1 oldgui does not work with Ocaml 3.10/3.11, disabled"
1608 if test "$TARGET_TYPE" = "byte"; then
1609 OCAML_TYPE="- byte code"
1610 COMPILE_TARGET=".byte"
1612 echo -e "\nCompilers:"
1613 echo -e " - Ocaml version $OCAMLVERSION $OCAML_TYPE"
1614 echo -e " - $CC version $CC_VERSION"
1615 if test "x$CXX" != "x"; then
1616 echo -e " - $CXX version $CXX_VERSION"
1618 echo -e "\nNow execute '$GNU_MAKE' to start compiling. Good luck!"
1620 echo -e "\nTo compile a static code execute: $GNU_MAKE mlnet$COMPILE_TARGET.static"
1621 echo "To produce a release tarball execute: $GNU_MAKE release.mlnet.static"
1622 echo "To clean the build directory execute: $GNU_MAKE maintainerclean"
1623 if test "$DONKEY_SUI" = "yes"; then
1624 echo -e "\nCompiling CryptoPP.cc can take several minutes, on slow machines up to half an hour."