1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/branches/gmyth-0.1b/configure.ac Wed Feb 14 22:25:09 2007 +0000
1.3 @@ -0,0 +1,182 @@
1.4 +# -*- Autoconf -*-
1.5 +# Process this file with autoconf to produce a configure script.
1.6 +
1.7 +AC_PREREQ(2.50)
1.8 +
1.9 +AC_INIT([gmyth],[0.1])
1.10 +
1.11 +dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
1.12 +AC_CONFIG_HEADER(config.h)
1.13 +
1.14 +dnl when going to/from release please set the nano (fourth number) right !
1.15 +dnl releases only do Wall, SVN and prerelease does Werror too
1.16 +AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
1.17 +GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
1.18 +AC_SUBST(GMYTH_MAJORMINOR)
1.19 +
1.20 +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
1.21 +AM_MAINTAINER_MODE
1.22 +dnl make aclocal work in maintainer mode
1.23 +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
1.24 +
1.25 +# Checks for programs.
1.26 +# check for tools
1.27 +# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
1.28 +CFLAGS="$CFLAGS -Wall"
1.29 +AC_PROG_CC
1.30 +AC_PROG_LIBTOOL
1.31 +
1.32 +dnl Generate doxygen documentation
1.33 +DX_HTML_FEATURE(ON)
1.34 +DX_CHM_FEATURE(OFF)
1.35 +DX_CHI_FEATURE(OFF)
1.36 +DX_MAN_FEATURE(OFF)
1.37 +DX_RTF_FEATURE(OFF)
1.38 +DX_XML_FEATURE(OFF)
1.39 +DX_PDF_FEATURE(OFF)
1.40 +DX_PS_FEATURE(OFF)
1.41 +DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
1.42 +
1.43 +# Checks for libraries.
1.44 +
1.45 +# Checks for header files.
1.46 +AC_HEADER_STDC
1.47 +AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
1.48 +
1.49 +# Checks for typedefs, structures, and compiler characteristics.
1.50 +AC_C_CONST
1.51 +AC_TYPE_PID_T
1.52 +AC_STRUCT_TM
1.53 +AC_HEADER_TIME
1.54 +AC_HEADER_STDBOOL
1.55 +
1.56 +# Checks for library functions.
1.57 +AC_FUNC_FORK
1.58 +AC_FUNC_STRFTIME
1.59 +AC_FUNC_SELECT_ARGTYPES
1.60 +AC_PROG_GCC_TRADITIONAL
1.61 +AC_FUNC_MALLOC
1.62 +AC_FUNC_MKTIME
1.63 +AC_FUNC_STRFTIME
1.64 +AC_FUNC_VPRINTF
1.65 +AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
1.66 +
1.67 +##############################
1.68 +# Checks for Network functions
1.69 +##############################
1.70 +
1.71 +AC_CHECK_FUNCS([socket])
1.72 +AC_CHECK_FUNCS([inet_ntoa])
1.73 +AC_CHECK_HEADERS([ifaddrs.h])
1.74 +AC_CHECK_FUNCS([getifaddrs])
1.75 +AC_CHECK_FUNCS([time])
1.76 +
1.77 +AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
1.78 +
1.79 +CFLAGS="$CFLAGS -I/usr/include"
1.80 +LDFLAGS="$LDFLAGS -L/usr/lib"
1.81 +
1.82 +# Checks required packages
1.83 +
1.84 +dnl Test if --disable-debug given
1.85 +AC_ARG_ENABLE(debug,
1.86 + AC_HELP_STRING([--disable-debug], [enable debugging mode]))
1.87 +if test x"$enable_debug" != xno; then
1.88 + CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
1.89 +else
1.90 + CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
1.91 +fi
1.92 +
1.93 +# Check for pkgconfig
1.94 +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
1.95 +# Give error and exit if we don't have pkgconfig
1.96 +if test "x$HAVE_PKGCONFIG" = "xno"; then
1.97 + AC_MSG_ERROR(you need to have pkgconfig installed !)
1.98 +fi
1.99 +
1.100 +# Check for Glib2.0
1.101 +PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
1.102 +
1.103 +# Give error and exit if we don't have glib
1.104 +if test "x$HAVE_GLIB" = "xno"; then
1.105 + AC_MSG_ERROR(you need glib-2.0 installed)
1.106 +fi
1.107 +
1.108 +# make GLIB_CFLAGS and GLIB_LIBS available
1.109 +AC_SUBST(GLIB_CFLAGS)
1.110 +AC_SUBST(GLIB_LIBS)
1.111 +
1.112 +# Check for GObject2.0
1.113 +PKG_CHECK_MODULES(GOBJECT,
1.114 + gobject-2.0,
1.115 + HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
1.116 +
1.117 +# Give error and exit if we don't have gobject
1.118 +if test "x$HAVE_GOBJECT" = "xno"; then
1.119 + AC_MSG_ERROR(you need gobject-2.0 installed)
1.120 +fi
1.121 +
1.122 +# make GOBJECT_CFLAGS and GOBJECT_LIBS available
1.123 +AC_SUBST(GOBJECT_CFLAGS)
1.124 +AC_SUBST(GOBJECT_LIBS)
1.125 +
1.126 +# Check for libxml-2.0
1.127 +PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
1.128 +
1.129 +# Give error and exit if we don't have libxml
1.130 +if test "x$HAVE_LIBXML" = "xno"; then
1.131 + AC_MSG_ERROR(you need libxml-2.0 installed)
1.132 +fi
1.133 +
1.134 +# make LIBXML_CFLAGS and LIBXML_LIBS available
1.135 +AC_SUBST(LIBXML_CFLAGS)
1.136 +AC_SUBST(LIBXML_LIBS)
1.137 +
1.138 +# Check for libcurl
1.139 +PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no)
1.140 +
1.141 +# Give error and exit if we don't have libcurl
1.142 +if test "x$HAVE_LIBCURL" = "xno"; then
1.143 + AC_MSG_ERROR(you need libcurl installed)
1.144 +fi
1.145 +
1.146 +# make LIBCURL_CFLAGS and LIBCURL_LIBS available
1.147 +AC_SUBST(LIBCURL_CFLAGS)
1.148 +AC_SUBST(LIBCURL_LIBS)
1.149 +
1.150 +
1.151 +#
1.152 +# mysql libraries
1.153 +#
1.154 +AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
1.155 +if test -z "$MYSQL_CFLAGS"; then
1.156 + AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
1.157 +fi
1.158 +AC_SUBST(MYSQL_CFLAGS)
1.159 +
1.160 +
1.161 +AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
1.162 +if test -z "$MYSQL_LIBS"; then
1.163 + AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
1.164 +fi
1.165 +AC_SUBST(MYSQL_LIBS)
1.166 +
1.167 +#dnl Enable gtk-doc
1.168 +#GTK_DOC_CHECK(1.4)
1.169 +
1.170 +AC_SUBST(CFLAGS)
1.171 +AC_SUBST(LDFLAGS)
1.172 +AC_SUBST(LIBS)
1.173 +
1.174 +AC_OUTPUT([
1.175 +Makefile
1.176 +src/Makefile
1.177 +tests/Makefile
1.178 +gmyth.pc])
1.179 +
1.180 +if test "x$enable_debug" != "xno"; then
1.181 + AC_MSG_NOTICE([Debug: Enabled])
1.182 +else
1.183 + AC_MSG_NOTICE([Debug: Disabled])
1.184 +fi
1.185 +