]>
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 | ||
a465e68b MT |
31 | AC_USE_SYSTEM_EXTENSIONS |
32 | AC_SYS_LARGEFILE | |
5ca9dc30 MT |
33 | AC_PREFIX_DEFAULT([/usr]) |
34 | ||
35 | AM_INIT_AUTOMAKE([ | |
36 | foreign | |
37 | 1.11 | |
38 | -Wall | |
39 | -Wno-portability | |
40 | silent-rules | |
41 | tar-pax | |
42 | subdir-objects | |
43 | ]) | |
44 | AM_SILENT_RULES([yes]) | |
45 | ||
01f2b2e4 MT |
46 | LT_INIT([ |
47 | disable-static | |
48 | pic-only | |
49 | ]) | |
50 | ||
5ca9dc30 MT |
51 | AC_PROG_LN_S |
52 | AC_PROG_MKDIR_P | |
53 | AC_PROG_SED | |
54 | ||
1908d2b3 | 55 | AC_PATH_PROG([NITSI], [nitsi]) |
c4966dd6 | 56 | AC_PATH_PROG([WGET], [wget]) |
5ca9dc30 MT |
57 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
58 | ||
59 | # pkg-config | |
60 | PKG_PROG_PKG_CONFIG | |
61 | # This makes sure pkg.m4 is available. | |
62 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) | |
63 | ||
e708653f SS |
64 | # C Compiler |
65 | AC_PROG_CC | |
66 | AC_PROG_CC_C99 | |
67 | AC_PROG_CC_C_O | |
68 | AC_PROG_GCC_TRADITIONAL | |
69 | ||
70 | CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ | |
e708653f | 71 | -Wall \ |
a465e68b MT |
72 | -Wchar-subscripts \ |
73 | -Wformat-security \ | |
74 | -Wmissing-declarations \ | |
75 | -Wmissing-prototypes \ | |
76 | -Wnested-externs \ | |
77 | -Wpointer-arith \ | |
78 | -Wshadow \ | |
79 | -Wsign-compare \ | |
80 | -Wstrict-prototypes \ | |
81 | -Wtype-limits \ | |
82 | ]) | |
e708653f | 83 | |
a465e68b | 84 | AC_SUBST([OUR_CFLAGS], $with_cflags) |
e708653f | 85 | |
0e880048 MT |
86 | # ------------------------------------------------------------------------------ |
87 | ||
88 | AC_CHECK_HEADERS_ONCE([ | |
6f4814db | 89 | ctype.h |
0e880048 | 90 | errno.h |
c07b958a | 91 | linux/netlink.h |
d1f1b577 | 92 | net/if.h |
6f4814db MT |
93 | stdarg.h |
94 | stdio.h | |
0e880048 | 95 | stdlib.h |
6f4814db MT |
96 | string.h |
97 | syslog.h | |
98 | ]) | |
99 | ||
100 | AC_CHECK_FUNCS([ \ | |
101 | __secure_getenv \ | |
102 | secure_getenv \ | |
0e880048 MT |
103 | ]) |
104 | ||
e145b2f3 MT |
105 | # ------------------------------------------------------------------------------ |
106 | ||
107 | AC_ARG_ENABLE([debug], | |
108 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), | |
109 | [], [enable_debug=no]) | |
110 | AS_IF([test "x$enable_debug" = "xyes"], [ | |
111 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) | |
112 | ]) | |
113 | ||
dbe28a05 MT |
114 | # ------------------------------------------------------------------------------ |
115 | ||
116 | have_manpages=no | |
117 | AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages], | |
118 | [do not install man pages])) | |
119 | AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes]) | |
120 | AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) | |
121 | ||
063eb4d8 MT |
122 | # ------------------------------------------------------------------------------ |
123 | ||
d5fab986 MT |
124 | AC_ARG_WITH( |
125 | [dbuspolicydir], | |
126 | AS_HELP_STRING( | |
127 | [--with-dbuspolicydir=arg], | |
128 | [directory for D-Bus policies (default: ${dbusdatadir|datarootdir}/dbus-1/system.d)] | |
129 | ), | |
130 | [dbuspolicydir="$withval"], | |
131 | [PKG_CHECK_VAR([dbusdatadir], [dbus-1], [datadir],, [dbusdatadir="${datarootdir}"]) | |
132 | dbuspolicydir="${dbusdatadir}/dbus-1/system.d"] | |
133 | ) | |
134 | AC_SUBST(dbuspolicydir) | |
135 | ||
9ca8914e MT |
136 | AC_ARG_WITH( |
137 | [dbussystembusdir], | |
138 | AS_HELP_STRING( | |
139 | [--with-dbussystembusdir=arg], | |
140 | [path to D-Bus system bus services directory] | |
141 | ), | |
142 | [dbussystembusdir="$withval"], | |
143 | [PKG_CHECK_VAR([dbussystembusdir], [dbus-1], [system_bus_services_dir],, [dbussystembusdir="${datarootdir}"])] | |
144 | ) | |
145 | AC_SUBST(dbuspolicydir) | |
063eb4d8 | 146 | |
bf98bd65 MT |
147 | AC_ARG_WITH( |
148 | [polkitpolicydir], | |
149 | AS_HELP_STRING( | |
150 | [--with-polkitpolicydir=arg], | |
151 | [directory for PolicyKit policies] | |
152 | ), | |
153 | [polkitpolicydir="$withval"], | |
154 | [PKG_CHECK_VAR([polkitpolicydir], [polkit], [actiondir]) | |
155 | polkitpolicydir="${datadir}/polkit-1/actions"] | |
156 | ) | |
157 | AC_SUBST(polkitpolicydir) | |
158 | ||
5ca9dc30 MT |
159 | # ------------------------------------------------------------------------------ |
160 | AC_ARG_WITH([systemdsystemunitdir], | |
161 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), | |
162 | [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) | |
163 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) | |
164 | AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) | |
165 | ||
166 | # ------------------------------------------------------------------------------ | |
167 | AC_ARG_WITH([udevdir], | |
168 | AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]), | |
169 | [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)]) | |
170 | AC_SUBST([udevdir], [$with_udevdir]) | |
171 | AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"]) | |
172 | ||
173 | # ------------------------------------------------------------------------------ | |
db0a2d76 | 174 | |
dabf344d | 175 | PKG_CHECK_MODULES([CAP], [libcap]) |
6384cfdf | 176 | PKG_CHECK_MODULES([JSON_C], [json-c]) |
db0a2d76 | 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} |
bf98bd65 | 206 | polkitpolicydir: ${polkitpolicydir} |
5ca9dc30 MT |
207 | systemdsystemunitdir: $systemdsystemunitdir |
208 | udevdir: $udevdir | |
dbe28a05 MT |
209 | |
210 | Generate man-pages: ${have_manpages} | |
5ca9dc30 | 211 | ]) |