gmyth-upnp/m4/configure.ac
author melunko
Wed Apr 11 22:24:39 2007 +0100 (2007-04-11)
branchtrunk
changeset 527 eebe6df8aa11
permissions -rw-r--r--
[svn r532] Fixed segmentation fault at program_info_print/debug function
     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 
    15 GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
    16 
    17 AC_SUBST(GMYTH_MAJORMINOR)
    18 
    19 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    20 AM_MAINTAINER_MODE
    21 dnl make aclocal work in maintainer mode
    22 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    23 
    24 # Checks for programs.
    25 # check for tools
    26 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    27 CFLAGS="$CFLAGS -Wall"
    28 AC_PROG_CC
    29 AC_PROG_LIBTOOL
    30 
    31 dnl Generate doxygen documentation
    32 DX_HTML_FEATURE(ON)
    33 DX_CHM_FEATURE(OFF)
    34 DX_CHI_FEATURE(OFF)
    35 DX_MAN_FEATURE(OFF)
    36 DX_RTF_FEATURE(OFF)
    37 DX_XML_FEATURE(OFF)
    38 DX_PDF_FEATURE(OFF)
    39 DX_PS_FEATURE(OFF)
    40 DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
    41 
    42 
    43 # Checks for libraries.
    44 
    45 # Checks for header files.
    46 AC_HEADER_STDC
    47 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
    48 
    49 # Checks for typedefs, structures, and compiler characteristics.
    50 AC_C_CONST
    51 AC_TYPE_PID_T
    52 AC_STRUCT_TM
    53 
    54 # Checks for library functions.
    55 AC_FUNC_FORK
    56 AC_PROG_GCC_TRADITIONAL
    57 AC_FUNC_MALLOC
    58 AC_FUNC_MKTIME
    59 AC_FUNC_VPRINTF
    60 AC_CHECK_FUNCS([memset socket stime strstr strtoul])
    61 
    62 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    63 
    64 # Checks required packages
    65 
    66 dnl Test if --disable-debug given
    67 AC_ARG_ENABLE(debug,
    68 	[AC_HELP_STRING([--disable-debug], [disable debugging mode])],
    69 	enable_debug="$enableval",
    70 	enable_debug=yes)
    71 
    72 if test "x$enable_debug" = "xyes" ; then
    73       CFLAGS="$CFLAGS -g"
    74 else
    75       AC_DEFINE( NDEBUG, 1, [disable debug messages] )
    76       CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
    77 fi          
    78 
    79 AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
    80 
    81 # Check for pkgconfig
    82 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    83 # Give error and exit if we don't have pkgconfig
    84 if test "x$HAVE_PKGCONFIG" = "xno"; then
    85   AC_MSG_ERROR(you need to have pkgconfig installed !)
    86 fi
    87 
    88 # Check for Glib2.0
    89 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    90 
    91 # Give error and exit if we don't have glib
    92 if test "x$HAVE_GLIB" = "xno"; then
    93   AC_MSG_ERROR(you need glib-2.0 installed)
    94 fi
    95 
    96 # make GLIB_CFLAGS and GLIB_LIBS available
    97 AC_SUBST(GLIB_CFLAGS)
    98 AC_SUBST(GLIB_LIBS)
    99 
   100 # Check for GObject2.0
   101 PKG_CHECK_MODULES(GOBJECT,
   102   gobject-2.0,
   103   HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
   104 
   105 # Give error and exit if we don't have gobject
   106 if test "x$HAVE_GOBJECT" = "xno"; then
   107   AC_MSG_ERROR(you need gobject-2.0 installed)
   108 fi
   109 
   110 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
   111 AC_SUBST(GOBJECT_CFLAGS)
   112 AC_SUBST(GOBJECT_LIBS)
   113 
   114 # Check for GTK+-2.0
   115 PKG_CHECK_MODULES(GTK, gtk+-2.0, HAVE_GTK=yes,HAVE_GTK=no)
   116 
   117 # Give error and exit if we don't have gtk
   118 if test "x$HAVE_GTK" = "xyes"; then
   119   AC_DEFINE(WITH_GTK, 1, [build with GTK+ related stuff])
   120   dnl AC_MSG_ERROR(you need gtk+-2.0 installed)
   121 else
   122   AC_MSG_RESULT(no)
   123 fi
   124 
   125 AM_CONDITIONAL(WITH_GTK, test "x$HAVE_GTK" = "xyes" )
   126 
   127 # make GTK_CFLAGS and GTK_LIBS available
   128 AC_SUBST(GTK_CFLAGS)
   129 AC_SUBST(GTK_LIBS)
   130 
   131 dnl ========== Check for Hildon Libraries
   132 PKG_CHECK_MODULES(HILDON,
   133   hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs,
   134   HAVE_HILDON=yes, HAVE_HILDON=no)
   135 
   136 if test "x$HAVE_HILDON" = "xyes"; then
   137   AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs])
   138   HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM=1"
   139 else
   140   AC_MSG_RESULT(no)
   141 fi
   142 
   143 AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes")
   144 
   145 dnl make HILDON_CFLAGS and HILDON_LIBS available
   146 AC_SUBST(HILDON_CFLAGS)
   147 AC_SUBST(HILDON_LIBS)
   148 
   149 # Check for libxml-2.0
   150 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
   151 
   152 # Give error and exit if we don't have libxml
   153 if test "x$HAVE_LIBXML" = "xno"; then
   154   AC_MSG_ERROR(you need libxml-2.0 installed)
   155 fi
   156 
   157 # make LIBXML_CFLAGS and LIBXML_LIBS available
   158 AC_SUBST(LIBXML_CFLAGS)
   159 AC_SUBST(LIBXML_LIBS)
   160 
   161 
   162 # check for gstreamer development files
   163 GST_REQUIRED=0.10
   164 GST_MAJORMINOR=0.10
   165 PKG_CHECK_MODULES(GST, \
   166   gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
   167   HAVE_GST=yes, HAVE_GST=no)
   168 
   169 # Give error and exit if we don't have gstreamer
   170 if test "x$HAVE_GST" = "xno"; then
   171   AC_MSG_ERROR(you need gstreamer development packages installed !)
   172 fi
   173 
   174 # make GST_CFLAGS and GST_LIBS available
   175 AC_SUBST(GST_CFLAGS)
   176 AC_SUBST(GST_LIBS)
   177 
   178 # check for gstreamer-base plugins (xoverlay interface)
   179 GSTBASE_REQUIRED=0.10
   180 GSTBASE_MAJORMINOR=0.10
   181 PKG_CHECK_MODULES(GSTBASE, \
   182   gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
   183   HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
   184 
   185 # Give error and exit if we don't have gstreamer base libraries
   186 if test "x$HAVE_GSTBASE" = "xno"; then
   187   AC_MSG_ERROR(you need gstreamer base development packages installed !)
   188 fi
   189 
   190 # make GSTBASE_CFLAGS and GSTBASE_LIBS available
   191 AC_SUBST(GSTBASE_CFLAGS)
   192 AC_SUBST(GSTBASE_LIBS)
   193 
   194 
   195 # make GST_MAJORMINOR available in Makefile.am
   196 AC_SUBST(GST_MAJORMINOR)
   197 
   198 #
   199 # mysql libraries
   200 #
   201 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
   202 if test -z "$MYSQL_CFLAGS"; then 
   203         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   204 fi
   205 AC_SUBST(MYSQL_CFLAGS)
   206 
   207 
   208 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
   209 if test -z "$MYSQL_LIBS"; then 
   210         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   211 fi
   212 AC_SUBST(MYSQL_LIBS)
   213 
   214 ## Check for gmyth-0.1
   215 
   216 PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
   217 
   218 # Give error and exit if we don't have gmyth-0.1
   219 if test "x$HAVE_LIBGMYTH" = "xno"; then
   220   AC_MSG_ERROR(you need gmyth-0.1 installed)
   221 fi
   222 
   223 # make LIBXML_CFLAGS and LIBXML_LIBS available
   224 AC_SUBST(LIBGMYTH_CFLAGS)
   225 AC_SUBST(LIBGMYTH_LIBS)
   226 
   227 #dnl Enable gtk-doc
   228 #GTK_DOC_CHECK(1.4)
   229 
   230 
   231 AC_CONFIG_FILES([Makefile
   232                 src/Makefile
   233                 pixmaps/Makefile])
   234 AC_OUTPUT