-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
179 lines (166 loc) · 4.45 KB
/
configure.ac
File metadata and controls
179 lines (166 loc) · 4.45 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# This file is part of the osformat project and distributed under the
# terms of the GNU General Public License v2.
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (c)
# Martin V\"ath <martin@mvath.de>
dnl keep version in same line as AC_INIT for possible usage in scripts
AC_INIT([osformat], [1.0.7],
[https://github.com/vaeth/osformat/issues/],
[osformat],
[https://github.com/vaeth/osformat/])
AC_PREREQ([2.64])
m4_ifdef([AC_CONFIG_MACRO_DIR],
[AC_CONFIG_MACRO_DIR([m4])])
m4_ifdef([AC_CONFIG_MACRO_DIRS],
[AC_CONFIG_MACRO_DIRS([m4 martinm4])])
AC_CONFIG_FILES([
Makefile
])
AM_MAINTAINER_MODE()
AM_INIT_AUTOMAKE()
AM_SILENT_RULES([yes])
AC_LANG([C++])
AC_PROG_CXX()
AC_PROG_MKDIR_P()
AM_PROG_AR()
LT_INIT([disable-static])
AC_ARG_ENABLE([warnings],
[AS_HELP_STRING([--enable-warnings],
[append warning/testing flags; might produce worse code])],
[MV_ENABLE([warnings])
AS_VAR_SET([cmt_warnings], ["on request"])],
[AS_VAR_SET([warnings], [false])
AS_VAR_SET([cmt_warnings], ["default"])])
AC_MSG_CHECKING([whether warning options should be used])
MV_MSG_RESULT_BIN([$warnings], [$cmt_warnings])
AS_IF([$warnings],
[AS_VAR_COPY([oricxxflags], [CXXFLAGS])
AS_VAR_COPY([orildflags], [LDFLAGS])
AS_VAR_SET([CFLAGS], [])
AS_VAR_SET([CXXFLAGS], [])
AS_VAR_SET([LDFLAGS], [])
AS_VAR_SET([my_cxxfatal], [])
AS_VAR_SET([my_ldfatal], [])
MV_ADDFLAGS([my_cxxfatal], [CXXFLAGS], [AC_COMPILE_IFELSE], [ \
-Werror \
-Werror=unknown-warning-option \
-Wunknown-warning-option \
])
MV_ADDFLAGS([my_ldfatal], [LDFLAGS], [AC_LINK_IFELSE], [ \
$my_cxxfatal \
-Wl,--fatal-warnings \
])
AS_VAR_SET([my_cxxadd], [])
AS_VAR_SET([my_ldadd], [])
MV_ADDFLAGS([my_cxxadd], [CXXFLAGS], [AC_COMPILE_IFELSE], [ \
-Wpedantic \
-pedantic \
-Wall \
-Weverything \
-Wextra \
-Wformat=2 \
-Wunused-variable \
-Wunused-parameter \
-Wstring-plus-int \
-WNSObject-attribute \
-Winit-self \
-Wmissing-include-dirs \
-Wswitch-default \
-Wunused \
-Wunused-parameter \
-Wstrict-aliasing=1 \
-Wstrict-overflow=5 \
-Wfloat-equal \
-Wundef \
-Wshadow \
-Wpointer-arith \
-Wcast-qual \
-Wcast-align \
-Wwrite-strings \
-Wsign-compare \
-Wmissing-field-initializers \
-Wnormalized=nfkc \
-Wpacked \
-Wredundant-decls \
-Winvalid-pch \
-Wvolatile-register-var \
-Wdisabled-optimization \
-Wlogical-op \
-Wvla \
-Wabi \
-Wstrict-null-sentinel \
-Wstring-plus-int \
-Woverloaded-virtual \
-Wsign-promo \
-Wnoexcept \
-Wmissing-declarations \
-Wmissing-format-attribute \
-Wunused-but-set-variable \
-Wunused-but-set-parameter \
-Wdelete-non-virtual-dtor \
-Wint-to-pointer-cast \
-Wcomment \
-WNSObject-attribute \
-fdiagnostic-color=always \
-Wswitch-bool \
-Wlogical-not-parantheses \
-Wsizeof-array-argument \
-Wbool-compare \
-Wodr-type-mismatch \
-Wshift-negative-value \
-Wshift-overflow \
-Wshift-overflow=2 \
-Wnull-dereference \
-Wduplicated-cond \
-Wsign-conversion \
-Wold-style-cast \
-Wmissing-noreturn \
-Wsuggest-attribute=pure \
-Wsuggest-attribute=const \
-Wsuggest-attribute=noreturn \
-Wunreachable-code \
-Waggregate-return \
], [$my_cxxfatal], [], [:])
MV_ADDFLAGS([my_ldadd], [LDFLAGS], [AC_LINK_IFELSE], [ \
-Wl,-z,defs \
-Wl,--no-undefined \
-Wl,--no-allow-shlib-undefined \
-Wl,--no-undefined-version \
$warn_common \
], [$my_cxxfatal], [], [:])
MV_PREPEND([CXXFLAGS], [$my_cxxadd])
MV_PREPEND([LDFLAGS], [$my_ldadd])])
dnl This is used intentionally for backward compatibility:
dnl -Wzero-as-null-pointer-constant \
dnl Some purely static classes are used intentionally:
dnl -Wctor-dtor-privacy \
dnl Not needed anymore with current clang:
dnl -Wno-unknown-warning-option \
dnl Output is too confusing:
dnl -fmem-report \
dnl Too many useless warnings or only for C:
dnl -Wtraditional \
dnl -Wc++-compat \
dnl -Wstrict-prototypes \
dnl -Wold-style-definition \
dnl -Wmissing-prototypes \
dnl -Wnested-externs \
dnl -Wpointer-sign \
dnl Included in -Wall (in gcc-6; not available earlier, anyway)
dnl -Wtautological-compare \
dnl -Wmisleading-indentation \
dnl
dnl We do not use (since it gives too many useless warnings or is only for C):
dnl -Wconversion \
dnl -Wswitch-enum \
dnl -Wunsafe-loop-optimizations \
dnl -Wpadded \
dnl -Winline \
dnl -Weffc++ \
AC_OUTPUT([
osformat.pc
])
AS_ECHO(["
$PACKAGE-$VERSION configured successfully.
"])