# This file is part of GNUnet. # (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Christian Grothoff (and other contributing authors) # # GNUnet is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2, or (at your # option) any later version. # # GNUnet is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNUnet; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # # Process this file with autoconf to produce a configure script. # AC_PREREQ(2.57) AC_INIT([gnunet-gtk],[0.7.3],[bug-gnunet@gnu.org]) AM_INIT_AUTOMAKE([gnunet-gtk], [0.7.3]) AM_CONFIG_HEADER(config.h) AH_TOP([#define _GNU_SOURCE 1]) AC_ISC_POSIX AC_PROG_AWK AC_PROG_CC AC_PROG_MKDIR_P AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_LIBTOOL_WIN32_DLL AC_PROG_CC AM_PROG_CC_STDC AC_PROG_CXX AC_HEADER_STDC AC_CANONICAL_HOST # dynamic libraries/plugins AC_LIBTOOL_DLOPEN AC_LIBLTDL_INSTALLABLE AC_SUBST(LTDLINCL) AC_SUBST(LIBLTDL) AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_LIB_LTDL AC_CONFIG_SUBDIRS(libltdl) AC_SYS_LARGEFILE AC_FUNC_FSEEKO # check for gtk >= 2.6.0 AC_MSG_CHECKING(for gtk) AM_PATH_GTK_2_0(2.6.0,without_gtk=false,without_gtk=true) AM_CONDITIONAL(HAVE_GTK, test x$without_gtk != xtrue) if test $without_gtk != true then AC_DEFINE_UNQUOTED([HAVE_GTK], 1, [We have GTK]) else AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?) fi CFLAGS="-Wall $CFLAGS" # use '-fno-strict-aliasing', but only if the compiler can take it if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then CFLAGS="-fno-strict-aliasing $CFLAGS" fi # Check system type case "$host_os" in *darwin* | *rhapsody* | *macosx*) AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) CFLAGS="-no-cpp-precomp $CFLAGS" LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS" ;; linux*) AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) ;; freebsd*) AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system]) CFLAGS="-D_THREAD_SAFE $CFLAGS" ;; openbsd*) AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system]) ;; netbsd*) AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system]) ;; *solaris*) AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work]) AC_CHECK_LIB(resolv, res_init) build_target="solaris" ;; *arm-linux*) AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS" ;; *cygwin*) AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) AC_CHECK_LIB(intl, gettext) LDFLAGS="$LDFLAGS -no-undefined" CFLAGS="-mms-bitfields $CFLAGS" build_target="cygwin" ;; *mingw*) AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system]) AC_CHECK_LIB(intl, gettext) LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32" CFLAGS="-mms-bitfields $CFLAGS" build_target="mingw" ;; *) AC_MSG_RESULT(Unrecognised OS $host_os) AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) ;; esac AM_CONDITIONAL(MINGW, test "$build_target" = "mingw") # some other checks for standard libs AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(m, log) AC_CHECK_FUNCS(ftruncate) # check for POSIX emulation under Windows AC_CHECK_LIB(plibc, plibc_conv_to_win_path) # Checks for standard typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T # check for gettext AM_GNU_GETTEXT_VERSION([0.13.1]) AM_GNU_GETTEXT([external]) # test for libextractor extractor=0 AC_MSG_CHECKING(for libextractor) AC_ARG_WITH(extractor, [ --with-extractor=PFX Base of libextractor installation], [AC_MSG_RESULT([$with_extractor]) case $with_extractor in no) ;; yes) AC_CHECK_HEADERS(extractor.h,extractor=1) ;; *) CPPFLAGS="-I$with_extractor/include $CPPFLAGS" AC_CHECK_HEADERS(extractor.h,extractor=1) ;; esac ], [AC_MSG_RESULT([--with-extractor not specified]) AC_CHECK_HEADERS(extractor.h,extractor=1)]) if test "$extractor" != 1 then AC_MSG_ERROR([gnunet-gtk requires libextractor headers]) fi # test for GNUnet core gnunet=0 AC_MSG_CHECKING(for GNUnet core) AC_ARG_WITH(gnunet, [ --with-gnunet=PFX Base of GNUnet installation], [AC_MSG_RESULT([$with_gnunet]) case $with_gnunet in no) ;; yes) AC_CHECK_HEADERS(GNUnet/gnunet_util.h, AC_CHECK_LIB([gnunetutil], [GNUNET_GC_free], gnunet=1)) ;; *) LDFLAGS="-L$with_gnunet/lib $LDFLAGS" CPPFLAGS="-I$with_gnunet/include $CPPFLAGS" AC_CHECK_HEADERS(GNUnet/gnunet_util.h, AC_CHECK_LIB([gnunetutil], [GNUNET_GC_free], EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH" gnunet=1)) ;; esac ], [AC_MSG_RESULT([--with-gnunet not specified]) AC_CHECK_HEADERS(gnunet_util.h, AC_CHECK_LIB([GNUnet/gnunet_util.h], [GNUNET_GC_free], gnunet=1))]) # if GNUnet was not found, try in /usr/local if test "$gnunet" != 1 then AC_MSG_CHECKING(for GNUnet core in /usr/local) with_gnunet=/usr/local LDFLAGS="-L$with_gnunet/lib $LDFLAGS" CPPFLAGS="-I$with_gnunet/include $CPPFLAGS" AC_CHECK_HEADERS(GNUnet/gnunet_util.h, AC_CHECK_LIB([gnunetutil], [GNUNET_GC_free], EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH" gnunet=1)) fi if test "$gnunet" != 1 then AC_MSG_ERROR([gnunet-gtk requires GNUnet]) fi AC_CHECK_HEADERS([GNUnet/gnunet_ecrs_lib.h GNUnet/gnunet_fsui_lib.h GNUnet/gnunet_stats_lib.h GNUnet/gnunet_getoption_lib.h],, AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core headers])) SAVELIBS=$LIBS AC_CHECK_LIB(gnunetutil,GNUNET_GE_LOG,, AC_MSG_ERROR([gnunet-gtk requires libgnunetutil])) AC_CHECK_LIB(gnunetecrs,GNUNET_ECRS_meta_data_create,, AC_MSG_ERROR([gnunet-gtk requires ECRS])) AC_CHECK_LIB(gnunetfsui,GNUNET_FSUI_start,, AC_MSG_ERROR([gnunet-gtk requires FSUI])) AC_CHECK_LIB(gnunetgetoption_api,GNUNET_get_daemon_configuration_value,, AC_MSG_ERROR([gnunet-gtk requires getoption])) AC_CHECK_LIB(gnunetstats_api,GNUNET_STATS_get_statistics,, AC_MSG_ERROR([gnunet-gtk requires stats])) LIBS=$SAVELIBS PKG_CHECK_MODULES(GNUNETGTK, libglade-2.0) # libgnomeui-2.0 >= 1.110.0 AC_SUBST(GNUNETGTK_CFLAGS) AC_SUBST(GNUNETGTK_LIBS) # Is libnotify available? LIBNOTIFY_REQUIRED=0.3.2 AC_ARG_ENABLE(libnotify, [AC_HELP_STRING([--enable-libnotify], [build with libnotify support [default=no]])],, [enable_libnotify=no]) if test x$enable_libnotify = xno ; then have_libnotify=no; else # See if we have sufficiently new libnotify library PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED, have_libnotify=yes, have_libnotify=no) if test x$enable_libnotify = xauto ; then if test x$have_libnotify = xno ; then AC_MSG_WARN([Sufficiently new libnotify library not found]) fi else if test x$have_libnotify = xno ; then AC_MSG_ERROR([libnotify explicitly required, and sufficiently new libnotify library not found]) fi fi fi AM_CONDITIONAL(HAVE_LIBNOTIFY, test x$have_libnotify = xyes) if test x$have_libnotify = xyes ; then # Find out the version of LIBNOTIFY we're using libnotify_version=`pkg-config --modversion libnotify` LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'` LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'` LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'` if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then LIBNOTIFY_VERSION_MAJOR="0" fi if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then LIBNOTIFY_VERSION_MINOR="0" fi if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then LIBNOTIFY_VERSION_MICRO="0" fi echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR.$LIBNOTIFY_VERSION_MINOR.$LIBNOTIFY_VERSION_MICRO." LIBNOTIFY_CFLAGS="$LIBNOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR" LIBNOTIFY_CFLAGS="$LIBNOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR" LIBNOTIFY_CFLAGS="$LIBNOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO" AC_SUBST([LIBNOTIFY_CFLAGS]) AC_SUBST([LIBNOTIFY_LIBS]) AC_DEFINE(WITH_LIBNOTIFY,1,[Define if libnotify is enabled]) fi # Check for gksu version 2 AC_ARG_ENABLE(libgksu2, [AC_HELP_STRING([--enable-libgksu2], [build with libgksu2 support [default=auto]])],, [enable_libgksu2=auto]) if test x$enable_libgksu2 = xno ; then have_libgksu2=no; else # See if we have sufficiently new libgksu2 library PKG_CHECK_MODULES(LIBGKSU2, libgksu2, have_libgksu2=yes, have_libgksu2=no) if test x$enable_libgksu2 = xauto ; then if test x$have_libgksu2 = xno ; then AC_MSG_RESULT([library or headers not found, won't be enabled]) fi else if test x$have_libgksu2 = xno ; then AC_MSG_ERROR([libgksu2 explicitly required, and libgksu2 library or headers not found]) fi fi fi AM_CONDITIONAL(HAVE_LIBGKSU2, test x$have_libgksu2 = xyes) if test x$have_libgksu2 = xyes ; then AC_DEFINE(WITH_LIBGKSU2,1,[Define whether libgksu2 is enabled]) fi AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) # Set PACKAGE_SOURCE_DIR in config.h. packagesrcdir=`cd $srcdir && pwd` AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir]) AC_OUTPUT([ Makefile doc/Makefile src/Makefile src/include/Makefile src/common/Makefile src/core/Makefile src/plugins/Makefile src/plugins/about/Makefile src/plugins/daemon/Makefile src/plugins/fs/Makefile src/plugins/peers/Makefile src/plugins/stats/Makefile po/Makefile.in po/Makefile gnunet-gtk.desktop ]) if test x$have_libnotify = xyes ; then AC_MSG_NOTICE([libnotify support is enabled (experimental)]) else AC_MSG_NOTICE([libnotify support disabled (this is ok)]) fi if test x$have_libgksu2 = xyes ; then AC_MSG_NOTICE([libgksu2 support is enabled]) else AC_MSG_NOTICE([libgksu2 support disabled (this is ok)]) fi