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=1 # 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"
168 if test "x$SYSTEM" = "xunknown"; then
169 echo "Unknown build system, please report to the MLDonkey development team at http://mldonkey.sourceforge.net/forums/"
174 alpha*-*-osf*) arch=alpha; system=digital;;
175 alpha*-*-linux*) arch=alpha; system=linux;;
176 alpha*-*-freebsd*) arch=alpha; system=freebsd;;
177 alpha*-*-netbsd*) arch=alpha; system=netbsd;;
178 alpha*-*-openbsd*) arch=alpha; system=openbsd;;
179 sparc-*-sunos4.*) arch=sparc; system=sunos;;
180 sparc-*-solaris2.*) arch=sparc; system=solaris;;
181 sparc-*-*bsd*) arch=sparc; system=bsd;;
182 sparc-*-linux*) arch=sparc; system=linux;;
183 i?86-*-linux*) arch=i386; system=linux;;
184 i386-*-*bsd*) arch=i386; system=bsd;;
185 i486-*-*bsd*) arch=i486; system=bsd;;
186 i586-*-*bsd*) arch=i586; system=bsd;;
187 i686-*-*bsd*) arch=i686; system=bsd;;
188 i?86-*-nextstep*) arch=i386; system=nextstep;;
189 i?86-*-solaris*) arch=i386; system=solaris;;
190 i?86-*-beos*) arch=i386; system=beos;;
191 i?86-*-cygwin*) arch=i386; system=cygwin;;
192 mips-*-irix6*) arch=mips; system=irix;;
193 hppa1.1-*-hpux*) arch=hppa; system=hpux;;
194 hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
195 rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
196 powerpc-*-aix*) arch=power; model=ppc; system=aix;;
197 powerpc-*-linux*) arch=power; model=ppc; system=elf;;
198 powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
199 powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
200 arm*-*-linux*) arch=arm; system=linux;;
201 ia64-*-linux*) arch=ia64; system=linux;;
206 i386-pc-linux*|i386-*-*bsd*) MD4COMP=as; MD4ARCH=i386;;
207 i486-pc-linux*|i486-*-*bsd*) MD4COMP=as; MD4ARCH=i486;;
208 i586-pc-linux*|i586-*-*bsd*) MD4COMP=as; MD4ARCH=i586;;
209 i686-pc-linux*|i686-*-*bsd*) MD4COMP=as; MD4ARCH=i686;;
210 i386-pc-mingw32*) MD4COMP=cc; MD4ARCH=i386;;
211 i486-pc-mingw32*) MD4COMP=cc; MD4ARCH=i486;;
212 i586-pc-mingw32*) MD4COMP=cc; MD4ARCH=i586;;
213 i686-pc-mingw32*) MD4COMP=cc; MD4ARCH=i686;;
219 # ********** **********
220 # ********** Parse checkout date (CVS) or revision (SVN) if available **********
221 # ********** **********
223 if test -d .svn; then
224 AC_MSG_NOTICE(checking SVN revision)
225 AC_CHECK_PROG(SVNVERSION,svnversion,svnversion)
226 if test "$ac_cv_prog_SVNVERSION" = "svnversion"; then
228 SCM_VERSION=`svnversion -n .`
229 else AC_MSG_NOTICE(cannot checking SVN revision... no SVNVERSION)
230 SCM_VERSION="cannot find out SVN revision (no SVNVERSION)"
234 if test -f ./CVS/Entries ; then
235 AC_MSG_NOTICE(checking CVS checkout date)
236 AC_CHECK_PROGS(STAT, stat gstat, stat)
237 if [ test "$ac_cv_prog_STAT" = "stat" ] || [ test "$ac_cv_prog_STAT" = "gstat" ]; then
238 AC_CHECK_PROG(SED, sed, sed)
239 if test "$ac_cv_prog_SED" = "sed"; then
240 AC_CHECK_PROG(CUT, cut, cut)
241 if test "$ac_cv_prog_CUT" = "cut"; then
243 if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "netbsd"] || ( [ test "$SYSTEM" = "macos" ] && [ test "$ac_cv_prog_STAT" != "gstat" ] ); then
244 SCM_VERSION=`$STAT -f "%Sm" ./CVS/Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\4-\1-\2 \3/'`
246 if [ test "$SYSTEM" = "openbsd"]; then
247 AC_CHECK_PROG(GREP, grep, grep)
248 if test "$ac_cv_prog_GREP" = "grep"; then
249 SCM_VERSION=`$STAT -f %a ./CVS/Entries | $GREP -v Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\1-\2-\4 \3/'`
252 if [ test "$SYSTEM" = "mingw"] || [ test "$SYSTEM" = "cygwin"]; then
253 AC_CHECK_PROG(GREP, grep, grep)
254 if test "$ac_cv_prog_GREP" = "grep"; then
255 SCM_VERSION=`$STAT ./CVS/Entries | $GREP Modify | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\5-\2-\3 \4/'`
258 SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c 1-19`
259 fi #if [ test "$SYSTEM" = "mingw"] || ...
260 fi #if [ test "$SYSTEM" = "openbsd"]
261 fi #if [ test "$SYSTEM" = "freebsd"] || ...
263 AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
264 SCM_VERSION="cannot find out SCM Version (no CUT)"
267 AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
268 SCM_VERSION="cannot find out SCM Version (no SED)"
271 AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
272 SCM_VERSION="cannot find out SCM Version (no STAT)"
276 # ********** **********
277 # ********** build MLDonkey version, Required Ocaml and LablGTK versions **********
278 # ********** **********
280 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
281 if test -f ./subrelease; then
282 MLDONKEY_VERSION=$MLDONKEY_VERSION`cat ./subrelease`
284 if test ! -z "$SUB_VERSION3"; then
285 MLDONKEY_VERSION=$MLDONKEY_VERSION.$SUB_VERSION3
288 REQUIRED_OCAML=3.12.0
289 DOWNLOAD_OCAML_MAJOR=3.12
290 DOWNLOAD_OCAML=3.12.0
292 REQUIRED_LABLGTK=1.2.7
298 # ********** **********
299 # ********** Network and Feature configure switch variables **********
300 # ********** **********
302 # ********** currently not working Networks, can't be enabled
308 # ********** working Networks, enabled by default
318 # ********** predefined configure variations
323 # ********** Features, enabled by default
326 DONKEY_SUI_FILE=DonkeySui2
345 # ********** **********
346 # ********** Network and Feature configure switches and dependency **********
347 # ********** **********
349 AC_ARG_ENABLE(multinet,
350 AS_HELP_STRING([--disable-multinet], [disable all networks except eDonkey (with Overnet and Kademlia)]),
351 [MULTINET="$enableval"])
352 AC_ARG_ENABLE(minimum,
353 AS_HELP_STRING([--enable-minimum], [enable minimum set of features and networks (eDonkey, iconv and threads enabled)]),
354 [MINIMUM="$enableval"])
355 AC_ARG_ENABLE(minimum,
356 AS_HELP_STRING([--enable-minimum=all], [enable only eDonkey network and disable all optional features (not recommended)]),
357 [MINIMUM="$enableval"])
359 if [ test ! "$MULTINET" = "yes" ] || [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
367 if [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
373 if [ test "$MINIMUM" = "all" ]; then
378 #AC_ARG_ENABLE(soulseek, [ --disable-soulseek disable support for SoulSeek], [SOULSEEK="$enableval"])
379 #AC_ARG_ENABLE(opennap, [ --disable-opennap disable support for Open Napster], [OPEN_NAPSTER="$enableval"])
380 AC_ARG_ENABLE(directconnect,
381 AS_HELP_STRING([--disable-directconnect], [disable support for Direct Connect]),
382 [DIRECT_CONNECT="$enableval"])
383 #AC_ARG_ENABLE(openft, [ --disable-openft disable support for OpenFT], [OPENFT="$enableval"])
385 AC_ARG_ENABLE(donkey,
386 AS_HELP_STRING([--disable-donkey], [disable support for eDonkey]),
387 [DONKEY="$enableval"])
388 AC_ARG_ENABLE(donkeysui,
389 AS_HELP_STRING([--disable-donkeysui], [disable support for eMule SecureUserIdent]),
390 [DONKEY_SUI="$enableval"])
391 AC_ARG_ENABLE(bittorrent,
392 AS_HELP_STRING([--disable-bittorrent], [disable support for Bittorent]),
393 [BITTORRENT="$enableval"])
394 AC_ARG_ENABLE(filetp,
395 AS_HELP_STRING([--disable-filetp], [disable support for fileTP]),
396 [FILETP="$enableval"])
397 AC_ARG_ENABLE(gnutella,
398 AS_HELP_STRING([--disable-gnutella], [disable support for Gnutella]),
399 [GNUTELLA="$enableval"])
400 AC_ARG_ENABLE(gnutella2,
401 AS_HELP_STRING([--disable-gnutella2], [disable support for Gnutella2]),
402 [GNUTELLA2="$enableval"])
403 AC_ARG_ENABLE(fasttrack,
404 AS_HELP_STRING([--disable-fasttrack], [disable support for FastTrack]),
405 [FASTTRACK="$enableval"])
408 AS_HELP_STRING([--enable-batch], [reply YES to all queries in this script]),
409 [BATCH="$enableval"])
410 AC_ARG_ENABLE(force-ocaml,
411 AS_HELP_STRING([--enable-force-ocaml], [force usage of self-compiled Ocaml]),
412 [FORCE_OCAML="$enableval"])
413 AC_ARG_ENABLE(ocamlver,
414 AS_HELP_STRING([--enable-ocamlver=VER], [force usage of specific Ocaml version (3.10.1|SVN), ]),
415 [REQUIRED_OCAML="$enableval"])
417 AS_HELP_STRING([--enable-mingw], [force compilation with MINGW on Cygwin]),
418 [FORCE_MINGW="$enableval"])
419 AC_ARG_ENABLE(checks,
420 AS_HELP_STRING([--enable-checks], [enable bounds-checking for array/string accesses]),
421 [CHECKBOUNDS="$enableval"])
422 if test "$CHECKBOUNDS" = "yes"; then
426 AC_ARG_ENABLE(profile,
427 AS_HELP_STRING([--enable-profile], [compile with gprof profiling support (enables debug)]),
428 [PROFILE="$enableval"])
430 AS_HELP_STRING([--enable-debug], [compile with debugging information]),
431 [DEBUG="$enableval"])
432 if test "$PROFILE" = "yes"; then
436 AS_HELP_STRING([--disable-gui], [disable GUI build (default)]),
439 AS_HELP_STRING([--enable-gui=oldgui|newgui1|newgui2],
440 [enable GUI (newgui2 uses GTK2 (default), other GUIs use GTK1)]),
442 if test "$GUI" = "yes"; then
445 if test ! "$GUI" = "newgui2"; then
446 if test ! "$GUI" = "newgui1"; then
447 if test ! "$GUI" = "oldgui"; then
453 AC_ARG_ENABLE(pthread,
454 AS_HELP_STRING([--disable-pthread], [disable the use of pthread, hurts performance!]),
455 [USE_PTHREAD="$enableval"])
456 AC_ARG_ENABLE(pthread-lib,
457 AS_HELP_STRING([--enable-pthread-lib], [legacy option]),
458 [USE_PTHREAD="$enableval"])
460 AS_HELP_STRING([--disable-iconv], [disable the use of iconv]),
461 [ICONV="$enableval"])
463 AS_HELP_STRING([--disable-gd], [disable the use of gd]),
466 AS_HELP_STRING([--disable-bzip2], [disable the use of bzip2]),
467 [BZIP2="$enableval"])
469 AS_HELP_STRING([--disable-magic], [disable the use of libmagic (GNU file)]),
470 [MAGIC="$enableval"])
471 AC_ARG_ENABLE(upnp-natpmp,
472 AS_HELP_STRING([--enable-upnp-natpmp], [enable the use of libminiupnpc and libnatpmp]),
473 [UPNP_NATPMP="$enableval"])
474 AC_ARG_ENABLE(force-upnp-natpmp,
475 AS_HELP_STRING([--enable-force-upnp-natpmp], [force local compilation of libminiupnpc and libnatpmp]),
476 [UPNP_NATPMP_FORCE="$enableval"])
478 if test "$FORCE_MINGW" = "yes"; then
480 CPP="$CPP -mno-cygwin"
488 echo -e "\n--------------------------------"
489 echo " Checking system tools."
490 echo "--------------------------------"
493 AC_CHECK_PROG(GNU_MAKE, gmake, gmake)
494 AC_CHECK_PROG(GNU_MAKE, make, make)
496 if test "x$GNU_MAKE" != "x"; then
497 AC_MSG_CHECKING( [if $GNU_MAKE is GNU make] )
498 $GNU_MAKE --version > /dev/null 2>&1
499 if test "$?" != "0"; then
501 AC_MSG_ERROR(GNU make not found)
506 AC_MSG_ERROR(GNU make not found)
509 AC_CHECK_PROG(COMPRESS, bzip2, bzip2)
510 AC_CHECK_PROG(COMPRESS, gzip, gzip)
512 if test "$ac_cv_prog_COMPRESS" = "bzip2"; then
518 AC_PATH_PROG(PERL, perl, perl)
519 AC_CHECK_PROG(RPMBUILD,rpmbuild,rpmbuild)
520 AC_CHECK_PROG(RPMBUILD,rpm,rpm)
522 AC_CHECK_PROG(WGET, wget, wget)
523 if test -z "$ac_cv_prog_WGET"; then
524 $CC -o wget wget.c || echo "Cannot compile wget.c"
525 AC_PATH_PROG(WGET, wget,,$SOURCE_DIR/config)
526 ac_cv_prog_WGET="$ac_cv_path_WGET"
528 WGET="$ac_cv_prog_WGET"
530 echo "----------------------------------------"
531 echo " Checking system tools finished."
532 echo -e "----------------------------------------\n"
534 echo "--------------------------------"
535 echo " Checking Ocaml compiler."
536 echo "--------------------------------"
538 CONFIG_DIR=$SOURCE_DIR/config
539 PATCH_DIR=$SOURCE_DIR/patches
540 LOCAL_DIR=$PATCH_DIR/local
541 BUILD_DIR=$PATCH_DIR/build
543 AC_ARG_ENABLE(local-prefix,
544 AS_HELP_STRING([--enable-local-prefix=DIR], [specify path for temporary tools installation (DIR must be absolute)]),
545 [LOCAL_DIR="$enableval"])
548 LOCAL_OCAML=$LOCAL_DIR/bin
550 AC_PATH_PROG(OCAMLC,ocamlc.opt,"",[$LOCAL_DIR/bin:$PATH])
551 AC_CHECK_TOOL(OCAMLC,ocamlc,ocamlrun ocamlc)
552 AC_PATH_PROG(CAMLP4, camlp4,"",[$LOCAL_DIR/bin:$PATH])
555 if [ test -z "$OCAMLC" ] || [ test -z "$CAMLP4" ] || [ test "$REQUIRED_OCAML" = "SVN" ]; then
558 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
559 case "$OCAMLVERSION" in
560 "$REQUIRED_OCAML"*|3.12.*|3.11.*|3.10.1*|3.10.2*) ;;
567 case "$REQUIRED_OCAML" in
570 REQUIRED_OCAML=3.12.0
574 if [ test "$BUILD_OCAML" = "yes" ] || [ test "$FORCE_OCAML" = "yes" ]; then
576 if [ test "$SYSTEM" = "mingw" ]; then
577 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
578 echo "******** no valid Ocaml compiler found on your system *********" 1>&2;
579 echo "******** on MinGW there is no possibility to let configure *********" 1>&2;
580 echo "******** build the Ocaml compiler with the included script *********" 1>&2;
581 echo "******** check http://mldonkey.sourceforge.net/Windows *********" 1>&2;
582 echo "******** for instuctions how to compile Ocaml under MinGW *********" 1>&2;
586 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
587 if [ test "$WGET" = "" ] && [ test "$REQUIRED_OCAML" != "SVN" ]; then
588 echo "******** wget is missing *********" 1>&2;
589 echo "******** cannot download Ocaml *********" 1>&2;
592 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
593 echo "Do you want this script to try to download and install ocaml"
594 echo "LOCALLY in mldonkey directory ?"
595 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
599 if [ test "$REQUIRED_OCAML" = "SVN" ]; then
603 svn checkout http://caml.inria.fr/svn/ocaml/trunk
606 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
608 $WGET http://caml.inria.fr/pub/distrib/ocaml-"$DOWNLOAD_OCAML_MAJOR"/ocaml-"$REQUIRED_OCAML".tar.gz
610 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
611 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-"$REQUIRED_OCAML".tar.gz
613 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
614 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.10/ocaml-"$REQUIRED_OCAML".tar.gz
616 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
617 echo "******** download Ocaml $REQUIRED_OCAML not successful, try do download it manually *********" 1>&2;
618 echo "******** from http://caml.inria.fr/pub/distrib/ *********" 1>&2;
619 echo "******** and copy the tar.gz into $PATCH_DIR *********" 1>&2;
623 echo Uncompressing ...
626 rm -rf ocaml-"$REQUIRED_OCAML"
627 gzip -cd $PATCH_DIR/ocaml-"$REQUIRED_OCAML".tar.gz | tar vxf -
628 cd ocaml-"$REQUIRED_OCAML"
629 if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
631 patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
635 ./configure -prefix $LOCAL_DIR -host $host -cc $CC
637 cp -f Makefile Makefile.old
638 sed "s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" Makefile.old > Makefile
640 cp -f $PATCH_DIR/Makefile.ocamldoc ocamldoc/Makefile
642 $GNU_MAKE world opt opt.opt
645 if ! test -f $LOCAL_DIR/lib/ocaml/threads; then
646 if ! test -f $LOCAL_DIR/lib/ocaml/vmthreads; then
647 ln -s vmthreads $LOCAL_DIR/lib/ocaml/threads
651 if [ test "$REQUIRED_OCAML" = "SVN" ]; then
654 rm -rf ocaml-"$REQUIRED_OCAML"
657 echo Ocaml locally installed for mldonkey
659 if test -f "$LOCAL_OCAML"/ocamlc.opt; then
660 OCAMLC=$LOCAL_OCAML/ocamlc.opt
661 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc.opt
663 if test -f "$LOCAL_OCAML"/ocamlc; then
664 OCAMLC=$LOCAL_OCAML/ocamlc
665 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc
667 echo "Ocaml installation failed"; exit 1
676 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc.opt ; then
677 OCAML_PATH="$LOCAL_OCAML"/
678 OCAMLOPT=$LOCAL_OCAML/ocamlopt.opt
679 OCAMLDOC=$LOCAL_OCAML/ocamldoc
680 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
681 OCAMLDEP=$LOCAL_OCAML/ocamldep
682 OCAMLLEX=$LOCAL_OCAML/ocamllex.opt
683 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
684 CAMLP4=$LOCAL_OCAML/camlp4
685 CAMLP4OF=$LOCAL_OCAML/camlp4of
687 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc ; then
688 OCAML_PATH="$LOCAL_OCAML"/
689 if test -f "$LOCAL_OCAML/ocamlopt"; then
690 OCAMLOPT=$LOCAL_OCAML/ocamlopt
694 OCAMLDOC=$LOCAL_OCAML/ocamldoc
695 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
696 OCAMLDEP=$LOCAL_OCAML/ocamldep
697 OCAMLLEX=$LOCAL_OCAML/ocamllex
698 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
699 CAMLP4=$LOCAL_OCAML/camlp4
700 CAMLP4OF=$LOCAL_OCAML/camlp4of
702 AC_CHECK_PROG(OCAMLOPT, ocamlopt.opt, ocamlopt.opt)
703 AC_CHECK_PROG(OCAMLOPT, ocamlopt, ocamlopt, no)
704 AC_CHECK_PROG(OCAMLDEP, ocamldep, ocamldep)
705 AC_CHECK_PROG(OCAMLLEX, ocamllex.opt, ocamllex.opt)
706 AC_CHECK_PROG(OCAMLLEX, ocamllex, ocamllex)
707 AC_CHECK_PROG(OCAMLYACC, ocamlyacc, ocamlyacc)
708 AC_CHECK_PROG(OCAMLDOC, ocamldoc, ocamldoc)
709 AC_CHECK_PROG(OCAMLMKTOP, ocamlmktop, ocamlmktop)
710 AC_CHECK_PROG(CAMLP4, camlp4, camlp4)
711 AC_CHECK_PROG(CAMLP4OF, camlp4of, camlp4of, $CAMLP4 pa_o.cmo pr_o.cmo Camlp4QuotationExpander.cmo Camlp4GrammarParser.cmo)
715 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
716 OCAMLLIB=`$OCAMLC -where`
718 # check if native dynlink is supported and therefore needed for linking
719 CAMLP4LIB_OPT="camlp4lib.cmxa"
720 CAMLP4LIB_BYTE="camlp4lib.cma"
721 if test -f $OCAMLLIB/dynlink.cma; then
722 CAMLP4LIB_BYTE="dynlink.cma $CAMLP4LIB_BYTE"
724 if test -f $OCAMLLIB/dynlink.cmxa; then
725 CAMLP4LIB_OPT="dynlink.cmxa $CAMLP4LIB_OPT"
728 # force usage of supported Ocaml versions
729 case "$OCAMLVERSION" in
730 3.10.1*|3.10.2*|3.1*) ;;
732 if [ test "$REQUIRED_OCAML" != "SVN" ]; then
733 echo "******** Version $REQUIRED_OCAML of Objective-Caml is required *********" 1>&2;
734 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
740 if test "$OCAMLOPT" = "no"; then
747 OCAMLOPTVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
749 test "$OCAMLOPTVERSION" = "$OCAMLVERSION" || {
750 echo "******** Version $REQUIRED_OCAML of ocamlopt is required *********" 1>&2;
751 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
756 echo "-------------------------------------------"
757 echo " Checking Ocaml $OCAMLVERSION finished."
758 echo "-------------------------------------------"
761 if test "$PROFILE" = "yes"; then
762 OCAMLOPT="$OCAMLOPT -p"
765 if test "$FORCE_MINGW" = "yes"; then
766 OCAMLC="$OCAMLC -ccopt -mno-cygwin"
767 OCAMLOPT="$OCAMLOPT -ccopt -mno-cygwin"
768 OCAMLMKTOP="$OCAMLMKTOP -ccopt -mno-cygwin"
770 if test "$DEBUG" = "yes"; then
772 OCAMLOPT="$OCAMLOPT -g"
775 echo -e "\n----------------------------------"
776 echo " Checking system headers."
777 echo "----------------------------------"
779 ifelse(AC_ACVERSION, [2.13], [],
780 [dnl Large file enabled
785 dnl Check for native endianness.
787 [AC_MSG_ERROR([Machine endianness could not be determined])]
789 if test "x$WORDS_BIGENDIAN" = "x"; then
790 NATIVEENDIAN=LittleEndian
792 NATIVEENDIAN=BigEndian
794 AC_SUBST(NATIVEENDIAN)
796 # various header files
797 AC_CHECK_FUNCS(setrlimit getrlimit strerror_r strerror posix_fallocate)
798 AC_CHECK_HEADERS(byteswap.h,,)
799 AC_CHECK_HEADERS([sys/utsname.h])
800 AC_CHECK_HEADERS(arpa/inet.h,,)
801 AC_CHECK_HEADERS([sys/types.h sys/time.h sys/resource.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
802 [#ifdef HAVE_SYS_TYPES_H
803 #include <sys/types.h>
805 #ifdef HAVE_SYS_TIME_H
806 #include <sys/time.h>
808 #ifdef HAVE_NETINET_IN_SYSTM_H
809 #include <netinet/in_systm.h>
811 #ifdef HAVE_NETINET_IN_H
812 #include <netinet/in.h>
817 AC_CHECK_HEADERS(sys/poll.h,,)
818 AC_CHECK_FUNCS(poll,,)
820 AC_CHECK_HEADERS(sys/vfs.h,,)
821 AC_CHECK_HEADERS(sys/statvfs.h,,)
822 AC_CHECK_HEADERS([sys/param.h sys/mount.h],,,
823 [#if HAVE_SYS_PARAM_H
824 #include <sys/param.h>
827 echo "-------------------------------------------"
828 echo " Checking system headers finished."
829 echo -e "-------------------------------------------\n"
830 echo "-----------------------------------"
831 echo " Checking system libraries."
832 echo "-----------------------------------"
833 echo "----- checking zlib (required)"
834 AC_CHECK_LIB(z,inflate,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
835 AC_CHECK_HEADERS(zlib.h,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
836 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
838 if test "$BZIP2" != "no"; then
839 echo "----- checking bzlib (optional)"
840 AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])],[BZIP2=no])
843 if test "$BZIP2" = "yes"; then
844 AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
845 AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
847 AC_MSG_NOTICE(bzlib not available)
850 if test "$UPNP_NATPMP_FORCE" = "yes"; then
853 $WGET http://miniupnp.tuxfamily.org/files/miniupnpc-1.4.20100609.tar.gz
854 $WGET http://miniupnp.tuxfamily.org/files/libnatpmp-20100202.tar.gz
855 mkdir -p $BUILD_DIR $LOCAL_DIR/usr/bin $LOCAL_DIR/usr/lib $LOCAL_DIR/usr/include/miniupnpc
857 rm -rf libnatpmp-20100202 miniupnpc-1.4.20100609
858 tar -xzf $PATCH_DIR/miniupnpc-1.4.20100609.tar.gz
859 tar -xzf $PATCH_DIR/libnatpmp-20100202.tar.gz
860 cd $BUILD_DIR/libnatpmp-20100202
861 make all install PREFIX=$LOCAL_DIR
862 cd $BUILD_DIR/miniupnpc-1.4.20100609
863 make all install PREFIX=$LOCAL_DIR
865 rm -rf $BUILD_DIR/libnatpmp-20100202 $BUILD_DIR/miniupnpc-1.4.20100609
866 CPPFLAGS="${CPPFLAGS} -I$LOCAL_DIR/usr/include"
867 LDFLAGS="${LDFLAGS} -L$LOCAL_DIR/usr/lib"
870 if test "$UPNP_NATPMP" = "yes"; then
871 echo "----- checking libminiupnpc >= 1.4.20100609 (optional)"
872 AC_CHECK_HEADERS(miniupnpc/miniupnpc.h,[AC_CHECK_LIB(miniupnpc,upnpDiscover,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
875 if test "$UPNP_NATPMP" = "yes"; then
876 echo "----- checking libnatpmp >= 20100202 (optional)"
877 AC_CHECK_HEADERS(natpmp.h,[AC_CHECK_LIB(natpmp,initnatpmp,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
880 if test "$UPNP_NATPMP" = "yes"; then
881 AC_DEFINE(ENABLE_UPNP_NATPMP, 1, [Define to 1 if you have libminiupnpc & libnatpmp for port forwarding support.])
882 UPNP_NATPMP_LIBS="-lminiupnpc -lnatpmp $LIBS"
883 UPNP_NATPMP_STATIC_LIBS="-lminiupnpc -lnatpmp $LIBS"
886 if test "$MAGIC" != "no"; then
887 echo "----- checking libmagic (GNU file) (optional)"
888 AC_CHECK_HEADERS(magic.h,
889 [AC_CHECK_LIB(magic,magic_file,
890 [AC_CHECK_DECL([MAGIC_ERROR], [MAGIC=yes], [MAGIC=no],[#include <magic.h>])],
895 if test "$MAGIC" = "yes"; then
898 MAGICLIB=Magic_nomagic
899 AC_MSG_NOTICE(libmagic not available)
904 if test "$GD" != "no"; then
905 echo "----- checking gd (optional)"
910 SAVE_LDFLAGS=$LDFLAGS
911 AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
912 if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
913 GD_LIBS=`$GDLIBCONFIG --libs`
914 $GDLIBCONFIG --static-libs > /dev/null 2>&1
915 if test "$?" = "0"; then
916 GD_STATIC_LIBS=`$GDLIBCONFIG --static-libs`
918 GD_LIBS2="$LIBS -lgd $GD_LIBS"
920 GD_CFLAGS=`$GDLIBCONFIG --cflags`
921 CFLAGS="$CFLAGS $GD_CFLAGS"
922 GD_LDFLAGS=`$GDLIBCONFIG --ldflags`
923 LDFLAGS="$LDFLAGS $GD_LDFLAGS"
924 AC_MSG_CHECKING(for libgd > 2.0.14)
925 GDVERSION=`$GDLIBCONFIG --version`
926 GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
927 GDMINORVERSION=`$GDLIBCONFIG --minorversion`
928 GDREVISION=`$GDLIBCONFIG --revision`
929 if [ [ $GDMAJORVERSION = 2 ] && [ $GDMINORVERSION = 0 ] && [ $GDREVISION -gt 14 ]]; then
930 AC_MSG_RESULT($GDVERSION)
933 AC_MSG_RESULT(no (found $GDVERSION))
940 if test "$LIBGD" = "yes"; then
941 AC_CHECK_HEADERS(gd.h,[LIBGD=yes],[LIBGD=no])
944 if test "$LIBGD" = "yes"; then
945 AC_MSG_CHECKING(for gdImageCreate in -lgd)
946 AC_TRY_LINK([#include <gd.h>],
947 [gdImageCreate (0,0);],
948 [LIBGD=yes], [LIBGD=no])
949 AC_MSG_RESULT($LIBGD)
952 if test "$LIBGD" = "no"; then
953 AC_MSG_NOTICE([not found, trying another method])
954 AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
958 if test "$LIBGD" = "yes"; then
960 # saving current variables
962 SAVE_CFLAGS_PNG=$CFLAGS
963 SAVE_LDFLAGS_PNG=$LDFLAGS
964 AC_CHECK_PROG(PNGLIBCONFIG, libpng-config, libpng-config)
965 if test "$ac_cv_prog_PNGLIBCONFIG" = "libpng-config"; then
966 # check libpng-config contents and update system variables
967 PNG_LIBS=`$PNGLIBCONFIG --libs`
968 LIBS="$LIBS $PNG_LIBS"
969 PNG_CFLAGS=`$PNGLIBCONFIG --cflags`
970 CFLAGS="$CFLAGS $PNG_CFLAGS"
971 PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
972 LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
974 AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
977 CFLAGS=$SAVE_CFLAGS_PNG
978 LDFLAGS=$SAVE_LDFLAGS_PNG
980 if test "$LIBPNG" = "no"; then
981 AC_MSG_NOTICE(png support not available)
985 AC_MSG_CHECKING(for gdImagePng in -lgd)
986 AC_TRY_LINK([#include <gd.h>],
988 [LIBGD_PNG=yes], [LIBGD_PNG=no])
989 AC_MSG_RESULT($LIBGD_PNG)
992 if test "$LIBGD_PNG" = "no"; then
993 AC_MSG_NOTICE([not found, trying another method])
994 AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
997 AC_MSG_CHECKING(for png support in libgd)
998 if test "$LIBGD_PNG" = "yes"; then
1002 AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
1003 AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
1010 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [LIBJPEG=yes])
1012 if test "$LIBJPEG" = "no"; then
1013 AC_MSG_NOTICE(jpeg support not available)
1017 AC_MSG_CHECKING(for gdImageJpeg in -lgd)
1018 AC_TRY_LINK([#include <gd.h>],
1019 [gdImageJpeg (0,0,0);],
1020 [LIBGD_JPG=yes], [LIBGD_JPG=no])
1021 AC_MSG_RESULT($LIBGD_JPG)
1024 if test "$LIBGD_JPG" = "no"; then
1025 AC_MSG_NOTICE([not found, trying another method])
1026 AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
1029 AC_MSG_CHECKING(for jpeg support in libgd)
1030 if test "$LIBGD_JPG" = "yes"; then
1033 AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in libgd.])
1040 AC_MSG_NOTICE(libgd not available)
1044 LDFLAGS=$SAVE_LDFLAGS
1047 if test "$GD" != "no"; then
1048 GDGRAPHICS=DriverGraphics_gd
1050 GDGRAPHICS=DriverGraphics_nogd
1053 if test "$ICONV" = "yes"; then
1054 echo "----- checking iconv (optional)"
1056 if test "$am_cv_func_iconv" != "yes"; then
1057 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1060 LIBS="$LIBS $LIBICONV"
1061 AC_CHECK_FUNCS([locale_charset],,
1062 AC_TRY_LINK([#include <langinfo.h>],
1063 [char* cs = nl_langinfo(CODESET);],
1064 AC_MSG_NOTICE(found nl_langinfo(CODESET)),
1065 [echo "Your iconv implementation is incomplete"; exit 1]))
1066 AC_CHECK_LIB(charset,locale_charset)
1067 AC_CHECK_HEADERS([libcharset.h])
1068 AC_CHECK_HEADERS([langinfo.h])
1069 AC_CHECK_HEADERS([locale.h])
1072 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1076 if test "$USE_PTHREAD" = "no"; then
1078 echo "You disabled thread support, this will hurt MLDonkey performance!"
1080 echo "----- checking thread support (optional, strongly advised)"
1084 # On linux plaforms, we will have to check that includes from kernel are
1085 # available. glibc version test was shamelessly taken from
1086 # http://public.activestate.com/gsar/APC/perl-5.8.x/Configure
1090 echo "----- GNU C Library version"
1091 AC_CHECK_HEADERS(linux/limits.h,, [
1092 OLD_CPPFLAGS=$CPPFLAGS
1093 CPPFLAGS="-I /usr/src/linux/include"
1094 AC_CHECK_HEADER(linux/types.h,[CONFIG_INCLUDES="-I /usr/src/linux/include"])
1095 CPPFLAGS=$OLD_CPPFLAGS]
1097 AC_CHECK_HEADERS(gnu/libc-version.h,[AC_MSG_CHECKING(for GNU C Library version)
1100 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
1101 alone are insufficient to distinguish different versions, such as
1102 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
1103 libc version 2.1.0. A. Dougherty, June 3, 2002.
1109 # ifdef __GLIBC_MINOR__
1110 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
1111 # include <gnu/libc-version.h>
1112 printf("%s\n", gnu_get_libc_version());
1114 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
1117 printf("%d\n", __GLIBC__);
1127 GLIBC_VERSION="`./try`"
1128 AC_MSG_RESULT($GLIBC_VERSION)
1134 echo "---------------------------------------------"
1135 echo " Checking system libraries finished."
1136 echo -e "---------------------------------------------\n"
1140 echo "--------------------------------------"
1141 echo " Checking activated networks."
1142 echo "--------------------------------------"
1144 if test "$DONKEY" = "yes"; then
1145 AC_MSG_CHECKING(eDonkey)
1146 if test -d ../src/networks/donkey; then
1148 if test "$DONKEY_SUI" = "yes"; then
1151 AC_CHECK_TOOL(NEWCXX, [$CXX], [no])
1152 AC_MSG_CHECKING(eMule SUI)
1153 if test x"$NEWCXX" = x"no"
1160 ACX_CHECK_CXX_FLAGS(-fno-omit-frame-pointer,cv_no_omit_frame_pointer, CRYPTOPPFLAGS="-fno-omit-frame-pointer")
1161 ACX_CHECK_CXX_FLAGS(-mno-omit-leaf-frame-pointer,cv_no_omit_leaf_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -mno-omit-leaf-frame-pointer")
1163 CXX_VERSION=`$CXX -dumpversion`
1164 DONKEY_SUI_FILE=DonkeySui1
1165 AC_DEFINE(HAVE_CRYPTOPP, 1,)
1168 # AC_MSG_CHECKING(eDonkey server)
1169 # if test -d ../src/networks/server; then
1185 if test "$BITTORRENT" = "yes"; then
1186 AC_MSG_CHECKING(BitTorrent)
1187 if test -d ../src/networks/bittorrent; then
1195 if test "$FILETP" = "yes"; then
1196 AC_MSG_CHECKING(FileTP)
1197 if test -d ../src/networks/fileTP; then
1205 if test "$GNUTELLA" = "yes"; then
1206 AC_MSG_CHECKING(Gnutella)
1207 if test -d ../src/networks/gnutella; then
1215 if test "$GNUTELLA2" = "yes"; then
1217 if test -d ../src/networks/gnutella2; then
1225 if test "$FASTTRACK" = "yes"; then
1226 AC_MSG_CHECKING(Fasttrack)
1227 if test -d ../src/networks/fasttrack; then
1235 if test "$DIRECT_CONNECT" = "yes"; then
1236 AC_MSG_CHECKING(DirectConnect)
1237 if test "$BZIP2" = "yes"; then
1238 if test -d ../src/networks/direct_connect; then
1246 AC_MSG_RESULT(no - bzip2 support missing)
1250 if test "$SOULSEEK" = "yes"; then
1251 AC_MSG_CHECKING(Soulseek)
1252 if test -d ../src/networks/soulseek; then
1260 if test "$OPEN_NAPSTER" = "yes"; then
1261 AC_MSG_CHECKING(OpenNapster)
1262 if test -d ../src/networks/opennap; then
1270 if test "$OPENFT" = "yes"; then
1271 AC_MSG_CHECKING(OpenFT)
1272 if test -d ../src/networks/openFT; then
1279 echo "-----------------------------------------------"
1280 echo " Checking activated networks finished."
1281 echo "-----------------------------------------------"
1283 if test -f $OCAMLLIB/lablgl.cma; then
1284 LABLGL_CMA=lablgl.cma
1287 if test -f $OCAMLLIB/lablgl.$OCAMLLIB_EXT; then
1288 LABLGL_CMXA=lablgl.$OCAMLLIB_EXT
1291 # Check for GTK only if we want to build the GUI
1292 if test ! "$GUI" = "no"; then
1293 echo "---------------------------------------------------------"
1294 echo "Checking the libraries required to build the GTK GUI."
1295 echo "---------------------------------------------------------"
1296 if test "$GUI" = "newgui2"; then
1299 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1300 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1303 PKG_RSVG=librsvg-2.0
1304 AC_MSG_CHECKING(for librsvg - version >= $REQUIRED_RSVG)
1305 if pkg-config --atleast-version $REQUIRED_RSVG $PKG_RSVG; then
1306 GTK_CONFIG="pkg-config $PKG_GTK $PKG_RSVG"
1307 REQUIRED_LABLGTK=2.14.2
1308 LABLGTK_NAME=lablgtk2
1319 if test "$OS_FILES2" = "mingw"; then
1321 PKG_GTK=gtk+-1.3-win32-production
1322 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1323 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1324 GTK_CONFIG="pkg-config $PKG_GTK"
1331 AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config, no)
1332 if test "$GTK_CONFIG" = "no"; then
1342 if test "$GTK_CONFIG" = "no"; then
1345 AC_MSG_CHECKING(for native code $LABLGTK_NAME)
1346 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1347 if test "$GUI" = "newgui2"; then
1348 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then
1354 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.cma; then
1355 echo "---------------------------------------------------------"
1356 echo "lablrsvg is not installed properly. See the INSTALL.txt"
1357 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1358 echo "probably forgot to call 'make opt' before 'make install'."
1359 echo "---------------------------------------------------------"
1361 echo "---------------------------------------------------------"
1362 echo "lablrsvg is not installed. See the INSTALL.txt file of"
1363 echo "mldonkey to see how to compile $LABLGTK_NAME. Librsvg"
1364 echo "may not be installed when you compiled $LABLGTK_NAME."
1365 echo "---------------------------------------------------------"
1375 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.cma; then
1376 echo "-------------------------------------------------------------"
1377 echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
1378 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1379 echo "probably forgot to call 'make opt' before 'make install'."
1380 echo "-------------------------------------------------------------"
1382 echo "Do you want this script to try to download and install $LABLGTK_NAME"
1383 echo "LOCALLY in mldonkey directory ?"
1384 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
1389 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1390 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then
1391 echo Downloading ...
1392 $WGET http://www.math.nagoya-u.ac.jp/~garrigue/soft/olabl/dist/lablgtk-"$REQUIRED_LABLGTK".tar.gz
1394 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then exit 1; fi
1398 echo Uncompressing ...
1399 gzip -cd $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".tar.gz | tar xf -
1400 (cd lablgtk-"$REQUIRED_LABLGTK"
1401 if test -f $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch; then
1403 patch -p0 < $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch
1405 PATH=$OCAML_PATH:$PATH
1409 if test "$GUI" = "newgui2"; then
1410 ./configure --prefix=$LOCAL_DIR
1421 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1424 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1427 echo "Installation of $LABLGTK_NAME failed"
1437 if test "$GUI" = "newgui2" ; then
1438 GUIS="mldonkey_gui\$(EXE)"
1439 GTKCFLAGS="`pkg-config --cflags-only-I gtk+-2.0`"
1440 GTKLLIBS="`pkg-config --libs-only-L gtk+-2.0`"
1441 GTKLFLAGS="`pkg-config --libs-only-l gtk+-2.0` -lX11"
1443 GUIS="mldonkey_gui\$(EXE) mldonkey_gui2\$(EXE)"
1446 if test "$LABLGTK_CONFIG" = "no"; then
1449 MORE_TARGETS="$MORE_TARGETS $GUIS"
1450 AC_MSG_CHECKING(GToolbox.popup_menu args)
1451 GTOOLBOX="$OCAMLLIB/$LABLGTK_NAME/gToolbox.mli"
1452 grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
1453 if test "$GTOOLBOX_ARGS" = "new"; then
1454 GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
1457 GTOOLBOX_POPUPMENU=' ~x: button ~y: time '
1460 echo "---------------------------------------------------------"
1461 echo "End of GTK GUI configuration."
1462 echo "---------------------------------------------------------"
1465 if test "$OS_FILES" = "mingw"; then
1466 OCAMLDEP_OPTIONS="-slash"
1477 AC_SUBST(FIX_BROKEN_CPP)
1478 AC_SUBST(CONFIG_INCLUDES)
1485 AC_SUBST(OCAMLDEP_OPTIONS)
1488 AC_SUBST(CAMLP4LIB_OPT)
1489 AC_SUBST(CAMLP4LIB_BYTE)
1492 AC_SUBST(OCAMLMKTOP)
1494 AC_SUBST(MORE_TARGETS)
1495 AC_SUBST(MORE_SUBDIRS)
1496 AC_SUBST(LABLGL_CMA)
1497 AC_SUBST(LABLGL_CMXA)
1501 AC_SUBST(OPEN_NAPSTER)
1502 AC_SUBST(DIRECT_CONNECT)
1505 AC_SUBST(BITTORRENT)
1511 AC_SUBST(DONKEY_SUI)
1512 AC_SUBST(CRYPTOPPFLAGS)
1513 AC_SUBST(DONKEY_SUI_FILE)
1514 AC_SUBST(DONKEY_SERVER)
1516 AC_SUBST(REQUIRED_OCAML)
1517 AC_SUBST(REQUIRED_LABLGTK)
1520 AC_SUBST(COMPRESS_EXT)
1521 AC_SUBST(CHECKBOUNDS)
1522 AC_SUBST(MLDONKEY_VERSION)
1523 AC_SUBST(SCM_VERSION)
1524 AC_SUBST(MAJOR_VERSION)
1525 AC_SUBST(MINOR_VERSION)
1526 AC_SUBST(SUB_VERSION)
1527 AC_SUBST(GTOOLBOX_POPUPMENU)
1530 AC_SUBST(TARGET_TYPE)
1538 AC_SUBST(GDGRAPHICS)
1540 AC_SUBST(GD_STATIC_LIBS)
1542 AC_SUBST(GD_LDFLAGS)
1546 AC_SUBST(UPNP_NATPMP)
1547 AC_SUBST(UPNP_NATPMP_LIBS)
1548 AC_SUBST(UPNP_NATPMP_STATIC_LIBS)
1549 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
1550 AC_SUBST(BUILD_SYSTEM)
1551 AC_SUBST(GLIBC_VERSION)
1552 AC_SUBST(CC_VERSION)
1553 AC_SUBST(CXX_VERSION)
1554 AC_SUBST(CONFIGURE_ARGUMENTS)
1555 AC_SUBST(CONFIGURE_RUN)
1557 AUTOCONF=../src/utils/lib/autoconf.ml
1558 GTK_AUTOCONF=../src/utils/lib/gAutoconf.ml
1562 $AUTOCONF.new $GTK_AUTOCONF.new \
1563 ../src/utils/bitstring/bitstring.ml \
1564 ../src/utils/lib/magic.ml \
1565 ../src/networks/donkey/donkeySui.ml \
1566 ../src/daemon/driver/driverGraphics.ml \
1567 ../packages/rpm/mldonkey.spec \
1568 ../packages/rpm/Makefile \
1569 ../packages/slackware/mldonkey.options)
1570 diff $AUTOCONF.new $AUTOCONF 2> /dev/null > /dev/null || cp -f $AUTOCONF.new $AUTOCONF
1571 diff $GTK_AUTOCONF.new $GTK_AUTOCONF 2> /dev/null > /dev/null || cp -f $GTK_AUTOCONF.new $GTK_AUTOCONF
1575 echo -e "\nBuilding dependencies (if it blocks, try '$GNU_MAKE depend' to see the problem)"
1576 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: '$GNU_MAKE depend'"
1578 echo -e -n "\nConfiguring MLDonkey" $MLDONKEY_VERSION
1579 if test ! -z "$SCM_VERSION"; then
1580 echo -n " - SCM: $SCM_VERSION"
1584 echo -e "\nNetwork modules:"
1585 echo -n " - eDonkey "
1586 if test "$DONKEY" = "yes"; then
1587 if test "$DONKEY_SUI" = "yes"; then
1588 echo "enabled (eMule SUI enabled)"
1590 echo "enabled (eMule SUI disabled)"
1596 echo -n " - BitTorrent "
1597 if test "$BITTORRENT" = "yes"; then
1603 echo -n " - FileTP (aka wget) "
1604 if test "$FILETP" = "yes"; then
1610 echo -n " - Fasttrack "
1611 if test "$FASTTRACK" = "yes"; then
1617 echo -n " - Gnutella "
1618 if test "$GNUTELLA" = "yes"; then
1619 echo "enabled (warning: this network module is unmaintained)"
1621 echo " disabled - unmaintained"
1624 echo -n " - Gnutella2 "
1625 if test "$GNUTELLA2" = "yes"; then
1626 echo "enabled (warning: this network module is unmaintained)"
1628 echo " disabled - unmaintained"
1631 echo -n " - Direct Connect "
1632 if test "$DIRECT_CONNECT" = "yes"; then
1638 echo -n " - Open Napster "
1639 if test "$OPEN_NAPSTER" = "yes"; then
1640 echo "enabled - currently not usable"
1642 echo " disabled - currently not usable"
1645 echo -n " - Soulseek "
1646 if test "$SOULSEEK" = "yes"; then
1647 echo "enabled - currently not usable"
1649 echo " disabled - currently not usable"
1652 echo -n " - OpenFT "
1653 if test "$OPENFT" = "yes"; then
1654 echo "enabled - currently not usable"
1656 echo " disabled - currently not usable"
1659 echo -e "\nCore features:"
1661 echo " - zlib (required) enabled"
1663 echo -n " - threads "
1664 if test "$USE_PTHREAD" = "yes"; then
1671 if test "$BZIP2" = "yes"; then
1678 if test "$ICONV" = "yes"; then
1684 echo -n " - libmagic "
1685 if test "$MAGIC" = "yes"; then
1691 echo -n " - upnp & natpmp "
1692 if test "$UPNP_NATPMP" = "yes"; then
1698 echo -n " - graphical stats "
1699 if test "$GD" = "yes"; then
1701 echo -n " - png support "
1702 if test "$GD_PNG" = "yes"; then
1708 echo -n " - jpg support "
1709 if test "$GD_JPG" = "yes"; then
1718 if test "$LABLGTK_CONFIG" = "yes"; then
1719 echo -n -e "\n - GUI support "
1720 if test "$GUI" = "newgui1"; then
1723 if test "$GUI" = "newgui2"; then
1731 if test "$OLDGUI_NO_31" = "yes"; then
1732 echo " - GUI support GTK1 oldgui does not work with Ocaml 3.1*, disabled"
1735 if test "$TARGET_TYPE" = "byte"; then
1736 OCAML_TYPE="- byte code"
1737 COMPILE_TARGET=".byte"
1739 echo -e "\nCompilers:"
1740 echo -e " - Ocaml version $OCAMLVERSION $OCAML_TYPE"
1741 echo -e " - $CC version $CC_VERSION"
1742 if test "x$CXX" != "x"; then
1743 echo -e " - $CXX version $CXX_VERSION"
1745 echo -e "\nNow execute '$GNU_MAKE' to start compiling. Good luck!"
1747 echo -e "\nTo compile a static code execute: $GNU_MAKE mlnet$COMPILE_TARGET.static"
1748 echo "To produce a release tarball execute: $GNU_MAKE release.mlnet.static"
1749 echo "To clean the build directory execute: $GNU_MAKE maintainerclean"
1750 if test "$DONKEY_SUI" = "yes"; then
1751 echo -e "\nCompiling CryptoPP.cc can take several minutes, on slow machines up to half an hour."