Upstream tarball 20080520
[amule.git] / configure.in
blob0d4a79626d9ea83514a447e75c04446cfbcc4b85
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([aMule],[SVN],[admin@amule.org])
5 AC_CANONICAL_HOST
6 AM_INIT_AUTOMAKE
8 AC_CONFIG_SRCDIR([src/amule.cpp])
9 AM_CONFIG_HEADER([config.h])
10 AM_MAINTAINER_MODE
12 # Removing -fomit since it causes problems with CryptoPP
13 CFLAGS="`echo $CFLAGS | sed "s/-fomit-frame-pointer//g"`"
14 CXXFLAGS="`echo $CXXFLAGS | sed "s/-fomit-frame-pointer//g"`"
16 # System detection, need AC_CANONICAL_HOST
17 case "${host_os}" in
18 "")
19         SYS=unknown
20         ;;
21 darwin*)
22         SYS=darwin
23         CFLAGS="${CFLAGS} -no-cpp-precomp -D_INTL_REDIRECT_MACROS -DNOPCH";
24         LDFLAGS="$LDFLAGS -bind_at_load"
25         touch src/Scanner.cpp
26         ;;
27 openbsd*) 
28         SYS=openbsd
29         LIBS="$LIBS -L/usr/local/lib"
30         X11LIBS="-lX11 -L/usr/X11R6/lib"
31         CXXFLAGS=" $CXXFLAGS -D__OPENBSD__"
32         if test "$DEBUG_FLAGS" != ""; then
33                 DEBUG_FLAGS="-Wall -g -fno-inline -D__DEBUG__"
34         fi
35         ;;
36 *cygwin* | *mingw32*)
37         SYS=win32
38         CFLAGS="$CFLAGS -DNOMINMAX"
39         CXXFLAGS="$CXXFLAGS -DNOMINMAX"
40         ;;
41 solaris*)
42         RESOLV_LIB="-lresolv -lnsl"
43         X11LIBS="-lX11"
44         LIBS="$LIBS -lrt"
45 esac
47 AC_SUBST(RESOLV_LIB)
48 AC_SUBST(X11LIBS)
50 # Checks for programs.
51 AC_PROG_CXX
52 AC_PROG_CXXCPP
53 AC_PROG_CC
54 AC_PROG_CPP
55 AC_PROG_AWK
56 AS_IF([test "$cross_compiling" = yes], [AC_PROG_BUILD_CC], [BUILD_CC="$CC" ; BUILD_EXEEXT=$EXEEXT])
57 AC_PROG_EGREP
58 AC_PROG_MAKE_SET
59 AC_PROG_LEX
60 AC_PROG_INSTALL
61 AC_PROG_RANLIB
62 AC_PROG_YACC
64 # Find the right ranlib, even when cross-compiling
65 # And for some other tools for cross compilation
66 AC_CHECK_TOOL(RANLIB, ranlib)
67 AC_CHECK_TOOL(STRIP, strip)
68 AC_CHECK_TOOL(AR, ar)
69 AC_CHECK_TOOL(LD, ld)
72 # Add args to configure
74 AC_ARG_ENABLE(
75         [ccache],
76         [AS_HELP_STRING(
77                 [--enable-ccache],
78                 [enable ccache support for fast recompilation])],
79         [ccache=$enableval], [ccache=no])
81 AC_ARG_ENABLE(
82         [debug],
83         [AS_HELP_STRING(
84                 [--disable-debug],
85                 [disable additional debugging output])],
86         [USE_DEBUG=$enableval], [USE_DEBUG=yes])
88 AC_ARG_ENABLE(
89         [optimize],
90         [AS_HELP_STRING(
91                 [--enable-optimize],
92                 [enable code optimizing])],
93         [USE_OPTIMIZE=$enableval], [USE_OPTIMIZE=no])
95 AC_ARG_ENABLE(
96         [profile],
97         [AS_HELP_STRING(
98                 [--enable-profile],
99                 [enable code profiling])],
100         [USE_PROFILE=$enableval], [USE_PROFILE=no])
102 AC_ARG_ENABLE(
103         [static],
104         [AS_HELP_STRING(
105                 [--enable-static],
106                 [produce a statically linked executable])],
107         [USE_DEBUG_STATIC=$enableval], [USE_DEBUG_STATIC=no])
109 AC_ARG_ENABLE(
110         [monolithic],
111         [AS_HELP_STRING(
112                 [--disable-monolithic],
113                 [disable building of the monolithic aMule app])],
114         [MONOLITHIC=$enableval], [MONOLITHIC=yes])
116 AC_ARG_ENABLE(
117         [amule-daemon],
118         [AS_HELP_STRING(
119                 [--enable-amule-daemon],
120                 [compile aMule daemon version])],
121         [AMULE_DAEMON=$enableval], [AMULE_DAEMON=no])
123 AC_ARG_ENABLE(
124         [amulecmd],
125         [AS_HELP_STRING(
126                 [--enable-amulecmd],
127                 [compile aMule command line client])],
128         [AMULECMD=$enableval], [AMULECMD=no])
130 AC_ARG_ENABLE(
131         [webserver],
132         [AS_HELP_STRING(
133                 [--enable-webserver],
134                 [compile aMule WebServer])],
135         [WEB=$enableval], [WEB=no])
137 AC_ARG_ENABLE(
138         [amule-gui],
139         [AS_HELP_STRING(
140                 [--enable-amule-gui],
141                 [compile aMule remote GUI (EXPERIMENTAL)])],
142         [AMULE_GUI=$enableval], [AMULE_GUI=no])
144 AC_ARG_ENABLE(
145         [cas],
146         [AS_HELP_STRING(
147                 [--enable-cas],
148                 [compile C aMule Statistics])],
149         [CAS=$enableval], [CAS=no])
151 AC_ARG_ENABLE(
152         [wxcas],
153         [AS_HELP_STRING(
154                 [--enable-wxcas],
155                 [compile aMule GUI Statistics])],
156         [WXCAS=$enableval], [WXCAS=no])
158 AC_ARG_ENABLE(
159         [ed2k],
160         [AS_HELP_STRING(
161                 [--disable-ed2k],
162                 [don't compile aMule ed2k links handler])],
163         [ED2K=$enableval], [ED2K=yes])
165 AC_ARG_ENABLE(
166         [alc],
167         [AS_HELP_STRING(
168                 [--enable-alc],
169                 [compile aMuleLinkCreator GUI version])],
170         [ALC=$enableval], [ALC=no])
171               
172 AC_ARG_ENABLE(
173         [alcc],
174         [AS_HELP_STRING(
175                 [--enable-alcc],
176                 [compile aMuleLinkCreator for console])],
177         [ALCC=$enableval], [ALCC=no])
179 AC_ARG_ENABLE(
180         [monolithic],
181         [AS_HELP_STRING(
182                 [--disable-monolithic],
183                 [disable building of the monolithic aMule app])],
184         [MONOLITHIC=$enableval], [MONOLITHIC=yes])
186 AC_ARG_ENABLE(
187         [upnp],
188         [AS_HELP_STRING(
189                 [--disable-upnp],
190                 [do not compile UPnP code])],
191         [ENABLE_UPNP=$enableval], [ENABLE_UPNP=yes])
193 AC_ARG_ENABLE(
194         [geoip],
195         [AS_HELP_STRING(
196                 [--enable-geoip],
197                 [compile with GeoIP IP2Country library])],
198         [ENABLE_IP2COUNTRY=$enableval], [ENABLE_IP2COUNTRY=no])
200 AC_ARG_WITH(
201         [geoip-headers],
202         AS_HELP_STRING([--with-geoip-headers=DIR],
203                 [GeoIP include files location]),
204         [GEOIP_INCLUDE="-I$withval"])
206 AC_ARG_WITH(
207         [geoip-lib],
208         AS_HELP_STRING([--with-geoip-lib=DIR],
209                 [GeoIP library location]),
210         [GEOIP_LIB="-L$withval $GEOIP_LIB"])
212 AC_ARG_WITH(
213         [geoip-static],
214         AS_HELP_STRING([--with-geoip-static],
215                 [Explicitly link GeoIP statically (default=no)]),
216         [if test "$withval" != "no"; then
217                 GEOIP_LIB="-Wl,-Bstatic $GEOIP_LIB -Wl,-Bdynamic"
218         fi])
220 AC_ARG_WITH(
221         [denoise-level],
222         [AS_HELP_STRING(
223                 [--with-denoise-level=<level>],
224                 [Specifies denoising level (0-4):])
225 AS_HELP_STRING([], [0 - Do nothing])
226 AS_HELP_STRING([], [4 - Suppress all normal output])
227 AS_HELP_STRING([], [(for more information see src/utils/scripts/denoiser.rules)])
228         ],
229         [denoiselevel="$withval"], [denoiselevel=yes])
231 dnl Default is yes, because they're most likely compatible.
232 dnl However, this is only used when cross-compiling.
233 AC_ARG_WITH(
234         [gnu-malloc],
235         [AS_HELP_STRING([--without-gnu-malloc],
236                 [Don't assume that we use GNU libc compatible malloc/realloc when cross-compiling])],
237         [gnumalloc=$withval], [gnumalloc=yes])
239 AC_ARG_WITH(
240         [language],
241         [AS_HELP_STRING([--with-language=<langs>],
242                 [Specify a comma-separated list of languages you want to have installed. See po/LINGUAS for available languages])],
243         [AS_IF([test "$withval" = "all"], [LINGUAS='%UNSET%'], [LINGUAS="`echo $withval | sed -e 's/,/ /g'`"])])
245 # Checking for libs before all other stuff to break
246 # configure as soon as possible in case of a missing one
247 # to avoid losing too much time
249 # Sets gettext version.
250 AM_GNU_GETTEXT_VERSION(0.11.5)
252 # Check for zlib
253 AC_OPTIONS_ZLIB
254 AC_CHECK_ZLIB([1.1.4], , [AC_MSG_ERROR([zlib >= 1.1.4 is required for aMule])])
256 if test x$CAS = xyes -o x$WEB = xyes; then
257 # Check for gd
258 AM_OPTIONS_GDLIBCONFIG
259 AM_PATH_GDLIBCONFIG([2.0.0],
261         CAS_DEFS="-D__GD__"
262         GDLIB_LIBS="-lgd $GDLIB_LIBS"
263 ], [
264     AC_MSG_NOTICE([
265         WARNING: gd-lib >= 2.0.0, or a functional gd.h (from gd-devel) not found.
266         Please check that gdlib-config is in your default path, check out
267         LD_LIBRARY_PATH or equivalent variable.
268         Or this might also be that your gdlib-config has other name.
269         Please try again with --with-gdlib-config=/usr/bin/gdlib-config
270         (replace /usr/bin/gdlib-config with a valid path to your gdlib-config).
271         If you use compiled packages check if you have devel pack installed.
272         To download the latest version check http://www.boutell.com/gd
273         for sources.
274     ])
275         CAS_DEFS=""
278 else
279         CAS_DEFS=""
280         GDLIB_LIBS=""
281         GDLIB_CFLAGS=""
282         GDLIB_LDFLAGS=""
283         GDLIB_VERSION="not_needed"
286 AC_SUBST(CAS_DEFS)
288 AS_IF([test x$WEB = xyes], [AC_CHECK_REGEX(, [WEB=disabled])])
289 if test x$WEB = xyes; then
290 # Check for libpng
291 AM_OPTIONS_LIBPNGCONFIG
292 AM_PATH_LIBPNGCONFIG([1.2.0], [AMULEWEB_DEFS="-DWITH_LIBPNG"],
294     AC_MSG_NOTICE([
295         WARNING: libpng-devel >= 1.2.0 is needed for amuleweb
296     ])
297         AMULEWEB_DEFS=""
300 else
301         AMULEWEB_DEFS=""
302         LIBPNG_LIBS=""
303         LIBPNG_CFLAGS=""
304         LIBPNG_CXXFLAGS=""
305         LIBPNG_LDFLAGS=""
306         LIBPNG_VERSION="not_needed"
309 AC_SUBST(AMULEWEB_DEFS)
312 # Check for perl File::Copy
313 AC_MSG_CHECKING([for File::Copy])
314    if perl -e "require File::Copy" 2>/dev/null; then
315        AC_MSG_RESULT([ok])
316    else
317        AC_MSG_ERROR([File::Copy perl module is required])
318    fi
321 # Check if we need the GUI
322 AC_MSG_CHECKING([whether we need the GUI])
323 AS_IF([test x$MONOLITHIC = xyes], [need_gui=yes])
324 AS_IF([test x$WXCAS = xyes], [need_gui=yes])
325 AS_IF([test x$ALC = xyes], [need_gui=yes])
326 AS_IF([test x$AMULE_GUI = xyes], [need_gui=yes])
327 AS_IF([test ${need_gui:+set} != xset], [need_gui=no])
328 AC_MSG_RESULT($need_gui)
331 # Check for GeoIP (required for IP2Country capability)
332 if test x"$ENABLE_IP2COUNTRY" = x"yes" ; then
333         GEOIP_LIB="-lGeoIP"
334         CXXFLAGS="$CXXFLAGS $GEOIP_INCLUDE"
335         LIBS="$LIBS $GEOIP_LIB"
336         AC_CHECK_HEADER(GeoIP.h,,
337                 [AC_MSG_ERROR([--enable-geoip passed to configure, but the GeoIP header files were not found])])
338         AC_CHECK_LIB(GeoIP, GeoIP_open,
339                 [AC_DEFINE(SUPPORT_GEOIP, 1, Define if you want GeoIP support.)],
340                 [AC_MSG_ERROR([--enable-geoip passed to configure, but the GeoIP libraries were not found])])
342 AC_SUBST(GEOIP_INCLUDE)
343 AC_SUBST(GEOIP_LIB)
346 # Check if the compiler is broken, wrt. exceptions.
347 CHECK_EXCEPTIONS
349 # Check for wx
350 WX_CONFIG_OPTIONS
351 WX_STANDARD_OPTIONS([toolkit,wxshared,wxdebug,wxversion])
352 # Force using a static wxWidgets library if the executable is to be linked statically.
353 AS_IF([test "$USE_DEBUG_STATIC" = "yes"], [WX_SHARED=0])
354 # Force using a unicode build of the library
355 WX_UNICODE=1
356 DEBUG=$WX_DEBUG
357 WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
358 WX_CONFIG_CHECK([2.8.0], [wxWin=1],,, [$WXCONFIG_FLAGS])
359 if test "$wxWin" != 1; then
360         AC_MSG_ERROR([
361                 wxWidgets must be installed on your system but wx-config 
362                 script couldn't be found. Please check that wx-config is 
363                 in path or specified by --with-wx-config=path flag, the 
364                 directory where wxWidgets libraries are installed (returned 
365                 by 'wx-config --libs' command) is in LD_LIBRARY_PATH or
366                 equivalent variable and wxWidgets version is 2.8.0 or above.
367         ])
369 WX_DETECT_STANDARD_OPTION_VALUES
370 AM_WXCONFIG_LARGEFILE
372 dnl Get flags for windres
373 if test x$SYS = xwin32; then
374         AC_CHECK_TOOL([RC], [windres], [:])
375         AC_ARG_VAR([RC], [Win32 Resource Compiler])
376         RCFLAGS=`$WX_CONFIG_WITH_ARGS --cflags | $AWK ['{ for (i = 1; i <= NF; i++) if (index($i, "-I") != 1 && index($i, "-D") != 1) $i = ""; print }']`
377 else
378         RCFLAGS=""
380 AC_SUBST(RCFLAGS)
382 # Check for Crypto++
383 AM_OPTIONS_CRYPTO
385 CHECK_CRYPTO(5.1)
387 CXXFLAGS="$CXXFLAGS $CRYPTO_PP_CXXFLAGS"
388 LDFLAGS="$LDFLAGS $CRYPTO_PP_LDFLAGS"
389 CRYPTOLIBS="-l$CRYPTO_PP_LIB_NAME"
391 case "$CRYPTO_PP_STYLE" in
392         gentoo_debian | installed | sources)
393                 ;;
394         *) AC_MSG_ERROR([
395           WARNING: crypto++ >= $min_crypto_version is not found.
396           Please check that cryptopp-headers are in your default include path,
397           check out LD_LIBRARY_PATH or equivalent variable.
398           Or this might also be that your cryptopp is installed on other path.
399           Please try again with --with-crypto-prefix=/my_crypto_prefix
400           (replace /my_crypto_prefix with a valid path to your crypto directory).
401           To download the latest version check http://www.cryptopp.com for sources.
402           ])
403                 ;;
404 esac
406 # Check for CryptoPP >= 5.5
407 if test $CRYPTO_PP_VERSION_NUMBER -ge "5005000"; then
408         CXXFLAGS="$CXXFLAGS -D__WEAK_CRYPTO__"
412 AC_SUBST(CRYPTOLIBS)
414 # Check for bfd.h (to have proper backtraces without using wxExecute)
415 CHECK_BFD
416 CHECK_EXECINFO
417 CHECK_CXXABI
419 # Ok, we have all needed libs, now checking for other stuff
420 if test "$LEX" = "flex"; then
421         CHECK_FLEX_EXTENDED
422 else
423         HAVE_FLEX_EXTENDED=no
426 # Flush standard test results for speeding cache
427 AC_CACHE_SAVE
429 dnl -------------------------------------------------------------------------------
430 dnl Start of autoscan stuff
431 dnl -------------------------------------------------------------------------------
432 # Checks for header files.
433 AC_PATH_X
434 AC_FUNC_ALLOCA
435 AC_HEADER_DIRENT
436 AC_HEADER_STDC
437 AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h mntent.h netdb.h netinet/in.h stddef.h  nl_types.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/select.h sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h sys/types.h unistd.h])
438 AC_HEADER_SYS_WAIT
440 # Checks for typedefs, structures, and compiler characteristics.
441 AC_HEADER_STDBOOL
442 AC_C_CONST
443 AC_C_INLINE
444 AC_TYPE_MODE_T
445 AC_TYPE_OFF_T
446 AC_TYPE_SIZE_T
447 AC_HEADER_TIME
448 AC_STRUCT_TM
449 AC_TYPE_UID_T
450 AC_C_VOLATILE
451 AC_CHECK_TYPES([ptrdiff_t])
453 # Checks for library functions.
454 AC_FUNC_CLOSEDIR_VOID
455 AC_FUNC_GETMNTENT
456 AC_PROG_GCC_TRADITIONAL
457 AC_FUNC_FORK
458 if test x$SYS != xwin32; then
459 AC_FUNC_LSTAT
460 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
462 AC_FUNC_MEMCMP
463 AC_FUNC_MMAP
464 AC_FUNC_SELECT_ARGTYPES
465 AC_FUNC_SETVBUF_REVERSED
466 AC_TYPE_SIGNAL
467 AC_FUNC_STAT
468 AC_FUNC_STRFTIME
469 AC_FUNC_STRTOD
470 AC_FUNC_VPRINTF
471 dnl Some other functions that worth checking deeper:
472 dnl AC_FUNC_CLOSEDIR_VOID
473 dnl AC_FUNC_MEMCMP
474 dnl AC_FUNC_MMAP
475 dnl AC_FUNC_STAT
476 dnl AC_FUNC_STRTOD
477 dnl AC_FUNC_SETVBUF_REVERSED
478 dnl Anyways, do we actually USE them?
479 if test $cross_compiling = yes -a $gnumalloc = yes ; then
480         AC_MSG_WARN([
481     configure cannot check whether malloc() and realloc() are GNU libc
482     compatible. You have to be ABSOLUTELY sure that they are, otherwise
483     run configure with the --without-gnu-malloc switch.])
484         ac_cv_func_malloc_0_nonnull=yes
485         ac_cv_func_realloc_0_nonnull=yes
487 AC_FUNC_MALLOC
488 AC_FUNC_REALLOC
489 AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify endpwent floor ftruncate getcwd gethostbyaddr gethostbyname gethostname getmntent getmntinfo getpass gettimeofday inet_ntoa localeconv memmove mempcpy memset munmap nl_langinfo pow select setlocale socket sqrt stpcpy strcasecmp strchr strcspn strdup strerror strncasecmp strstr strtoul])
490 #-------------------------------------------------------------------------------
491 # End of autoscan stuff
492 #-------------------------------------------------------------------------------
495 dnl autoscan has missed these ones. Maybe because it's win32 stuff?
497 AC_CHECK_FUNCS([mkdir getrlimit setrlimit])
499 tmp_CFLAGS="$CFLAGS"
500 CFLAGS="-D_XOPEN_SOURCE=600 $CFLAGS"
501 AC_FUNC_STRERROR_R
502 CFLAGS="$tmp_CFLAGS"
504 AM_GNU_GETTEXT([no-libtool], [need-ngettext])
505 AS_IF([test $USE_INCLUDED_LIBINTL = yes], [INCINTL=-I\${top_builddir}/intl])
506 AC_SUBST(INCINTL)
508 AS_IF([test x$USE_NLS = xyes], [CHECK_AUTOPOINT([], [USE_NLS=no])])
509 AS_IF([test x$USE_NLS = xno -a x${enable_nls-yes} = xyes], [AC_MSG_WARN([You need to install GNU gettext/gettext-tools to compile aMule with i18n support.])])
512 # Flush standard test results for speeding cache
513 AC_CACHE_SAVE
515 # Other tests
517 case "$USE_DEBUG" in
518 yes)    DEBUG_FLAGS="-g -D__DEBUG__ -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC"
519         AS_IF([test x$GCC = xyes], [DEBUG_FLAGS="$DEBUG_FLAGS -W -Wall -Wshadow -Wundef -ggdb -fno-inline -fmessage-length=0"])
520         AS_IF([test x$SYS = xwin32], [RCFLAGS="$RCFLAGS -D__DEBUG__"])
521     ;;
522 *)      DEBUG_FLAGS=""
523         AS_IF([test x$GCC = xyes], [DEBUG_FLAGS="$DEBUG_FLAGS -W -Wall -Wshadow -Wundef"])
524     ;;
525 esac
527 #aMule options
529 # Command line tools
530 case "$AMULECMD" in
531 yes)    ;;
532 *)      AMULECMD="no"
533         ;;
534 esac
536 # For proper compilation flags
538 WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs adv,core,net`
540 WXBASE_LIBS=`$WX_CONFIG_WITH_ARGS --libs net`
541 WXBASE_CXXFLAGS="$WX_CXXFLAGS -DwxUSE_GUI=0"
542 WXBASE_CFLAGS="$WX_CFLAGS -DwxUSE_GUI=0"
544 AC_SUBST(WXBASE_LIBS)
545 AC_SUBST(WXBASE_CFLAGS)
546 AC_SUBST(WXBASE_CXXFLAGS)
548 case "$USE_OPTIMIZE" in
549 yes)    OPTIMIZE_FLAGS="-O2"
550         ;;
551 *)      OPTIMIZE_FLAGS=""
552         ;;
553 esac
555 # Profiling
556 case "$USE_PROFILE" in
557 yes)    PROFILE_FLAGS="-pg"
558         ;;
559 *)      PROFILE_FLAGS=""
560         ;;
561 esac
563 AC_MSG_CHECKING([if the applications should be statically linked])
564 case "$USE_DEBUG_STATIC" in
565 yes)    LDFLAGS="$LDFLAGS -static"
566         ;;
567 esac
568 AC_MSG_RESULT($USE_DEBUG_STATIC)
570 # autoconf >= 2.60 already defines ${docdir}, but we always need it.
571 AC_MSG_CHECKING([for docdir])
572 if test x"$docdir" = x; then
573         docdir="$datadir"/doc/"$PACKAGE_NAME"-"$PACKAGE_VERSION"
574         AC_SUBST(docdir)
576 AC_MSG_RESULT($docdir)
578 # Try to set the SVN checkout-date
579 AC_MSG_CHECKING([for SVNDATE])
580 if test -f "$srcdir/SVNDATE" # SVNDATE for tarballs
581 then
582         svndate=`cat $srcdir/SVNDATE`
583 elif test -d $srcdir/.svn # SVNDATE for svn
584 then
585         svndate="rev. `svnversion $srcdir | sed -e 's/[[0-9]][[0-9]]*:\(.*\)/\1/' -e 's/\([[0-9]][[0-9]]*\).*/\1/'`"
587 AC_MSG_RESULT(${svndate:-None required})
588 test "$svndate" && AC_DEFINE_UNQUOTED(SVNDATE, "$svndate", [The checkout date or svn revision number.])
589 test x$SYS = xwin32 && test "$svndate" && RCFLAGS="$RCFLAGS -D__PRERELEASE__"
590 SVNDATE="$svndate"
591 AC_SUBST(SVNDATE)
593 XRCFLAGS="-Isrc"
594 CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS $OPTIMIZE_FLAGS $PROFILE_FLAGS -DUSE_WX_EXTENSIONS"
595 CFLAGS="$CFLAGS $DEBUG_FLAGS $OPTIMIZE_FLAGS $PROFILE_FLAGS -DUSE_WX_EXTENSIONS"
597 LDFLAGS="$LDFLAGS $PROFILE_FLAGS"
598 dnl -lpthread is needed by Debian but FreeBSD < 5 doesnt support it
599 if test x$SYS != xwin32; then
600         AC_MSG_CHECKING([if this is a FreeBSD 4 or earlier system])
601         if test x"`uname -s`" = xFreeBSD && test 0`uname -r | cut -c 1` -lt 5; then
602                 LDFLAGS="$LDFLAGS -pthread"
603                 AC_MSG_RESULT(yes)
604         else
605                 LDFLAGS="$LDFLAGS -lpthread"
606                 AC_MSG_RESULT(no)
607         fi
610 if test "$USE_NLS" = "yes" ; then
611         AC_MSG_CHECKING([for requested languages])
612         Generate_Langs=`echo $LINGUAS | $AWK ['OFS="\\\\|" { for (i = 1; i <= NF; ++i) $i = "\\\\." $i; print }']`
613         GENERATE_MANS_TO_INSTALL(AMULE_DAEMON, docs/man/amuled)
614         GENERATE_MANS_TO_INSTALL(AMULECMD, docs/man/amulecmd)
615         GENERATE_MANS_TO_INSTALL(WEB, docs/man/amuleweb)
616         GENERATE_MANS_TO_INSTALL(AMULE_GUI, docs/man/amulegui)
617         GENERATE_MANS_TO_INSTALL(CAS, src/utils/cas/docs/cas)
618         GENERATE_MANS_TO_INSTALL(WXCAS, src/utils/wxCas/docs/wxcas)
619         GENERATE_MANS_TO_INSTALL(ED2K, docs/man/ed2k)
620         GENERATE_MANS_TO_INSTALL(ALC, src/utils/aLinkCreator/docs/alc)
621         GENERATE_MANS_TO_INSTALL(ALCC, src/utils/aLinkCreator/docs/alcc)
622         GENERATE_MANS_TO_INSTALL(MONOLITHIC, docs/man/amule)
623         AC_MSG_RESULT([${LINGUAS:-all}])
627 dnl Denoiser
629 AC_MSG_CHECKING([denoising level])
630 AS_IF([test "$denoiselevel" = "yes"], [denoiselevel=5])dnl
631 AS_IF([test "$denoiselevel" = "no"], [denoiselevel=0])dnl
632 AS_IF([test $denoiselevel -gt 4], [AS_IF([test "${svndate:+set}" = "set"], [denoiselevel=0], [denoiselevel=4])])dnl
633 AC_MSG_RESULT($denoiselevel)
635 AC_CONFIG_COMMANDS(denoiser, [[ if test $level -gt 0; then
636                 if test ! -d src/utils/scripts; then mkdir -p src/utils/scripts; fi
637                 sed -e "1{x;s/.*/1/;x;};/^[     ]*\$/d;/^#if /{/level.*$level/{x;s/^/1/;x;b0;};x;s/^/0/;x;:0;d;};/^#else/{x;/^1/{s/1/0/;b1;};s/0/1/;:1;x;d;};/^#endif/{x;s/.//;x;d;};/^[        ]*#/d;x;/^1/{x;b;};x;d" \
638                         $srcdir/src/utils/scripts/denoiser.rules > src/utils/scripts/denoiser.sed
639                 for i in `find . -name 'Makefile' -print`; do
640                         if test -n "`head -n 1 $i | grep '^#'`"; then
641                                 sed -f src/utils/scripts/denoiser.sed $i > $i.tmp && mv $i.tmp $i
642                         fi
643                 done
644         fi]], [level=$denoiselevel])
647 AM_CONDITIONAL(WEB, test x$WEB = xyes)
648 AM_CONDITIONAL(ED2K, test x$ED2K = xyes)
649 AM_CONDITIONAL(CAS, test x$CAS = xyes)
650 AM_CONDITIONAL(WXCAS, test x$WXCAS = xyes)
651 AM_CONDITIONAL(ALC, test x$ALC = xyes)
652 AM_CONDITIONAL(ALCC, test x$ALCC = xyes)
653 AM_CONDITIONAL(AMULE_GUI, test x$AMULE_GUI = xyes)
654 AM_CONDITIONAL(AMULE_DAEMON, test x$AMULE_DAEMON = xyes)
655 AM_CONDITIONAL(COMPILE_CMD, test x$AMULECMD = xyes)
656 AM_CONDITIONAL(MONOLITHIC, test x$MONOLITHIC = xyes)
657 AM_CONDITIONAL(ENABLE_UPNP, test x$ENABLE_UPNP = xyes -a x$SYS != xwin32)
658 AM_CONDITIONAL(ENABLE_IP2COUNTRY, test x$ENABLE_IP2COUNTRY = xyes)
659 AM_CONDITIONAL(SYS_WIN32, test x$SYS = xwin32)
660 AM_CONDITIONAL(NEED_RC, test x$SYS = xwin32 -a "$RC" != ":")
661 AM_CONDITIONAL(NEED_CORESERVICES, test x$SYS = xdarwin)
662 AM_CONDITIONAL(COMPILE_NLS, test x$USE_NLS = xyes)
663 AM_CONDITIONAL(GENERATE_FLEX_HEADER, test x$HAVE_FLEX_EXTENDED = xyes)
666 dnl Check for readline library
668 if test x$AMULECMD = xyes -o x$WEB = xyes; then
669         VL_LIB_READLINE
672 # DO NOT MOVE UP... THERE'S A REASON TO BE HERE!!
674 AM_OPTIONS_CCACHE_PFX
676 AC_MSG_CHECKING([whether ccache support should be added])
677 AC_MSG_RESULT($ccache)
678 AC_SUBST(ccache)
680 case "$ccache" in
682 yes)
683         CHECK_CCACHE
684         if [[ $CCACHE = 0 ]]; then
685                 GCC="$ccache_prefix/ccache $GCC"
686                 CC="$ccache_prefix/ccache $CC"
687                 GXX="$ccache_prefix/ccache $GXX"
688                 CXX="$ccache_prefix/ccache $CXX"
689                 BUILD_CC="$ccache_prefix/ccache $BUILD_CC"
690         fi
691 esac
694 dnl Generate the Makefiles
696 AC_CONFIG_FILES([Makefile
697                  docs/Makefile
698                  docs/man/Makefile
699                  intl/Makefile
700                  src/Makefile
701                  src/pixmaps/Makefile
702                  src/pixmaps/flags_xpm/Makefile
703                  src/libs/Makefile
704                  src/libs/ec/Makefile
705                  src/libs/ec/cpp/Makefile
706                  src/libs/common/Makefile
707                  src/utils/Makefile
708                  src/utils/aLinkCreator/Makefile
709                  src/utils/aLinkCreator/docs/Makefile
710                  src/utils/aLinkCreator/src/Makefile
711                  src/utils/cas/Makefile
712                  src/utils/cas/docs/Makefile
713                  src/utils/fileview/Makefile
714                  src/utils/wxCas/Makefile
715                  src/utils/wxCas/docs/Makefile
716                  src/utils/wxCas/src/Makefile
717                  src/utils/xas/Makefile
718                  src/utils/xas/autostart-xas
719                  src/utils/xas/docs/Makefile
720                  src/skins/Makefile
721                  src/webserver/Makefile
722                  src/webserver/src/Makefile
723                  src/webserver/default/Makefile
724                  src/webserver/php-default/Makefile
725                  src/webserver/chicane/Makefile
726                  src/webserver/litoral/Makefile
727                  unittests/Makefile
728                  unittests/muleunit/Makefile
729                  unittests/tests/Makefile])
731 dnl autoscan has missed these, i wonder why...
733 AC_CONFIG_FILES([po/Makefile.in
734                  Compilation.flags])
735 AS_IF([test x$SYS = xwin32], [AC_CONFIG_FILES([version.rc])])
736 AC_OUTPUT
738 echo
739 echo
740 echo "  Configure script has finished system check."
741 echo
742 echo "  Configured aMule ${PACKAGE_VERSION} for '${host}'."
743 echo
744 echo "  aMule enabled options:"
745 echo 
746 echo "  **** aMule Core ****" 
747 echo "  Prefix where aMule should be installed?                    ${prefix:-none}"
748 echo "  Should aMule be compiled with i18n support?                ${USE_NLS:-no}"
749 echo "  Should aMule be compiled in debug mode?                    ${USE_DEBUG:-no}"
750 echo "  Should aMule be compiled with profiling?                   ${USE_PROFILE:-no}"
751 echo "  Should aMule be compiled with optimizations?               ${USE_OPTIMIZE:-no}"
752 echo "  Should aMule be compiled with UPnP support?                ${ENABLE_UPNP:-yes}"
753 echo "  Should aMule be compiled with IP2country support?          ${ENABLE_IP2COUNTRY:-yes}"
754 echo "  Should aMule monolithic application be built?              ${MONOLITHIC:-yes}"
755 echo "  Should aMule daemon version be built?                      ${AMULE_DAEMON:-no}"
756 echo "  Should aMule remote gui be built? (EXPERIMENTAL)           ${AMULE_GUI:-no}"
757 echo "  Crypto++ library/headers style?                            ${CRYPTO_PP_STYLE:-not found}"
759 echo
760 echo "  **** aMule TextClient ****"
761 echo "  Should aMule Command Line Client be built?                 ${AMULECMD:-no}"
762 echo
763 echo "  **** aMule WebServer ****"
764 echo "  Should aMule WebServer be built?                           ${WEB:-no}"
765 echo
766 echo "  **** aMule ED2K Links Handler ****"
767 echo "  Should aMule ED2K Links Handler be built?                  ${ED2K:-yes}"
768 echo
769 echo "  **** aMuleLinkCreator ****"
770 echo "  Should aMuleLinkCreator GUI version (alc) be built?        ${ALC:-no}"
771 echo "  Should aMuleLinkCreator for console (alcc) be built?       ${ALCC:-no}"
772 echo
773 echo "  **** aMule Statistics ****"
774 echo "  Should C aMule Statistics (CAS) be built?                  ${CAS:-no}"
775 echo "  Should aMule GUI Statistics (wxCas) be built?              ${WXCAS:-no}"
777 echo
778 echo "  **** General Libraries and Tools ****"
779 echo "  Should ccache support be enabled?                          ${ccache:-no}"
780 echo "  Libraries aMule will use to build:"
781 wxinfo="$WX_PORT"
782 AS_IF([test $WX_DEBUG -eq 1], [wxinfo="$wxinfo,debug"])
783 AS_IF([test $WX_SHARED -eq 1], [wxinfo="$wxinfo,shared"], [wxinfo="$wxinfo,static"])
784 echo "                                       wxWidgets             ${WX_VERSION_FULL} ($wxinfo)"
785 echo "                                       crypto++              ${CRYPTO_PP_VERSION_STRING} (${CRYPTO_PP_STYLE})"
786 if test x${WEB:-no} != xno; then
787 AS_IF([test $regex_found = no], [regex_found="Not detected"],
788 [AS_IF([test x$REGEX_LIB = x], [regex_found=system], [regex_found="standalone (in $REGEX_LIB)"])])
789 echo "                                       regex                 $regex_found"
791 if test ${enable_nls-yes} = yes; then
792 AS_IF([test x$USE_NLS = xno], [libintl_found="Not detected"],
793 [AS_IF([test x$USE_INCLUDED_LIBINTL = xyes], [libintl_found="included"], [libintl_found="system"])])
794 echo "                                       libintl               $libintl_found"
796 if test x$LIBPNG_VERSION != xnot_needed; then
797 echo "                                       libpng                ${LIBPNG_VERSION:-Not detected}"
799 if test x$GDLIB_VERSION != xnot_needed; then
800 echo "                                       libgd                 ${GDLIB_VERSION:-Not detected}"
802 echo "                                       zlib                  ${ZLIB_VERSION:-Not detected}"
803 if test x$WEB = xdisabled; then
804 echo ""
805 echo ""
806 echo "WARNING! amuleweb has been disabled because configure could not find"
807 echo "a POSIX compliant regex library."
808 echo ""
810 if test x"$LIBPNG_VERSION" = x""; then
811 echo ""
812 echo ""
813 echo " WARNING! libpng >= 1.2.0 not found."
814 echo " amuleweb will be compiled but file download progress bar images will NOT be generated."
815 echo ""