$OpenBSD: patch-configure,v 1.55 2017/12/15 16:25:31 ajacoutot Exp $

- Fix TLS test to work with Clang's emulated TLS
- Fix curses test to work on OpenBSD
- More appropriate CFLAGS handling

Index: configure
--- configure.orig
+++ configure
@@ -1724,7 +1724,7 @@ static __thread int tls_var;
 int main(void) { return tls_var; }
 EOF
 
-if ! compile_prog "-Werror" "" ; then
+if ! compile_prog "-Werror" "-pthread" ; then
     error_exit "Your compiler does not support the __thread specifier for " \
 	"Thread-Local Storage (TLS). Please upgrade to a version that does."
 fi
@@ -3170,6 +3170,7 @@ if test "$curses" != "no" ; then
   fi
   curses_found=no
   cat > $TMPC << EOF
+#define _XOPEN_SOURCE_EXTENDED
 #include <locale.h>
 #include <curses.h>
 #include <wchar.h>
@@ -5124,10 +5125,6 @@ fi
 if test "$gcov" = "yes" ; then
   CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
   LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
-elif test "$fortify_source" = "yes" ; then
-  CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
-elif test "$debug" = "no"; then
-  CFLAGS="-O2 $CFLAGS"
 fi
 
 ##########################################
