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