gmyth/configure.ac
author rosfran
Tue Dec 12 18:18:36 2006 +0000 (2006-12-12)
branchtrunk
changeset 215 633c6c9784d3
parent 148 680e5d40ff1a
child 240 bb2752e9fe02
permissions -rw-r--r--
[svn r216] Change the time_t time/date references, to the GTimeVal GLib's structure.
     1 #                                               -*- Autoconf -*-
     2 # Process this file with autoconf to produce a configure script.
     3 
     4 AC_PREREQ(2.50)
     5 
     6 AC_INIT([gmyth],[0.1])
     7 
     8 dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
     9 AC_CONFIG_HEADER(config.h)
    10 
    11 dnl when going to/from release please set the nano (fourth number) right !
    12 dnl releases only do Wall, SVN and prerelease does Werror too
    13 AS_VERSION(gmyth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
    14 GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
    15 AC_SUBST(GMYTH_MAJORMINOR)
    16 
    17 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    18 AM_MAINTAINER_MODE
    19 dnl make aclocal work in maintainer mode
    20 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    21 
    22 # Checks for programs.
    23 # check for tools
    24 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    25 CFLAGS="$CFLAGS -Wall"
    26 AC_PROG_CC
    27 AC_PROG_LIBTOOL
    28 
    29 dnl Generate doxygen documentation
    30 DX_HTML_FEATURE(ON)
    31 DX_CHM_FEATURE(OFF)
    32 DX_CHI_FEATURE(OFF)
    33 DX_MAN_FEATURE(OFF)
    34 DX_RTF_FEATURE(OFF)
    35 DX_XML_FEATURE(OFF)
    36 DX_PDF_FEATURE(OFF)
    37 DX_PS_FEATURE(OFF)
    38 DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
    39 
    40 # Checks for libraries.
    41 
    42 # Checks for header files.
    43 AC_HEADER_STDC
    44 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
    45 
    46 # Checks for typedefs, structures, and compiler characteristics.
    47 AC_C_CONST
    48 AC_TYPE_PID_T
    49 AC_STRUCT_TM
    50 AC_HEADER_TIME
    51 AC_STRUCT_TM
    52 AC_HEADER_STDBOOL
    53 
    54 # Checks for library functions.
    55 AC_FUNC_FORK
    56 AC_FUNC_STRFTIME
    57 AC_FUNC_SELECT_ARGTYPES
    58 AC_PROG_GCC_TRADITIONAL
    59 AC_FUNC_MALLOC
    60 AC_FUNC_MKTIME
    61 AC_FUNC_STRFTIME
    62 AC_FUNC_VPRINTF
    63 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
    64 
    65 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    66 
    67 # Checks required packages
    68 
    69 dnl Test if --disable-debug given
    70 AC_ARG_ENABLE(debug,
    71 	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    72 if test x"$enable_debug" != xno; then
    73     CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
    74 else
    75     CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    76 fi          
    77 
    78 # Check for pkgconfig
    79 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    80 # Give error and exit if we don't have pkgconfig
    81 if test "x$HAVE_PKGCONFIG" = "xno"; then
    82   AC_MSG_ERROR(you need to have pkgconfig installed !)
    83 fi
    84 
    85 # Check for Glib2.0
    86 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    87 
    88 # Give error and exit if we don't have glib
    89 if test "x$HAVE_GLIB" = "xno"; then
    90   AC_MSG_ERROR(you need glib-2.0 installed)
    91 fi
    92 
    93 # make GLIB_CFLAGS and GLIB_LIBS available
    94 AC_SUBST(GLIB_CFLAGS)
    95 AC_SUBST(GLIB_LIBS)
    96 
    97 # Check for GObject2.0
    98 PKG_CHECK_MODULES(GOBJECT,
    99   gobject-2.0,
   100   HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
   101 
   102 # Give error and exit if we don't have gobject
   103 if test "x$HAVE_GOBJECT" = "xno"; then
   104   AC_MSG_ERROR(you need gobject-2.0 installed)
   105 fi
   106 
   107 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
   108 AC_SUBST(GOBJECT_CFLAGS)
   109 AC_SUBST(GOBJECT_LIBS)
   110 
   111 # Check for libxml-2.0
   112 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
   113 
   114 # Give error and exit if we don't have libxml
   115 if test "x$HAVE_LIBXML" = "xno"; then
   116   AC_MSG_ERROR(you need libxml-2.0 installed)
   117 fi
   118 
   119 # make LIBXML_CFLAGS and LIBXML_LIBS available
   120 AC_SUBST(LIBXML_CFLAGS)
   121 AC_SUBST(LIBXML_LIBS)
   122 
   123 
   124 # check for gstreamer development files
   125 GST_REQUIRED=0.10
   126 GST_MAJORMINOR=0.10
   127 PKG_CHECK_MODULES(GST, \
   128   gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
   129   HAVE_GST=yes, HAVE_GST=no)
   130 
   131 # Give error and exit if we don't have gstreamer
   132 if test "x$HAVE_GST" = "xno"; then
   133   AC_MSG_ERROR(you need gstreamer development packages installed !)
   134 fi
   135 
   136 # make GST_CFLAGS and GST_LIBS available
   137 AC_SUBST(GST_CFLAGS)
   138 AC_SUBST(GST_LIBS)
   139 
   140 # check for gstreamer-base
   141 GSTBASE_REQUIRED=0.10
   142 GSTBASE_MAJORMINOR=0.10
   143 PKG_CHECK_MODULES(GSTBASE, \
   144   gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
   145   HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
   146 
   147 # Give error and exit if we don't have gstreamer base libraries
   148 if test "x$HAVE_GSTBASE" = "xno"; then
   149   AC_MSG_ERROR(you need gstreamer base development packages installed !)
   150 fi
   151 
   152 # make GSTBASE_CFLAGS and GSTBASE_LIBS available
   153 AC_SUBST(GSTBASE_CFLAGS)
   154 AC_SUBST(GSTBASE_LIBS)
   155 
   156 # check for gstreamer-base plugins (xoverlay interface)
   157 GSTPLUGINSBASE_REQUIRED=0.10
   158 GSTPLUGINSBASE_MAJORMINOR=0.10
   159 PKG_CHECK_MODULES(GSTPLUGINSBASE, \
   160   gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
   161   HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
   162 
   163 # Give error and exit if we don't have gstreamer base libraries
   164 if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
   165   AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
   166 fi
   167 
   168 # make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
   169 AC_SUBST(GSTPLUGINSBASE_CFLAGS)
   170 AC_SUBST(GSTPLUGINSBASE_LIBS)
   171 
   172 
   173 # make GST_MAJORMINOR available in Makefile.am
   174 AC_SUBST(GST_MAJORMINOR)
   175 GSTBASE_MAJORMINOR=0.10
   176 PKG_CHECK_MODULES(GSTBASE, \
   177   gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
   178   HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
   179 
   180 # Give error and exit if we don't have gstreamer base libraries
   181 if test "x$HAVE_GSTBASE" = "xno"; then
   182   AC_MSG_ERROR(you need gstreamer base development packages installed !)
   183 fi
   184 
   185 ##############################
   186 # Checks for Network functions
   187 ##############################
   188 
   189 AC_CHECK_FUNCS([socket])
   190 AC_CHECK_FUNCS([inet_ntoa])
   191 AC_CHECK_HEADERS([ifaddrs.h])
   192 AC_CHECK_FUNCS([getifaddrs])
   193 AC_CHECK_FUNCS([time])
   194 
   195 #
   196 # mysql libraries
   197 #
   198 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
   199 if test -z "$MYSQL_CFLAGS"; then 
   200         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   201 fi
   202 AC_SUBST(MYSQL_CFLAGS)
   203 
   204 
   205 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
   206 if test -z "$MYSQL_LIBS"; then 
   207         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   208 fi
   209 AC_SUBST(MYSQL_LIBS)
   210 
   211 #dnl Enable gtk-doc
   212 #GTK_DOC_CHECK(1.4)
   213 
   214 AC_OUTPUT([
   215 Makefile
   216 src/Makefile
   217 tests/Makefile
   218 gmyth.pc])
   219 
   220 if test x"$enable_debug" != xno; then
   221     AC_MSG_NOTICE([Debug: Enabled])
   222 else
   223     AC_MSG_NOTICE([Debug: Disabled])
   224 fi          
   225