]> git.ipfire.org Git - people/stevee/network.git/blame - configure.ac
Replace ipcalc by inetcalc
[people/stevee/network.git] / configure.ac
CommitLineData
5ca9dc30
MT
1###############################################################################
2# #
3# Pakfire - The IPFire package management system #
4# Copyright (C) 2013 IPFire Network Development Team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21AC_PREREQ([2.64])
22
23AC_INIT([network],
24 [006],
25 [info@ipfire.org],
26 [network],
27 [http://www.ipfire.org/])
28
29AC_CONFIG_AUX_DIR([build-aux])
30
31AC_PREFIX_DEFAULT([/usr])
32
33AM_INIT_AUTOMAKE([
34 foreign
35 1.11
36 -Wall
37 -Wno-portability
38 silent-rules
39 tar-pax
40 subdir-objects
41])
42AM_SILENT_RULES([yes])
43
44AC_PROG_LN_S
45AC_PROG_MKDIR_P
46AC_PROG_SED
47
48AC_PATH_PROG([XSLTPROC], [xsltproc])
49
50# pkg-config
51PKG_PROG_PKG_CONFIG
52# This makes sure pkg.m4 is available.
53m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
54
e708653f
SS
55# C Compiler
56AC_PROG_CC
57AC_PROG_CC_C99
58AC_PROG_CC_C_O
59AC_PROG_GCC_TRADITIONAL
60
61CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
62 -pipe \
63 -Wall \
64 -Wextra \
65 -Wno-inline \
66 -Wundef \
67 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
68 -Wno-unused-parameter \
69 -Wno-unused-result \
70 -fno-strict-aliasing \
71 -ffunction-sections \
72 -fdata-sections \
73 -fstack-protector-all \
74 --param=ssp-buffer-size=4])
75AC_SUBST([OUR_CFLAGS], $with_cflags)
76
77AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*],
78 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
79 -Wp,-D_FORTIFY_SOURCE=2])],
80 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
81AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
82
83CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
84 -Wl,--as-needed \
85 -Wl,--no-undefined \
86 -Wl,--gc-sections \
87 -Wl,-z,relro \
88 -Wl,-z,now])
89AC_SUBST([OUR_LDFLAGS], $with_ldflags)
90
5ca9dc30
MT
91# ------------------------------------------------------------------------------
92AC_ARG_WITH([systemdsystemunitdir],
93 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
94 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
95AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
96AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
97
98# ------------------------------------------------------------------------------
99AC_ARG_WITH([udevdir],
100 AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]),
101 [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)])
102AC_SUBST([udevdir], [$with_udevdir])
103AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"])
104
105# ------------------------------------------------------------------------------
106AC_CONFIG_FILES([
107 Makefile
108])
109
110AC_OUTPUT
111AC_MSG_RESULT([
112 $PACKAGE_NAME $VERSION
113
e708653f
SS
114 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
115 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
116 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
117
5ca9dc30
MT
118 prefix: $prefix
119
120 systemdsystemunitdir: $systemdsystemunitdir
121 udevdir: $udevdir
122])