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