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