branches/gmyth-0.1b/configure.ac
author rosfran
Fri Feb 02 22:44:59 2007 +0000 (2007-02-02)
branchtrunk
changeset 323 6523ab923c00
permissions -rw-r--r--
[svn r325] Minor changes, separated process of opening LiveTV FileTransfer from the LiveTV setup.
     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_HEADER_STDBOOL
    52 
    53 # Checks for library functions.
    54 AC_FUNC_FORK
    55 AC_FUNC_STRFTIME
    56 AC_FUNC_SELECT_ARGTYPES
    57 AC_PROG_GCC_TRADITIONAL
    58 AC_FUNC_MALLOC
    59 AC_FUNC_MKTIME
    60 AC_FUNC_STRFTIME
    61 AC_FUNC_VPRINTF
    62 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
    63 
    64 ##############################
    65 # Checks for Network functions
    66 ##############################
    67 
    68 AC_CHECK_FUNCS([socket])
    69 AC_CHECK_FUNCS([inet_ntoa])
    70 AC_CHECK_HEADERS([ifaddrs.h])
    71 AC_CHECK_FUNCS([getifaddrs])
    72 AC_CHECK_FUNCS([time])
    73 
    74 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    75 
    76 CFLAGS="$CFLAGS -I/usr/include"
    77 LDFLAGS="$LDFLAGS -L/usr/lib"
    78 
    79 # Checks required packages
    80 
    81 dnl Test if --disable-debug given
    82 AC_ARG_ENABLE(debug,
    83 	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    84 if test x"$enable_debug" != xno; then
    85     CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
    86 else
    87     CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    88 fi          
    89 
    90 # Check for pkgconfig
    91 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    92 # Give error and exit if we don't have pkgconfig
    93 if test "x$HAVE_PKGCONFIG" = "xno"; then
    94   AC_MSG_ERROR(you need to have pkgconfig installed !)
    95 fi
    96 
    97 # Check for Glib2.0
    98 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    99 
   100 # Give error and exit if we don't have glib
   101 if test "x$HAVE_GLIB" = "xno"; then
   102   AC_MSG_ERROR(you need glib-2.0 installed)
   103 fi
   104 
   105 # make GLIB_CFLAGS and GLIB_LIBS available
   106 AC_SUBST(GLIB_CFLAGS)
   107 AC_SUBST(GLIB_LIBS)
   108 
   109 # Check for GObject2.0
   110 PKG_CHECK_MODULES(GOBJECT,
   111   gobject-2.0,
   112   HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
   113 
   114 # Give error and exit if we don't have gobject
   115 if test "x$HAVE_GOBJECT" = "xno"; then
   116   AC_MSG_ERROR(you need gobject-2.0 installed)
   117 fi
   118 
   119 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
   120 AC_SUBST(GOBJECT_CFLAGS)
   121 AC_SUBST(GOBJECT_LIBS)
   122 
   123 # Check for libxml-2.0
   124 PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
   125 
   126 # Give error and exit if we don't have libxml
   127 if test "x$HAVE_LIBXML" = "xno"; then
   128   AC_MSG_ERROR(you need libxml-2.0 installed)
   129 fi
   130 
   131 # make LIBXML_CFLAGS and LIBXML_LIBS available
   132 AC_SUBST(LIBXML_CFLAGS)
   133 AC_SUBST(LIBXML_LIBS)
   134 
   135 # Check for libcurl
   136 PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCRUL=yes, HAVE_LIBCURL=no)
   137 
   138 # Give error and exit if we don't have libcurl
   139 if test "x$HAVE_LIBCURL" = "xno"; then
   140   AC_MSG_ERROR(you need libcurl installed)
   141 fi
   142 
   143 # make LIBCURL_CFLAGS and LIBCURL_LIBS available
   144 AC_SUBST(LIBCURL_CFLAGS)
   145 AC_SUBST(LIBCURL_LIBS)
   146 
   147 
   148 #
   149 # mysql libraries
   150 #
   151 AC_CHECK_PROG(MYSQL_CFLAGS,mysql_config,`mysql_config --cflags`)
   152 if test -z "$MYSQL_CFLAGS"; then
   153         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   154 fi
   155 AC_SUBST(MYSQL_CFLAGS)
   156 
   157 
   158 AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs`)
   159 if test -z "$MYSQL_LIBS"; then
   160         AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
   161 fi
   162 AC_SUBST(MYSQL_LIBS)
   163 
   164 #dnl Enable gtk-doc
   165 #GTK_DOC_CHECK(1.4)
   166 
   167 AC_SUBST(CFLAGS)
   168 AC_SUBST(LDFLAGS)
   169 AC_SUBST(LIBS)
   170 
   171 AC_OUTPUT([
   172 Makefile
   173 src/Makefile
   174 tests/Makefile
   175 gmyth.pc])
   176 
   177 if test "x$enable_debug" != "xno"; then
   178     AC_MSG_NOTICE([Debug: Enabled])
   179 else
   180     AC_MSG_NOTICE([Debug: Disabled])
   181 fi          
   182