Code

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