1 ###############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2013 IPFire Network Development Team #
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. #
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. #
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/>. #
19 ###############################################################################
27 [http://www.ipfire.org/])
29 AC_CONFIG_AUX_DIR([build-aux])
31 AC_PREFIX_DEFAULT([/usr])
42 AM_SILENT_RULES([yes])
53 AC_PATH_PROG([XSLTPROC], [xsltproc])
57 # This makes sure pkg.m4 is available.
58 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
64 AC_PROG_GCC_TRADITIONAL
66 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
72 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
73 -Wno-unused-parameter \
75 -fno-strict-aliasing \
78 -fstack-protector-all \
79 --param=ssp-buffer-size=4])
80 AC_SUBST([OUR_CFLAGS], $with_cflags)
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)
88 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
94 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
96 # ------------------------------------------------------------------------------
98 AC_CHECK_HEADERS_ONCE([
115 # ------------------------------------------------------------------------------
117 AC_ARG_ENABLE([debug],
118 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
119 [], [enable_debug=no])
120 AS_IF([test "x$enable_debug" = "xyes"], [
121 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
124 # ------------------------------------------------------------------------------
125 AC_ARG_WITH([systemdsystemunitdir],
126 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
127 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
128 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
129 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
131 # ------------------------------------------------------------------------------
132 AC_ARG_WITH([udevdir],
133 AS_HELP_STRING([--with-udevdir=DIR], [Directory for udev files]),
134 [], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)])
135 AC_SUBST([udevdir], [$with_udevdir])
136 AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"])
138 # ------------------------------------------------------------------------------
140 PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0])
142 # ------------------------------------------------------------------------------
144 AC_CONFIG_HEADERS(config.h)
151 $PACKAGE_NAME $VERSION
153 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
154 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
155 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
159 systemdsystemunitdir: $systemdsystemunitdir