gmyth/configure.ac
author melunko
Mon Mar 03 13:11:54 2008 +0000 (2008-03-03)
branchtrunk
changeset 936 d389914210cf
parent 930 bb5d61b14d41
child 942 c93bfa74c71f
permissions -rw-r--r--
[svn r945] gmyth library version incremented to 0.8
     1 AC_INIT(gmyth, 0.8.0)
     2 AC_PREREQ(2.52)
     3 AC_CONFIG_SRCDIR(configure.ac)
     4 AC_CANONICAL_BUILD
     5 AC_CANONICAL_HOST
     6 AC_ISC_POSIX
     7 
     8 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
     9 AM_CONFIG_HEADER(config.h)
    10 
    11 dnl make aclocal work in maintainer mode
    12 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    13 
    14 AC_PROG_CXX
    15 AC_PROG_CC
    16 AM_PROG_CC_STDC
    17 AC_HEADER_STDC
    18 AC_C_BIGENDIAN
    19 AC_C_CONST
    20 
    21 AC_LIBTOOL_WIN32_DLL
    22 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
    23 AC_PROG_LIBTOOL
    24 
    25 dnl Test if --enable-debug given
    26 AC_ARG_ENABLE(debug,
    27         AC_HELP_STRING([--enable-debug], [enable debugging mode]),
    28         enable_debug="$enableval",
    29         enable_debug=no)
    30 
    31 if test "x$enable_debug" = "xyes" ; then
    32         AC_DEFINE(GMYTH_USE_DEBUG, 1, [Debug enabled!])
    33         CFLAGS="$CFLAGS -Wall -O0 -g -DGMYTH_USE_DEBUG"
    34 else
    35         CFLAGS="$CFLAGS -Wall -O2"
    36 fi
    37 
    38 AM_CONDITIONAL(GMYTH_USE_DEBUG, test "x$enable_debug" = "xyes")
    39 
    40 # Check for pkgconfig
    41 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    42 # Give error and exit if we don't have pkgconfig
    43 if test "x$HAVE_PKGCONFIG" = "xno"; then
    44         AC_MSG_ERROR(you need to have pkgconfig installed !)
    45 fi
    46 
    47 # Check for Glib2.0
    48 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    49 
    50 # Give error and exit if we don't have glib
    51 if test "x$HAVE_GLIB" = "xno"; then
    52         AC_MSG_ERROR(you need glib-2.0 installed)
    53 fi
    54 
    55 # make GLIB_CFLAGS and GLIB_LIBS available
    56 AC_SUBST(GLIB_CFLAGS)
    57 AC_SUBST(GLIB_LIBS)
    58 
    59 # Check for GObject2.0
    60 PKG_CHECK_MODULES(GOBJECT,
    61         gobject-2.0,
    62         HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
    63 
    64 # Give error and exit if we don't have gobject
    65 if test "x$HAVE_GOBJECT" = "xno"; then
    66         AC_MSG_ERROR(you need gobject-2.0 installed)
    67 fi
    68 
    69 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
    70 AC_SUBST(GOBJECT_CFLAGS)
    71 AC_SUBST(GOBJECT_LIBS)
    72 
    73 # Check for GThread 
    74 PKG_CHECK_MODULES(GTHREAD, gthread-2.0, HAVE_GTHREAD=yes,HAVE_GTHREAD=no)
    75 
    76 # Give error and exit if we don't have glib
    77 if test "x$HAVE_GTHREAD" = "xno"; then
    78         AC_MSG_ERROR(you need gthread+-2.0 installed)
    79 fi
    80 
    81 # make GTHREAD_CFLAGS and GTHREAD_LIBS available
    82 AC_SUBST(GTHREAD_CFLAGS)
    83 AC_SUBST(GTHREAD_LIBS)
    84 
    85 # Check for libxml-2.0
    86 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
    87 
    88 # Give error and exit if we don't have libxml
    89 if test "x$HAVE_LIBXML" = "xno"; then
    90         AC_MSG_ERROR(you need libxml-2.0 installed)
    91 fi
    92 
    93 # make LIBXML_CFLAGS and LIBXML_LIBS available
    94 AC_SUBST(LIBXML_CFLAGS)
    95 AC_SUBST(LIBXML_LIBS)
    96 
    97 # Check for libcurl
    98 PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no)
    99 
   100 # Give error and exit if we don't have libcurl
   101 if test "x$HAVE_LIBCURL" = "xno"; then
   102         AC_MSG_ERROR(you need libcurl installed)
   103 fi
   104 
   105 # make LIBCURL_CFLAGS and LIBCURL_LIBS available
   106 AC_SUBST(LIBCURL_CFLAGS)
   107 AC_SUBST(LIBCURL_LIBS)
   108 
   109 # check for mysql
   110 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
   111 if test -z "$MYSQL_CFLAGS"; then
   112         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   113 fi
   114 AC_SUBST(MYSQL_CFLAGS)
   115 
   116 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
   117 if test -z "$MYSQL_LIBS"; then
   118         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   119 fi
   120 AC_SUBST(MYSQL_LIBS)
   121 
   122 AC_OUTPUT(
   123 Makefile
   124 m4/Makefile
   125 gmyth/Makefile
   126 samples/Makefile
   127 tests/Makefile
   128 gmyth.pc)
   129 
   130 if test "x$enable_debug" != "xno"; then
   131         AC_MSG_NOTICE([Debug: Enabled])
   132 else
   133         AC_MSG_NOTICE([Debug: Disabled])
   134 fi