gmyth-upnp/configure.ac
author melunko
Wed Jan 10 17:19:50 2007 +0000 (2007-01-10)
branchtrunk
changeset 251 9f0346db9a46
child 252 0bddbe7eba51
permissions -rw-r--r--
[svn r252] Added gmyth-upnp library
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
melunko@249
     6
AC_INIT([gmyth-upnp],[0.1])
melunko@249
     7
melunko@249
     8
AC_CONFIG_HEADER(config.h)
melunko@249
     9
melunko@249
    10
dnl when going to/from release please set the nano (fourth number) right !
melunko@249
    11
dnl releases only do Wall, SVN and prerelease does Werror too
melunko@249
    12
AS_VERSION(gmyth-upnp, GMYTH_UPNP, 0, 1, 0, 3, GMYTH_UPNP_SVN="no", GMYTH_UPNP_SVN="yes")
melunko@249
    13
GMYTH_UPNP_MAJORMINOR=$GMYTH_UPNP_MAJOR_VERSION.$GMYTH_UPNP_MINOR_VERSION
melunko@249
    14
AC_SUBST(GMYTH_UPNP_MAJORMINOR)
melunko@249
    15
melunko@249
    16
dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
melunko@249
    17
AM_MAINTAINER_MODE
melunko@249
    18
dnl make aclocal work in maintainer mode
melunko@249
    19
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
melunko@249
    20
melunko@249
    21
# Checks for programs.
melunko@249
    22
# check for tools
melunko@249
    23
# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
melunko@249
    24
CFLAGS="$CFLAGS -Wall"
melunko@249
    25
AC_PROG_CC
melunko@249
    26
AC_PROG_LIBTOOL
melunko@249
    27
melunko@249
    28
dnl Generate doxygen documentation
melunko@249
    29
DX_HTML_FEATURE(ON)
melunko@249
    30
DX_CHM_FEATURE(OFF)
melunko@249
    31
DX_CHI_FEATURE(OFF)
melunko@249
    32
DX_MAN_FEATURE(OFF)
melunko@249
    33
DX_RTF_FEATURE(OFF)
melunko@249
    34
DX_XML_FEATURE(OFF)
melunko@249
    35
DX_PDF_FEATURE(OFF)
melunko@249
    36
DX_PS_FEATURE(OFF)
melunko@249
    37
DX_INIT_DOXYGEN(gmyth, doxygen.cfg, docs)
melunko@249
    38
melunko@249
    39
# Checks for libraries.
melunko@249
    40
melunko@249
    41
## Check for gmyth-0.1
melunko@249
    42
PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
melunko@249
    43
melunko@249
    44
# Give error and exit if we don't have gmyth-0.1
melunko@249
    45
if test "x$HAVE_LIBGMYTH" = "xno"; then
melunko@249
    46
  AC_MSG_ERROR(you need gmyth-0.1 installed)
melunko@249
    47
fi
melunko@249
    48
melunko@249
    49
# make LIBXML_CFLAGS and LIBXML_LIBS available
melunko@249
    50
AC_SUBST(LIBGMYTH_CFLAGS)
melunko@249
    51
AC_SUBST(LIBGMYTH_LIBS)
melunko@249
    52
melunko@249
    53
dnl ========== Check for Cyberlink UPnP Libraries
melunko@249
    54
PKG_CHECK_MODULES(CYBERLINK, clinkc,
melunko@249
    55
          HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no)
melunko@249
    56
melunko@249
    57
if test "x$HAVE_CYBERLINK" = "xno"; then
melunko@249
    58
  AC_MSG_ERROR(you need clinkc installed)
melunko@249
    59
melunko@249
    60
dnl make CYBERLINK_CFLAGS and CYBERLINK_LIBS available
melunko@249
    61
AC_SUBST(CYBERLINK_CFLAGS)
melunko@249
    62
AC_SUBST(CYBERLINK_LIBS)
melunko@249
    63
melunko@249
    64
# Checks for header files.
melunko@249
    65
AC_HEADER_STDC
melunko@249
    66
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
melunko@249
    67
melunko@249
    68
# Checks for typedefs, structures, and compiler characteristics.
melunko@249
    69
AC_C_CONST
melunko@249
    70
AC_TYPE_PID_T
melunko@249
    71
AC_STRUCT_TM
melunko@249
    72
AC_HEADER_TIME
melunko@249
    73
AC_HEADER_STDBOOL
melunko@249
    74
melunko@249
    75
# Checks for library functions.
melunko@249
    76
AC_FUNC_FORK
melunko@249
    77
AC_FUNC_STRFTIME
melunko@249
    78
AC_FUNC_SELECT_ARGTYPES
melunko@249
    79
AC_PROG_GCC_TRADITIONAL
melunko@249
    80
AC_FUNC_MALLOC
melunko@249
    81
AC_FUNC_MKTIME
melunko@249
    82
AC_FUNC_STRFTIME
melunko@249
    83
AC_FUNC_VPRINTF
melunko@249
    84
AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
melunko@249
    85
melunko@249
    86
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
melunko@249
    87
melunko@249
    88
CFLAGS="$CFLAGS -I/usr/include"
melunko@249
    89
LDFLAGS="$LDFLAGS -L/usr/lib"
melunko@249
    90
melunko@249
    91
# Checks required packages
melunko@249
    92
melunko@249
    93
dnl Test if --disable-debug given
melunko@249
    94
AC_ARG_ENABLE(debug,
melunko@249
    95
	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
melunko@249
    96
if test x"$enable_debug" != xno; then
melunko@249
    97
    CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
melunko@249
    98
else
melunko@249
    99
    CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
melunko@249
   100
fi          
melunko@249
   101
melunko@249
   102
# Check for pkgconfig
melunko@249
   103
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
melunko@249
   104
# Give error and exit if we don't have pkgconfig
melunko@249
   105
if test "x$HAVE_PKGCONFIG" = "xno"; then
melunko@249
   106
  AC_MSG_ERROR(you need to have pkgconfig installed !)
melunko@249
   107
fi
melunko@249
   108
melunko@249
   109
# Check for Glib2.0
melunko@249
   110
PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
melunko@249
   111
melunko@249
   112
# Give error and exit if we don't have glib
melunko@249
   113
if test "x$HAVE_GLIB" = "xno"; then
melunko@249
   114
  AC_MSG_ERROR(you need glib-2.0 installed)
melunko@249
   115
fi
melunko@249
   116
melunko@249
   117
# make GLIB_CFLAGS and GLIB_LIBS available
melunko@249
   118
AC_SUBST(GLIB_CFLAGS)
melunko@249
   119
AC_SUBST(GLIB_LIBS)
melunko@249
   120
melunko@249
   121
# Check for GObject2.0
melunko@249
   122
PKG_CHECK_MODULES(GOBJECT,
melunko@249
   123
  gobject-2.0,
melunko@249
   124
  HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
melunko@249
   125
melunko@249
   126
# Give error and exit if we don't have gobject
melunko@249
   127
if test "x$HAVE_GOBJECT" = "xno"; then
melunko@249
   128
  AC_MSG_ERROR(you need gobject-2.0 installed)
melunko@249
   129
fi
melunko@249
   130
melunko@249
   131
# make GOBJECT_CFLAGS and GOBJECT_LIBS available
melunko@249
   132
AC_SUBST(GOBJECT_CFLAGS)
melunko@249
   133
AC_SUBST(GOBJECT_LIBS)
melunko@249
   134
melunko@249
   135
##############################
melunko@249
   136
# Checks for Network functions
melunko@249
   137
##############################
melunko@249
   138
melunko@249
   139
AC_CHECK_FUNCS([socket])
melunko@249
   140
AC_CHECK_FUNCS([inet_ntoa])
melunko@249
   141
AC_CHECK_HEADERS([ifaddrs.h])
melunko@249
   142
AC_CHECK_FUNCS([getifaddrs])
melunko@249
   143
AC_CHECK_FUNCS([time])
melunko@249
   144
melunko@249
   145
#dnl Enable gtk-doc
melunko@249
   146
#GTK_DOC_CHECK(1.4)
melunko@249
   147
melunko@249
   148
AC_SUBST(CFLAGS)
melunko@249
   149
AC_SUBST(LDFLAGS)
melunko@249
   150
AC_SUBST(LIBS)
melunko@249
   151
melunko@249
   152
AC_OUTPUT([
melunko@249
   153
Makefile
melunko@249
   154
src/Makefile
melunko@249
   155
tests/Makefile
melunko@249
   156
gmyth.pc])
melunko@249
   157
melunko@249
   158
if test x"$enable_debug" != xno; then
melunko@249
   159
    AC_MSG_NOTICE([Debug: Enabled])
melunko@249
   160
else
melunko@249
   161
    AC_MSG_NOTICE([Debug: Disabled])
melunko@249
   162
fi          
melunko@249
   163