#!/bin/sh # # This file was generated by confgen version 2. # Do not edit. # PREFIX='/usr' #EXECPREFIX='$PREFIX' INSTALLROOT='' BINMODE='755' #DAEMONMODE='$BINMODE' MANMODE='644' while [ x$1 != x ]; do case $1 in --help) cat < __conftest.c int main() { int class=0; return class; } EOF if [ x"$CC" = x ]; then echo -n 'Looking for a C compiler... ' for TRY in egcs gcc g++ CC c++ cc; do ( $TRY __conftest.c -o __conftest || exit 1; ./__conftest || exit 1; ) >/dev/null 2>&1 || continue; CC=$TRY break; done if [ x"$CC" = x ]; then echo 'failed.' echo 'Cannot find a C compiler. Run configure with --with-c-compiler.' rm -f __conftest* exit fi echo "$CC" else echo -n 'Checking if C compiler works... ' if ( $CC __conftest.c -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' else echo 'no' echo 'Compiler '"$CC"' does not exist or cannot compile C; try another.' rm -f __conftest* exit fi fi echo -n "Checking if $CC accepts gcc warnings... " if ( $CC $WARNINGS __conftest.c -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' CC_WARNINGS=1 else echo 'no' fi cat << EOF > __conftest.cc template class fnord { public: T x; fnord(T y) { x=y; }}; int main() { fnord *a = new fnord(0); return a->x; } EOF if [ x"$CXX" = x ]; then echo -n 'Looking for a C++ compiler... ' for TRY in egcs gcc g++ CC c++ cc; do ( $TRY __conftest.cc -o __conftest || exit 1; ./__conftest || exit 1; ) >/dev/null 2>&1 || continue; CXX=$TRY break; done if [ x"$CXX" = x ]; then echo 'failed.' echo 'Cannot find a C++ compiler. Run configure with --with-cpp-compiler.' rm -f __conftest* exit fi echo "$CXX" else echo -n 'Checking if C++ compiler works... ' if ( $CXX __conftest.cc -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' else echo 'no' echo 'Compiler '"$CXX"' does not exist or cannot compile C++; try another.' rm -f __conftest* exit fi fi echo -n "Checking if $CXX accepts gcc warnings... " if ( $CXX $WARNINGS __conftest.cc -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' CXX_WARNINGS=1 else echo 'no' fi if [ x$DEBUG = x ]; then echo -n "Checking if $CC accepts -O2... " if ( $CC -O2 __conftest.c -o __conftest ) >/dev/null 2>&1; then echo 'yes' CFLAGS="$CFLAGS -O2" else echo 'no' echo -n "Checking if $CC accepts -O... " if ( $CC -O __conftest.c -o __conftest ) >/dev/null 2>&1; then echo 'yes' CFLAGS="$CFLAGS -O" else echo 'no' fi fi else echo -n "Checking if $CC accepts -g... " if ( $CC -g __conftest.c -o __conftest ) >/dev/null 2>&1; then echo 'yes' CFLAGS="$CFLAGS -g" else echo 'no' fi fi if [ x"$CC" != x"$CXX" ]; then if [ x$DEBUG = x ]; then echo -n "Checking if $CXX accepts -O2... " if ( $CXX -O2 __conftest.cc -o __conftest ) >/dev/null 2>&1; then echo 'yes' CXXFLAGS="$CXXFLAGS -O2" else echo 'no' echo -n "Checking if $CXX accepts -O... " if ( $CXX -O __conftest.cc -o __conftest ) >/dev/null 2>&1; then echo 'yes' CXXFLAGS="$CXXFLAGS -O" else echo 'no' fi fi else echo -n "Checking if $CXX accepts -g... " if ( $CXX -g __conftest.cc -o __conftest ) >/dev/null 2>&1; then echo 'yes' CXXFLAGS="$CXXFLAGS -g" else echo 'no' fi fi else CXXFLAGS="$CFLAGS" fi echo -n "Checking if $CXX accepts -fno-rtti... " if ( $CXX -fno-rtti __conftest.cc -o __conftest ) >/dev/null 2>&1; then echo 'yes' CXXFLAGS="$CXXFLAGS -fno-rtti" else echo 'no' fi echo -n "Checking if $CXX accepts -fno-exceptions... " if ( $CXX -fno-exceptions __conftest.cc -o __conftest ) >/dev/null 2>&1; then echo 'yes' CXXFLAGS="$CXXFLAGS -fno-exceptions" else echo 'no' fi LDFLAGS= LIBS= rm -f __conftest* ################################################## echo -n 'Checking for BSD signal semantics... ' cat <__conftest.cc #include #include int count=0; void handle(int foo) { count++; } int main() { int pid=getpid(); signal(SIGINT, handle); kill(pid,SIGINT); kill(pid,SIGINT); kill(pid,SIGINT); if (count!=3) return 1; return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' else if ( $CXX $CXXFLAGS -D__USE_BSD_SIGNAL __conftest.cc -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo '-D__USE_BSD_SIGNAL' CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL" CXXFLAGS="$CXXFLAGS -D__USE_BSD_SIGNAL" else echo 'no' echo 'This package needs BSD signal semantics to run.' rm -f __conftest* exit fi fi rm -f __conftest* ################################################## echo -n 'Checking for ncurses... ' cat <__conftest.cc #include #include #ifndef KEY_DOWN syntax error. /* not ncurses */ #endif int main() { endwin(); return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc -lncurses -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' NCURSES=1 else if ( $CXX $CXXFLAGS -I/usr/include/ncurses __conftest.cc -lncurses -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-I/usr/include/ncurses' CFLAGS="$CFLAGS -I/usr/include/ncurses" CXXFLAGS="$CXXFLAGS -I/usr/include/ncurses" NCURSES=1 else echo 'no' fi fi if [ x$NCURSES != x ]; then LIBTERMCAP=-lncurses else echo -n 'Checking for traditional termcap... ' cat <__conftest.cc #include #include int main() { tgetent(NULL, NULL); return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc -ltermcap -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-ltermcap' LIBTERMCAP=-ltermcap else echo 'not found' echo 'This package needs termcap to run.' rm -f __conftest* exit fi fi rm -f __conftest* ################################################## echo -n 'Checking for GNU libc... ' cat <__conftest.cc #include #if defined(__GLIBC__) && (__GLIBC__ >= 2) int tester; #endif int main() { tester=6; return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' USE_GLIBC=1 else echo 'no' fi rm -f __conftest* ################################################## echo -n 'Checking for forkpty... ' cat <__conftest.cc #include int main() { forkpty(0, 0, 0, 0); } EOF if ( $CXX $CXXFLAGS __conftest.cc -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' else if ( $CXX $CXXFLAGS __conftest.cc -lutil -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-lutil' LIBS="$LIBS -lutil" else if ( $CXX $CXXFLAGS __conftest.cc -lbsd -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-lbsd' LIBBSD="-lbsd" else echo 'no' echo 'This package requires forkpty.' rm -f __conftest* exit fi fi fi rm -f __conftest* ################################################## echo -n 'Checking for logwtmp... ' cat <__conftest.cc #ifdef __cplusplus extern "C" #endif void logwtmp(const char *, const char *, const char *); int main() { logwtmp(0, 0, 0); } EOF if ( $CXX $CXXFLAGS __conftest.cc -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'yes' else if ( $CXX $CXXFLAGS __conftest.cc -lutil -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-lutil' LIBS="$LIBS -lutil" else if ( $CXX $CXXFLAGS __conftest.cc -lbsd -o __conftest || exit 1 ) >/dev/null 2>&1; then echo '-lbsd' LIBBSD="-lbsd" else echo 'no' echo 'This package requires logwtmp.' rm -f __conftest* exit fi fi fi rm -f __conftest* ################################################## echo -n 'Checking for snprintf declaration... ' cat <__conftest.cc #include int main() { void *x = (void *)snprintf; printf("%lx", (long)x); return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc -o __conftest || exit 1 ) >/dev/null 2>&1; then echo 'ok' else if ( $CXX $CXXFLAGS -D_GNU_SOURCE __conftest.cc -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo '-D_GNU_SOURCE' CFLAGS="$CFLAGS -D_GNU_SOURCE" CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE" else echo 'manual' CFLAGS="$CFLAGS -DDECLARE_SNPRINTF" CXXFLAGS="$CXXFLAGS -DDECLARE_SNPRINTF" fi fi rm -f __conftest* echo -n 'Checking for snprintf implementation... ' cat <__conftest.cc #include #include #ifdef DECLARE_SNPRINTF #ifdef __cplusplus extern "C" #endif /*__cplusplus*/ int snprintf(char *, int, const char *, ...); #endif /*DECLARE_SNPRINTF*/ int main() { char buf[32]; snprintf(buf, 8, "%s", "1234567890"); if (strlen(buf)!=7) return 1; return 0; } EOF if ( $CXX $CXXFLAGS __conftest.cc $LIBBSD -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo 'ok' else if ( $CXX $CXXFLAGS __conftest.cc -lsnprintf $LIBBSD -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo '-lsnprintf' LIBS="$LIBS -lsnprintf" else if ( $CXX $CXXFLAGS __conftest.cc -ldb $LIBBSD -o __conftest || exit 1 ./__conftest || exit 1 ) >/dev/null 2>&1; then echo '-ldb' LIBS="$LIBS -ldb" else echo 'missing' echo 'This package requires snprintf.' rm -f __conftest* exit fi fi fi rm -f __conftest* ################################################## ## libbsd should go last in case it's broken if [ "x$LIBBSD" != x ]; then LIBS="$LIBS $LIBBSD" fi echo 'Generating MCONFIG...' ( echo -n '# Generated by configure (confgen version 2) on ' date echo '#' echo echo "BINDIR=$BINDIR" echo "SBINDIR=$SBINDIR" echo "MANDIR=$MANDIR" echo "BINMODE=$BINMODE" echo "DAEMONMODE=$DAEMONMODE" echo "MANMODE=$MANMODE" echo "PREFIX=$PREFIX" echo "EXECPREFIX=$EXECPREFIX" echo "INSTALLROOT=$INSTALLROOT" echo "CC=$CC" echo "CXX=$CXX" if [ x$CC_WARNINGS != x ]; then CFLAGS="$CFLAGS $WARNINGS" fi if [ x$CXX_WARNINGS != x ]; then CXXFLAGS="$CXXFLAGS $WARNINGS" fi echo "CFLAGS=$CFLAGS" | sed 's/= */=/' echo "CXXFLAGS=$CXXFLAGS" | sed 's/= */=/' echo "LDFLAGS=$LDFLAGS" | sed 's/= */=/' echo "LIBS=$LIBS" | sed 's/= */=/' echo "LIBTERMCAP=$LIBTERMCAP" echo "USE_GLIBC=$USE_GLIBC" ) > MCONFIG