X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=configure.ac;h=2d33c793bbdabf6809e9851314464c78830ff8da;hb=15aaf28f0345ed6998ef6eae921c7750c4ce26f9;hp=faea098fbf553fa0cf89f6f229887fd8be721a70;hpb=a4d93bdc07c01f05eb7c39a6fc6fe5c505e2c5fc;p=catta diff --git a/configure.ac b/configure.ac index faea098..2d33c79 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,30 @@ AC_PROG_GCC_TRADITIONAL # libtool stuff AC_PROG_LIBTOOL +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="-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" + + 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]) @@ -61,21 +85,14 @@ AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES 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 strcasecmp gettimeofday]) +AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid strcasecmp gettimeofday putenv]) AC_FUNC_CHOWN 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 # # Check for GLIB 2.0 @@ -89,14 +106,13 @@ AC_ARG_ENABLE(glib, esac], [HAVE_GLIB=yes]) -if test "x$HAVE_GLIB" = "xyes"; then +if test "x$HAVE_GLIB" = "xyes" ; then PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ]) AC_SUBST(GLIB20_CFLAGS) AC_SUBST(GLIB20_LIBS) fi AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes") - # # Check for GTK+ # @@ -109,7 +125,7 @@ AC_ARG_ENABLE(gtk, esac], [HAVE_GTK=yes]) -if test "x$HAVE_GTK" = "xyes"; then +if test "x$HAVE_GTK" = "xyes" ; then # Check for GTK 2.0 PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ]) AC_SUBST(GTK20_CFLAGS) @@ -139,7 +155,7 @@ AC_ARG_ENABLE(dbus, AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=], [where D-BUS system.d directory is])) -if test "x$HAVE_DBUS" = "xyes"; then +if test "x$HAVE_DBUS" = "xyes" ; then AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-BUS or not]) PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.30 ]) @@ -169,7 +185,7 @@ AC_ARG_ENABLE(expat, esac], [HAVE_EXPAT=yes]) -if test "x$HAVE_EXPAT" = "xyes"; then +if test "x$HAVE_EXPAT" = "xyes" ; then AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) if ! $have_expat ; then @@ -190,7 +206,7 @@ AC_ARG_ENABLE(libdaemon, esac], [HAVE_LIBDAEMON=yes]) -if test "x$HAVE_LIBDAEMON" = "xyes"; then +if test "x$HAVE_LIBDAEMON" = "xyes" ; then PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ]) AC_SUBST(LIBDAEMON_CFLAGS) AC_SUBST(LIBDAEMON_LIBS) @@ -208,13 +224,10 @@ AC_ARG_ENABLE(python, *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;; esac],[HAVE_PYTHON=yes]) -if test "y$HAVE_PYTHON" = xyes ; then - AM_PATH_PYTHON(2.4) - - if test "x$HAVE_PYTHON" = xyes ; then - AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module pygtk)]) - AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)]) - fi +if test "x$HAVE_PYTHON" = "xyes" ; then + AM_PATH_PYTHON([2.4]) + AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module pygtk)]) + AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)]) fi AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ]) @@ -328,8 +341,6 @@ avahi-discover-standalone/Makefile avahi-client/Makefile initscript/Makefile initscript/Debian/Makefile -initscript/Gentoo/Makefile -initscript/SUSE/Makefile avahi-dnsconfd/Makefile avahi-utils/Makefile avahi-utils/avahi/Makefile @@ -361,23 +372,31 @@ echo " Group for Avahi: ${AVAHI_GROUP} " -BUILD_DAEMON=no +BUILD_DAEMON="no (!)" if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then BUILD_DAEMON=yes fi -BUILD_UTILS=no +BUILD_UTILS="no (!)" if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" -a "x$HAVE_PYTHON" = "xyes" ; then BUILD_UTILS=yes fi + +BUILD_CLIENT="no (!)" + +if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then + BUILD_CLIENT=yes +fi + echo " - Building avahi-core yes + Building libavahi-core yes Building avahi-daemon: ${BUILD_DAEMON} Building avahi-dnsconfd: ${BUILD_DAEMON} Building avahi-utils: ${BUILD_UTILS} - Building avahi-glib: ${HAVE_GLIB} - Building avahi-discover-standalone ${HAVE_GTK} + Building libavahi-glib: ${HAVE_GLIB} + Building libavahi-client: ${BUILD_CLIENT} + Building avahi-discover-standalone: ${HAVE_GTK} "