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"
165 if test "x$SYSTEM" = "xunknown"; then
166 echo "Unknown build system, please report to the MLDonkey development team at http://mldonkey.sourceforge.net/forums/"
171 alpha*-*-osf*) arch=alpha; system=digital;;
172 alpha*-*-linux*) arch=alpha; system=linux;;
173 alpha*-*-freebsd*) arch=alpha; system=freebsd;;
174 alpha*-*-netbsd*) arch=alpha; system=netbsd;;
175 alpha*-*-openbsd*) arch=alpha; system=openbsd;;
176 sparc-*-sunos4.*) arch=sparc; system=sunos;;
177 sparc-*-solaris2.*) arch=sparc; system=solaris;;
178 sparc-*-*bsd*) arch=sparc; system=bsd;;
179 sparc-*-linux*) arch=sparc; system=linux;;
180 i?86-*-linux*) arch=i386; system=linux;;
181 i386-*-*bsd*) arch=i386; system=bsd;;
182 i486-*-*bsd*) arch=i486; system=bsd;;
183 i586-*-*bsd*) arch=i586; system=bsd;;
184 i686-*-*bsd*) arch=i686; system=bsd;;
185 i?86-*-nextstep*) arch=i386; system=nextstep;;
186 i?86-*-solaris*) arch=i386; system=solaris;;
187 i?86-*-beos*) arch=i386; system=beos;;
188 i?86-*-cygwin*) arch=i386; system=cygwin;;
189 mips-*-irix6*) arch=mips; system=irix;;
190 hppa1.1-*-hpux*) arch=hppa; system=hpux;;
191 hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
192 rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
193 powerpc-*-aix*) arch=power; model=ppc; system=aix;;
194 powerpc-*-linux*) arch=power; model=ppc; system=elf;;
195 powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
196 powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
197 arm*-*-linux*) arch=arm; system=linux;;
198 ia64-*-linux*) arch=ia64; system=linux;;
203 i386-pc-linux*|i386-*-*bsd*) MD4COMP=as; MD4ARCH=i386;;
204 i486-pc-linux*|i486-*-*bsd*) MD4COMP=as; MD4ARCH=i486;;
205 i586-pc-linux*|i586-*-*bsd*) MD4COMP=as; MD4ARCH=i586;;
206 i686-pc-linux*|i686-*-*bsd*) MD4COMP=as; MD4ARCH=i686;;
207 i386-pc-mingw32*) MD4COMP=cc; MD4ARCH=i386;;
208 i486-pc-mingw32*) MD4COMP=cc; MD4ARCH=i486;;
209 i586-pc-mingw32*) MD4COMP=cc; MD4ARCH=i586;;
210 i686-pc-mingw32*) MD4COMP=cc; MD4ARCH=i686;;
216 # ********** **********
217 # ********** Parse checkout date (CVS) or revision (SVN) if available **********
218 # ********** **********
220 if test -d .svn; then
221 AC_MSG_NOTICE(checking SVN revision)
222 AC_CHECK_PROG(SVNVERSION,svnversion,svnversion)
223 if test "$ac_cv_prog_SVNVERSION" = "svnversion"; then
225 SCM_VERSION=`svnversion -n .`
226 else AC_MSG_NOTICE(cannot checking SVN revision... no SVNVERSION)
227 SCM_VERSION="cannot find out SVN revision (no SVNVERSION)"
231 if test -f ./CVS/Entries ; then
232 AC_MSG_NOTICE(checking CVS checkout date)
233 AC_CHECK_PROGS(STAT, stat gstat, stat)
234 if [ test "$ac_cv_prog_STAT" = "stat" ] || [ test "$ac_cv_prog_STAT" = "gstat" ]; then
235 AC_CHECK_PROG(SED, sed, sed)
236 if test "$ac_cv_prog_SED" = "sed"; then
237 AC_CHECK_PROG(CUT, cut, cut)
238 if test "$ac_cv_prog_CUT" = "cut"; then
240 if [ test "$SYSTEM" = "freebsd"] || [ test "$SYSTEM" = "netbsd"] || ( [ test "$SYSTEM" = "macos" ] && [ test "$ac_cv_prog_STAT" != "gstat" ] ); then
241 SCM_VERSION=`$STAT -f "%Sm" ./CVS/Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\4-\1-\2 \3/'`
243 if [ test "$SYSTEM" = "openbsd"]; then
244 AC_CHECK_PROG(GREP, grep, grep)
245 if test "$ac_cv_prog_GREP" = "grep"; then
246 SCM_VERSION=`$STAT -f %a ./CVS/Entries | $GREP -v Entries | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\)/\1-\2-\4 \3/'`
249 if [ test "$SYSTEM" = "mingw"] || [ test "$SYSTEM" = "cygwin"]; then
250 AC_CHECK_PROG(GREP, grep, grep)
251 if test "$ac_cv_prog_GREP" = "grep"; then
252 SCM_VERSION=`$STAT ./CVS/Entries | $GREP Modify | $SED -e 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\5-\2-\3 \4/'`
255 SCM_VERSION=`$STAT -Lc %y ./CVS/Entries | $SED -e 's#\.[0-9]*##' | $CUT -c 1-19`
256 fi #if [ test "$SYSTEM" = "mingw"] || ...
257 fi #if [ test "$SYSTEM" = "openbsd"]
258 fi #if [ test "$SYSTEM" = "freebsd"] || ...
260 AC_MSG_NOTICE(cannot checking CVS checkout date... no CUT)
261 SCM_VERSION="cannot find out SCM Version (no CUT)"
264 AC_MSG_NOTICE(cannot checking CVS checkout date... no SED)
265 SCM_VERSION="cannot find out SCM Version (no SED)"
268 AC_MSG_NOTICE(cannot checking CVS checkout date... no STAT)
269 SCM_VERSION="cannot find out SCM Version (no STAT)"
273 # ********** **********
274 # ********** build MLDonkey version, Required Ocaml and LablGTK versions **********
275 # ********** **********
277 MLDONKEY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$SUB_VERSION
278 if test -f ./subrelease; then
279 MLDONKEY_VERSION=$MLDONKEY_VERSION`cat ./subrelease`
281 if test ! -z "$SUB_VERSION3"; then
282 MLDONKEY_VERSION=$MLDONKEY_VERSION.$SUB_VERSION3
285 REQUIRED_OCAML=3.12.0
286 DOWNLOAD_OCAML_MAJOR=3.12
287 DOWNLOAD_OCAML=3.12.0
289 REQUIRED_LABLGTK=1.2.7
295 # ********** **********
296 # ********** Network and Feature configure switch variables **********
297 # ********** **********
299 # ********** currently not working Networks, can't be enabled
305 # ********** working Networks, enabled by default
315 # ********** predefined configure variations
320 # ********** Features, enabled by default
323 DONKEY_SUI_FILE=DonkeySui2
342 # ********** **********
343 # ********** Network and Feature configure switches and dependency **********
344 # ********** **********
346 AC_ARG_ENABLE(multinet, [ --disable-multinet allows you to only compile support for eDonkey (incl. Overnet and Kademlia)], [MULTINET="$enableval"])
347 AC_ARG_ENABLE(minimum, [ --enable-minimum compile MLDonkey with minimum features and Networks (eDonkey, iconv and thread enabled)], [MINIMUM="$enableval"])
348 AC_ARG_ENABLE(minimum, [ --enable-minimum=all disable all optional features and Networks excepting eDonkey], [MINIMUM="$enableval"])
350 if [ test ! "$MULTINET" = "yes" ] || [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
358 if [ test "$MINIMUM" = "yes" ] || [ test "$MINIMUM" = "all" ]; then
364 if [ test "$MINIMUM" = "all" ]; then
369 #AC_ARG_ENABLE(soulseek, [ --disable-soulseek allows you to remove support for SoulSeek], [SOULSEEK="$enableval"])
370 #AC_ARG_ENABLE(opennap, [ --disable-opennap allows you to remove support for Open Napster], [OPEN_NAPSTER="$enableval"])
371 AC_ARG_ENABLE(directconnect, [ --disable-directconnect allows you to remove support for Direct Connect], [DIRECT_CONNECT="$enableval"])
372 #AC_ARG_ENABLE(openft, [ --disable-openft allows you to remove support for OpenFT], [OPENFT="$enableval"])
374 AC_ARG_ENABLE(donkey, [ --disable-donkey allows you to remove support for eDonkey], [DONKEY="$enableval"])
375 AC_ARG_ENABLE(donkeysui, [ --disable-donkeysui allows you to remove support for eMule SecureUserIdent], [DONKEY_SUI="$enableval"])
376 AC_ARG_ENABLE(bittorrent, [ --disable-bittorrent allows you to remove support for Bittorent], [BITTORRENT="$enableval"])
377 AC_ARG_ENABLE(filetp, [ --disable-filetp allows you to remove support for fileTP], [FILETP="$enableval"])
378 AC_ARG_ENABLE(gnutella, [ --disable-gnutella allows you to remove support for Gnutella], [GNUTELLA="$enableval"])
379 AC_ARG_ENABLE(gnutella2, [ --disable-gnutella2 allows you to remove support for Gnutella2], [GNUTELLA2="$enableval"])
380 AC_ARG_ENABLE(fasttrack, [ --disable-fasttrack allows you to remove support for FastTrack], [FASTTRACK="$enableval"])
382 AC_ARG_ENABLE(batch, [ --enable-batch reply YES to all queries in this script], [BATCH="$enableval"])
383 AC_ARG_ENABLE(force-ocaml, [ --enable-force-ocaml force usage of self-compiled Ocaml], [FORCE_OCAML="$enableval"])
384 AC_ARG_ENABLE(ocamlver, [ --enable-ocamlver=VER force usage of specific Ocaml version (3.10.1|CVS), ], [REQUIRED_OCAML="$enableval"])
385 AC_ARG_ENABLE(mingw, [ --enable-mingw forces compilation with MINGW on Cygwin], [FORCE_MINGW="$enableval"])
386 AC_ARG_ENABLE(checks, [ --enable-checks force mldonkey to perform bound checks on array/string access], [CHECKBOUNDS="$enableval"])
387 if test "$CHECKBOUNDS" = "yes"; then
391 AC_ARG_ENABLE(profile, [ --enable-profile allows you to profile mlnet using gprof (enables debug)], [PROFILE="$enableval"])
392 AC_ARG_ENABLE(debug, [ --enable-debug allows you to compile mlnet with debug symbols], [DEBUG="$enableval"])
393 if test "$PROFILE" = "yes"; then
396 AC_ARG_ENABLE(gui, [ --disable-gui allows you to disable GUI build (default)], [GUI="$enableval"])
397 AC_ARG_ENABLE(gui, [ --enable-gui=oldgui|newgui1|newgui2
398 allows you to choose a GUI (default: newgui2 - is a GTK2 GUI, other GUIs use GTK1)], [GUI="$enableval"])
399 if test "$GUI" = "yes"; then
402 if test ! "$GUI" = "newgui2"; then
403 if test ! "$GUI" = "newgui1"; then
404 if test ! "$GUI" = "oldgui"; then
410 AC_ARG_ENABLE(pthread, [ --disable-pthread allows you to disable pthread support in mldonkey, hurts performance!], [USE_PTHREAD="$enableval"])
411 AC_ARG_ENABLE(pthread-lib, [ --enable-pthread-lib legacy option], [USE_PTHREAD="$enableval"])
412 AC_ARG_ENABLE(iconv, [ --disable-iconv disable the use of iconv], [ICONV="$enableval"])
413 AC_ARG_ENABLE(gd, [ --disable-gd disable the use of gd], [GD="$enableval"])
414 AC_ARG_ENABLE(bzip2, [ --disable-bzip2 disable the use of bzip2], [BZIP2="$enableval"])
415 AC_ARG_ENABLE(magic, [ --disable-magic disable the use of libmagic (GNU file)], [MAGIC="$enableval"])
416 AC_ARG_ENABLE(upnp-natpmp, [ --enable-upnp-natpmp enable the use of libminiupnpc and libnatpmp], [UPNP_NATPMP="$enableval"])
417 AC_ARG_ENABLE(force-upnp-natpmp, [ --enable-force-upnp-natpmp force local compilation of libminiupnpc and libnatpmp], [UPNP_NATPMP_FORCE="$enableval"])
419 if test "$FORCE_MINGW" = "yes"; then
421 CPP="$CPP -mno-cygwin"
429 echo -e "\n--------------------------------"
430 echo " Checking system tools."
431 echo "--------------------------------"
434 AC_CHECK_PROG(GNU_MAKE, gmake, gmake)
435 AC_CHECK_PROG(GNU_MAKE, make, make)
437 if test "x$GNU_MAKE" != "x"; then
438 AC_MSG_CHECKING( [if $GNU_MAKE is GNU make] )
439 $GNU_MAKE --version > /dev/null 2>&1
440 if test "$?" != "0"; then
442 AC_MSG_ERROR(GNU make not found)
447 AC_MSG_ERROR(GNU make not found)
450 AC_CHECK_PROG(COMPRESS, bzip2, bzip2)
451 AC_CHECK_PROG(COMPRESS, gzip, gzip)
453 if test "$ac_cv_prog_COMPRESS" = "bzip2"; then
459 AC_PATH_PROG(PERL, perl, perl)
460 AC_CHECK_PROG(RPMBUILD,rpmbuild,rpmbuild)
461 AC_CHECK_PROG(RPMBUILD,rpm,rpm)
463 AC_CHECK_PROG(WGET, wget, wget)
464 if test -z "$ac_cv_prog_WGET"; then
465 $CC -o wget wget.c || echo "Cannot compile wget.c"
466 AC_PATH_PROG(WGET, wget,,$SOURCE_DIR/config)
467 ac_cv_prog_WGET="$ac_cv_path_WGET"
469 WGET="$ac_cv_prog_WGET"
471 echo "----------------------------------------"
472 echo " Checking system tools finished."
473 echo -e "----------------------------------------\n"
475 echo "--------------------------------"
476 echo " Checking Ocaml compiler."
477 echo "--------------------------------"
479 CONFIG_DIR=$SOURCE_DIR/config
480 PATCH_DIR=$SOURCE_DIR/patches
481 LOCAL_DIR=$PATCH_DIR/local
482 BUILD_DIR=$PATCH_DIR/build
484 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"])
487 LOCAL_OCAML=$LOCAL_DIR/bin
489 AC_PATH_PROG(OCAMLC,ocamlc.opt,"",[$LOCAL_DIR/bin:$PATH])
490 AC_CHECK_TOOL(OCAMLC,ocamlc,ocamlrun ocamlc)
491 AC_PATH_PROG(CAMLP4, camlp4,"",[$LOCAL_DIR/bin:$PATH])
494 if [ test -z "$OCAMLC" ] || [ test -z "$CAMLP4" ] || [ test "$REQUIRED_OCAML" = "CVS" ]; then
497 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
498 case "$OCAMLVERSION" in
499 "$REQUIRED_OCAML"*|3.12.*|3.11.*|3.10.1*|3.10.2*) ;;
506 case "$REQUIRED_OCAML" in
509 REQUIRED_OCAML=3.12.0
513 if [ test "$BUILD_OCAML" = "yes" ] || [ test "$FORCE_OCAML" = "yes" ]; then
515 if [ test "$SYSTEM" = "mingw" ]; then
516 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
517 echo "******** no valid Ocaml compiler found on your system *********" 1>&2;
518 echo "******** on MinGW there is no possibility to let configure *********" 1>&2;
519 echo "******** build the Ocaml compiler with the included script *********" 1>&2;
520 echo "******** check http://mldonkey.sourceforge.net/Windows *********" 1>&2;
521 echo "******** for instuctions how to compile Ocaml under MinGW *********" 1>&2;
525 echo "******** Objective-Caml $REQUIRED_OCAML is required *********" 1>&2;
526 if [ test "$WGET" = "" ] && [ test "$REQUIRED_OCAML" != "CVS" ]; then
527 echo "******** wget is missing *********" 1>&2;
528 echo "******** cannot download Ocaml *********" 1>&2;
531 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
532 echo "Do you want this script to try to download and install ocaml"
533 echo "LOCALLY in mldonkey directory ?"
534 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
538 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
542 cvs -d:pserver:anoncvs:""@camlcvs.inria.fr:/caml login
543 cvs -z3 -d:pserver:anoncvs@camlcvs.inria.fr:/caml co -P ocaml
546 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
548 $WGET http://caml.inria.fr/pub/distrib/ocaml-"$DOWNLOAD_OCAML_MAJOR"/ocaml-"$REQUIRED_OCAML".tar.gz
550 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
551 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-"$REQUIRED_OCAML".tar.gz
553 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
554 $WGET http://caml.inria.fr/pub/distrib/ocaml-3.10/ocaml-"$REQUIRED_OCAML".tar.gz
556 if test ! -f ocaml-"$REQUIRED_OCAML".tar.gz; then
557 echo "******** download Ocaml $REQUIRED_OCAML not successful, try do download it manually *********" 1>&2;
558 echo "******** from http://caml.inria.fr/pub/distrib/ *********" 1>&2;
559 echo "******** and copy the tar.gz into $PATCH_DIR *********" 1>&2;
563 echo Uncompressing ...
566 rm -rf ocaml-"$REQUIRED_OCAML"
567 gzip -cd $PATCH_DIR/ocaml-"$REQUIRED_OCAML".tar.gz | tar vxf -
568 cd ocaml-"$REQUIRED_OCAML"
569 if test -f $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch; then
571 patch -p1 < $PATCH_DIR/ocaml-"$REQUIRED_OCAML".patch
575 ./configure -prefix $LOCAL_DIR -host $host -cc $CC
577 cp -f Makefile Makefile.old
578 sed "s/OTHERLIBRARIES=.*/OTHERLIBRARIES=unix dynlink num str bigarray threads/" Makefile.old > Makefile
580 cp -f $PATCH_DIR/Makefile.ocamldoc ocamldoc/Makefile
582 $GNU_MAKE world opt opt.opt
585 if ! test -f $LOCAL_DIR/lib/ocaml/threads; then
586 if ! test -f $LOCAL_DIR/lib/ocaml/vmthreads; then
587 ln -s vmthreads $LOCAL_DIR/lib/ocaml/threads
591 if [ test "$REQUIRED_OCAML" = "CVS" ]; then
594 rm -rf ocaml-"$REQUIRED_OCAML"
597 echo Ocaml locally installed for mldonkey
599 if test -f "$LOCAL_OCAML"/ocamlc.opt; then
600 OCAMLC=$LOCAL_OCAML/ocamlc.opt
601 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc.opt
603 if test -f "$LOCAL_OCAML"/ocamlc; then
604 OCAMLC=$LOCAL_OCAML/ocamlc
605 ac_cv_prog_OCAMLC=$LOCAL_OCAML/ocamlc
607 echo "Ocaml installation failed"; exit 1
616 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc.opt ; then
617 OCAML_PATH="$LOCAL_OCAML"/
618 OCAMLOPT=$LOCAL_OCAML/ocamlopt.opt
619 OCAMLDOC=$LOCAL_OCAML/ocamldoc
620 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
621 OCAMLDEP=$LOCAL_OCAML/ocamldep
622 OCAMLLEX=$LOCAL_OCAML/ocamllex.opt
623 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
624 CAMLP4=$LOCAL_OCAML/camlp4
625 CAMLP4OF=$LOCAL_OCAML/camlp4of
627 if test "$OCAMLC" = "$LOCAL_OCAML"/ocamlc ; then
628 OCAML_PATH="$LOCAL_OCAML"/
629 if test -f "$LOCAL_OCAML/ocamlopt"; then
630 OCAMLOPT=$LOCAL_OCAML/ocamlopt
634 OCAMLDOC=$LOCAL_OCAML/ocamldoc
635 OCAMLMKTOP=$LOCAL_OCAML/ocamlmktop
636 OCAMLDEP=$LOCAL_OCAML/ocamldep
637 OCAMLLEX=$LOCAL_OCAML/ocamllex
638 OCAMLYACC=$LOCAL_OCAML/ocamlyacc
639 CAMLP4=$LOCAL_OCAML/camlp4
640 CAMLP4OF=$LOCAL_OCAML/camlp4of
642 AC_CHECK_PROG(OCAMLOPT, ocamlopt.opt, ocamlopt.opt)
643 AC_CHECK_PROG(OCAMLOPT, ocamlopt, ocamlopt, no)
644 AC_CHECK_PROG(OCAMLDEP, ocamldep, ocamldep)
645 AC_CHECK_PROG(OCAMLLEX, ocamllex.opt, ocamllex.opt)
646 AC_CHECK_PROG(OCAMLLEX, ocamllex, ocamllex)
647 AC_CHECK_PROG(OCAMLYACC, ocamlyacc, ocamlyacc)
648 AC_CHECK_PROG(OCAMLDOC, ocamldoc, ocamldoc)
649 AC_CHECK_PROG(OCAMLMKTOP, ocamlmktop, ocamlmktop)
650 AC_CHECK_PROG(CAMLP4, camlp4, camlp4)
651 AC_CHECK_PROG(CAMLP4OF, camlp4of, camlp4of, $CAMLP4 pa_o.cmo pr_o.cmo Camlp4QuotationExpander.cmo Camlp4GrammarParser.cmo)
655 OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
656 OCAMLLIB=`$OCAMLC -where`
658 # check if native dynlink is supported and therefore needed for linking
659 CAMLP4LIB_OPT="camlp4lib.cmxa"
660 CAMLP4LIB_BYTE="camlp4lib.cma"
661 if test -f $OCAMLLIB/dynlink.cma; then
662 CAMLP4LIB_BYTE="dynlink.cma $CAMLP4LIB_BYTE"
664 if test -f $OCAMLLIB/dynlink.cmxa; then
665 CAMLP4LIB_OPT="dynlink.cmxa $CAMLP4LIB_OPT"
668 # force usage of supported Ocaml versions
669 case "$OCAMLVERSION" in
670 3.10.1*|3.10.2*|3.1*) ;;
672 if [ test "$REQUIRED_OCAML" != "CVS" ]; then
673 echo "******** Version $REQUIRED_OCAML of Objective-Caml is required *********" 1>&2;
674 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
680 if test "$OCAMLOPT" = "no"; then
687 OCAMLOPTVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
689 test "$OCAMLOPTVERSION" = "$OCAMLVERSION" || {
690 echo "******** Version $REQUIRED_OCAML of ocamlopt is required *********" 1>&2;
691 echo "******* Check http://caml.inria.fr/ ********" 1>&2;
696 echo "-------------------------------------------"
697 echo " Checking Ocaml $OCAMLVERSION finished."
698 echo "-------------------------------------------"
701 if test "$PROFILE" = "yes"; then
702 OCAMLOPT="$OCAMLOPT -p"
705 if test "$FORCE_MINGW" = "yes"; then
706 OCAMLC="$OCAMLC -ccopt -mno-cygwin"
707 OCAMLOPT="$OCAMLOPT -ccopt -mno-cygwin"
708 OCAMLMKTOP="$OCAMLMKTOP -ccopt -mno-cygwin"
710 if test "$DEBUG" = "yes"; then
712 OCAMLOPT="$OCAMLOPT -g"
715 echo -e "\n----------------------------------"
716 echo " Checking system headers."
717 echo "----------------------------------"
719 ifelse(AC_ACVERSION, [2.13], [],
720 [dnl Large file enabled
725 dnl Check for native endianness.
727 [AC_MSG_ERROR([Machine endianness could not be determined])]
729 if test "x$WORDS_BIGENDIAN" = "x"; then
730 NATIVEENDIAN=LittleEndian
732 NATIVEENDIAN=BigEndian
734 AC_SUBST(NATIVEENDIAN)
736 # various header files
737 AC_CHECK_FUNCS(setrlimit getrlimit strerror_r strerror posix_fallocate)
738 AC_CHECK_HEADERS(byteswap.h,,)
739 AC_CHECK_HEADERS([sys/utsname.h])
740 AC_CHECK_HEADERS(arpa/inet.h,,)
741 AC_CHECK_HEADERS([sys/types.h sys/time.h sys/resource.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
742 [#ifdef HAVE_SYS_TYPES_H
743 #include <sys/types.h>
745 #ifdef HAVE_SYS_TIME_H
746 #include <sys/time.h>
748 #ifdef HAVE_NETINET_IN_SYSTM_H
749 #include <netinet/in_systm.h>
751 #ifdef HAVE_NETINET_IN_H
752 #include <netinet/in.h>
757 AC_CHECK_HEADERS(sys/poll.h,,)
758 AC_CHECK_FUNCS(poll,,)
760 AC_CHECK_HEADERS(sys/vfs.h,,)
761 AC_CHECK_HEADERS(sys/statvfs.h,,)
762 AC_CHECK_HEADERS([sys/param.h sys/mount.h],,,
763 [#if HAVE_SYS_PARAM_H
764 #include <sys/param.h>
767 echo "-------------------------------------------"
768 echo " Checking system headers finished."
769 echo -e "-------------------------------------------\n"
770 echo "-----------------------------------"
771 echo " Checking system libraries."
772 echo "-----------------------------------"
773 echo "----- checking zlib (required)"
774 AC_CHECK_LIB(z,inflate,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
775 AC_CHECK_HEADERS(zlib.h,,[echo "Zlib missing, did you install zlib and zlib-developer packages?"; exit 1])
776 AC_CHECK_LIB(z,zlibVersion,[AC_DEFINE(HAVE_ZLIBVERSION, 1,)])
778 if test "$BZIP2" != "no"; then
779 echo "----- checking bzlib (optional)"
780 AC_CHECK_HEADERS(bzlib.h,[AC_CHECK_LIB(bz2,BZ2_bzReadOpen,[BZIP2=yes],[BZIP2=no])],[BZIP2=no])
783 if test "$BZIP2" = "yes"; then
784 AC_CHECK_LIB(bz2,BZ2_bzlibVersion,[AC_DEFINE(HAVE_BZLIBVERSION, 1,)])
785 AC_DEFINE(USE_BZIP2, 1, [Define to 1 if you have bzip2 support.])
787 AC_MSG_NOTICE(bzlib not available)
790 if test "$UPNP_NATPMP_FORCE" = "yes"; then
793 $WGET http://miniupnp.tuxfamily.org/files/miniupnpc-1.4.20100609.tar.gz
794 $WGET http://miniupnp.tuxfamily.org/files/libnatpmp-20100202.tar.gz
795 mkdir -p $BUILD_DIR $LOCAL_DIR/usr/bin $LOCAL_DIR/usr/lib $LOCAL_DIR/usr/include/miniupnpc
797 rm -rf libnatpmp-20100202 miniupnpc-1.4.20100609
798 tar -xzf $PATCH_DIR/miniupnpc-1.4.20100609.tar.gz
799 tar -xzf $PATCH_DIR/libnatpmp-20100202.tar.gz
800 cd $BUILD_DIR/libnatpmp-20100202
801 make all install PREFIX=$LOCAL_DIR
802 cd $BUILD_DIR/miniupnpc-1.4.20100609
803 make all install PREFIX=$LOCAL_DIR
805 rm -rf $BUILD_DIR/libnatpmp-20100202 $BUILD_DIR/miniupnpc-1.4.20100609
806 CPPFLAGS="${CPPFLAGS} -I$LOCAL_DIR/usr/include"
807 LDFLAGS="${LDFLAGS} -L$LOCAL_DIR/usr/lib"
810 if test "$UPNP_NATPMP" = "yes"; then
811 echo "----- checking libminiupnpc >= 1.4.20100609 (optional)"
812 AC_CHECK_HEADERS(miniupnpc/miniupnpc.h,[AC_CHECK_LIB(miniupnpc,upnpDiscover,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
815 if test "$UPNP_NATPMP" = "yes"; then
816 echo "----- checking libnatpmp >= 20100202 (optional)"
817 AC_CHECK_HEADERS(natpmp.h,[AC_CHECK_LIB(natpmp,initnatpmp,[UPNP_NATPMP=yes],[UPNP_NATPMP=no])],[UPNP_NATPMP=no])
820 if test "$UPNP_NATPMP" = "yes"; then
821 AC_DEFINE(ENABLE_UPNP_NATPMP, 1, [Define to 1 if you have libminiupnpc & libnatpmp for port forwarding support.])
822 UPNP_NATPMP_LIBS="-lminiupnpc -lnatpmp $LIBS"
823 UPNP_NATPMP_STATIC_LIBS="-lminiupnpc -lnatpmp $LIBS"
826 if test "$MAGIC" != "no"; then
827 echo "----- checking libmagic (GNU file) (optional)"
828 AC_CHECK_HEADERS(magic.h,
829 [AC_CHECK_LIB(magic,magic_file,
830 [AC_CHECK_DECL([MAGIC_ERROR], [MAGIC=yes], [MAGIC=no],[#include <magic.h>])],
835 if test "$MAGIC" = "yes"; then
838 MAGICLIB=Magic_nomagic
839 AC_MSG_NOTICE(libmagic not available)
844 if test "$GD" != "no"; then
845 echo "----- checking gd (optional)"
850 SAVE_LDFLAGS=$LDFLAGS
851 AC_CHECK_PROG(GDLIBCONFIG, gdlib-config, gdlib-config)
852 if test "$ac_cv_prog_GDLIBCONFIG" = "gdlib-config"; then
853 GD_LIBS=`$GDLIBCONFIG --libs`
854 $GDLIBCONFIG --static-libs > /dev/null 2>&1
855 if test "$?" = "0"; then
856 GD_STATIC_LIBS=`$GDLIBCONFIG --static-libs`
858 GD_LIBS2="$LIBS -lgd $GD_LIBS"
860 GD_CFLAGS=`$GDLIBCONFIG --cflags`
861 CFLAGS="$CFLAGS $GD_CFLAGS"
862 GD_LDFLAGS=`$GDLIBCONFIG --ldflags`
863 LDFLAGS="$LDFLAGS $GD_LDFLAGS"
864 AC_MSG_CHECKING(for libgd > 2.0.14)
865 GDVERSION=`$GDLIBCONFIG --version`
866 GDMAJORVERSION=`$GDLIBCONFIG --majorversion`
867 GDMINORVERSION=`$GDLIBCONFIG --minorversion`
868 GDREVISION=`$GDLIBCONFIG --revision`
869 if [ [ $GDMAJORVERSION = 2 ] && [ $GDMINORVERSION = 0 ] && [ $GDREVISION -gt 14 ]]; then
870 AC_MSG_RESULT($GDVERSION)
873 AC_MSG_RESULT(no (found $GDVERSION))
880 if test "$LIBGD" = "yes"; then
881 AC_CHECK_HEADERS(gd.h,[LIBGD=yes],[LIBGD=no])
884 if test "$LIBGD" = "yes"; then
885 AC_MSG_CHECKING(for gdImageCreate in -lgd)
886 AC_TRY_LINK([#include <gd.h>],
887 [gdImageCreate (0,0);],
888 [LIBGD=yes], [LIBGD=no])
889 AC_MSG_RESULT($LIBGD)
892 if test "$LIBGD" = "no"; then
893 AC_MSG_NOTICE([not found, trying another method])
894 AC_CHECK_LIB(gd, gdImageCreate, [LIBGD=yes], [LIBGD=no])
898 if test "$LIBGD" = "yes"; then
900 # saving current variables
902 SAVE_CFLAGS_PNG=$CFLAGS
903 SAVE_LDFLAGS_PNG=$LDFLAGS
904 AC_CHECK_PROG(PNGLIBCONFIG, libpng-config, libpng-config)
905 if test "$ac_cv_prog_PNGLIBCONFIG" = "libpng-config"; then
906 # check libpng-config contents and update system variables
907 PNG_LIBS=`$PNGLIBCONFIG --libs`
908 LIBS="$LIBS $PNG_LIBS"
909 PNG_CFLAGS=`$PNGLIBCONFIG --cflags`
910 CFLAGS="$CFLAGS $PNG_CFLAGS"
911 PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
912 LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
914 AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
917 CFLAGS=$SAVE_CFLAGS_PNG
918 LDFLAGS=$SAVE_LDFLAGS_PNG
920 if test "$LIBPNG" = "no"; then
921 AC_MSG_NOTICE(png support not available)
925 AC_MSG_CHECKING(for gdImagePng in -lgd)
926 AC_TRY_LINK([#include <gd.h>],
928 [LIBGD_PNG=yes], [LIBGD_PNG=no])
929 AC_MSG_RESULT($LIBGD_PNG)
932 if test "$LIBGD_PNG" = "no"; then
933 AC_MSG_NOTICE([not found, trying another method])
934 AC_CHECK_LIB(gd, gdImagePng, [LIBGD_PNG=yes], [LIBGD_PNG=no])
937 AC_MSG_CHECKING(for png support in libgd)
938 if test "$LIBGD_PNG" = "yes"; then
942 AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
943 AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
950 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [LIBJPEG=yes])
952 if test "$LIBJPEG" = "no"; then
953 AC_MSG_NOTICE(jpeg support not available)
957 AC_MSG_CHECKING(for gdImageJpeg in -lgd)
958 AC_TRY_LINK([#include <gd.h>],
959 [gdImageJpeg (0,0,0);],
960 [LIBGD_JPG=yes], [LIBGD_JPG=no])
961 AC_MSG_RESULT($LIBGD_JPG)
964 if test "$LIBGD_JPG" = "no"; then
965 AC_MSG_NOTICE([not found, trying another method])
966 AC_CHECK_LIB(gd, gdImageJpeg, [LIBGD_JPG=yes], [LIBGD_JPG=no])
969 AC_MSG_CHECKING(for jpeg support in libgd)
970 if test "$LIBGD_JPG" = "yes"; then
973 AC_DEFINE(HAVE_GD_JPG, 1, [Define to 1 if you have jpg support in libgd.])
980 AC_MSG_NOTICE(libgd not available)
984 LDFLAGS=$SAVE_LDFLAGS
987 if test "$GD" != "no"; then
988 GDGRAPHICS=DriverGraphics_gd
990 GDGRAPHICS=DriverGraphics_nogd
993 if test "$ICONV" = "yes"; then
994 echo "----- checking iconv (optional)"
996 if test "$am_cv_func_iconv" != "yes"; then
997 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1000 LIBS="$LIBS $LIBICONV"
1001 AC_CHECK_FUNCS([locale_charset],,
1002 AC_TRY_LINK([#include <langinfo.h>],
1003 [char* cs = nl_langinfo(CODESET);],
1004 AC_MSG_NOTICE(found nl_langinfo(CODESET)),
1005 [echo "Your iconv implementation is incomplete"; exit 1]))
1006 AC_CHECK_LIB(charset,locale_charset)
1007 AC_CHECK_HEADERS([libcharset.h])
1008 AC_CHECK_HEADERS([langinfo.h])
1009 AC_CHECK_HEADERS([locale.h])
1012 AC_DEFINE(DISABLE_ICONV, 1, [Define to 1 if you want to replace iconv and related with stubs.])
1016 if test "$USE_PTHREAD" = "no"; then
1018 echo "You disabled thread support, this will hurt MLDonkey performance!"
1020 echo "----- checking thread support (optional, strongly advised)"
1024 # On linux plaforms, we will have to check that includes from kernel are
1025 # available. glibc version test was shamelessly taken from
1026 # http://public.activestate.com/gsar/APC/perl-5.8.x/Configure
1030 echo "----- GNU C Library version"
1031 AC_CHECK_HEADERS(linux/limits.h,, [
1032 OLD_CPPFLAGS=$CPPFLAGS
1033 CPPFLAGS="-I /usr/src/linux/include"
1034 AC_CHECK_HEADER(linux/types.h,[CONFIG_INCLUDES="-I /usr/src/linux/include"])
1035 CPPFLAGS=$OLD_CPPFLAGS]
1037 AC_CHECK_HEADERS(gnu/libc-version.h,[AC_MSG_CHECKING(for GNU C Library version)
1040 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
1041 alone are insufficient to distinguish different versions, such as
1042 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
1043 libc version 2.1.0. A. Dougherty, June 3, 2002.
1049 # ifdef __GLIBC_MINOR__
1050 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
1051 # include <gnu/libc-version.h>
1052 printf("%s\n", gnu_get_libc_version());
1054 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
1057 printf("%d\n", __GLIBC__);
1067 GLIBC_VERSION="`./try`"
1068 AC_MSG_RESULT($GLIBC_VERSION)
1074 echo "---------------------------------------------"
1075 echo " Checking system libraries finished."
1076 echo -e "---------------------------------------------\n"
1080 echo "--------------------------------------"
1081 echo " Checking activated networks."
1082 echo "--------------------------------------"
1084 if test "$DONKEY" = "yes"; then
1085 AC_MSG_CHECKING(eDonkey)
1086 if test -d ../src/networks/donkey; then
1088 if test "$DONKEY_SUI" = "yes"; then
1091 AC_CHECK_TOOL(NEWCXX, [$CXX], [no])
1092 AC_MSG_CHECKING(eMule SUI)
1093 if test x"$NEWCXX" = x"no"
1100 ACX_CHECK_CXX_FLAGS(-fno-omit-frame-pointer,cv_no_omit_frame_pointer, CRYPTOPPFLAGS="-fno-omit-frame-pointer")
1101 ACX_CHECK_CXX_FLAGS(-mno-omit-leaf-frame-pointer,cv_no_omit_leaf_frame_pointer, CRYPTOPPFLAGS="$CRYPTOPPFLAGS -mno-omit-leaf-frame-pointer")
1103 CXX_VERSION=`$CXX -dumpversion`
1104 DONKEY_SUI_FILE=DonkeySui1
1105 AC_DEFINE(HAVE_CRYPTOPP, 1,)
1108 # AC_MSG_CHECKING(eDonkey server)
1109 # if test -d ../src/networks/server; then
1125 if test "$BITTORRENT" = "yes"; then
1126 AC_MSG_CHECKING(BitTorrent)
1127 if test -d ../src/networks/bittorrent; then
1135 if test "$FILETP" = "yes"; then
1136 AC_MSG_CHECKING(FileTP)
1137 if test -d ../src/networks/fileTP; then
1145 if test "$GNUTELLA" = "yes"; then
1146 AC_MSG_CHECKING(Gnutella)
1147 if test -d ../src/networks/gnutella; then
1155 if test "$GNUTELLA2" = "yes"; then
1157 if test -d ../src/networks/gnutella2; then
1165 if test "$FASTTRACK" = "yes"; then
1166 AC_MSG_CHECKING(Fasttrack)
1167 if test -d ../src/networks/fasttrack; then
1175 if test "$DIRECT_CONNECT" = "yes"; then
1176 AC_MSG_CHECKING(DirectConnect)
1177 if test "$BZIP2" = "yes"; then
1178 if test -d ../src/networks/direct_connect; then
1186 AC_MSG_RESULT(no - bzip2 support missing)
1190 if test "$SOULSEEK" = "yes"; then
1191 AC_MSG_CHECKING(Soulseek)
1192 if test -d ../src/networks/soulseek; then
1200 if test "$OPEN_NAPSTER" = "yes"; then
1201 AC_MSG_CHECKING(OpenNapster)
1202 if test -d ../src/networks/opennap; then
1210 if test "$OPENFT" = "yes"; then
1211 AC_MSG_CHECKING(OpenFT)
1212 if test -d ../src/networks/openFT; then
1219 echo "-----------------------------------------------"
1220 echo " Checking activated networks finished."
1221 echo "-----------------------------------------------"
1223 if test -f $OCAMLLIB/lablgl.cma; then
1224 LABLGL_CMA=lablgl.cma
1227 if test -f $OCAMLLIB/lablgl.$OCAMLLIB_EXT; then
1228 LABLGL_CMXA=lablgl.$OCAMLLIB_EXT
1231 # Check for GTK only if we want to build the GUI
1232 if test ! "$GUI" = "no"; then
1233 echo "---------------------------------------------------------"
1234 echo "Checking the libraries required to build the GTK GUI."
1235 echo "---------------------------------------------------------"
1236 if test "$GUI" = "newgui2"; then
1239 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1240 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1243 PKG_RSVG=librsvg-2.0
1244 AC_MSG_CHECKING(for librsvg - version >= $REQUIRED_RSVG)
1245 if pkg-config --atleast-version $REQUIRED_RSVG $PKG_RSVG; then
1246 GTK_CONFIG="pkg-config $PKG_GTK $PKG_RSVG"
1247 REQUIRED_LABLGTK=2.14.2
1248 LABLGTK_NAME=lablgtk2
1259 if test "$OS_FILES2" = "mingw"; then
1261 PKG_GTK=gtk+-1.3-win32-production
1262 AC_MSG_CHECKING(for GTK+ - version >= $REQUIRED_GTK)
1263 if pkg-config --atleast-version $REQUIRED_GTK $PKG_GTK; then
1264 GTK_CONFIG="pkg-config $PKG_GTK"
1271 AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config, no)
1272 if test "$GTK_CONFIG" = "no"; then
1282 if test "$GTK_CONFIG" = "no"; then
1285 AC_MSG_CHECKING(for native code $LABLGTK_NAME)
1286 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1287 if test "$GUI" = "newgui2"; then
1288 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.$OCAMLLIB_EXT; then
1294 if test -f $OCAMLLIB/$LABLGTK_NAME/lablrsvg.cma; then
1295 echo "---------------------------------------------------------"
1296 echo "lablrsvg is not installed properly. See the INSTALL.txt"
1297 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1298 echo "probably forgot to call 'make opt' before 'make install'."
1299 echo "---------------------------------------------------------"
1301 echo "---------------------------------------------------------"
1302 echo "lablrsvg is not installed. See the INSTALL.txt file of"
1303 echo "mldonkey to see how to compile $LABLGTK_NAME. Librsvg"
1304 echo "may not be installed when you compiled $LABLGTK_NAME."
1305 echo "---------------------------------------------------------"
1315 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.cma; then
1316 echo "-------------------------------------------------------------"
1317 echo "$LABLGTK_NAME is not installed properly. See the INSTALL.txt"
1318 echo "file of mldonkey to see how to compile $LABLGTK_NAME. You"
1319 echo "probably forgot to call 'make opt' before 'make install'."
1320 echo "-------------------------------------------------------------"
1322 echo "Do you want this script to try to download and install $LABLGTK_NAME"
1323 echo "LOCALLY in mldonkey directory ?"
1324 if test "$BATCH" = "no"; then read i <&1; else i=yes; fi
1329 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1330 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then
1331 echo Downloading ...
1332 $WGET http://www.math.nagoya-u.ac.jp/~garrigue/soft/olabl/dist/lablgtk-"$REQUIRED_LABLGTK".tar.gz
1334 if test ! -f lablgtk-"$REQUIRED_LABLGTK".tar.gz; then exit 1; fi
1338 echo Uncompressing ...
1339 gzip -cd $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".tar.gz | tar xf -
1340 (cd lablgtk-"$REQUIRED_LABLGTK"
1341 if test -f $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch; then
1343 patch -p0 < $PATCH_DIR/lablgtk-"$REQUIRED_LABLGTK".patch
1345 PATH=$OCAML_PATH:$PATH
1349 if test "$GUI" = "newgui2"; then
1350 ./configure --prefix=$LOCAL_DIR
1361 rm -rf lablgtk-"$REQUIRED_LABLGTK"
1364 if test -f $OCAMLLIB/$LABLGTK_NAME/lablgtk.$OCAMLLIB_EXT; then
1367 echo "Installation of $LABLGTK_NAME failed"
1377 if test "$GUI" = "newgui2" ; then
1378 GUIS="mldonkey_gui\$(EXE)"
1379 GTKCFLAGS="`pkg-config --cflags-only-I gtk+-2.0`"
1380 GTKLLIBS="`pkg-config --libs-only-L gtk+-2.0`"
1381 GTKLFLAGS="`pkg-config --libs-only-l gtk+-2.0` -lX11"
1383 GUIS="mldonkey_gui\$(EXE) mldonkey_gui2\$(EXE)"
1386 if test "$LABLGTK_CONFIG" = "no"; then
1389 MORE_TARGETS="$MORE_TARGETS $GUIS"
1390 AC_MSG_CHECKING(GToolbox.popup_menu args)
1391 GTOOLBOX="$OCAMLLIB/$LABLGTK_NAME/gToolbox.mli"
1392 grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
1393 if test "$GTOOLBOX_ARGS" = "new"; then
1394 GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
1397 GTOOLBOX_POPUPMENU=' ~x: button ~y: time '
1400 echo "---------------------------------------------------------"
1401 echo "End of GTK GUI configuration."
1402 echo "---------------------------------------------------------"
1405 if test "$OS_FILES" = "mingw"; then
1406 OCAMLDEP_OPTIONS="-slash"
1417 AC_SUBST(FIX_BROKEN_CPP)
1418 AC_SUBST(CONFIG_INCLUDES)
1425 AC_SUBST(OCAMLDEP_OPTIONS)
1428 AC_SUBST(CAMLP4LIB_OPT)
1429 AC_SUBST(CAMLP4LIB_BYTE)
1432 AC_SUBST(OCAMLMKTOP)
1434 AC_SUBST(MORE_TARGETS)
1435 AC_SUBST(MORE_SUBDIRS)
1436 AC_SUBST(LABLGL_CMA)
1437 AC_SUBST(LABLGL_CMXA)
1441 AC_SUBST(OPEN_NAPSTER)
1442 AC_SUBST(DIRECT_CONNECT)
1445 AC_SUBST(BITTORRENT)
1451 AC_SUBST(DONKEY_SUI)
1452 AC_SUBST(CRYPTOPPFLAGS)
1453 AC_SUBST(DONKEY_SUI_FILE)
1454 AC_SUBST(DONKEY_SERVER)
1456 AC_SUBST(REQUIRED_OCAML)
1457 AC_SUBST(REQUIRED_LABLGTK)
1460 AC_SUBST(COMPRESS_EXT)
1461 AC_SUBST(CHECKBOUNDS)
1462 AC_SUBST(MLDONKEY_VERSION)
1463 AC_SUBST(SCM_VERSION)
1464 AC_SUBST(MAJOR_VERSION)
1465 AC_SUBST(MINOR_VERSION)
1466 AC_SUBST(SUB_VERSION)
1467 AC_SUBST(GTOOLBOX_POPUPMENU)
1470 AC_SUBST(TARGET_TYPE)
1478 AC_SUBST(GDGRAPHICS)
1480 AC_SUBST(GD_STATIC_LIBS)
1482 AC_SUBST(GD_LDFLAGS)
1486 AC_SUBST(UPNP_NATPMP)
1487 AC_SUBST(UPNP_NATPMP_LIBS)
1488 AC_SUBST(UPNP_NATPMP_STATIC_LIBS)
1489 BUILD_SYSTEM="`uname -s` `uname -m` `uname -r`"
1490 AC_SUBST(BUILD_SYSTEM)
1491 AC_SUBST(GLIBC_VERSION)
1492 AC_SUBST(CC_VERSION)
1493 AC_SUBST(CXX_VERSION)
1494 AC_SUBST(CONFIGURE_ARGUMENTS)
1495 AC_SUBST(CONFIGURE_RUN)
1497 AUTOCONF=../src/utils/lib/autoconf.ml
1498 GTK_AUTOCONF=../src/utils/lib/gAutoconf.ml
1502 $AUTOCONF.new $GTK_AUTOCONF.new \
1503 ../src/utils/bitstring/bitstring.ml \
1504 ../src/utils/lib/magic.ml \
1505 ../src/networks/donkey/donkeySui.ml \
1506 ../src/daemon/driver/driverGraphics.ml \
1507 ../packages/rpm/mldonkey.spec \
1508 ../packages/rpm/Makefile \
1509 ../packages/slackware/mldonkey.options)
1510 diff $AUTOCONF.new $AUTOCONF 2> /dev/null > /dev/null || cp -f $AUTOCONF.new $AUTOCONF
1511 diff $GTK_AUTOCONF.new $GTK_AUTOCONF 2> /dev/null > /dev/null || cp -f $GTK_AUTOCONF.new $GTK_AUTOCONF
1515 echo -e "\nBuilding dependencies (if it blocks, try '$GNU_MAKE depend' to see the problem)"
1516 $GNU_MAKE depend 2> /dev/null > /dev/null || echo "Building dependencies fails: try: '$GNU_MAKE depend'"
1518 echo -e -n "\nConfiguring MLDonkey" $MLDONKEY_VERSION
1519 if test ! -z "$SCM_VERSION"; then
1520 echo -n " - SCM: $SCM_VERSION"
1524 echo -e "\nNetwork modules:"
1525 echo -n " - eDonkey "
1526 if test "$DONKEY" = "yes"; then
1527 if test "$DONKEY_SUI" = "yes"; then
1528 echo "enabled (eMule SUI enabled)"
1530 echo "enabled (eMule SUI disabled)"
1536 echo -n " - BitTorrent "
1537 if test "$BITTORRENT" = "yes"; then
1543 echo -n " - FileTP (aka wget) "
1544 if test "$FILETP" = "yes"; then
1550 echo -n " - Fasttrack "
1551 if test "$FASTTRACK" = "yes"; then
1557 echo -n " - Gnutella "
1558 if test "$GNUTELLA" = "yes"; then
1559 echo "enabled (warning: this network module is unmaintained)"
1561 echo " disabled - unmaintained"
1564 echo -n " - Gnutella2 "
1565 if test "$GNUTELLA2" = "yes"; then
1566 echo "enabled (warning: this network module is unmaintained)"
1568 echo " disabled - unmaintained"
1571 echo -n " - Direct Connect "
1572 if test "$DIRECT_CONNECT" = "yes"; then
1578 echo -n " - Open Napster "
1579 if test "$OPEN_NAPSTER" = "yes"; then
1580 echo "enabled - currently not usable"
1582 echo " disabled - currently not usable"
1585 echo -n " - Soulseek "
1586 if test "$SOULSEEK" = "yes"; then
1587 echo "enabled - currently not usable"
1589 echo " disabled - currently not usable"
1592 echo -n " - OpenFT "
1593 if test "$OPENFT" = "yes"; then
1594 echo "enabled - currently not usable"
1596 echo " disabled - currently not usable"
1599 echo -e "\nCore features:"
1601 echo " - zlib (required) enabled"
1603 echo -n " - threads "
1604 if test "$USE_PTHREAD" = "yes"; then
1611 if test "$BZIP2" = "yes"; then
1618 if test "$ICONV" = "yes"; then
1624 echo -n " - libmagic "
1625 if test "$MAGIC" = "yes"; then
1631 echo -n " - upnp & natpmp "
1632 if test "$UPNP_NATPMP" = "yes"; then
1638 echo -n " - graphical stats "
1639 if test "$GD" = "yes"; then
1641 echo -n " - png support "
1642 if test "$GD_PNG" = "yes"; then
1648 echo -n " - jpg support "
1649 if test "$GD_JPG" = "yes"; then
1658 if test "$LABLGTK_CONFIG" = "yes"; then
1659 echo -n -e "\n - GUI support "
1660 if test "$GUI" = "newgui1"; then
1663 if test "$GUI" = "newgui2"; then
1671 if test "$OLDGUI_NO_31" = "yes"; then
1672 echo " - GUI support GTK1 oldgui does not work with Ocaml 3.1*, disabled"
1675 if test "$TARGET_TYPE" = "byte"; then
1676 OCAML_TYPE="- byte code"
1677 COMPILE_TARGET=".byte"
1679 echo -e "\nCompilers:"
1680 echo -e " - Ocaml version $OCAMLVERSION $OCAML_TYPE"
1681 echo -e " - $CC version $CC_VERSION"
1682 if test "x$CXX" != "x"; then
1683 echo -e " - $CXX version $CXX_VERSION"
1685 echo -e "\nNow execute '$GNU_MAKE' to start compiling. Good luck!"
1687 echo -e "\nTo compile a static code execute: $GNU_MAKE mlnet$COMPILE_TARGET.static"
1688 echo "To produce a release tarball execute: $GNU_MAKE release.mlnet.static"
1689 echo "To clean the build directory execute: $GNU_MAKE maintainerclean"
1690 if test "$DONKEY_SUI" = "yes"; then
1691 echo -e "\nCompiling CryptoPP.cc can take several minutes, on slow machines up to half an hour."