]> git.meshlink.io Git - catta/blobdiff - configure.ac
fPIC fix
[catta] / configure.ac
index 798574a96fb5bb38627fa9e177c6434ad7a9dd9e..cc66f6d0b8d9df18a0b111f4e3ea0059993a960c 100644 (file)
@@ -21,7 +21,7 @@
 # USA.
 
 AC_PREREQ(2.57)
-AC_INIT([avahi],[0.1],[avahi (at) lists (dot) freedesktop (dot) org])
+AC_INIT([avahi],[0.2],[avahi (at) lists (dot) freedesktop (dot) org])
 AC_CONFIG_SRCDIR([avahi-core/server.c])
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
@@ -46,6 +46,67 @@ AC_PROG_GCC_TRADITIONAL
 # libtool stuff
 AC_PROG_LIBTOOL
 
+#
+# Detecting the linux distro for specific things like initscripts.
+#
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of debian, archlinux or none]))
+if test "z$with_distro" = "z"; then
+   #AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
+   #AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
+   AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
+   AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
+fi
+with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
+
+if test "z$with_distro" = "z"; then
+   echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
+   exit 1
+else
+case $with_distro in
+   debian|archlinux)
+     ;;
+   *)
+     echo "Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome)"
+     ;;
+esac
+fi
+
+#AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
+#AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
+AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
+AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
+
+
+test_gcc_flag() {
+   AC_LANG_CONFTEST([int main() {}])
+   $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
+   ret=$?
+   rm -f conftest.o
+   return $ret
+}
+
+# If using GCC specify some additional parameters
+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 -Wlarger-than-4000 -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter"
+
+   # Work around a kernel header bug in arch linux where rtnetlink.h
+   # can't be included with -std=c99
+   if test x"$with_distro" != xarchlinux ; then
+       DESIRED_FLAGS="$DESIRED_FLAGS -std=c99"
+   fi
+
+   for flag in $DESIRED_FLAGS ; do
+       AC_MSG_CHECKING([whether $CC accepts $flag])
+       if test_gcc_flag $flag ; then 
+          CFLAGS="$CFLAGS $flag"
+          AC_MSG_RESULT([yes])
+       else
+          AC_MSG_RESULT([no])
+       fi
+   done 
+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])
@@ -68,15 +129,6 @@ AC_FUNC_STAT
 AC_TYPE_MODE_T
 AC_TYPE_PID_T
 
-# If using GCC specify some additional parameters
-if test "x$GCC" = "xyes" ; then
-   CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
-
-   AC_LANG_CONFTEST([int main() {}])
-   $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
-   rm -f conftest.o
-fi
-
 PKG_PROG_PKG_CONFIG
 
 #
@@ -216,39 +268,6 @@ if test "x$HAVE_PYTHON" = "xyes" ; then
 fi
 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
 
-#
-# Detecting the linux distro for specific things like initscripts.
-#
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, or slackware]))
-if test "z$with_distro" = "z"; then
-   AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
-   AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
-   AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
-   AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
-   AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
-   AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
-fi
-with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
-
-if test "z$with_distro" = "z"; then
-   echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
-   exit 1
-else
-case $with_distro in
-   debian|gentoo|suse)
-     ;;
-   *)
-     echo "Your distribution (${with_distro}) is not yet supported, init scripts and dbus configuration will not be installed! (patches welcome)"
-     ;;
-esac
-
-fi
-AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
-AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
-AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
-AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
-AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
-
 #
 # Defining Avahi User and Group.
 #
@@ -307,6 +326,10 @@ if test x$xmltoman = xyes ; then
    AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
 
    if test x$have_xmltoman = xno ; then
+     if ! test -e man/avahi-daemon.8 ; then
+        AC_MSG_ERROR([*** xmltoman was not found, it is required to build the manpages and they have not been pre-built])
+        exit 1
+     fi
      AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
      xmltoman=no
    fi
@@ -325,9 +348,8 @@ avahi-daemon/avahi-dbus.conf
 avahi-discover-standalone/Makefile 
 avahi-client/Makefile 
 initscript/Makefile 
-initscript/Debian/Makefile
-initscript/Gentoo/Makefile
-initscript/SUSE/Makefile
+initscript/debian/Makefile
+initscript/archlinux/Makefile
 avahi-dnsconfd/Makefile
 avahi-utils/Makefile
 avahi-utils/avahi/Makefile