-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
140 lines (122 loc) · 4.08 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# ------------------------------------------------------------------------------
# versions
AC_PREREQ([2.64])
AC_INIT([dbus-http],
[1],
[http://www.github.com/larsu/dbus-http],
[dbus-http],
[http://www.github.com/larsu/dbus-http])
# ------------------------------------------------------------------------------
# autotools
AC_CONFIG_SRCDIR([src/dbus-http.c])
AC_CONFIG_HEADERS([build/config.h])
AC_CONFIG_AUX_DIR([build/build-aux])
# suppress conflicting defaults
# CFLAGS=${CFLAGS:-""}
# CXXFLAGS=${CXXFLAGS:-""}
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AM_MAINTAINER_MODE([enable])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
AC_PROG_CC_C99
AC_PROG_RANLIB
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
# systemd unit support
AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[Directory for systemd service files]))
# default location
AS_IF([test -z "$with_systemdsystemunitdir" && $PKG_CONFIG systemd],
with_systemdsystemunitdir="\$(prefix)/lib/systemd/system")
AS_IF([test -z "$with_systemdsystemunitdir"], with_systemdsystemunitdir=no)
# add conditional and subst
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$with_systemdsystemunitdir" != no])
if test "$with_systemdsystemunitdir" != no; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd support is available])
else
AC_DEFINE(HAVE_SYSTEMD, 0, [Define if systemd support is available])
fi
# ------------------------------------------------------------------------------
# toolchain
OUR_CFLAGS=${OUR_CFLAGS:-$(echo \
-g \
-Og \
-pipe \
-ftrapv \
-ffast-math \
-fno-common \
-fdiagnostics-show-option \
-fno-strict-aliasing \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections \
-fstack-protector \
-fstack-protector-strong \
-fPIC \
-funsigned-char \
--param=ssp-buffer-size=4 \
-Wall \
-Wextra \
-Wno-inline \
-Wundef \
-Wformat=2 \
-Wformat-security \
-Wformat-nonliteral \
-Wsign-compare \
-Wmissing-include-dirs \
-Wold-style-definition \
-Wpointer-arith \
-Winit-self \
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wmissing-prototypes \
-Wstrict-prototypes \
-Wredundant-decls \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wshadow \
-Wendif-labels \
-Wstrict-aliasing=2 \
-Wwrite-strings \
-Wno-long-long \
-Wno-overlength-strings \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wno-unused-result \
-Werror=overflow \
-Wdate-time \
-Wnested-externs)}
OUR_CPPFLAGS=${OUR_CPPFLAGS:-$(echo \
-Wp,-D_FORTIFY_SOURCE=2)}
OUR_LDFLAGS=${OUR_LDFLAGS:-$(echo \
-Wl,--as-needed \
-Wl,--no-undefined \
-Wl,--gc-sections \
-Wl,-z,relro \
-Wl,-z,now \
-pie)}
AC_SUBST(OUR_CFLAGS)
AC_SUBST(OUR_CPPFLAGS)
AC_SUBST(OUR_LDFLAGS)
# ------------------------------------------------------------------------------
# dependencies
PKG_CHECK_MODULES(EXPAT, [expat])
PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd])
PKG_CHECK_MODULES(SYSTEMD, [libsystemd])
# ------------------------------------------------------------------------------
# report
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
prefix: ${prefix}
exec_prefix: ${exec_prefix}
includedir: ${includedir}
systemdunitdir: ${with_systemdsystemunitdir}
CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
])