Code

b4ad76cc2d5e7b338f053ea1d9d2d35454e30747
[fusedav.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 # $Id$
6 # Copyright (c) 2004-2006 Lennart Poettering
7 #
8 # Permission is hereby granted, free of charge, to any person
9 # obtaining a copy of this software and associated documentation files
10 # (the "Software"), to deal in the Software without restriction,
11 # including without limitation the rights to use, copy, modify, merge,
12 # publish, distribute, sublicense, and/or sell copies of the Software,
13 # and to permit persons to whom the Software is furnished to do so,
14 # subject to the following conditions:
15 #
16 # The above copyright notice and this permission notice shall be
17 # included in all copies or substantial portions of the Software.
18 #
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 # SOFTWARE.
28 AC_PREREQ(2.59)
29 AC_INIT([fusedav],[0.2],[mzshfrqni (at) 0pointer (dot) de])
30 AC_CONFIG_SRCDIR([src/fusedav.c])
31 AC_CONFIG_HEADERS([config.h])
32 AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
33 AC_REVISION($Id$)
35 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/fusedav/])
37 if type -p stow > /dev/null && test -d /usr/local/stow ; then
38    AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
39    ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
40 fi
42 AC_GNU_SOURCE
44 # Checks for programs.
45 AC_PROG_CC
46 AC_PROG_CPP
47 AC_PROG_INSTALL
48 AC_PROG_LN_S
49 AC_PROG_MAKE_SET
51 test_gcc_flag() {
52     AC_LANG_CONFTEST([int main() {}])
53     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
54     ret=$?
55     rm -f conftest.o
56     return $ret
57 }
59 # If using GCC specify some additional parameters
60 if test "x$GCC" = "xyes" ; then
62     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 -Winline"
64     if test "x$HAVE_NETLINK" = "xyes" ; then
65         # Test whether rtnetlink.h can be included when compiled with -std=c99
66         # some distributions (e.g. archlinux) have broken headers that dont
67         # define __u64 with -std=c99
68         AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
69         OLDCFLAGS="$CFLAGS"
70         CFLAGS="-std=c99"
71         AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
72             use_stdc99=yes, use_stdc99=no)
74         if test x"$use_stdc99" = xyes; then
75             DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
76             AC_MSG_RESULT([yes])
77         else
78             AC_MSG_RESULT([no])
79         fi
81         CFLAGS="$OLDCFLAGS"
82     else
83         DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
84     fi
86     for flag in $DESIRED_FLAGS ; do
87         AC_MSG_CHECKING([whether $CC accepts $flag])
88         if test_gcc_flag $flag ; then
89            CFLAGS="$CFLAGS $flag"
90            AC_MSG_RESULT([yes])
91         else
92            AC_MSG_RESULT([no])
93         fi
94     done
95 fi
97 # 64 Bit LFS support
98 AC_SYS_LARGEFILE
100 # Checks for header files.
101 AC_HEADER_DIRENT
102 AC_HEADER_STDC
103 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdlib.h string.h sys/statfs.h termios.h unistd.h])
105 # Checks for typedefs, structures, and compiler characteristics.
106 AC_C_CONST
107 AC_TYPE_MODE_T
108 AC_TYPE_OFF_T
109 AC_TYPE_SIZE_T
110 AC_STRUCT_ST_BLOCKS
112 # Checks for library functions.
113 AC_FUNC_MALLOC
114 AC_CHECK_FUNCS([ftruncate memset strdup strerror strrchr memchr strchr strcspn])
116 AC_CHECK_LIB([pthread], [pthread_create])
118 PKG_CHECK_MODULES(NEON, [ neon >= 0.26 ])
119 PKG_CHECK_MODULES(FUSE, [ fuse >= 2.5 ])
121 # LYNX documentation generation
122 AC_ARG_ENABLE(lynx,
123         AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
124 [case "${enableval}" in
125   yes) lynx=yes ;;
126   no)  lynx=no ;;
127   *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
128 esac],[lynx=yes])
130 if test x$lynx = xyes ; then
131    AC_CHECK_PROG(have_lynx, lynx, yes, no)
133    if test x$have_lynx = xno ; then
134      AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
135    fi
136 fi
138 AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
140 AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html])
141 AC_OUTPUT