chiark / gitweb /
nss-myhostname: move to subdirectory
[elogind.git] / src / nss-myhostname / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # This file is part of nss-myhostname.
5 #
6 # Copyright 2008 Lennart Poettering
7 #
8 # nss-myhostname is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public License
10 # as published by the Free Software Foundation, either version 2.1 of
11 # the License, or (at your option) any later version.
12 #
13 # nss-myhostname is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with nss-myhostname. If not, If not, see
20 # <http://www.gnu.org/licenses/>.
21
22 AC_PREREQ(2.62)
23 AC_INIT([nss-myhostname],[0.3],[mzzlubfganzr (at) 0pointer (dot) de])
24 AC_CONFIG_SRCDIR([nss-myhostname.c])
25 AC_CONFIG_HEADERS([config.h])
26 AC_CONFIG_MACRO_DIR(m4)
27 AC_USE_SYSTEM_EXTENSIONS
28 AC_SYS_LARGEFILE
29
30 AM_INIT_AUTOMAKE([foreign 1.9 -Wall -Wno-portability silent-rules tar-pax subdir-objects dist-bzip2])
31
32 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/nss-myhostname/])
33
34 ac_default_prefix="/"
35
36 AC_CANONICAL_HOST
37 case "$host_os" in
38         linux*) legacy=false ;;
39         *)      legacy=true ;;
40 esac
41 AM_CONDITIONAL([LEGACY], [test x$legacy = xtrue])
42
43 # Checks for programs.
44 AC_PROG_CC
45 AC_PROG_CC_C99
46 AC_PROG_CPP
47
48 AC_PROG_INSTALL
49 AC_PROG_LN_S
50 AC_PROG_MAKE_SET
51
52 # GCC flags
53
54 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 -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -ffast-math -fvisibility=hidden -fdiagnostics-show-option"
55
56 for flag in $DESIRED_FLAGS ; do
57   CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
58 done
59
60 # libtool stuff
61 AC_DISABLE_STATIC
62 LT_PREREQ(2.2)
63 LT_INIT
64
65 # Checks for header files.
66 AC_HEADER_STDC
67 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h])
68
69 # Checks for typedefs, structures, and compiler characteristics.
70 AC_C_CONST
71 AC_TYPE_SIZE_T
72 AC_HEADER_TIME
73
74 # Checks for library functions.
75 AC_FUNC_MALLOC
76 AC_FUNC_SELECT_ARGTYPES
77 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
78
79 # LYNX documentation generation
80 ZP_LYNX_DOC
81
82 AC_CONFIG_FILES([Makefile doc/Makefile doc/README.html ])
83
84 AC_OUTPUT