[svn r253] Fixes some autotools problems.
2 # Process this file with autoconf to produce a configure script.
6 AC_INIT([gmyth-upnp],[0.1])
8 AC_CONFIG_HEADER(config.h)
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)
16 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
18 dnl make aclocal work in maintainer mode
19 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
21 # Checks for programs.
23 # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
24 CFLAGS="$CFLAGS -Wall"
28 dnl Generate doxygen documentation
37 DX_INIT_DOXYGEN(gmyth-upnp, doxygen.cfg, docs)
39 # Checks for libraries.
42 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
43 # Give error and exit if we don't have pkgconfig
44 if test "x$HAVE_PKGCONFIG" = "xno"; then
45 AC_MSG_ERROR(you need to have pkgconfig installed !)
48 # Checks for header files.
50 AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
52 # Checks for typedefs, structures, and compiler characteristics.
59 # Checks for library functions.
62 AC_FUNC_SELECT_ARGTYPES
63 AC_PROG_GCC_TRADITIONAL
68 AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime])
70 ##############################
71 # Checks for Network functions
72 ##############################
74 AC_CHECK_FUNCS([socket])
75 AC_CHECK_FUNCS([inet_ntoa])
76 AC_CHECK_HEADERS([ifaddrs.h])
77 AC_CHECK_FUNCS([getifaddrs])
78 AC_CHECK_FUNCS([time])
80 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
82 CFLAGS="$CFLAGS -I/usr/include"
83 LDFLAGS="$LDFLAGS -L/usr/lib"
85 # Checks required packages
87 dnl Test if --disable-debug given
89 AC_HELP_STRING([--disable-debug], [enable debugging mode]))
90 if test x"$enable_debug" != xno; then
91 CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG"
93 CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
97 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
99 # Give error and exit if we don't have glib
100 if test "x$HAVE_GLIB" = "xno"; then
101 AC_MSG_ERROR(you need glib-2.0 installed)
104 # make GLIB_CFLAGS and GLIB_LIBS available
105 AC_SUBST(GLIB_CFLAGS)
108 # Check for GObject2.0
109 PKG_CHECK_MODULES(GOBJECT,
111 HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
113 # Give error and exit if we don't have gobject
114 if test "x$HAVE_GOBJECT" = "xno"; then
115 AC_MSG_ERROR(you need gobject-2.0 installed)
118 # make GOBJECT_CFLAGS and GOBJECT_LIBS available
119 AC_SUBST(GOBJECT_CFLAGS)
120 AC_SUBST(GOBJECT_LIBS)
122 ## Check for gmyth-0.1
123 PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
125 # Give error and exit if we don't have gmyth-0.1
126 if test "x$HAVE_LIBGMYTH" = "xno"; then
127 AC_MSG_ERROR([you need gmyth-0.1 installed])
130 # make LIBXML_CFLAGS and LIBXML_LIBS available
131 AC_SUBST(LIBGMYTH_CFLAGS)
132 AC_SUBST(LIBGMYTH_LIBS)
134 dnl ========== Check for Cyberlink UPnP Libraries
135 PKG_CHECK_MODULES(CYBERLINK, clinkc,
136 HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no)
138 if test "x$HAVE_CYBERLINK" = "xno"; then
139 AC_MSG_ERROR([you need clinkc installed])
142 dnl make CYBERLINK_CFLAGS and CYBERLINK_LIBS available
143 AC_SUBST(CYBERLINK_CFLAGS)
144 AC_SUBST(CYBERLINK_LIBS)
154 if test "x$enable_debug" != "xno"; then
155 AC_MSG_NOTICE([Debug: Enabled])
157 AC_MSG_NOTICE([Debug: Disabled])