]>
Commit | Line | Data |
---|---|---|
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 | ||
21 | AC_PREREQ([2.64]) | |
22 | ||
23 | AC_INIT([network], | |
af91a344 | 24 | [011], |
5ca9dc30 MT |
25 | [info@ipfire.org], |
26 | [network], | |
27 | [http://www.ipfire.org/]) | |
28 | ||
29 | AC_CONFIG_AUX_DIR([build-aux]) | |
30 | ||
31 | AC_PREFIX_DEFAULT([/usr]) | |
32 | ||
33 | AM_INIT_AUTOMAKE([ | |
34 | foreign | |
35 | 1.11 | |
36 | -Wall | |
37 | -Wno-portability | |
38 | silent-rules | |
39 | tar-pax | |
40 | subdir-objects | |
41 | ]) | |
42 | AM_SILENT_RULES([yes]) | |
43 | ||
01f2b2e4 MT |
44 | LT_INIT([ |
45 | disable-static | |
46 | pic-only | |
47 | ]) | |
48 | ||
5ca9dc30 MT |
49 | AC_PROG_LN_S |
50 | AC_PROG_MKDIR_P | |
51 | AC_PROG_SED | |
52 | ||
1908d2b3 | 53 | AC_PATH_PROG([NITSI], [nitsi]) |
c4966dd6 | 54 | AC_PATH_PROG([WGET], [wget]) |
5ca9dc30 MT |
55 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
56 | ||
57 | # pkg-config | |
58 | PKG_PROG_PKG_CONFIG | |
59 | # This makes sure pkg.m4 is available. | |
60 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) | |
61 | ||
e708653f SS |
62 | # C Compiler |
63 | AC_PROG_CC | |
64 | AC_PROG_CC_C99 | |
65 | AC_PROG_CC_C_O | |
66 | AC_PROG_GCC_TRADITIONAL | |
67 | ||
374d06ad MT |
68 | AC_USE_SYSTEM_EXTENSIONS |
69 | ||
e708653f SS |
70 | CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ |
71 | -pipe \ | |
72 | -Wall \ | |
73 | -Wextra \ | |
74 | -Wno-inline \ | |
75 | -Wundef \ | |
76 | "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ | |
77 | -Wno-unused-parameter \ | |
78 | -Wno-unused-result \ | |
79 | -fno-strict-aliasing \ | |
80 | -ffunction-sections \ | |
81 | -fdata-sections \ | |
82 | -fstack-protector-all \ | |
83 | --param=ssp-buffer-size=4]) | |
84 | AC_SUBST([OUR_CFLAGS], $with_cflags) | |
85 | ||
86 | AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*], | |
87 | [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ | |
88 | -Wp,-D_FORTIFY_SOURCE=2])], | |
89 | [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])]) | |
90 | AC_SUBST([OUR_CPPFLAGS], $with_cppflags) | |
91 | ||
92 | CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ | |
93 | -Wl,--as-needed \ | |
94 | -Wl,--no-undefined \ | |
95 | -Wl,--gc-sections \ | |
96 | -Wl,-z,relro \ | |
97 | -Wl,-z,now]) | |
98 | AC_SUBST([OUR_LDFLAGS], $with_ldflags) | |
99 | ||
0e880048 MT |
100 | # ------------------------------------------------------------------------------ |
101 | ||
102 | AC_CHECK_HEADERS_ONCE([ | |
6f4814db | 103 | ctype.h |
0e880048 | 104 | errno.h |
c07b958a | 105 | linux/netlink.h |
d1f1b577 | 106 | net/if.h |
6f4814db MT |
107 | stdarg.h |
108 | stdio.h | |
0e880048 | 109 | stdlib.h |
6f4814db MT |
110 | string.h |
111 | syslog.h | |
112 | ]) | |
113 | ||
114 | AC_CHECK_FUNCS([ \ | |
115 | __secure_getenv \ | |
116 | secure_getenv \ | |
0e880048 MT |
117 | ]) |
118 | ||
e145b2f3 MT |
119 | # ------------------------------------------------------------------------------ |
120 | ||
121 | AC_ARG_ENABLE([debug], | |
122 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), | |
123 | [], [enable_debug=no]) | |
124 | AS_IF([test "x$enable_debug" = "xyes"], [ | |
125 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) | |
126 | ]) | |
127 | ||
dbe28a05 MT |
128 | # ------------------------------------------------------------------------------ |
129 | ||
130 | have_manpages=no | |
131 | AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages], | |
132 | [do not install man pages])) | |
133 | AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes]) | |
134 | AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) | |
135 | ||
063eb4d8 MT |
136 | # ------------------------------------------------------------------------------ |
137 | ||
d5fab986 MT |
138 | AC_ARG_WITH( |
139 | [dbuspolicydir], | |
140 | AS_HELP_STRING( | |
141 | [--with-dbuspolicydir=arg], | |
142 | [directory for D-Bus policies (default: ${dbusdatadir|datarootdir}/dbus-1/system.d)] | |
143 | ), | |
144 | [dbuspolicydir="$withval"], | |
145 | [PKG_CHECK_VAR([dbusdatadir], [dbus-1], [datadir],, [dbusdatadir="${datarootdir}"]) | |
146 | dbuspolicydir="${dbusdatadir}/dbus-1/system.d"] | |
147 | ) | |
148 | AC_SUBST(dbuspolicydir) | |
149 | ||
9ca8914e MT |
150 | AC_ARG_WITH( |
151 | [dbussystembusdir], | |
152 | AS_HELP_STRING( | |
153 | [--with-dbussystembusdir=arg], | |
154 | [path to D-Bus system bus services directory] | |
155 | ), | |
156 | [dbussystembusdir="$withval"], | |
157 | [PKG_CHECK_VAR([dbussystembusdir], [dbus-1], [system_bus_services_dir],, [dbussystembusdir="${datarootdir}"])] | |
158 | ) | |
159 | AC_SUBST(dbuspolicydir) | |
063eb4d8 | 160 | |
5ca9dc30 MT |
161 | # ------------------------------------------------------------------------------ |
162 | AC_ARG_WITH([systemdsystemunitdir], | |
163 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), | |
164 | [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) | |
165 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) | |
166 | AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) | |
167 | ||
168 | # ------------------------------------------------------------------------------ | |
169 | AC_ARG_WITH([udevdir], | |
170 | AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]), | |
171 | [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)]) | |
172 | AC_SUBST([udevdir], [$with_udevdir]) | |
173 | AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"]) | |
174 | ||
175 | # ------------------------------------------------------------------------------ | |
db0a2d76 MT |
176 | |
177 | PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0]) | |
ed993fc9 | 178 | PKG_CHECK_MODULES([SYSTEMD], [libsystemd]) |
db0a2d76 MT |
179 | |
180 | # ------------------------------------------------------------------------------ | |
181 | ||
57496df2 | 182 | AC_CHECK_PROGS(ASCIIDOC, [asciidoc]) |
dbe28a05 | 183 | if test "${have_manpages}" = "yes" && test -z "${ASCIIDOC}"; then |
9665b796 MT |
184 | AC_MSG_ERROR([Required program 'asciidoc' not found]) |
185 | fi | |
57496df2 MT |
186 | |
187 | # ------------------------------------------------------------------------------ | |
188 | ||
01f2b2e4 | 189 | AC_CONFIG_HEADERS(config.h) |
5ca9dc30 MT |
190 | AC_CONFIG_FILES([ |
191 | Makefile | |
192 | ]) | |
193 | ||
194 | AC_OUTPUT | |
195 | AC_MSG_RESULT([ | |
196 | $PACKAGE_NAME $VERSION | |
197 | ||
e708653f SS |
198 | CFLAGS: ${OUR_CFLAGS} ${CFLAGS} |
199 | CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} | |
200 | LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} | |
201 | ||
5ca9dc30 MT |
202 | prefix: $prefix |
203 | ||
9ca8914e | 204 | dbuspolicydir: ${dbuspolicydir} |
063eb4d8 | 205 | dbussystembusdir: ${dbussystembusdir} |
5ca9dc30 MT |
206 | systemdsystemunitdir: $systemdsystemunitdir |
207 | udevdir: $udevdir | |
dbe28a05 MT |
208 | |
209 | Generate man-pages: ${have_manpages} | |
5ca9dc30 | 210 | ]) |