melunko@249: # -*- Autoconf -*- melunko@249: # Process this file with autoconf to produce a configure script. melunko@249: melunko@249: AC_PREREQ(2.50) melunko@249: melunko@249: AC_INIT([gmyth-upnp],[0.1]) melunko@249: melunko@249: AC_CONFIG_HEADER(config.h) melunko@249: melunko@249: dnl when going to/from release please set the nano (fourth number) right ! melunko@249: dnl releases only do Wall, SVN and prerelease does Werror too melunko@249: AS_VERSION(gmyth-upnp, GMYTH_UPNP, 0, 1, 0, 3, GMYTH_UPNP_SVN="no", GMYTH_UPNP_SVN="yes") melunko@249: GMYTH_UPNP_MAJORMINOR=$GMYTH_UPNP_MAJOR_VERSION.$GMYTH_UPNP_MINOR_VERSION melunko@249: AC_SUBST(GMYTH_UPNP_MAJORMINOR) melunko@249: melunko@249: dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode melunko@249: AM_MAINTAINER_MODE melunko@249: dnl make aclocal work in maintainer mode melunko@249: AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") melunko@249: melunko@249: # Checks for programs. melunko@249: # check for tools melunko@249: # Make sure CFLAGS is defined to stop AC_PROC_CC adding -g melunko@249: CFLAGS="$CFLAGS -Wall" melunko@249: AC_PROG_CC melunko@249: AC_PROG_LIBTOOL melunko@249: melunko@249: dnl Generate doxygen documentation melunko@249: DX_HTML_FEATURE(ON) melunko@249: DX_CHM_FEATURE(OFF) melunko@249: DX_CHI_FEATURE(OFF) melunko@249: DX_MAN_FEATURE(OFF) melunko@249: DX_RTF_FEATURE(OFF) melunko@249: DX_XML_FEATURE(OFF) melunko@249: DX_PDF_FEATURE(OFF) melunko@249: DX_PS_FEATURE(OFF) rosfran@252: DX_INIT_DOXYGEN(gmyth-upnp, doxygen.cfg, docs) melunko@249: melunko@249: # Checks for libraries. melunko@249: rosfran@252: # Check for pkgconfig rosfran@252: AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) rosfran@252: # Give error and exit if we don't have pkgconfig rosfran@252: if test "x$HAVE_PKGCONFIG" = "xno"; then rosfran@252: AC_MSG_ERROR(you need to have pkgconfig installed !) melunko@249: fi melunko@249: melunko@249: # Checks for header files. melunko@249: AC_HEADER_STDC melunko@249: AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) melunko@249: melunko@249: # Checks for typedefs, structures, and compiler characteristics. melunko@249: AC_C_CONST melunko@249: AC_TYPE_PID_T melunko@249: AC_STRUCT_TM melunko@249: AC_HEADER_TIME melunko@249: AC_HEADER_STDBOOL melunko@249: melunko@249: # Checks for library functions. melunko@249: AC_FUNC_FORK melunko@249: AC_FUNC_STRFTIME melunko@249: AC_FUNC_SELECT_ARGTYPES melunko@249: AC_PROG_GCC_TRADITIONAL melunko@249: AC_FUNC_MALLOC melunko@249: AC_FUNC_MKTIME melunko@249: AC_FUNC_STRFTIME melunko@249: AC_FUNC_VPRINTF melunko@249: AC_CHECK_FUNCS([memset socket stime strstr strtoul gethostname inet_ntoa localtime_r select strrchr localtime strptime]) melunko@249: rosfran@252: ############################## rosfran@252: # Checks for Network functions rosfran@252: ############################## rosfran@252: rosfran@252: AC_CHECK_FUNCS([socket]) rosfran@252: AC_CHECK_FUNCS([inet_ntoa]) rosfran@252: AC_CHECK_HEADERS([ifaddrs.h]) rosfran@252: AC_CHECK_FUNCS([getifaddrs]) rosfran@252: AC_CHECK_FUNCS([time]) rosfran@252: melunko@249: AM_INIT_AUTOMAKE($PACKAGE, $VERSION) melunko@249: melunko@249: CFLAGS="$CFLAGS -I/usr/include" melunko@249: LDFLAGS="$LDFLAGS -L/usr/lib" melunko@249: melunko@249: # Checks required packages melunko@249: melunko@249: dnl Test if --disable-debug given melunko@249: AC_ARG_ENABLE(debug, melunko@249: AC_HELP_STRING([--disable-debug], [enable debugging mode])) melunko@249: if test x"$enable_debug" != xno; then melunko@249: CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG" melunko@249: else melunko@249: CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS" rosfran@252: fi melunko@249: melunko@249: # Check for Glib2.0 melunko@249: PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no) melunko@249: melunko@249: # Give error and exit if we don't have glib melunko@249: if test "x$HAVE_GLIB" = "xno"; then melunko@249: AC_MSG_ERROR(you need glib-2.0 installed) melunko@249: fi melunko@249: melunko@249: # make GLIB_CFLAGS and GLIB_LIBS available melunko@249: AC_SUBST(GLIB_CFLAGS) melunko@249: AC_SUBST(GLIB_LIBS) melunko@249: melunko@249: # Check for GObject2.0 melunko@249: PKG_CHECK_MODULES(GOBJECT, melunko@249: gobject-2.0, melunko@249: HAVE_GOBJECT=yes, HAVE_GOBJECT=no) melunko@249: melunko@249: # Give error and exit if we don't have gobject melunko@249: if test "x$HAVE_GOBJECT" = "xno"; then melunko@249: AC_MSG_ERROR(you need gobject-2.0 installed) melunko@249: fi melunko@249: melunko@249: # make GOBJECT_CFLAGS and GOBJECT_LIBS available melunko@249: AC_SUBST(GOBJECT_CFLAGS) melunko@249: AC_SUBST(GOBJECT_LIBS) melunko@249: rosfran@252: ## Check for gmyth-0.1 rosfran@252: PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no) melunko@249: rosfran@252: # Give error and exit if we don't have gmyth-0.1 rosfran@252: if test "x$HAVE_LIBGMYTH" = "xno"; then rosfran@252: AC_MSG_ERROR([you need gmyth-0.1 installed]) rosfran@252: fi rosfran@252: rosfran@252: # make LIBXML_CFLAGS and LIBXML_LIBS available rosfran@252: AC_SUBST(LIBGMYTH_CFLAGS) rosfran@252: AC_SUBST(LIBGMYTH_LIBS) rosfran@252: rosfran@252: dnl ========== Check for Cyberlink UPnP Libraries rosfran@252: PKG_CHECK_MODULES(CYBERLINK, clinkc, rosfran@252: HAVE_CYBERLINK=yes, HAVE_CYBERLINK=no) rosfran@252: rosfran@252: if test "x$HAVE_CYBERLINK" = "xno"; then rosfran@252: AC_MSG_ERROR([you need clinkc installed]) rosfran@252: fi rosfran@252: rosfran@252: dnl make CYBERLINK_CFLAGS and CYBERLINK_LIBS available rosfran@252: AC_SUBST(CYBERLINK_CFLAGS) rosfran@252: AC_SUBST(CYBERLINK_LIBS) melunko@249: melunko@249: #dnl Enable gtk-doc melunko@249: #GTK_DOC_CHECK(1.4) melunko@249: melunko@249: AC_OUTPUT([ melunko@249: Makefile melunko@249: src/Makefile rosfran@252: gmyth-upnp.pc]) melunko@249: rosfran@252: if test "x$enable_debug" != "xno"; then melunko@249: AC_MSG_NOTICE([Debug: Enabled]) melunko@249: else melunko@249: AC_MSG_NOTICE([Debug: Disabled]) melunko@249: fi melunko@249: