From 7cc1122bbe1c9fdeaa445fc0b5efc2ceecad7648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Wed, 31 Jan 1996 20:34:06 +0000 Subject: [PATCH] Massaged the configure files so that we can build under NEXTSTEP 3.3. Some kludges to prevent cpp bugs and link errors where also neccessary. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@219 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/configure | 162 +++++++++++++++++++++--------------- appl/telnet/configure.in | 16 ++++ appl/telnet/telnet/telnet.c | 3 +- lib/roken/signal.c | 6 ++ 4 files changed, 119 insertions(+), 68 deletions(-) diff --git a/appl/telnet/configure b/appl/telnet/configure index a10453ddc..c1a3e3c01 100755 --- a/appl/telnet/configure +++ b/appl/telnet/configure @@ -517,6 +517,60 @@ else echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" @@ -594,6 +648,34 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo $ac_n "checking for NEXTSTEP""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'krb_cv_sys_nextstep'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + krb_cv_sys_nextstep=yes +else + rm -rf conftest* + krb_cv_sys_nextstep=no +fi +rm -f conftest* + +fi + +test $krb_cv_sys_nextstep = "yes" && CFLAGS="$CFLAGS -posix" +test $krb_cv_sys_nextstep = "yes" && LIBS="$LIBS -posix" +echo "$ac_t""$krb_cv_sys_nextstep" 1>&6 + # # authentication # @@ -845,7 +927,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - for ac_hdr in termios.h termio.h sys/select.h sys/resource.h sys/tty.h utmpx.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` @@ -1369,7 +1397,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1409,7 +1437,7 @@ if eval "test \"`echo '$''{'krb_cv_sys_streamspty'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1548,6 +1576,7 @@ s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@CC@%$CC%g s%@RANLIB@%$RANLIB%g +s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@AUTHENTICATION@%$AUTHENTICATION%g @@ -1568,7 +1597,6 @@ s%@ENV_HACK@%$ENV_HACK%g s%@OLD_ENVIRON@%$OLD_ENVIRON%g s%@LIBOBJS@%$LIBOBJS%g s%@HAVE_LIBTERMCAP@%$HAVE_LIBTERMCAP%g -s%@CPP@%$CPP%g s%@STREAMSPTY@%$STREAMSPTY%g CEOF diff --git a/appl/telnet/configure.in b/appl/telnet/configure.in index 3a77c937e..622869ede 100644 --- a/appl/telnet/configure.in +++ b/appl/telnet/configure.in @@ -18,6 +18,7 @@ test -z "$LDFLAGS" && LDFLAGS=-g AC_PROG_CC AC_PROG_RANLIB +AC_PROG_CPP # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" @@ -27,6 +28,21 @@ AC_SUBST(LDFLAGS)dnl AC_PROG_INSTALL +dnl +dnl NEXTSTEP is not posix compliant by default, +dnl you need a switch -posix to the compiler +dnl +AC_MSG_CHECKING(for NEXTSTEP) +AC_CACHE_VAL(krb_cv_sys_nextstep, +AC_EGREP_CPP(yes, +[#ifdef NeXT + yes +#endif +], krb_cv_sys_nextstep=yes, krb_cv_sys_nextstep=no) ) +test $krb_cv_sys_nextstep = "yes" && CFLAGS="$CFLAGS -posix" +test $krb_cv_sys_nextstep = "yes" && LIBS="$LIBS -posix" +AC_MSG_RESULT($krb_cv_sys_nextstep) + # # authentication # diff --git a/appl/telnet/telnet/telnet.c b/appl/telnet/telnet/telnet.c index a070e0694..b89824161 100644 --- a/appl/telnet/telnet/telnet.c +++ b/appl/telnet/telnet/telnet.c @@ -685,7 +685,8 @@ mklist(buf, name) * Skip entries with spaces or non-ascii values. * Convert lower case letters to upper case. */ - if ((c == ' ') || !isascii(c)) +#define ISASCII(c) (0 <= (c) && (c) < 0200) + if ((c == ' ') || !ISASCII(c)) n = 1; else if (islower(c)) *cp = toupper(c); diff --git a/lib/roken/signal.c b/lib/roken/signal.c index 126fe3b4b..5cdab14c8 100644 --- a/lib/roken/signal.c +++ b/lib/roken/signal.c @@ -2,6 +2,11 @@ RCSID("$Id$"); +/* + * We would like to always use this signal but there is a link error + * on NEXTSTEP + */ +#ifndef NeXT /* * Bugs: * @@ -38,3 +43,4 @@ signal(int iSig, SigAction pAction) return(saOld.sa_handler); } +#endif