4 # This configure script written by Brian Callahan <bcallah@openbsd.org>
5 # and released into the Public Domain.
8 - if [ ! -z "$CC" ] ; then
9 -cat << EOF > conftest.c
10 -int main(void){return 0;}
12 - $CC -o conftest conftest.c > /dev/null 2>&1
13 - if [ $? -eq 0 ] ; then
15 - if [ $? -eq 0 ] ; then
16 - rm -f conftest conftest.c
20 - echo "could not build working executables"
21 - echo "Please ensure your C compiler is a native compiler"
25 - rm -f conftest conftest.c
29 - for compiler in cc clang pcc xlc gcc ; do
30 -cat << EOF > conftest.c
31 -int main(void){return 0;}
34 - $compiler -o conftest conftest.c > /dev/null 2>&1
36 - if [ $? -eq 0 ] ; then
38 - if [ $? -eq 0 ] ; then
39 - rm -f conftest conftest.c
43 - echo "could not build working executables"
44 - echo "Please ensure your C compiler is a native compiler"
48 - rm -f conftest conftest.c
54 -defaultcflagscheck() {
55 - cat << EOF > conftest.c
56 -int main(void){return 0;}
58 - $cc $cflags -g -O2 -o conftest.o -c conftest.c > /dev/null 2>&1
59 - if [ $? -eq 0 ] ; then
60 - rm -f conftest conftest.o conftest.c
63 - rm -f conftest conftest.o conftest.c
70 cat << EOF > conftest.c
71 @@ -229,20 +170,6 @@ EOF
76 - cat << EOF > conftest.c
77 -int main(void){return 0;}
79 - $cc $cflags -w -o conftest conftest.c > /dev/null 2>&1
80 - if [ $? -eq 0 ] ; then
81 - rm -f conftest conftest.o conftest.c
84 - rm -f conftest conftest.o conftest.c
90 if [ ! -z "$PREFIX" ] ; then
92 @@ -327,79 +254,9 @@ if [ $static -ne 0 ] ; then
93 ldflags="${ldflags}-static"
96 -printf "checking for C compiler... "
98 -if [ $? -ne 0 ] ; then
100 - echo "Please install a C compiler and re-run configure."
106 -if [ "x$cflags" = "x-DREGEX" ] ; then
107 - printf "checking if the compiler accepts -g -O2... "
109 - if [ $? -eq 0 ] ; then
112 - cflags="-g -O2 $cflags"
117 -printf "checking for -w compiler flag... "
119 -if [ $? -eq 0 ] ; then
122 - cflags="$cflags -w"
126 -printf "checking for OS... "
128 -if [ $terminfo -eq 0 ] ; then
138 - "xLinux"|"xCYGWIN"*)
139 - cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
142 - cflags="$cflags -DMSG_NOSIGNAL=SO_NOSIGPIPE -DLOGIN_NAME_MAX=MAXLOGNAME"
143 - if [ $terminfo -eq 0 ] ; then
144 - libs="-lncurses -lutil"
150 - cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
151 - libs="$libs -lutil"
154 - libs="$libs -lutil"
157 - cflags="$cflags -D_OPENBSD_SOURCE"
158 - if [ $terminfo -eq 0 ] ; then
159 - libs="-lcurses -lutil"
165 - cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
166 - libs="$libs -lutil"
170 +libs='-lncurses -lpcreposix'
171 +cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
173 cat << EOF > config.h
174 /* This file generated automatically by configure. */