diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-04-14 22:12:52 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-04-14 22:12:52 -0500 |
| commit | 2753f5ca876a909deec9f52404bd72c85ee625ca (patch) | |
| tree | 01cb87f1fd541907d481311064bdab5d2cdf3691 | |
| parent | 5cf05de18ce848d7579f235758160ee12fcd85a5 (diff) | |
| download | portable-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.ac | 50 |
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 | ||
| 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 11 | 11 | ||
| 12 | AM_PROG_AS | ||
| 13 | AC_PROG_CC | 12 | AC_PROG_CC |
| 14 | AC_PROG_CC_STDC | 13 | AC_PROG_CC_STDC |
| 15 | AM_PROG_CC_C_O | 14 | AM_PROG_CC_C_O |
| 16 | AC_PROG_LIBTOOL | 15 | AC_PROG_LIBTOOL |
| 17 | LT_INIT | 16 | LT_INIT |
| 18 | 17 | ||
| 18 | CFLAGS="$CFLAGS -Wall -std=gnu99" | ||
| 19 | |||
| 19 | case $host_os in | 20 | case $host_os in |
| 20 | *aix*) | 21 | *aix*) |
| 21 | HOST_OS=aix | 22 | HOST_OS=aix |
| @@ -87,40 +88,6 @@ AC_CHECK_FUNC([clock_gettime],, | |||
| 87 | AC_CHECK_FUNC([dl_iterate_phdr],, | 88 | AC_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. | ||
| 92 | save_cflags="$CFLAGS" | ||
| 93 | CFLAGS=-Wno-pointer-sign | ||
| 94 | AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign]) | ||
| 95 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
| 96 | [AC_MSG_RESULT([yes])] | ||
| 97 | [AM_CFLAGS=-Wno-pointer-sign], | ||
| 98 | [AC_MSG_RESULT([no])] | ||
| 99 | ) | ||
| 100 | CFLAGS="$save_cflags $AM_CFLAGS" | ||
| 101 | |||
| 102 | # Check for some common compiler flag support | ||
| 103 | save_cflags="$CFLAGS" | ||
| 104 | CFLAGS=-Wall | ||
| 105 | AC_MSG_CHECKING([whether CC supports -Wall]) | ||
| 106 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
| 107 | [AC_MSG_RESULT([yes])] | ||
| 108 | [AM_CFLAGS=-Wall], | ||
| 109 | [AC_MSG_RESULT([no])] | ||
| 110 | ) | ||
| 111 | CFLAGS="$save_cflags $AM_CFLAGS" | ||
| 112 | |||
| 113 | save_cflags="$CFLAGS" | ||
| 114 | CFLAGS=--std=gnu99 | ||
| 115 | AC_MSG_CHECKING([whether CC supports --std=gnu99]) | ||
| 116 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
| 117 | [AC_MSG_RESULT([yes])] | ||
| 118 | [AM_CFLAGS=--std=gnu99], | ||
| 119 | [AC_MSG_RESULT([no])] | ||
| 120 | ) | ||
| 121 | CFLAGS="$save_cflags $AM_CFLAGS" | ||
| 122 | |||
| 123 | # Clang needs some workarounds, check for it | ||
| 124 | AC_MSG_CHECKING([if compiling with clang]) | 91 | AC_MSG_CHECKING([if compiling with clang]) |
| 125 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | 92 | AC_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" | |||
| 230 | CFLAGS="$CFLAGS $HARDEN_CFLAGS" | 196 | CFLAGS="$CFLAGS $HARDEN_CFLAGS" |
| 231 | LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS" | 197 | LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS" |
| 232 | 198 | ||
| 199 | # Removing the dependency on -Wno-pointer-sign should be a goal | ||
| 200 | save_cflags="$CFLAGS" | ||
| 201 | CFLAGS=-Wno-pointer-sign | ||
| 202 | AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign]) | ||
| 203 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | ||
| 204 | [AC_MSG_RESULT([yes])] | ||
| 205 | [AM_CFLAGS=-Wno-pointer-sign], | ||
| 206 | [AC_MSG_RESULT([no])] | ||
| 207 | ) | ||
| 208 | CFLAGS="$save_cflags $AM_CFLAGS" | ||
| 209 | |||
| 233 | save_cflags="$CFLAGS" | 210 | save_cflags="$CFLAGS" |
| 234 | CFLAGS= | 211 | CFLAGS= |
| 235 | AC_MSG_CHECKING([whether AS supports .note.GNU-stack]) | 212 | AC_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 | ) |
| 242 | CFLAGS="$save_cflags $AM_CFLAGS" | 219 | CFLAGS="$save_cflags $AM_CFLAGS" |
| 220 | AM_PROG_AS | ||
| 243 | 221 | ||
| 244 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) | 222 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) |
| 245 | AC_CHECK_FUNCS([getentropy memmem poll reallocarray]) | 223 | AC_CHECK_FUNCS([getentropy memmem poll reallocarray]) |
