diff -r 000000000000 -r 6523ab923c00 branches/gmyth-0.1b/configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/branches/gmyth-0.1b/configure.ac Fri Feb 02 22:44:59 2007 +0000 @@ -0,0 +1,182 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.50) + +AC_INIT([gmyth],[0.1]) + +dnl AC_CONFIG_SRCDIR([src/mmyth_main.c]) +AC_CONFIG_HEADER(config.h) + +dnl when going to/from release please set the nano (fourth number) right ! +dnl releases only do Wall, SVN and prerelease does Werror too +AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes") +GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION +AC_SUBST(GMYTH_MAJORMINOR) + +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode +AM_MAINTAINER_MODE +dnl make aclocal work in maintainer mode +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") + +# Checks for programs. +# check for tools +# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g +CFLAGS="$CFLAGS -Wall" +AC_PROG_CC +AC_PROG_LIBTOOL + +dnl Generate doxygen documentation +DX_HTML_FEATURE(ON) +DX_CHM_FEATURE(OFF) +DX_CHI_FEATURE(OFF) +DX_MAN_FEATURE(OFF) +DX_RTF_FEATURE(OFF) +DX_XML_FEATURE(OFF) +DX_PDF_FEATURE(OFF) +DX_PS_FEATURE(OFF) +DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs) + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_STRUCT_TM +AC_HEADER_TIME +AC_HEADER_STDBOOL + +# Checks for library functions. +AC_FUNC_FORK +AC_FUNC_STRFTIME +AC_FUNC_SELECT_ARGTYPES +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MKTIME +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime]) + +############################## +# Checks for Network functions +############################## + +AC_CHECK_FUNCS([socket]) +AC_CHECK_FUNCS([inet_ntoa]) +AC_CHECK_HEADERS([ifaddrs.h]) +AC_CHECK_FUNCS([getifaddrs]) +AC_CHECK_FUNCS([time]) + +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) + +CFLAGS="$CFLAGS -I/usr/include" +LDFLAGS="$LDFLAGS -L/usr/lib" + +# Checks required packages + +dnl Test if --disable-debug given +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug], [enable debugging mode])) +if test x"$enable_debug" != xno; then + CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG" +else + CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS" +fi + +# Check for pkgconfig +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) +# Give error and exit if we don't have pkgconfig +if test "x$HAVE_PKGCONFIG" = "xno"; then + AC_MSG_ERROR(you need to have pkgconfig installed !) +fi + +# Check for Glib2.0 +PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no) + +# Give error and exit if we don't have glib +if test "x$HAVE_GLIB" = "xno"; then + AC_MSG_ERROR(you need glib-2.0 installed) +fi + +# make GLIB_CFLAGS and GLIB_LIBS available +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +# Check for GObject2.0 +PKG_CHECK_MODULES(GOBJECT, + gobject-2.0, + HAVE_GOBJECT=yes, HAVE_GOBJECT=no) + +# Give error and exit if we don't have gobject +if test "x$HAVE_GOBJECT" = "xno"; then + AC_MSG_ERROR(you need gobject-2.0 installed) +fi + +# make GOBJECT_CFLAGS and GOBJECT_LIBS available +AC_SUBST(GOBJECT_CFLAGS) +AC_SUBST(GOBJECT_LIBS) + +# Check for libxml-2.0 +PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no) + +# Give error and exit if we don't have libxml +if test "x$HAVE_LIBXML" = "xno"; then + AC_MSG_ERROR(you need libxml-2.0 installed) +fi + +# make LIBXML_CFLAGS and LIBXML_LIBS available +AC_SUBST(LIBXML_CFLAGS) +AC_SUBST(LIBXML_LIBS) + +# Check for libcurl +PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no) + +# Give error and exit if we don't have libcurl +if test "x$HAVE_LIBCURL" = "xno"; then + AC_MSG_ERROR(you need libcurl installed) +fi + +# make LIBCURL_CFLAGS and LIBCURL_LIBS available +AC_SUBST(LIBCURL_CFLAGS) +AC_SUBST(LIBCURL_LIBS) + + +# +# mysql libraries +# +AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`) +if test -z "$MYSQL_CFLAGS"; then + AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed]) +fi +AC_SUBST(MYSQL_CFLAGS) + + +AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`) +if test -z "$MYSQL_LIBS"; then + AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed]) +fi +AC_SUBST(MYSQL_LIBS) + +#dnl Enable gtk-doc +#GTK_DOC_CHECK(1.4) + +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBS) + +AC_OUTPUT([ +Makefile +src/Makefile +tests/Makefile +gmyth.pc]) + +if test "x$enable_debug" != "xno"; then + AC_MSG_NOTICE([Debug: Enabled]) +else + AC_MSG_NOTICE([Debug: Disabled]) +fi +