diff options
author | mwesdorp <mwesdorp> | 2014-03-01 17:01:09 +0000 |
---|---|---|
committer | mwesdorp <mwesdorp> | 2014-03-01 17:01:09 +0000 |
commit | c4fcec88ba2ee0c96f3a36c053c1fa5e855426ed (patch) | |
tree | 7b631ef8b8f469431b9559c12158b729858b809f | |
parent | d53419f61525c97f4018e5051617ea4a3d9b0b21 (diff) |
sqsh-2.5 new features and bugfixes
-rw-r--r-- | aclocal.m4 | 156 | ||||
-rwxr-xr-x | conf.sh | 24 | ||||
-rwxr-xr-x | configure | 1123 | ||||
-rw-r--r-- | configure.in | 30 | ||||
-rw-r--r-- | cygwin/Makefile-syb15 | 8 | ||||
-rw-r--r-- | cygwin/Makefile-syb15-x64 | 8 | ||||
-rw-r--r-- | scripts/install.sh | 6 | ||||
-rwxr-xr-x | scripts/install.sh.in | 2 | ||||
-rwxr-xr-x | scripts/make_dist.sh | 2 | ||||
-rw-r--r-- | scripts/make_wrapper.sh | 2 | ||||
-rw-r--r-- | scripts/make_wrapper.sh.in | 5 | ||||
-rw-r--r-- | src/Makefile.in | 7 | ||||
-rw-r--r-- | src/var.h | 1 |
13 files changed, 1056 insertions, 318 deletions
@@ -159,6 +159,36 @@ AC_DEFUN(AC_FIND_LIB, [ ]) +dnl # AC_BIT_MODE (M Wesdorp) +dnl # +dnl # Determines whether we are compiling and running code in 32 or 64 bit mode +dnl # +AC_DEFUN(AC_BIT_MODE, +[ + AC_MSG_CHECKING(Compiling 32/64 bit mode) + AC_CACHE_VAL(ac_cv_bit_mode, + [ + AC_TRY_RUN( + [ +main() { +#if defined (__LP64__) || defined (__LP64) || defined (_LP64) || defined (__arch64__) + exit (0); +#else + exit (1); +#endif +} + ], ac_cv_bit_mode=64, ac_cv_bit_mode=32) + ]) + + AC_MSG_RESULT($ac_cv_bit_mode) + + if (test "$ac_cv_bit_mode" = "64"); then + CPPFLAGS="-DSYB_LP64 $CPPFLAGS" + fi + AC_SUBST(CPPFLAGS) +]) + + dnl # AC_SYSV_SIGNALS (Scott C. Gray gray@voicenet.com) dnl # dnl # Determines behaviour of signals, if they need to be reinstalled @@ -204,7 +234,7 @@ AC_DEFUN([AC_SYBASE_ASE], [ # Is $SYBASE defined? # AC_MSG_CHECKING(Open Client installation) - if test "$SYBASE" = ""; then + if [[ "$SYBASE" = "" ]]; then AC_MSG_RESULT(no) AC_MSG_ERROR([Unable to locate Sybase installation. Check your SYBASE environment variable setting.]) fi @@ -212,77 +242,98 @@ AC_DEFUN([AC_SYBASE_ASE], [ SYBASE_OCOS= for subdir in $SYBASE $SYBASE/OCS $SYBASE/OCS-[[0-9]]* do - if test -d $subdir/include; then + if [[ -d $subdir/include ]]; then SYBASE_OCOS=$subdir break fi done - if test "$SYBASE_OCOS" = ""; then + if [[ "$SYBASE_OCOS" = "" ]]; then AC_MSG_RESULT(fail) AC_MSG_ERROR([Sybase include files not found in \$SYBASE. Check your SYBASE environment variable setting.]) fi + AC_MSG_RESULT($SYBASE_OCOS) AC_MSG_CHECKING(Open Client libraries) - if test "$with_devlib" = "yes" - then - SYBASE_LIBDIR="$SYBASE_OCOS/devlib" - else + #SYBASE_VERSION=`strings $SYBASE_OCOS/lib/lib*ct*.a 2>/dev/null | \ + # cut -c1-80 | fgrep 'Sybase Client-Library' | cut -d '/' -f 2 | uniq` + SYBASE_VERSION=`$SYBASE_OCOS/bin/isql -v 2>/dev/null | cut -c1-80 | fgrep 'Sybase CTISQL Utility' | cut -d '/' -f 2` + SYBASE_VERSION=`echo $SYBASE_VERSION | cut -d . -f 1` + + if [[ "$SYBASE_VERSION" = "" ]]; then + SYBASE_VERSION="FreeTDS" SYBASE_LIBDIR="$SYBASE_OCOS/lib" - fi + case "${host_os}" in + *cygwin) + SYBASE_LIBS="-lct -liconv" + CPPFLAGS="-D_MSC_VER=800 $CPPFLAGS" + ;; + *) + SYBASE_LIBS="-lct" + ;; + esac + else + if [[ "$with_devlib" = "yes" ]]; then + SYBASE_LIBDIR="$SYBASE_OCOS/devlib" + else + SYBASE_LIBDIR="$SYBASE_OCOS/lib" + fi - SYBASE_LIBS= + SYBASE_LIBS= - for i in blk cs ct tcl comn intl unic - do - x= - if test -f $SYBASE_LIBDIR/lib${i}.a; then - x="-l${i}" - else if test -f $SYBASE_LIBDIR/lib${i}64.a; then - x="-l${i}64" - else if test -f $SYBASE_LIBDIR/libsyb${i}.a; then - x="-lsyb${i}" - else if test -f $SYBASE_LIBDIR/libsyb${i}64.a; then - x="-lsyb${i}64" - fi - fi - fi - fi - if test -n $x ; then - SYBASE_LIBS="$SYBASE_LIBS $x" - fi - done - # - # Check for -ltds (FreeTDS project) - # - if test -f $SYBASE_LIBDIR/libtds.a; then - SYBASE_LIBS="$SYBASE_LIBS -ltds" + case "${host_os}" in + *cygwin) + if [[ $SYBASE_VERSION -ge 15 -a $ac_cv_bit_mode = "64" ]]; then + SYBASE_LIBS="-L../cygwin -lsybcs64 -lsybct64 -lsybblk64" + else if [[ $SYBASE_VERSION -ge 15 -a $ac_cv_bit_mode = "32" ]]; then + SYBASE_LIBS="-L../cygwin -lsybcs -lsybct -lsybblk" + else + SYBASE_LIBS="-L../cygwin -lcs -lct -lblk" + fi + fi + CPPFLAGS="-D_MSC_VER=800 $CPPFLAGS" + ;; + *) + for i in blk cs ct tcl comn intl unic + do + x= + if [[ -f $SYBASE_LIBDIR/lib${i}.a ]]; then + x="-l${i}" + else if [[ -f $SYBASE_LIBDIR/lib${i}64.a -a $ac_cv_bit_mode = "64" ]]; then + x="-l${i}64" + else if [[ -f $SYBASE_LIBDIR/libsyb${i}.a ]]; then + x="-lsyb${i}" + else if [[ -f $SYBASE_LIBDIR/libsyb${i}64.a -a $ac_cv_bit_mode = "64" ]]; then + x="-lsyb${i}64" + fi + fi + fi + fi + if test -n $x ; then + SYBASE_LIBS="$SYBASE_LIBS $x" + fi + done + ;; + esac fi AC_MSG_RESULT($SYBASE_LIBS) AC_MSG_CHECKING(Open Client needs net libraries) - SYBASE_VERSION=`strings $SYBASE_LIBDIR/lib*ct.a 2>/dev/null | \ - cut -c1-80 | fgrep 'Sybase Client-Library' | cut -d '/' -f 2` - SYBASE_VERSION=`echo $SYBASE_VERSION | cut -d . -f 1` - - if [[ "$SYBASE_VERSION" = "" ]]; then - SYBASE_VERSION="FreeTDS" - fi - if [[ "$SYBASE_VERSION" = "10" ]]; then if [[ -f $SYBASE_LIBDIR/libinsck.a ]]; then SYBASE_LIBS="$SYBASE_LIBS -linsck" AC_MSG_RESULT([yes [(]-linsck[)]]) - elif [[ -f $SYBASE_LIBDIR/libtli.a ]]; then + else if [[ -f $SYBASE_LIBDIR/libtli.a ]]; then SYBASE_LIBS="$SYBASE_LIBS -ltli" AC_MSG_RESULT([yes [(]-ltli[)]]) else AC_MSG_RESULT([yes [(]version 10.x[)]]) fi + fi else AC_MSG_RESULT([no [(]version $SYBASE_VERSION[)]]) fi @@ -310,6 +361,8 @@ AC_DEFUN([AC_SYBASE_ASE], [ SYBASE_OS="-lm -ldl -ldgc";; aix*) SYBASE_OS="-lm";; + *cygwin) + SYBASE_OS="";; *) SYBASE_OS="-lm -ldl";; esac @@ -319,21 +372,18 @@ AC_DEFUN([AC_SYBASE_ASE], [ if test "$with_static" = "yes" then SYBASE_LIBS=`echo $SYBASE_LIBS | \ - sed -e 's,-l\([[a-z]]*\),\$(SYBASE_OCOS)/lib/lib\1.a,g'` + sed -e 's,-l\([[a-z,0-9]]*\),\$(SYBASE_OCOS)/lib/lib\1.a,g'` fi - if test "$with_devlib" = "yes"; then - SYBASE_LIBDIR='-L$(SYBASE_OCOS)/devlib' - else - SYBASE_LIBDIR='-L$(SYBASE_OCOS)/lib' - fi - SYBASE_INCDIR='-I$(SYBASE_OCOS)/include' + SYBASE_INCDIR="-I${SYBASE_OCOS}/include" + SYBASE_LIBDIR="-L${SYBASE_LIBDIR}" - AC_SUBST(SYBASE_OCOS) - AC_SUBST(SYBASE_LIBS) - AC_SUBST(SYBASE_LIBDIR) + AC_SUBST(CPPFLAGS) + AC_SUBST(SYBASE) AC_SUBST(SYBASE_INCDIR) + AC_SUBST(SYBASE_LIBDIR) + AC_SUBST(SYBASE_LIBS) + AC_SUBST(SYBASE_OCOS) AC_SUBST(SYBASE_OS) - AC_SUBST(SYBASE) ]) @@ -1,22 +1,22 @@ #!/bin/bash # # File: conf.sh -# A wrapper file to run configure with the correct settings. -# Check your configuration and adjust accordingly. When you are finished -# run this script from the prompt: cd ~/sqsh-2.4 && ./conf.sh -# If configure completes successfully, continue with make and make install. +# A wrapper file to run configure with adjusted settings. +# Check your configuration and make changes accordingly. When you are finished +# run this script from the prompt: cd ~/sqsh-2.5 && ./conf.sh +# If 'configure' completes successfully, continue with make and make install. # -export CC="gcc" +# export CC="gcc" # # General 64bit compile flag settings (Linux, Solaris) # Uncomment the LDFLAGS line with -lcrypt if you want to use the \lock command # in combination with your Unix/Linux password to unlock the sqsh session. # -export CPPFLAGS="-DSYB_LP64" -export CFLAGS="-g -O2 -Wall -m64" -export LDFLAGS="-m64" +#export CPPFLAGS="-DSYB_LP64" +#export CFLAGS="-g -O2 -Wall -m64" +#export LDFLAGS="-m64" #export LDFLAGS="-m64 -lcrypt" # @@ -31,13 +31,13 @@ export LDFLAGS="-m64" # Uncomment these settings if you want to build a 32 bit version of sqsh # #export CPPFLAGS="" -#export CFLAGS="-g -O2 -Wall" -#export LDFLAGS="-lcrypt" +#export CFLAGS="-g -O2 -Wall -m32" +#export LDFLAGS="-m32 -lcrypt" # # If you want to include X-Windows and optional Motif libraries to create # result sets in a separate window (\go -x), then remove the # comment sign on -# the configure line. +# the configure line. (X and Motif development packages required) # -./configure --with-readline # --with-x --with-motif +./configure --with-readline --with-debug # --with-x --with-motif @@ -638,21 +638,16 @@ READLINE_LIBDIR READLINE_INCDIR DEF_READLINE SYBASE_OS -SYBASE_INCDIR -SYBASE_LIBDIR -SYBASE_LIBS SYBASE_OCOS +SYBASE_LIBS +SYBASE_LIBDIR +SYBASE_INCDIR +SYBASE DEF_POSIX CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC ATHENA_LIBS MOTIF_LIBS +DEF_DEBUG MOTIF_LIBDIR MOTIF_INCDIR MOTIF_PATH @@ -661,6 +656,13 @@ with_readline with_motif with_x DEF_AIX_FIX +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC host_os host_vendor host_cpu @@ -711,11 +713,12 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_gcc -with_x +with_debug with_readline with_old_readline with_static with_devlib +with_x with_motif ' ac_precious_vars='build_alias @@ -1343,11 +1346,12 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcc Use gcc, regardless of path - + --with-debug Enable sqsh debugging options --with-readline support fancy command line editing --with-old-readline Force readline backwards compatibilty --with-static Statically link in Sybase libraries --with-devlib Compile against Open Client devlibs + --with-motif support X11/Motif widgets --with-x use the X Window System @@ -1480,6 +1484,48 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1563,48 +1609,6 @@ fi } # ac_fn_c_try_link -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using @@ -2226,7 +2230,6 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -2298,121 +2301,6 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - -case "$host_os" in - aix*) - DEF_AIX_FIX="-DUSE_AIX_FIX" - - ;; - *) - ;; -esac - - - -# Check whether --with-gcc was given. -if test "${with_gcc+set}" = set; then : - withval=$with_gcc; with_gcc="yes" -fi - - - -# Check whether --with-x was given. -if test "${with_x+set}" = set; then : - withval=$with_x; -else - with_x="no" -fi - - - -# Check whether --with-readline was given. -if test "${with_readline+set}" = set; then : - withval=$with_readline; -else - with_readline="no" -fi - - - -# Check whether --with-old-readline was given. -if test "${with_old_readline+set}" = set; then : - withval=$with_old_readline; -else - with_old_readline="no" -fi - - - -# Check whether --with-static was given. -if test "${with_static+set}" = set; then : - withval=$with_static; -else - with_static="no" -fi - - - -# Check whether --with-devlib was given. -if test "${with_devlib+set}" = set; then : - withval=$with_devlib; -else - with_devlib="no" -fi - - - -# Check whether --with-motif was given. -if test "${with_motif+set}" = set; then : - withval=$with_motif; - if test "x$with_motif" != "xno" - then - if test "x$with_motif" != "xyes" - then - MOTIF_PATH=$with_motif - with_motif="yes" - MOTIF_INCDIR="-I$MOTIF_PATH/include/X11" - MOTIF_LIBDIR="-L$MOTIF_PATH/lib" - else - MOTIF_INCDIR="# -I/usr/X11/include" - MOTIF_LIBDIR="# -L/usr/X11/lib" - fi - with_x="yes" - DEF_MOTIF="-DUSE_MOTIF" - fi - - -else - - DEF_MOTIF="# -DUSE_MOTIF" - with_motif="no" - -fi - - - - - - - - - - -if test "x$with_x" != "xno" -then - if test "x$with_motif" != "xno" - then - MOTIF_LIBS=-lXm - ATHENA_LIBS= - else - MOTIF_LIBS= - ATHENA_LIBS=-lXaw - fi -fi - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3202,6 +3090,724 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Compiling 32/64 bit mode" >&5 +$as_echo_n "checking Compiling 32/64 bit mode... " >&6; } + if ${ac_cv_bit_mode+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +main() { +#if defined (__LP64__) || defined (__LP64) || defined (_LP64) || defined (__arch64__) + exit (0); +#else + exit (1); +#endif +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_bit_mode=64 +else + ac_cv_bit_mode=32 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_bit_mode" >&5 +$as_echo "$ac_cv_bit_mode" >&6; } + + if (test "$ac_cv_bit_mode" = "64"); then + CPPFLAGS="-DSYB_LP64 $CPPFLAGS" + fi + + + +case "$host_os" in + aix*) + DEF_AIX_FIX="-DUSE_AIX_FIX" + + ;; + *) + ;; +esac + + +# Check whether --with-gcc was given. +if test "${with_gcc+set}" = set; then : + withval=$with_gcc; +else + with_gcc="yes" +fi + + + +# Check whether --with-debug was given. +if test "${with_debug+set}" = set; then : + withval=$with_debug; +else + with_debug="no" +fi + + + +# Check whether --with-readline was given. +if test "${with_readline+set}" = set; then : + withval=$with_readline; +else + with_readline="yes" +fi + + + +# Check whether --with-old-readline was given. +if test "${with_old_readline+set}" = set; then : + withval=$with_old_readline; +else + with_old_readline="no" +fi + + + +# Check whether --with-static was given. +if test "${with_static+set}" = set; then : + withval=$with_static; +else + with_static="no" +fi + + + +# Check whether --with-devlib was given. +if test "${with_devlib+set}" = set; then : + withval=$with_devlib; +else + with_devlib="no" +fi + + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +else + with_x="no" +fi + + + +# Check whether --with-motif was given. +if test "${with_motif+set}" = set; then : + withval=$with_motif; + if test "x$with_motif" != "xno" + then + if test "x$with_motif" != "xyes" + then + MOTIF_PATH=$with_motif + with_motif="yes" + MOTIF_INCDIR="-I$MOTIF_PATH/include/X11" + MOTIF_LIBDIR="-L$MOTIF_PATH/lib" + else + MOTIF_INCDIR="# -I/usr/X11/include" + MOTIF_LIBDIR="# -L/usr/X11/lib" + fi + with_x="yes" + DEF_MOTIF="-DUSE_MOTIF" + fi + + +else + + DEF_MOTIF="# -DUSE_MOTIF" + with_motif="no" + +fi + + + + + + + + + + +if test "x$with_debug" != "xno" +then + DEF_DEBUG="-DDEBUG" + CFLAGS="-g -Wall" +fi + + +if test "x$with_x" != "xno" +then + if test "x$with_motif" != "xno" + then + MOTIF_LIBS=-lXm + ATHENA_LIBS= + else + MOTIF_LIBS= + ATHENA_LIBS=-lXaw + fi +fi + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +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="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3339,7 +3945,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : @@ -3446,7 +4051,7 @@ $as_echo "#define HAVE_VOLATILE 1" >>confdefs.h # { $as_echo "$as_me:${as_lineno-$LINENO}: checking Open Client installation" >&5 $as_echo_n "checking Open Client installation... " >&6; } - if test "$SYBASE" = ""; then + if [ "$SYBASE" = "" ]; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Unable to locate Sybase installation. Check your SYBASE environment variable setting." "$LINENO" 5 @@ -3455,56 +4060,84 @@ $as_echo "no" >&6; } SYBASE_OCOS= for subdir in $SYBASE $SYBASE/OCS $SYBASE/OCS-[0-9]* do - if test -d $subdir/include; then + if [ -d $subdir/include ]; then SYBASE_OCOS=$subdir break fi done - if test "$SYBASE_OCOS" = ""; then + if [ "$SYBASE_OCOS" = "" ]; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: fail" >&5 $as_echo "fail" >&6; } as_fn_error $? "Sybase include files not found in \$SYBASE. Check your SYBASE environment variable setting." "$LINENO" 5 fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYBASE_OCOS" >&5 $as_echo "$SYBASE_OCOS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Open Client libraries" >&5 $as_echo_n "checking Open Client libraries... " >&6; } - if test "$with_devlib" = "yes" - then - SYBASE_LIBDIR="$SYBASE_OCOS/devlib" - else + #SYBASE_VERSION=`strings $SYBASE_OCOS/lib/lib*ct*.a 2>/dev/null | \ + # cut -c1-80 | fgrep 'Sybase Client-Library' | cut -d '/' -f 2 | uniq` + SYBASE_VERSION=`$SYBASE_OCOS/bin/isql -v 2>/dev/null | cut -c1-80 | fgrep 'Sybase CTISQL Utility' | cut -d '/' -f 2` + SYBASE_VERSION=`echo $SYBASE_VERSION | cut -d . -f 1` + + if [ "$SYBASE_VERSION" = "" ]; then + SYBASE_VERSION="FreeTDS" SYBASE_LIBDIR="$SYBASE_OCOS/lib" - fi + case "${host_os}" in + *cygwin) + SYBASE_LIBS="-lct -liconv" + CPPFLAGS="-D_MSC_VER=800 $CPPFLAGS" + ;; + *) + SYBASE_LIBS="-lct" + ;; + esac + else + if [ "$with_devlib" = "yes" ]; then + SYBASE_LIBDIR="$SYBASE_OCOS/devlib" + else + SYBASE_LIBDIR="$SYBASE_OCOS/lib" + fi - SYBASE_LIBS= + SYBASE_LIBS= - for i in blk cs ct tcl comn intl unic - do - x= - if test -f $SYBASE_LIBDIR/lib${i}.a; then - x="-l${i}" - else if test -f $SYBASE_LIBDIR/lib${i}64.a; then - x="-l${i}64" - else if test -f $SYBASE_LIBDIR/libsyb${i}.a; then - x="-lsyb${i}" - else if test -f $SYBASE_LIBDIR/libsyb${i}64.a; then - x="-lsyb${i}64" - fi - fi - fi - fi - if test -n $x ; then - SYBASE_LIBS="$SYBASE_LIBS $x" - fi - done - # - # Check for -ltds (FreeTDS project) - # - if test -f $SYBASE_LIBDIR/libtds.a; then - SYBASE_LIBS="$SYBASE_LIBS -ltds" + case "${host_os}" in + *cygwin) + if [ $SYBASE_VERSION -ge 15 -a $ac_cv_bit_mode = "64" ]; then + SYBASE_LIBS="-L../cygwin -lsybcs64 -lsybct64 -lsybblk64" + else if [ $SYBASE_VERSION -ge 15 -a $ac_cv_bit_mode = "32" ]; then + SYBASE_LIBS="-L../cygwin -lsybcs -lsybct -lsybblk" + else + SYBASE_LIBS="-L../cygwin -lcs -lct -lblk" + fi + fi + CPPFLAGS="-D_MSC_VER=800 $CPPFLAGS" + ;; + *) + for i in blk cs ct tcl comn intl unic + do + x= + if [ -f $SYBASE_LIBDIR/lib${i}.a ]; then + x="-l${i}" + else if [ -f $SYBASE_LIBDIR/lib${i}64.a -a $ac_cv_bit_mode = "64" ]; then + x="-l${i}64" + else if [ -f $SYBASE_LIBDIR/libsyb${i}.a ]; then + x="-lsyb${i}" + else if [ -f $SYBASE_LIBDIR/libsyb${i}64.a -a $ac_cv_bit_mode = "64" ]; then + x="-lsyb${i}64" + fi + fi + fi + fi + if test -n $x ; then + SYBASE_LIBS="$SYBASE_LIBS $x" + fi + done + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYBASE_LIBS" >&5 @@ -3513,20 +4146,12 @@ $as_echo "$SYBASE_LIBS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Open Client needs net libraries" >&5 $as_echo_n "checking Open Client needs net libraries... " >&6; } - SYBASE_VERSION=`strings $SYBASE_LIBDIR/lib*ct.a 2>/dev/null | \ - cut -c1-80 | fgrep 'Sybase Client-Library' | cut -d '/' -f 2` - SYBASE_VERSION=`echo $SYBASE_VERSION | cut -d . -f 1` - - if [ "$SYBASE_VERSION" = "" ]; then - SYBASE_VERSION="FreeTDS" - fi - if [ "$SYBASE_VERSION" = "10" ]; then if [ -f $SYBASE_LIBDIR/libinsck.a ]; then SYBASE_LIBS="$SYBASE_LIBS -linsck" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (-linsck)" >&5 $as_echo "yes (-linsck)" >&6; } - elif [ -f $SYBASE_LIBDIR/libtli.a ]; then + else if [ -f $SYBASE_LIBDIR/libtli.a ]; then SYBASE_LIBS="$SYBASE_LIBS -ltli" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (-ltli)" >&5 $as_echo "yes (-ltli)" >&6; } @@ -3534,6 +4159,7 @@ $as_echo "yes (-ltli)" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version 10.x)" >&5 $as_echo "yes (version 10.x)" >&6; } fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (version $SYBASE_VERSION)" >&5 $as_echo "no (version $SYBASE_VERSION)" >&6; } @@ -3563,6 +4189,8 @@ $as_echo_n "checking Open Client OS libraries... " >&6; } SYBASE_OS="-lm -ldl -ldgc";; aix*) SYBASE_OS="-lm";; + *cygwin) + SYBASE_OS="";; *) SYBASE_OS="-lm -ldl";; esac @@ -3573,15 +4201,13 @@ $as_echo "$SYBASE_OS" >&6; } if test "$with_static" = "yes" then SYBASE_LIBS=`echo $SYBASE_LIBS | \ - sed -e 's,-l\([a-z]*\),\$(SYBASE_OCOS)/lib/lib\1.a,g'` + sed -e 's,-l\([a-z,0-9]*\),\$(SYBASE_OCOS)/lib/lib\1.a,g'` fi - if test "$with_devlib" = "yes"; then - SYBASE_LIBDIR='-L$(SYBASE_OCOS)/devlib' - else - SYBASE_LIBDIR='-L$(SYBASE_OCOS)/lib' - fi - SYBASE_INCDIR='-I$(SYBASE_OCOS)/include' + SYBASE_INCDIR="-I${SYBASE_OCOS}/include" + SYBASE_LIBDIR="-L${SYBASE_LIBDIR}" + + @@ -3597,7 +4223,7 @@ fi if test "$with_readline" = "no"; then DEF_READLINE="# -DUSE_READLINE" READLINE_INCDIR="# -I/usr/local/include" - READLINE_LIBDIR="# -I/usr/local/lib" + READLINE_LIBDIR="# -L/usr/local/lib" READLINE_LIBS="# -lreadline -lcurses" else DEF_READLINE="-DUSE_READLINE" @@ -3729,11 +4355,11 @@ else fi if test "${READLINE_LIBDIR}" != ""; then - CPPFLAGS="${CPPFLAGS} -L${READLINE_LIBDIR}" + LDFLAGS="${LDFLAGS} -L${READLINE_LIBDIR}" fi for lib in "-lHcurses" "-lcurses" "-lncurses" "-ltermcap" \ - "-ltermcap -lucb" + "-ltermcap" "-lucb" "-lhistory" do LIBS="${ORIG_LIBS} -lreadline ${lib}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4625,6 +5251,57 @@ $as_echo "#define gid_t int" >>confdefs.h fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcrypt" >&5 +$as_echo_n "checking for libcrypt... " >&6; } + if ${ac_cv_libcrypt+:} false; then : + $as_echo_n "(cached) " >&6 +else + + SEARCH_PATH="/lib:/usr/lib:/usr/local/lib:${HOME}/lib:${HOME}/usr/lib" + libdir="" + + if test "${LD_LIBRARY_PATH}" != ""; then + SEARCH_PATH="${LD_LIBRARY_PATH}:${SEARCH_PATH}" + fi + + if test "$LIBDIRS" != ""; then + SEARCH_PATH="$LIBDIRS:${SEARCH_PATH}" + fi + + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for dir in ${SEARCH_PATH}; do + for lib in ${dir}/libcrypt.*; do + if test -f "${lib}"; then + libdir=${dir} + break; + fi + done + + if test "${libdir}" != ""; then + break; + fi + done + IFS="$ac_save_ifs" + + ac_cv_libcrypt="${libdir}" + +fi + + + libdir=$ac_cv_libcrypt + + if test "${libdir}" != ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libdir" >&5 +$as_echo "$libdir" >&6; } + LIBS="${LIBS} -lcrypt" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : diff --git a/configure.in b/configure.in index 01e68ca..9d22f7e 100644 --- a/configure.in +++ b/configure.in @@ -5,8 +5,8 @@ dnl AC_INIT(src/sqsh_main.c) AC_CONFIG_HEADER(src/config.h) AC_CONFIG_AUX_DIR(autoconf) - AC_CANONICAL_HOST +AC_BIT_MODE dnl dnl Enable workarounds for various operating system bugs. @@ -21,16 +21,17 @@ case "$host_os" in ;; esac - AC_ARG_WITH([gcc], [ --with-gcc Use gcc, regardless of path], - [with_gcc="yes"], []) + [], [with_gcc="yes"]) -AC_ARG_WITH([x], [], [],[with_x="no"]) +AC_ARG_WITH([debug], + [ --with-debug Enable sqsh debugging options], + [], [with_debug="no"]) AC_ARG_WITH([readline], [ --with-readline support fancy command line editing], - [], [with_readline="no"]) + [], [with_readline="yes"]) AC_ARG_WITH([old-readline], [ --with-old-readline Force readline backwards compatibilty], @@ -44,6 +45,10 @@ AC_ARG_WITH([devlib], [ --with-devlib Compile against Open Client devlibs], [], [with_devlib="no"]) +AC_ARG_WITH([x], + [], + [], [with_x="no"]) + AC_ARG_WITH([motif], [ --with-motif support X11/Motif widgets], [ @@ -76,6 +81,13 @@ AC_SUBST(MOTIF_PATH) AC_SUBST(MOTIF_INCDIR) AC_SUBST(MOTIF_LIBDIR) +if test "x$with_debug" != "xno" +then + DEF_DEBUG="-DDEBUG" + CFLAGS="-g -Wall" +fi +AC_SUBST(DEF_DEBUG) + if test "x$with_x" != "xno" then if test "x$with_motif" != "xno" @@ -114,7 +126,7 @@ fi if test "$with_readline" = "no"; then DEF_READLINE="# -DUSE_READLINE" READLINE_INCDIR="# -I/usr/local/include" - READLINE_LIBDIR="# -I/usr/local/lib" + READLINE_LIBDIR="# -L/usr/local/lib" READLINE_LIBS="# -lreadline -lcurses" else DEF_READLINE="-DUSE_READLINE" @@ -154,11 +166,11 @@ else fi if test "${READLINE_LIBDIR}" != ""; then - CPPFLAGS="${CPPFLAGS} -L${READLINE_LIBDIR}" + LDFLAGS="${LDFLAGS} -L${READLINE_LIBDIR}" fi for lib in "-lHcurses" "-lcurses" "-lncurses" "-ltermcap" \ - "-ltermcap -lucb" + "-ltermcap" "-lucb" "-lhistory" do LIBS="${ORIG_LIBS} -lreadline ${lib}" AC_TRY_LINK([ @@ -323,6 +335,8 @@ AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_UID_T +AC_FIND_LIB(crypt, [$LIBDIRS], [ LIBS="${LIBS} -lcrypt" ],[ ]) + dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(sigaction strcasecmp strerror cftime strftime memcpy memmove localtime timelocal strchr gettimeofday get_process_stats crypt poll localeconv setlocale) diff --git a/cygwin/Makefile-syb15 b/cygwin/Makefile-syb15 index df1ee88..2278dba 100644 --- a/cygwin/Makefile-syb15 +++ b/cygwin/Makefile-syb15 @@ -1,4 +1,4 @@ -# $Id: Makefile-syb15,v 1.4 2014/02/12 16:42:32 mwesdorp Exp $ +# $Id: Makefile-syb15,v 1.5 2014/03/01 17:01:10 mwesdorp Exp $ # # Makefile for sqsh on Cygwin 32 bits for Sybase OC 15.0 # @@ -71,7 +71,7 @@ READLINE_LIBS = -lreadline DEF_MOTIF = # -DUSE_MOTIF MOTIF_INCDIR = MOTIF_LIBDIR = -MOTIF_LIBS = +MOTIF_LIBS = # -lXm # # X Windows Support @@ -170,14 +170,14 @@ LIB_DIRS = $(X_LIBDIR) $(MOTIF_INCDIR) $(SYBASE_LIBDIR) $(READLINE_LIBDIR) CFLAGS = -g -Wall $(DEBUG) $(DEFINES) $(INCLUDE_DIRS) CPPFLAGS = -D_MSC_VER=800 LDFLAGS = $(DEBUG) $(LIB_DIRS) -LIBS = $(SYBASE_LIBS) $(X_LIBS) $(READLINE_LIBS) sqsh_parser/sqsh_parser.a +LIBS = $(SYBASE_LIBS) $(X_LIBS) $(READLINE_LIBS) sqsh_parser/sqsh_parser.a # The follow define information about the components that make up # the actual program. TARGET = sqsh -CMDS = \ +CMDS = \ cmd_alias.o cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o \ cmd_echo.o cmd_exit.o cmd_for.o cmd_func.o cmd_go.o \ cmd_help.o cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o \ diff --git a/cygwin/Makefile-syb15-x64 b/cygwin/Makefile-syb15-x64 index dc17eb7..99ae345 100644 --- a/cygwin/Makefile-syb15-x64 +++ b/cygwin/Makefile-syb15-x64 @@ -1,4 +1,4 @@ -# $Id: Makefile-syb15-x64,v 1.1 2014/02/12 16:35:42 mwesdorp Exp $ +# $Id: Makefile-syb15-x64,v 1.2 2014/03/01 17:01:10 mwesdorp Exp $ # # Makefile for sqsh on Cygwin 64 bits for Sybase OC 15.0 # @@ -71,7 +71,7 @@ READLINE_LIBS = -lreadline DEF_MOTIF = # -DUSE_MOTIF MOTIF_INCDIR = MOTIF_LIBDIR = -MOTIF_LIBS = +MOTIF_LIBS = # -lXm # # X Windows Support @@ -170,14 +170,14 @@ LIB_DIRS = $(X_LIBDIR) $(MOTIF_INCDIR) $(SYBASE_LIBDIR) $(READLINE_LIBDIR) CFLAGS = -g -Wall -m64 $(DEBUG) $(DEFINES) $(INCLUDE_DIRS) CPPFLAGS = -DSYB_LP64 -D_MSC_VER=800 LDFLAGS = $(DEBUG) $(LIB_DIRS) -m64 -LIBS = $(SYBASE_LIBS) $(X_LIBS) $(READLINE_LIBS) sqsh_parser/sqsh_parser.a +LIBS = $(SYBASE_LIBS) $(X_LIBS) $(READLINE_LIBS) sqsh_parser/sqsh_parser.a # The follow define information about the components that make up # the actual program. TARGET = sqsh -CMDS = \ +CMDS = \ cmd_alias.o cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o \ cmd_echo.o cmd_exit.o cmd_for.o cmd_func.o cmd_go.o \ cmd_help.o cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o \ diff --git a/scripts/install.sh b/scripts/install.sh index 5e8030a..e3d979f 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=2.1 +VERSION=2.5 # Determine how to use echo without a carriage return. # This is pretty much stolen from autoconf. @@ -211,7 +211,7 @@ do # install on. # x11_path="" - if [ "no" = "yes" ] + if [ "yes" = "yes" ] then x11_path="" for dir in \ @@ -259,7 +259,7 @@ do readline_path="" if [ "yes" = "yes" ] then - for dir in `echo # -L/lib | sed -e 's,^-L,,g'` \ + for dir in `echo | sed -e 's,^-L,,g'` \ /usr/local/lib /usr/lib do if [ -f $dir/libreadline.a -o \ diff --git a/scripts/install.sh.in b/scripts/install.sh.in index 0754958..98674a6 100755 --- a/scripts/install.sh.in +++ b/scripts/install.sh.in @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=2.4 +VERSION=2.5 # Determine how to use echo without a carriage return. # This is pretty much stolen from autoconf. diff --git a/scripts/make_dist.sh b/scripts/make_dist.sh index b048c85..a0242cc 100755 --- a/scripts/make_dist.sh +++ b/scripts/make_dist.sh @@ -62,7 +62,7 @@ cp COPYING doc/README.bin $tmp_dir # Documentation files. # cp ChangeLog doc/FAQ doc/global.sqshrc doc/sample.sqsh_m4 \ - doc/sqsh.1 doc/sqsh.html doc/sqshrc-2.4 doc/CHANGES-2.* \ + doc/sqsh.1 doc/sqsh.html doc/sqshrc-2.5 doc/CHANGES* \ $tmp_dir/doc # diff --git a/scripts/make_wrapper.sh b/scripts/make_wrapper.sh index bfce756..e7be128 100644 --- a/scripts/make_wrapper.sh +++ b/scripts/make_wrapper.sh @@ -9,7 +9,7 @@ prefix=/usr/local exec_prefix=${prefix}/bin sybase=/opt/sybase/OCS-15_0 -readline_libdir='# -L/lib' +readline_libdir='' motif_libdir='' x_libdir='# -L/usr/X11R6/lib' diff --git a/scripts/make_wrapper.sh.in b/scripts/make_wrapper.sh.in index 53284f0..b2cdb51 100644 --- a/scripts/make_wrapper.sh.in +++ b/scripts/make_wrapper.sh.in @@ -7,8 +7,7 @@ fi prefix=@prefix@ exec_prefix=@exec_prefix@/bin -sybase=@SYBASE@ -sybase_ocos=@SYBASE_OCOS@ +sybase=@SYBASE_OCOS@ readline_libdir='@READLINE_LIBDIR@' motif_libdir='@MOTIF_LIBDIR@' @@ -18,7 +17,7 @@ readline_libdir=`echo $readline_libdir | sed -e 's,^#.*$,,g'` motif_libdir=`echo $motif_libdir | sed -e 's,^#.*$,,g'` x_libdir=`echo $x_libdir | sed -e 's,^#.*$,,g'` -LD_LIBRARY_PATH=$sybase_ocos/lib +LD_LIBRARY_PATH=$sybase/lib if [ "$readline_libdir" != "" ]; then readline_libdir=`echo $readline_libdir | sed -e 's,^-L,,g'` LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$readline_libdir" diff --git a/src/Makefile.in b/src/Makefile.in index 23a6fe1..cf7f866 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -136,7 +136,7 @@ X_LIBS = @ATHENA_LIBS@ $(MOTIF_LIBS) @X_LIBS@ # unless you are debugging a problem or are interested in what is # going on under the hood. # -#DEF_DEBUG = -DDEBUG +DEF_DEBUG = @DEF_DEBUG@ # # End of user configuration section. @@ -160,15 +160,14 @@ INSTALL_DATA = $(INSTALL) -c -m 644 INSTALL_MAN = $(src_dir)/autoconf/install-man CC = @CC@ -DEBUG = DEFINES = -DSQSH_RC='${SQSHRC_PATH}' $(DEF_READLINE) \ $(DEF_NOBCP) $(DEF_DEBUG) $(DEF_INSECURE) $(DEF_X11) \ $(DEF_MOTIF) $(DEF_BUGFIX) @DEF_POSIX@ @DEF_AIX_FIX@ INCLUDE_DIRS = $(X_INCDIR) $(MOTIF_INCDIR) $(SYBASE_INCDIR) $(READLINE_INCDIR) LIB_DIRS = $(X_LIBDIR) $(MOTIF_INCDIR) $(SYBASE_LIBDIR) $(READLINE_LIBDIR) -CFLAGS = @CFLAGS@ $(DEBUG) $(DEFINES) $(INCLUDE_DIRS) +CFLAGS = @CFLAGS@ $(DEFINES) $(INCLUDE_DIRS) CPPFLAGS = @CPPFLAGS@ -LDFLAGS = $(DEBUG) $(LIB_DIRS) @LDFLAGS@ +LDFLAGS = @LDFLAGS@ $(LIB_DIRS) LIBS = $(SYBASE_LIBS) $(X_LIBS) $(READLINE_LIBS) @LIBS@ @SQSH_PARSE_LIB@ # The follow define information about the components that make up @@ -160,7 +160,6 @@ static var_entry_t sg_var_entry[] = { { "semicolon_hack", "0", var_set_bool, NULL }, { "semicolon_cmd", "\\go", var_set_nullstr, NULL }, { "session", SQSH_SESSION, var_set_nullstr, NULL }, - { "start_connected", "1", var_set_bool, NULL }, { "statistics", "0", var_set_bool, NULL }, { "style", "horizontal", var_set_style, var_get_style }, { "thresh_display", "0", var_set_severity, NULL }, |