]>
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], | |
ccc9e6fd | 24 | [009], |
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 | ||
53 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
54 | ||
55 | # pkg-config | |
56 | PKG_PROG_PKG_CONFIG | |
57 | # This makes sure pkg.m4 is available. | |
58 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) | |
59 | ||
e708653f SS |
60 | # C Compiler |
61 | AC_PROG_CC | |
62 | AC_PROG_CC_C99 | |
63 | AC_PROG_CC_C_O | |
64 | AC_PROG_GCC_TRADITIONAL | |
65 | ||
66 | CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ | |
67 | -pipe \ | |
68 | -Wall \ | |
69 | -Wextra \ | |
70 | -Wno-inline \ | |
71 | -Wundef \ | |
72 | "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ | |
73 | -Wno-unused-parameter \ | |
74 | -Wno-unused-result \ | |
75 | -fno-strict-aliasing \ | |
76 | -ffunction-sections \ | |
77 | -fdata-sections \ | |
78 | -fstack-protector-all \ | |
79 | --param=ssp-buffer-size=4]) | |
80 | AC_SUBST([OUR_CFLAGS], $with_cflags) | |
81 | ||
82 | AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*], | |
83 | [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ | |
84 | -Wp,-D_FORTIFY_SOURCE=2])], | |
85 | [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])]) | |
86 | AC_SUBST([OUR_CPPFLAGS], $with_cppflags) | |
87 | ||
88 | CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ | |
89 | -Wl,--as-needed \ | |
90 | -Wl,--no-undefined \ | |
91 | -Wl,--gc-sections \ | |
92 | -Wl,-z,relro \ | |
93 | -Wl,-z,now]) | |
94 | AC_SUBST([OUR_LDFLAGS], $with_ldflags) | |
95 | ||
0e880048 MT |
96 | # ------------------------------------------------------------------------------ |
97 | ||
98 | AC_CHECK_HEADERS_ONCE([ | |
6f4814db | 99 | ctype.h |
0e880048 | 100 | errno.h |
d1f1b577 | 101 | net/if.h |
6f4814db MT |
102 | stdarg.h |
103 | stdio.h | |
0e880048 | 104 | stdlib.h |
6f4814db MT |
105 | string.h |
106 | syslog.h | |
107 | ]) | |
108 | ||
109 | AC_CHECK_FUNCS([ \ | |
110 | __secure_getenv \ | |
111 | secure_getenv \ | |
0e880048 MT |
112 | ]) |
113 | ||
5ca9dc30 MT |
114 | # ------------------------------------------------------------------------------ |
115 | AC_ARG_WITH([systemdsystemunitdir], | |
116 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), | |
117 | [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) | |
118 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) | |
119 | AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) | |
120 | ||
121 | # ------------------------------------------------------------------------------ | |
122 | AC_ARG_WITH([udevdir], | |
123 | AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]), | |
124 | [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)]) | |
125 | AC_SUBST([udevdir], [$with_udevdir]) | |
126 | AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"]) | |
127 | ||
128 | # ------------------------------------------------------------------------------ | |
01f2b2e4 | 129 | AC_CONFIG_HEADERS(config.h) |
5ca9dc30 MT |
130 | AC_CONFIG_FILES([ |
131 | Makefile | |
132 | ]) | |
133 | ||
134 | AC_OUTPUT | |
135 | AC_MSG_RESULT([ | |
136 | $PACKAGE_NAME $VERSION | |
137 | ||
e708653f SS |
138 | CFLAGS: ${OUR_CFLAGS} ${CFLAGS} |
139 | CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS} | |
140 | LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS} | |
141 | ||
5ca9dc30 MT |
142 | prefix: $prefix |
143 | ||
144 | systemdsystemunitdir: $systemdsystemunitdir | |
145 | udevdir: $udevdir | |
146 | ]) |