gmyth-upnp/configure.ac
author renatofilho
Mon Feb 25 14:14:29 2008 +0000 (2008-02-25)
branchtrunk
changeset 923 337aef39e86a
parent 915 e612ba1d16ab
child 929 00536b0eb88b
permissions -rw-r--r--
[svn r932] moved test dir to tests
     1 #                                               -*- Autoconf -*-
     2 # Process this file with autoconf to produce a configure script.
     3 
     4 AC_PREREQ(2.50)
     5 
     6 AC_INIT([gmyth-upnp],[0.7.1])
     7 
     8 AC_CONFIG_SRCDIR([src/gmyth_upnp.c])
     9 AC_CONFIG_HEADER(config.h)
    10 
    11 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    12 AM_MAINTAINER_MODE
    13 dnl make aclocal work in maintainer mode
    14 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    15 
    16 # Checks for programs.
    17 # check for tools
    18 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    19 CFLAGS="$CFLAGS -Wall"
    20 AC_PROG_CC
    21 AC_PROG_LIBTOOL
    22 
    23 # Checks for libraries.
    24 
    25 # Check for pkgconfig
    26 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    27 # Give error and exit if we don't have pkgconfig
    28 if test "x$HAVE_PKGCONFIG" = "xno"; then
    29   AC_MSG_ERROR(you need to have pkgconfig installed !)
    30 fi
    31 
    32 # Checks for header files.
    33 AC_HEADER_STDC
    34 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
    35 
    36 # Checks for typedefs, structures, and compiler characteristics.
    37 AC_C_CONST
    38 AC_TYPE_PID_T
    39 AC_STRUCT_TM
    40 AC_HEADER_TIME
    41 AC_HEADER_STDBOOL
    42 
    43 # Checks for library functions.
    44 AC_FUNC_FORK
    45 AC_FUNC_STRFTIME
    46 AC_FUNC_SELECT_ARGTYPES
    47 AC_PROG_GCC_TRADITIONAL
    48 AC_FUNC_MALLOC
    49 AC_FUNC_MKTIME
    50 AC_FUNC_STRFTIME
    51 AC_FUNC_VPRINTF
    52 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
    53 
    54 ##############################
    55 # Checks for Network functions
    56 ##############################
    57 
    58 AC_CHECK_FUNCS([socket])
    59 AC_CHECK_FUNCS([inet_ntoa])
    60 AC_CHECK_HEADERS([ifaddrs.h])
    61 AC_CHECK_FUNCS([getifaddrs])
    62 AC_CHECK_FUNCS([time])
    63 
    64 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    65 
    66 CFLAGS="$CFLAGS -I/usr/include"
    67 LDFLAGS="$LDFLAGS -L/usr/lib"
    68 
    69 # Checks required packages
    70 
    71 dnl Test if --disable-debug given
    72 AC_ARG_ENABLE(debug,
    73 	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    74 if test x"$enable_debug" != xno; then
    75     CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
    76 else
    77     CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    78 fi 
    79 
    80 # Check for Glib2.0
    81 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    82 
    83 # Give error and exit if we don't have glib
    84 if test "x$HAVE_GLIB" = "xno"; then
    85   AC_MSG_ERROR(you need glib-2.0 installed)
    86 fi
    87 
    88 # make GLIB_CFLAGS and GLIB_LIBS available
    89 AC_SUBST(GLIB_CFLAGS)
    90 AC_SUBST(GLIB_LIBS)
    91 
    92 # Check for GObject2.0
    93 PKG_CHECK_MODULES(GOBJECT,
    94   gobject-2.0,
    95   HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
    96 
    97 # Give error and exit if we don't have gobject
    98 if test "x$HAVE_GOBJECT" = "xno"; then
    99   AC_MSG_ERROR(you need gobject-2.0 installed)
   100 fi
   101 
   102 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
   103 AC_SUBST(GOBJECT_CFLAGS)
   104 AC_SUBST(GOBJECT_LIBS)
   105 
   106 ## Check for gmyth-0.7
   107 PKG_CHECK_MODULES(LIBGMYTH, gmyth >= 0.7, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
   108 
   109 # Give error and exit if we don't have gmyth-0.7
   110 if test "x$HAVE_LIBGMYTH" = "xno"; then
   111   AC_MSG_ERROR([you need gmyth  installed])
   112 fi
   113 
   114 # make LIBXML_CFLAGS and LIBXML_LIBS available
   115 AC_SUBST(LIBGMYTH_CFLAGS)
   116 AC_SUBST(LIBGMYTH_LIBS)
   117 
   118 dnl ========== Check for Cyberlink UPnP Libraries
   119 PKG_CHECK_MODULES(LIBUPNP, libupnp, HAVE_LIBUPNP=yes, HAVE_LIBUPNP=no)
   120 
   121 if test "x$HAVE_LIBUPNP" = "xno"; then
   122   AC_MSG_ERROR([you need libupnp installed])
   123 fi
   124 
   125 AC_SUBST(LIBUPNP_CFLAGS)
   126 AC_SUBST(LIBIPNP_LIBS)
   127 
   128 AC_OUTPUT([
   129 Makefile
   130 src/Makefile
   131 tests/Makefile
   132 gmyth-upnp.pc])
   133 
   134 if test "x$enable_debug" != "xno"; then
   135     AC_MSG_NOTICE([Debug: Enabled])
   136 else
   137     AC_MSG_NOTICE([Debug: Disabled])
   138 fi
   139