From 827e165e5b80d999a8a30b3292f9bbb4a8c772e1 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Tue, 14 Jul 2009 03:33:56 +0000 Subject: Build on solaris --- configure | 138 ++++++++++++++++++++++++++++++++++++++++-------------- configure.in | 3 +- h/config.h.in | 9 ++++ lib/Makefile.in | 2 +- server/bdump.c | 4 ++ server/utf8proc.h | 4 ++ zwgc/tty_filter.c | 7 +++ 7 files changed, 131 insertions(+), 36 deletions(-) diff --git a/configure b/configure index af717aa..1feead6 100755 --- a/configure +++ b/configure @@ -856,6 +856,7 @@ X_LIBS X_EXTRA_LIBS XCLIENTS ZWGC_LIBX11 +LIBICONV TLIB RLIB SLIB @@ -4190,7 +4191,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4193 "configure"' > conftest.$ac_ext + echo '#line 4194 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6756,11 +6757,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6759: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6760: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6763: \$? = $ac_status" >&5 + echo "$as_me:6764: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6989,11 +6990,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6992: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6993: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6996: \$? = $ac_status" >&5 + echo "$as_me:6997: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7049,11 +7050,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7052: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7053: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7056: \$? = $ac_status" >&5 + echo "$as_me:7057: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8379,7 +8380,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 8382 "configure"' > conftest.$ac_ext + echo '#line 8383 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9217,7 +9218,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:11498: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11501: \$? = $ac_status" >&5 + echo "$as_me:11502: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11554,11 +11555,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11557: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11558: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11561: \$? = $ac_status" >&5 + echo "$as_me:11562: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12065,7 +12066,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 12068 "configure"' > conftest.$ac_ext + echo '#line 12069 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12903,7 +12904,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13832: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13835: \$? = $ac_status" >&5 + echo "$as_me:13836: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13888,11 +13889,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13891: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13892: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13895: \$? = $ac_status" >&5 + echo "$as_me:13896: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15198,7 +15199,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 15201 "configure"' > conftest.$ac_ext + echo '#line 15202 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -15942,11 +15943,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15945: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15946: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15949: \$? = $ac_status" >&5 + echo "$as_me:15950: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16175,11 +16176,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16178: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16179: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16182: \$? = $ac_status" >&5 + echo "$as_me:16183: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16235,11 +16236,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16238: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16239: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16242: \$? = $ac_status" >&5 + echo "$as_me:16243: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17565,7 +17566,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 17568 "configure"' > conftest.$ac_ext + echo '#line 17569 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -18403,7 +18404,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking for libiconv_open in -liconv... $ECHO_C" >&6; } +if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-liconv $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libiconv_open (); +int +main () +{ +return libiconv_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_iconv_libiconv_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_iconv_libiconv_open=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv_open" >&5 +echo "${ECHO_T}$ac_cv_lib_iconv_libiconv_open" >&6; } +if test $ac_cv_lib_iconv_libiconv_open = yes; then + LIBICONV=-liconv; +fi + { echo "$as_me:$LINENO: checking for tgetstr in -lcurses" >&5 echo $ECHO_N "checking for tgetstr in -lcurses... $ECHO_C" >&6; } @@ -26901,6 +26970,7 @@ X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim XCLIENTS!$XCLIENTS$ac_delim ZWGC_LIBX11!$ZWGC_LIBX11$ac_delim +LIBICONV!$LIBICONV$ac_delim TLIB!$TLIB$ac_delim RLIB!$RLIB$ac_delim SLIB!$SLIB$ac_delim @@ -26908,7 +26978,6 @@ KRB4_LIBS!$KRB4_LIBS$ac_delim krb5config!$krb5config$ac_delim KRB5_LIBS!$KRB5_LIBS$ac_delim LIBZEPHYR_LIBS!$LIBZEPHYR_LIBS$ac_delim -HESIOD_LIBS!$HESIOD_LIBS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -26950,6 +27019,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +HESIOD_LIBS!$HESIOD_LIBS$ac_delim REGEX_LIBS!$REGEX_LIBS$ac_delim SS_LIBS!$SS_LIBS$ac_delim ARES_LIBS!$ARES_LIBS$ac_delim @@ -26957,7 +27027,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 5; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index ab15ca2..901a370 100644 --- a/configure.in +++ b/configure.in @@ -39,7 +39,7 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h paths.h sgtty.h unistd.h malloc.h term.h) AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h sys/time.h sys/file.h sys/utsname.h) AC_CHECK_HEADERS(sys/select.h sys/msgbuf.h sys/cdefs.h krb5_err.h termcap.h) -AC_CHECK_HEADERS(arpa/nameser_compat.h) +AC_CHECK_HEADERS(arpa/nameser_compat.h stdbool.h termio.h curses.h) if test "$no_x" != "yes"; then ZWGC_LIBX11=-lX11 @@ -75,6 +75,7 @@ AC_SEARCH_LIBS(socket, socket) AC_CHECK_LIB(44bsd, strerror) +AC_CHECK_LIB(iconv, libiconv_open, [LIBICONV=-liconv; AC_SUBST(LIBICONV)]) AC_CHECK_LIB(curses, tgetstr, [TLIB=-lcurses], [TLIB=-ltermcap]) AC_CHECK_LIB(src, srcsrpy, [SLIB=-lsrc; AC_DEFINE(HAVE_SRC)]) diff --git a/h/config.h.in b/h/config.h.in index 074306f..890dbbb 100644 --- a/h/config.h.in +++ b/h/config.h.in @@ -239,6 +239,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CURSES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIO_H + /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF diff --git a/lib/Makefile.in b/lib/Makefile.in index 3b95ffa..7541917 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -29,7 +29,7 @@ CFLAGS=@CFLAGS@ ${DEBUG} ALL_CFLAGS=${CFLAGS} -DSYSCONFDIR=\"${sysconfdir}\" -I${top_srcdir}/h \ -I${BUILDTOP}/h ${CPPFLAGS} LDFLAGS=@LDFLAGS@ -LIBS=@LIBZEPHYR_LIBS@ -lcom_err +LIBS=@LIBZEPHYR_LIBS@ -lcom_err @LIBICONV@ OBJS = zephyr_err.lo ZAsyncLocate.lo ZCkAuth.lo ZCkIfNot.lo ZClosePort.lo \ ZCmpUID.lo ZCmpUIDP.lo ZFlsLocs.lo ZFlsSubs.lo ZFmtAuth.lo \ diff --git a/server/bdump.c b/server/bdump.c index 9f2c506..2de30b0 100644 --- a/server/bdump.c +++ b/server/bdump.c @@ -20,6 +20,10 @@ static const char rcsid_bdump_c[] = "$Id$"; #endif /* lint */ +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + /* * External functions are: * diff --git a/server/utf8proc.h b/server/utf8proc.h index f883054..2fd4f17 100644 --- a/server/utf8proc.h +++ b/server/utf8proc.h @@ -55,7 +55,11 @@ #include +#ifdef HAVE_STDBOOL_H #include +#else +typedef enum {false = 0, true = 1} bool; +#endif #include #include #include diff --git a/zwgc/tty_filter.c b/zwgc/tty_filter.c index 6921b5f..ea607e9 100644 --- a/zwgc/tty_filter.c +++ b/zwgc/tty_filter.c @@ -28,6 +28,13 @@ static const char rcsid_tty_filter_c[] = "$Id$"; #include #else #ifdef HAVE_TERM_H +#ifdef HAVE_TERMIO_H +/* I blame Solaris. Solaris to blame. */ +#include +#endif +#ifdef HAVE_CURSES_H +#include +#endif #include #endif #endif -- cgit v1.2.3