This extra handy patch enables readline support for qmgr. The command-line editing features of that library are quite nice for those of us used to it in Unix shells. From the Ben collection, modified a bit. --- pbs-2.3.12-pw/configure | 653 ++++++++++++++++++++---------- pbs-2.3.12-pw/configure.in | 24 + pbs-2.3.12-pw/src/cmds/Makefile.in | 2 pbs-2.3.12-pw/src/cmds/qmgr.c | 33 + pbs-2.3.12-pw/src/include/pbs_config.h.in | 3 5 files changed, 509 insertions(+), 206 deletions(-) diff -puN configure~qmgr-readline configure --- pbs-2.3.12/configure~qmgr-readline 2004-04-17 11:07:46.000000000 -0400 +++ pbs-2.3.12-pw/configure 2004-04-17 11:07:46.000000000 -0400 @@ -83,7 +83,7 @@ # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -485,7 +485,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -666,9 +666,11 @@ ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +ac_exeext= +ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -732,26 +734,26 @@ PBS_MKDIRS=buildutils/pbs_mkdirs # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:741: checking host system type" >&5 +echo "configure:743: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) - if host_alias=`$ac_config_guess`; then : + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac -host=`$ac_config_sub $host_alias` +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -911,7 +913,7 @@ TK=0; TCL=0; TCLX=0; orig_tclx_dir="$tclx_dir" if test "$tclx_dir" = yes; then echo $ac_n "checking Tclx library path prefix""... $ac_c" 1>&6 -echo "configure:915: checking Tclx library path prefix" >&5 +echo "configure:917: checking Tclx library path prefix" >&5 if eval "test \"`echo '$''{'pbs_cv_tclx_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -946,7 +948,7 @@ test -n "$GUI" -a "$tcl_dir" = no && tcl if test "$tcl_dir" = yes; then echo $ac_n "checking Tcl library path prefix""... $ac_c" 1>&6 -echo "configure:950: checking Tcl library path prefix" >&5 +echo "configure:952: checking Tcl library path prefix" >&5 if eval "test \"`echo '$''{'pbs_cv_tcl_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1012,7 +1014,7 @@ if test "$TCL" -eq 1; then done echo $ac_n "checking Tcl version""... $ac_c" 1>&6 -echo "configure:1016: checking Tcl version" >&5 +echo "configure:1018: checking Tcl version" >&5 if eval "test \"`echo '$''{'pbs_cv_ver_tcl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1053,7 +1055,7 @@ if test "$TK" -eq 1; then done echo $ac_n "checking Tk version""... $ac_c" 1>&6 -echo "configure:1057: checking Tk version" >&5 +echo "configure:1059: checking Tk version" >&5 if eval "test \"`echo '$''{'pbs_cv_ver_tk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1162,7 +1164,7 @@ TCLSH_PATH=""; WISH_PATH="" if test "$TCL" -eq 1 ; then # a loose symlink would be bad here echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:1166: checking for tclsh" >&5 +echo "configure:1168: checking for tclsh" >&5 if eval "test \"`echo '$''{'pbs_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1194,7 +1196,7 @@ if test "$TK" -eq 1 ; then # a loose symbolic link will screw us here echo $ac_n "checking for wish""... $ac_c" 1>&6 -echo "configure:1198: checking for wish" >&5 +echo "configure:1200: checking for wish" >&5 if eval "test \"`echo '$''{'pbs_cv_path_wish'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1529,7 +1531,7 @@ if test "${with_scp+set}" = set; then # Extract the first word of ""scp"", so it can be a program name with args. set dummy "scp"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1533: checking for $ac_word" >&5 +echo "configure:1535: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SCP_PATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1537,9 +1539,13 @@ else /*) ac_cv_path_SCP_PATH="$SCP_PATH" # Let the user override the test with a path. ;; + ?:/*) + ac_cv_path_SCP_PATH="$SCP_PATH" # Let the user override the test with a dos path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SCP_PATH="$ac_dir/$ac_word" @@ -1589,7 +1595,7 @@ fi # run the script in the aux dir to figure out what PBS "machine type" we are on # echo $ac_n "checking PBS machine type""... $ac_c" 1>&6 -echo "configure:1593: checking PBS machine type" >&5 +echo "configure:1599: checking PBS machine type" >&5 if eval "test \"`echo '$''{'pbs_cv_type_mach'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1649,7 +1655,7 @@ if test "${enable_sp2}" = "yes" ; then MOMLIBS="-ljm_client -lSDR" case "${PBS_MACH}" in aix*) echo $ac_n "checking for swtbl_load_table in -lswitchtbl""... $ac_c" 1>&6 -echo "configure:1653: checking for swtbl_load_table in -lswitchtbl" >&5 +echo "configure:1659: checking for swtbl_load_table in -lswitchtbl" >&5 ac_lib_var=`echo switchtbl'_'swtbl_load_table | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1657,7 +1663,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lswitchtbl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1839,7 +1845,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1843: checking for $ac_word" >&5 +echo "configure:1849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1847,9 +1853,13 @@ else /*) ac_cv_path_SENDMAIL_CMD="$SENDMAIL_CMD" # Let the user override the test with a path. ;; + ?:/*) + ac_cv_path_SENDMAIL_CMD="$SENDMAIL_CMD" # Let the user override the test with a dos path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ${sendmail_maybe_in}$ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="${sendmail_maybe_in}" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SENDMAIL_CMD="$ac_dir/$ac_word" @@ -1897,15 +1907,16 @@ EOF # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1901: checking for $ac_word" >&5 +echo "configure:1911: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_LEX="flex" @@ -1930,7 +1941,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1934: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1945: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1938,7 +1949,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1972,7 +1983,7 @@ fi fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1976: checking whether ln -s works" >&5 +echo "configure:1987: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1993,7 +2004,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1997: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:2008: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2022,15 +2033,16 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2026: checking for $ac_word" >&5 +echo "configure:2037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" @@ -2053,15 +2065,16 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2057: checking for $ac_word" >&5 +echo "configure:2069: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_YACC="$ac_prog" @@ -2091,7 +2104,7 @@ test -n "$YACC" || YACC="yacc" # Always use the supplied install-sh script instead of trying to divine # which OS has a good install program. echo $ac_n "checking for the install-sh script""... $ac_c" 1>&6 -echo "configure:2095: checking for the install-sh script" >&5 +echo "configure:2108: checking for the install-sh script" >&5 if test -z "$INSTALL"; then INSTALL="$ac_install_sh" fi @@ -2109,15 +2122,16 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2113: checking for $ac_word" >&5 +echo "configure:2126: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TBL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$TBL"; then ac_cv_prog_TBL="$TBL" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_TBL="$ac_prog" @@ -2143,15 +2157,16 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2147: checking for $ac_word" >&5 +echo "configure:2161: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PIC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$PIC"; then ac_cv_prog_PIC="$PIC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_PIC="$ac_prog" @@ -2177,15 +2192,16 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2181: checking for $ac_word" >&5 +echo "configure:2196: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$ROFF"; then ac_cv_prog_ROFF="$ROFF" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_ROFF="$ac_prog" @@ -2211,7 +2227,7 @@ test -n "$ROFF" || ROFF="exit" echo $ac_n "checking whether ${MAKE-make} understands '.POSIX:'""... $ac_c" 1>&6 -echo "configure:2215: checking whether ${MAKE-make} understands '.POSIX:'" >&5 +echo "configure:2231: checking whether ${MAKE-make} understands '.POSIX:'" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_${ac_make}_posix_target'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2240,7 +2256,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} understands an initial '+'""... $ac_c" 1>&6 -echo "configure:2244: checking whether ${MAKE-make} understands an initial '+'" >&5 +echo "configure:2260: checking whether ${MAKE-make} understands an initial '+'" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_${ac_make}_posix_plus'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2273,15 +2289,16 @@ pbs_save_CFLAGS="$CFLAGS" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2277: checking for $ac_word" >&5 +echo "configure:2293: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -2302,16 +2319,17 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2306: checking for $ac_word" >&5 +echo "configure:2323: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -2346,25 +2364,61 @@ else echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2374: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2354: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2406: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross -cat > conftest.$ac_ext < conftest.$ac_ext << EOF + +#line 2417 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:2368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2378,18 +2432,24 @@ else ac_cv_prog_cc_works=no fi rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2388: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2448: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2393: checking whether we are using GNU C" >&5 +echo "configure:2453: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2398,7 +2458,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2409,11 +2469,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2417: checking whether ${CC-cc} accepts -g" >&5 +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:2481: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2428,16 +2492,20 @@ rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then CFLAGS="-g -O2" else - CFLAGS="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi CFLAGS="$pbs_save_CFLAGS" @@ -2466,7 +2534,7 @@ MOM_CHECKPOINT=0 case "$PBS_MACH" in unicos*) MOM_CHECKPOINT=1 ;; irix6*) echo $ac_n "checking for atcheckpoint in -lcpr""... $ac_c" 1>&6 -echo "configure:2470: checking for atcheckpoint in -lcpr" >&5 +echo "configure:2538: checking for atcheckpoint in -lcpr" >&5 ac_lib_var=`echo cpr'_'atcheckpoint | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2474,7 +2542,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcpr $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2531,7 +2599,7 @@ esac echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2535: checking size of int" >&5 +echo "configure:2603: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2539,18 +2607,18 @@ else ac_cv_sizeof_int=20 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(int)); - exit(0); + return(0); } EOF -if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -2570,7 +2638,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2574: checking size of long" >&5 +echo "configure:2642: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2578,18 +2646,18 @@ else ac_cv_sizeof_long=21 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(long)); - exit(0); + return(0); } EOF -if { (eval echo configure:2593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2609,7 +2677,7 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:2613: checking size of float" >&5 +echo "configure:2681: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2617,18 +2685,18 @@ else ac_cv_sizeof_float=22 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(float)); - exit(0); + return(0); } EOF -if { (eval echo configure:2632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -2648,7 +2716,7 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:2652: checking size of double" >&5 +echo "configure:2720: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2656,18 +2724,18 @@ else ac_cv_sizeof_double=23 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(double)); - exit(0); + return(0); } EOF -if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -2687,7 +2755,7 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:2691: checking size of long double" >&5 +echo "configure:2759: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2695,18 +2763,18 @@ else ac_cv_sizeof_long_double=24 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(long double)); - exit(0); + return(0); } EOF -if { (eval echo configure:2710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -2726,7 +2794,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2730: checking size of short" >&5 +echo "configure:2798: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2734,18 +2802,18 @@ else ac_cv_sizeof_short=25 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(short)); - exit(0); + return(0); } EOF -if { (eval echo configure:2749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2765,7 +2833,7 @@ EOF echo $ac_n "checking size of unsigned""... $ac_c" 1>&6 -echo "configure:2769: checking size of unsigned" >&5 +echo "configure:2837: checking size of unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2773,18 +2841,18 @@ else ac_cv_sizeof_unsigned=26 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(unsigned)); - exit(0); + return(0); } EOF -if { (eval echo configure:2788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned=`cat conftestval` else @@ -2804,7 +2872,7 @@ EOF echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6 -echo "configure:2808: checking size of unsigned int" >&5 +echo "configure:2876: checking size of unsigned int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2812,18 +2880,18 @@ else ac_cv_sizeof_unsigned_int=27 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(unsigned int)); - exit(0); + return(0); } EOF -if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_int=`cat conftestval` else @@ -2843,7 +2911,7 @@ EOF echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6 -echo "configure:2847: checking size of unsigned short" >&5 +echo "configure:2915: checking size of unsigned short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2851,18 +2919,18 @@ else ac_cv_sizeof_unsigned_short=28 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(unsigned short)); - exit(0); + return(0); } EOF -if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_short=`cat conftestval` else @@ -2882,7 +2950,7 @@ EOF echo $ac_n "checking size of unsigned char""... $ac_c" 1>&6 -echo "configure:2886: checking size of unsigned char" >&5 +echo "configure:2954: checking size of unsigned char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2890,18 +2958,18 @@ else ac_cv_sizeof_unsigned_char=29 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(unsigned char)); - exit(0); + return(0); } EOF -if { (eval echo configure:2905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_char=`cat conftestval` else @@ -2921,7 +2989,7 @@ EOF echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6 -echo "configure:2925: checking size of unsigned long" >&5 +echo "configure:2993: checking size of unsigned long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2929,18 +2997,18 @@ else ac_cv_sizeof_unsigned_long=30 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(unsigned long)); - exit(0); + return(0); } EOF -if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_unsigned_long=`cat conftestval` else @@ -2960,7 +3028,7 @@ EOF echo $ac_n "checking size of signed char""... $ac_c" 1>&6 -echo "configure:2964: checking size of signed char" >&5 +echo "configure:3032: checking size of signed char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_signed_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2968,18 +3036,18 @@ else ac_cv_sizeof_signed_char=31 else cat > conftest.$ac_ext < -main() +int main() { FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); + if (!f) return(1); fprintf(f, "%d\n", sizeof(signed char)); - exit(0); + return(0); } EOF -if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_signed_char=`cat conftestval` else @@ -2999,7 +3067,7 @@ EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3003: checking how to run the C preprocessor" >&5 +echo "configure:3071: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3014,14 +3082,14 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:3092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else @@ -3031,14 +3099,31 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:3109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else @@ -3051,6 +3136,8 @@ fi rm -f conftest* fi rm -f conftest* +fi +rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" @@ -3060,14 +3147,14 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3064: checking whether char is unsigned" >&5 +echo "configure:3151: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -3124,12 +3211,12 @@ fi echo $ac_n "checking for h_errno declaration in netdb.h""... $ac_c" 1>&6 -echo "configure:3128: checking for h_errno declaration in netdb.h" >&5 +echo "configure:3215: checking for h_errno declaration in netdb.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_h_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_UNISTD_H @@ -3141,7 +3228,7 @@ int main() { int _ZzQ = (int)(h_errno + 1); ; return 0; } EOF -if { (eval echo configure:3145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_h_errno=yes else @@ -3163,12 +3250,12 @@ fi echo $ac_n "checking for FD_SET eclaration in sys/select.h""... $ac_c" 1>&6 -echo "configure:3167: checking for FD_SET eclaration in sys/select.h" >&5 +echo "configure:3254: checking for FD_SET eclaration in sys/select.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_fdset_sys_select_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef FD_SETSIZE @@ -3200,12 +3287,12 @@ fi for ac_func in setresuid setresgid seteuid setegid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3204: checking for $ac_func" >&5 +echo "configure:3291: checking for $ac_func" >&5 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3253,12 +3340,167 @@ fi done +readline="test" +READLINE_LIBS="" +if test "$readline" = "test"; then + echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:3348: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lreadline $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + READLINELIBS="$READLINELIBS -lreadline" + readline="yes" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "$readline" = "test"; then + unset ac_cv_lib_readline_readline + echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:3392: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lreadline -lncurses $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + READLINELIBS="$READLINELIBS -lreadline -lncurses" + readline="yes" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "$readline" = "test"; then + for ac_func in readline +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3437: checking for $ac_func" >&5 +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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +fi + +if test "$readline" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_READLINE 1 +EOF + + +fi + # # nsl is needed on some systems but duplicates libc.a on others (O2000s) # echo $ac_n "checking for xdr_int in -lc""... $ac_c" 1>&6 -echo "configure:3262: checking for xdr_int in -lc" >&5 +echo "configure:3504: checking for xdr_int in -lc" >&5 ac_lib_var=`echo c'_'xdr_int | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3266,7 +3508,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3296,7 +3538,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for xdr_int in -lnsl""... $ac_c" 1>&6 -echo "configure:3300: checking for xdr_int in -lnsl" >&5 +echo "configure:3542: checking for xdr_int in -lnsl" >&5 ac_lib_var=`echo nsl'_'xdr_int | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3304,7 +3546,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3345,7 +3587,7 @@ fi fi echo $ac_n "checking for ruserok in -lc""... $ac_c" 1>&6 -echo "configure:3349: checking for ruserok in -lc" >&5 +echo "configure:3591: checking for ruserok in -lc" >&5 ac_lib_var=`echo c'_'ruserok | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3353,7 +3595,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3383,7 +3625,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for ruserok in -lsocket""... $ac_c" 1>&6 -echo "configure:3387: checking for ruserok in -lsocket" >&5 +echo "configure:3629: checking for ruserok in -lsocket" >&5 ac_lib_var=`echo socket'_'ruserok | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3391,7 +3633,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3432,7 +3674,7 @@ fi fi echo $ac_n "checking for nlist in -lc""... $ac_c" 1>&6 -echo "configure:3436: checking for nlist in -lc" >&5 +echo "configure:3678: checking for nlist in -lc" >&5 ac_lib_var=`echo c'_'nlist | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3440,7 +3682,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3470,7 +3712,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nlist in -lelf""... $ac_c" 1>&6 -echo "configure:3474: checking for nlist in -lelf" >&5 +echo "configure:3716: checking for nlist in -lelf" >&5 ac_lib_var=`echo elf'_'nlist | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3478,7 +3720,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lelf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3519,7 +3761,7 @@ fi fi echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6 -echo "configure:3523: checking for kvm_open in -lkvm" >&5 +echo "configure:3765: checking for kvm_open in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3527,7 +3769,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lkvm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3567,7 +3809,7 @@ fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:3571: checking for dlopen in -ldl" >&5 +echo "configure:3813: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3575,7 +3817,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3618,18 +3860,18 @@ fi # if sys/ioctl.h exists then define a symbol ac_safe=`echo "sys/ioctl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:3622: checking for sys/ioctl.h" >&5 +echo "configure:3864: checking for sys/ioctl.h" >&5 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:3874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -3656,13 +3898,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3660: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3902: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -3680,7 +3922,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -3705,12 +3947,12 @@ fi for ac_func in atexit on_exit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3709: checking for $ac_func" >&5 +echo "configure:3951: checking for $ac_func" >&5 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3889,7 +4131,7 @@ EOF # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -3956,7 +4198,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3976,9 +4218,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -4054,6 +4298,7 @@ s%@MAKE_POSIX_PLUS@%$MAKE_POSIX_PLUS%g s%@CC@%$CC%g s%@MOM_ADDTL_OBJS@%$MOM_ADDTL_OBJS%g s%@CPP@%$CPP%g +s%@READLINELIBS@%$READLINELIBS%g s%@mkinclude_subdir@%$mkinclude_subdir%g s%@pbs_os_version@%$pbs_os_version%g s%@pbs_os_type@%$pbs_os_type%g diff -puN configure.in~qmgr-readline configure.in --- pbs-2.3.12/configure.in~qmgr-readline 2004-04-17 11:07:46.000000000 -0400 +++ pbs-2.3.12-pw/configure.in 2004-04-17 11:07:46.000000000 -0400 @@ -1274,6 +1274,30 @@ AC_DECL_FD_SET_SYS_SELECT_H dnl under HP-UX seteuid does not exist, look for setresuid instead AC_CHECK_FUNCS(setresuid setresgid seteuid setegid) +dnl use the readline function if available +readline="test" +READLINE_LIBS="" +if test "$readline" = "test"; then + AC_CHECK_LIB(readline,readline, + [READLINELIBS="$READLINELIBS -lreadline" + readline="yes"]) +fi +if test "$readline" = "test"; then + dnl Disable the cache + unset ac_cv_lib_readline_readline + AC_CHECK_LIB(readline,readline, + [READLINELIBS="$READLINELIBS -lreadline -lncurses" + readline="yes"],,-lncurses) +fi +if test "$readline" = "test"; then + AC_CHECK_FUNCS(readline,readline="yes") +fi + +if test "$readline" = "yes"; then + AC_DEFINE(HAVE_READLINE) + AC_SUBST(READLINELIBS) +fi + dnl dnl Checks for libraries. dnl diff -puN src/cmds/Makefile.in~qmgr-readline src/cmds/Makefile.in --- pbs-2.3.12/src/cmds/Makefile.in~qmgr-readline 2004-04-17 11:07:46.000000000 -0400 +++ pbs-2.3.12-pw/src/cmds/Makefile.in 2004-04-17 11:07:46.000000000 -0400 @@ -164,7 +164,7 @@ qdel: qdel.o; $(DFLT_ACTION) qdisable: qdisable.o; $(DFLT_ACTION) qenable: qenable.o; $(DFLT_ACTION) qhold: qhold.o; $(DFLT_ACTION) -qmgr: qmgr.o; $(DFLT_ACTION) +qmgr: qmgr.o; $(DFLT_ACTION) @READLINELIBS@ qmove: qmove.o; $(DFLT_ACTION) qmsg: qmsg.o; $(DFLT_ACTION) qorder: qorder.o; $(DFLT_ACTION) diff -puN src/cmds/qmgr.c~qmgr-readline src/cmds/qmgr.c --- pbs-2.3.12/src/cmds/qmgr.c~qmgr-readline 2004-04-17 11:07:46.000000000 -0400 +++ pbs-2.3.12-pw/src/cmds/qmgr.c 2004-04-17 11:07:46.000000000 -0400 @@ -131,6 +131,14 @@ #include #include #include +#ifdef HAVE_READLINE +/* Do not want or need , and it insists on trying to + * find since it seems -DHAVE_CONFIG_H, bad, in linux rh7.3 + * (but not 7.2 and before) at least. */ +#define _TILDE_H_ +#include +#include +#endif /* PBS include files */ #include @@ -1463,6 +1471,11 @@ get_request( request ) char *lp; /* Pointer into line */ int eoc; /* End of command */ char quote; /* Either ' or " */ +#ifdef HAVE_READLINE + char *rlread = 0; /* Buffer for readline */ + int readlen; + int buflen; +#endif /* Make sure something is in the stdin line */ if ( empty ) @@ -1472,6 +1485,24 @@ get_request( request ) ll = 0; while ( !eol ) { +#ifdef HAVE_READLINE + if ( isatty(0) && isatty(1) ) + { + if ( lp == line ) + rlread = readline(prompt); + else + rlread = readline(contin); + if (!rlread) return EOF; + if (*rlread) add_history(rlread); + readlen = strlen(rlread); + buflen = sizeof(line) - (lp - line); + memcpy(lp, rlread, readlen < buflen ? readlen : buflen); + free(rlread); + line[sizeof(line)-1] = 0; + } else if (fgets(lp, sizeof(line) - ll, stdin) == NULL) { + return EOF; + } +#else if ( isatty(0) && isatty(1) ) { if ( lp == line ) @@ -1479,8 +1510,8 @@ get_request( request ) else printf(contin); } - if ( fgets(lp, sizeof(line)-ll, stdin) == NULL ) return EOF; +#endif ll = strlen(line); if ( line[ll-1] == '\n' ) { /* remove newline */ diff -puN src/include/pbs_config.h.in~qmgr-readline src/include/pbs_config.h.in --- pbs-2.3.12/src/include/pbs_config.h.in~qmgr-readline 2004-04-17 11:07:46.000000000 -0400 +++ pbs-2.3.12-pw/src/include/pbs_config.h.in 2004-04-17 11:07:46.000000000 -0400 @@ -218,6 +218,9 @@ /* Define if you have the on_exit function. */ #undef HAVE_ON_EXIT +/* Define if you have the readline function. */ +#undef HAVE_READLINE + /* Define if you have the dl library (-ldl). */ #undef HAVE_LIBDL _