]> git.meshlink.io Git - catta/blobdiff - configure.ac
move tests into their own directory
[catta] / configure.ac
index 3f60cd7993c20a77297ae8199b44da09425ede80..f931dd1ac627afb57fe0cf91bb1ab8c08208f61d 100644 (file)
 
 AC_PREREQ(2.63)
 AC_INIT([avahi],[0.6.31],[avahi (at) lists (dot) freedesktop (dot) org])
-AC_CONFIG_SRCDIR([avahi-core/server.c])
+AC_CONFIG_SRCDIR([avahi/server.c])
 AC_CONFIG_MACRO_DIR([common])
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
 
 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
 
-AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:3:5])
-AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [7:2:0])
+AC_SUBST(LIBAVAHI_VERSION_INFO, [7:2:0])
 
 AC_CANONICAL_HOST
 
@@ -44,16 +43,18 @@ AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CC_C99
-AC_PROG_CXX
 AM_PROG_CC_C_O
 AC_USE_SYSTEM_EXTENSIONS
-AC_PROG_CPP
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_PROG_GCC_TRADITIONAL
 
+if test x"$ac_cv_prog_cc_c99" = x"no"; then
+    AC_MSG_ERROR([C99 support is required])
+fi
+
 # -fstack-protector
 AC_ARG_ENABLE([stack-protector],
     [AS_HELP_STRING([--disable-stack-protector],
@@ -145,6 +146,15 @@ AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
 
 AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
 
+if test "x$HAVE_NETLINK" = "xyes" ; then
+    # Test whether rtnetlink.h can be included when compiled with -std=c99
+    # some distributions (e.g. archlinux) have broken headers that dont
+    # define __u64 with -std=c99
+    AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
+    AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
+        [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no])])
+fi
+
 #
 # Check for net/route.h
 #
@@ -228,7 +238,7 @@ AC_TRY_COMPILE([#include <netinet/in.h>], [
 ])
 
 test_gcc_flag() {
-    AC_LANG_CONFTEST([int main() {}])
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[int main() {}]])])
     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
     ret=$?
     rm -f conftest.o
@@ -240,28 +250,6 @@ if test "x$GCC" = "xyes" ; then
 
     DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing"
 
-    if test "x$HAVE_NETLINK" = "xyes" ; then
-        # Test whether rtnetlink.h can be included when compiled with -std=c99
-        # some distributions (e.g. archlinux) have broken headers that dont
-        # define __u64 with -std=c99
-        AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
-        OLDCFLAGS="$CFLAGS"
-        CFLAGS="-std=c99"
-        AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
-            use_stdc99=yes, use_stdc99=no)
-
-        if test x"$use_stdc99" = xyes; then
-            DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
-            AC_MSG_RESULT([yes])
-        else
-            AC_MSG_RESULT([no])
-        fi
-
-        CFLAGS="$OLDCFLAGS"
-    else
-        DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
-    fi
-
     for flag in $DESIRED_FLAGS ; do
         AC_MSG_CHECKING([whether $CC accepts $flag])
         if test_gcc_flag $flag ; then
@@ -274,15 +262,7 @@ if test "x$GCC" = "xyes" ; then
 fi
 
 # Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
-AC_HEADER_STDBOOL
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
-AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
 
  # Solaris stuff
  AC_SEARCH_LIBS([inet_ntop],[nsl])
@@ -290,13 +270,8 @@ AC_HEADER_SYS_WAIT
  AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
 
 # Checks for library functions.
-AC_FUNC_MEMCMP
 AC_FUNC_SELECT_ARGTYPES
-# avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
-# whether libc's malloc does too. (Same for realloc.)
-#AC_FUNC_MALLOC
-#AC_FUNC_REALLOC
-AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
+AC_CHECK_FUNCS([gethostname select socket uname strcasecmp gettimeofday strncasecmp strlcpy])
 
 AC_FUNC_CHOWN
 AC_FUNC_STAT
@@ -331,16 +306,6 @@ DX_PDF_FEATURE(OFF)
 DX_PS_FEATURE(OFF)
 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
 
-AC_ARG_ENABLE(core-docs,
-        AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
-[case "${enableval}" in
-  yes) ENABLE_CORE_DOCS=yes ;;
-  no)  ENABLE_CORE_DOCS=no ;;
-  *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
-esac],[ENABLE_CORE_DOCS=no])
-
-AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
-
 #
 # Conditionally compile test and example programs
 #
@@ -358,8 +323,8 @@ AM_CONDITIONAL([ENABLE_TESTS], [test "x$ENABLE_TESTS" = "xyes"])
 # ==========================================================================
 AC_CONFIG_FILES([
 Makefile
-avahi-common/Makefile
-avahi-core/Makefile
+avahi/Makefile
+tests/Makefile
 examples/Makefile
 common/Makefile
 ])
@@ -378,7 +343,5 @@ echo "
 "
 
 echo "\
-    Building libavahi-core              yes
     Building tests:                     ${ENABLE_TESTS}
-    Building avahi-core documentation:  ${ENABLE_CORE_DOCS}
 "