]> git.zarvox.org Git - crbtree.git/blob - configure.ac
build: install-tree - move to $builddir
[crbtree.git] / configure.ac
1 # ------------------------------------------------------------------------------
2 # versions
3
4 AC_PREREQ([2.64])
5 AC_INIT([crbtree],
6         [1],
7         [http://www.github.com/bus1/crbtree],
8         [crbtree],
9         [http://www.github.com/bus1/crbtree])
10
11 # ------------------------------------------------------------------------------
12 # autotools
13
14 AC_CONFIG_SRCDIR([src/org.bus1/c-rbtree.h])
15 AC_CONFIG_MACRO_DIR([build/m4])
16 AC_CONFIG_HEADERS([build/config.h])
17 AC_CONFIG_AUX_DIR([build/build-aux])
18
19 # suppress conflicting defaults
20 CFLAGS=${CFLAGS:-""}
21 CXXFLAGS=${CXXFLAGS:-""}
22
23 AC_USE_SYSTEM_EXTENSIONS
24 AC_SYS_LARGEFILE
25 AM_MAINTAINER_MODE([enable])
26 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
27 AM_SILENT_RULES([yes])
28 AC_CANONICAL_HOST
29 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
30 AC_PROG_CC_C99
31 AC_PROG_RANLIB
32 AC_PROG_SED
33 AC_PROG_LN_S
34
35 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
36
37 # ------------------------------------------------------------------------------
38 # toolchain
39
40 OUR_CFLAGS=${OUR_CFLAGS:-$(echo \
41         -g \
42         -Og \
43         -pipe \
44         -ftrapv \
45         -ffast-math \
46         -fno-common \
47         -fdiagnostics-show-option \
48         -fno-strict-aliasing \
49         -fvisibility=hidden \
50         -ffunction-sections \
51         -fdata-sections \
52         -fstack-protector \
53         -fstack-protector-strong \
54         -fPIC \
55         --param=ssp-buffer-size=4 \
56         -Wall \
57         -Wextra \
58         -Wno-inline \
59         -Wundef \
60         -Wformat=2 \
61         -Wformat-security \
62         -Wformat-nonliteral \
63         -Wsign-compare \
64         -Wmissing-include-dirs \
65         -Wold-style-definition \
66         -Wpointer-arith \
67         -Winit-self \
68         -Wdeclaration-after-statement \
69         -Wfloat-equal \
70         -Wmissing-prototypes \
71         -Wstrict-prototypes \
72         -Wredundant-decls \
73         -Wmissing-declarations \
74         -Wmissing-noreturn \
75         -Wshadow \
76         -Wendif-labels \
77         -Wstrict-aliasing=2 \
78         -Wwrite-strings \
79         -Wno-long-long \
80         -Wno-overlength-strings \
81         -Wno-unused-parameter \
82         -Wno-missing-field-initializers \
83         -Wno-unused-result \
84         -Werror=overflow \
85         -Wdate-time \
86         -Wnested-externs)}
87
88 OUR_CPPFLAGS=${OUR_CPPFLAGS:-$(echo \
89         -Wp,-D_FORTIFY_SOURCE=2 \
90         -Wno-typedef-redefinition \
91         -Wno-gnu-variable-sized-type-not-at-end)}
92
93 OUR_LDFLAGS=${OUR_LDFLAGS:-$(echo \
94         -Wl,--as-needed \
95         -Wl,--no-undefined \
96         -Wl,--gc-sections \
97         -Wl,-z,relro \
98         -Wl,-z,now \
99         -pie)}
100
101 AC_SUBST(OUR_CFLAGS)
102 AC_SUBST(OUR_CPPFLAGS)
103 AC_SUBST(OUR_LDFLAGS)
104
105 # ------------------------------------------------------------------------------
106 # report
107
108 AC_CONFIG_FILES([Makefile])
109
110 AC_OUTPUT
111 AC_MSG_RESULT([
112         $PACKAGE_NAME $VERSION
113         prefix:                 ${prefix}
114         exec_prefix:            ${exec_prefix}
115         includedir:             ${includedir}
116         libdir:                 ${libdir}
117
118         CFLAGS:                 ${OUR_CFLAGS} ${CFLAGS}
119         CPPFLAGS:               ${OUR_CPPFLAGS} ${CPPFLAGS}
120         LDFLAGS:                ${OUR_LDFLAGS} ${LDFLAGS}
121 ])