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=7 # 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 # Parse git version if available
221 if test -d ../.git; then
222 AC_MSG_NOTICE(checking git revision)
223 AC_CHECK_PROG(GIT,git,yes)
225 if test "$ac_cv_prog_GIT" = "yes"; then
226 GIT_BRANCH=`git symbolic-ref -q --short HEAD`
227 GIT_COMMIT=`git describe --always --tags`
228 case "$GIT_BRANCH" in
230 SCM_VERSION="${GIT_COMMIT}"
233 SCM_VERSION="${GIT_COMMIT}-${GIT_BRANCH}"
237 AC_MSG_NOTICE(cannot determine git revision)
242 # ********** **********
243 # ********** build MLDonkey version, Required OCaml and LablGTK versions **********
244 # ********** **********
246 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
247 if test -f ./subrelease; then
248 MLDONKEY_VERSION=$MLDONKEY_VERSION`cat ./subrelease`
250 if test ! -z "$SUB_VERSION3"; then
251 MLDONKEY_VERSION=$MLDONKEY_VERSION.$SUB_VERSION3
256 REQUIRED_OCAML=$DEFAULT_OCAML
258 REQUIRED_LABLGTK=1.2.7
264 # ********** **********
265 # ********** Network and Feature configure switch variables **********
266 # ********** **********
268 # ********** currently not working Networks, can't be enabled
274 # ********** working Networks, enabled by default
284 # ********** predefined configure variations
289 # ********** Features, enabled by default
292 DONKEY_SUI_FILE=DonkeySui2
313 # ********** **********
314 # ********** Network and Feature configure switches and dependency **********
315 # ********** **********
317 AC_ARG_ENABLE(multinet,
318 AS_HELP_STRING([--disable-multinet], [disable all networks except eDonkey (with Overnet and Kademlia)]),
319 [MULTINET="$enableval"])
320 AC_ARG_ENABLE(minimum,
321 AS_HELP_STRING([--enable-minimum], [enable minimum set of features and networks (eDonkey, iconv and threads enabled)]),
322 [MINIMUM="$enableval"])
323 AC_ARG_ENABLE(minimum,
324 AS_HELP_STRING([--enable-minimum=all], [enable only eDonkey network and disable all optional features (not recommended)]),
325 [MINIMUM="$enableval"])
327 if [ test ! "$MULTINET" = "yes" ] || [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
335 if [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
341 if [ test "$MINIMUM" = "all" ]; then
346 #AC_ARG_ENABLE(soulseek, [ --disable-soulseek disable support for SoulSeek], [SOULSEEK="$enableval"])
347 #AC_ARG_ENABLE(opennap, [ --disable-opennap disable support for Open Napster], [OPEN_NAPSTER="$enableval"])
348 AC_ARG_ENABLE(directconnect,
349 AS_HELP_STRING([--disable-directconnect], [disable support for Direct Connect]),
350 [DIRECT_CONNECT="$enableval"])
351 #AC_ARG_ENABLE(openft, [ --disable-openft disable support for OpenFT], [OPENFT="$enableval"])
353 AC_ARG_ENABLE(donkey,
354 AS_HELP_STRING([--disable-donkey], [disable support for eDonkey]),
355 [DONKEY="$enableval"])
356 AC_ARG_ENABLE(donkeysui,
357 AS_HELP_STRING([--disable-donkeysui], [disable support for eMule SecureUserIdent]),
358 [DONKEY_SUI="$enableval"])
359 AC_ARG_ENABLE(bittorrent,
360 AS_HELP_STRING([--disable-bittorrent], [disable support for Bittorent]),
361 [BITTORRENT="$enableval"])
362 AC_ARG_ENABLE(filetp,
363 AS_HELP_STRING([--disable-filetp], [disable support for fileTP]),
364 [FILETP="$enableval"])
365 AC_ARG_ENABLE(gnutella,
366 AS_HELP_STRING([--disable-gnutella], [disable support for Gnutella]),
367 [GNUTELLA="$enableval"])
368 AC_ARG_ENABLE(gnutella2,
369 AS_HELP_STRING([--disable-gnutella2], [disable support for Gnutella2]),
370 [GNUTELLA2="$enableval"])
371 AC_ARG_ENABLE(fasttrack,
372 AS_HELP_STRING([--disable-fasttrack], [disable support for FastTrack]),
373 [FASTTRACK="$enableval"])
376 AS_HELP_STRING([--enable-batch], [reply YES to all queries in this script]),
377 [BATCH="$enableval"])
378 AC_ARG_ENABLE(force-ocaml,
379 AS_HELP_STRING([--enable-force-ocaml], [force usage of self-compiled OCaml]),
380 [FORCE_OCAML="$enableval"])
381 AC_ARG_ENABLE(ocamlver,
382 AS_HELP_STRING([--enable-ocamlver=VER], [force usage of specific OCaml version]),
383 [REQUIRED_OCAML="$enableval"])
385 AS_HELP_STRING([--enable-mingw], [force compilation with MINGW on Cygwin]),
386 [FORCE_MINGW="$enableval"])
387 AC_ARG_ENABLE(checks,
388 AS_HELP_STRING([--enable-checks], [enable bounds-checking for array/string accesses]),
389 [CHECKBOUNDS="$enableval"])
390 if test "$CHECKBOUNDS" = "yes"; then
394 AC_ARG_ENABLE(profile,
395 AS_HELP_STRING([--enable-profile], [compile with gprof profiling support (enables debug)]),
396 [PROFILE="$enableval"])
398 AS_HELP_STRING([--enable-debug], [compile with debugging information]),
399 [DEBUG="$enableval"])
401 AS_HELP_STRING([--enable-dev], [development mode (enables debug and annot information)]),
403 if test "$PROFILE" = "yes"; then
406 if test "$DEV" = "yes"; then
410 AS_HELP_STRING([--disable-gui], [disable GUI build (default)]),
413 AS_HELP_STRING([--enable-gui=oldgui|newgui1|newgui2],
414 [enable GUI (newgui2 uses GTK2 (default), other GUIs use GTK1)]),
416 if test "$GUI" = "yes"; then
419 if test ! "$GUI" = "newgui2"; then
420 if test ! "$GUI" = "newgui1"; then
421 if test ! "$GUI" = "oldgui"; then
427 AC_ARG_ENABLE(pthread,
428 AS_HELP_STRING([--disable-pthread], [disable the use of pthread, hurts performance!]),
429 [USE_PTHREAD="$enableval"])
430 AC_ARG_ENABLE(pthread-lib,
431 AS_HELP_STRING([--enable-pthread-lib], [legacy option]),
432 [USE_PTHREAD="$enableval"])
434 AS_HELP_STRING([--disable-iconv], [disable the use of iconv]),
435 [ICONV="$enableval"])
437 AS_HELP_STRING([--disable-gd], [disable the use of gd]),
440 AS_HELP_STRING([--disable-bzip2], [disable the use of bzip2]),
441 [BZIP2="$enableval"])
443 AS_HELP_STRING([--disable-magic], [disable the use of libmagic (GNU file)]),
444 [MAGIC="$enableval"])
445 AC_ARG_ENABLE(upnp-natpmp,
446 AS_HELP_STRING([--enable-upnp-natpmp], [enable the use of libminiupnpc and libnatpmp]),
447 [UPNP_NATPMP="$enableval"])
448 AC_ARG_ENABLE(force-upnp-natpmp,
449 AS_HELP_STRING([--enable-force-upnp-natpmp], [force local compilation of libminiupnpc and libnatpmp]),
450 [UPNP_NATPMP_FORCE="$enableval"])
452 if test "$FORCE_MINGW" = "yes"; then
454 CPP="$CPP -mno-cygwin"
463 echo "--------------------------------"
464 echo " Checking system tools."
465 echo "--------------------------------"
468 AC_CHECK_PROG(GNU_MAKE, gmake, gmake)
469 AC_CHECK_PROG(GNU_MAKE, make, make)
471 if test "x$GNU_MAKE" != "x"; then
472 AC_MSG_CHECKING( [if $GNU_MAKE is GNU make] )
473 $GNU_MAKE --version > /dev/null 2>&1
474 if test "$?" != "0"; then
476 AC_MSG_ERROR(GNU make not found)
481 AC_MSG_ERROR(GNU make not found)
484 AC_CHECK_PROG(COMPRESS, bzip2, bzip2)
485 AC_CHECK_PROG(COMPRESS, gzip, gzip)
487 if test "$ac_cv_prog_COMPRESS" = "bzip2"; then
493 AC_PATH_PROG(PERL, perl, perl)
494 AC_CHECK_PROG(RPMBUILD,rpmbuild,rpmbuild)
495 AC_CHECK_PROG(RPMBUILD,rpm,rpm)
497 AC_CHECK_PROG(WGET, wget, wget)
498 if test -z "$ac_cv_prog_WGET"; then
499 $CC -o wget wget.c || echo "Cannot compile wget.c"
500 AC_PATH_PROG(WGET, wget,,$SOURCE_DIR/config)
501 ac_cv_prog_WGET="$ac_cv_path_WGET"
503 WGET="$ac_cv_prog_WGET"
505 echo "----------------------------------------"
506 echo " Checking system tools finished."
507 echo "----------------------------------------"
509 echo "--------------------------------"
510 echo " Checking OCaml compiler."
511 echo "--------------------------------"
513 CONFIG_DIR=$SOURCE_DIR/config
514 PATCH_DIR=$SOURCE_DIR/patches
515 LOCAL_DIR=$PATCH_DIR/local
516 BUILD_DIR=$PATCH_DIR/build
518 AC_ARG_ENABLE(local-prefix,
519 AS_HELP_STRING([--enable-local-prefix=DIR], [specify path for temporary tools installation (DIR must be absolute)]),
520 [LOCAL_DIR="$enableval"])
523 LOCAL_OCAML=$LOCAL_DIR/bin
525 AC_PATH_PROG(OCAMLC,ocamlc.opt,"",[$LOCAL_DIR/bin:$PATH])
526 AC_CHECK_TOOL(OCAMLC,ocamlc,ocamlrun ocamlc)
527 AC_PATH_PROG(CAMLP4, camlp4,"",[$LOCAL_DIR/bin:$PATH])
530 if [ test -z "$OCAMLC" ] || [ test -z "$CAMLP4" ]; then
533 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
534 if test "$OCAMLVERSION" \< "$MINIMUM_OCAML"; then
535 echo "Detected OCaml $OCAMLVERSION, required at least $MINIMUM_OCAML, need build"
539 if test "$REQUIRED_OCAML" \< "$MINIMUM_OCAML"; then
540 echo "OCaml $REQUIRED_OCAML is too old, need build"
541 REQUIRED_OCAML=$DEFAULT_OCAML
544 if [ test "$BUILD_OCAML" = "yes" ] || [ test "$FORCE_OCAML" = "yes" ]; then
546 if [ test "$SYSTEM" = "mingw" ]; then
547 echo "******** No valid OCaml compiler found on your system. *********" 1>&2;
548 echo "******** OCaml version >= $MINIMUM_OCAML is required. *********" 1>&2;
549 echo "******** On MinGW there is no possibility to let configure *********" 1>&2;
550 echo "******** build the OCaml compiler with the included script *********" 1>&2;
551 echo "******** check http://mldonkey.sourceforge.net/Windows *********" 1>&2;
552 echo "******** for instuctions how to compile OCaml under MinGW *********" 1>&2;
556 echo "******** OCaml (and camlp4) version >= $MINIMUM_OCAML required *********" 1>&2;
557 if [ test "$WGET" = "" ]; then
558 echo "******** wget is missing *********" 1>&2;
559 echo "******** cannot download OCaml *********" 1>&2;
562 echo "******* Check http://ocaml.org/ ********" 1>&2;
563 echo "Do you want this script to try to download and install ocaml $REQUIRED_OCAML"
564 echo "LOCALLY in mldonkey directory ?"
565 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
569 DOWNLOAD_OCAML_MAJOR=`echo $REQUIRED_OCAML | sed -n -e 's/^\([[0-9]]*\.[[0-9]]*\).*/\1/p'`
570 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
572 $WGET http://caml.inria.fr/pub/distrib/ocaml-"$DOWNLOAD_OCAML_MAJOR"/ocaml-"$REQUIRED_OCAML".tar.gz
574 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
575 echo "******** download OCaml $REQUIRED_OCAML not successful, try do download it manually *********" 1>&2;
576 echo "******** from http://caml.inria.fr/pub/distrib/ *********" 1>&2;
577 echo "******** and copy the tar.gz into $PATCH_DIR *********" 1>&2;
581 echo Uncompressing ...
584 rm -rf ocaml-"$REQUIRED_OCAML"
585 gzip -cd $PATCH_DIR/ocaml-"$REQUIRED_OCAML".tar.gz | tar vxf -
586 cd ocaml-"$REQUIRED_OCAML"
587 if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
589 patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
592 if test "$REQUIRED_OCAML" \< "4.08.0"; then
593 ./configure -prefix "$LOCAL_DIR" -host "$host" -cc "$CC"
595 ./configure CC="$CC" -prefix "$LOCAL_DIR" -host "$host"
598 cp -f Makefile Makefile.old
599 sed "s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" Makefile.old > Makefile
601 cp -f $PATCH_DIR/Makefile.ocamldoc ocamldoc/Makefile
603 $GNU_MAKE world opt opt.opt
606 if ! test -f $LOCAL_DIR/lib/ocaml/threads; then
607 if ! test -f $LOCAL_DIR/lib/ocaml/vmthreads; then
608 ln -s vmthreads $LOCAL_DIR/lib/ocaml/threads
612 rm -rf ocaml-"$REQUIRED_OCAML"
614 echo OCaml locally installed for mldonkey
616 if test -f "$LOCAL_OCAML"/ocamlc.opt; then
617 OCAMLC=$LOCAL_OCAML/ocamlc.opt
618 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc.opt
620 if test -f "$LOCAL_OCAML"/ocamlc; then
621 OCAMLC=$LOCAL_OCAML/ocamlc
622 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc
624 echo "OCaml installation failed"; exit 1
633 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc.opt ; then
634 OCAML_PATH="$LOCAL_OCAML"/
635 OCAMLOPT=$LOCAL_OCAML/ocamlopt.opt
636 OCAMLDOC=$LOCAL_OCAML/ocamldoc
637 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
638 OCAMLDEP=$LOCAL_OCAML/ocamldep
639 OCAMLLEX=$LOCAL_OCAML/ocamllex.opt
640 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
641 CAMLP4=$LOCAL_OCAML/camlp4
642 CAMLP4OF=$LOCAL_OCAML/camlp4of
644 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc ; then
645 OCAML_PATH="$LOCAL_OCAML"/
646 if test -f "$LOCAL_OCAML/ocamlopt"; then
647 OCAMLOPT=$LOCAL_OCAML/ocamlopt
651 OCAMLDOC=$LOCAL_OCAML/ocamldoc
652 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
653 OCAMLDEP=$LOCAL_OCAML/ocamldep
654 OCAMLLEX=$LOCAL_OCAML/ocamllex
655 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
656 CAMLP4=$LOCAL_OCAML/camlp4
657 CAMLP4OF=$LOCAL_OCAML/camlp4of
659 AC_PATH_PROG(OCAMLOPT, ocamlopt.opt, ,[$PATH])
660 AC_PATH_PROG(OCAMLOPT, ocamlopt, no, [$PATH])
661 AC_PATH_PROG(OCAMLDEP, ocamldep, ocamldep, [$PATH])
662 AC_PATH_PROG(OCAMLLEX, ocamllex.opt, , [$PATH])
663 AC_PATH_PROG(OCAMLLEX, ocamllex, ocamllex, [$PATH])
664 AC_PATH_PROG(OCAMLYACC, ocamlyacc, ocamlyacc, [$PATH])
665 AC_PATH_PROG(OCAMLDOC, ocamldoc, ocamldoc, [$PATH])
666 AC_PATH_PROG(OCAMLMKTOP, ocamlmktop, ocamlmktop, [$PATH])
667 AC_PATH_PROG(CAMLP4, camlp4, camlp4, [$PATH])
668 AC_PATH_PROG(CAMLP4OF, camlp4of, $CAMLP4 pa_o.cmo pr_o.cmo Camlp4QuotationExpander.cmo Camlp4GrammarParser.cmo, [$PATH])
672 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
673 OCAMLVERSION_MAJOR=`echo $OCAMLVERSION | sed -n -e 's/^\([[0-9]]*\.[[0-9]]*\).*/\1/' -e 's/\.//gp'`
674 OCAMLLIB=`$OCAMLC -where`
676 # check if native dynlink is supported and therefore needed for linking
677 CAMLP4LIB_OPT="camlp4lib.cmxa"
678 CAMLP4LIB_BYTE="camlp4lib.cma"
679 if test -f $OCAMLLIB/dynlink.cma; then
680 CAMLP4LIB_BYTE="dynlink.cma $CAMLP4LIB_BYTE"
682 if test -f $OCAMLLIB/dynlink.cmxa; then
683 CAMLP4LIB_OPT="dynlink.cmxa $CAMLP4LIB_OPT"
686 # force usage of supported OCaml versions
687 if test "$OCAMLVERSION" \< "$MINIMUM_OCAML"; then
688 echo "******** OCaml version >= $MINIMUM_OCAML required *********" 1>&2;
689 echo "******* Check http://ocaml.org/ ********" 1>&2;
693 if test ! "$OCAMLVERSION" \< "4.03.0"; then
694 OCAMLC="$OCAMLC -unsafe-string"
697 if test "$OCAMLOPT" = "no"; then
704 OCAMLOPTVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
706 test "$OCAMLOPTVERSION" = "$OCAMLVERSION" || {
707 echo "******** Expected ocamlopt version $OCAMLVERSION , but got $OCAMLOPTVERSION *********" 1>&2;
708 echo "******* Check http://ocaml.org/ ********" 1>&2;
711 if test ! "$OCAMLVERSION" \< "4.03.0"; then
712 OCAMLOPT="$OCAMLOPT -unsafe-string"
717 echo "-------------------------------------------"
718 echo " Checking OCaml $OCAMLVERSION finished."
719 echo "-------------------------------------------"
722 if test "$PROFILE" = "yes"; then
723 OCAMLOPT="$OCAMLOPT -p"
726 if test "$FORCE_MINGW" = "yes"; then
727 OCAMLC="$OCAMLC -ccopt -mno-cygwin"
728 OCAMLOPT="$OCAMLOPT -ccopt -mno-cygwin"
729 OCAMLMKTOP="$OCAMLMKTOP -ccopt -mno-cygwin"
731 if test "$DEBUG" = "yes"; then
733 OCAMLOPT="$OCAMLOPT -g"
736 if test "$DEV" = "yes"; then
737 DEVFLAGS="-annot -bin-annot -w @a\$(MINUS_WARNING)"
742 AC_MSG_CHECKING([ocaml num library])
743 if ! test -f $OCAMLLIB/nums.$OCAMLLIB_EXT; then
744 if test -f $OCAMLLIB/num/nums.$OCAMLLIB_EXT; then
745 NUMS_INCLUDE="-I +num"
747 NUMS_PATH="`ocamlfind query num 2> /dev/null`"
748 if test "$NUMS_PATH" != ""; then
749 NUMS_INCLUDE="-I $NUMS_PATH"
756 if test "$NUMS" = "no"; then
759 AC_MSG_RESULT([found $NUMS_INCLUDE])
763 echo "----------------------------------"
764 echo " Checking system headers."
765 echo "----------------------------------"
767 ifelse(AC_ACVERSION, [2.13], [],
768 [dnl Large file enabled
773 dnl Check for native endianness.
775 [AC_MSG_ERROR([Machine endianness could not be determined])]
777 if test "x$WORDS_BIGENDIAN" = "x"; then
778 NATIVEENDIAN=LittleEndian
780 NATIVEENDIAN=BigEndian
782 AC_SUBST(NATIVEENDIAN)
784 # various header files
785 AC_CHECK_FUNCS(setrlimit getrlimit strerror_r strerror posix_fallocate)
786 AC_CHECK_HEADERS(byteswap.h,,)
787 AC_CHECK_HEADERS([sys/utsname.h])
788 AC_CHECK_HEADERS(arpa/inet.h,,)
789 AC_CHECK_HEADERS([sys/types.h sys/time.h sys/resource.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
790 [#ifdef HAVE_SYS_TYPES_H
791 #include <sys/types.h>
793 #ifdef HAVE_SYS_TIME_H
794 #include <sys/time.h>
796 #ifdef HAVE_NETINET_IN_SYSTM_H
797 #include <netinet/in_systm.h>
799 #ifdef HAVE_NETINET_IN_H
800 #include <netinet/in.h>
805 AC_CHECK_HEADERS(sys/poll.h,,)
806 AC_CHECK_FUNCS(poll,,)
808 AC_CHECK_HEADERS(sys/vfs.h,,)
809 AC_CHECK_HEADERS(sys/statvfs.h,,)
810 AC_CHECK_HEADERS([sys/param.h sys/mount.h],,,
811 [#if HAVE_SYS_PARAM_H
812 #include <sys/param.h>
815 echo "-------------------------------------------"
816 echo " Checking system headers finished."
817 echo "-------------------------------------------"
819 echo "-----------------------------------"
820 echo " Checking system libraries."
821 echo "-----------------------------------"
822 echo "----- checking zlib (required)"
823 AC_CHECK_LIB(z,inflate,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
824 AC_CHECK_HEADERS(zlib.h,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
825 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
827 if test "$BZIP2" != "no"; then
828 echo "----- checking bzlib (optional)"
829 AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])],[BZIP2=no])
832 if test "$BZIP2" = "yes"; then
833 AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
834 AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
836 AC_MSG_NOTICE(bzlib not available)
839 if test "$UPNP_NATPMP_FORCE" = "yes"; then
842 MINIUPNPC=miniupnpc-2.1
843 LIBNATPMP=libnatpmp-20150609
844 $WGET http://miniupnp.tuxfamily.org/files/$MINIUPNPC.tar.gz
845 $WGET http://miniupnp.tuxfamily.org/files/$LIBNATPMP.tar.gz
846 mkdir -p $BUILD_DIR $LOCAL_DIR/usr/bin $LOCAL_DIR/usr/lib $LOCAL_DIR/usr/include/miniupnpc
848 rm -rf $LIBNATPMP $MINIUPNPC
849 tar -xzf $PATCH_DIR/$MINIUPNPC.tar.gz
850 tar -xzf $PATCH_DIR/$LIBNATPMP.tar.gz
851 cd $BUILD_DIR/$LIBNATPMP
852 $GNU_MAKE all install PREFIX=$LOCAL_DIR
853 cd $BUILD_DIR/$MINIUPNPC
854 $GNU_MAKE all install PREFIX=$LOCAL_DIR/usr
856 rm -rf $BUILD_DIR/$LIBNATPMP $BUILD_DIR/$MINIUPNPC
857 CPPFLAGS="${CPPFLAGS} -I$LOCAL_DIR/usr/include"
858 LDFLAGS="${LDFLAGS} -L$LOCAL_DIR/usr/lib"
861 if test "$UPNP_NATPMP" = "yes"; then
862 echo "----- checking libminiupnpc >= 1.6 (optional)"
863 AC_CHECK_HEADERS(miniupnpc/miniupnpc.h,[AC_CHECK_LIB(miniupnpc,upnpDiscover,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
866 if test "$UPNP_NATPMP" = "yes"; then
867 echo "----- checking libnatpmp >= 20110808 (optional)"
868 AC_CHECK_HEADERS(natpmp.h,[AC_CHECK_LIB(natpmp,initnatpmp,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
871 if test "$UPNP_NATPMP" = "yes"; then
872 AC_DEFINE(ENABLE_UPNP_NATPMP, 1, [Define to 1 if you have libminiupnpc & libnatpmp for port forwarding support.])
873 UPNP_NATPMP_LIBS="-lminiupnpc -lnatpmp $LIBS"
874 UPNP_NATPMP_STATIC_LIBS="-lminiupnpc -lnatpmp $LIBS"
877 if test "$MAGIC" != "no"; then
878 echo "----- checking libmagic (GNU file) (optional)"
879 AC_CHECK_HEADERS(magic.h,
880 [AC_CHECK_LIB(magic,magic_file,
881 [AC_CHECK_DECL([MAGIC_ERROR], [MAGIC=yes], [MAGIC=no],[#include <magic.h>])],
886 if test "$MAGIC" = "yes"; then
889 MAGICLIB=Magic_nomagic
890 AC_MSG_NOTICE(libmagic not available)
895 if test "$GD" != "no"; then
896 echo "----- checking gd (optional)"
901 SAVE_LDFLAGS=$LDFLAGS
902 AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
903 if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
904 GD_LIBS=`$GDLIBCONFIG --libs`
905 $GDLIBCONFIG --static-libs > /dev/null 2>&1
906 if test "$?" = "0"; then
907 GD_STATIC_LIBS=`$GDLIBCONFIG --static-libs`
909 GD_LIBS2="$LIBS -lgd $GD_LIBS"
911 GD_CFLAGS=`$GDLIBCONFIG --cflags`
912 CFLAGS="$CFLAGS $GD_CFLAGS"
913 GD_LDFLAGS=`$GDLIBCONFIG --ldflags`
914 LDFLAGS="$LDFLAGS $GD_LDFLAGS"
915 AC_MSG_CHECKING(for libgd > 2.0.14)
916 GDVERSION=`$GDLIBCONFIG --version`
917 GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
918 GDMINORVERSION=`$GDLIBCONFIG --minorversion`
919 GDREVISION=`$GDLIBCONFIG --revision`
920 case $GDMAJORVERSION in
922 AC_MSG_RESULT(no (found $GDVERSION))
926 if test $GDMINORVERSION -ge 1; then
927 AC_MSG_RESULT($GDVERSION)
930 if test $GDREVISION -gt 14; then
931 AC_MSG_RESULT($GDVERSION)
934 AC_MSG_RESULT(no (found $GDVERSION))
940 AC_MSG_RESULT($GDVERSION)
948 if test "$LIBGD" = "yes"; then
949 AC_CHECK_HEADERS(gd.h,[LIBGD=yes],[LIBGD=no])
952 if test "$LIBGD" = "yes"; then
953 AC_MSG_CHECKING(for gdImageCreate in -lgd)
954 AC_TRY_LINK([#include <gd.h>],
955 [gdImageCreate (0,0);],
956 [LIBGD=yes], [LIBGD=no])
957 AC_MSG_RESULT($LIBGD)
960 if test "$LIBGD" = "no"; then
961 AC_MSG_NOTICE([not found, trying another method])
962 AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
966 if test "$LIBGD" = "yes"; then
968 # saving current variables
970 SAVE_CFLAGS_PNG=$CFLAGS
971 SAVE_LDFLAGS_PNG=$LDFLAGS
972 AC_CHECK_PROG(PNGLIBCONFIG, libpng-config, libpng-config)
973 if test "$ac_cv_prog_PNGLIBCONFIG" = "libpng-config"; then
974 # check libpng-config contents and update system variables
975 PNG_LIBS=`$PNGLIBCONFIG --libs`
976 LIBS="$LIBS $PNG_LIBS"
977 PNG_CFLAGS=`$PNGLIBCONFIG --cflags`
978 CFLAGS="$CFLAGS $PNG_CFLAGS"
979 PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
980 LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
982 AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
985 CFLAGS=$SAVE_CFLAGS_PNG
986 LDFLAGS=$SAVE_LDFLAGS_PNG
988 if test "$LIBPNG" = "no"; then
989 AC_MSG_NOTICE(png support not available)
993 AC_MSG_CHECKING(for gdImagePng in -lgd)
994 AC_TRY_LINK([#include <gd.h>],
996 [LIBGD_PNG=yes], [LIBGD_PNG=no])
997 AC_MSG_RESULT($LIBGD_PNG)
1000 if test "$LIBGD_PNG" = "no"; then
1001 AC_MSG_NOTICE([not found, trying another method])
1002 AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
1005 AC_MSG_CHECKING(for png support in libgd)
1006 if test "$LIBGD_PNG" = "yes"; then
1009 GD_LIBS="$GD_LIBS $PNG_LIBS"
1011 AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
1012 AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
1019 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [LIBJPEG=yes])
1021 if test "$LIBJPEG" = "no"; then
1022 AC_MSG_NOTICE(jpeg support not available)
1026 AC_MSG_CHECKING(for gdImageJpeg in -lgd)
1027 AC_TRY_LINK([#include <gd.h>],
1028 [gdImageJpeg (0,0,0);],
1029 [LIBGD_JPG=yes], [LIBGD_JPG=no])
1030 AC_MSG_RESULT($LIBGD_JPG)
1033 if test "$LIBGD_JPG" = "no"; then
1034 AC_MSG_NOTICE([not found, trying another method])
1035 AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
1038 AC_MSG_CHECKING(for jpeg support in libgd)
1039 if test "$LIBGD_JPG" = "yes"; then
1042 GD_LIBS="$GD_LIBS -ljpeg"
1043 AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in libgd.])
1050 AC_MSG_NOTICE(libgd not available)
1054 LDFLAGS=$SAVE_LDFLAGS
1057 if test "$GD" != "no"; then
1058 GDGRAPHICS=DriverGraphics_gd
1060 GDGRAPHICS=DriverGraphics_nogd
1063 if test "$ICONV" = "yes"; then
1064 echo "----- checking iconv (optional)"
1066 if test "$am_cv_func_iconv" != "yes"; then
1067 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1070 LIBS="$LIBS $LIBICONV"
1071 AC_CHECK_FUNCS([locale_charset],,
1072 AC_TRY_LINK([#include <langinfo.h>],
1073 [char* cs = nl_langinfo(CODESET);],
1074 AC_MSG_NOTICE(found nl_langinfo(CODESET)),
1075 [echo "Your iconv implementation is incomplete"; exit 1]))
1076 AC_CHECK_LIB(charset,locale_charset)
1077 AC_CHECK_HEADERS([libcharset.h])
1078 AC_CHECK_HEADERS([langinfo.h])
1079 AC_CHECK_HEADERS([locale.h])
1082 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1086 if test "$USE_PTHREAD" = "no"; then
1088 echo "You disabled thread support, this will hurt MLDonkey performance!"
1090 echo "----- checking thread support (optional, strongly advised)"
1094 # On linux plaforms, we will have to check that includes from kernel are
1095 # available. glibc version test was shamelessly taken from
1096 # http://public.activestate.com/gsar/APC/perl-5.8.x/Configure
1100 echo "----- GNU C Library version"
1101 AC_CHECK_HEADERS(linux/limits.h,, [
1102 OLD_CPPFLAGS=$CPPFLAGS
1103 CPPFLAGS="-I /usr/src/linux/include"
1104 AC_CHECK_HEADER(linux/types.h,[CONFIG_INCLUDES="-I /usr/src/linux/include"])
1105 CPPFLAGS=$OLD_CPPFLAGS]
1107 AC_CHECK_HEADERS(gnu/libc-version.h,[AC_MSG_CHECKING(for GNU C Library version)
1110 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
1111 alone are insufficient to distinguish different versions, such as
1112 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
1113 libc version 2.1.0. A. Dougherty, June 3, 2002.
1119 # ifdef __GLIBC_MINOR__
1120 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
1121 # include <gnu/libc-version.h>
1122 printf("%s\n", gnu_get_libc_version());
1124 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
1127 printf("%d\n", __GLIBC__);
1137 GLIBC_VERSION="`./try`"
1138 AC_MSG_RESULT($GLIBC_VERSION)
1144 echo "---------------------------------------------"
1145 echo " Checking system libraries finished."
1146 echo "---------------------------------------------"
1151 echo "--------------------------------------"
1152 echo " Checking activated networks."
1153 echo "--------------------------------------"
1155 if test "$DONKEY" = "yes"; then
1156 AC_MSG_CHECKING(eDonkey)
1157 if test -d ../src/networks/donkey; then
1159 if test "$DONKEY_SUI" = "yes"; then
1162 # GCC miscompiles cryptopp.cc with -O2 on armhf
1163 # http://mldonkey.sourceforge.net/phpBB2/viewtopic.php?p=32309#32309
1164 # https://bugs.launchpad.net/ubuntu/+source/mldonkey/+bug/1060007
1166 armv7l-*-linux-gnueabihf)
1171 AC_CHECK_TOOL(NEWCXX, [$CXX], [no])
1172 AC_MSG_CHECKING(eMule SUI)
1173 if test x"$NEWCXX" = x"no"
1180 ACX_CHECK_CXX_FLAGS(-std=c++14,cv_stdcxx14, CRYPTOPPFLAGS="-std=c++14")
1181 ACX_CHECK_CXX_FLAGS(-fno-omit-frame-pointer,cv_no_omit_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -fno-omit-frame-pointer")
1182 ACX_CHECK_CXX_FLAGS(-mno-omit-leaf-frame-pointer,cv_no_omit_leaf_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -mno-omit-leaf-frame-pointer")
1184 CXX_VERSION=`$CXX -dumpversion`
1185 DONKEY_SUI_FILE=DonkeySui1
1186 AC_DEFINE(HAVE_CRYPTOPP, 1,)
1189 # AC_MSG_CHECKING(eDonkey server)
1190 # if test -d ../src/networks/server; then
1206 if test "$BITTORRENT" = "yes"; then
1207 AC_MSG_CHECKING(BitTorrent)
1208 if test -d ../src/networks/bittorrent; then
1209 if test "$NUMS" != "no"; then
1213 AC_MSG_RESULT([no (ocaml num library missing)])
1221 if test "$FILETP" = "yes"; then
1222 AC_MSG_CHECKING(FileTP)
1223 if test -d ../src/networks/fileTP; then
1231 if test "$GNUTELLA" = "yes"; then
1232 AC_MSG_CHECKING(Gnutella)
1233 if test -d ../src/networks/gnutella; then
1241 if test "$GNUTELLA2" = "yes"; then
1243 if test -d ../src/networks/gnutella2; then
1251 if test "$FASTTRACK" = "yes"; then
1252 AC_MSG_CHECKING(Fasttrack)
1253 if test -d ../src/networks/fasttrack; then
1261 if test "$DIRECT_CONNECT" = "yes"; then
1262 AC_MSG_CHECKING(DirectConnect)
1263 if test "$BZIP2" = "yes"; then
1264 if test -d ../src/networks/direct_connect; then
1272 AC_MSG_RESULT(no - bzip2 support missing)
1276 if test "$SOULSEEK" = "yes"; then
1277 AC_MSG_CHECKING(Soulseek)
1278 if test -d ../src/networks/soulseek; then
1286 if test "$OPEN_NAPSTER" = "yes"; then
1287 AC_MSG_CHECKING(OpenNapster)
1288 if test -d ../src/networks/opennap; then
1296 if test "$OPENFT" = "yes"; then
1297 AC_MSG_CHECKING(OpenFT)
1298 if test -d ../src/networks/openFT; then
1305 echo "-----------------------------------------------"
1306 echo " Checking activated networks finished."
1307 echo "-----------------------------------------------"
1309 if test -f $OCAMLLIB/lablgl.cma; then
1310 LABLGL_CMA=lablgl.cma
1313 if test -f $OCAMLLIB/lablgl.$OCAMLLIB_EXT; then
1314 LABLGL_CMXA=lablgl.$OCAMLLIB_EXT
1317 # Check for GTK only if we want to build the GUI
1318 if test ! "$GUI" = "no"; then
1319 echo "---------------------------------------------------------"
1320 echo "Checking the libraries required to build the GTK GUI."
1321 echo "---------------------------------------------------------"
1322 if test "$GUI" = "newgui2"; then
1325 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1326 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1329 PKG_RSVG=librsvg-2.0
1330 AC_MSG_CHECKING(for librsvg - version >= $REQUIRED_RSVG)
1331 if pkg-config --atleast-version $REQUIRED_RSVG $PKG_RSVG; then
1332 GTK_CONFIG="pkg-config $PKG_GTK $PKG_RSVG"
1333 REQUIRED_LABLGTK=2.14.2
1334 LABLGTK_NAME=lablgtk2
1345 if test "$OS_FILES2" = "mingw"; then
1347 PKG_GTK=gtk+-1.3-win32-production
1348 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1349 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1350 GTK_CONFIG="pkg-config $PKG_GTK"
1357 AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config, no)
1358 if test "$GTK_CONFIG" = "no"; then
1368 if test "$GTK_CONFIG" = "no"; then
1371 AC_MSG_CHECKING(for native code $LABLGTK_NAME)
1372 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1373 if test "$GUI" = "newgui2"; then
1374 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then
1380 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.cma; then
1381 echo "---------------------------------------------------------"
1382 echo "lablrsvg is not installed properly. See the INSTALL.txt"
1383 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1384 echo "probably forgot to call 'make opt' before 'make install'."
1385 echo "---------------------------------------------------------"
1387 echo "---------------------------------------------------------"
1388 echo "lablrsvg is not installed. See the INSTALL.txt file of"
1389 echo "mldonkey to see how to compile $LABLGTK_NAME. Librsvg"
1390 echo "may not be installed when you compiled $LABLGTK_NAME."
1391 echo "---------------------------------------------------------"
1401 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.cma; then
1402 echo "-------------------------------------------------------------"
1403 echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
1404 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1405 echo "probably forgot to call 'make opt' before 'make install'."
1406 echo "-------------------------------------------------------------"
1408 echo "Do you want this script to try to download and install $LABLGTK_NAME"
1409 echo "LOCALLY in mldonkey directory ?"
1410 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
1415 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1416 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then
1417 echo Downloading ...
1418 $WGET http://www.math.nagoya-u.ac.jp/~garrigue/soft/olabl/dist/lablgtk-"$REQUIRED_LABLGTK".tar.gz
1420 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then exit 1; fi
1424 echo Uncompressing ...
1425 gzip -cd $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".tar.gz | tar xf -
1426 (cd lablgtk-"$REQUIRED_LABLGTK"
1427 if test -f $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch; then
1429 patch -p0 < $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch
1431 PATH=$OCAML_PATH:$PATH
1435 if test "$GUI" = "newgui2"; then
1436 ./configure --prefix=$LOCAL_DIR
1447 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1450 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1453 echo "Installation of $LABLGTK_NAME failed"
1463 if test "$GUI" = "newgui2" ; then
1464 GUIS="mldonkey_gui\$(EXE)"
1465 GTKCFLAGS="`pkg-config --cflags-only-I gtk+-2.0`"
1466 GTKLLIBS="`pkg-config --libs-only-L gtk+-2.0`"
1467 GTKLFLAGS="`pkg-config --libs-only-l gtk+-2.0` -lX11"
1469 GUIS="mldonkey_gui\$(EXE) mldonkey_gui2\$(EXE)"
1472 if test "$LABLGTK_CONFIG" = "no"; then
1475 MORE_TARGETS="$MORE_TARGETS $GUIS"
1476 AC_MSG_CHECKING(GToolbox.popup_menu args)
1477 GTOOLBOX="$OCAMLLIB/$LABLGTK_NAME/gToolbox.mli"
1478 grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
1479 if test "$GTOOLBOX_ARGS" = "new"; then
1480 GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
1483 GTOOLBOX_POPUPMENU=' ~x: button ~y: time '
1486 echo "---------------------------------------------------------"
1487 echo "End of GTK GUI configuration."
1488 echo "---------------------------------------------------------"
1491 if test "$OS_FILES" = "mingw"; then
1492 OCAMLDEP_OPTIONS="-slash"
1503 AC_SUBST(FIX_BROKEN_CPP)
1504 AC_SUBST(CONFIG_INCLUDES)
1511 AC_SUBST(OCAMLDEP_OPTIONS)
1514 AC_SUBST(CAMLP4LIB_OPT)
1515 AC_SUBST(CAMLP4LIB_BYTE)
1518 AC_SUBST(OCAMLMKTOP)
1520 AC_SUBST(MORE_TARGETS)
1521 AC_SUBST(MORE_SUBDIRS)
1522 AC_SUBST(LABLGL_CMA)
1523 AC_SUBST(LABLGL_CMXA)
1527 AC_SUBST(OPEN_NAPSTER)
1528 AC_SUBST(DIRECT_CONNECT)
1531 AC_SUBST(BITTORRENT)
1537 AC_SUBST(DONKEY_SUI)
1538 AC_SUBST(CRYPTOPPFLAGS)
1539 AC_SUBST(DONKEY_SUI_FILE)
1540 AC_SUBST(DONKEY_SERVER)
1542 AC_SUBST(REQUIRED_OCAML)
1543 AC_SUBST(REQUIRED_LABLGTK)
1546 AC_SUBST(COMPRESS_EXT)
1547 AC_SUBST(CHECKBOUNDS)
1548 AC_SUBST(MLDONKEY_VERSION)
1549 AC_SUBST(SCM_VERSION)
1550 AC_SUBST(MAJOR_VERSION)
1551 AC_SUBST(MINOR_VERSION)
1552 AC_SUBST(SUB_VERSION)
1553 AC_SUBST(GTOOLBOX_POPUPMENU)
1556 AC_SUBST(TARGET_TYPE)
1564 AC_SUBST(GDGRAPHICS)
1566 AC_SUBST(GD_STATIC_LIBS)
1568 AC_SUBST(GD_LDFLAGS)
1572 AC_SUBST(UPNP_NATPMP)
1573 AC_SUBST(UPNP_NATPMP_LIBS)
1574 AC_SUBST(UPNP_NATPMP_STATIC_LIBS)
1575 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
1576 AC_SUBST(BUILD_SYSTEM)
1577 AC_SUBST(GLIBC_VERSION)
1578 AC_SUBST(CC_VERSION)
1579 AC_SUBST(CXX_VERSION)
1580 AC_SUBST(CONFIGURE_ARGUMENTS)
1581 AC_SUBST(CONFIGURE_RUN)
1583 AC_SUBST(OCAMLVERSION_MAJOR)
1584 AC_SUBST(NUMS_INCLUDE)
1586 AUTOCONF=../src/utils/lib/autoconf.ml
1587 GTK_AUTOCONF=../src/utils/lib/gAutoconf.ml
1591 $AUTOCONF.new $GTK_AUTOCONF.new \
1592 ../src/utils/bitstring/bitstring.ml \
1593 ../src/utils/lib/magic.ml \
1594 ../src/networks/donkey/donkeySui.ml \
1595 ../src/daemon/driver/driverGraphics.ml \
1596 ../packages/rpm/mldonkey.spec \
1597 ../packages/rpm/Makefile \
1598 ../packages/slackware/mldonkey.options)
1599 diff $AUTOCONF.new $AUTOCONF 2> /dev/null > /dev/null || cp -f $AUTOCONF.new $AUTOCONF
1600 diff $GTK_AUTOCONF.new $GTK_AUTOCONF 2> /dev/null > /dev/null || cp -f $GTK_AUTOCONF.new $GTK_AUTOCONF
1605 echo "Building dependencies (if it blocks, try '$GNU_MAKE depend' to see the problem)"
1606 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: '$GNU_MAKE depend'"
1609 printf "Configuring MLDonkey %s" "$MLDONKEY_VERSION"
1610 if test ! -z "$SCM_VERSION"; then
1611 printf " - SCM: %s" "$SCM_VERSION"
1616 echo "Network modules:"
1617 printf " - eDonkey "
1618 if test "$DONKEY" = "yes"; then
1619 if test "$DONKEY_SUI" = "yes"; then
1620 echo "enabled (eMule SUI enabled)"
1622 echo "enabled (eMule SUI disabled)"
1628 printf " - BitTorrent "
1629 if test "$BITTORRENT" = "yes"; then
1632 if test "$NUMS" != "no"; then
1635 echo " disabled - ocaml num library missing (must be installed manually when building with OCaml >= 4.06)"
1639 printf " - FileTP (aka wget) "
1640 if test "$FILETP" = "yes"; then
1646 printf " - Fasttrack "
1647 if test "$FASTTRACK" = "yes"; then
1653 printf " - Gnutella "
1654 if test "$GNUTELLA" = "yes"; then
1655 echo "enabled (warning: this network module is unmaintained)"
1657 echo " disabled - unmaintained"
1660 printf " - Gnutella2 "
1661 if test "$GNUTELLA2" = "yes"; then
1662 echo "enabled (warning: this network module is unmaintained)"
1664 echo " disabled - unmaintained"
1667 printf " - Direct Connect "
1668 if test "$DIRECT_CONNECT" = "yes"; then
1674 printf " - Open Napster "
1675 if test "$OPEN_NAPSTER" = "yes"; then
1676 echo "enabled - currently not usable"
1678 echo " disabled - currently not usable"
1681 printf " - Soulseek "
1682 if test "$SOULSEEK" = "yes"; then
1683 echo "enabled - currently not usable"
1685 echo " disabled - currently not usable"
1689 if test "$OPENFT" = "yes"; then
1690 echo "enabled - currently not usable"
1692 echo " disabled - currently not usable"
1696 echo "Core features:"
1698 echo " - zlib (required) enabled"
1700 printf " - threads "
1701 if test "$USE_PTHREAD" = "yes"; then
1708 if test "$BZIP2" = "yes"; then
1715 if test "$ICONV" = "yes"; then
1721 printf " - libmagic "
1722 if test "$MAGIC" = "yes"; then
1728 printf " - upnp & natpmp "
1729 if test "$UPNP_NATPMP" = "yes"; then
1735 printf " - graphical stats "
1736 if test "$GD" = "yes"; then
1738 printf " - png support "
1739 if test "$GD_PNG" = "yes"; then
1745 printf " - jpg support "
1746 if test "$GD_JPG" = "yes"; then
1755 if test "$LABLGTK_CONFIG" = "yes"; then
1757 printf "\n - GUI support "
1758 if test "$GUI" = "newgui1"; then
1761 if test "$GUI" = "newgui2"; then
1769 if test "$OLDGUI_NO_31" = "yes"; then
1770 echo " - GUI support GTK1 oldgui does not work with Ocaml 3.1*, disabled"
1773 if test "$TARGET_TYPE" = "byte"; then
1774 OCAML_TYPE="- byte code"
1775 COMPILE_TARGET=".byte"
1779 echo " - OCaml version $OCAMLVERSION $OCAML_TYPE"
1780 echo " - $CC version $CC_VERSION"
1781 if test "x$CXX" != "x"; then
1782 echo " - $CXX version $CXX_VERSION"
1785 echo "\nNow execute '$GNU_MAKE' to start compiling. Good luck!"
1788 echo "To compile a static code execute: $GNU_MAKE mlnet$COMPILE_TARGET.static"
1789 echo "To produce a release tarball execute: $GNU_MAKE release.mlnet.static"
1790 echo "To clean the build directory execute: $GNU_MAKE maintainerclean"
1791 if test "$DONKEY_SUI" = "yes"; then
1793 echo "Compiling CryptoPP.cc can take several minutes, on slow machines up to half an hour."