summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2005-08-23 08:16:13 +0000
committerTrent Lloyd <lathiat@bur.st>2005-08-23 08:16:13 +0000
commitda5014cb5f3d06271ae79dc28354a03c7392cf0f (patch)
tree92272d80b4f9ca728fafe5677982846a99a537af /configure.ac
parent83c0bc0c4f8701e71d34896472810d0f5c73fbe5 (diff)
* Clean up init script handling stuff
* Add archlinux support git-svn-id: file:///home/lennart/svn/public/avahi/trunk@406 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac72
1 files changed, 38 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index 9feaea6..8cb6f2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,37 @@ 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-version,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|arch)
+ ;;
+ *)
+ 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
@@ -57,7 +88,13 @@ test_gcc_flag() {
# If using GCC specify some additional parameters
if test "x$GCC" = "xyes" ; then
- DESIRED_FLAGS="-std=c99 -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"
+ 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])
@@ -232,39 +269,6 @@ 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, slackware or none]))
-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.
#
AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running the Avahi daemon (avahi)]))