gmyth-upnp/configure.ac
author renatofilho
Tue Jan 30 22:04:04 2007 +0000 (2007-01-30)
branchtrunk
changeset 315 03b31601f9ca
parent 252 0bddbe7eba51
child 909 847da7267234
permissions -rw-r--r--
[svn r316] - fixed msg log;
     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.1])
     7 
     8 AC_CONFIG_SRCDIR([src/gmyth_upnp.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-upnp, GMYTH_UPNP, 0, 1, 0, 3, GMYTH_UPNP_SVN="no", GMYTH_UPNP_SVN="yes")
    14 GMYTH_UPNP_MAJORMINOR=$GMYTH_UPNP_MAJOR_VERSION.$GMYTH_UPNP_MINOR_VERSION
    15 AC_SUBST(GMYTH_UPNP_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-upnp, doxygen.cfg, docs)
    39 
    40 # Checks for libraries.
    41 
    42 # Check for pkgconfig
    43 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    44 # Give error and exit if we don't have pkgconfig
    45 if test "x$HAVE_PKGCONFIG" = "xno"; then
    46   AC_MSG_ERROR(you need to have pkgconfig installed !)
    47 fi
    48 
    49 # Checks for header files.
    50 AC_HEADER_STDC
    51 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
    52 
    53 # Checks for typedefs, structures, and compiler characteristics.
    54 AC_C_CONST
    55 AC_TYPE_PID_T
    56 AC_STRUCT_TM
    57 AC_HEADER_TIME
    58 AC_HEADER_STDBOOL
    59 
    60 # Checks for library functions.
    61 AC_FUNC_FORK
    62 AC_FUNC_STRFTIME
    63 AC_FUNC_SELECT_ARGTYPES
    64 AC_PROG_GCC_TRADITIONAL
    65 AC_FUNC_MALLOC
    66 AC_FUNC_MKTIME
    67 AC_FUNC_STRFTIME
    68 AC_FUNC_VPRINTF
    69 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
    70 
    71 ##############################
    72 # Checks for Network functions
    73 ##############################
    74 
    75 AC_CHECK_FUNCS([socket])
    76 AC_CHECK_FUNCS([inet_ntoa])
    77 AC_CHECK_HEADERS([ifaddrs.h])
    78 AC_CHECK_FUNCS([getifaddrs])
    79 AC_CHECK_FUNCS([time])
    80 
    81 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    82 
    83 CFLAGS="$CFLAGS -I/usr/include"
    84 LDFLAGS="$LDFLAGS -L/usr/lib"
    85 
    86 # Checks required packages
    87 
    88 dnl Test if --disable-debug given
    89 AC_ARG_ENABLE(debug,
    90 	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    91 if test x"$enable_debug" != xno; then
    92     CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
    93 else
    94     CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    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 gmyth-0.1
   124 PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
   125 
   126 # Give error and exit if we don't have gmyth-0.1
   127 if test "x$HAVE_LIBGMYTH" = "xno"; then
   128   AC_MSG_ERROR([you need gmyth-0.1 installed])
   129 fi
   130 
   131 # make LIBXML_CFLAGS and LIBXML_LIBS available
   132 AC_SUBST(LIBGMYTH_CFLAGS)
   133 AC_SUBST(LIBGMYTH_LIBS)
   134 
   135 dnl ========== Check for Cyberlink UPnP Libraries
   136 PKG_CHECK_MODULES(CYBERLINK, clinkc,
   137           HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no)
   138 
   139 if test "x$HAVE_CYBERLINK" = "xno"; then
   140   AC_MSG_ERROR([you need clinkc installed])
   141 fi
   142 
   143 dnl make CYBERLINK_CFLAGS and CYBERLINK_LIBS available
   144 AC_SUBST(CYBERLINK_CFLAGS)
   145 AC_SUBST(CYBERLINK_LIBS)
   146 
   147 #dnl Enable gtk-doc
   148 #GTK_DOC_CHECK(1.4)
   149 
   150 AC_OUTPUT([
   151 Makefile
   152 src/Makefile
   153 gmyth-upnp.pc])
   154 
   155 if test "x$enable_debug" != "xno"; then
   156     AC_MSG_NOTICE([Debug: Enabled])
   157 else
   158     AC_MSG_NOTICE([Debug: Disabled])
   159 fi          
   160