aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-04-14 22:12:52 -0500
committerBrent Cook <bcook@openbsd.org>2015-04-14 22:12:52 -0500
commit2753f5ca876a909deec9f52404bd72c85ee625ca (patch)
tree01cb87f1fd541907d481311064bdab5d2cdf3691
parent5cf05de18ce848d7579f235758160ee12fcd85a5 (diff)
downloadportable-2753f5ca876a909deec9f52404bd72c85ee625ca.tar.gz
portable-2753f5ca876a909deec9f52404bd72c85ee625ca.tar.bz2
portable-2753f5ca876a909deec9f52404bd72c85ee625ca.zip
Revert configure-time checks for -Wall/-std=gnu99
There is a problem with these on some compilers, revert while a solution is found.
-rw-r--r--configure.ac50
1 files changed, 14 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index 31efac7..2cd9814 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,13 +9,14 @@ AC_CONFIG_MACRO_DIR([m4])
9 9
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 11
12AM_PROG_AS
13AC_PROG_CC 12AC_PROG_CC
14AC_PROG_CC_STDC 13AC_PROG_CC_STDC
15AM_PROG_CC_C_O 14AM_PROG_CC_C_O
16AC_PROG_LIBTOOL 15AC_PROG_LIBTOOL
17LT_INIT 16LT_INIT
18 17
18CFLAGS="$CFLAGS -Wall -std=gnu99"
19
19case $host_os in 20case $host_os in
20 *aix*) 21 *aix*)
21 HOST_OS=aix 22 HOST_OS=aix
@@ -87,40 +88,6 @@ AC_CHECK_FUNC([clock_gettime],,
87AC_CHECK_FUNC([dl_iterate_phdr],, 88AC_CHECK_FUNC([dl_iterate_phdr],,
88 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) 89 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])])
89 90
90# Check if -Wno-pointer-sign is supported, a lot of ASN1 code needs this due to
91# char*/unsigned char* mismatches.
92save_cflags="$CFLAGS"
93CFLAGS=-Wno-pointer-sign
94AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
95AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
96 [AC_MSG_RESULT([yes])]
97 [AM_CFLAGS=-Wno-pointer-sign],
98 [AC_MSG_RESULT([no])]
99)
100CFLAGS="$save_cflags $AM_CFLAGS"
101
102# Check for some common compiler flag support
103save_cflags="$CFLAGS"
104CFLAGS=-Wall
105AC_MSG_CHECKING([whether CC supports -Wall])
106AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
107 [AC_MSG_RESULT([yes])]
108 [AM_CFLAGS=-Wall],
109 [AC_MSG_RESULT([no])]
110)
111CFLAGS="$save_cflags $AM_CFLAGS"
112
113save_cflags="$CFLAGS"
114CFLAGS=--std=gnu99
115AC_MSG_CHECKING([whether CC supports --std=gnu99])
116AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
117 [AC_MSG_RESULT([yes])]
118 [AM_CFLAGS=--std=gnu99],
119 [AC_MSG_RESULT([no])]
120)
121CFLAGS="$save_cflags $AM_CFLAGS"
122
123# Clang needs some workarounds, check for it
124AC_MSG_CHECKING([if compiling with clang]) 91AC_MSG_CHECKING([if compiling with clang])
125AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ 92AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
126#ifndef __clang__ 93#ifndef __clang__
@@ -215,7 +182,6 @@ AS_IF([test "x$enable_hardening" = "xyes"], [
215 AC_MSG_WARN([compiler does not appear to support stack protection]) 182 AC_MSG_WARN([compiler does not appear to support stack protection])
216 ) 183 )
217 ) 184 )
218 # Make sure we can actually link libssp on Windows platforms.
219 AS_IF([test "x$HOST_OS" = "xwin"], [ 185 AS_IF([test "x$HOST_OS" = "xwin"], [
220 AC_SEARCH_LIBS([__stack_chk_guard],[ssp]) 186 AC_SEARCH_LIBS([__stack_chk_guard],[ssp])
221 ]) 187 ])
@@ -230,6 +196,17 @@ LD="$saved_LD"
230CFLAGS="$CFLAGS $HARDEN_CFLAGS" 196CFLAGS="$CFLAGS $HARDEN_CFLAGS"
231LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS" 197LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS"
232 198
199# Removing the dependency on -Wno-pointer-sign should be a goal
200save_cflags="$CFLAGS"
201CFLAGS=-Wno-pointer-sign
202AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
203AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
204 [AC_MSG_RESULT([yes])]
205 [AM_CFLAGS=-Wno-pointer-sign],
206 [AC_MSG_RESULT([no])]
207)
208CFLAGS="$save_cflags $AM_CFLAGS"
209
233save_cflags="$CFLAGS" 210save_cflags="$CFLAGS"
234CFLAGS= 211CFLAGS=
235AC_MSG_CHECKING([whether AS supports .note.GNU-stack]) 212AC_MSG_CHECKING([whether AS supports .note.GNU-stack])
@@ -240,6 +217,7 @@ __asm__(".section .note.GNU-stack,\"\",@progbits");]])],
240 [AC_MSG_RESULT([no])] 217 [AC_MSG_RESULT([no])]
241) 218)
242CFLAGS="$save_cflags $AM_CFLAGS" 219CFLAGS="$save_cflags $AM_CFLAGS"
220AM_PROG_AS
243 221
244AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) 222AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval])
245AC_CHECK_FUNCS([getentropy memmem poll reallocarray]) 223AC_CHECK_FUNCS([getentropy memmem poll reallocarray])