vqtcl/0000755000076500007650000000000010637717020011614 5ustar jcwjcw00000000000000vqtcl/aclocal.m40000644000076500007650000000022310574304471013453 0ustar jcwjcw00000000000000# # Include the TEA standard macro set # builtin(include,tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # vqtcl/ChangeLog0000644000076500007650000000102110574304471013362 0ustar jcwjcw000000000000002007-01-26 jcw * vlerq.c: updated to get rid of stdint.h header 2007-01-25 jcw * all: vlerq update 2007-01-16 jcw * all: vlerq update 2007-01-02 jcw * all: vlerq update 2006-12-28 jcw * all: vlerq and tclconfig updates 2006-12-12 jcw * all: vlerq update 2006-12-06 jcw * Added ratcl package and "view" operator, many tweaks, bump to 4.1 * m2mvfs.tcl: updated to 1.8 for sdx wrapping of starpacks 2006-11-15 jcw * all: Initial 4.0 release 2006-11-05 jcw * Sources brought under darcs revision control vqtcl/configure0000755000076500007650000116667610604723362013552 0ustar jcwjcw00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for vqtcl 4.1. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='vqtcl' PACKAGE_TARNAME='vqtcl' PACKAGE_VERSION='4.1' PACKAGE_STRING='vqtcl 4.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures vqtcl 4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of vqtcl 4.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --enable-wince enable Win/CE support (where applicable) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF vqtcl configure 4.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by vqtcl $as_me 4.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.5" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.5" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.5" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... ac_aux_dir= for ac_dir in tclconfig $srcdir/tclconfig; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&5 echo "$as_me: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . ${TCL_BIN_DIR}/tclConfig.sh else echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f ${TCL_BIN_DIR}/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* 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 -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 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' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC="$OLDCC" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* 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_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* 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_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* 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_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* 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_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 echo "${ECHO_T}$tcl_cv_dirent_h" >&6 if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to the vqtcl lists. ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #----------------------------------------------------------------------- # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="vlerq.c" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done PKG_CFLAGS="$PKG_CFLAGS " vars="" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="library/m2mvfs.tcl library/mkclvfs.tcl library/mklite.tcl library/ratcl.tcl" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_vlerq in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_vlerq 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "`uname -s`" = "SunOS" ; then cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = 1; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0.a: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. echo "$as_me:$LINENO: checking system version" >&5 echo $ECHO_N "checking system version... $ECHO_C" >&6 if test "${tcl_cv_sys_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 echo "${ECHO_T}$tcl_cv_sys_version" >&6 system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Require ranlib early so we can override it in special cases below. # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char inet_ntoa (); int main () { inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bind_inet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bind_inet_ntoa=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 if test $ac_cv_lib_bind_inet_ntoa = yes; then LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF # Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_m64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_m64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_m64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 echo "${ECHO_T}$tcl_cv_cc_m64" >&6 if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD="${CC} -shared " DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6 if test $tcl_cv_ld_elf = yes; then SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. case `machine` in sparc|sparc64) SHLIB_CFLAGS="-fPIC";; *) SHLIB_CFLAGS="-fpic";; esac SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6 if test $tcl_cv_ld_elf = yes; then LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then case `arch` in ppc) echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_arch_ppc64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_arch_ppc64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_ppc64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386) echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 if test "${tcl_cv_cc_arch_x86_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_cc_arch_x86_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_x86_64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; *) { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ fat_32_64=yes fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ "`echo "${CFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for Tk extensions, remove 64-bit arch flags from # CFLAGS for combined 32-bit and 64-bit fat builds as neither TkAqua # nor TkX11 can be built for 64-bit at present. test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && \ CFLAGS="`echo "$CFLAGS " | sed -e 's/-arch ppc64 / /g' -e 's/-arch x86_64 / /g'`" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 if test "${tcl_cv_ld_Bexport+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_Bexport=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_Bexport=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "${tcl_cv_flag__largefile_source64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile_source64=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile_source64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile_source64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE_SOURCE64 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi for ac_func in open64 lseek64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_TCL_STUBS 1 _ACEOF #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 #TEA_PROG_WISH #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # 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 | 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 \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by vqtcl $as_me 4.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ vqtcl config.status 4.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi vqtcl/configure.in0000644000076500007650000001601310604723362014126 0ustar jcwjcw00000000000000#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. #----------------------------------------------------------------------- # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([vqtcl], [4.1]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.5]) AC_CONFIG_AUX_DIR(tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #----------------------------------------------------------------------- # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([vlerq.c]) TEA_ADD_HEADERS([]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([library/m2mvfs.tcl library/mkclvfs.tcl library/mklite.tcl library/ratcl.tcl]) #-------------------------------------------------------------------- # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_vlerq in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_vlerq, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH #TEA_PROG_WISH #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl]) vqtcl/data/0000755000076500007650000000000010574304471012527 5ustar jcwjcw00000000000000vqtcl/data/gtest.db0000644000076500007650000000111610574304471014163 0ustar jcwjcw00000000000000LJNadamwoodysamnormwiltnormlolanormwoodypierreeTUUvlolascheerscheerscheersjoesjoeslolaslolaslolasfrankiesvwUf–Q5&€Šµˆ…½€ÀÂ…‚€…‡adamwiltsamnormnormnanwoodylolaUTEVbudrollingrockbudrollingrockbudsierranevadapabstmickiesÄÄÔ†2R€ˆ§œ„À¿Ç„†€„ŠcheerscheersjoesjoesjoeslolaslolaswinkosfrankieswUev budsamaddamsbudsamaddamsmickiesmickiespabstrollingrocksnafu¤¤ˆÆôÿÙ ®ëM°€‰¹¡…Ú€Äß…£€’¨€åfrequents[drinker:S,bar:S,perweek:I],likes[drinker:S,beer:S,perday:I],serves[bar:S,beer:S,quantity:I]Œ“Ž“º€>€qÍvqtcl/data/lkit-be.db0000644000076500007650000005001510574304471014366 0ustar jcwjcw00000000000000#!/bin/sh # \ exec tclkit "$0" ${1+"$@"} package require starkit starkit::header mk4 -readonly ################################################################################################################################################################LJO ÿ€€€‡ˆ†€•‚–€¼dirs[name:S,parent:I,files[name:S,size:I,date:I,contents:B]]‹˜€d€A#LJ N™libapp-listkcgi1.6GzÿChangeLogmain.tclš§C>Z1=ññjxœ=ÍÍ Â0à{ŸbnB¡%DO>øùÙ4©kÜÔâÛ)õ6‡ùf¬1çÁØÁ^€9l€5°ÍõÉc W¸)âN)á&ÞŸA"¡ 4Ëö+#&,%ö.ZŸW­m¡U›ËçåMHòB?^wéø²[&ËÔ}Ág4µxœ+HLÎNLOU(J-,Í,JU(.I,ÊÎ,á‚ÒVV FIiWšÂĂݜÌâ’l.iøQ‚6listk.tclpkgIndex.tcltcl2html.tclÚ ”H©>Z.=ññŠ>ZÝxœ•VmOÛHþÿŠ9c*8ÕäEý€r⥇t@ÅÑ'c!Ç^;Û8»îî:$Pÿ÷›}±ã ^O±wgfŸyž™Yöà/•ˆUaòœ9- ”T*"ÞCÎÔ’@"áüÓ5ÈTÐJA·|“Ñhò¾¦Ï¿“o5ýp”ò¥çTIºH •à+š¡kU…:ÜÆG#mf¶:¸¸;ÿrsyûðtw÷pˆ’(¨íÞýåÅõýåùÃÓ—û?=·'I!!2ødURA»-#|B´$Iç !0¶¯¸@sx $0þÐoÜ¢]¶Á¨4_ŒáÝ;wY+³@¾„äø¸åõç `pQYV¨¹=.†ïß!’JPVeY#@ ,³Q†þ¡>|`³´§|å”AT=£ æ V¹œN—‹Óé ¯™F BÌ*ã¬Ü8M/ƒ_Ú2*tŒfh½pšjÙZ³TóÚM˪€ˆ¬’¶€Ž01‘°‚8#ë›\4ã†ÑУGð"nz*ô¨ŽZ•–=MªüsÎa*T›ŠLA¡ýp®–¥¿côY$Å2™ãaŠš“GÖî'B$¨™Nk >Ÿ=üñt}{u×ÞÉäÒ0‚±Cdj¤eæ­ÙÄêÙ* ­Q¬ÌB©2^›ìZ^‹”ì¨mQ-–,‰¦6ç®­â‰NUÓÒ†@*U§š=2Ï âaÝAyÊYN‹Û7ÀÍP!`Y&Šr3ʱé|³D%éŠÒ¦Ö=-¹4žÞ[~ZyµW §0éz× ª ë üÇèq=‡øç/ða|õ¸>áÃÕÕcì» ?‡EIS|ÈSERŠX—VÛH)É¿T’)‘ÿUJ6Ü{TeB]uY ~^f7dœ‘ç’âÔ1y{=)›Ý¶Ók#ìÆu%t…ã»­7Q…ž³(qZP=F úd×âßËȬ. ä¶Åu–]fs­6ŽE²ö¶Ýmïzƒ=(tÑÓ xŽí“¡áKx°…ô&³×©6è« úè‚R)ýSop6Õ–Ø>z9ÌHÊ…ÑR“ÄÈo˜ùàdhÜOÛj¿g<Û´ãQïÛ§†Þ ëë7\u3†Ø·¯úlkÞë´ ‡`ë-¬*´Ä°Q-J\Ä­a¬##žù¤Ó\êÄ‡Šºäu_ÛAn4óoê{È„ ˆj™(E2{| !”’ <«(ùL×Þ‹¦‚àרAµ`׬J(‚ÊãíÎæÇ¹)ƒI9ÛþfænÚkЫçÈ„×ýɱ„}Ù µ- C6Ã6V× ƒíhÃ$p4¤ pAìYKE—zZÄvÁÿ÷—á~ÖÄ­û›&]÷nRѨûþÁ¢ /ØÄ‡¨úÀ‰µÖú´/ýâê¥ÃÙ†0Ë~·¿“¾¼tìg³ößúB ‚mYlbÇDitxƒ~*æV»¿<»¸¹l©ž îãX¿ìÖ…“À [;°ëöÙ6@Ó»šÿ}Ùøpackage ifneeded app-listk 1.0 [list source [file join $dir listk.tcl]] xœXkSÛ8þœü Õx é’ åS!…¥f tÒôíìÄ)£8J¢­cg-‡” ùïïsŽdǶË,’H::—ç\ÅÖ‹æ@ÇM3©n‰ ª¾«Pdad&Âó[žð—{¿{þÞªŠc쿞dÓ¨º…Åiß©43´+Âd¨D–ˆ‹îÕ>ýl”Jg•БްHbPM§2ŠHÇJ$©À©øxÒ½¸½¼>¿#ìÌ"B)¾ì £Rp²JçFŽÕv+Çu“ “y&êq’àÖ"Õ™:mË©2FãˆYu!3'Er,¦ò´Ó™˜¥:ÎX§T™yD–%ÂR6„¸!Sú)VÄw’P£†b"‰‰ ÖGÎf*b{‡ÈÑ@Á|HÊ7˜°Ö§›\a ö]›LÇc‡Ù<Æo³a”ÐFÌ$‹Ôñ.þ‹ÅD‡J£À v„©’ÄKâºþ{®DKl€&6™’C‘ŒDΖDnÈn0Xä…0Õ³l ú$ËfÍæ0™J7ˆmÓ’Ô‡:mæiÞé4›Ë¨1“ÙÄ!³»$>Ðlísr*¯º“ëONºgï õ‘Æ>y‚TÙ&!»¦s“Eð‘wRGrqÈÙB \¸°Þ:£9Ò3Ètx;Ô&Œ¤ž‚`â±.çó”ƒÁê$6ˆÎ8“av þR£Qc’ æNI:æ'§§Ÿ;'§Šë›îÙiW(i4"¸?¢ø%…BN¾yVˆ’A$Ã!8 døÍDÒLíL…ö“A”]nßAªá]Ü›@{i7»b0σs¬¾ÏÀ%ÒSI«; ‹“©‚Û”Àf vÝ T4“d sfoZ¿‘ã».iÁ‡£l(_ü¡†@2ÌDIÈVÊÄÿÎ:Ÿ.o®Å^£u(¶¶2’¡)Ü(½Uœí«÷ùÂW«z$–=b-¾Û)b Ö_‰¥ Æ‹}±'VBE±Øi .=€Œ cWγ䢾‹(‘”eóY5”²@ß.dœÝ®)n-E•3_““§3N-‚2‚6†«Kœð=žDøŸ‰"¹“Ñœsž¥\DÂ’b§7WW'×ï?‰< ѨœkbΫÏ[2Må½à TR›Ï–Àû£NÇ1T#‰ªÃæ1úX]¿Z¥*c3P,VUàg%Ißµ«¼E8û‹}¢¨ÌæÀÙóùµ!Џ^„Išª0‹î½jE¥) î¯HˆçŠ;ÚÏ\DK_†övÿyõ׫•³Âã‚¥²lŸ]µÏo®»ØŠ’ôíÖéi«u~~dÕhætí&ѵ› çB¨Ò~gM»jº¥ÉÒ 8or%¾9W"pyãN>¹Ðj½y³Vƒò ]ÛCbî…®b¢ e&qÚQÙ<í’ˆØpt»©ulÑÄ–"Óeºåɇú´\­Ä#Ÿóý<­ë9Yàð bá!-ÑÐf2T–UÃÌ¢7‹åË•ð­à¥œÎWVÓ'tí]”ý”ì¨D6.Ș.²P°}^›4?j_œ¼?jw/»ÎŽ|6¹Ý´«v“Ï<¾»yÿ'¾ ˆ®î´øJ|ø&¯ý±svä¹LØBÁP)õ…¼ìq3Iå”*n)ã ðÂ)ÒçëCÐÿeà‡þÂýÚNï¯.ó‹„À^Ðû*ëÿ´êo‚þƒ_{ˆÏÌ,$A°ç“Õ;äêZ¼¶«¦[î—°úW¥všÊ±Éɹ¢Ù~à® Úëé,¢º•î®Ë•m曞®Ì6wj‚kQÃ2# pGˆ%@è} ÈôÀ–øºê¿ Vß³6ßö¯­64HbÛ³L©g¤ƒ'¯T:Ba¡*uŸÌ©žæLFó˜ÆD¦h¿èš¢.&ê~ƒÍ=w4"Ç”F(àkj‡Íyœw§…ŸmÀN°ƒýökµcX³áÂ8¡Yʹ’X>ò$¶JޤUɉK(é•V±Ôñ©-[Âî5´‰‰BC£‘—gÚë8& yLØ*Å%xy_r‡T&ã‚`+èíš÷l¦BŽ/õáû×oÍþ÷ç³G^odÇv°½öóvlüÌ)«˜)|Â, –ø–98ÒLm¹öÌ,Âhå0ûǪ̂±½è¡L“<4”1¬É—ø=>]í÷¹ó墙ÛrU­¬ò–ºÜñÉ5âåKáN©‰‡ÑsIäŽ[ÁŒ¥¯/ð~ÅKéŠo!®MQ”x¬.lFže]hW–õXÔF uQ—Kx¸U0ÎÙõʪ¾þw]­á?×·úH!kßýˆ÷ OV¨ ,%ŸmŽ«•¹çäNX¸’Îäˆ0já¥ÑÉÎ<>ቛAP=»ŸaìÉÔ÷¬I—‚Ø+*ö:¿0ó”Ÿ"4ý?~Í”[ëgh‘*9šd!dH/Iûúá÷2TÐ(t¸XÍðŒ$¹ý~>´ßuŽ‚ø“þ§Ž ¾3Üc,û à‘e=«÷ì›eY €ÌvEÐ8+Žï~iº?c\“0Dø éÏë?HPe܆üíƒ æ@¶OžËîÃ'ÎSÕâÌõ ;ÔE2ã'ëÿ›ÏÝŸ»Tª‹<1¿t.»g¨;´guYæ%ʰõW¢Ùg › Z®´;Ôi\õúª¼ØÖÍ+÷Ît*¸7Œ+žõ¸8.ôiå‡ùkméÞe¶21 éE©šEÈÖ\(ÄæÈ”[žŒœ½Lä: ÷Tö-Åfk+…¿c€(N••ÇI°n\z ç@ø—RGÀ®UØÊå¿(åÍ‚zOÅ¹ê…¿Æ ívÓ$¤…åȲã0Ú-~$Â×¹”•“T2?'^ôÝ™ó$WqyòqÄ9^¨²ù]o£cþ÷‚àÕœ-?+ Žî…aí‹'…!“Ÿk)܆¼~Fa°ìÊÅa3]>ç`:ü¹Iº½·ocjÑëpÊA|2ÖlhwNê:ØòŸÌãá.¿QfаÑhx”O–R‘“UÿÝ6ilH ‚cgi.tclpkgIndex.tclØ]<ÚQC<ÚQCxœí}}{ÛÆ±ïßÒ§Ø@L,%"e9MÏ©-)ÇÇq÷ØqŽ­Ü<}DEH€$j`в*ë»ßùÍì.oõâ6¹·n#’ÀìÛìììÌìÌìÖÖMÿmÒÿÔx Šq¬ú*K—E”„¹š¤™:Ï"ú1UϾ¡òq-Š\E‰:ÇTæé²˜¥Ùcõ]š¨—шŠÄøø¯$Ê‹Á4}´«þâ'K?»Pþô ·s< ó°l#š/âp&…*f¡§A¨‚  áéÂ_„õ~é쌧ÎgÑx¦üÅ"ô³²(½¢–ÿH'“0 “q8 Š~ŠCý l@Bp¨–9š(fQÎÝ(tYƒDùc*>+ŠÅã½½ðÃ"3Ö½ ï‹‹`‚‘Þ|nSFz£f4ê_¾\,Ò¬¸Uã‹,ƒ ÎPá*T—~6ͯÔ妢Ó8ù±:#&ïU˜eiö"™¤›ü:š¨Ë“ˆ~ªða$gÀm[×Y&áÎé!½Xf‰”Éâ%gÔ‘iæùŽÚ/«~¨ÕI‡É´˜©:vŠžm Ç4»‘ÐYq±¹Ä• cš`zÍÝûÑÆå’Hí}«}ª(J‚ðƒÔ£RM4šWùTª4]Ëý÷a€ª^9X~ÛhtãJÚÝ4oKBçÉ–É5#íÂ#ÍECöÒmî#w•F¢zö­îÙÑ—òß§Q ¦af>/%K=¨>I ,,/šá(K¬L*V¤ÊãôÜ–¤ŸNÔbIëå‡ãW/Õ$ŠÃ\Hè¬BCgXàÑ8*Ôe¨…ŽqÑ›í7Ïÿ÷ççoÏ^=?þáõw œJµ%ؼð‹e®.“å\åEÖB°×’¨TQ'Òæ¬¸p4/™~Ë/«:Ñ£^x‚ðp¢EâJjLH$Þ4KŒã‹]¼ºPþ²Hç„S¼½0™1…ŠÌWIxNô:#vi¯s•:‹çð°mé`hô?jdoVÌãÚÊ‘·õ•¢WTN‰ý©_ç˸ˆ~Vì©^Q]=Œ4ûز‹d-†á®r© ¶ŸÉøû?á¼ðj}¯²1¯2[¢BG´oD±tuY܆†VôZSèש7º‘0pôsÉ8œg/Ó1¯´ëxYr%;†^Qâ›)1ô‚(+Ø¥=.¬@—8ˆu£÷ƒ›Ê«t§}Æ ¢ÊðÚùúìf>ê9õÏ—yAâ“õ$Kçê<"ù ©²¤×ºüBë'=ïKM2jžŽWþ;šƒ8‚èCì&‹hkRË,É…„âÔ"Ñm«mOƒ.–qìí@ˆù…ú@[=Jb.Ó]5^f@¸’ÜV \ ŸÐ@i+4õ^Øó®>þL{ë!$-Eþ²o¿/£÷„”¼èÀ±òÞH+„\=,Ïa}Ÿž7æ*Óù\¸'c®P¦òžðóö9ÔSöüƒiõ±¼ÉüéœxsÚûãYXâX¿WþDXÕ-Ü…*â*3[—ÑÝFôÔâ&+ A8ZN§À3ýHióÊÔ8[Ž#7zE›ÇyH;DóùœØ1¢øân‚*M(ä“ Ù7.¯6žlI¼€üÜ_TÄÚyÜ(Âh¡Í,_ŽTŸö_uyt¥÷ºËáÓâÉÖV^¥·ƒÏúýsbš»³"=Ó&{«ê÷§vdÜì¨~:™”ýá‡×lÞ¨!Õsª±/¨ds{6Ô…™½~šxv·¯ö&‘‡\ô$ÎüdêŠöI Nö\«r2骓Fx£J$áýÚ/<td“p¾€Øpçž;$邦ªèÕÛÒÏMs×Ô¼yÓIè—øZ«jîu‹ÈƵº¸p§X¤&Ìqœæ!m_Sy¶…%:iß§]#]„‰Â²Øåg»j”Z”isc£±ÙkLI¸[¯"€r{·2 šä²ãk ¦|_DE*¯ä(Z3ÃB«(ç¡Øþ˜b20Œô|ÚUñ0Œ@#-™­ì:U:Jjäß©”>iAŒ—]•§àf¤<(£Z£nðéhšP==hôðjÓ|]-ƒèO[W8ÃÌEG‘§®L´Œ‚3ڨϗ$æÕµ!«umiäІA£“1ÖêÞrQv²\C´È±~P{M¡oUå~~ûüÍN9¤óYêÏ#ÒSÍ«Úb…²¢É/üŽ5ü•þ”z¶”G?•?W‘§RŒ`ª—Q²ü f)Ú•NaëÆè +t³“(Ë‹ë[äªëmæï¢…JßÓÎæ¡•Ïhz R¶_~¶óíöðäW5,N¿Ü!ôèƒå|~¡ÿÊ£îÖDiþ†)z2|N ‹ÙÅU{'æ•‚|úÃÿ<ÿëÙË×Ïž¾<{õôÙ/~|>þçiön8|™N C˜¬ÄŸ‡.k¬Ï`”¢=tA]è%T¨iêг ]ä3â>\Ìse”_ü,¡eûXc.uJ,f9R¶LX^QD®j(• =HÏiEf»²‡ë‚g— *¥]àÒ>p´‚-%,K5£b+…O¼ Ë|6T½c›àƒ\-øñ¼%Ë/¤€“fÄ’Ì(KÏ©7ŽDÇ ´Uc†ŒVÝ—Vb^.Þûñž¯[)å;)¦Wÿ¨ˆr4 èÑØ°ÜL'½ú3÷?Äê!ÿ$YSa‰_å½t#x¤ÛP=ÝÉÓSkÓò‰ÙO˜Ô‘ê¡òŠÒέµ‚·˜¸²°Dœ&%)Oóœ‘ð¯Õù§ôðÑÕx«™®â­Ô|"ýPŸçÛŸç;˜ ÓçŠÔ{‚o_¦E([)æ}Þÿ2W‡TÜ”Hñ·V¨£Nló£ÓÓŠVmI$|O¼õr<šìÖç¶`,RÅ ëœdd˜y¨fLhRQQ5>a{¡QQmQ´ûa¤Ö–k™åéß·¦çTV·xnI9•ŽY‘$q`FëŸ6bêKÕ¨cëßq £ÔÔlÚ­yØðyRò" :tÏÊšéµÞX̶)}„Ul’Â)*]‚9@r'¦¢EY¿8€ÝRÁøšòù’ÐÀ8'„6鼈Æ9ã}~Gþ(&µ{–ž'›¦Œìð!…îóQš†¸jÈo+p¹r‘‘S¬ÔÔnq“À#ÍàTDª¯•÷LìÏñÒ3/h§2öaõ&dÝÙ,áé"]f*¿ 5{®ü`áX#ó „e‰ê=É©i6°rM)ÛÙvŸ&À;6›XÔ9±ì€Ä6ؼ̹ Uö>‡C”ÜÈÓIqNš¹>jq'úú(ÄT‡s?‚ñ´H¥SK{··…¤øá—ÞÙ¡ž£ðJ)ÚDEWþd)ù¢„Z",=ÈÂRÙÝU/í^ðc“î¡ >í\ÑtV(,öÇž©]tg¨÷fó¡Ê*Mט«™À6>V_;§¦"–ŒÝI2µ"«&–€~(ïírô7šÂÇÒºì ØÚ‰èG´Ùzm¥Úkª/~îuž¬Yøéwß½©Æ·p¥”9&Y0g{ñþàƒýŽ Z!µtCèœwºšLÓwQxM5oÏ^¿þŸϻ겫±‹¼ë‹¶ F¼Ö¨·f1_A:§çÊìzwtóQމAlV ´ð 2³V#‹lb›±ÂÌØ_‚mÑÆÈ}tDü<3RBãX¯”vtÍÍ}ËåT·5=‚‰üü楓‰‚Û·#ÇØcì9é YJkš>Ñ„œkjFÁG "làqhq)àýSÄ|Ànr´¥ŽC*=÷ßa ‹H/ñó @ÏITÐs.˜é˜“%¡,”cCl'3hèr†‡Ü±|Wý v_m{`Á‡úæÚøÑýëÏ»y†PÇN»]«ª:–Ю6ÇÙ†Ïó…Êwt@ÇzK’êõÖOM¯ÖL—aŸe_$Q£ ïÁb÷ZN‚£-)±ç•RýƆm;_N&ÑÙðäû隆?èôõΡ€×—z¼ߦ‘JUû§¶ÂGëØ ÷¹c#Â0ëíI˵I]£Ä·'K‰^ÛL˜ê‹ÓåH±s²;A êÃ*YJE]„¹êdE—Ä'¦ ÒÁÎ S˜¤ÕP|§LŸýD8Ë öà'|ÐN&šåÛ?ª'¶6fš…E8ŽæÔX–˱¦öÙÍE0@—ŒBHË^õ“t Šaè+–Ö½áÐÃ||þ0øü¡¯†4d¬ R;¹Ç!k’4 Œ¶cHÜŸ÷Ã|ì/Д+ˆ›&.?ß>ñû“‡ý?šÏ+®•t‰áòáÃ!©ŠôK7!õ—j™D|º2ÇBÔxægÔ±è4µ6¡Y)w'Ô( ƒZÄQ(Nçs Oú®õ§’ÀÛ§uÿ¦µ©)q)%#¼‡Y¯60,‰ï‹kFÛly2óžÔë Ï™›O:ýë̾èןïÕSzIðWÿêIÕ.!N==©'HnU|âÀ~zuAO\PˆúKO@ˆæ,X‚12'¨lûd8<ñzîôعù4TE•¾Js?“Ôg`6,~þð)ŸÃAÞÊõ°=¶ã£=Ûƒµ¨RÝœ,íiþX=ü0Ü?mÐgY9&v™bÎèg­K“ë¥aÅSD¿Ò,Ê%£[r?_„ì¶ ¢÷ÇŒci/Ø… ¢°0Db£=çá”qHy—¤ç UpÔŒœ÷ö˳¼ɰ޵Ö.óVÒW=öFõç‹'W9œ\ë/“îgÍ2ž)ƒêQ¨ r`@â€#0uDñË+ÂUÐ1ýÆqeNtÛ40LÉ2ƒ!{39¨4è³ô_C+ZQÒm}£‚bz‹’{š@ŒÚ!TYÇÃv¯„xÔÑÊ·¦•¯'„`“~ÞÚ{†3|ˆÒ„ÀzPæO31»û×(« ÍŽŒœy+,ä GéVgþR[°Z"Ÿjí‹w¾ KÐ¥5 s’!>ôìσÿ¼MŒ³¢!^ÌJpu)Ã$)ÌÚkŒ· ¿rѱ²¸œµ£g†8°N ©#µßŠ%W‹|¨ý¨jeûN¡/tœ€9ç•NÕõ؃=îfMUZtMùâ·?žEm,~°ÿcÖdJèWG½œ´EýÝ™ÝQœŽß1©•ÌÕAùŽK;?o»ŒãTâ&ìQßý¬ã-õü›8O‚è=m•Ñ49‡pÒ9¢­þ„<³ÎÍaaú '9ïŒPÑ©*xJ¤çŸ"lÄš—‰î\%ÆHÊo°3܆ñ‘4Þj¿B½ˆ HUºb ÃTì´:‰¼ƒ.é½PfÍ‹^ç31ƒß#À#oõ è:\/ØtuÚÎËŽ¼Úð[¬õ-¯.ÇŠ#PÇÊÌÂõ0@€÷Ö%|¿ã¿Ý2ÝÓÁO;®âUÇ•wd‚×ó8`ì`/ŽjlŽ˜ø(Ìx“í"‘4^BÒx|š!®A$×®’Ñ’Z+Vb`¹&–¿+ l©?[oØâhÐõ{áì„ÖN³‹•¸ˆ²u‘Á7ÀÆ­˜2«Â÷”©×uRËaRÐÖÒ,åäÑ@°R 2¨¡Ì;L^ªƒ ›º4§ Ї=çÓV iˆTó6(hì. ‰m€¬¦»aÂÆ¯P¼©‚Î;Aç5ÐdÔºµÿLJ ' Bç( Åc­v–^ÌÛ:¿µÿÐe%*)„_`‘ùA8÷³wn¼îâBœ¡[šÿS¥§QžbƤ5¨ö%h/©@r_Ù@W«ôàœ´WR&+±q‰7ª(“-“¤£ŒÙqÛqŠv,<)²ÖÊs@oȇ’Øa¹îFW\^§š»'wkjçmÇyå ¤qP®K‹Ê‘(G$F‰ücÕŽ8ªa<àÓû°¼dàe]"ô«,^^^Žt`Yx)½ÆgµÀ‚8‡©—Xè‹J ìlÑÎj Ùé£BÅ8ølC"žk-ߪ 1óó(o ç\‚>j"-³¥ y!£¯n±q¤YVµsþRi‡“$´Ì1^H+øây^ŒR? EÞD(À§[ÀåëèÀ§[ .uØÁ$±ƒ>+µ¡ŠžÊdDU$å·ÚP‹ç2fþæÕϤ'iÂÜ0þ:œAóK¼9ìáo™ñëu½¼Úka…Ôú›ô+iÓŒ0Jc>,Ä ™zª&ËdÌæCö§Ž SÑ9œÎÓe”23Çrž:N'[œN%LhO#”oà ò §ÒT}ÉSšþaÇ©¬þfP`39SÃ_U:øÜ©ûf;¯t`¨õ·c' +™/½F9iÜšG¯j´6~ºcœ¹"Z®Œ«„;Ü ‰“Ýz¸V½‚»Mw¯šˆ‰¨áìØ¦¤j-­JR¨BG@òÚLwj.‹úh% ó"åàL>!Ôù|«h!5ìĈ9ô£XÍu~Žõbz£aáØQÅ>må¦ÜÈG×c"q#2MLg™w®3#]¥ûˆG*¨p*·Äpæ>0—!¬Ab&UO$À ­«ÂÁ… ‡2ÉÅ9üØxqÄòEXpå&6PG[ÒZ{w!1—ƒ *±¿zò7W§êï·RºvȪ=nÒ½}u/õ–ÔÓëf})‰Œ\뜢Üe¯™ûÅ¡ØÊué%q¥K:1Ä­”6>¨ãcsXÙI ZåIé¢/¡DwÒëäà°.ÌJˆv»ÁPŸŒë›•Õ¿5Æ^«g¦)øØ¾ûII6éÊ,Ûí©VÞ¡gÛJ·Æ­ñl&ÝjA › ²lú€3*QDbÁÁp‘0))¶…•…%F+îÐ^¦©l0âÇ*R‰Éf‚¬oÿ'äiád×8Œ+c“á: 1óâ1œ* ¬-n8/"*Á2v4Ϊ3‚å$ƒ™Ée¸R‹°FÄ»º¬cQ ¼~%‚Ò·gDˆ¿Ÿ´¶œgèR>®Vg¼kYqn[)TÝ{%Eê² Ôù>›ëyÈLÔø„Kxx)r†Ûö†›éຖx)'¶¥Óu1àý‘WÁ"#FFÔdgs;X²I@vBö¢Ÿ;Ba•4²s¡èõXÌ–Ž_´Fg{Öo+ÒòÎûÃ8z”@IÐyú‰®†^Ï‘¥¨†ÅZÆ µ ÿjv™z1#Ž9&~©³OÐXæi;ÃoZÖMV‹(‰)©‰Iðq4§qš}ÄQûG,Æïù¯ÏÓäeêôñsÓ—[ð⻓9‡á¤ÇnÎ:’7Jy\J¼àt> ~mGnÞíÀvÕRä™äîÑeêIzlAGdä4ŒCé`vp³ÇJUMJ[i\¸}£f)_Õ Jk˜"Qñij´_^Ó Ûo»°„µ ‹ú:ˆ{3ÆUSsé.ÜOÛò+Ú¥°†fP[;™ª IôInÇ~/¯oæØµÎÁ®ö¤î¦ÛÍmœÞþæ¿÷?ÝPœZ>ë÷ûꇈ´nŽ÷›gQÒ)²BÏgöD ´þB½{Ëà+Pã¬à½=õ§ ÇöûGäD×Õ}à+I¯Á–¸¿©¿4kÐT}OC!¶€Ä¼]‘ן†‚¥îµ(øºQÀÕp.AÝ$8<’Syxòëáé—;Û‡ßîè-KCê‹eÌ¿ëD4¥éÿø°Ì¸®³Ñ´ß„p ¨FK‘1™ŸC=ãRG6Œiœf|FÆ'¡ô’0QZZí]dQÊbœ6JŒ¢›^­ƒ„n¸™”ÔŽ7Ut´CôO´$â<®ÙÓÝÞ¦‹î¯”[hVŸÐ¬>ÑSÚhVæÉ9l+îûŠào œ€¡h,§Ñl(DÞV«9GÆ—Ò=¬ðœ£ ÆñÖñ”ca’;iîi.òiñPä¦èÞ”óhÖÚÖÃ&ÚÚÄÛÈŠÞ´7Meºoña‰ÎÝàëÐe_n¥ŠÍî뻬ËCn–­©¶ŸGA1[©XW΢ünçVµœ·A âEÔDïÌï†D®ëÒç°ÚÕYlÎ ø™‰b’kª †Úô¢VÞWÖiÄßR}âžILJG=w—¿žøýœ~ù×¹0P†‘}ŸNõ* Ã;ýg+6øæ<$í;Pž|.Òüþ­¼_u­ —ªõW7ÛóÛ-BÛrái}oœ?ß.Gó¨¸í¯ÚR˜Œo`~2ÐN¥ úØÕ@;l–º¹Î‰W‚žušjI¥WmZ嵆H×:Wn,‚iï ~rݲ´Vë™M¶Þh·rÁ3?÷gT …‰l#ãš°‘18˪‹quêÎLUîE Ž·`»Â†;ùD ºð'JÄs QÓæ‹bÍ 5ð½UÙ¦ª‡‡m€µä›uͱíÝv²ãrâ¿ õw¢ã§$Nn9U·Wð¤ÃŒ '@YHRÆù~–Ïü =ë¦4]Œ¶ŠË®Ks`ïyöúÇãç?Ÿÿõ§ç;§ê‹/TË-• »~à¾$r®–±'Äk^`€®lÙ‹IFŒè’ŸM¢@pÊÿžÅÙi `^Ú jàlwåÈÙQ?*mÆ¥¡Ù×xÜXïIz6Š óŒ8 Le¿Ï씞YìP?£ ÞÁ6@]«¯mŸ7Ä 0 ôT¢©|S·ä Œ»t[ÓÃs^ÿïŸ{ª¥5³õhÞït5Q=oþzööøÍ‹¿ßáØ– ÙïQüeR}óÞz}øáùÓï:;QVÐÄš!ЗÏüþø‡¶àÊ%æðWsô¿âNãŸ91÷'T¯˜Õ‡u}-‹h_ýôúí±2 ÆYCµðÒÒÍò*¶,ͺ ×ß×i7J|œðܼZk>ÝØ0)Ïí­ݨØhÃ}çðêàI'ìïw¢@ø4–èYè.#°ž„¾¥k—%1™"¼‡V“Dõô»S:O®E vÏ1µ0PÃéûõƒ7aÇðêG|¯{4kW8 ¥Í•ð Í×h²(!\}=€™³æâv U8+Óo¨£ÑŽ÷ÄcaK“Q%ŒW Ѧä=Q®/™ÎJ’³Rôw‡“B“Œ§¼S&ïE8–„»[eìó’‡áDG‚Ù6U9Œ:ÖZ› S²lpÙÖÚkD\Qê{úå¤Lt½T†¸ó ~bgîÍrcî°Úͯ‹eFœÐ$= FÓ3 ÞœÇÛ´:ADlúÙ÷/pp²ˆ y~@âPCÔ4‰a€_‡ÒårÇӲإÍwì#[ B}‹YE±—IÀ*ý46e®vNoøtw婘M:6"Î1Ÿ7Û.ã(]Ëm•!œŸ¶0sÂoMh_™DS8ûöl•}Dåâw¢D€ªq!]À#œë„åˆÒtoÞ Ù7äX½ XÃ\Û$×”|5ôlËCOÒÐqJ®’ÖH\¤¤æªJ‡·ôqg ÔOÄXrxN*̺&g÷¿pz2¨9¨òͦ&ä$§ì$Íù¶Ì }£ ›ŽÈ`K—P[“â˜}¼D7v¾|«¶ý9§äátSÆæ\æóò†ÃmdÓ3õÈïʤÕÀwjà;«Á¿ªµ|P¬ÿ¶þ­^šJ @¿ß«¾5޻ؗ N?6Oƒhr¡DÍÈ96H6‰ãq¬þcð®£t÷Nw•“j_ ºÁ)«IÈm»®æ'°U?4‹k}Êe këÍiìSÇ«‹{Lm:Öî|Fv)%eNÂgZ’ü.Êå:¨4y,›I”Ö*½DNCD“·l'7ïjõPÝ0£«RˆéÄŠ²«X©ø²‰©«[§UEëá‰f³¼™&ò")™¯Y\qæ…¾¦d!lw«°€ŠÀÎ0p çÆíI<iàa¬ÏV6®¸˜Ã—T¼Ÿ*›Ûv›èïGš.ä|„$Œ ‰×P’AJ{(îäâÜæ FYlÈw>ûL©·ìŠÊ;Xø@_ù9Š%"3U‡,ÿœìŒ„kö®ÈJèñ|§â|€J§³ƒ.m5å\ÒlËlÚ­ M¼Åýµ È>ûŒÆœýÛ‰'Æ>òäSÛÀz>¾XÀ%·Œý‚î@öhOì" ¡¬².Ì"\Mû÷´TK­¨åÖIxšyÕV5êl~Ô_+Þà߯€M*)u|°£ßéF¿ ¦+¦!öõž…B¶&@âUiû¡!0ùî‘@´G BƒŽ´¼ç´¥À*‰ª½’Z-Ö8ej6Ò Ìhz× ÕéàaoV®]§>N»ÜVTVµâˆ³W!´8¿«zmc4I=ªvž%-U'çda(ëZÊ é¸i·Ív*qj×Ö<&ºp1igÔ)#s¬Éq5cvm­;7 Æ¢_j¼vƒ×DSb|•)Ü:ÜÅ¢§S~¢…y $›sÞ þþ¿ÌèqU!_øç¤ñn½Ê0‡y¨8‹\‡a·,G¿IZ ‘”Hký,YÆqN¸*ÍZí!rZhû7RŸ‘E'¬‡·å0ÞÁäûÑúÀ‡’âƒ|û÷­ã‘÷¯ÃL/M‡+yÏÞxOø° ;w”,¡ÚhðÄ8Xþø²fЬ°'}8£I×évea<8+ƒ@¤íïÙzãäCú· çÿ3ŽÝÐi1¦ÅÑv˜b·ÀÖ¾†É¥\Å•EÜçã=]­cÀ䮺ý]ÙלƒÂÆAžò.I;1Ì­ßçMk˜ÈQvÐ{8%2{ÿv\H†uáضEÝN×b¹‰ÙÁ] w60•¢•Éൠٸf6Ú…¦u¦Âa˜˜-ËüÛ8u7ãÔ¿­S÷dúͬ“NÉž Uì]I¤æoiªêZ–ŸÀ€u{{TS¼m˜¤LK5Qõ·gL²7'ÑôŽ9I˜ªSn{'ZÍ8wϧ“¢¯€é~fjyÁ iv±«—§u;âT„nâ\¿\àÊD]¶b9b{•R?ÓDgÅ2á;uvu&šÈ.9GŠ s?*îM’ò%»ZZ1L¶‚Dæçãyj~‚#{Ñ0Ö²%¦)jG2bŒgiÊÛä/µ–e{ÐYÌ1qi+µ[±T–#·pCª•‚Tï b€Ë‘ñZ‘*äV.â3¸‘I ñ@>ŽBîøÄG¾bK1Rg÷35ðUDØ¥^€=r Íaø½kŒã´z£ù9ehtcÌœúÊ#FŸ$Ò¤íé»0\€dpñ-ÓóYÈQè’]üxœÅ“m‹Éý´Ín^1’üâË]¶’k(6öL‘]ª ‘K3MaåËyòÑ··Ýh2ÿS8Éð~´Lø¸ýæµìb(4Ê5á8 ²šðB“È(dJEiIôƒÁh ¥d—awF¨ìA¶3¤ëɈۦÊÌ@FB ­›˜6ðQ,¤P!»“Á`pú•] ZÐÖJ+nžæ…5ߘÒÊã~ vÅùµ/W—š P¡©ÉÔÁX˜1øÉºrW]˜‡úuÆÖAk:!ί+3•Ì–Ó[G›ðC8^b†3ée 0Ð.¿0&éTßN&–ïT(ê¾.¬Ùœ.r™å4ìÞà ð¼•ÌÇTÀ>HÔùÀ2CÀL^bx¥=G ¦é‚—„W–Ñ%4¼úËÏoUîŸw(ÿý5…l!izWs0³9òw†|u ­F]rcƒ±úâ²ÑıN/•ûã,"Àw?ÅQq!T‡½møãñ’DC^KìQ< ‹s³V…øÛ¸lïåïqVûóû5Œ$Þ¯@MźH•i”ik´iDO‹³Óþ0Ó¿kÇ•ÒÍ$×5£ŸR×íë7†—¬›dμ¹ÎªºÒÒÞijç—f|lYå'W¦UÇú ·ÆJÏ´*h뿉l'ûír mX+®˜÷êI…6DÊÔ„@ÿjÓ`§Ì5Ûׯöëdå ù†BêUY[}¢1ŒÚ0¤ævýÆÝÁKÁ¹³U FÇÜ…ÕįA¯&w¶ “Ó¯®#z«Ø–³‹bKûîüÔqã,ØöÊÜõÛX¯Ì·+'Yh® ± Õô¥&aѬÆFVÍW›ŽBNÕuU1Ø:vmºFÛ¿™ ˆúÈŸÆ´Q3—`D|RA ý{²¥Lv1HÊ€ÉUyÀ†‚,¸»åêgoòìÎßVîIÝÙÝòºôçÛ²'awÞCÖ>“s×èuÇjëÚµžÚÉ&Õ8—ëæY7;³c’‘’n{pgí67ª$«§H[‚4O¥BmSNR’Ìe¹Iy"£]sÅJ)ÆýìDžà\€š†ì*'o±ñ9ž!ÚÜ97tQq鸂·KV K›¬qÓÏ[C:ŽÞ•Dþ=e$¹ŽßN ›)YEŒÜ³,—rAêæ<¹²ñøæ—Ù+]×-6{*ÄP%j^NŸ.ùÊ\EYqÏ,mYP®‡fÀ_pbâH Ÿ]h±Z{Èðœ&¨äm15è[¬ó0¦ÑîìJ-àOö¢Î¥Á6eaôCOå´=FÚÓV!Áõœg‡s\¢‹÷AÉäÇüúŸ”¥ä¤ŒUÆCmzâ9>uIƉ“•SXUÏ¢ 䦹L¸†Zþ>µ‰Ò¼”x'ŠW®sØ—®©ež 7Ì¡:€ÃÞ‡Ó2“½ü™˜äõJVþ{Ú”yÖ±Þi äTê¹ DJæÚRXOTT 8…1Íø¢ƒ,šFBcì xó½“éS*ÖW©u¦5¨ä´ËXó§ùJÊѯy-õ[¶ÓÄg…1G¯’³ÍuX ­$™+„ŽúÙÚ­ øúíâ®Íw¡;JhÛWV”ó·‹õ¯t°f½«.iÝ;æÈ ÆêêôU5ÀÊ€ž8äŠOYi÷:Â{›“O9Úz×Ù–/ùoWÍ܈|Å´.tÄÄøi4ï¸5b†^_âï<B¥s6 ¦‡àõ^_üVˆ}@m­ïÕØ¿fœ]¾¹†…VÔHvÓzx«àvXH5ˆùøQ9OãtìÇž>/–_`åÀH4¨ °*T‘Wbæ69h¸uñN—Vc…ñM þˆP³©Ma° 9â<´R¤nHyrÄø­{É ÷äR¶ÕöÌÆÎÖ©ÁWï•kæ¢H“g´Q½[3{„¾C’MIQîâ[ê»0‹ÞË KßÁ™Œ‰*X¦‡fTÇuÌñÃÎl‹R¤ô¡ó§íyz;ngzd¥â¢aç5/%JОm~»GÍîòÓ'1zè=)gÐ\/¿ÌâêNšsžK?FîS—‡’AGýï2Ì.®®*4U—»EA; Qš/µ(”ž®¸–Ѩ&÷µ^5üÿ»™¼¡íÙÉ’ÕÎ)®®_ô\øZ”üNpR¢Ä¢Ô¢ÄPà¨u ÑØÍ4Žu1ÊYÂà,š ¿×QKLÌ'%µDoW 4틦D°nÇÉðÐ’HÕû »>|œà1öö>¾ÈÚ-BÖCí¯ë¹U×~;”Íýix¿”×IxÜÖ'c“y6÷aí$ÿÿò‰À‘òbÆî—žJDå~Û6# @Î-ØôKë'í›Óë*ÆÖ½æÜ_Üò®u@Çex·îe¤édAþ1Ÿù‹ð#²~}´Iñ^¥´ _/‹~|/)ñn8gÅ2{1[¥î'O¦­m­»ž«sÙÚÆê«ðº•ìðî›I3WÿÞnþßÚnnµdàò‚ |/îgͰÍ=®—ÖÓ¹Dî`<¾™6°î¾·ý–-÷ÿœŽ—ùÇÿŽ—ÙÇgpp ¼Uî—ë$–¿ÿMP ïB÷F,²§}2‚±M´ 7¿» ü¤Î4Þ$ñƒ=ƒ¹»ä[†±TRŸÜÑò…ó7Ö~W-ü<·IsÛòXâ(u* U¬ÍÔ£ŠÞ™ºÙà¹=Y,g¿å\šÛ^Kãæ¦×Ì—»ã¦•­÷ÁQš[…ußËkHmÚÒ£nÚ]1ƒ§¤ºôm4À³"=Ó›¶˜¤îcÈÑåýð ]WsâÊ¡j¶Õ~\.Eî1G5±OÎ7:„-“BئÇÞx‚HÝ$*´°¤#.>³½åƒóŠfèö…¯+‚ã¹ UˆXî; Ù_”§Ùˆ]QNù/ð‰̲ϹéVºàƒó]Cö<{h\Aø`;”J{°msìÉ8ždµÅ0M¢ ð(gË.UÞ¹Q!.Å6F¯9 e‹ßÑšœ¸ª¿Ýâ’AºL;HYÞ{ΆÛKíAäáz»™ï”äBm®HµòŽ\3qjý½°Á’;úÜ™ê¢×(PÑGªÍØî+¼ÛgJ[§Ìܘæ"^NûÑÝŽ‹J…9­Ju™gcZmfñƒD]ŸÏôTò jrV–*]J}0µ$öÎÆ§åmü…V­TÃwCò·µå¯…‡E±n }½2…y¿¯¼>w¹yu€ä{Ýoc±šc8Í#» wåšÈ8ÛæFE;o»Æ“žž ³ô®«­£vÈ÷<7w ¼¹ÝífG]E‘îÙ«q6ñ½³´œ&®}-ŠÏü Èîz&B#ãõïÃð +æ®è›‹´³'¶EÀC’Úéî£ï€2©,ZŠ;&ª¯VçùW-ðEŠ{ˆÓ2W@ÄgÙeZ[lÊÈj›¤|""oR¶uH˜}Ìißó§a®«À=‰Ø=—ˆgyOû5 ¡˜0c§¬õ~1XJ3³¦¼7òú'zýX¸¸u.J+ÁÿLôðX<-XÄX£ÈqúcÖ&\<ò¹†TrH¥zšJ0Ú4 œ‰v܉mžºá­¼ó^ÒáT' ôµyµÁr“TíG*±ŸnTÔí¼CØ¡¤Ù©´æ,¦4‰abIio™g{q4ÚC[€7>¨á¸ùNõ ÕOƒ‘:¨“|#àAæKÒ×Çì+Q@ ý$ÌÑ]ˆê"Á*ZÀb®…>"2E¥!Õ’Z•—pˆf-|LE¦Ë\‰Ö=¢÷u¶ZÓKä±eÊžÏà â LçÀ» ù(J:ñPy¹J.·Å†”ºê¿ß~÷‡Áú»Ð4_äp¯ÔNåIa¥EÉ škÎ9zMä»ic³=TßvŠ/c¾p2&›­æ¿Ü oݦ^¸¼ÏÉÔÓñ;87ÕÔ£oN77$]q”$?Gð¢°]ÃRù!1U(¶!Û¾†VÞ\!$_Kެþ/_káYš§ÞMÚùšù¦¥™J;¯ž¾x©þüæõ«Ç5^ò‰Ú{óì§cuüÚ´¦Qÿ©šûîéñÓ[Õüõ7h¯9ÃwunöP²ì•ÍÊMU¨S§np¿£Ö¯rW°‘GU~ÈŒ2b÷k’öBÕ—-®¾–»;“ºº=®·¿›ÅÑC‘ÛŸH‰3çÝD*ÄL³éËñæ föÄ„]ìñæ–Þ=pĹ‚É#â/ƒiú§"04&V½]ÉôüVåƒH,ˆ é—{ÜVÖÓjn [®y,/æí¾Ñ‰›ÊíE”„] <š¸=ºc«´Õª‰¸Þ†Eßܳ캒Ê%Ö\}úd݃ƒ®º©ýòÎ6ƒ„¶Ã¶–DB̳{§ˆûòÏ$÷ù»j¿ÿ?é?zøõªG_?þæOôõý«ãŠJ²Vkéùum}½ßÿ.÷÷ÿô§‡­mmntâÚ’’Óæ“ŽËª¶… ?B‚]ÿ0»Öžl·M+ w5“|’…½ªŽÙÞ€€>é´1x­QcM­1õ5Õéʯ„,ý,óå4¥ryC…—:NÒ.n $êxèäuŠW9Eöø5»ïR¹òtƒáª¶Ø}±³m˜6öôá™ÉtRm¨l‰Êpõ;;7n­¼×¹°B‚žYgëdœ&c_Ë\öº q³ª¢º âúúN«ô㪼UÀ¶ùÔ$}Y&¬dUÃ2 ¶è}å)!±òúsýúóGß@q„&óVÎLr²hmTBŸnPûÁ’¶íÏ›•=1•}ýßí­íÚÖžµp*[†xøÝçŸ:@‚úyëóO^i÷søÉUuxóðËõŽ-´r‹}‹­¤<î“Þ54Z“îÃö=öµñ»}øúõzÐÀ¿7ð¼eéy' dk@väýF®‡Êq#nÈ(Åì‡Sâ&kG á¤k¤êHíªÑy-j­i² )j©ƒç§eâ!YvÎülÍ™ŸýNˆ¾2õ<òs?[…–îô7G¨‘ÞœOö9èêx°æ|¿Çù”?ÝóÙMæÁob>ïr^·üå³ö>Çgᆟ ³§ÉwÊÚÕ%Üt E/8à@¤,Œ8s‡/>q^.WJ×goœçCœ¡X„ó…ŸtÝ w÷çÁ]]ÿâx_}'ñ8öó†ªÜ]¥€ßò.z-BòUô­ÔlÝÅc*ƒöuǛ鹎º‚Æ& pÞ'[úT(â[-vÍUŠÓhB1­ûЙ ×`b9q1~Ô°vÜÁ•fib>ŽÓ8ÿ˜&?'p)£//åî5ÿ\gõü~d@F•X»p<ßÎ&È3A÷+}"QIÅ'’8 /?„× ·VäGYõ¶•ÓÑ ôQ+u} œžG {|”ïâð1g)眣‰eï©þÌj®1É$ÊnÝÎÀ À:q X(5ø[mÄ·a2~0¿£o‰>6‡xú¢®7BšÁ"Íœ¨<¾¿Ó~©î†gþn¡[ãºfÒ¹îJ²~¦ññç|ɬ´Œž Gîá!—áo¼²ô÷$<ß1g8z"¤Þq:ŸûI`NÄwJ³Sæa’Ëm•GÈípåÀ•¿Ð¦ž&»6“ƒavG të9A[e»C¦@ÃoMa&¯Ó²@vÍè–¢À–Z&AŠ«Èˆ³lõøJ²)Ø\‘&›:13_pÍÉxþ8”k®‘¶—ø2甊ô%\b÷çIPǹ ì]Ø~|î_ ÅBe¾ÜwÌ8~õRnÿÀÂÆù,‚B]”—t1iw 䯹Ó\ G]¹d*•Ì£q8 èí¯B¹â÷®qE™x}ÒF;™2$ ÏÒs…ì¢Ò(p6^p3ÔÍ©Ž}Ψ€DÔº3ÈÖ³bÆ)–QnÙSÏÃôþ’¢)*;Nª­š;õ%~»²µ~^s„‹‘0.çlqZ5pôÂUi¶ôE4ú" ™4‡?Y ½VÔ·z¥èú¬Œ<µ.·Ô$Q‹l˜a A [Ãlq²‰0Nç ­ð±³%¶èlHLE_BlÁÒzv¥1Ӕư¹‚]zØÓG“ ƒviêR2!í«è‘AzÛ¬XyT‚$¾=:½õêÅégßd`?ã`™Ýz ÿÜZ›¹ÑÎqQþ™ºà‘sD¿OÓ@ÍC$RrÉ …§¥*“ŽÚä#<‚ºÓ‰¤c\°ƒØ–¾zñÎë’ã4ó´l‘Nìù£4¢õ¶€#µNET{†~g:ÂþÕõƒù›ÃbXTU>+7öäÑ4ñ ”ÆùY¾«HŸ+úË”ƒþèbW…ŸÞãxåÊsL¢a„œÅ¿¡ÌÆÕÑu·Kß½~†‹°;öåH²l&HÇ’ÀGãâ6”E+‘½ôˆþ!m܆°ÆÚÿ¬ß³4-ÌwF¯RÕm©ÐJy ±ÖÔÞ™#GæüÚÇs³MÞóЄ‡ø¢0•Ï8˼ãp埱D‰¬áºž\ßK.yííåèô‡ršxöý \¶- âò„-Xb²p_x’Ɉ›ŠùBò¦ÙŦN°„lRg aÄÐl›/;š"–Iô¡"}÷NÜJª¾æþ‰BI¸o’ ‚fêÈûûÂEâ<Źx<$þž%ñ3@¶¼edµ÷¢”¸ö²[ ¼RºX»/$ŒsVJÖÛÙ—5i@##¶‹à²‘× #±Ó˜îuUýï®[â{½ÇÉ‹ ?ŒqZ¶ùÍb15X­ÎŸÏÕ/¦1¸I=€z… ”€‚“ž±€„²ˆ¶¸¾„ö€€€€ƒ¤ú‚ž€† Œ¦¶²†耀‚•î ƒ€ˆ „ˆ Œ½™„Ö…Ú€„œü‚˜€„šÌ߀¼dirs[name:S,parent:I,files[name:S,size:I,date:I,contents:B]]«€Ný€CNºvqtcl/data/lkit-le.db0000644000076500007650000005001510574304471014400 0ustar jcwjcw00000000000000#!/bin/sh # \ exec tclkit "$0" ${1+"$@"} package require starkit starkit::header mk4 -readonly ################################################################################################################################################################JLO ÿ€€€‡ˆ†€•‚–€¼dirs[name:S,parent:I,files[name:S,size:I,date:I,contents:B]]‹˜€d€A#JL N™libapp-listkcgi1.6Gzÿmain.tclChangeLog©C§jññ=1Z>xœ+HLÎNLOU(J-,Í,JU(.I,ÊÎ,á‚ÒVV FIiWšÂĂݜÌâ’l.iøQxœ=ÍÍ Â0à{ŸbnB¡%DO>øùÙ4©kÜÔâÛ)õ6‡ùf¬1çÁØÁ^€9l€5°ÍõÉc W¸)âN)á&ÞŸA"¡ 4Ëö+#&,%ö.ZŸW­m¡U›ËçåMHòB?^wéø²[&ËÔ}Ág4µ6‚pkgIndex.tcllistk.tcltcl2html.tcl­ H” ©Šññ=.Z>ÝZ>package ifneeded app-listk 1.0 [list source [file join $dir listk.tcl]] xœ•VmOÛHþÿŠ9c*8ÕäEý€r⥇t@ÅÑ'c!Ç^;Û8»îî:$Pÿ÷›}±ã ^O±wgfŸyž™Yöà/•ˆUaòœ9- ”T*"ÞCÎÔ’@"áüÓ5ÈTÐJA·|“Ñhò¾¦Ï¿“o5ýp”ò¥çTIºH •à+š¡kU…:ÜÆG#mf¶:¸¸;ÿrsyûðtw÷pˆ’(¨íÞýåÅõýåùÃÓ—û?=·'I!!2ødURA»-#|B´$Iç !0¶¯¸@sx $0þÐoÜ¢]¶Á¨4_ŒáÝ;wY+³@¾„äø¸åõç `pQYV¨¹=.†ïß!’JPVeY#@ ,³Q†þ¡>|`³´§|å”AT=£ æ V¹œN—‹Óé ¯™F BÌ*ã¬Ü8M/ƒ_Ú2*tŒfh½pšjÙZ³TóÚM˪€ˆ¬’¶€Ž01‘°‚8#ë›\4ã†ÑУGð"nz*ô¨ŽZ•–=MªüsÎa*T›ŠLA¡ýp®–¥¿côY$Å2™ãaŠš“GÖî'B$¨™Nk >Ÿ=üñt}{u×ÞÉäÒ0‚±Cdj¤eæ­ÙÄêÙ* ­Q¬ÌB©2^›ìZ^‹”ì¨mQ-–,‰¦6ç®­â‰NUÓÒ†@*U§š=2Ï âaÝAyÊYN‹Û7ÀÍP!`Y&Šr3ʱé|³D%éŠÒ¦Ö=-¹4žÞ[~ZyµW §0éz× ª ë üÇèq=‡øç/ða|õ¸>áÃÕÕcì» ?‡EIS|ÈSERŠX—VÛH)É¿T’)‘ÿUJ6Ü{TeB]uY ~^f7dœ‘ç’âÔ1y{=)›Ý¶Ók#ìÆu%t…ã»­7Q…ž³(qZP=F úd×âßËȬ. ä¶Åu–]fs­6ŽE²ö¶Ýmïzƒ=(tÑÓ xŽí“¡áKx°…ô&³×©6è« úè‚R)ýSop6Õ–Ø>z9ÌHÊ…ÑR“ÄÈo˜ùàdhÜOÛj¿g<Û´ãQïÛ§†Þ ëë7\u3†Ø·¯úlkÞë´ ‡`ë-¬*´Ä°Q-J\Ä­a¬##žù¤Ó\êÄ‡Šºäu_ÛAn4óoê{È„ ˆj™(E2{| !”’ <«(ùL×Þ‹¦‚àרAµ`׬J(‚ÊãíÎæÇ¹)ƒI9ÛþfænÚkЫçÈ„×ýɱ„}Ù µ- C6Ã6V× ƒíhÃ$p4¤ pAìYKE—zZÄvÁÿ÷—á~ÖÄ­û›&]÷nRѨûþÁ¢ /ØÄ‡¨úÀ‰µÖú´/ýâê¥ÃÙ†0Ë~·¿“¾¼tìg³ößúB ‚mYlbÇDitxƒ~*æV»¿<»¸¹l©ž îãX¿ìÖ…“À [;°ëöÙ6@Ó»šÿ}ÙøxœXkSÛ8þœü Õx é’ åS!…¥f tÒôíìÄ)£8J¢­cg-‡” ùïïsŽdǶË,’H::—ç\ÅÖ‹æ@ÇM3©n‰ ª¾«Pdad&Âó[žð—{¿{þÞªŠc쿞dÓ¨º…Åiß©43´+Âd¨D–ˆ‹îÕ>ýl”Jg•БްHbPM§2ŠHÇJ$©À©øxÒ½¸½¼>¿#ìÌ"B)¾ì £Rp²JçFŽÕv+Çu“ “y&êq’àÖ"Õ™:mË©2FãˆYu!3'Er,¦ò´Ó™˜¥:ÎX§T™yD–%ÂR6„¸!Sú)VÄw’P£†b"‰‰ ÖGÎf*b{‡ÈÑ@Á|HÊ7˜°Ö§›\a ö]›LÇc‡Ù<Æo³a”ÐFÌ$‹Ôñ.þ‹ÅD‡J£À v„©’ÄKâºþ{®DKl€&6™’C‘ŒDΖDnÈn0Xä…0Õ³l ú$ËfÍæ0™J7ˆmÓ’Ô‡:mæiÞé4›Ë¨1“ÙÄ!³»$>Ðlísr*¯º“ëONºgï õ‘Æ>y‚TÙ&!»¦s“Eð‘wRGrqÈÙB \¸°Þ:£9Ò3Ètx;Ô&Œ¤ž‚`â±.çó”ƒÁê$6ˆÎ8“av þR£Qc’ æNI:æ'§§Ÿ;'§Šë›îÙiW(i4"¸?¢ø%…BN¾yVˆ’A$Ã!8 døÍDÒLíL…ö“A”]nßAªá]Ü›@{i7»b0σs¬¾ÏÀ%ÒSI«; ‹“©‚Û”Àf vÝ T4“d sfoZ¿‘ã».iÁ‡£l(_ü¡†@2ÌDIÈVÊÄÿÎ:Ÿ.o®Å^£u(¶¶2’¡)Ü(½Uœí«÷ùÂW«z$–=b-¾Û)b Ö_‰¥ Æ‹}±'VBE±Øi .=€Œ cWγ䢾‹(‘”eóY5”²@ß.dœÝ®)n-E•3_““§3N-‚2‚6†«Kœð=žDøŸ‰"¹“Ñœsž¥\DÂ’b§7WW'×ï?‰< ѨœkbΫÏ[2Må½à TR›Ï–Àû£NÇ1T#‰ªÃæ1úX]¿Z¥*c3P,VUàg%Ißµ«¼E8û‹}¢¨ÌæÀÙóùµ!Џ^„Išª0‹î½jE¥) î¯HˆçŠ;ÚÏ\DK_†övÿyõ׫•³Âã‚¥²lŸ]µÏo®»ØŠ’ôíÖéi«u~~dÕhætí&ѵ› çB¨Ò~gM»jº¥ÉÒ 8or%¾9W"pyãN>¹Ðj½y³Vƒò ]ÛCbî…®b¢ e&qÚQÙ<í’ˆØpt»©ulÑÄ–"Óeºåɇú´\­Ä#Ÿóý<­ë9Yàð bá!-ÑÐf2T–UÃÌ¢7‹åË•ð­à¥œÎWVÓ'tí]”ý”ì¨D6.Ș.²P°}^›4?j_œ¼?jw/»ÎŽ|6¹Ý´«v“Ï<¾»yÿ'¾ ˆ®î´øJ|ø&¯ý±svä¹LØBÁP)õ…¼ìq3Iå”*n)ã ðÂ)ÒçëCÐÿeà‡þÂýÚNï¯.ó‹„À^Ðû*ëÿ´êo‚þƒ_{ˆÏÌ,$A°ç“Õ;äêZ¼¶«¦[î—°úW¥všÊ±Éɹ¢Ù~à® Úëé,¢º•î®Ë•m曞®Ì6wj‚kQÃ2# pGˆ%@è} ÈôÀ–øºê¿ Vß³6ßö¯­64HbÛ³L©g¤ƒ'¯T:Ba¡*uŸÌ©žæLFó˜ÆD¦h¿èš¢.&ê~ƒÍ=w4"Ç”F(àkj‡Íyœw§…ŸmÀN°ƒýökµcX³áÂ8¡Yʹ’X>ò$¶JޤUɉK(é•V±Ôñ©-[Âî5´‰‰BC£‘—gÚë8& yLØ*Å%xy_r‡T&ã‚`+èíš÷l¦BŽ/õáû×oÍþ÷ç³G^odÇv°½öóvlüÌ)«˜)|Â, –ø–98ÒLm¹öÌ,Âhå0ûǪ̂±½è¡L“<4”1¬É—ø=>]í÷¹ó墙ÛrU­¬ò–ºÜñÉ5âåKáN©‰‡ÑsIäŽ[ÁŒ¥¯/ð~ÅKéŠo!®MQ”x¬.lFže]hW–õXÔF uQ—Kx¸U0ÎÙõʪ¾þw]­á?×·úH!kßýˆ÷ OV¨ ,%ŸmŽ«•¹çäNX¸’Îäˆ0já¥ÑÉÎ<>ቛAP=»ŸaìÉÔ÷¬I—‚Ø+*ö:¿0ó”Ÿ"4ý?~Í”[ëgh‘*9šd!dH/Iûúá÷2TÐ(t¸XÍðŒ$¹ý~>´ßuŽ‚ø“þ§Ž ¾3Üc,û à‘e=«÷ì›eY €ÌvEÐ8+Žï~iº?c\“0Dø éÏë?HPe܆üíƒ æ@¶OžËîÃ'ÎSÕâÌõ ;ÔE2ã'ëÿ›ÏÝŸ»Tª‹<1¿t.»g¨;´guYæ%ʰõW¢Ùg › Z®´;Ôi\õúª¼ØÖÍ+÷Ît*¸7Œ+žõ¸8.ôiå‡ùkméÞe¶21 éE©šEÈÖ\(ÄæÈ”[žŒœ½Lä: ÷Tö-Åfk+…¿c€(N••ÇI°n\z ç@ø—RGÀ®UØÊå¿(åÍ‚zOÅ¹ê…¿Æ ívÓ$¤…åȲã0Ú-~$Â×¹”•“T2?'^ôÝ™ó$WqyòqÄ9^¨²ù]o£cþ÷‚àÕœ-?+ Žî…aí‹'…!“Ÿk)܆¼~Fa°ìÊÅa3]>ç`:ü¹Iº½·ocjÑëpÊA|2ÖlhwNê:ØòŸÌãá.¿QfаÑhx”O–R‘“UÿÝ6iHl‚ pkgIndex.tclcgi.tcl]CQÚ+ŠÅã½½ðÃ"3Ö½ ï‹‹`‚‘Þ|nSFz£f4ê_¾\,Ò¬¸Uã‹,ƒ ÎPá*T—~6ͯÔ妢Ó8ù±:#&ïU˜eiö"™¤›ü:š¨Ë“ˆ~ªða$gÀm[×Y&áÎé!½Xf‰”Éâ%gÔ‘iæùŽÚ/«~¨ÕI‡É´˜©:vŠžm Ç4»‘ÐYq±¹Ä• cš`zÍÝûÑÆå’Hí}«}ª(J‚ðƒÔ£RM4šWùTª4]Ëý÷a€ª^9X~ÛhtãJÚÝ4oKBçÉ–É5#íÂ#ÍECöÒmî#w•F¢zö­îÙÑ—òß§Q ¦af>/%K=¨>I ,,/šá(K¬L*V¤ÊãôÜ–¤ŸNÔbIëå‡ãW/Õ$ŠÃ\Hè¬BCgXàÑ8*Ôe¨…ŽqÑ›í7Ïÿ÷ççoÏ^=?þáõw œJµ%ؼð‹e®.“å\åEÖB°×’¨TQ'Òæ¬¸p4/™~Ë/«:Ñ£^x‚ðp¢EâJjLH$Þ4KŒã‹]¼ºPþ²Hç„S¼½0™1…ŠÌWIxNô:#vi¯s•:‹çð°mé`hô?jdoVÌãÚÊ‘·õ•¢WTN‰ý©_ç˸ˆ~Vì©^Q]=Œ4ûز‹d-†á®r© ¶ŸÉøû?á¼ðj}¯²1¯2[¢BG´oD±tuY܆†VôZSèש7º‘0pôsÉ8œg/Ó1¯´ëxYr%;†^Qâ›)1ô‚(+Ø¥=.¬@—8ˆu£÷ƒ›Ê«t§}Æ ¢ÊðÚùúìf>ê9õÏ—yAâ“õ$Kçê<"ù ©²¤×ºüBë'=ïKM2jžŽWþ;šƒ8‚èCì&‹hkRË,É…„âÔ"Ñm«mOƒ.–qìí@ˆù…ú@[=Jb.Ó]5^f@¸’ÜV \ ŸÐ@i+4õ^Øó®>þL{ë!$-Eþ²o¿/£÷„”¼èÀ±òÞH+„\=,Ïa}Ÿž7æ*Óù\¸'c®P¦òžðóö9ÔSöüƒiõ±¼ÉüéœxsÚûãYXâX¿WþDXÕ-Ü…*â*3[—ÑÝFôÔâ&+ A8ZN§À3ýHióÊÔ8[Ž#7zE›ÇyH;DóùœØ1¢øân‚*M(ä“ Ù7.¯6žlI¼€üÜ_TÄÚyÜ(Âh¡Í,_ŽTŸö_uyt¥÷ºËáÓâÉÖV^¥·ƒÏúýsbš»³"=Ó&{«ê÷§vdÜì¨~:™”ýá‡×lÞ¨!Õsª±/¨ds{6Ô…™½~šxv·¯ö&‘‡\ô$ÎüdêŠöI Nö\«r2骓Fx£J$áýÚ/<td“p¾€Øpçž;$邦ªèÕÛÒÏMs×Ô¼yÓIè—øZ«jîu‹ÈƵº¸p§X¤&Ìqœæ!m_Sy¶…%:iß§]#]„‰Â²Øåg»j”Z”isc£±ÙkLI¸[¯"€r{·2 šä²ãk ¦|_DE*¯ä(Z3ÃB«(ç¡Øþ˜b20Œô|ÚUñ0Œ@#-™­ì:U:Jjäß©”>iAŒ—]•§àf¤<(£Z£nðéhšP==hôðjÓ|]-ƒèO[W8ÃÌEG‘§®L´Œ‚3ڨϗ$æÕµ!«umiäІA£“1ÖêÞrQv²\C´È±~P{M¡oUå~~ûüÍN9¤óYêÏ#ÒSÍ«Úb…²¢É/üŽ5ü•þ”z¶”G?•?W‘§RŒ`ª—Q²ü f)Ú•NaëÆè +t³“(Ë‹ë[äªëmæï¢…JßÓÎæ¡•Ïhz R¶_~¶óíöðäW5,N¿Ü!ôèƒå|~¡ÿÊ£îÖDiþ†)z2|N ‹ÙÅU{'æ•‚|úÃÿ<ÿëÙË×Ïž¾<{õôÙ/~|>þçiön8|™N C˜¬ÄŸ‡.k¬Ï`”¢=tA]è%T¨iêг ]ä3â>\Ìse”_ü,¡eûXc.uJ,f9R¶LX^QD®j(• =HÏiEf»²‡ë‚g— *¥]àÒ>p´‚-%,K5£b+…O¼ Ë|6T½c›àƒ\-øñ¼%Ë/¤€“fÄ’Ì(KÏ©7ŽDÇ ´Uc†ŒVÝ—Vb^.Þûñž¯[)å;)¦Wÿ¨ˆr4 èÑØ°ÜL'½ú3÷?Äê!ÿ$YSa‰_å½t#x¤ÛP=ÝÉÓSkÓò‰ÙO˜Ô‘ê¡òŠÒέµ‚·˜¸²°Dœ&%)Oóœ‘ð¯Õù§ôðÑÕx«™®â­Ô|"ýPŸçÛŸç;˜ ÓçŠÔ{‚o_¦E([)æ}Þÿ2W‡TÜ”Hñ·V¨£Nló£ÓÓŠVmI$|O¼õr<šìÖç¶`,RÅ ëœdd˜y¨fLhRQQ5>a{¡QQmQ´ûa¤Ö–k™åéß·¦çTV·xnI9•ŽY‘$q`FëŸ6bêKÕ¨cëßq £ÔÔlÚ­yØðyRò" :tÏÊšéµÞX̶)}„Ul’Â)*]‚9@r'¦¢EY¿8€ÝRÁøšòù’ÐÀ8'„6鼈Æ9ã}~Gþ(&µ{–ž'›¦Œìð!…îóQš†¸jÈo+p¹r‘‘S¬ÔÔnq“À#ÍàTDª¯•÷LìÏñÒ3/h§2öaõ&dÝÙ,áé"]f*¿ 5{®ü`áX#ó „e‰ê=É©i6°rM)ÛÙvŸ&À;6›XÔ9±ì€Ä6ؼ̹ Uö>‡C”ÜÈÓIqNš¹>jq'úú(ÄT‡s?‚ñ´H¥SK{··…¤øá—ÞÙ¡ž£ðJ)ÚDEWþd)ù¢„Z",=ÈÂRÙÝU/í^ðc“î¡ >í\ÑtV(,öÇž©]tg¨÷fó¡Ê*Mט«™À6>V_;§¦"–ŒÝI2µ"«&–€~(ïírô7šÂÇÒºì ØÚ‰èG´Ùzm¥Úkª/~îuž¬Yøéwß½©Æ·p¥”9&Y0g{ñþàƒýŽ Z!µtCèœwºšLÓwQxM5oÏ^¿þŸϻ겫±‹¼ë‹¶ F¼Ö¨·f1_A:§çÊìzwtóQމAlV ´ð 2³V#‹lb›±ÂÌØ_‚mÑÆÈ}tDü<3RBãX¯”vtÍÍ}ËåT·5=‚‰üü楓‰‚Û·#ÇØcì9é YJkš>Ñ„œkjFÁG "làqhq)àýSÄ|Ànr´¥ŽC*=÷ßa ‹H/ñó @ÏITÐs.˜é˜“%¡,”cCl'3hèr†‡Ü±|Wý v_m{`Á‡úæÚøÑýëÏ»y†PÇN»]«ª:–Ю6ÇÙ†Ïó…Êwt@ÇzK’êõÖOM¯ÖL—aŸe_$Q£ ïÁb÷ZN‚£-)±ç•RýƆm;_N&ÑÙðäû隆?èôõΡ€×—z¼ߦ‘JUû§¶ÂGëØ ÷¹c#Â0ëíI˵I]£Ä·'K‰^ÛL˜ê‹ÓåH±s²;A êÃ*YJE]„¹êdE—Ä'¦ ÒÁÎ S˜¤ÕP|§LŸýD8Ë öà'|ÐN&šåÛ?ª'¶6fš…E8ŽæÔX–˱¦öÙÍE0@—ŒBHË^õ“t Šaè+–Ö½áÐÃ||þ0øü¡¯†4d¬ R;¹Ç!k’4 Œ¶cHÜŸ÷Ã|ì/Д+ˆ›&.?ß>ñû“‡ý?šÏ+®•t‰áòáÃ!©ŠôK7!õ—j™D|º2ÇBÔxægÔ±è4µ6¡Y)w'Ô( ƒZÄQ(Nçs Oú®õ§’ÀÛ§uÿ¦µ©)q)%#¼‡Y¯60,‰ï‹kFÛly2óžÔë Ï™›O:ýë̾èןïÕSzIðWÿêIÕ.!N==©'HnU|âÀ~zuAO\PˆúKO@ˆæ,X‚12'¨lûd8<ñzîôعù4TE•¾Js?“Ôg`6,~þð)ŸÃAÞÊõ°=¶ã£=Ûƒµ¨RÝœ,íiþX=ü0Ü?mÐgY9&v™bÎèg­K“ë¥aÅSD¿Ò,Ê%£[r?_„ì¶ ¢÷ÇŒci/Ø… ¢°0Db£=çá”qHy—¤ç UpÔŒœ÷ö˳¼ɰ޵Ö.óVÒW=öFõç‹'W9œ\ë/“îgÍ2ž)ƒêQ¨ r`@â€#0uDñË+ÂUÐ1ýÆqeNtÛ40LÉ2ƒ!{39¨4è³ô_C+ZQÒm}£‚bz‹’{š@ŒÚ!TYÇÃv¯„xÔÑÊ·¦•¯'„`“~ÞÚ{†3|ˆÒ„ÀzPæO31»û×(« ÍŽŒœy+,ä GéVgþR[°Z"Ÿjí‹w¾ KÐ¥5 s’!>ôìσÿ¼MŒ³¢!^ÌJpu)Ã$)ÌÚkŒ· ¿rѱ²¸œµ£g†8°N ©#µßŠ%W‹|¨ý¨jeûN¡/tœ€9ç•NÕõ؃=îfMUZtMùâ·?žEm,~°ÿcÖdJèWG½œ´EýÝ™ÝQœŽß1©•ÌÕAùŽK;?o»ŒãTâ&ìQßý¬ã-õü›8O‚è=m•Ñ49‡pÒ9¢­þ„<³ÎÍaaú '9ïŒPÑ©*xJ¤çŸ"lÄš—‰î\%ÆHÊo°3܆ñ‘4Þj¿B½ˆ HUºb ÃTì´:‰¼ƒ.é½PfÍ‹^ç31ƒß#À#oõ è:\/ØtuÚÎËŽ¼Úð[¬õ-¯.ÇŠ#PÇÊÌÂõ0@€÷Ö%|¿ã¿Ý2ÝÓÁO;®âUÇ•wd‚×ó8`ì`/ŽjlŽ˜ø(Ìx“í"‘4^BÒx|š!®A$×®’Ñ’Z+Vb`¹&–¿+ l©?[oØâhÐõ{áì„ÖN³‹•¸ˆ²u‘Á7ÀÆ­˜2«Â÷”©×uRËaRÐÖÒ,åäÑ@°R 2¨¡Ì;L^ªƒ ›º4§ Ї=çÓV iˆTó6(hì. ‰m€¬¦»aÂÆ¯P¼©‚Î;Aç5ÐdÔºµÿLJ ' Bç( Åc­v–^ÌÛ:¿µÿÐe%*)„_`‘ùA8÷³wn¼îâBœ¡[šÿS¥§QžbƤ5¨ö%h/©@r_Ù@W«ôàœ´WR&+±q‰7ª(“-“¤£ŒÙqÛqŠv,<)²ÖÊs@oȇ’Øa¹îFW\^§š»'wkjçmÇyå ¤qP®K‹Ê‘(G$F‰ücÕŽ8ªa<àÓû°¼dàe]"ô«,^^^Žt`Yx)½ÆgµÀ‚8‡©—Xè‹J ìlÑÎj Ùé£BÅ8ølC"žk-ߪ 1óó(o ç\‚>j"-³¥ y!£¯n±q¤YVµsþRi‡“$´Ì1^H+øây^ŒR? EÞD(À§[ÀåëèÀ§[ .uØÁ$±ƒ>+µ¡ŠžÊdDU$å·ÚP‹ç2fþæÕϤ'iÂÜ0þ:œAóK¼9ìáo™ñëu½¼Úka…Ôú›ô+iÓŒ0Jc>,Ä ™zª&ËdÌæCö§Ž SÑ9œÎÓe”23Çrž:N'[œN%LhO#”oà ò §ÒT}ÉSšþaÇ©¬þfP`39SÃ_U:øÜ©ûf;¯t`¨õ·c' +™/½F9iÜšG¯j´6~ºcœ¹"Z®Œ«„;Ü ‰“Ýz¸V½‚»Mw¯šˆ‰¨áìØ¦¤j-­JR¨BG@òÚLwj.‹úh% ó"åàL>!Ôù|«h!5ìĈ9ô£XÍu~Žõbz£aáØQÅ>må¦ÜÈG×c"q#2MLg™w®3#]¥ûˆG*¨p*·Äpæ>0—!¬Ab&UO$À ­«ÂÁ… ‡2ÉÅ9üØxqÄòEXpå&6PG[ÒZ{w!1—ƒ *±¿zò7W§êï·RºvȪ=nÒ½}u/õ–ÔÓëf})‰Œ\뜢Üe¯™ûÅ¡ØÊué%q¥K:1Ä­”6>¨ãcsXÙI ZåIé¢/¡DwÒëäà°.ÌJˆv»ÁPŸŒë›•Õ¿5Æ^«g¦)øØ¾ûII6éÊ,Ûí©VÞ¡gÛJ·Æ­ñl&ÝjA › ²lú€3*QDbÁÁp‘0))¶…•…%F+îÐ^¦©l0âÇ*R‰Éf‚¬oÿ'äiád×8Œ+c“á: 1óâ1œ* ¬-n8/"*Á2v4Ϊ3‚å$ƒ™Ée¸R‹°FÄ»º¬cQ ¼~%‚Ò·gDˆ¿Ÿ´¶œgèR>®Vg¼kYqn[)TÝ{%Eê² Ôù>›ëyÈLÔø„Kxx)r†Ûö†›éຖx)'¶¥Óu1àý‘WÁ"#FFÔdgs;X²I@vBö¢Ÿ;Ba•4²s¡èõXÌ–Ž_´Fg{Öo+ÒòÎûÃ8z”@IÐyú‰®†^Ï‘¥¨†ÅZÆ µ ÿjv™z1#Ž9&~©³OÐXæi;ÃoZÖMV‹(‰)©‰Iðq4§qš}ÄQûG,Æïù¯ÏÓäeêôñsÓ—[ð⻓9‡á¤ÇnÎ:’7Jy\J¼àt> ~mGnÞíÀvÕRä™äîÑeêIzlAGdä4ŒCé`vp³ÇJUMJ[i\¸}£f)_Õ Jk˜"Qñij´_^Ó Ûo»°„µ ‹ú:ˆ{3ÆUSsé.ÜOÛò+Ú¥°†fP[;™ª IôInÇ~/¯oæØµÎÁ®ö¤î¦ÛÍmœÞþæ¿÷?ÝPœZ>ë÷ûꇈ´nŽ÷›gQÒ)²BÏgöD ´þB½{Ëà+Pã¬à½=õ§ ÇöûGäD×Õ}à+I¯Á–¸¿©¿4kÐT}OC!¶€Ä¼]‘ן†‚¥îµ(øºQÀÕp.AÝ$8<’Syxòëáé—;Û‡ßîè-KCê‹eÌ¿ëD4¥éÿø°Ì¸®³Ñ´ß„p ¨FK‘1™ŸC=ãRG6Œiœf|FÆ'¡ô’0QZZí]dQÊbœ6JŒ¢›^­ƒ„n¸™”ÔŽ7Ut´CôO´$â<®ÙÓÝÞ¦‹î¯”[hVŸÐ¬>ÑSÚhVæÉ9l+îûŠào œ€¡h,§Ñl(DÞV«9GÆ—Ò=¬ðœ£ ÆñÖñ”ca’;iîi.òiñPä¦èÞ”óhÖÚÖÃ&ÚÚÄÛÈŠÞ´7Meºoña‰ÎÝàëÐe_n¥ŠÍî뻬ËCn–­©¶ŸGA1[©XW΢ünçVµœ·A âEÔDïÌï†D®ëÒç°ÚÕYlÎ ø™‰b’kª †Úô¢VÞWÖiÄßR}âžILJG=w—¿žøýœ~ù×¹0P†‘}ŸNõ* Ã;ýg+6øæ<$í;Pž|.Òüþ­¼_u­ —ªõW7ÛóÛ-BÛrái}oœ?ß.Gó¨¸í¯ÚR˜Œo`~2ÐN¥ úØÕ@;l–º¹Î‰W‚žušjI¥WmZ嵆H×:Wn,‚iï ~rݲ´Vë™M¶Þh·rÁ3?÷gT …‰l#ãš°‘18˪‹quêÎLUîE Ž·`»Â†;ùD ºð'JÄs QÓæ‹bÍ 5ð½UÙ¦ª‡‡m€µä›uͱíÝv²ãrâ¿ õw¢ã§$Nn9U·Wð¤ÃŒ '@YHRÆù~–Ïü =ë¦4]Œ¶ŠË®Ks`ïyöúÇãç?Ÿÿõ§ç;§ê‹/TË-• »~à¾$r®–±'Äk^`€®lÙ‹IFŒè’ŸM¢@pÊÿžÅÙi `^Ú jàlwåÈÙQ?*mÆ¥¡Ù×xÜXïIz6Š óŒ8 Le¿Ï씞YìP?£ ÞÁ6@]«¯mŸ7Ä 0 ôT¢©|S·ä Œ»t[ÓÃs^ÿïŸ{ª¥5³õhÞït5Q=oþzööøÍ‹¿ßáØ– ÙïQüeR}óÞz}øáùÓï:;QVÐÄš!ЗÏüþø‡¶àÊ%æðWsô¿âNãŸ91÷'T¯˜Õ‡u}-‹h_ýôúí±2 ÆYCµðÒÒÍò*¶,ͺ ×ß×i7J|œðܼZk>ÝØ0)Ïí­ݨØhÃ}çðêàI'ìïw¢@ø4–èYè.#°ž„¾¥k—%1™"¼‡V“Dõô»S:O®E vÏ1µ0PÃéûõƒ7aÇðêG|¯{4kW8 ¥Í•ð Í×h²(!\}=€™³æâv U8+Óo¨£ÑŽ÷ÄcaK“Q%ŒW Ѧä=Q®/™ÎJ’³Rôw‡“B“Œ§¼S&ïE8–„»[eìó’‡áDG‚Ù6U9Œ:ÖZ› S²lpÙÖÚkD\Qê{úå¤Lt½T†¸ó ~bgîÍrcî°Úͯ‹eFœÐ$= FÓ3 ÞœÇÛ´:ADlúÙ÷/pp²ˆ y~@âPCÔ4‰a€_‡ÒårÇӲإÍwì#[ B}‹YE±—IÀ*ý46e®vNoøtw婘M:6"Î1Ÿ7Û.ã(]Ëm•!œŸ¶0sÂoMh_™DS8ûöl•}Dåâw¢D€ªq!]À#œë„åˆÒtoÞ Ù7äX½ XÃ\Û$×”|5ôlËCOÒÐqJ®’ÖH\¤¤æªJ‡·ôqg ÔOÄXrxN*̺&g÷¿pz2¨9¨òͦ&ä$§ì$Íù¶Ì }£ ›ŽÈ`K—P[“â˜}¼D7v¾|«¶ý9§äátSÆæ\æóò†ÃmdÓ3õÈïʤÕÀwjà;«Á¿ªµ|P¬ÿ¶þ­^šJ @¿ß«¾5޻ؗ N?6Oƒhr¡DÍÈ96H6‰ãq¬þcð®£t÷Nw•“j_ ºÁ)«IÈm»®æ'°U?4‹k}Êe këÍiìSÇ«‹{Lm:Öî|Fv)%eNÂgZ’ü.Êå:¨4y,›I”Ö*½DNCD“·l'7ïjõPÝ0£«RˆéÄŠ²«X©ø²‰©«[§UEëá‰f³¼™&ò")™¯Y\qæ…¾¦d!lw«°€ŠÀÎ0p çÆíI<iàa¬ÏV6®¸˜Ã—T¼Ÿ*›Ûv›èïGš.ä|„$Œ ‰×P’AJ{(îäâÜæ FYlÈw>ûL©·ìŠÊ;Xø@_ù9Š%"3U‡,ÿœìŒ„kö®ÈJèñ|§â|€J§³ƒ.m5å\ÒlËlÚ­ M¼Åýµ È>ûŒÆœýÛ‰'Æ>òäSÛÀz>¾XÀ%·Œý‚î@öhOì" ¡¬².Ì"\Mû÷´TK­¨åÖIxšyÕV5êl~Ô_+Þà߯€M*)u|°£ßéF¿ ¦+¦!öõž…B¶&@âUiû¡!0ùî‘@´G BƒŽ´¼ç´¥À*‰ª½’Z-Ö8ej6Ò Ìhz× ÕéàaoV®]§>N»ÜVTVµâˆ³W!´8¿«zmc4I=ªvž%-U'çda(ëZÊ é¸i·Ív*qj×Ö<&ºp1igÔ)#s¬Éq5cvm­;7 Æ¢_j¼vƒ×DSb|•)Ü:ÜÅ¢§S~¢…y $›sÞ þþ¿ÌèqU!_øç¤ñn½Ê0‡y¨8‹\‡a·,G¿IZ ‘”Hký,YÆqN¸*ÍZí!rZhû7RŸ‘E'¬‡·å0ÞÁäûÑúÀ‡’âƒ|û÷­ã‘÷¯ÃL/M‡+yÏÞxOø° ;w”,¡ÚhðÄ8Xþø²fЬ°'}8£I×évea<8+ƒ@¤íïÙzãäCú· çÿ3ŽÝÐi1¦ÅÑv˜b·ÀÖ¾†É¥\Å•EÜçã=]­cÀ䮺ý]ÙלƒÂÆAžò.I;1Ì­ßçMk˜ÈQvÐ{8%2{ÿv\H†uáضEÝN×b¹‰ÙÁ] w60•¢•Éൠٸf6Ú…¦u¦Âa˜˜-ËüÛ8u7ãÔ¿­S÷dúͬ“NÉž Uì]I¤æoiªêZ–ŸÀ€u{{TS¼m˜¤LK5Qõ·gL²7'ÑôŽ9I˜ªSn{'ZÍ8wϧ“¢¯€é~fjyÁ iv±«—§u;âT„nâ\¿\àÊD]¶b9b{•R?ÓDgÅ2á;uvu&šÈ.9GŠ s?*îM’ò%»ZZ1L¶‚Dæçãyj~‚#{Ñ0Ö²%¦)jG2bŒgiÊÛä/µ–e{ÐYÌ1qi+µ[±T–#·pCª•‚Tï b€Ë‘ñZ‘*äV.â3¸‘I ñ@>ŽBîøÄG¾bK1Rg÷35ðUDØ¥^€=r Íaø½kŒã´z£ù9ehtcÌœúÊ#FŸ$Ò¤íé»0\€dpñ-ÓóYÈQè’]üxœÅ“m‹Éý´Ín^1’üâË]¶’k(6öL‘]ª ‘K3MaåËyòÑ··Ýh2ÿS8Éð~´Lø¸ýæµìb(4Ê5á8 ²šðB“È(dJEiIôƒÁh ¥d—awF¨ìA¶3¤ëɈۦÊÌ@FB ­›˜6ðQ,¤P!»“Á`pú•] ZÐÖJ+nžæ…5ߘÒÊã~ vÅùµ/W—š P¡©ÉÔÁX˜1øÉºrW]˜‡úuÆÖAk:!ί+3•Ì–Ó[G›ðC8^b†3ée 0Ð.¿0&éTßN&–ïT(ê¾.¬Ùœ.r™å4ìÞà ð¼•ÌÇTÀ>HÔùÀ2CÀL^bx¥=G ¦é‚—„W–Ñ%4¼úËÏoUîŸw(ÿý5…l!izWs0³9òw†|u ­F]rcƒ±úâ²ÑıN/•ûã,"Àw?ÅQq!T‡½møãñ’DC^KìQ< ‹s³V…øÛ¸lïåïqVûóû5Œ$Þ¯@MźH•i”ik´iDO‹³Óþ0Ó¿kÇ•ÒÍ$×5£ŸR×íë7†—¬›dμ¹ÎªºÒÒÞijç—f|lYå'W¦UÇú ·ÆJÏ´*h뿉l'ûír mX+®˜÷êI…6DÊÔ„@ÿjÓ`§Ì5Ûׯöëdå ù†BêUY[}¢1ŒÚ0¤ævýÆÝÁKÁ¹³U FÇÜ…ÕįA¯&w¶ “Ó¯®#z«Ø–³‹bKûîüÔqã,ØöÊÜõÛX¯Ì·+'Yh® ± Õô¥&aѬÆFVÍW›ŽBNÕuU1Ø:vmºFÛ¿™ ˆúÈŸÆ´Q3—`D|RA ý{²¥Lv1HÊ€ÉUyÀ†‚,¸»åêgoòìÎßVîIÝÙÝòºôçÛ²'awÞCÖ>“s×èuÇjëÚµžÚÉ&Õ8—ëæY7;³c’‘’n{pgí67ª$«§H[‚4O¥BmSNR’Ìe¹Iy"£]sÅJ)ÆýìDžà\€š†ì*'o±ñ9ž!ÚÜ97tQq鸂·KV K›¬qÓÏ[C:ŽÞ•Dþ=e$¹ŽßN ›)YEŒÜ³,—rAêæ<¹²ñøæ—Ù+]×-6{*ÄP%j^NŸ.ùÊ\EYqÏ,mYP®‡fÀ_pbâH Ÿ]h±Z{Èðœ&¨äm15è[¬ó0¦ÑîìJ-àOö¢Î¥Á6eaôCOå´=FÚÓV!Áõœg‡s\¢‹÷AÉäÇüúŸ”¥ä¤ŒUÆCmzâ9>uIƉ“•SXUÏ¢ 䦹L¸†Zþ>µ‰Ò¼”x'ŠW®sØ—®©ež 7Ì¡:€ÃÞ‡Ó2“½ü™˜äõJVþ{Ú”yÖ±Þi äTê¹ DJæÚRXOTT 8…1Íø¢ƒ,šFBcì xó½“éS*ÖW©u¦5¨ä´ËXó§ùJÊѯy-õ[¶ÓÄg…1G¯’³ÍuX ­$™+„ŽúÙÚ­ øúíâ®Íw¡;JhÛWV”ó·‹õ¯t°f½«.iÝ;æÈ ÆêêôU5ÀÊ€ž8äŠOYi÷:Â{›“O9Úz×Ù–/ùoWÍ܈|Å´.tÄÄøi4ï¸5b†^_âï<B¥s6 ¦‡àõ^_üVˆ}@m­ïÕØ¿fœ]¾¹†…VÔHvÓzx«àvXH5ˆùøQ9OãtìÇž>/–_`åÀH4¨ °*T‘Wbæ69h¸uñN—Vc…ñM þˆP³©Ma° 9â<´R¤nHyrÄø­{É ÷äR¶ÕöÌÆÎÖ©ÁWï•kæ¢H“g´Q½[3{„¾C’MIQîâ[ê»0‹ÞË KßÁ™Œ‰*X¦‡fTÇuÌñÃÎl‹R¤ô¡ó§íyz;ngzd¥â¢aç5/%JОm~»GÍîòÓ'1zè=)gÐ\/¿ÌâêNšsžK?FîS—‡’AGýï2Ì.®®*4U—»EA; Qš/µ(”ž®¸–Ѩ&÷µ^5üÿ»™¼¡íÙÉ’ÕÎ)®®_ô\øZ”üNpR¢Ä¢Ô¢ÄPà¨u ÑØÍ4Žu1ÊYÂà,š ¿×QKLÌ'%µDoW 4틦D°nÇÉðÐ’HÕû »>|œà1öö>¾ÈÚ-BÖCí¯ë¹U×~;”Íýix¿”×IxÜÖ'c“y6÷aí$ÿÿò‰À‘òbÆî—žJDå~Û6# @Î-ØôKë'í›Óë*ÆÖ½æÜ_Üò®u@Çex·îe¤édAþ1Ÿù‹ð#²~}´Iñ^¥´ _/‹~|/)ñn8gÅ2{1[¥î'O¦­m­»ž«sÙÚÆê«ðº•ìðî›I3WÿÞnþßÚnnµdàò‚ |/îgͰÍ=®—ÖÓ¹Dî`<¾™6°î¾·ý–-÷ÿœŽ—ùÇÿŽ—ÙÇgpp ¼Uî—ë$–¿ÿMP ïB÷F,²§}2‚±M´ 7¿» ü¤Î4Þ$ñƒ=ƒ¹»ä[†±TRŸÜÑò…ó7Ö~W-ü<·IsÛòXâ(u* U¬ÍÔ£ŠÞ™ºÙà¹=Y,g¿å\šÛ^Kãæ¦×Ì—»ã¦•­÷ÁQš[…ußËkHmÚÒ£nÚ]1ƒ§¤ºôm4À³"=Ó›¶˜¤îcÈÑåýð ]WsâÊ¡j¶Õ~\.Eî1G5±OÎ7:„-“BئÇÞx‚HÝ$*´°¤#.>³½åƒóŠfèö…¯+‚ã¹ UˆXî; Ù_”§Ùˆ]QNù/ð‰̲ϹéVºàƒó]Cö<{h\Aø`;”J{°msìÉ8ždµÅ0M¢ ð(gË.UÞ¹Q!.Å6F¯9 e‹ßÑšœ¸ª¿Ýâ’AºL;HYÞ{ΆÛKíAäáz»™ï”äBm®HµòŽ\3qjý½°Á’;úÜ™ê¢×(PÑGªÍØî+¼ÛgJ[§Ìܘæ"^NûÑÝŽ‹J…9­Ju™gcZmfñƒD]ŸÏôTò jrV–*]J}0µ$öÎÆ§åmü…V­TÃwCò·µå¯…‡E±n }½2…y¿¯¼>w¹yu€ä{Ýoc±šc8Í#» wåšÈ8ÛæFE;o»Æ“žž ³ô®«­£vÈ÷<7w ¼¹ÝífG]E‘îÙ«q6ñ½³´œ&®}-ŠÏü Èîz&B#ãõïÃð +æ®è›‹´³'¶EÀC’Úéî£ï€2©,ZŠ;&ª¯VçùW-ðEŠ{ˆÓ2W@ÄgÙeZ[lÊÈj›¤|""oR¶uH˜}Ìißó§a®«À=‰Ø=—ˆgyOû5 ¡˜0c§¬õ~1XJ3³¦¼7òú'zýX¸¸u.J+ÁÿLôðX<-XÄX£ÈqúcÖ&\<ò¹†TrH¥zšJ0Ú4 œ‰v܉mžºá­¼ó^ÒáT' ôµyµÁr“TíG*±ŸnTÔí¼CØ¡¤Ù©´æ,¦4‰abIio™g{q4ÚC[€7>¨á¸ùNõ ÕOƒ‘:¨“|#àAæKÒ×Çì+Q@ ý$ÌÑ]ˆê"Á*ZÀb®…>"2E¥!Õ’Z•—pˆf-|LE¦Ë\‰Ö=¢÷u¶ZÓKä±eÊžÏà â LçÀ» ù(J:ñPy¹J.·Å†”ºê¿ß~÷‡Áú»Ð4_äp¯ÔNåIa¥EÉ škÎ9zMä»ic³=TßvŠ/c¾p2&›­æ¿Ü oݦ^¸¼ÏÉÔÓñ;87ÕÔ£oN77$]q”$?Gð¢°]ÃRù!1U(¶!Û¾†VÞ\!$_Kެþ/_káYš§ÞMÚùšù¦¥™J;¯ž¾x©þüæõ«Ç5^ò‰Ú{óì§cuüÚ´¦Qÿ©šûîéñÓ[Õüõ7h¯9ÃwunöP²ì•ÍÊMU¨S§np¿£Ö¯rW°‘GU~ÈŒ2b÷k’öBÕ—-®¾–»;“ºº=®·¿›ÅÑC‘ÛŸH‰3çÝD*ÄL³éËñæ föÄ„]ìñæ–Þ=pĹ‚É#â/ƒiú§"04&V½]ÉôüVåƒH,ˆ é—{ÜVÖÓjn [®y,/æí¾Ñ‰›ÊíE”„] <š¸=ºc«´Õª‰¸Þ†Eßܳ캒Ê%Ö\}úd݃ƒ®º©ýòÎ6ƒ„¶Ã¶–DB̳{§ˆûòÏ$÷ù»j¿ÿ?é?zøõªG_?þæOôõý«ãŠJ²Vkéùum}½ßÿ.÷÷ÿô§‡­mmntâÚ’’Óæ“ŽËª¶… ?B‚]ÿ0»Öžl·M+ w5“|’…½ªŽÙÞ€€>é´1x­QcM­1õ5Õéʯ„,ý,óå4¥ryC…—:NÒ.n $êxèäuŠW9Eöø5»ïR¹òtƒáª¶Ø}±³m˜6öôá™ÉtRm¨l‰Êpõ;;7n­¼×¹°B‚žYgëdœ&c_Ë\öº q³ª¢º âúúN«ô㪼UÀ¶ùÔ$}Y&¬dUÃ2 ¶è}å)!±òúsýúóGß@q„&óVÎLr²hmTBŸnPûÁ’¶íÏ›•=1•}ýßí­íÚÖžµp*[†xøÝçŸ:@‚úyëóO^i÷søÉUuxóðËõŽ-´r‹}‹­¤<î“Þ54Z“îÃö=öµñ»}øúõzÐÀ¿7ð¼eéy' dk@väýF®‡Êq#nÈ(Åì‡Sâ&kG á¤k¤êHíªÑy-j­i² )j©ƒç§eâ!YvÎülÍ™ŸýNˆ¾2õ<òs?[…–îô7G¨‘ÞœOö9èêx°æ|¿Çù”?ÝóÙMæÁob>ïr^·üå³ö>Çgᆟ ³§ÉwÊÚÕ%Üt E/8à@¤,Œ8s‡/>q^.WJ×goœçCœ¡X„ó…ŸtÝ w÷çÁ]]ÿâx_}'ñ8öó†ªÜ]¥€ßò.z-BòUô­ÔlÝÅc*ƒöuǛ鹎º‚Æ& pÞ'[úT(â[-vÍUŠÓhB1­ûЙ ×`b9q1~Ô°vÜÁ•fib>ŽÓ8ÿ˜&?'p)£//åî5ÿ\gõü~d@F•X»p<ßÎ&È3A÷+}"QIÅ'’8 /?„× ·VäGYõ¶•ÓÑ ôQ+u} œžG {|”ïâð1g)眣‰eï©þÌj®1É$ÊnÝÎÀ À:q X(5ø[mÄ·a2~0¿£o‰>6‡xú¢®7BšÁ"Íœ¨<¾¿Ó~©î†gþn¡[ãºfÒ¹îJ²~¦ññç|ɬ´Œž Gîá!—áo¼²ô÷$<ß1g8z"¤Þq:ŸûI`NÄwJ³Sæa’Ëm•GÈípåÀ•¿Ð¦ž&»6“ƒavG të9A[e»C¦@ÃoMa&¯Ó²@vÍè–¢À–Z&AŠ«Èˆ³lõøJ²)Ø\‘&›:13_pÍÉxþ8”k®‘¶—ø2甊ô%\b÷çIPǹ ì]Ø~|î_ ÅBe¾ÜwÌ8~õRnÿÀÂÆù,‚B]”—t1iw 䯹Ó\ G]¹d*•Ì£q8 èí¯B¹â÷®qE™x}ÒF;™2$ ÏÒs…ì¢Ò(p6^p3ÔÍ©Ž}Ψ€DÔº3ÈÖ³bÆ)–QnÙSÏÃôþ’¢)*;Nª­š;õ%~»²µ~^s„‹‘0.çlqZ5pôÂUi¶ôE4ú" ™4‡?Y ½VÔ·z¥èú¬Œ<µ.·Ô$Q‹l˜a A [Ãlq²‰0Nç ­ð±³%¶èlHLE_BlÁÒzv¥1Ӕư¹‚]zØÓG“ ƒviêR2!í«è‘AzÛ¬XyT‚$¾=:½õêÅégßd`?ã`™Ýz ÿÜZ›¹ÑÎqQþ™ºà‘sD¿OÓ@ÍC$RrÉ …§¥*“ŽÚä#<‚ºÓ‰¤c\°ƒØ–¾zñÎë’ã4ó´l‘Nìù£4¢õ¶€#µNET{†~g:ÂþÕõƒù›ÃbXTU>+7öäÑ4ñ ”ÆùY¾«HŸ+úË”ƒþèbW…ŸÞãxåÊsL¢a„œÅ¿¡ÌÆÕÑu·Kß½~†‹°;öåH²l&HÇ’ÀGãâ6”E+‘½ôˆþ!m܆°ÆÚÿ¬ß³4-ÌwF¯RÕm©ÐJy ±ÖÔÞ™#GæüÚÇs³MÞóЄ‡ø¢0•Ï8˼ãp埱D‰¬áºž\ßK.yííåèô‡ršxöý \¶- âò„-Xb²p_x’Ɉ›ŠùBò¦ÙŦN°„lRg aÄÐl›/;š"–Iô¡"}÷NÜJª¾æþ‰BI¸o’ ‚fêÈûûÂEâ<Źx<$þž%ñ3@¶¼edµ÷¢”¸ö²[ ¼RºX»/$ŒsVJÖÛÙ—5i@##¶‹à²‘× #±Ó˜îuUýï®[â{½ÇÉ‹ ?ŒqZ¶ùÍb15X­ÎŸÏÕ/¦1¸I=z… ”€‚“ž±€„²ˆ¶¸¾„ö€€€€ƒ¤ú‚ž€† Œ¦¶²†耀‚•î ƒ€ˆ „ˆ Œ½™„Ö…Ú€„œü‚˜€„šÌ߀¼dirs[name:S,parent:I,files[name:S,size:I,date:I,contents:B]]«€Ný€CNºvqtcl/data/mkblk.db0000644000076500007650000002355410574304471014147 0ustar jcwjcw00000000000000LJ'l  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæÿÿÿþÿýÿüÿûÿúÿùÿøÿ÷ÿöÿõÿôÿóÿòÿñÿðÿïÿîÿíÿìÿëÿêÿéÿèÿçÿæÿåÿäÿãÿâÿáÿàÿßÿÞÿÝÿÜÿÛÿÚÿÙÿØÿ×ÿÖÿÕÿÔÿÓÿÒÿÑÿÐÿÏÿÎÿÍÿÌÿËÿÊÿÉÿÈÿÇÿÆÿÅÿÄÿÃÿÂÿÁÿÀÿ¿ÿ¾ÿ½ÿ¼ÿ»ÿºÿ¹ÿ¸ÿ·ÿ¶ÿµÿ´ÿ³ÿ²ÿ±ÿ°ÿ¯ÿ®ÿ­ÿ¬ÿ«ÿªÿ©ÿ¨ÿ§ÿ¦ÿ¥ÿ¤ÿ£ÿ¢ÿ¡ÿ ÿŸÿžÿÿœÿ›ÿšÿ™ÿ˜ÿ—ÿ–ÿ•ÿ”ÿ“ÿ’ÿ‘ÿÿÿŽÿÿŒÿ‹ÿŠÿ‰ÿˆÿ‡ÿ†ÿ…ÿ„ÿƒÿ‚ÿÿ€ÿÿ~ÿ}ÿ|ÿ{ÿzÿyÿxÿwÿvÿuÿtÿsÿrÿqÿpÿoÿnÿmÿlÿkÿjÿiÿhÿgÿfÿeÿdÿcÿbÿaÿ`ÿ_ÿ^ÿ]ÿ\ÿ[ÿZÿYÿXÿWÿVÿUÿTÿSÿRÿQÿPÿOÿNÿMÿLÿKÿJÿIÿHÿGÿFÿEÿDÿCÿBÿAÿ@ÿ?ÿ>ÿ=ÿ<ÿ;ÿ:ÿ9ÿ8ÿ7ÿ6ÿ5ÿ4ÿ3ÿ2ÿ1ÿ0ÿ/ÿ.ÿ-ÿ,ÿ+ÿ*ÿ)ÿ(ÿ'ÿ&ÿ%ÿ$ÿ#ÿ"ÿ!ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿþÿþþþýþüþûþúþùþøþ÷þöþõþôþóþòþñþðþïþîþíþìþëþêþéþèþçþæþåþäþãþâþáþàþßþÞþÝþÜþÛþÚþÙþØþ×þÖþÕþÔþÓþÒþÑþÐþÏþÎþÍþÌþËþÊþÉþÈþÇþÆþÅþÄþÃþÂþÁþÀþ¿þ¾þ½þ¼þ»þºþ¹þ¸þ·þ¶þµþ´þ³þ²þ±þ°þ¯þ®þ­þ¬þ«þªþ©þ¨þ§þ¦þ¥þ¤þ£þ¢þ¡þ þŸþžþþœþ›þšþ™þ˜þ—þ–þ•þ”þ“þ’þ‘þþþŽþþŒþ‹þŠþ‰þˆþ‡þ†þ…þ„þƒþ‚þþ€þþ~þ}þ|þ{þzþyþxþwþvþuþtþsþrþqþpþoþnþmþlþkþjþiþhþgþfþeþdþcþbþaþ`þ_þ^þ]þ\þ[þZþYþXþWþVþUþTþSþRþQþPþOþNþMþLþKþJþIþHþGþFþEþDþCþBþAþ@þ?þ>þ=þ<þ;þ:þ9þ8þ7þ6þ5þ4þ3þ2þ1þ0þ/þ.þ-þ,þ+þ*þ)þ(þ'þ&þ%þ$þ#þ"þ!þ þþþþþþþþþþþþþþþþþþþ þ þ þ þ þþþþþþþþþýÿýþýýýüýûýúýùýøý÷ýöýõýôýóýòýñýðýïýîýíýìýëýêýéýèýçýæýåýäýãýâýáýàýßýÞýÝýÜýÛýÚýÙýØý×ýÖýÕýÔýÓýÒýÑýÐýÏýÎýÍýÌýËýÊýÉýÈýÇýÆýÅýÄýÃýÂýÁýÀý¿ý¾ý½ý¼ý»ýºý¹ý¸ý·ý¶ýµý´ý³ý²ý±ý°ý¯ý®ý­ý¬ý«ýªý©ý¨ý§ý¦ý¥ý¤ý£ý¢ý¡ý ýŸýžýýœý›ýšý™ý˜ý—ý–ý•ý”ý“ý’ý‘ýýýŽýýŒý‹ýŠý‰ýˆý‡ý†ý…ý„ýƒý‚ýý€ýý~ý}ý|ý{ýzýyýxýwývýuýtýsýrýqýpýoýnýmýlýkýjýiýhýgýfýeýdýcýbýaý`ý_ý^ý]ý\ý[ýZýYýXýWýVýUýTýSýRýQýPýOýNýMýLýKýJýIýHýGýFýEýDýCýBýAý@ý?ý>ý=ý<ý;ý:ý9ý8ý7ý6ý5ý4ý3ý2ý1ý0ý/ý.ý-ý,ý+ý*ý)ý(ý'ý&ý%ý$ý#ý"ý!ý ýýýýýýýýýýýýýýýýýýý ý ý ý ý ýýýýýýýýýüÿüþüýüüüûüúüùüøü÷üöüõüôüóüòüñüðüïüîüíüìüëüêüéüèüçüæüåüäüãüâüáüàüßüÞüÝüÜüÛüÚüÙüØü×üÖüÕüÔüÓüÒüÑüÐüÏüÎüÍüÌüËüÊüÉüÈüÇüÆüÅüÄüÃüÂüÁüÀü¿ü¾ü½ü¼ü»üºü¹ü¸ü·ü¶üµü´ü³ü²ü±ü°ü¯ü®ü­ü¬ü«üªü©ü¨ü§ü¦ü¥ü¤ü£ü¢ü¡ü üŸüžüüœü›üšü™ü˜ü—ü–ü•ü”ü“ü’ü‘üüüŽüüŒü‹üŠü‰üˆü‡ü†ü…ü„üƒü‚üü€üü~ü}ü|ü{üzüyüxüwüvüuütüsürüqüpüoünümülüküjüiühügüfüeüdücübüaü`ü_ü^ü]ü\ü[üZüYüXüWüVüUüTüSüRüQüPüOüNüMüLüKüJüIüHüGüFüEüDüCüBüAü@ü?ü>ü=ü<ü;ü:ü9ü8ü7ü6ü5ü4ü3ü2ü1ü0ü/ü.ü-ü,ü+ü*ü)ü(ü'ü&ü%ü$ü#ü"ü!ü üüüüüüèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎüüüüüüüüüüüü ü ü ü ü üüüüüüüüüûÿûþûýûüûûûúûùûøû÷ûöûõûôûóûòûñûðûïûîûíûìûëûêûéûèûçûæûåûäûãûâûáûàûßûÞûÝûÜûÛûÚûÙûØû×ûÖûÕûÔûÓûÒûÑûÐûÏûÎûÍûÌûËûÊûÉûÈûÇûÆûÅûÄûÃûÂûÁûÀû¿û¾û½û¼û»ûºû¹û¸û·û¶ûµû´û³û²û±û°û¯û®û­û¬û«ûªû©û¨û§û¦û¥û¤û£û¢û¡û ûŸûžûûœû›ûšû™û˜û—û–û•û”û“û’û‘ûûûŽûûŒû‹ûŠû‰ûˆû‡û†û…û„ûƒû‚ûû€ûû~û}û|û{ûzûyûxûwûvûuûtûsûrûqûpûoûnûmûlûkûjûiûhûgûfûeûdûcûbûaû`û_û^û]û\û[ûZûYûXûWûVûUûTûSûRûQûPûOûNûMûLûKûJûIûHûGûFûEûDûCûBûAû@û?û>û=û<û;û:û9û8û7û6û5û4û3û2û1û0û/û.û-û,û+û*û)û(û'û&û%û$û#û"û!û ûûûûûûûûûûûûûûûûûûû û û û û ûûûûûûûûûúÿúþúýúüúûúúúùúøú÷úöúõúôúóúòúñúðúïúîúíúìúëúêúéúèúçúæúåúäúãúâúáúàúßúÞúÝúÜúÛúÚúÙúØú×úÖúÕúÔúÓúÒúÑúÐúÏúÎúÍúÌúËúÊúÉúÈúÇúÆúÅúÄúÃúÂúÁúÀú¿ú¾ú½ú¼ú»úºú¹ú¸ú·ú¶úµú´ú³ú²ú±ú°ú¯ú®ú­ú¬ú«úªú©ú¨ú§ú¦ú¥ú¤ú£ú¢ú¡ú úŸúžúúœú›úšú™ú˜ú—ú–ú•ú”ú“ú’ú‘úúúŽúúŒú‹úŠú‰úˆú‡ú†ú…ú„úƒú‚úú€úú~ú}ú|ú{úzúyúxúwúvúuútúsúrúqúpúoúnúmúlúkújúiúhúgúfúeúdúcúbúaú`ú_ú^ú]ú\ú[úZúYúXúWúVúUúTúSúRúQúPúOúNúMúLúKúJúIúHúGúFúEúDúCúBúAú@ú?ú>ú=ú<ú;ú:ú9ú8ú7ú6ú5ú4ú3ú2ú1ú0ú/ú.ú-ú,ú+ú*ú)ú(ú'ú&ú%ú$ú#ú"ú!ú úúúúúúúúúúúúúúúúúúú ú ú ú ú úúúúúúúúúùÿùþùýùüùûùúùùùøù÷ùöùõùôùóùòùñùðùïùîùíùìùëùêùéùèùçùæùåùäùãùâùáùàùßùÞùÝùÜùÛùÚùÙùØù×ùÖùÕùÔùÓùÒùÑùÐùÏùÎùÍùÌùËùÊùÉùÈùÇùÆùÅùÄùÃùÂùÁùÀù¿ù¾ù½ù¼ù»ùºù¹ù¸ù·ù¶ùµù´ù³ù²ù±ù°ù¯ù®ù­ù¬ù«ùªù©ù¨ù§ù¦ù¥ù¤ù£ù¢ù¡ù ùŸùžùùœù›ùšù™ù˜ù—ù–ù•ù”ù“ù’ù‘ùùùŽùùŒù‹ùŠù‰ùˆù‡ù†ù…ù„ùƒù‚ùù€ùù~ù}ù|ù{ùzùyùxùwùvùuùtùsùrùqùpùoùnùmùlùkùjùiùhùgùfùeùdùcùbùaù`ù_ù^ù]ù\ù[ùZùYùXùWùVùUùTùSùRùQùPùOùNùMùLùKùJùIùHùGùFùEùDùCùBùAù@ù?ù>ù=ù<ù;ù:ù9ù8ù7ù6ù5ù4ù3ù2ù1ù0ù/ù.ù-ù,ù+ù*ù)ù(ù'ù&ù%ù$ù#ù"ù!ù ùùùùùùùùùùùùùùùùùùù ù ù ù ù ùùùùùùùùùøÿøþøýøüøûøúøùøøø÷øöøõøôøóøòøñøðøïøîøíøìøëøêøéøèøçøæøåøäøãøâøáøàøßøÞøÝøÜøÛøÚøÙøØø×øÖøÕøÔøÓøÒøÑøÐøÏøÎøÍøÌøËøÊøÉøÈøÇøÆøÅøÄøÃøÂøÁøÀø¿ø¾ø½ø¼ø»øºø¹ø¸ø·ø¶øµø´ø³ø²ø±ø°ø¯ø®ø­ø¬ø«øªø©ø¨ø§ø¦ø¥ø¤ø£ø¢ø¡ø øŸøžøøœø›øšø™ø˜ø—ø–ø•ø”ø“ø’ø‘øøøŽøøŒø‹øŠø‰øˆø‡ø†ø…ø„øƒø‚øø€øø~ø}ø|ø{øzøyøxøwøvøuøtøsørøqøpøoønømøløkøjøiøhøgøføeødøcøbøaø`ø_ø^ø]ø\ø[øZøYøXøWøVøUøTøSøRøQøPøOøNøMøLøKøJøIøHøGøFøEøDøCøBøAø@ø?ø>ø=ø<ø;ø:ø9ø8ø7ø6ø5ø4ø3ø2ÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ                           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ãø0ø/ø.ø-ø,ø+ø*ø)ø(ø'ø&ø%ø$ø#ø"ø!ø øøøøøøøøøøøøøøøøøøø ø ø ø ø øøøøøøøøø÷ÿ÷þ÷ý÷ü÷û÷ú÷ù÷ø÷÷÷ö÷õ÷ô÷ó÷ò÷ñ÷ð÷ï÷î÷í÷ì÷ë÷ê÷é÷è÷ç÷æ÷å÷ä÷ã÷â÷á÷à÷ß÷Þ÷Ý÷Ü÷Û÷Ú÷Ù÷Ø÷×÷Ö÷Õ÷Ô÷Ó÷Ò÷Ñ÷Ð÷Ï÷Î÷Í÷Ì÷Ë÷Ê÷É÷È÷Ç÷Æ÷Å÷Ä÷Ã÷Â÷Á÷À÷¿÷¾÷½÷¼÷»÷º÷¹÷¸÷·÷¶÷µ÷´÷³÷²÷±÷°÷¯÷®÷­÷¬÷«÷ª÷©÷¨÷§÷¦÷¥÷¤÷£÷¢÷¡÷ ÷Ÿ÷ž÷÷œ÷›÷š÷™÷˜÷—÷–÷•÷”÷“÷’÷‘÷÷÷Ž÷÷Œ÷‹÷Š÷‰÷ˆ÷‡÷†÷…÷„÷ƒ÷‚÷÷€÷÷~÷}÷|÷{÷z÷y÷x÷w÷v÷u÷t÷s÷r÷q÷p÷o÷n÷m÷l÷k÷j÷i÷h÷g÷f÷e÷d÷c÷b÷a÷`÷_÷^÷]÷\÷[÷Z÷Y÷X÷W÷V÷U÷T÷S÷R÷Q÷P÷O÷N÷M÷L÷K÷J÷I÷H÷G÷F÷E÷D÷C÷B÷A÷@÷?÷>÷=÷<÷;÷:÷9÷8÷7÷6÷5÷4÷3÷2÷1÷0÷/÷.÷-÷,÷+÷*÷)÷(÷'÷&÷%÷$÷#÷"÷!÷ ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷ ÷ ÷ ÷ ÷÷÷÷÷÷÷÷÷öÿöþöýöüöûöúöùöøö÷öööõöôöóöòöñöðöïöîöíöìöëöêöéöèöçöæöåöäöãöâöáöàößöÞöÝöÜöÛöÚöÙöØö×öÖöÕöÔöÓöÒöÑöÐöÏöÎöÍöÌöËöÊöÉöÈöÇöÆöÅöÄöÃöÂöÁöÀö¿ö¾ö½ö¼ö»öºö¹ö¸ö·ö¶öµö´ö³ö²ö±ö°ö¯ö®ö­ö¬ö«öªö©ö¨ö§ö¦ö¥ö¤ö£ö¢ö¡ö öŸöžööœö›öšö™ö˜ö—ö–ö•ö”ö“ö’ö‘öööŽööŒö‹öŠö‰öˆö‡ö†ö…ö„öƒö‚öö€öö~ö}ö|ö{özöyöxöwövöuötösöröqöpöoönömölököjöiöhögöföeödöcöböaö`ö_ö^ö]ö\ö[öZöYöXöWöVöUöTöSöRöQöPöOöNöMöLöKöJöIöHöGöFöEöDöCöBöAö@ö?ö>ö=çÏüø1€çΈÎÖ€çΤÎ.ò€ôè>ÀèF¨€‚„N„N”€„¨N˜€‘bv[_B[k1:I,k2:I]]…NÀ€'\€'Evqtcl/doc/0000755000076500007650000000000010574304471012363 5ustar jcwjcw00000000000000vqtcl/doc/ratcl.html0000644000076500007650000000646710574304471014373 0ustar jcwjcw00000000000000 ratcl - Relational Algebra for Tcl

ratcl(n) 4 ratcl "Relational Algebra for Tcl"

NAME

ratcl - A Relational Algebra extension for Tcl

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    EXAMPLE
    SEE ALSO
    KEYWORDS

SYNOPSIS

package require ratcl ?4?

view arg operator ... | ...
... view | names
... filename | open
... view | to varname

DESCRIPTION

The ratcl package implements a general-purpose relational algebra and persistence framework as a notation on top of the Vlerq extension.

COMMANDS

view arg operator ... | ...
The view command wraps all the different operators provided by the vlerq package and lets you create pipelines, whereby the output of one operator is fed as input to the next.

... view | names
Return a list with all the column names of view.

... filename | open
The open operator opens a Metakit-compatible datafile and returns its root view.

... view | to varname
Store a view in the varname variable. That same view is also returned as result.

THIS DOCUMENTATION NEEDS TO BE FINISHED

EXAMPLE

 
package require ratcl
view myile.db open | to v
puts [view $v names]

This lists all the sub-views available in the myfile.db file.

SEE ALSO

metakit, vlerq

KEYWORDS

algebra, database, persistence, relational vqtcl/doc/ratcl.man0000644000076500007650000000243010574304471014164 0ustar jcwjcw00000000000000[manpage_begin ratcl n 4] [moddesc {Relational Algebra for Tcl}] [titledesc {A Relational Algebra extension for Tcl}] [require ratcl [opt 4]] [description] [para] The [package ratcl] package implements a general-purpose relational algebra and persistence framework as a notation on top of the Vlerq extension. [section COMMANDS] [list_begin definitions] [call [cmd view] [arg arg] [cmd operator] [arg ...] | [arg ...]] The [cmd view] command wraps all the different operators provided by the [package vlerq] package and lets you create pipelines, whereby the output of one operator is fed as input to the next. [call ... [arg view] | [cmd names]] Return a list with all the column names of [arg view]. [call ... [arg filename] | [cmd open]] The [cmd open] operator opens a Metakit-compatible datafile and returns its root view. [call ... [arg view] | [cmd to] [arg varname]] Store a view in the [arg varname] variable. That same view is also returned as result. [list_end] [para] THIS DOCUMENTATION NEEDS TO BE FINISHED [section EXAMPLE] [para] [example { package require ratcl view myile.db open | to v puts [view $v names] }] [para] This lists all the sub-views available in the myfile.db file. [see_also vlerq metakit] [keywords database persistence relational algebra] [manpage_end] vqtcl/doc/ratcl.n0000644000076500007650000000273710574304471013660 0ustar jcwjcw00000000000000'\" '\" Generated from file './doc/ratcl.man' by tcllib/doctools with format 'nroff' '\" .so man.macros .TH "ratcl" n 4 ratcl "Relational Algebra for Tcl" .BS .SH NAME ratcl \- A Relational Algebra extension for Tcl .SH SYNOPSIS package require \fBratcl ?4?\fR .sp \fBview\fR \fIarg\fR \fBoperator\fR \fI...\fR | \fI...\fR .sp ... \fIview\fR | \fBnames\fR .sp ... \fIfilename\fR | \fBopen\fR .sp ... \fIview\fR | \fBto\fR \fIvarname\fR .sp .BE .SH DESCRIPTION .PP The \fBratcl\fR package implements a general-purpose relational algebra and persistence framework as a notation on top of the Vlerq extension. .SH COMMANDS .TP \fBview\fR \fIarg\fR \fBoperator\fR \fI...\fR | \fI...\fR The \fBview\fR command wraps all the different operators provided by the \fBvlerq\fR package and lets you create pipelines, whereby the output of one operator is fed as input to the next. .TP ... \fIview\fR | \fBnames\fR Return a list with all the column names of \fIview\fR. .TP ... \fIfilename\fR | \fBopen\fR The \fBopen\fR operator opens a Metakit-compatible datafile and returns its root view. .TP ... \fIview\fR | \fBto\fR \fIvarname\fR Store a view in the \fIvarname\fR variable. That same view is also returned as result. .PP THIS DOCUMENTATION NEEDS TO BE FINISHED .SH EXAMPLE .PP .nf package require ratcl view myile.db open | to v puts [view $v names] .fi .PP This lists all the sub-views available in the myfile.db file. .SH "SEE ALSO" metakit, vlerq .SH KEYWORDS algebra, database, persistence, relationalvqtcl/doc/vlerq.html0000644000076500007650000000514410574304471014406 0ustar jcwjcw00000000000000 vlerq - Vlerq data manipulation core engine

vlerq(n) 4 vlerq "Vlerq data manipulation core engine"

NAME

vlerq - The engine used by the Ratcl extension

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    EXAMPLE
    SEE ALSO
    KEYWORDS

SYNOPSIS

package require vlerq ?4?

vlerq command ...
vlerq open filename

DESCRIPTION

The vlerq package provides commands used by the Ratcl extension to implement a general-purpose relational algebra and persistence framework.

COMMANDS

vlerq command ...
The vlerq command wraps all the different sub-commands provided by the vlerq package.

vlerq open filename
The open sub-command opens a Metakit-compatible datafile and returns its root view.

THIS DOCUMENTATION NEEDS TO BE FINISHED

EXAMPLE

 
package require vlerq
set v [vlerq open myfile.db]
puts [vlerq names $v]

This lists all the sub-views available in the myfile.db file.

SEE ALSO

metakit, ratcl

KEYWORDS

algebra, database, persistence, relational vqtcl/doc/vlerq.man0000644000076500007650000000173510574304471014217 0ustar jcwjcw00000000000000[manpage_begin vlerq n 4] [moddesc {Vlerq data manipulation core engine}] [titledesc {The engine used by the Ratcl extension}] [require vlerq [opt 4]] [description] [para] The [package vlerq] package provides commands used by the Ratcl extension to implement a general-purpose relational algebra and persistence framework. [section COMMANDS] [list_begin definitions] [call [cmd vlerq] [arg command] [arg ...]] The [cmd vlerq] command wraps all the different sub-commands provided by the [package vlerq] package. [call [cmd vlerq] [cmd open] [arg filename]] The [cmd open] sub-command opens a Metakit-compatible datafile and returns its root view. [list_end] [para] THIS DOCUMENTATION NEEDS TO BE FINISHED [section EXAMPLE] [para] [example { package require vlerq set v [vlerq open myfile.db] puts [vlerq names $v] }] [para] This lists all the sub-views available in the myfile.db file. [see_also ratcl metakit] [keywords database persistence relational algebra] [manpage_end] vqtcl/doc/vlerq.n0000644000076500007650000000212110574304471013667 0ustar jcwjcw00000000000000'\" '\" Generated from file './doc/vlerq.man' by tcllib/doctools with format 'nroff' '\" .so man.macros .TH "vlerq" n 4 vlerq "Vlerq data manipulation core engine" .BS .SH NAME vlerq \- The engine used by the Ratcl extension .SH SYNOPSIS package require \fBvlerq ?4?\fR .sp \fBvlerq\fR \fIcommand\fR \fI...\fR .sp \fBvlerq\fR \fBopen\fR \fIfilename\fR .sp .BE .SH DESCRIPTION .PP The \fBvlerq\fR package provides commands used by the Ratcl extension to implement a general-purpose relational algebra and persistence framework. .SH COMMANDS .TP \fBvlerq\fR \fIcommand\fR \fI...\fR The \fBvlerq\fR command wraps all the different sub-commands provided by the \fBvlerq\fR package. .TP \fBvlerq\fR \fBopen\fR \fIfilename\fR The \fBopen\fR sub-command opens a Metakit-compatible datafile and returns its root view. .PP THIS DOCUMENTATION NEEDS TO BE FINISHED .SH EXAMPLE .PP .nf package require vlerq set v [vlerq open myfile.db] puts [vlerq names $v] .fi .PP This lists all the sub-views available in the myfile.db file. .SH "SEE ALSO" metakit, ratcl .SH KEYWORDS algebra, database, persistence, relationalvqtcl/generic/0000755000076500007650000000000010637717020013230 5ustar jcwjcw00000000000000vqtcl/generic/vlerq.c0000644000076500007650000062166210637717020014542 0ustar jcwjcw00000000000000/* vlerq.c - this is the single-source-file version of Vlerq for Tcl */ /* %includeDir<../src>% */ /* %includeDir<../src_tcl>% */ /* %include% */ /* * bits.c - Implementation of bitwise operations. */ #include #include /* * intern.h - Internal definitions. */ #include #include typedef ptrdiff_t Int_t; /* large enough to hold a pointer */ typedef unsigned char Byte_t; #ifdef OBJECT_TYPE typedef OBJECT_TYPE Object_p; #else /* * defs.h - Binding-specific definitions needed by the general code. */ typedef struct Tcl_Obj *Object_p; #endif #if !defined(VALUES_MUST_BE_ALIGNED) && (defined(__sparc__) || defined(__sgi__)) #define VALUES_MUST_BE_ALIGNED 1 #endif #if !defined(_BIG_ENDIAN) && defined(WORDS_BIGENDIAN) #define _BIG_ENDIAN 1 #endif #if DEBUG+0 #define Assert(x) do if (!(x)) FailedAssert(#x, __FILE__, __LINE__); while (0) #define DbgIf(x) if (GetShared()->debug && (x)) #else #define Assert(x) #define DbgIf(x) if (0) #endif #define DBG_trace (1<<0) #define DBG_deps (1<<1) #define PUSH_KEEP_REFS \ { Shared_p _shared = GetShared(); \ struct Buffer _keep, *_prev = _shared->keeps; \ InitBuffer(_shared->keeps = &_keep); #define POP_KEEP_REFS \ ReleaseSequences(&_keep); \ _shared->keeps = _prev; \ } /* keep in sync with CharAsItemType() in column.c */ typedef enum ItemTypes { IT_unknown, IT_int, IT_wide, IT_float, IT_double, IT_string, IT_bytes, IT_object, IT_column, IT_view, IT_error } ItemTypes; typedef enum ErrorCodes { EC_cioor, EC_rioor, EC_cizwv, EC_nmcw, EC_rambe, EC_nalor, EC_wnoa } ErrorCodes; struct Shared { struct SharedInfo *info; /* ext_tcl.c */ int refs; /* ext_tcl.c */ int debug; /* debug flags */ struct Buffer *keeps; /* column.c */ struct Sequence *empty; /* view.c */ }; typedef struct Shared *Shared_p; typedef struct SeqType *SeqType_p; typedef struct Sequence *Seq_p; typedef struct Column *Column_p; typedef union Item *Item_p; typedef Seq_p View_p; typedef ItemTypes (*Getter) (int row, Item_p item); typedef void (*Cleaner) (Seq_p seq); struct SeqType { const char *name; /* for introspection only */ Getter getfun; /* item accessor, copied to Sequence during setup */ short cleanups; /* octal for data[0..3].p: 0=none, 1=decref, 2=free */ Cleaner cleaner; /* called before performing the above cleanups */ }; struct Sequence { int count; /* number of entries */ int refs; /* reference count */ SeqType_p type; /* type dispatch table */ Getter getter; /* item accessor function */ union { int i; void *p; Seq_p q; Object_p o; } data[4]; /* getter-specific */ }; #define IncRefCount(seq) AdjustSeqRefs(seq, 1) #define DecRefCount(seq) AdjustSeqRefs(seq, -1) #define KeepRef(seq) IncRefCount(LoseRef(seq)) typedef struct Column { Seq_p seq; /* the sequence which will handle accesses */ int pos; /* position of this column in the view */ } Column; typedef union Item { char b [8]; /* used for raw access and byte-swapping */ int q [2]; /* used for hash calculation of wides and doubles */ int i; /* IT_int */ int64_t w; /* IT_wide */ float f; /* IT_float */ double d; /* IT_double */ const void *p; /* used to convert pointers */ const char *s; /* IT_string */ struct { const Byte_t *ptr; int len; } u; /* IT_bytes */ Object_p o; /* IT_object */ Column c; /* IT_column */ View_p v; /* IT_view */ ErrorCodes e; /* IT_error */ } Item; /* column.c */ void *(AdjustSeqRefs) (void *refs, int count); void (AppendToStrVec) (const void *s, int bytes, Seq_p seq); int (CastObjToItem) (char type, Item_p item); ItemTypes (CharAsItemType) (char type); Column (CoerceColumn) (ItemTypes type, Object_p obj); void (FailedAssert) (const char *msg, const char *file, int line); Column (ForceStringColumn) (Column column); Item (GetColItem) (int row, Column column, ItemTypes type); ItemTypes (GetItem) (int row, Item_p item); Item (GetSeqItem) (int row, Seq_p seq, ItemTypes type); Item (GetViewItem) (View_p view, int row, int col, ItemTypes type); Seq_p (LoseRef) (Seq_p seq); Seq_p (NewBitVec) (int count); Seq_p (NewIntVec) (int count, int **dataptr); Seq_p (NewPtrVec) (int count, Int_t **dataptr); Seq_p (NewSequence) (int count, SeqType_p type, int auxbytes); Seq_p (NewSequenceNoRef) (int count, SeqType_p type, int auxbytes); Seq_p (NewSeqVec) (ItemTypes type, const Seq_p *p, int n); Seq_p (NewStrVec) (int istext); Seq_p (FinishStrVec) (Seq_p seq); void (ReleaseSequences) (struct Buffer *keep); Seq_p (ResizeSeq) (Seq_p seq, int pos, int diff, int elemsize); Column (SeqAsCol) (Seq_p seq); /* buffer.c */ typedef struct Buffer *Buffer_p; typedef struct Overflow *Overflow_p; struct Buffer { union { char *c; int *i; const void **p; } fill; char *limit; Overflow_p head; Int_t saved; Int_t used; char *ofill; char *result; char buf [128]; char slack [8]; }; #define ADD_ONEC_TO_BUF(b,x) (*(b).fill.c++ = (x)) #define ADD_CHAR_TO_BUF(b,x) \ { char _c = (x); \ if ((b).fill.c < (b).limit) *(b).fill.c++ = _c; \ else AddToBuffer(&(b), &_c, sizeof _c); } #define ADD_INT_TO_BUF(b,x) \ { int _i = (x); \ if ((b).fill.c < (b).limit) *(b).fill.i++ = _i; \ else AddToBuffer(&(b), &_i, sizeof _i); } #define ADD_PTR_TO_BUF(b,x) \ { const void *_p = (x); \ if ((b).fill.c < (b).limit) *(b).fill.p++ = _p; \ else AddToBuffer(&(b), &_p, sizeof _p); } #define BufferFill(b) ((b)->saved + ((b)->fill.c - (b)->buf)) void (InitBuffer) (Buffer_p bp); void (ReleaseBuffer) (Buffer_p bp, int keep); void (AddToBuffer) (Buffer_p bp, const void *data, Int_t len); void *(BufferAsPtr) (Buffer_p bp, int fast); Seq_p (BufferAsIntVec) (Buffer_p bp); int (NextBuffer) (Buffer_p bp, char **firstp, int *countp); /* view.c */ typedef enum MetaCols { MC_name, MC_type, MC_subv, MC_limit } MetaCols; #define V_Cols(view) ((Column_p) ((Seq_p) (view) + 1)) #define V_Types(view) (*(char**) ((view)->data)) #define V_Meta(view) (*(View_p*) ((view)->data+1)) #define ViewAsCol(v) SeqAsCol(v) #define ViewWidth(view) ((view)->count) #define ViewCol(view,col) (V_Cols(view)[col]) #define ViewColType(view,col) ((ItemTypes) V_Types(view)[col]) #define ViewCompat(view1,view2) MetaIsCompatible(V_Meta(view1), V_Meta(view2)) View_p (DescAsMeta) (const char** desc, const char* end); View_p (EmptyMetaView) (void); char (GetColType) (View_p meta, int col); View_p (IndirectView) (View_p meta, Seq_p seq); View_p (NewView) (View_p meta); View_p (MakeIntColMeta) (const char *name); int (MetaIsCompatible) (View_p meta1, View_p meta2); void (ReleaseUnusedViews) (void); void (SetViewCols) (View_p view, int first, int count, Column src); void (SetViewSeqs) (View_p view, int first, int count, Seq_p src); /* hash.c */ int (HashMapAdd) (Seq_p hmap, int key, int value); int (HashMapLookup) (Seq_p hmap, int key, int defval); Seq_p (HashMapNew) (void); int (HashMapRemove) (Seq_p hmap, int key); /* file.c */ typedef Seq_p MappedFile_p; MappedFile_p (InitMappedFile) (const char *data, Int_t length, Cleaner fun); View_p (MappedToView) (MappedFile_p map, View_p base); View_p (OpenDataFile) (const char *filename); /* emit.c */ typedef void *(*SaveInitFun)(void*,Int_t); typedef void *(*SaveDataFun)(void*,const void*,Int_t); void (MetaAsDesc) (View_p meta, Buffer_p buffer); Int_t (ViewSave) (View_p view, void *aux, SaveInitFun, SaveDataFun, int); /* getters.c */ SeqType_p (PickIntGetter) (int bits); SeqType_p (FixedGetter) (int bytes, int rows, int real, int flip); /* bits.c */ char *(Bits2elias) (const char *bytes, int count, int *outsize); void (ClearBit) (Seq_p bitmap, int row); int (CountBits) (Seq_p seq); Seq_p (MinBitCount) (Seq_p *pbitmap, int count); int (NextBits) (Seq_p bits, int *fromp, int *countp); int (NextElias) (const char *bytes, int count, int *inbits); int (SetBit) (Seq_p *pbitmap, int row); void (SetBitRange) (Seq_p bits, int from, int count); int (TestBit) (Seq_p bitmap, int row); int (TopBit) (int v); /* mutable.c */ enum MutPrepares { MP_insdat, MP_adjdat, MP_usemap, MP_delmap, MP_adjmap, MP_insmap, MP_revmap, MP_limit }; int (IsMutable) (View_p view); View_p (MutableView) (View_p view); Seq_p (MutPrepare) (View_p view); View_p (ViewSet) (View_p view, int row, int col, Item_p item); /* the following must be supplied in the language binding */ int (ColumnByName) (View_p meta, Object_p obj); struct Shared *(GetShared) (void); void (InvalidateView) (Object_p obj); Object_p (ItemAsObj) (ItemTypes type, Item_p item); Object_p (NeedMutable) (Object_p obj); Column (ObjAsColumn) (Object_p obj); View_p (ObjAsView) (Object_p obj); int (ObjToItem) (ItemTypes type, Item_p item); int TestBit (Seq_p bitmap, int row) { if (bitmap != NULL && row < bitmap->count) { const Byte_t *bits = bitmap->data[0].p; return (bits[row>>3] >> (row&7)) & 1; } return 0; } int SetBit (Seq_p *pbitmap, int row) { Byte_t *bits; Seq_p bitmap = *pbitmap; if (bitmap == NULL) *pbitmap = bitmap = IncRefCount(NewBitVec(row+1)); if (TestBit(bitmap, row)) return 0; if (row >= bitmap->count) { int bytes = bitmap->data[1].i; if (row >= 8 * bytes) { Seq_p newbitmap = IncRefCount(NewBitVec(12 * bytes)); memcpy(newbitmap->data[0].p, LoseRef(bitmap)->data[0].p, bytes); *pbitmap = bitmap = newbitmap; } bitmap->count = row + 1; } bits = bitmap->data[0].p; bits[row>>3] |= 1 << (row&7); return 8 * bitmap->data[1].i; } void ClearBit (Seq_p bitmap, int row) { if (TestBit(bitmap, row)) { Byte_t *bits = bitmap->data[0].p; bits[row>>3] &= ~ (1 << (row&7)); } } void SetBitRange (Seq_p bits, int from, int count) { while (--count >= 0) SetBit(&bits, from++); } Seq_p MinBitCount (Seq_p *pbitmap, int count) { if (*pbitmap == NULL || (*pbitmap)->count < count) { SetBit(pbitmap, count); ClearBit(*pbitmap, count); --(*pbitmap)->count; } return *pbitmap; } int NextBits (Seq_p bits, int *fromp, int *countp) { int curr = *fromp + *countp; while (curr < bits->count && !TestBit(bits, curr)) ++curr; *fromp = curr; while (curr < bits->count && TestBit(bits, curr)) ++curr; *countp = curr - *fromp; return *countp; } int TopBit (int v) { #define Vn(x) (v < (1<> 3); int bit = 8 - (*ppos & 7); int top = TopBit(val), n = top + 1; Assert(val > 0); while (top >= bit) { ++curr; top -= bit; bit = 8; } bit -= top; while (n >= bit) { *curr++ |= (char) (val >> (n-bit)); val &= (1 << (n-bit)) - 1; n -= bit; bit = 8; } *curr |= (char) (val << (bit - n)); *ppos = ((curr - bytes) << 3) + (8 - bit) + n; } char *Bits2elias (const char *bytes, int count, int *outbits) { int i, last, bits = 0; char *out; if (count <= 0) { *outbits = 0; return NULL; } out = calloc(1, (count+count/2)/8+1); last = *bytes & 1; *out = last << 7; *outbits = 1; for (i = 0; i < count; ++i) { if (((bytes[i>>3] >> (i&7)) & 1) == last) ++bits; else { EmitBits(out, bits, outbits); bits = 1; last ^= 1; } } if (bits) EmitBits(out, bits, outbits); return out; } int NextElias (const char *bytes, int count, int *inbits) { int val = 0; const char *in; if (*inbits == 0) *inbits = 1; in = bytes + (*inbits >> 3); if (in < bytes + count) { int i = 0, bit = 8 - (*inbits & 7); for (;;) { ++i; if (*in & (1 << (bit-1))) break; if (--bit <= 0) { if (++in >= bytes + count) return 0; bit = 8; } } while (i >= bit) { val <<= bit; val |= (*in++ & ((1 << bit) - 1)); i -= bit; bit = 8; } val <<= i; val |= (*in >> (bit - i)) & ((1 << i) - 1); *inbits = ((in - bytes) << 3) + (8 - bit) + i; } return val; } int CountBits (Seq_p seq) { int result = 0, from = 0, count = 0; if (seq != NULL) while (NextBits(seq, &from, &count)) result += count; return result; } ItemTypes BitRunsCmd_i (Item_p a) { int i, outsize, count = a->c.seq->count, pos = 0; char *data; struct Buffer buffer; Seq_p temp; temp = NewBitVec(count); for (i = 0; i < count; ++i) { if (GetColItem(i, a->c, IT_int).i) SetBit(&temp, i); } data = Bits2elias(temp->data[0].p, count, &outsize); count = (outsize + 7) / 8; InitBuffer(&buffer); if (count > 0) { ADD_INT_TO_BUF(buffer, (*data & 0x80) != 0); while ((i = NextElias(data, count, &pos)) != 0) ADD_INT_TO_BUF(buffer, i); } free(data); a->c = SeqAsCol(BufferAsIntVec(&buffer)); return IT_column; } /* %include% */ /* * buffer.c - Implementation of a simple temporary buffer. */ #include #include typedef struct Overflow { char b[4096]; /* must be first member */ Overflow_p next; } Overflow; void InitBuffer (Buffer_p bp) { bp->fill.c = bp->buf; bp->limit = bp->buf + sizeof bp->buf; bp->head = 0; bp->ofill = 0; bp->saved = 0; bp->result = 0; } void ReleaseBuffer (Buffer_p bp, int keep) { while (bp->head != 0) { Overflow_p op = bp->head; bp->head = op->next; free(op); } if (!keep && bp->result != 0) free(bp->result); } void AddToBuffer (Buffer_p bp, const void *data, Int_t len) { Int_t n; while (len > 0) { if (bp->fill.c >= bp->limit) { if (bp->head == 0 || bp->ofill >= bp->head->b + sizeof bp->head->b) { Overflow_p op = (Overflow_p) malloc(sizeof(Overflow)); op->next = bp->head; bp->head = op; bp->ofill = op->b; } memcpy(bp->ofill, bp->buf, sizeof bp->buf); bp->ofill += sizeof bp->buf; bp->saved += sizeof bp->buf; n = bp->fill.c - bp->slack; memcpy(bp->buf, bp->slack, n); bp->fill.c = bp->buf + n; } n = len; if (n > bp->limit - bp->fill.c) n = bp->limit - bp->fill.c; /* TODO: copy big chunks to overflow */ memcpy(bp->fill.c, data, n); bp->fill.c += n; data = (const char*) data + n; len -= n; } } int NextBuffer (Buffer_p bp, char **firstp, int *countp) { int count; if (*firstp == NULL) { Overflow_p p = bp->head, q = NULL; while (p != NULL) { Overflow_p t = p->next; p->next = q; q = p; p = t; } bp->head = q; bp->used = 0; } else if (*firstp == bp->head->b) { bp->head = bp->head->next; bp->used += *countp; free(*firstp); } else if (*firstp == bp->buf) return *countp == 0; if (bp->head != NULL) { *firstp = bp->head->b; count = bp->saved - bp->used; if (count > sizeof bp->head->b) count = sizeof bp->head->b; } else { count = bp->fill.c - bp->buf; *firstp = bp->buf; } *countp = count; return *countp; } void *BufferAsPtr (Buffer_p bp, int fast) { Int_t len; char *data, *ptr = NULL; int cnt; if (fast && bp->saved == 0) return bp->buf; len = BufferFill(bp); if (bp->result == 0) bp->result = malloc(len); for (data = bp->result; NextBuffer(bp, &ptr, &cnt); data += cnt) memcpy(data, ptr, cnt); return bp->result; } Seq_p BufferAsIntVec (Buffer_p bp) { int cnt; char *data, *ptr = NULL; Seq_p seq; seq = NewIntVec(BufferFill(bp) / sizeof(int), (void*) &data); for (; NextBuffer(bp, &ptr, &cnt); data += cnt) memcpy(data, ptr, cnt); return seq; } /* %include% */ /* * column.c - Implementation of sequences, columns, and items. */ #include #include #include /* wrap_gen.h - generated code, do not edit */ View_p (BlockedView) (View_p); View_p (CloneView) (View_p); Column (CoerceCmd) (Object_p, const char*); View_p (ColMapView) (View_p, Column); View_p (ColOmitView) (View_p, Column); View_p (ConcatView) (View_p, View_p); View_p (DescToMeta) (const char*); View_p (FirstView) (View_p, int); Column (GetHashInfo) (View_p, View_p, int); View_p (GroupCol) (View_p, Column, const char*); View_p (GroupedView) (View_p, Column, Column, const char*); int (HashDoFind) (View_p, int, View_p, Column, Column, Column); Column (HashValues) (View_p); View_p (IjoinView) (View_p, View_p); Column (IntersectMap) (View_p, View_p); View_p (JoinView) (View_p, View_p, const char*); View_p (LastView) (View_p, int); Column (NewCountsColumn) (Column); Column (NewIotaColumn) (int); View_p (NoColumnView) (int); View_p (ObjAsMetaView) (Object_p); Column (OmitColumn) (Column, int); View_p (OneColView) (View_p, int); View_p (PairView) (View_p, View_p); View_p (RemapSubview) (View_p, Column, int, int); int (RowCompare) (View_p, int, View_p, int); int (RowEqual) (View_p, int, View_p, int); int (RowHash) (View_p, int); Column (SortMap) (View_p); View_p (StepView) (View_p, int, int, int, int); int (StringLookup) (const char*, Column); View_p (TagView) (View_p, const char*); View_p (TakeView) (View_p, int); View_p (UngroupView) (View_p, int); Column (UniqMap) (View_p); View_p (V_Meta) (View_p); Column (ViewAsCol) (View_p); Column (ViewCol) (View_p, int); int (ViewCompare) (View_p, View_p); int (ViewCompat) (View_p, View_p); View_p (ViewReplace) (View_p, int, int, View_p); int (ViewSize) (View_p); int (ViewWidth) (View_p); ItemTypes (AppendCmd_VV) (Item_p a); ItemTypes (AtCmd_VIO) (Item_p a); ItemTypes (AtRowCmd_OI) (Item_p a); ItemTypes (BitRunsCmd_i) (Item_p a); ItemTypes (BlockedCmd_V) (Item_p a); ItemTypes (CloneCmd_V) (Item_p a); ItemTypes (CoerceCmd_OS) (Item_p a); ItemTypes (ColConvCmd_C) (Item_p a); ItemTypes (ColMapCmd_Vn) (Item_p a); ItemTypes (ColOmitCmd_Vn) (Item_p a); ItemTypes (CompareCmd_VV) (Item_p a); ItemTypes (CompatCmd_VV) (Item_p a); ItemTypes (ConcatCmd_VV) (Item_p a); ItemTypes (CountsCmd_VN) (Item_p a); ItemTypes (CountsColCmd_C) (Item_p a); ItemTypes (CountViewCmd_I) (Item_p a); ItemTypes (DataCmd_VX) (Item_p a); ItemTypes (DebugCmd_I) (Item_p a); ItemTypes (DefCmd_OO) (Item_p a); ItemTypes (DeleteCmd_VII) (Item_p a); ItemTypes (DepsCmd_O) (Item_p a); ItemTypes (EmitCmd_V) (Item_p a); ItemTypes (EmitModsCmd_V) (Item_p a); ItemTypes (ExceptCmd_VV) (Item_p a); ItemTypes (ExceptMapCmd_VV) (Item_p a); ItemTypes (FirstCmd_VI) (Item_p a); ItemTypes (GetCmd_VX) (Item_p a); ItemTypes (GetColCmd_VN) (Item_p a); ItemTypes (GetInfoCmd_VVI) (Item_p a); ItemTypes (GroupCmd_VnS) (Item_p a); ItemTypes (GroupedCmd_ViiS) (Item_p a); ItemTypes (HashColCmd_SO) (Item_p a); ItemTypes (HashFindCmd_VIViii) (Item_p a); ItemTypes (HashViewCmd_V) (Item_p a); ItemTypes (IjoinCmd_VV) (Item_p a); ItemTypes (InsertCmd_VIV) (Item_p a); ItemTypes (IntersectCmd_VV) (Item_p a); ItemTypes (IotaCmd_I) (Item_p a); ItemTypes (IsectMapCmd_VV) (Item_p a); ItemTypes (JoinCmd_VVS) (Item_p a); ItemTypes (LastCmd_VI) (Item_p a); ItemTypes (LoadCmd_O) (Item_p a); ItemTypes (LoadModsCmd_OV) (Item_p a); ItemTypes (LoopCmd_X) (Item_p a); ItemTypes (MaxCmd_VN) (Item_p a); ItemTypes (MdefCmd_O) (Item_p a); ItemTypes (MdescCmd_S) (Item_p a); ItemTypes (MetaCmd_V) (Item_p a); ItemTypes (MinCmd_VN) (Item_p a); ItemTypes (MutInfoCmd_V) (Item_p a); ItemTypes (NameColCmd_V) (Item_p a); ItemTypes (NamesCmd_V) (Item_p a); ItemTypes (OmitMapCmd_iI) (Item_p a); ItemTypes (OneColCmd_VN) (Item_p a); ItemTypes (OpenCmd_S) (Item_p a); ItemTypes (PairCmd_VV) (Item_p a); ItemTypes (ProductCmd_VV) (Item_p a); ItemTypes (RefCmd_OX) (Item_p a); ItemTypes (RefsCmd_O) (Item_p a); ItemTypes (RemapCmd_Vi) (Item_p a); ItemTypes (RemapSubCmd_ViII) (Item_p a); ItemTypes (RenameCmd_VO) (Item_p a); ItemTypes (RepeatCmd_VI) (Item_p a); ItemTypes (ReplaceCmd_VIIV) (Item_p a); ItemTypes (ResizeColCmd_iII) (Item_p a); ItemTypes (ReverseCmd_V) (Item_p a); ItemTypes (RowCmpCmd_VIVI) (Item_p a); ItemTypes (RowEqCmd_VIVI) (Item_p a); ItemTypes (RowHashCmd_VI) (Item_p a); ItemTypes (SaveCmd_VS) (Item_p a); ItemTypes (SetCmd_MIX) (Item_p a); ItemTypes (SizeCmd_V) (Item_p a); ItemTypes (SliceCmd_VIII) (Item_p a); ItemTypes (SortCmd_V) (Item_p a); ItemTypes (SortMapCmd_V) (Item_p a); ItemTypes (SpreadCmd_VI) (Item_p a); ItemTypes (StepCmd_VIIII) (Item_p a); ItemTypes (StrLookupCmd_Ss) (Item_p a); ItemTypes (StructDescCmd_V) (Item_p a); ItemTypes (StructureCmd_V) (Item_p a); ItemTypes (SumCmd_VN) (Item_p a); ItemTypes (TagCmd_VS) (Item_p a); ItemTypes (TakeCmd_VI) (Item_p a); ItemTypes (ToCmd_OO) (Item_p a); ItemTypes (TypeCmd_O) (Item_p a); ItemTypes (TypesCmd_V) (Item_p a); ItemTypes (UngroupCmd_VN) (Item_p a); ItemTypes (UnionCmd_VV) (Item_p a); ItemTypes (UnionMapCmd_VV) (Item_p a); ItemTypes (UniqueCmd_V) (Item_p a); ItemTypes (UniqueMapCmd_V) (Item_p a); ItemTypes (ViewCmd_X) (Item_p a); ItemTypes (ViewAsColCmd_V) (Item_p a); ItemTypes (ViewConvCmd_V) (Item_p a); ItemTypes (WidthCmd_V) (Item_p a); ItemTypes (WriteCmd_VO) (Item_p a); /* end of generated code */ ItemTypes DebugCmd_I (Item_p a) { Shared_p sh = GetShared(); a->i = sh->debug ^= a[0].i; return IT_int; } void *AdjustSeqRefs (void *refs, int count) { /*if (count > 0)*/ if (refs != NULL) { Seq_p ptr = refs; ptr->refs += count; if (ptr->refs <= 0) { if (ptr->type != NULL) { int i, f; if (ptr->type->cleaner != NULL) ptr->type->cleaner(ptr); for (i = 0, f = ptr->type->cleanups; f > 0; ++i, f >>= 3) if (f & 1) DecRefCount(ptr->data[i].p); else if (f & 2) free(ptr->data[i].p); } free(refs); refs = NULL; } } return refs; } Seq_p LoseRef (Seq_p seq) { ADD_PTR_TO_BUF(*GetShared()->keeps, seq); return seq; } Column SeqAsCol (Seq_p seq) { Column result; result.seq = seq; result.pos = -1; return result; } Seq_p NewSequenceNoRef (int count, SeqType_p type, int bytes) { Seq_p seq; seq = calloc(1, sizeof(struct Sequence) + bytes); seq->count = count; seq->type = type; seq->getter = type->getfun; /* default for data[0].p is to point to the aux bytes after the sequence */ /* default for data[1].i is to contain number of extra bytes allocated */ seq->data[0].p = seq + 1; seq->data[1].i = bytes; /* make sure 64-bit values have a "natural" 8-byte alignment */ Assert(((Int_t) seq->data[0].p) % 8 == 0); return seq; } Seq_p NewSequence (int count, SeqType_p type, int bytes) { return KeepRef(NewSequenceNoRef(count, type, bytes)); } void ReleaseSequences (Buffer_p keep) { int cnt; char *ptr = NULL; while (NextBuffer(keep, &ptr, &cnt)) { Seq_p *refs = (Seq_p*) ptr; int count = cnt / sizeof(Seq_p); while (--count >= 0) DecRefCount(refs[count]); } } /* TODO: not used yet, should review refcount scenarios, might be wrong now */ Seq_p ResizeSeq (Seq_p seq, int pos, int diff, int elemsize) { int newcnt, olimit, nlimit = 0, bytes; Seq_p result = seq; Assert(seq->refs == 1); newcnt = seq->count + diff; bytes = seq->data[1].i; olimit = bytes / elemsize; if (diff > 0) { /* grow when limit is reached */ if (newcnt > olimit) { nlimit = (olimit / 2) * 3 + 4; if (nlimit < newcnt) nlimit = newcnt + 4; } } else { /* shrink when less than half full */ if (newcnt < olimit / 2) { nlimit = newcnt + 2; bytes = seq->count * elemsize; } } if (nlimit > 0) { result = IncRefCount(NewSequence(seq->count, seq->type, nlimit * elemsize)); result->getter = seq->getter; result->data[2] = seq->data[2]; result->data[3] = seq->data[3]; memcpy(result+1, seq+1, pos * elemsize); seq->type = NULL; /* release and prevent from calling cleaner */ /*LoseRef(seq);*/ } if (diff > 0) { memmove((char*) (result+1) + (pos + diff) * elemsize, (char*) (seq+1) + pos * elemsize, (seq->count - pos) * elemsize); memset((char*) (result+1) + pos * elemsize, 0, diff * elemsize); } else memmove((char*) (result+1) + pos * elemsize, (char*) (seq+1) + (pos - diff) * elemsize, (seq->count - (pos - diff)) * elemsize); result->count += diff; return result; } ItemTypes ResizeColCmd_iII (Item_p a) { int r, *data; Seq_p seq, result; seq = a[0].c.seq; result = NewIntVec(seq->count, &data); for (r = 0; r < seq->count; ++r) data[r] = GetSeqItem(r, seq, IT_int).i; a->c.seq = ResizeSeq(result, a[1].i, a[2].i, sizeof(int)); return IT_column; } Seq_p NewBitVec (int count) { return NewSequence(count, PickIntGetter(1), (count + 7) / 8); } Seq_p NewIntVec (int count, int **dataptr) { const int w = sizeof(int); Seq_p seq = NewSequence(count, PickIntGetter(8 * w), w * count); if (dataptr != NULL) *dataptr = seq->data[0].p; return seq; } Seq_p NewPtrVec (int count, Int_t **dataptr) { const int w = sizeof(Int_t); Seq_p result = NewSequence(count, PickIntGetter(8 * w), w * count); if (dataptr != NULL) *dataptr = result->data[0].p; return result; } ItemTypes GetItem (int row, Item_p item) { Seq_p seq = item->c.seq; if (row < 0 || row >= seq->count) { item->e = EC_rioor; return IT_error; } return seq->getter(row, item); } Item GetColItem (int row, Column column, ItemTypes type) { Item item; ItemTypes got; item.c = column; got = GetItem(row, &item); Assert(got == type); return item; } Item GetSeqItem (int row, Seq_p seq, ItemTypes type) { Item item; ItemTypes got; item.c.seq = seq; item.c.pos = -1; got = GetItem(row, &item); Assert(got == type); return item; } Item GetViewItem (View_p view, int row, int col, ItemTypes type) { Item item; ItemTypes got; item.c = ViewCol(view, col); got = GetItem(row, &item); Assert(got == type); return item; } #if 0 /* unused */ const char *ItemTypeAsString (ItemTypes type) { static const char *typeTable[] = { "", /* IT_unknown */ "I", /* IT_int */ "L", /* IT_wide */ "D", /* IT_double */ "S", /* IT_string */ "O", /* IT_object */ "C", /* IT_column */ "V", /* IT_view */ "E", /* IT_error */ }; return typeTable[type]; } #endif ItemTypes CharAsItemType (char type) { switch (type) { case 0: return IT_unknown; case 'I': return IT_int; case 'L': return IT_wide; case 'F': return IT_float; case 'D': return IT_double; case 'S': return IT_string; case 'B': return IT_bytes; case 'O': return IT_object; case 'C': return IT_column; case 'V': return IT_view; } return IT_error; } static ItemTypes StringGetter (int row, Item_p item) { char **ptrs = (char**) item->c.seq->data[0].p; item->s = ptrs[row]; return IT_string; } static struct SeqType ST_String = { "string", StringGetter, 0102 }; static ItemTypes BytesGetter (int row, Item_p item) { char **ptrs = (char**) item->c.seq->data[0].p; item->u.ptr = (const Byte_t*) ptrs[row]; item->u.len = ptrs[row+1] - ptrs[row]; return IT_bytes; } static struct SeqType ST_Bytes = { "string", BytesGetter, 0102 }; Seq_p NewStrVec (int istext) { Seq_p seq; Buffer_p bufs; bufs = malloc(2 * sizeof(struct Buffer)); InitBuffer(bufs); InitBuffer(bufs+1); seq = NewSequence(0, istext ? &ST_String : &ST_Bytes, 0); /* data[0] starts as two buffers, then becomes vector of string pointers */ /* data[1] is not used */ /* data[2] is an optional pointer to hash map sequence, see StringLookup */ seq->data[0].p = bufs; return seq; } void AppendToStrVec (const void *string, int bytes, Seq_p seq) { Buffer_p bufs = seq->data[0].p; if (bytes < 0) bytes = strlen((const char*) string) + 1; /* TODO: consider tracking pointers i.s.o. making actual copies here */ AddToBuffer(bufs, string, bytes); ADD_INT_TO_BUF(bufs[1], bytes); ++seq->count; } Seq_p FinishStrVec (Seq_p seq) { int r = 0, cnt = 0, *iptr = NULL; char *fill, **ptrs, *cptr = NULL; Buffer_p bufs = seq->data[0].p; ptrs = malloc((seq->count+1) * sizeof(char*) + BufferFill(bufs)); fill = (char*) (ptrs + seq->count + 1); while (NextBuffer(bufs+1, (void*) &iptr, &cnt)) { int i, n = cnt / sizeof(int); for (i = 0; i < n; ++i) { ptrs[r++] = fill; fill += iptr[i]; } } ptrs[r] = fill; /* past-end mark needed to provide length of last entry */ fill = (char*) (ptrs + seq->count + 1); while (NextBuffer(bufs, &cptr, &cnt)) { memcpy(fill, cptr, cnt); fill += cnt; } ReleaseBuffer(bufs, 0); ReleaseBuffer(bufs+1, 0); free(seq->data[0].p); seq->data[0].p = ptrs; return seq; } Column ForceStringColumn (Column column) { int r, rows; Seq_p result; /* this code needed to always make name column of meta views string cols */ if (column.seq == NULL || column.seq->getter == StringGetter) return column; rows = column.seq->count; result = NewStrVec(1); for (r = 0; r < rows; ++r) AppendToStrVec(GetColItem(r, column, IT_string).s, -1, result); return SeqAsCol(FinishStrVec(result)); } static ItemTypes IotaGetter (int row, Item_p item) { item->i = row; return IT_int; } static struct SeqType ST_Iota = { "iota", IotaGetter }; Column NewIotaColumn (int count) { return SeqAsCol(NewSequence(count, &ST_Iota, 0)); } static void SequenceCleaner (Seq_p seq) { int i; View_p *items = seq->data[0].p; for (i = 0; i < seq->count; ++i) DecRefCount(items[i]); } static ItemTypes SequenceGetter (int row, Item_p item) { void **items = (void**) item->c.seq->data[0].p; ItemTypes type = item->c.seq->data[1].i; switch (type) { case IT_view: item->v = items[row]; return IT_view; case IT_column: item->c.seq = items[row]; item->c.pos = -1; return IT_column; default: return IT_unknown; } } static struct SeqType ST_Sequence = { "sequence", SequenceGetter, 0, SequenceCleaner }; Seq_p NewSeqVec (ItemTypes type, const Seq_p *items, int count) { int i, bytes; Seq_p seq; bytes = count * sizeof(View_p); seq = NewSequence(count, &ST_Sequence, bytes); /* data[0] points to a list of pointers */ /* data[1] is the type of the returned items */ seq->data[1].i = type; if (items != NULL) { memcpy(seq->data[0].p, items, bytes); for (i = 0; i < count; ++i) IncRefCount(items[i]); } return seq; } static ItemTypes CountsGetter (int row, Item_p item) { const View_p *items = (const View_p*) item->c.seq->data[0].p; item->i = ViewSize(items[row]); return IT_int; } Column NewCountsColumn (Column column) { int r, rows; View_p *items; Seq_p seq; rows = column.seq->count; seq = NewSeqVec(IT_view, NULL, rows); seq->getter = CountsGetter; items = seq->data[0].p; for (r = 0; r < rows; ++r) items[r] = IncRefCount(GetColItem(r, column, IT_view).v); return SeqAsCol(seq); } Column OmitColumn (Column omit, int size) { int i, *data, j = 0, outsize; Seq_p seq, map; if (omit.seq == NULL) return omit; outsize = size - omit.seq->count; /* FIXME: wasteful for large views, consider sorting input col instead */ map = NewBitVec(size); for (i = 0; i < omit.seq->count; ++i) SetBit(&map, GetColItem(i, omit, IT_int).i); seq = NewIntVec(outsize, &data); for (i = 0; i < size; ++i) if (!TestBit(map, i)) { Assert(j < outsize); data[j++] = i; } return SeqAsCol(seq); } #if 0 static ItemTypes UnknownGetter (int row, Item_p item) { return IT_unknown; } static struct SeqType ST_Unknown = { "unknown", UnknownGetter }; static Seq_p NewUnknownVec (int count) { return NewSequence(count, &ST_Unknown, 0); } #endif Column CoerceColumn (ItemTypes type, Object_p obj) { int i, n; void *data; Seq_p seq; Item item; Column out, column = ObjAsColumn(obj); if (column.seq == NULL) return column; /* determine the input column type by fetching one item */ item.c = column; n = column.seq->count; if (GetItem(0, &item) == type) return column; switch (type) { case IT_int: seq = NewIntVec(n, (void*) &data); break; case IT_wide: seq = NewSequence(n, PickIntGetter(64), 8 * n); break; case IT_float: seq = NewSequence(n, FixedGetter(4,1,1,0), 4 * n); break; case IT_double: seq = NewSequence(n, FixedGetter(8,1,1,0), 8 * n); break; case IT_string: seq = NewStrVec(1); break; case IT_bytes: seq = NewStrVec(0); break; case IT_view: seq = NewSeqVec(IT_view, NULL, n); break; default: Assert(0); } out = SeqAsCol(seq); data = out.seq->data[0].p; for (i = 0; i < n; ++i) { item.o = GetColItem(i, column, IT_object).o; if (!ObjToItem(type, &item)) { out.seq = NULL; out.pos = i; break; } switch (type) { case IT_int: ((int*) data)[i] = item.i; break; case IT_wide: ((int64_t*) data)[i] = item.w; break; case IT_float: ((float*) data)[i] = item.f; break; case IT_double: ((double*) data)[i] = item.d; break; case IT_string: AppendToStrVec(item.s, -1, out.seq); break; case IT_bytes: AppendToStrVec(item.u.ptr, item.u.len, out.seq); break; case IT_view: ((Seq_p*) data)[i] = IncRefCount(item.v); break; default: Assert(0); } } if (type == IT_string || type == IT_bytes) FinishStrVec(seq); return out; } Column CoerceCmd (Object_p obj, const char *str) { return CoerceColumn(CharAsItemType(str[0]), obj); } int CastObjToItem (char type, Item_p item) { switch (type) { case 'M': item->o = NeedMutable(item->o); return (void*) item->o != NULL; case 'N': item->i = ColumnByName(V_Meta(item[-1].v), item->o); return item->i >= 0; case 'n': { int *data, r, rows; View_p meta; Column column; Seq_p seq; column = ObjAsColumn(item->o); if (column.seq == NULL) return 0; rows = column.seq->count; seq = NewIntVec(rows, &data); meta = V_Meta(item[-1].v); for (r = 0; r < rows; ++r) { /* FIXME: this only works if input is a list, not a column! */ data[r] = ColumnByName(meta, GetColItem(r, column, IT_object).o); if (data[r] < 0) return 0; } item->c = SeqAsCol(seq); break; } default: if (type < 'a' || type > 'z') return ObjToItem(CharAsItemType(type), item); item->c = CoerceColumn(CharAsItemType(type +'A'-'a'), item->o); break; } return 1; /* cast succeeded */ } /* %include% */ /* * emit.c - Implementation of file output commands. */ #include #include #include typedef enum EmitTypes { ET_mem } EmitTypes; typedef struct EmitItem { EmitTypes type; Int_t size; const void *data; } EmitItem, *EmitItem_p; typedef struct EmitInfo { int64_t position; /* emit offset, track >2 Gb even on 32b arch */ struct Buffer *itembuf; /* item buffer */ struct Buffer *colbuf; /* column buffer */ int diff; /* true if emitting differences */ } EmitInfo, *EmitInfo_p; static void EmitView (EmitInfo_p eip, View_p view, int describe); /* forward */ static Int_t EmitBlock (EmitInfo_p eip, const void* data, int size) { EmitItem item; Int_t pos = eip->position; if (size > 0) { item.type = ET_mem; item.size = size; item.data = data; AddToBuffer(eip->itembuf, &item, sizeof item); eip->position += size; } else free((void*) data); return pos; } static void *EmitCopy (EmitInfo_p eip, const void* data, int size) { void *buf = NULL; if (size > 0) { buf = memcpy(malloc(size), data, size); EmitBlock(eip, buf, size); } return buf; } static Int_t EmitBuffer (EmitInfo_p eip, Buffer_p buf) { Int_t pos = EmitBlock(eip, BufferAsPtr(buf, 0), BufferFill(buf)); ReleaseBuffer(buf, 1); return pos; } static void EmitAlign (EmitInfo_p eip) { if (eip->position >= 1024 * 1024) EmitCopy(eip, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 15 & - eip->position); } void MetaAsDesc (View_p meta, Buffer_p buffer) { int r, rows = ViewSize(meta); Column names, types, subvs; char type; const char *name; View_p subv; names = ViewCol(meta, MC_name); types = ViewCol(meta, MC_type); subvs = ViewCol(meta, MC_subv); for (r = 0; r < rows; ++r) { if (r > 0) AddToBuffer(buffer, ",", 1); name = GetColItem(r, names, IT_string).s; type = *GetColItem(r, types, IT_string).s; subv = GetColItem(r, subvs, IT_view).v; AddToBuffer(buffer, name, strlen(name)); if (type == 'V' && ViewSize(subv) > 0) { AddToBuffer(buffer, "[", 1); MetaAsDesc(subv, buffer); AddToBuffer(buffer, "]", 1); } else { AddToBuffer(buffer, ":", 1); AddToBuffer(buffer, &type, 1); } } } static void EmitVarInt (EmitInfo_p eip, Int_t value) { int n; #if 0 if (value < 0) { ADD_ONEC_TO_BUF(*eip->colbuf, 0); value = ~value; } #endif Assert(value >= 0); for (n = 7; (value >> n) > 0; n += 7) ; while ((n -= 7) > 0) ADD_ONEC_TO_BUF(*eip->colbuf, (value >> n) & 0x7F); ADD_CHAR_TO_BUF(*eip->colbuf, (value & 0x7F) | 0x80); } static void EmitPair (EmitInfo_p eip, Int_t offset) { Int_t size; size = eip->position - offset; EmitVarInt(eip, size); if (size > 0) EmitVarInt(eip, offset); } static int MinWidth (int lo, int hi) { lo = lo > 0 ? 0 : "444444445555555566666666666666666"[TopBit(~lo)+1] & 7; hi = hi < 0 ? 0 : "012334445555555566666666666666666"[TopBit(hi)+1] & 7; return lo > hi ? lo : hi; } static int *PackedIntVec (const int *data, int rows, Int_t *outsize) { int r, width, lo = 0, hi = 0, bits, *result; const int *limit; Int_t bytes; for (r = 0; r < rows; ++r) { if (data[r] < lo) lo = data[r]; if (data[r] > hi) hi = data[r]; } width = MinWidth(lo, hi); if (width >= 6) { bytes = rows * (1 << (width-4)); result = malloc(bytes); memcpy(result, data, bytes); } else if (rows > 0 && width > 0) { if (rows < 5 && width < 4) { static char fudges[3][4] = { /* n: 1: 2: 3: 4: */ {1,1,1,1}, /* 1-bit entries: 1b 2b 3b 4b */ {1,1,1,1}, /* 2-bit entries: 2b 4b 6b 8b */ {1,1,2,2}, /* 4-bit entries: 4b 8b 12b 16b */ }; static char widths[3][4] = { /* n: 1: 2: 3: 4: */ {3,3,2,2}, /* 1-bit entries: 4b 4b 2b 2b */ {3,3,2,2}, /* 2-bit entries: 4b 4b 2b 2b */ {3,3,3,3}, /* 4-bit entries: 4b 4b 4b 4b */ }; bytes = fudges[width-1][rows-1]; width = widths[width-1][rows-1]; } else bytes = (((Int_t) rows << width) + 14) >> 4; /* round up */ result = malloc(bytes); if (width < 4) memset(result, 0, bytes); limit = data + rows; bits = 0; switch (width) { case 1: { /* 1 bit, 8 per byte */ char* q = (char*) result; while (data < limit) { *q |= (*data++ & 1) << bits; ++bits; q += bits >> 3; bits &= 7; } break; } case 2: { /* 2 bits, 4 per byte */ char* q = (char*) result; while (data < limit) { *q |= (*data++ & 3) << bits; bits += 2; q += bits >> 3; bits &= 7; } break; } case 3: { /* 4 bits, 2 per byte */ char* q = (char*) result; while (data < limit) { *q |= (*data++ & 15) << bits; bits += 4; q += bits >> 3; bits &= 7; } break; } case 4: { /* 1-byte (char) */ char* q = (char*) result; while (data < limit) *q++ = (char) *data++; break; } case 5: { /* 2-byte (short) */ short* q = (short*) result; while (data < limit) *q++ = (short) *data++; break; } } } else { bytes = 0; result = NULL; } *outsize = bytes; return result; } static int EmitFixCol (EmitInfo_p eip, Column column, ItemTypes type) { int r, rows, *tempvec; void *buffer; Int_t bufsize; rows = column.seq->count; switch (type) { case IT_int: bufsize = rows * sizeof(int); tempvec = malloc(bufsize); for (r = 0; r < rows; ++r) tempvec[r] = GetColItem(r, column, type).i; buffer = PackedIntVec(tempvec, rows, &bufsize); free((char*) tempvec); /* TODO: avoid extra copy & malloc */ /* try to compress the bitmap, but only in diff save mode */ if (eip->diff && rows >= 128 && rows == bufsize * 8) { int ebits; tempvec = (void*) Bits2elias(buffer, rows, &ebits); /* only keep compressed form if under 80% of plain bitmap */ if (ebits + ebits/4 < rows) { free(buffer); buffer = tempvec; bufsize = (ebits + 7) / 8; } else free((char*) tempvec); } break; case IT_wide: bufsize = rows * sizeof(int64_t); buffer = malloc(bufsize); for (r = 0; r < rows; ++r) ((int64_t*) buffer)[r] = GetColItem(r, column, type).w; break; case IT_float: bufsize = rows * sizeof(float); buffer = malloc(bufsize); for (r = 0; r < rows; ++r) ((float*) buffer)[r] = GetColItem(r, column, type).f; break; case IT_double: bufsize = rows * sizeof(double); buffer = malloc(bufsize); for (r = 0; r < rows; ++r) ((double*) buffer)[r] = GetColItem(r, column, type).d; break; default: Assert(0); return 0; } /* start using 16-byte alignment once the emitted data reaches 1 Mb */ /* only do this for vectors >= 128 bytes, worst-case waste is under 10% */ Assert(!(bufsize > 0 && rows == 0)); if (bufsize >= 128 && bufsize / rows >= 2) EmitAlign(eip); EmitPair(eip, EmitBlock(eip, buffer, bufsize)); return bufsize != 0; } static void EmitVarCol (EmitInfo_p eip, Column column, int istext) { int r, rows, bytes, *sizevec; Int_t buflen; Item item; struct Buffer buffer; Seq_p sizes; InitBuffer(&buffer); rows = column.seq->count; sizes = NewIntVec(rows, &sizevec); if (istext) for (r = 0; r < rows; ++r) { item = GetColItem(r, column, IT_string); bytes = strlen(item.s); if (bytes > 0) AddToBuffer(&buffer, item.s, ++bytes); sizevec[r] = bytes; } else for (r = 0; r < rows; ++r) { item = GetColItem(r, column, IT_bytes); AddToBuffer(&buffer, item.u.ptr, item.u.len); sizevec[r] = item.u.len; } buflen = BufferFill(&buffer); EmitPair(eip, EmitBuffer(eip, &buffer)); if (buflen > 0) EmitFixCol(eip, SeqAsCol(sizes), 1); EmitVarInt(eip, 0); /* no memos */ } static void EmitSubCol (EmitInfo_p eip, Column column, int describe) { int r, rows; View_p view; struct Buffer newcolbuf; Buffer_p origcolbuf; origcolbuf = eip->colbuf; eip->colbuf = &newcolbuf; InitBuffer(eip->colbuf); rows = column.seq->count; for (r = 0; r < rows; ++r) { view = GetColItem(r, column, IT_view).v; EmitView(eip, view, describe); } eip->colbuf = origcolbuf; EmitPair(eip, EmitBuffer(eip, &newcolbuf)); } static void EmitCols (EmitInfo_p eip, View_p view, View_p maps) { int rows = ViewSize(view); EmitVarInt(eip, rows); if (rows > 0) { int i, r, c, *rowptr = NULL; ItemTypes type; Column column; Seq_p rowmap; View_p v, subv, meta = V_Meta(view); rowmap = NULL; for (c = 0; c < ViewWidth(view); ++c) { if (maps != NULL) { Column mapcol = ViewCol(maps, c); if (!EmitFixCol(eip, mapcol, IT_int)) continue; if (rowmap == NULL) rowmap = NewIntVec(rows, &rowptr); i = 0; for (r = 0; r < rows; ++r) if (GetColItem(r, mapcol, IT_int).i) rowptr[i++] = r; rowmap->count = i; v = RemapSubview(view, SeqAsCol(rowmap), 0, -1); } else v = view; column = ViewCol(v,c); type = ViewColType(view, c); switch (type) { case IT_int: case IT_wide: case IT_float: case IT_double: EmitFixCol(eip, column, type); break; case IT_string: EmitVarCol(eip, column, 1); break; case IT_bytes: EmitVarCol(eip, column, 0); break; case IT_view: subv = GetViewItem(meta, c, MC_subv, IT_view).v; EmitSubCol(eip, column, ViewSize(subv) == 0); break; default: Assert(0); } } } } static void EmitView (EmitInfo_p eip, View_p view, int describe) { EmitVarInt(eip, 0); if (eip->diff) { Seq_p mods = MutPrepare(view), *seqs = (void*) (mods + 1); EmitVarInt(eip, 0); EmitFixCol(eip, SeqAsCol(seqs[MP_delmap]), IT_int); if (EmitFixCol(eip, SeqAsCol(seqs[MP_adjmap]), IT_int)) EmitCols(eip, seqs[MP_adjdat], seqs[MP_usemap]); EmitCols(eip, seqs[MP_insdat], NULL); if (ViewSize(seqs[MP_insdat]) > 0) EmitFixCol(eip, SeqAsCol(seqs[MP_insmap]), IT_int); } else { if (describe) { int cnt; char *ptr = NULL; struct Buffer desc; InitBuffer(&desc); MetaAsDesc(V_Meta(view), &desc); EmitVarInt(eip, BufferFill(&desc)); while (NextBuffer(&desc, &ptr, &cnt)) AddToBuffer(eip->colbuf, ptr, cnt); } EmitCols(eip, view, NULL); } } static void SetBigEndian32 (char* dest, Int_t value) { dest[0] = (char) (value >> 24); dest[1] = (char) (value >> 16); dest[2] = (char) (value >> 8); dest[3] = (char) value; } static Int_t EmitComplete (EmitInfo_p eip, View_p view) { int overflow; Int_t rootpos, tailpos, endpos; char tail[16]; struct Head { short a; char b; char c; char d[4]; } head, *fixup; struct Buffer newcolbuf; if (eip->diff && !IsMutable(view)) return 0; eip->position = 0; head.a = 'J' + ('L' << 8); head.b = 0x1A; head.c = 0; fixup = EmitCopy(eip, &head, sizeof head); eip->colbuf = &newcolbuf; InitBuffer(eip->colbuf); EmitView(eip, view, 1); EmitAlign(eip); rootpos = EmitBuffer(eip, eip->colbuf); eip->colbuf = NULL; EmitAlign(eip); if (eip->position != (Int_t) eip->position) return -1; /* fail if >= 2 Gb on machines with a 32-bit address space */ /* large files will have bit 8 of head[3] and bit 8 of tail[12] set */ tailpos = eip->position; endpos = tailpos + sizeof tail; overflow = endpos >> 31; /* for file sizes > 2 Gb, store bits 41..31 in tail[2..3] */ SetBigEndian32(tail, 0x80000000 + overflow); SetBigEndian32(tail+4, tailpos); SetBigEndian32(tail+8, ((eip->diff ? 0x90 : 0x80) << 24) + tailpos - rootpos); SetBigEndian32(tail+12, rootpos); if (overflow) tail[12] |= 0x80; EmitCopy(eip, tail, sizeof tail); if (overflow) { /* store bits 41..36 in head[3], and bits 35..4 in head[4..7] */ Assert((endpos & 15) == 0); fixup->c = 0x80 | ((endpos >> 16) >> 20); SetBigEndian32(fixup->d, endpos >> 4); } else SetBigEndian32(fixup->d, endpos); return endpos; } Int_t ViewSave (View_p view, void *aux, SaveInitFun initfun, SaveDataFun datafun, int diff) { int i, numitems; Int_t bytes; struct Buffer buffer; EmitItem_p items; EmitInfo einfo; InitBuffer(&buffer); einfo.itembuf = &buffer; einfo.diff = diff; bytes = EmitComplete(&einfo, view); numitems = BufferFill(&buffer) / sizeof(EmitItem); items = BufferAsPtr(&buffer, 1); if (initfun != NULL) aux = initfun(aux, bytes); for (i = 0; i < numitems; ++i) { if (aux != NULL) aux = datafun(aux, items[i].data, items[i].size); free((void*) items[i].data); } if (aux == NULL) bytes = 0; ReleaseBuffer(&buffer, 0); return bytes; } /* %include% */ /* * file.c - Implementation of memory-mapped file access. */ #include #include #include #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include #else #include #include #include #endif static View_p MapSubview (MappedFile_p, Int_t, View_p, View_p); /* forward */ #define MF_Data(map) ((const char*) ((map)->data[0].p)) #define MF_Length(map) ((Int_t) (map)->data[1].p) static void MappedCleaner (MappedFile_p map) { Cleaner fun = *((Cleaner*) (map + 1)); if (fun != NULL) fun(map); } static struct SeqType ST_Mapped = { "mapped", NULL, 0, MappedCleaner }; MappedFile_p InitMappedFile (const char *data, Int_t length, Cleaner fun) { MappedFile_p map; map = NewSequence(0, &ST_Mapped, sizeof(Cleaner)); /* data[0] points to the current start of the mapped area */ /* data[1] is the current length of the mapped area */ /* data[2] points to the original mapped area */ /* data[3] is available for storing an Object_p, see ext_tcl.c */ map->data[0].p = (void*) data; map->data[1].p = (void*) length; map->data[2].p = (void*) data; *((Cleaner*) (map + 1)) = fun; /* TODO: get rid of this ugly hack */ return map; } static void MappedFileCleaner (MappedFile_p map) { #if WIN32+0 UnmapViewOfFile(map->data[2].p); #else int offset = MF_Data(map) - (const char*) map->data[2].p; munmap(map->data[2].p, MF_Length(map) + offset); #endif } static MappedFile_p OpenMappedFile (const char *filename) { const char *data = NULL; Int_t length = -1; #if WIN32+0 { DWORD n; HANDLE h, f = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (f != INVALID_HANDLE_VALUE) { h = CreateFileMapping(f, 0, PAGE_READONLY, 0, 0, 0); if (h != INVALID_HANDLE_VALUE) { n = GetFileSize(f, 0); data = MapViewOfFile(h, FILE_MAP_READ, 0, 0, n); if (data != NULL) length = n; CloseHandle(h); } CloseHandle(f); } } #else { struct stat sb; int fd = open(filename, O_RDONLY); if (fd != -1) { if (fstat(fd, &sb) == 0) { data = mmap(0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (data != MAP_FAILED) length = sb.st_size; } close(fd); } } #endif if (length < 0) return NULL; return InitMappedFile(data, length, MappedFileCleaner); } static void AdjustMappedFile (MappedFile_p map, int offset) { map->data[0].p = (void*) (MF_Data(map) + offset); map->data[1].p = (void*) (MF_Length(map) - offset); } static int IsReversedEndian(MappedFile_p map) { #if _BIG_ENDIAN+0 return *MF_Data(map) == 'J'; #else return *MF_Data(map) == 'L'; #endif } static Int_t GetVarInt (const char **cp) { int8_t b; Int_t v = 0; do { b = *(*cp)++; v = (v << 7) + b; } while (b >= 0); return v + 128; } static Int_t GetVarPair(const char** cp) { Int_t n = GetVarInt(cp); if (n > 0 && GetVarInt(cp) == 0) *cp += n; return n; } #define MM_cache data[0].p #define MM_offvec data[1].q #define MM_mapf data[2].q #define MM_meta data[3].q #define MM_offsets MM_offvec->data[0].p #define MM_base MM_offvec->data[1].q static void MappedViewCleaner (Seq_p seq) { int i, count; const View_p *subviews = seq->MM_cache; count = seq->MM_offvec->count; for (i = 0; i < count; ++i) DecRefCount(subviews[i]); DecRefCount(seq->MM_base); } static ItemTypes MappedViewGetter (int row, Item_p item) { Seq_p seq = item->c.seq; View_p *subviews = seq->MM_cache; if (subviews[row] == NULL) { Seq_p base = seq->MM_base; const Int_t *offsets = seq->MM_offsets; if (base != NULL) base = GetViewItem(base, row, item->c.pos, IT_view).v; subviews[row] = IncRefCount(MapSubview(seq->MM_mapf, offsets[row], seq->MM_meta, base)); } item->v = subviews[row]; return IT_view; } static struct SeqType ST_MappedView = { "mappedview", MappedViewGetter, 01110, MappedViewCleaner }; static Seq_p MappedViewCol (MappedFile_p map, int rows, const char **nextp, View_p meta, View_p base) { int r, c, cols, subcols; Int_t colsize, colpos, *offsets; const char *next; Seq_p offseq, result; offseq = NewPtrVec(rows, &offsets); cols = ViewSize(meta); colsize = GetVarInt(nextp); colpos = colsize > 0 ? GetVarInt(nextp) : 0; next = MF_Data(map) + colpos; for (r = 0; r < rows; ++r) { offsets[r] = next - MF_Data(map); GetVarInt(&next); if (cols == 0) { Int_t desclen = GetVarInt(&next); const char *desc = next; next += desclen; meta = DescAsMeta(&desc, next); } if (GetVarInt(&next) > 0) { subcols = ViewSize(meta); for (c = 0; c < subcols; ++c) switch (GetColType(meta, c)) { case 'B': case 'S': if (GetVarPair(&next)) GetVarPair(&next); /* fall through */ default: GetVarPair(&next); } } } result = NewSequence(rows, &ST_MappedView, rows * sizeof(View_p)); /* data[0] points to a subview cache */ /* data[1] points to a sequence owning the offest vector */ /* data[2] points to the mapped file */ /* data[3] points to the meta view */ result->MM_offvec = IncRefCount(offseq); result->MM_mapf = IncRefCount(map); result->MM_meta = IncRefCount(cols > 0 ? meta : EmptyMetaView()); /* offseq->data[1] points to the base view if there is one */ result->MM_base = IncRefCount(base); /* TODO: could combine subview cache and offsets vector */ return result; } static struct SeqType ST_MappedFix = { "mappedfix", NULL, 010 }; static Seq_p MappedFixedCol (MappedFile_p map, int rows, const char **nextp, int isreal) { Int_t colsize, colpos; const char *data; Seq_p result; colsize = GetVarInt(nextp); colpos = colsize > 0 ? GetVarInt(nextp) : 0; data = MF_Data(map) + colpos; /* if bit count is too low-for single-bit vectors then it's compressed */ if (rows >= 128 && 0 < colsize && colsize < rows/8) { int from, pos = 0; result = NewBitVec(rows); from = *data & 0x80 ? 0 : NextElias(data, colsize, &pos); for (;;) { int count = NextElias(data, colsize, &pos); if (count == 0) break; SetBitRange(result, from, count); from += count + NextElias(data, colsize, &pos); } } else { int rev = IsReversedEndian(map); result = NewSequence(rows, &ST_MappedFix, 0); result->getter = FixedGetter(colsize, rows, isreal, rev)->getfun; /* data[0] points to the mapped data */ /* data[1] points to the mapped file */ result->data[0].p = (void*) data; result->data[1].p = IncRefCount(map); } return result; } #define MS_offvec data[0].q #define MS_offptr data[1].p #define MS_mapf data[2].q #define MS_sizes data[3].q static ItemTypes MappedStringGetter (int row, Item_p item) { const Int_t *offsets = item->c.seq->MS_offptr; const char *data = MF_Data(item->c.seq->MS_mapf); if (offsets[row] == 0) item->s = ""; else if (offsets[row] > 0) item->s = data + offsets[row]; else { const char *next = data - offsets[row]; if (GetVarInt(&next) > 0) item->s = data + GetVarInt(&next); else item->s = ""; } return IT_string; } static struct SeqType ST_MappedString = { "mappedstring", MappedStringGetter, 01101 }; static ItemTypes MappedBytesGetter (int row, Item_p item) { Seq_p seq = item->c.seq; const Int_t *offsets = seq->MS_offptr; const char *data = MF_Data(seq->MS_mapf); item->u.len = GetSeqItem(row, seq->MS_sizes, IT_int).i; if (offsets[row] >= 0) item->u.ptr = (const Byte_t*) data + offsets[row]; else { const char *next = data - offsets[row]; item->u.len = GetVarInt(&next); item->u.ptr = (const Byte_t*) data + GetVarInt(&next); } return IT_bytes; } static struct SeqType ST_MappedBytes = { "mappedstring", MappedBytesGetter, 01101 }; static Seq_p MappedStringCol (MappedFile_p map, int rows, const char **nextp, int istext) { int r, len, memopos; Int_t colsize, colpos, *offsets; const char *next, *limit; Seq_p offseq, result, sizes; offseq = NewPtrVec(rows, &offsets); colsize = GetVarInt(nextp); colpos = colsize > 0 ? GetVarInt(nextp) : 0; if (colsize > 0) { sizes = MappedFixedCol(map, rows, nextp, 0); for (r = 0; r < rows; ++r) { len = GetSeqItem(r, sizes, IT_int).i; if (len > 0) { offsets[r] = colpos; colpos += len; } } } else sizes = NewSequence(rows, FixedGetter(0, rows, 0, 0), 0); colsize = GetVarInt(nextp); memopos = colsize > 0 ? GetVarInt(nextp) : 0; next = MF_Data(map) + memopos; limit = next + colsize; /* negated offsets point to the size/pos pair in the map */ for (r = 0; next < limit; ++r) { r += (int) GetVarInt(&next); offsets[r] = MF_Data(map) - next; /* always < 0 */ GetVarPair(&next); } result = NewSequence(rows, istext ? &ST_MappedString : &ST_MappedBytes, 0); /* data[0] points to a sequence owning the offset vector */ /* data[1] points to that vector of subview offsets */ /* data[2] points to the mapped file */ /* data[3] points to sizes seq if binary or is null if zero-terminated */ result->MS_offvec = IncRefCount(offseq); result->MS_offptr = offsets; result->MS_mapf = IncRefCount(map); result->MS_sizes = istext ? NULL : IncRefCount(sizes); return result; } static Seq_p MappedBits (MappedFile_p map, int rows, const char **nextp) { Seq_p seq; if ((**nextp & 0xFF) == 0x80) { ++*nextp; return NULL; /* zero-sized column */ } seq = MappedFixedCol(map, rows, nextp, 0); /* if this does not use 1-bit encoding, then we need to convert back */ if (rows < 8 && seq->getter != PickIntGetter(1)->getfun) { int i; Seq_p result = NULL; for (i = 0; i < rows; ++i) if (GetSeqItem(i, seq, IT_int).i) SetBit(&result, i); return result; } return seq; } static View_p MapCols (MappedFile_p map, const char **nextp, View_p meta, View_p base, Seq_p adjseq) { int i, c, r, rows, *rowptr = NULL; View_p result, subview; Seq_p seq, usedmap = NULL, rowmap; Item item; rows = (int) GetVarInt(nextp); if (ViewSize(meta) == 0) return NoColumnView(rows); if (base != NULL) { int pos = 0, from = 0, count = 0; rowmap = NewIntVec(rows, &rowptr); while (NextBits(adjseq, &from, &count)) for (i = 0; i < count; ++i) rowptr[pos++] = from + i; result = base; } else result = NewView(meta); if (rows > 0) for (c = 0; c < ViewWidth(result); ++c) { if (base != NULL) { usedmap = MappedBits(map, rows, nextp); r = CountBits(usedmap); } else r = rows; switch (ViewColType(result, c)) { case IT_int: case IT_wide: seq = MappedFixedCol(map, r, nextp, 0); break; case IT_float: case IT_double: seq = MappedFixedCol(map, r, nextp, 1); break; case IT_string: seq = MappedStringCol(map, r, nextp, 1); break; case IT_bytes: seq = MappedStringCol(map, r, nextp, 0); break; case IT_view: subview = GetViewItem(meta, c, MC_subv, IT_view).v; seq = MappedViewCol(map, r, nextp, subview, base); break; default: Assert(0); return result; } if (base != NULL) { i = 0; for (r = 0; r < usedmap->count; ++r) if (TestBit(usedmap, r)) { item.c.seq = seq; item.c.pos = -1; GetItem(i++, &item); result = ViewSet(result, rowptr[r], c, &item); } Assert(i == seq->count); } else SetViewSeqs(result, c, 1, seq); } return result; } static View_p MapSubview (MappedFile_p map, Int_t offset, View_p meta, View_p base) { const char *next; next = MF_Data(map) + offset; GetVarInt(&next); if (base != NULL) { int inscnt; View_p insview; Seq_p delseq, insseq, adjseq; meta = V_Meta(base); GetVarInt(&next); /* structure changes and defaults, NOTYET */ delseq = MappedBits(map, ViewSize(base), &next); if (delseq != NULL) { int delcnt = 0, from = 0, count = 0; while (NextBits(delseq, &from, &count)) { base = ViewReplace(base, from - delcnt, count, NULL); delcnt += count; } } adjseq = MappedBits(map, ViewSize(base), &next); if (adjseq != NULL) base = MapCols(map, &next, meta, base, adjseq); insview = MapCols(map, &next, meta, NULL, NULL); inscnt = ViewSize(insview); if (inscnt > 0) { int shift = 0, from = 0, count = 0; insseq = MappedBits(map, ViewSize(base) + inscnt, &next); while (NextBits(insseq, &from, &count)) { View_p newdata = StepView(insview, count, shift, 1, 1); base = ViewReplace(base, from, 0, newdata); shift += count; } } return base; } if (ViewSize(meta) == 0) { Int_t desclen = GetVarInt(&next); const char *desc = next; next += desclen; meta = DescAsMeta(&desc, next); } return MapCols(map, &next, meta, NULL, NULL); } static int BigEndianInt32 (const char *p) { const Byte_t *up = (const Byte_t*) p; return (p[0] << 24) | (up[1] << 16) | (up[2] << 8) | up[3]; } View_p MappedToView (MappedFile_p map, View_p base) { int i, t[4]; Int_t datalen, rootoff; if (MF_Length(map) <= 24 || *(MF_Data(map) + MF_Length(map) - 16) != '\x80') return NULL; for (i = 0; i < 4; ++i) t[i] = BigEndianInt32(MF_Data(map) + MF_Length(map) - 16 + i * 4); datalen = t[1] + 16; rootoff = t[3]; if (rootoff < 0) { const Int_t mask = 0x7FFFFFFF; datalen = (datalen & mask) + ((Int_t) ((t[0] & 0x7FF) << 16) << 15); rootoff = (rootoff & mask) + (datalen & ~mask); /* FIXME: rollover at 2 Gb, prob needs: if (rootoff > datalen) ... */ } AdjustMappedFile(map, MF_Length(map) - datalen); return MapSubview(map, rootoff, EmptyMetaView(), base); } View_p OpenDataFile (const char *filename) { MappedFile_p map; map = OpenMappedFile(filename); if (map == NULL) return NULL; return MappedToView(map, NULL); } /* %include% */ /* * getters.c - Implementation of several simple getter functions. */ #include static ItemTypes Getter_i0 (int row, Item_p item) { item->i = 0; return IT_int; } static ItemTypes Getter_i1 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = (ptr[row>>3] >> (row&7)) & 1; return IT_int; } static ItemTypes Getter_i2 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = (ptr[row>>2] >> 2*(row&3)) & 3; return IT_int; } static ItemTypes Getter_i4 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = (ptr[row>>1] >> 4*(row&1)) & 15; return IT_int; } static ItemTypes Getter_i8 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = (int8_t) ptr[row]; return IT_int; } #if VALUES_MUST_BE_ALIGNED+0 static ItemTypes Getter_i16 (int row, Item_p item) { const Byte_t *ptr = (const Byte_t*) item->c.seq->data[0].p + row * 2; #if _BIG_ENDIAN+0 item->i = (((int8_t) ptr[0]) << 8) | ptr[1]; #else item->i = (((int8_t) ptr[1]) << 8) | ptr[0]; #endif return IT_int; } static ItemTypes Getter_i32 (int row, Item_p item) { const char *ptr = (const char*) item->c.seq->data[0].p + row * 4; int i; for (i = 0; i < 4; ++i) item->b[i] = ptr[i]; return IT_int; } static ItemTypes Getter_i64 (int row, Item_p item) { const char *ptr = (const char*) item->c.seq->data[0].p + row * 8; int i; for (i = 0; i < 8; ++i) item->b[i] = ptr[i]; return IT_wide; } static ItemTypes Getter_f32 (int row, Item_p item) { Getter_i32(row, item); return IT_float; } static ItemTypes Getter_f64 (int row, Item_p item) { Getter_i64(row, item); return IT_double; } #else static ItemTypes Getter_i16 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = ((short*) ptr)[row]; return IT_int; } static ItemTypes Getter_i32 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->i = ((const int*) ptr)[row]; return IT_int; } static ItemTypes Getter_i64 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->w = ((const int64_t*) ptr)[row]; return IT_wide; } static ItemTypes Getter_f32 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->f = ((const float*) ptr)[row]; return IT_float; } static ItemTypes Getter_f64 (int row, Item_p item) { const char *ptr = item->c.seq->data[0].p; item->d = ((const double*) ptr)[row]; return IT_double; } #endif static ItemTypes Getter_i16r (int row, Item_p item) { const Byte_t *ptr = (const Byte_t*) item->c.seq->data[0].p + row * 2; #if _BIG_ENDIAN+0 item->i = (((int8_t) ptr[1]) << 8) | ptr[0]; #else item->i = (((int8_t) ptr[0]) << 8) | ptr[1]; #endif return IT_int; } static ItemTypes Getter_i32r (int row, Item_p item) { const char *ptr = (const char*) item->c.seq->data[0].p + row * 4; int i; for (i = 0; i < 4; ++i) item->b[i] = ptr[3-i]; return IT_int; } static ItemTypes Getter_i64r (int row, Item_p item) { const char *ptr = (const char*) item->c.seq->data[0].p + row * 8; int i; for (i = 0; i < 8; ++i) item->b[i] = ptr[7-i]; return IT_wide; } static ItemTypes Getter_f32r (int row, Item_p item) { Getter_i32r(row, item); return IT_float; } static ItemTypes Getter_f64r (int row, Item_p item) { Getter_i64r(row, item); return IT_double; } static struct SeqType ST_Get_i0 = { "get_i0" , Getter_i0 }; static struct SeqType ST_Get_i1 = { "get_i1" , Getter_i1 }; static struct SeqType ST_Get_i2 = { "get_i2" , Getter_i2 }; static struct SeqType ST_Get_i4 = { "get_i4" , Getter_i4 }; static struct SeqType ST_Get_i8 = { "get_i8" , Getter_i8 }; static struct SeqType ST_Get_i16 = { "get_i16" , Getter_i16 }; static struct SeqType ST_Get_i32 = { "get_i32" , Getter_i32 }; static struct SeqType ST_Get_i64 = { "get_i64" , Getter_i64 }; static struct SeqType ST_Get_i16r = { "get_i16r", Getter_i16r }; static struct SeqType ST_Get_i32r = { "get_i32r", Getter_i32r }; static struct SeqType ST_Get_i64r = { "get_i64r", Getter_i64r }; static struct SeqType ST_Get_f32 = { "get_f32" , Getter_f32 }; static struct SeqType ST_Get_f64 = { "get_f64" , Getter_f64 }; static struct SeqType ST_Get_f32r = { "get_f32r", Getter_f32r }; static struct SeqType ST_Get_f64r = { "get_f64r", Getter_f64r }; SeqType_p PickIntGetter (int bits) { switch (bits) { default: Assert(0); /* fall through */ case 0: return &ST_Get_i0; case 1: return &ST_Get_i1; case 2: return &ST_Get_i2; case 4: return &ST_Get_i4; case 8: return &ST_Get_i8; case 16: return &ST_Get_i16; case 32: return &ST_Get_i32; case 64: return &ST_Get_i64; } } SeqType_p FixedGetter (int bytes, int rows, int real, int flip) { int bits; static char widths[8][7] = { {0,-1,-1,-1,-1,-1,-1}, {0, 8,16, 1,32, 2, 4}, {0, 4, 8, 1,16, 2,-1}, {0, 2, 4, 8, 1,-1,16}, {0, 2, 4,-1, 8, 1,-1}, {0, 1, 2, 4,-1, 8,-1}, {0, 1, 2, 4,-1,-1, 8}, {0, 1, 2,-1, 4,-1,-1}, }; bits = rows < 8 && bytes < 7 ? widths[rows][bytes] : (bytes << 3) / rows; switch (bits) { case 16: return flip ? &ST_Get_i16r : &ST_Get_i16; case 32: return real ? flip ? &ST_Get_f32r : &ST_Get_f32 : flip ? &ST_Get_i32r : &ST_Get_i32; case 64: return real ? flip ? &ST_Get_f64r : &ST_Get_f64 : flip ? &ST_Get_i64r : &ST_Get_i64; } return PickIntGetter(bits); } /* %include% */ /* * hash.c - Implementation of hashing functions. */ #include #include typedef struct HashInfo *HashInfo_p; typedef struct HashInfo { View_p view; /* input view */ int prime; /* prime used for hashing */ int fill; /* used to fill map */ int *map; /* map of unique rows */ Column mapcol; /* owner of map */ int *hvec; /* hash probe vector */ Column veccol; /* owner of hvec */ int *hashes; /* hash values, one per view row */ Column hashcol; /* owner of hashes */ } HashInfo; static int StringHash (const char *s, int n) { /* similar to Python's stringobject.c */ int i, h = (*s * 0xFF) << 7; if (n < 0) n = strlen(s); for (i = 0; i < n; ++i) h = (1000003 * h) ^ s[i]; return h ^ i; } static Column HashCol (ItemTypes type, Column column) { int i, count, *data; Seq_p seq; Item item; /* the following is not possible: the result may be xor-ed into! if (type == IT_int && column.seq->getter == PickIntGetter(32)) return column; */ count = column.seq->count; seq = NewIntVec(count, &data); switch (type) { case IT_int: for (i = 0; i < count; ++i) data[i] = GetColItem(i, column, IT_int).i; break; case IT_wide: for (i = 0; i < count; ++i) { item = GetColItem(i, column, IT_wide); data[i] = item.q[0] ^ item.q[1]; } break; case IT_float: for (i = 0; i < count; ++i) data[i] = GetColItem(i, column, IT_float).i; break; case IT_double: for (i = 0; i < count; ++i) { item = GetColItem(i, column, IT_double); data[i] = item.q[0] ^ item.q[1]; } break; case IT_string: for (i = 0; i < count; ++i) { item = GetColItem(i, column, IT_string); data[i] = StringHash(item.s, -1); } break; case IT_bytes: for (i = 0; i < count; ++i) { item = GetColItem(i, column, IT_bytes); data[i] = StringHash((const char*) item.u.ptr, item.u.len); } break; case IT_view: for (i = 0; i < count; ++i) { int j, hcount, hval = 0; const int *hvec; Column hashes; item = GetColItem(i, column, IT_view); hashes = HashValues(item.v); hvec = (const int*) hashes.seq->data[0].p; hcount = hashes.seq->count; for (j = 0; j < hcount; ++j) hval ^= hvec[j]; /* TODO: release hashes right now */ data[i] = hval ^ hcount; } break; default: Assert(0); } return SeqAsCol(seq); } ItemTypes HashColCmd_SO (Item args[]) { ItemTypes type; Column column; type = CharAsItemType(args[0].s[0]); column = CoerceColumn(type, args[1].o); if (column.seq == NULL) return IT_unknown; args->c = HashCol(type, column); return IT_column; } int RowHash (View_p view, int row) { int c, hash = 0; Item item; for (c = 0; c < ViewWidth(view); ++c) { item.c = ViewCol(view, c); switch (GetItem(row, &item)) { case IT_int: hash ^= item.i; break; case IT_string: hash ^= StringHash(item.s, -1); break; case IT_bytes: hash ^= StringHash((const char*) item.u.ptr, item.u.len); break; default: { View_p rview = StepView(view, 1, row, 1, 1); Column rcol = HashValues(rview); hash = *(const int*) rcol.seq->data[0].p; break; } } } return hash; } static void XorWithIntCol (Column src, Column_p dest) { const int *srcdata = (const int*) src.seq->data[0].p; int i, count = src.seq->count, *destdata = (int*) dest->seq->data[0].p; for (i = 0; i < count; ++i) destdata[i] ^= srcdata[i]; } Column HashValues (View_p view) { int c; Column result; if (ViewWidth(view) == 0 || ViewSize(view) == 0) return SeqAsCol(NewIntVec(ViewSize(view), NULL)); result = HashCol(ViewColType(view, 0), ViewCol(view, 0)); for (c = 1; c < ViewWidth(view); ++c) { Column auxcol = HashCol(ViewColType(view, c), ViewCol(view, c)); /* TODO: get rid of the separate xor step by xoring in HashCol */ XorWithIntCol(auxcol, &result); } return result; } static int HashFind (View_p keyview, int keyrow, int keyhash, HashInfo_p data) { int probe, datarow, mask, step; mask = data->veccol.seq->count - 1; probe = ~keyhash & mask; step = (keyhash ^ (keyhash >> 3)) & mask; if (step == 0) step = mask; for (;;) { probe = (probe + step) & mask; if (data->hvec[probe] == 0) break; datarow = data->map[data->hvec[probe]-1]; if (keyhash == data->hashes[datarow] && RowEqual(keyview, keyrow, data->view, datarow)) return data->hvec[probe] - 1; step <<= 1; if (step > mask) step ^= data->prime; } if (keyview == data->view) { data->hvec[probe] = data->fill + 1; data->map[data->fill++] = keyrow; } return -1; } static int StringHashFind (const char *key, Seq_p hseq, Column values) { int probe, datarow, mask, step, keyhash; const int *hvec = (const int*) hseq->data[0].p; int prime = hseq->data[2].i; keyhash = StringHash(key, -1); mask = hseq->count - 1; probe = ~keyhash & mask; step = (keyhash ^ (keyhash >> 3)) & mask; if (step == 0) step = mask; for (;;) { probe = (probe + step) & mask; datarow = hvec[probe] - 1; if (datarow < 0) break; /* These string hashes are much simpler than the standard HashFind: no hashes vector, no indirect map, compute all hashes on-the-fly */ if (strcmp(key, GetColItem(datarow, values, IT_string).s) == 0) return datarow; step <<= 1; if (step > mask) step ^= prime; } return ~probe; } static int Log2bits (int n) { int bits = 0; while ((1 << bits) < n) ++bits; return bits; } static Column HashVector (int rows) { int bits = Log2bits((4 * rows) / 3); if (bits < 2) bits = 2; return SeqAsCol(NewIntVec(1 << bits, NULL)); } static void InitHashInfo (HashInfo_p info, View_p view, Column hmap, Column hvec, Column hashes) { int size = hvec.seq->count; static char slack [] = { 0, 0, 3, 3, 3, 5, 3, 3, 29, 17, 9, 5, 83, 27, 43, 3, 45, 9, 39, 39, 9, 5, 3, 33, 27, 9, 71, 39, 9, 5, 83, 0 }; info->view = view; info->prime = size + slack[Log2bits(size-1)]; info->fill = 0; info->mapcol = hmap; info->map = (int*) hmap.seq->data[0].p; info->veccol = hvec; info->hvec = (int*) hvec.seq->data[0].p; info->hashcol = hashes; info->hashes = (int*) hashes.seq->data[0].p; } int StringLookup (const char *key, Column values) { int h, r, rows, *hptr; const char *string; Column hvec; HashInfo info; /* adjust data[2], this assumes values is a string column */ if (values.seq->data[2].p == NULL) { rows = values.seq->count; hvec = HashVector(rows); hptr = (int*) hvec.seq->data[0].p; /* use InitHashInfo to get at the prime number, bit of a hack */ InitHashInfo(&info, NULL, hvec, hvec, hvec); hvec.seq->data[2].i = info.prime; for (r = 0; r < rows; ++r) { string = GetColItem(r, values, IT_string).s; h = StringHashFind(string, hvec.seq, values); if (h < 0) /* silently ignore duplicates */ hptr[~h] = r + 1; } values.seq->data[2].p = IncRefCount(hvec.seq); } h = StringHashFind(key, (Seq_p) values.seq->data[2].p, values); return h >= 0 ? h : -1; } static void FillHashInfo (HashInfo_p info, View_p view) { int r, rows; Column mapcol; rows = ViewSize(view); mapcol = SeqAsCol(NewIntVec(rows, NULL)); /* worst-case, dunno #groups */ InitHashInfo(info, view, mapcol, HashVector(rows), HashValues(view)); for (r = 0; r < rows; ++r) HashFind(view, r, info->hashes[r], info); /* TODO: reclaim unused entries at end of map */ mapcol.seq->count = info->fill; } static void ChaseLinks (HashInfo_p info, int count, const int *hmap, const int *lmap) { int groups = info->fill, *smap = info->hvec, *gmap = info->hashes; while (--groups >= 0) { int head = hmap[groups] - 1; smap[groups] = count; while (head >= 0) { gmap[--count] = head; head = lmap[head]; } } /* assert(count == 0); */ } void FillGroupInfo (HashInfo_p info, View_p view) { int g, r, rows, *hmap, *lmap; Column mapcol, headmap, linkmap; rows = ViewSize(view); mapcol = SeqAsCol(NewIntVec(rows, NULL)); /* worst-case, dunno #groups */ headmap = SeqAsCol(NewIntVec(rows, &hmap)); /* same: don't know #groups */ linkmap = SeqAsCol(NewIntVec(rows, &lmap)); InitHashInfo(info, view, mapcol, HashVector(rows), HashValues(view)); for (r = 0; r < rows; ++r) { g = HashFind(view, r, info->hashes[r], info); if (g < 0) g = info->fill - 1; lmap[r] = hmap[g] - 1; hmap[g] = r + 1; } /* TODO: reclaim unused entries at end of map and hvec */ info->mapcol.seq->count = info->veccol.seq->count = info->fill; ChaseLinks(info, rows, hmap, lmap); /* TODO: could release headmap and linkmap but that's a no-op here */ /* There's probably an opportunity to reduce space usage further, since the grouping map points to the starting row of each group: map[i] == gmap[smap[i]] Perhaps "map" (which starts out with #rows entries) can be re-used to append the gmap entries (if we can reduce it by #groups items). Or just release map[x] for grouping views, and use gmap[smap[x]]. */ } View_p GroupCol (View_p view, Column cols, const char *name) { View_p vkey, vres, gview; HashInfo info; vkey = ColMapView(view, cols); vres = ColMapView(view, OmitColumn(cols, ViewWidth(view))); FillGroupInfo(&info, vkey); gview = GroupedView(vres, info.veccol, info.hashcol, name); return PairView(RemapSubview(vkey, info.mapcol, 0, -1), gview); } static void FillJoinInfo (HashInfo_p info, View_p left, View_p right) { int g, r, gleft, nleft, nright, nused = 0, *hmap, *lmap, *jmap; Column mapcol, headmap, linkmap, joincol; nleft = ViewSize(left); mapcol = SeqAsCol(NewIntVec(nleft, NULL)); /* worst-case dunno #groups */ joincol = SeqAsCol(NewIntVec(nleft, &jmap)); InitHashInfo(info, left, mapcol, HashVector(nleft), HashValues(left)); for (r = 0; r < nleft; ++r) { g = HashFind(left, r, info->hashes[r], info); if (g < 0) g = info->fill - 1; jmap[r] = g; } /* TODO: reclaim unused entries at end of map */ mapcol.seq->count = info->fill; gleft = info->mapcol.seq->count; nleft = info->hashcol.seq->count; nright = ViewSize(right); headmap = SeqAsCol(NewIntVec(gleft, &hmap)); /* don't know #groups */ linkmap = SeqAsCol(NewIntVec(nright, &lmap)); for (r = 0; r < nright; ++r) { g = HashFind(right, r, RowHash(right, r), info); if (g >= 0) { lmap[r] = hmap[g] - 1; hmap[g] = r + 1; ++nused; } } /* we're reusing veccol, but it might not be large enough to start with */ /* TODO: reclaim unused entries at end of hvec */ if (info->veccol.seq->count < nused) info->veccol = SeqAsCol(NewIntVec(nused, &info->hvec)); else info->veccol.seq->count = nused; /* reorder output to match results from FillHashInfo and FillGroupInfo */ info->hashcol = info->veccol; info->hashes = info->hvec; info->veccol = info->mapcol; info->hvec = info->map; info->mapcol = joincol; info->map = jmap; ChaseLinks(info, nused, hmap, lmap); /* As with FillGroupInfo, this is most likely not quite optimal yet. All zero-length groups in smap (info->map, now info->hvec) could be coalesced into one, and joinmap indices into it adjusted down a bit. Would reduce the size of smap when there are lots of failed matches. Also: FillJoinInfo needs quite a lot of temp vector space right now. */ } Column IntersectMap (View_p keys, View_p view) { int r, rows; HashInfo info; struct Buffer buffer; if (!ViewCompat(keys, view)) return SeqAsCol(NULL); FillHashInfo(&info, view); InitBuffer(&buffer); rows = ViewSize(keys); /* these ints are added in increasing order, could have used a bitmap */ for (r = 0; r < rows; ++r) if (HashFind(keys, r, RowHash(keys, r), &info) >= 0) ADD_INT_TO_BUF(buffer, r); return SeqAsCol(BufferAsIntVec(&buffer)); } /* ReverseIntersectMap returns RHS indices, instead of IntersectMap's LHS */ static Column ReverseIntersectMap (View_p keys, View_p view) { int r, rows; HashInfo info; struct Buffer buffer; FillHashInfo(&info, view); InitBuffer(&buffer); rows = ViewSize(keys); for (r = 0; r < rows; ++r) { int f = HashFind(keys, r, RowHash(keys, r), &info); if (f >= 0) ADD_INT_TO_BUF(buffer, f); } return SeqAsCol(BufferAsIntVec(&buffer)); } View_p JoinView (View_p left, View_p right, const char *name) { View_p lmeta, rmeta, lkey, rkey, rres, gview; Column lmap, rmap; HashInfo info; lmeta = V_Meta(left); rmeta = V_Meta(right); lmap = IntersectMap(lmeta, rmeta); /* TODO: optimize, don't create the hash info twice */ rmap = ReverseIntersectMap(lmeta, rmeta); lkey = ColMapView(left, lmap); rkey = ColMapView(right, rmap); rres = ColMapView(right, OmitColumn(rmap, ViewWidth(right))); FillJoinInfo(&info, lkey, rkey); gview = GroupedView(rres, info.veccol, info.hashcol, name); return PairView(left, RemapSubview(gview, info.mapcol, 0, -1)); } Column UniqMap (View_p view) { HashInfo info; FillHashInfo(&info, view); return info.mapcol; } int HashDoFind (View_p view, int row, View_p w, Column a, Column b, Column c) { HashInfo info; /* TODO: avoid Log2bits call in InitHashInfo, since done on each find */ InitHashInfo(&info, w, a, b, c); return HashFind(view, row, RowHash(view, row), &info); } Column GetHashInfo (View_p left, View_p right, int type) { HashInfo info; Seq_p seqvec[3]; switch (type) { case 0: FillHashInfo(&info, left); break; case 1: FillGroupInfo(&info, left); break; default: FillJoinInfo(&info, left, right); break; } seqvec[0] = info.mapcol.seq; seqvec[1] = info.veccol.seq; seqvec[2] = info.hashcol.seq; return SeqAsCol(NewSeqVec(IT_column, seqvec, 3)); } View_p IjoinView (View_p left, View_p right) { View_p view = JoinView(left, right, "?"); return UngroupView(view, ViewWidth(view)-1); } static struct SeqType ST_HashMap = { "hashmap", NULL, 02 }; Seq_p HashMapNew (void) { Seq_p result; result = NewSequence(0, &ST_HashMap, 0); /* data[0] is the key + value + hash vector */ /* data[1] is the allocated count */ result->data[0].p = NULL; result->data[1].i = 0; return result; } /* FIXME: dumb linear scan instead of hashing for now, for small tests only */ static int HashMapLocate(Seq_p hmap, int key, int *pos) { const int *data = hmap->data[0].p; for (*pos = 0; *pos < hmap->count; ++*pos) if (key == data[*pos]) return 1; return 0; } int HashMapAdd (Seq_p hmap, int key, int value) { int pos, *data = hmap->data[0].p; int allocnt = hmap->data[1].i; if (HashMapLocate(hmap, key, &pos)) { data[pos+allocnt] = value; return 0; } Assert(pos == hmap->count); if (pos >= allocnt) { int newlen = (allocnt / 2) * 3 + 10; hmap->data[0].p = data = realloc(data, newlen * 2 * sizeof(int)); memmove(data+newlen, data+allocnt, allocnt * sizeof(int)); allocnt = hmap->data[1].i = newlen; } data[pos] = key; data[pos+allocnt] = value; ++hmap->count; return allocnt; } int HashMapLookup (Seq_p hmap, int key, int defval) { int pos; if (HashMapLocate(hmap, key, &pos)) { int allocnt = hmap->data[1].i; const int *data = hmap->data[0].p; return data[pos+allocnt]; } return defval; } #if 0 /* not yet */ int HashMapRemove (Seq_p hmap, int key) { int pos; if (HashMapLocate(hmap, key, &pos)) { int last = --hmap->count; if (pos < last) { int allocnt = hmap->data[1].i, *data = hmap->data[0].p; data[pos] = data[last]; data[pos+allocnt] = data[last+allocnt]; return pos; } } return -1; } #endif /* %include% */ /* * indirect.c - Implementation of some virtual views. */ #include #include #define RV_parent data[0].q #define RV_map data[1].q #define RV_start data[2].i static ItemTypes RemapGetter (int row, Item_p item) { const int* data; Seq_p seq; Assert(item->c.pos >= 0); seq = item->c.seq; data = seq->RV_map->data[0].p; item->c = ViewCol(seq->RV_parent, item->c.pos); row += seq->RV_start; if (data[row] < 0) row += data[row]; return GetItem(data[row], item); } static struct SeqType ST_Remap = { "remap", RemapGetter, 011 }; View_p RemapSubview (View_p view, Column mapcol, int start, int count) { Seq_p seq; if (mapcol.seq == NULL) return NULL; if (count < 0) count = mapcol.seq->count; if (ViewWidth(view) == 0) return NoColumnView(count); seq = NewSequence(count, &ST_Remap, 0); /* data[0] is the parent view to which the map applies */ /* data[1] is the map, as a sequence */ /* data[2] is the index offset */ seq->RV_parent = IncRefCount(view); seq->RV_map = IncRefCount(mapcol.seq); seq->RV_start = start; return IndirectView(V_Meta(view), seq); } static View_p MakeMetaSubview (const char *name, View_p view) { View_p meta, result; Seq_p names, types, subvs; names = NewStrVec(1); AppendToStrVec(name, -1, names); types = NewStrVec(1); AppendToStrVec("V", -1, types); meta = V_Meta(view); subvs = NewSeqVec(IT_view, &meta, 1); result = NewView(V_Meta(meta)); SetViewSeqs(result, MC_name, 1, FinishStrVec(names)); SetViewSeqs(result, MC_type, 1, FinishStrVec(types)); SetViewSeqs(result, MC_subv, 1, subvs); return result; } #define GV_parent data[0].q #define GV_start data[1].q #define GV_group data[2].q #define GV_cache data[3].q static ItemTypes GroupedGetter (int row, Item_p item) { Seq_p seq = item->c.seq; View_p *subviews = seq->GV_cache->data[0].p; if (subviews[row] == NULL) { const int *sptr = seq->GV_start->data[0].p; Seq_p gmap = seq->GV_group; int start = row > 0 ? sptr[row-1] : 0; item->c.seq = gmap; subviews[row] = IncRefCount(RemapSubview(seq->GV_parent, item->c, start, sptr[row] - start)); } item->v = subviews[row]; return IT_view; } static struct SeqType ST_Grouped = { "grouped", GroupedGetter, 01111 }; View_p GroupedView (View_p view, Column startcol, Column groupcol, const char *name) { int groups; Seq_p seq, subviews; groups = startcol.seq->count; subviews = NewSeqVec(IT_view, NULL, groups); seq = NewSequence(groups, &ST_Grouped, 0); /* data[0] is the parent view to which the grouping applies */ /* data[1] is the start map, as a sequence */ /* data[2] is the group map, as a sequence */ /* data[3] is a cache of subviews, as a pointer vector in a sequence */ seq->GV_parent = IncRefCount(view); seq->GV_start = IncRefCount(startcol.seq); seq->GV_group = IncRefCount(groupcol.seq); seq->GV_cache = IncRefCount(subviews); return IndirectView(MakeMetaSubview(name, view), seq); } #define PV_parent data[0].q #define PV_start data[1].i #define PV_rate data[2].i #define PV_step data[3].i static ItemTypes StepGetter (int row, Item_p item) { Seq_p seq = item->c.seq; int rows = ViewSize(seq->PV_parent); item->c = ViewCol(seq->PV_parent, item->c.pos); row = (seq->PV_start + (row / seq->PV_rate) * seq->PV_step) % rows; if (row < 0) row += rows; return GetItem(row, item); } static struct SeqType ST_Step = { "step", StepGetter, 01 }; View_p StepView (View_p view, int count, int offset, int rate, int step) { Seq_p seq; /* prevent division by zero if input view is empty */ if (ViewSize(view) == 0) return view; seq = NewSequence(count * rate, &ST_Step, 0); /* data[0] is the parent view to which the changes apply */ /* data[1] is the starting offset */ /* data[2] is the rate to repeat an item */ /* data[3] is the step to the next item */ seq->PV_parent = IncRefCount(view); seq->PV_start = offset; seq->PV_rate = rate; seq->PV_step = step; return IndirectView(V_Meta(view), seq); } #define CV_left data[0].q #define CV_right data[1].q static ItemTypes ConcatGetter (int row, Item_p item) { View_p view = item->c.seq->CV_left; int rows = ViewSize(view); if (row >= rows) { row -= rows; view = item->c.seq->CV_right; } item->c = ViewCol(view, item->c.pos); return GetItem(row, item); } static struct SeqType ST_Concat = { "concat", ConcatGetter, 011 }; View_p ConcatView (View_p view1, View_p view2) { int rows1, rows2; Seq_p seq; if (view1 == NULL || view2 == NULL || !ViewCompat(view1, view2)) return NULL; rows1 = ViewSize(view1); if (rows1 == 0) return view2; rows2 = ViewSize(view2); if (rows2 == 0) return view1; seq = NewSequence(rows1 + rows2, &ST_Concat, 0); /* data[0] is the left-hand view */ /* data[1] is the right-hand view */ seq->CV_left = IncRefCount(view1); seq->CV_right = IncRefCount(view2); return IndirectView(V_Meta(view1), seq); } #define UV_parent data[0].q #define UV_unmap data[1].q #define UV_subcol data[2].i #define UV_swidth data[3].i static ItemTypes UngroupGetter (int row, Item_p item) { int col, subcol, parentrow; const int *data; View_p view; Seq_p seq; col = item->c.pos; seq = item->c.seq; view = seq->UV_parent; data = seq->UV_unmap->data[0].p; subcol = seq->UV_subcol; parentrow = data[row]; if (parentrow < 0) { parentrow = data[row+parentrow]; row = -data[row]; } else row = 0; if (subcol <= col && col < subcol + seq->UV_swidth) { view = GetViewItem(view, parentrow, subcol, IT_view).v; col -= subcol; } else { if (col >= subcol) col -= seq->UV_swidth - 1; row = parentrow; } item->c = ViewCol(view, col); return GetItem(row, item); } static struct SeqType ST_Ungroup = { "ungroup", UngroupGetter, 011 }; View_p UngroupView (View_p view, int col) { int i, n, r, rows; struct Buffer buffer; View_p subview, meta, submeta, newmeta; Seq_p seq, map; Column column; InitBuffer(&buffer); column = ViewCol(view, col); rows = column.seq->count; for (r = 0; r < rows; ++r) { subview = GetColItem(r, column, IT_view).v; n = ViewSize(subview); if (n > 0) { ADD_INT_TO_BUF(buffer, r); for (i = 1; i < n; ++i) ADD_INT_TO_BUF(buffer, -i); } } map = BufferAsIntVec(&buffer); /* result meta view replaces subview column with its actual meta view */ meta = V_Meta(view); submeta = GetViewItem(meta, col, MC_subv, IT_view).v; newmeta = ConcatView(FirstView(meta, col), submeta); newmeta = ConcatView(newmeta, LastView(meta, ViewSize(meta) - (col + 1))); seq = NewSequence(map->count, &ST_Ungroup, 0); /* data[0] is the parent view */ /* data[1] is ungroup map as a sequence */ /* data[2] is the subview column */ /* data[3] is the subview width */ seq->UV_parent = IncRefCount(view); seq->UV_unmap = IncRefCount(map); seq->UV_subcol = col; seq->UV_swidth = ViewSize(submeta); return IndirectView(newmeta, seq); } #define BV_parent data[0].q #define BV_cumcnt data[1].q static ItemTypes BlockedGetter (int row, Item_p item) { int block; const int* data; View_p subv; Seq_p seq; seq = item->c.seq; data = seq->BV_cumcnt->data[0].p; for (block = 0; block + data[block] < row; ++block) ; if (row == block + data[block]) { row = block; block = ViewSize(seq->BV_parent) - 1; } else if (block > 0) row -= block + data[block-1]; subv = GetViewItem(seq->BV_parent, block, 0, IT_view).v; item->c = ViewCol(subv, item->c.pos); return GetItem(row, item); } static struct SeqType ST_Blocked = { "blocked", BlockedGetter, 011 }; View_p BlockedView (View_p view) { int r, rows, *limits, tally = 0; View_p submeta; Seq_p seq, offsets; Column blocks; /* view must have exactly one subview column */ if (ViewWidth(view) != 1) return NULL; blocks = ViewCol(view, 0); rows = ViewSize(view); offsets = NewIntVec(rows, &limits); for (r = 0; r < rows; ++r) { tally += ViewSize(GetColItem(r, blocks, IT_view).v); limits[r] = tally; } seq = NewSequence(tally, &ST_Blocked, 0); /* data[0] is the parent view */ /* data[1] is a cumulative row count, as a sequence */ seq->BV_parent = IncRefCount(view); seq->BV_cumcnt = IncRefCount(offsets); submeta = GetViewItem(V_Meta(view), 0, MC_subv, IT_view).v; return IndirectView(submeta, seq); } /* %include% */ /* * mutable.c - Implementation of mutable views. */ #include #include #define MUT_DEBUG 0 #define S_aux(seq,typ) ((typ) ((Seq_p) (seq) + 1)) #define SV_data(seq) S_aux(seq, Seq_p*) #define SV_bits data[0].q #define SV_hash data[1].q #define SV_view data[2].q static void SettableCleaner (Seq_p seq) { int c, r; View_p view = seq->SV_view; for (c = 0; c < ViewWidth(view); ++c) { Seq_p dseq = SV_data(seq)[c]; if (dseq != NULL) switch (ViewColType(view, c)) { case IT_string: { char **p = S_aux(dseq, char**); for (r = 0; r < dseq->count; ++r) if (p[r] != NULL) free(p[r]); break; } case IT_bytes: { const Item *p = S_aux(dseq, const Item*); for (r = 0; r < dseq->count; ++r) if (p[r].u.ptr != NULL) free((char*) p[r].u.ptr); break; } case IT_view: { const View_p *p = S_aux(dseq, const View_p*); for (r = 0; r < dseq->count; ++r) if (p[r] != NULL) DecRefCount(p[r]); break; } default: break; } DecRefCount(dseq); DecRefCount(SV_data(seq)[ViewWidth(view)+c]); } } static ItemTypes SettableGetter (int row, Item_p item) { int col = item->c.pos; Seq_p seq = item->c.seq; View_p view = seq->SV_view; item->c = ViewCol(view, col); if (TestBit(seq->SV_bits, row)) { int index = HashMapLookup(seq->SV_hash, row, -1); Assert(index >= 0); if (TestBit(SV_data(seq)[ViewWidth(view)+col], index)) { row = index; item->c.seq = SV_data(seq)[col]; } } return GetItem(row, item); } static int SettableWidth (ItemTypes type) { switch (type) { case IT_int: case IT_float: return 4; case IT_wide: case IT_double: return 8; case IT_view: case IT_string: return sizeof(void*); case IT_bytes: return sizeof(Item); default: Assert(0); return 0; } } static ItemTypes StringSetGetter (int row, Item_p item) { item->s = S_aux(item->c.seq, const char**)[row]; return IT_string; } static ItemTypes BytesSetGetter (int row, Item_p item) { item->u = S_aux(item->c.seq, const Item*)[row].u; return IT_bytes; } static ItemTypes ViewSetGetter (int row, Item_p item) { item->v = S_aux(item->c.seq, const View_p*)[row]; return IT_view; } static struct SeqType ST_StringSet = { "stringset", StringSetGetter }; static struct SeqType ST_BytesSet = { "bytesset", BytesSetGetter }; static struct SeqType ST_ViewSet = { "viewset", ViewSetGetter }; static SeqType_p PickSetGetter (ItemTypes type) { int w = 8; switch (type) { case IT_int: w = 4; /* fall through */ case IT_wide: return FixedGetter(w, 1, 0, 0); case IT_float: w = 4; /* fall through */ case IT_double: return FixedGetter(w, 1, 1, 0); case IT_string: return &ST_StringSet; case IT_bytes: return &ST_BytesSet; case IT_view: return &ST_ViewSet; default: Assert(0); return NULL; } } static struct SeqType ST_Settable = { "settable", SettableGetter, 0111, SettableCleaner }; static int IsSettable(View_p view) { Seq_p seq = ViewCol(view, 0).seq; return seq != NULL && seq->type == &ST_Settable; } static void SettableSetter (View_p view, int row, int col, Item_p item) { int index, count, limit; ItemTypes type; Seq_p seq, dseq, hash; Assert(IsSettable(view)); seq = ViewCol(view, col).seq; type = ViewColType(view, col); dseq = SV_data(seq)[col]; hash = seq->SV_hash; if (SetBit(&seq->SV_bits, row)) { index = hash->count; HashMapAdd(hash, row, index); } else { index = HashMapLookup(hash, row, -1); Assert(index >= 0); } limit = SetBit(&SV_data(seq)[ViewWidth(view)+col], index); count = dseq != NULL ? dseq->count : 0; /* clumsy: resize a settable column so it can store more items if needed */ if (limit > count) { int w = SettableWidth(type); Seq_p nseq; nseq = IncRefCount(NewSequence(limit, PickSetGetter(type), limit * w)); memcpy(nseq + 1, LoseRef(dseq) + 1, count * w); SV_data(seq)[col] = dseq = nseq; } switch (type) { case IT_int: S_aux(dseq, int* )[index] = item->i; break; case IT_wide: S_aux(dseq, int64_t*)[index] = item->w; break; case IT_float: S_aux(dseq, float* )[index] = item->f; break; case IT_double: S_aux(dseq, double* )[index] = item->d; break; case IT_string: { char **p = S_aux(dseq, char**) + index; free(*p); *p = strdup(item->s); break; } case IT_bytes: { Item *p = S_aux(dseq, Item*) + index; free((char*) p->u.ptr); p->u.len = item->u.len; p->u.ptr = memcpy(malloc(p->u.len), item->u.ptr, p->u.len); break; } case IT_view: { View_p *p = S_aux(dseq, View_p*) + index; LoseRef(*p); *p = IncRefCount(item->v); break; } default: Assert(0); break; } } static View_p SettableView (View_p view) { Int_t bytes = 2 * ViewWidth(view) * sizeof(Seq_p*); Seq_p seq; /* room for a set of new data columns, then a set of "used" bitmaps */ seq = NewSequence(ViewSize(view), &ST_Settable, bytes); /* data[0] is the adjusted bitmap */ /* data[1] points to hash row map */ /* data[2] points to the original view */ seq->SV_bits = NULL; seq->SV_hash = IncRefCount(HashMapNew()); seq->SV_view = IncRefCount(view); return IndirectView(V_Meta(view), seq); } #define MV_parent data[0].q #define MV_mutmap data[1].q typedef struct MutRange { int start; int shift; View_p added; } *MutRange_p; static void MutableCleaner (Seq_p seq) { int i; Seq_p map; MutRange_p range; map = seq->MV_mutmap; range = S_aux(map, MutRange_p); for (i = 0; i < map->count; ++i) DecRefCount(range[i].added); } #if MUT_DEBUG #include static void DumpRanges (const char *msg, View_p view) { int i; Seq_p seq, map; MutRange_p range; seq = ViewCol(view, 0).seq; map = seq->MV_mutmap; range = S_aux(map, MutRange_p); printf("%s: view %p rc %d, has %d rows %d ranges\n", msg, (void*) view, view->refs, ViewSize(view), map->count); for (i = 0; i < map->count; ++i) { View_p v = range[i].added; printf(" %2d: st %3d sh %3d", i, range[i].start, range[i].shift); if (v != NULL) printf(" - %p: sz %3d rc %3d\n", (void*) v, ViewSize(v), v->refs); printf("\n"); } } #else #define DumpRanges(a,b) #endif static int MutSlot (MutRange_p range, int pos) { int i = -1; /* TODO: use binary i.s.o. linear search */ while (pos > range[++i].start) ; return pos < range[i].start ? i-1 : i; } static int ChooseMutView (Seq_p seq, int *prow) { int slot, row = *prow; MutRange_p range; range = S_aux(seq->MV_mutmap, MutRange_p); slot = MutSlot(range, row); row -= range[slot].start; Assert(row >= 0); *prow = range[slot].added != NULL ? slot : -1; return row + range[slot].shift; } static ItemTypes MutableGetter (int row, Item_p item) { Seq_p seq = item->c.seq; View_p view = seq->MV_parent; int index = ChooseMutView(seq, &row); if (row >= 0) { MutRange_p range = S_aux(seq->MV_mutmap, MutRange_p); view = range[row].added; } item->c = ViewCol(view, item->c.pos); return GetItem(index, item); } static MutRange_p MutResize (Seq_p *seqp, int pos, int diff) { int i, limit = 0, count = 0; MutRange_p range = NULL; Seq_p map; map = *seqp; if (map != NULL) { count = map->count; limit = map->data[1].i / sizeof(struct MutRange); range = S_aux(map, MutRange_p); } /* TODO: this only grows the ranges, should also shrink when possible */ if (diff > 0 && count + diff > limit) { int newlimit; MutRange_p newrange; newlimit = (count / 2) * 3 + 5; Assert(pos + diff <= newlimit); *seqp = NewSequence(count, PickIntGetter(0), newlimit * sizeof(struct MutRange)); newrange = S_aux(*seqp, MutRange_p); memcpy(newrange, range, count * sizeof(struct MutRange)); range = newrange; LoseRef(map); map = IncRefCount(*seqp); } map->count += diff; if (diff > 0) { for (i = count; --i >= pos; ) range[i+diff] = range[i]; } else if (diff < 0) { for (i = pos; i < pos - diff; ++i) LoseRef(range[i].added); for (i = pos - diff; i < count; ++i) range[i+diff] = range[i]; } return range; } static struct SeqType ST_Mutable = { "mutable", MutableGetter, 011, MutableCleaner }; View_p MutableView (View_p view) { int rows; Seq_p seq; rows = ViewSize(view); seq = NewSequence(rows, &ST_Mutable, 0); /* data[0] is the parent view (may be changed to a settable one later) */ /* data[1] holds the mutable range map, as a sequence */ seq->MV_parent = IncRefCount(view); seq->MV_mutmap = NULL; if (rows == 0) MutResize(&seq->MV_mutmap, 0, 1); else { MutRange_p range = MutResize(&seq->MV_mutmap, 0, 2); range[1].start = rows; } return IndirectView(V_Meta(view), seq); } int IsMutable (View_p view) { Seq_p seq = ViewCol(view, 0).seq; return seq != NULL && seq->type == &ST_Mutable; } View_p ViewSet (View_p view, int row, int col, Item_p item) { int index; View_p *modview; Seq_p mutseq; if (!IsMutable(view)) view = MutableView(view); mutseq = ViewCol(view, 0).seq; index = ChooseMutView(mutseq, &row); if (row >= 0) { MutRange_p range = S_aux(mutseq->MV_mutmap, MutRange_p); modview = &range[row].added; } else modview = (View_p*) &mutseq->data[0].p; if (!IsSettable(*modview)) *modview = IncRefCount(SettableView(LoseRef(*modview))); SettableSetter(*modview, index, col, item); return view; } View_p ViewReplace (View_p view, int offset, int count, View_p data) { int drows, fend, fpos, fslot, tend, tpos, tslot, grow, diff; Seq_p seq, map; MutRange_p range; View_p tailv; drows = data != NULL ? ViewSize(data) : 0; fend = offset + count; tend = offset + drows; if (drows > 0 && !ViewCompat(view, data)) return NULL; if (drows == 0 && count == 0) return view; if (!IsMutable(view)) view = MutableView(view); DumpRanges("before", view); seq = ViewCol(view, 0).seq; map = seq->MV_mutmap; range = S_aux(map, MutRange_p); fslot = MutSlot(range, offset); fpos = offset - range[fslot].start; tslot = MutSlot(range, fend); tpos = fend - range[tslot].start; tailv = range[tslot].added; #if MUT_DEBUG printf("fslot %d fpos %d tslot %d tpos %d drows %d offset %d count %d fend %d tend %d\n", fslot,fpos,tslot,tpos,drows,offset,count,fend,tend); #endif /* keep head of first range, if rows remain before offset */ if (fpos > 0) ++fslot; grow = fslot - tslot; if (drows > 0) ++grow; range = MutResize(&seq->MV_mutmap, fslot, grow); tslot += grow; if (fpos > 0 && grow > 0) range[tslot].shift = range[fslot-1].shift; if (drows > 0) { range[fslot].start = offset; range[fslot].shift = 0; range[fslot].added = IncRefCount(data); } /* keep tail of last range, if rows remain after offset */ if (tpos > 0) { range[tslot].start = tend; range[tslot].shift += tpos; LoseRef(range[tslot].added); range[tslot].added = IncRefCount(tailv); ++tslot; } diff = drows - count; seq->count += diff; map = seq->MV_mutmap; while (tslot < map->count) range[tslot++].start += diff; DumpRanges("after", view); return view; } ItemTypes SetCmd_MIX (Item args[]) { int i, col, row, objc; const Object_p *objv; View_p view; Item item; view = ObjAsView(args[0].o); row = args[1].i; if (row < 0) row += ViewSize(view); objv = (const void*) args[2].u.ptr; objc = args[2].u.len; if (objc % 2 != 0) { args->e = EC_wnoa; return IT_error; } for (i = 0; i < objc; i += 2) { col = ColumnByName(V_Meta(view), objv[i]); if (col < 0) return IT_unknown; item.o = objv[i+1]; if (!ObjToItem(ViewColType(view, col), &item)) return IT_unknown; view = ViewSet(view, row, col, &item); } args->v = view; return IT_view; } Seq_p MutPrepare (View_p view) { int i, j, k, cols, ranges, parows, delcnt, delpos, count, adjpos; Seq_p result, *seqs, mutseq, mutmap; MutRange_p range, rp; View_p parent, insview; Column column; Assert(IsMutable(view)); mutseq = ViewCol(view, 0).seq; parent = mutseq->MV_parent; parows = ViewSize(parent); mutmap = mutseq->MV_mutmap; range = S_aux(mutmap, MutRange_p); ranges = mutmap->count - 1; cols = ViewWidth(view); result = NewSeqVec(IT_unknown, NULL, MP_limit); seqs = S_aux(result, Seq_p*); seqs[MP_delmap] = NewBitVec(parows); seqs[MP_insmap] = NewBitVec(ViewSize(view)); delcnt = delpos = 0; insview = CloneView(view); for (i = 0; i < ranges; ++i) { rp = range + i; count = (rp+1)->start - rp->start; if (rp->added == NULL) { delcnt += rp->shift - delpos; SetBitRange(seqs[MP_delmap], delpos, rp->shift - delpos); delpos = rp->shift + count; } else { View_p newdata = StepView(rp->added, count, rp->shift, 1, 1); insview = ViewReplace(insview, ViewSize(insview), 0, newdata); SetBitRange(seqs[MP_insmap], rp->start, count); } } delcnt += parows - delpos; SetBitRange(seqs[MP_delmap], delpos, parows - delpos); seqs[MP_insdat] = insview; seqs[MP_adjmap] = NewBitVec(parows - delcnt); if (IsSettable(parent)) { Seq_p setseq, adjseq; setseq = ViewCol(parent, 0).seq; adjseq = setseq->SV_bits; if (adjseq != NULL && adjseq->count > 0) { int *revptr, *rowptr; Seq_p revmap, rowmap, hash = setseq->SV_hash; View_p bitmeta, bitview; revmap = NewIntVec(hash->count, &revptr); rowmap = NewIntVec(hash->count, &rowptr); k = adjpos = 0; for (i = 0; i < ranges; ++i) { rp = range + i; if (rp->added == NULL) { count = (rp+1)->start - rp->start; for (j = 0; j < count; ++j) if (TestBit(adjseq, rp->start + j)) { int index = HashMapLookup(hash, rp->start + j, -1); Assert(index >= 0); revptr[k] = index; rowptr[k++] = rp->start + j; SetBit(seqs+MP_adjmap, adjpos + j); } adjpos += count; } } Assert(adjpos == parows - delcnt); seqs[MP_adjdat] = RemapSubview(parent, SeqAsCol(rowmap), 0, -1); bitmeta = StepView(MakeIntColMeta("_"), 1, 0, ViewWidth(parent), 1); bitview = NewView(bitmeta); /* will become an N-intcol view */ for (i = 0; i < cols; ++i) { column.seq = SV_data(setseq)[cols+i]; column.pos = -1; MinBitCount(&column.seq, hash->count); SetViewCols(bitview, i, 1, column); } seqs[MP_revmap] = revmap; seqs[MP_usemap] = RemapSubview(bitview, SeqAsCol(revmap), 0, -1); } } else { seqs[MP_adjdat] = seqs[MP_usemap] = NoColumnView(0); seqs[MP_revmap] = ViewCol(seqs[MP_usemap], 0).seq; } for (i = 0; i < MP_limit; ++i) IncRefCount(seqs[i]); return result; } /* %include% */ /* * sorted.c - Implementation of sorting functions. */ #include #include static int ItemsEqual (ItemTypes type, Item a, Item b) { switch (type) { case IT_int: return a.i == b.i; case IT_wide: return a.w == b.w; case IT_float: return a.f == b.f; case IT_double: return a.d == b.d; case IT_string: return strcmp(a.s, b.s) == 0; case IT_bytes: return a.u.len == b.u.len && memcmp(a.u.ptr, b.u.ptr, a.u.len) == 0; case IT_view: return ViewCompare(a.v, b.v) == 0; default: Assert(0); return -1; } } int RowEqual (View_p v1, int r1, View_p v2, int r2) { int c; ItemTypes type; Item item1, item2; for (c = 0; c < ViewWidth(v1); ++c) { type = ViewColType(v1, c); item1 = GetViewItem(v1, r1, c, type); item2 = GetViewItem(v2, r2, c, type); if (!ItemsEqual(type, item1, item2)) return 0; } return 1; } /* TODO: UTF-8 comparisons, also case-sensitive & insensitive */ static int ItemsCompare (ItemTypes type, Item a, Item b, int lower) { switch (type) { case IT_int: return (a.i > b.i) - (a.i < b.i); case IT_wide: return (a.w > b.w) - (a.w < b.w); case IT_float: return (a.f > b.f) - (a.f < b.f); case IT_double: return (a.d > b.d) - (a.d < b.d); case IT_string: return (lower ? strcasecmp : strcmp)(a.s, b.s); case IT_bytes: { int f; if (a.u.len == b.u.len) return memcmp(a.u.ptr, b.u.ptr, a.u.len); f = memcmp(a.u.ptr, b.u.ptr, a.u.len < b.u.len ? a.u.len : b.u.len); return f != 0 ? f : a.u.len - b.u.len; } case IT_view: return ViewCompare(a.v, b.v); default: Assert(0); return -1; } } int RowCompare (View_p v1, int r1, View_p v2, int r2) { int c, f; ItemTypes type; Item item1, item2; for (c = 0; c < ViewWidth(v1); ++c) { type = ViewColType(v1, c); item1 = GetViewItem(v1, r1, c, type); item2 = GetViewItem(v2, r2, c, type); f = ItemsCompare(type, item1, item2, 0); if (f != 0) return f < 0 ? -1 : 1; } return 0; } static int RowIsLess (View_p v, int a, int b) { int c, f; ItemTypes type; Item va, vb; if (a != b) for (c = 0; c < ViewWidth(v); ++c) { type = ViewColType(v, c); va = GetViewItem(v, a, c, type); vb = GetViewItem(v, b, c, type); f = ItemsCompare(type, va, vb, 0); if (f != 0) return f < 0; } return a < b; } static int TestAndSwap (View_p v, int *a, int *b) { if (RowIsLess(v, *b, *a)) { int t = *a; *a = *b; *b = t; return 1; } return 0; } static void MergeSort (View_p v, int *ar, int nr, int *scr) { switch (nr) { case 2: TestAndSwap(v, ar, ar+1); break; case 3: TestAndSwap(v, ar, ar+1); if (TestAndSwap(v, ar+1, ar+2)) TestAndSwap(v, ar, ar+1); break; case 4: /* TODO: optimize with if's */ TestAndSwap(v, ar, ar+1); TestAndSwap(v, ar+2, ar+3); TestAndSwap(v, ar, ar+2); TestAndSwap(v, ar+1, ar+3); TestAndSwap(v, ar+1, ar+2); break; /* TODO: also special-case 5-item sort? */ default: { int s1 = nr / 2, s2 = nr - s1; int *f1 = scr, *f2 = scr + s1, *t1 = f1 + s1, *t2 = f2 + s2; MergeSort(v, f1, s1, ar); MergeSort(v, f2, s2, ar+s1); for (;;) if (RowIsLess(v, *f1, *f2)) { *ar++ = *f1++; if (f1 >= t1) { while (f2 < t2) *ar++ = *f2++; break; } } else { *ar++ = *f2++; if (f2 >= t2) { while (f1 < t1) *ar++ = *f1++; break; } } } } } Column SortMap (View_p view) { int r, rows, *imap, *itmp; Seq_p seq; rows = ViewSize(view); if (rows <= 1 || ViewWidth(view) == 0) return NewIotaColumn(rows); seq = NewIntVec(rows, &imap); NewIntVec(rows, &itmp); for (r = 0; r < rows; ++r) imap[r] = itmp[r] = r; MergeSort(view, imap, rows, itmp); return SeqAsCol(seq); } static ItemTypes AggregateMax (ItemTypes type, Column column, Item_p item) { int r, rows; Item temp; rows = column.seq->count; if (rows == 0) { item->e = EC_nalor; return IT_error; } *item = GetColItem(0, column, type); for (r = 1; r < rows; ++r) { temp = GetColItem(r, column, type); if (ItemsCompare (type, temp, *item, 0) > 0) *item = temp; } return type; } ItemTypes MaxCmd_VN (Item args[]) { Column column = ViewCol(args[0].v, args[1].i); return AggregateMax(ViewColType(args[0].v, args[1].i), column, args); } static ItemTypes AggregateMin (ItemTypes type, Column column, Item_p item) { int r, rows; Item temp; rows = column.seq->count; if (rows == 0) { item->e = EC_nalor; return IT_error; } *item = GetColItem(0, column, type); for (r = 1; r < rows; ++r) { temp = GetColItem(r, column, type); if (ItemsCompare (type, temp, *item, 0) < 0) *item = temp; } return type; } ItemTypes MinCmd_VN (Item args[]) { Column column = ViewCol(args[0].v, args[1].i); return AggregateMin(ViewColType(args[0].v, args[1].i), column, args); } static ItemTypes AggregateSum (ItemTypes type, Column column, Item_p item) { int r, rows = column.seq->count; switch (type) { case IT_int: item->w = 0; for (r = 0; r < rows; ++r) item->w += GetColItem(r, column, IT_int).i; return IT_wide; case IT_wide: item->w = 0; for (r = 0; r < rows; ++r) item->w += GetColItem(r, column, IT_wide).w; return IT_wide; case IT_float: item->d = 0; for (r = 0; r < rows; ++r) item->d += GetColItem(r, column, IT_float).f; return IT_double; case IT_double: item->d = 0; for (r = 0; r < rows; ++r) item->d += GetColItem(r, column, IT_double).d; return IT_double; default: return IT_unknown; } } ItemTypes SumCmd_VN (Item args[]) { Column column = ViewCol(args[0].v, args[1].i); return AggregateSum(ViewColType(args[0].v, args[1].i), column, &args[0]); } /* %include% */ /* * view.c - Implementation of views. */ #include #include int ViewSize (View_p view) { Seq_p seq = ViewCol(view, 0).seq; return seq != NULL ? seq->count : 0; } char GetColType (View_p meta, int col) { /* TODO: could be a #define */ return *GetViewItem(meta, col, MC_type, IT_string).s; } static void ViewCleaner (View_p view) { int c; for (c = 0; c <= ViewWidth(view); ++c) DecRefCount(ViewCol(view, c).seq); } static ItemTypes ViewGetter (int row, Item_p item) { item->c = ViewCol(item->c.seq, row); return IT_column; } static struct SeqType ST_View = { "view", ViewGetter, 010, ViewCleaner }; static View_p ForceMetaView(View_p meta) { View_p newmeta; Column orignames, names; /* this code is needed so we can always do a hash lookup on name column */ orignames = ViewCol(meta, MC_name); names = ForceStringColumn(orignames); if (names.seq == orignames.seq) return meta; /* need to construct a new meta view with the adjusted names column */ newmeta = NewView(V_Meta(meta)); SetViewCols(newmeta, MC_name, 1, names); SetViewCols(newmeta, MC_type, 1, ViewCol(meta, MC_type)); SetViewCols(newmeta, MC_subv, 1, ViewCol(meta, MC_subv)); return newmeta; } View_p NewView (View_p meta) { int c, cols, bytes; View_p view; /* a view must always be able to store at least one column */ cols = ViewSize(meta); bytes = (cols + 1) * (sizeof(Column) + 1); view = NewSequence(cols, &ST_View, bytes); /* data[0] points to types string (allocated inline after the columns) */ /* data[1] is the meta view */ V_Types(view) = (char*) (V_Cols(view) + cols + 1); V_Meta(view) = IncRefCount(ForceMetaView(meta)); /* TODO: could optimize by storing the types with the meta view instead */ for (c = 0; c < cols; ++c) V_Types(view)[c] = CharAsItemType(GetColType(meta, c)); return view; } void SetViewCols (View_p view, int first, int count, Column src) { int c; AdjustSeqRefs(src.seq, count); for (c = first; c < first + count; ++c) { DecRefCount(ViewCol(view, c).seq); ViewCol(view, c) = src; } } void SetViewSeqs (View_p view, int first, int count, Seq_p src) { SetViewCols(view, first, count, SeqAsCol(src)); } View_p IndirectView (View_p meta, Seq_p seq) { int c, cols; View_p result; cols = ViewSize(meta); if (cols == 0) ++cols; result = NewView(meta); SetViewSeqs(result, 0, cols, seq); for (c = 0; c < cols; ++c) ViewCol(result, c).pos = c; return result; } View_p EmptyMetaView (void) { Shared_p sh = GetShared(); if (sh->empty == NULL) { int bytes; View_p meta, subs [MC_limit]; Seq_p tempseq; /* meta is recursively defined, so we can't use NewView here */ bytes = (MC_limit + 1) * (sizeof(Column) + 1); meta = NewSequence(MC_limit, &ST_View, bytes); V_Meta(meta) = IncRefCount(meta); /* circular */ V_Types(meta) = (char*) (V_Cols(meta) + MC_limit + 1); V_Types(meta)[0] = V_Types(meta)[1] = IT_string; V_Types(meta)[2] = IT_view; /* initialize all but last columns of meta with static ptr contents */ tempseq = NewStrVec(1); AppendToStrVec("name", -1, tempseq); AppendToStrVec("type", -1, tempseq); AppendToStrVec("subv", -1, tempseq); SetViewSeqs(meta, MC_name, 1, FinishStrVec(tempseq)); tempseq = NewStrVec(1); AppendToStrVec("S", -1, tempseq); AppendToStrVec("S", -1, tempseq); AppendToStrVec("V", -1, tempseq); SetViewSeqs(meta, MC_type, 1, FinishStrVec(tempseq)); /* same structure as meta but no rows */ sh->empty = NewView(meta); /* initialize last column of meta, now that empty exists */ subs[MC_name] = subs[MC_type] = subs[MC_subv] = sh->empty; SetViewSeqs(meta, MC_subv, 1, NewSeqVec(IT_view, subs, MC_limit)); } return sh->empty; } View_p NoColumnView (int rows) { View_p result = NewView(EmptyMetaView()); SetViewSeqs(result, 0, 1, NewSequence(rows, PickIntGetter(0), 0)); return result; } View_p ColMapView (View_p view, Column mapcol) { int c, cols; const int *map; View_p result; map = (const int*) mapcol.seq->data[0].p; cols = mapcol.seq->count; if (cols == 0) return NoColumnView(ViewSize(view)); result = NewView(RemapSubview(V_Meta(view), mapcol, 0, cols)); for (c = 0; c < cols; ++c) SetViewCols(result, c, 1, ViewCol(view, map[c])); return result; } View_p ColOmitView (View_p view, Column omitcol) { int c, d, *map; Seq_p mapcol; mapcol = NewIntVec(ViewWidth(view), &map); /* TODO: make this robust, may have to add bounds check */ for (c = 0; c < omitcol.seq->count; ++c) map[GetColItem(c, omitcol, IT_int).i] = 1; for (c = d = 0; c < mapcol->count; ++c) if (!map[c]) map[d++] = c; mapcol->count = d; /* TODO: truncate unused area */ return ColMapView(view, SeqAsCol(mapcol)); } View_p OneColView (View_p view, int col) { View_p result; result = NewView(StepView(V_Meta(view), 1, col, 1, 1)); SetViewCols(result, 0, 1, ViewCol(view, col)); return result; } View_p FirstView (View_p view, int count) { if (count >= ViewSize(view)) return view; return StepView(view, count, 0, 1, 1); } View_p LastView (View_p view, int count) { int rows = ViewSize(view); if (count >= rows) return view; return StepView(view, count, rows - count, 1, 1); } View_p TakeView (View_p view, int count) { if (count >= 0) return StepView(view, count, 0, 1, 1); else return StepView(view, -count, -1, 1, -1); } View_p CloneView (View_p view) { return NewView(V_Meta(view)); } View_p PairView (View_p view1, View_p view2) { int c, rows1 = ViewSize(view1), rows2 = ViewSize(view2); View_p meta, result; if (rows2 < rows1) view1 = FirstView(view1, rows2); else if (rows1 < rows2) view2 = FirstView(view2, rows1); else if (ViewWidth(view2) == 0) return view1; else if (ViewWidth(view1) == 0) return view2; meta = ConcatView(V_Meta(view1), V_Meta(view2)); result = NewView(meta); for (c = 0; c < ViewWidth(view1); ++c) SetViewCols(result, c, 1, ViewCol(view1, c)); for (c = 0; c < ViewWidth(view2); ++c) SetViewCols(result, ViewWidth(view1) + c, 1, ViewCol(view2, c)); return result; } static void ViewStructure (View_p meta, Buffer_p buffer) { int c, cols = ViewSize(meta); for (c = 0; c < cols; ++c) { char type = GetColType(meta, c); if (type == 'V') { View_p submeta = GetViewItem(meta, c, MC_subv, IT_view).v; if (ViewSize(submeta) > 0) { AddToBuffer(buffer, "(", 1); ViewStructure(submeta, buffer); AddToBuffer(buffer, ")", 1); continue; } } AddToBuffer(buffer, &type, 1); } } int MetaIsCompatible (View_p meta1, View_p meta2) { if (meta1 != meta2) { int c, cols = ViewSize(meta1); if (cols != ViewSize(meta2)) return 0; for (c = 0; c < cols; ++c) { char type = GetColType(meta1, c); if (type != GetColType(meta2, c)) return 0; if (type == 'V') { View_p v1 = GetViewItem(meta1, c, MC_subv, IT_view).v; View_p v2 = GetViewItem(meta2, c, MC_subv, IT_view).v; if (!MetaIsCompatible(v1, v2)) return 0; } } } return 1; } int ViewCompare (View_p view1, View_p view2) { int f, r, rows1, rows2; if (view1 == view2) return 0; f = ViewCompare(V_Meta(view1), V_Meta(view2)); if (f != 0) return f; rows1 = ViewSize(view1); rows2 = ViewSize(view2); for (r = 0; r < rows1; ++r) { if (r >= rows2) return 1; f = RowCompare(view1, r, view2, r); if (f != 0) return f < 0 ? -1 : 1; } return rows1 < rows2 ? -1 : 0; } View_p MakeIntColMeta (const char *name) { View_p result, subv; Seq_p names, types, subvs; names = NewStrVec(1); AppendToStrVec(name, -1, names); types = NewStrVec(1); AppendToStrVec("I", -1, types); subv = EmptyMetaView(); subvs = NewSeqVec(IT_view, &subv, 1); result = NewView(V_Meta(EmptyMetaView())); SetViewSeqs(result, MC_name, 1, FinishStrVec(names)); SetViewSeqs(result, MC_type, 1, FinishStrVec(types)); SetViewSeqs(result, MC_subv, 1, subvs); return result; } View_p TagView (View_p view, const char* name) { View_p tagview; tagview = NewView(MakeIntColMeta(name)); SetViewCols(tagview, 0, 1, NewIotaColumn(ViewSize(view))); return PairView(view, tagview); } View_p DescAsMeta (const char** desc, const char* end) { int c, len, cols = 0, namebytes = 0; char sep, *buf, *ptr, **strings; Seq_p *views, tempseq; struct Buffer names, types, subvs; View_p result, empty; InitBuffer(&names); InitBuffer(&types); InitBuffer(&subvs); len = end - *desc; buf = memcpy(malloc(len+1), *desc, len); buf[len] = ','; empty = EmptyMetaView(); result = NewView(V_Meta(empty)); for (ptr = buf; ptr < buf + len; ++ptr) { const char *s = ptr; while (strchr(":,[]", *ptr) == 0) ++ptr; sep = *ptr; *ptr = 0; ADD_PTR_TO_BUF(names, s); namebytes += ptr - s + 1; switch (sep) { case '[': ADD_PTR_TO_BUF(types, "V"); ++ptr; ADD_PTR_TO_BUF(subvs, DescAsMeta((const char**) &ptr, buf + len)); sep = *++ptr; break; case ':': ptr += 2; sep = *ptr; *ptr = 0; ADD_PTR_TO_BUF(types, ptr - 1); ADD_PTR_TO_BUF(subvs, empty); break; default: ADD_PTR_TO_BUF(types, "S"); ADD_PTR_TO_BUF(subvs, empty); break; } ++cols; if (sep != ',') break; } strings = BufferAsPtr(&names, 1); tempseq = NewStrVec(1); for (c = 0; c < cols; ++c) AppendToStrVec(strings[c], -1, tempseq); SetViewSeqs(result, MC_name, 1, FinishStrVec(tempseq)); ReleaseBuffer(&names, 0); strings = BufferAsPtr(&types, 1); tempseq = NewStrVec(1); for (c = 0; c < cols; ++c) AppendToStrVec(strings[c], -1, tempseq); SetViewSeqs(result, MC_type, 1, FinishStrVec(tempseq)); ReleaseBuffer(&types, 0); views = BufferAsPtr(&subvs, 1); tempseq = NewSeqVec(IT_view, views, cols); SetViewSeqs(result, MC_subv, 1, tempseq); ReleaseBuffer(&subvs, 0); free(buf); *desc += ptr - buf; return result; } View_p DescToMeta (const char *desc) { int len; const char *end; View_p meta; len = strlen(desc); end = desc + len; meta = DescAsMeta(&desc, end); if (desc < end) return NULL; return meta; } ItemTypes DataCmd_VX (Item args[]) { View_p meta, view; int c, cols, objc; const Object_p *objv; Column column; meta = args[0].v; cols = ViewSize(meta); objv = (const void*) args[1].u.ptr; objc = args[1].u.len; if (objc != cols) { args->e = EC_wnoa; return IT_error; } view = NewView(meta); for (c = 0; c < cols; ++c) { column = CoerceColumn(ViewColType(view, c), objv[c]); if (column.seq == NULL) return IT_unknown; SetViewCols(view, c, 1, column); } args->v = view; return IT_view; } ItemTypes StructDescCmd_V (Item args[]) { struct Buffer buffer; Item item; InitBuffer(&buffer); MetaAsDesc(V_Meta(args[0].v), &buffer); AddToBuffer(&buffer, "", 1); item.s = BufferAsPtr(&buffer, 1); args->o = ItemAsObj(IT_string, &item); ReleaseBuffer(&buffer, 0); return IT_object; } ItemTypes StructureCmd_V (Item args[]) { struct Buffer buffer; Item item; InitBuffer(&buffer); ViewStructure(V_Meta(args[0].v), &buffer); AddToBuffer(&buffer, "", 1); item.s = BufferAsPtr(&buffer, 1); args->o = ItemAsObj(IT_string, &item); ReleaseBuffer(&buffer, 0); return IT_object; } /* %include% */ /* wrap_gen.c - generated code, do not edit */ #include ItemTypes BlockedCmd_V (Item_p a) { a[0].v = BlockedView(a[0].v); return IT_view; } ItemTypes CloneCmd_V (Item_p a) { a[0].v = CloneView(a[0].v); return IT_view; } ItemTypes CoerceCmd_OS (Item_p a) { a[0].c = CoerceCmd(a[0].o, a[1].s); return IT_column; } ItemTypes ColMapCmd_Vn (Item_p a) { a[0].v = ColMapView(a[0].v, a[1].c); return IT_view; } ItemTypes ColOmitCmd_Vn (Item_p a) { a[0].v = ColOmitView(a[0].v, a[1].c); return IT_view; } ItemTypes CompareCmd_VV (Item_p a) { a[0].i = ViewCompare(a[0].v, a[1].v); return IT_int; } ItemTypes CompatCmd_VV (Item_p a) { a[0].i = ViewCompat(a[0].v, a[1].v); return IT_int; } ItemTypes ConcatCmd_VV (Item_p a) { a[0].v = ConcatView(a[0].v, a[1].v); return IT_view; } ItemTypes CountsColCmd_C (Item_p a) { a[0].c = NewCountsColumn(a[0].c); return IT_column; } ItemTypes CountViewCmd_I (Item_p a) { a[0].v = NoColumnView(a[0].i); return IT_view; } ItemTypes FirstCmd_VI (Item_p a) { a[0].v = FirstView(a[0].v, a[1].i); return IT_view; } ItemTypes GetColCmd_VN (Item_p a) { a[0].c = ViewCol(a[0].v, a[1].i); return IT_column; } ItemTypes GetInfoCmd_VVI (Item_p a) { a[0].c = GetHashInfo(a[0].v, a[1].v, a[2].i); return IT_column; } ItemTypes GroupCmd_VnS (Item_p a) { a[0].v = GroupCol(a[0].v, a[1].c, a[2].s); return IT_view; } ItemTypes GroupedCmd_ViiS (Item_p a) { a[0].v = GroupedView(a[0].v, a[1].c, a[2].c, a[3].s); return IT_view; } ItemTypes HashFindCmd_VIViii (Item_p a) { a[0].i = HashDoFind(a[0].v, a[1].i, a[2].v, a[3].c, a[4].c, a[5].c); return IT_int; } ItemTypes HashViewCmd_V (Item_p a) { a[0].c = HashValues(a[0].v); return IT_column; } ItemTypes IjoinCmd_VV (Item_p a) { a[0].v = IjoinView(a[0].v, a[1].v); return IT_view; } ItemTypes IotaCmd_I (Item_p a) { a[0].c = NewIotaColumn(a[0].i); return IT_column; } ItemTypes IsectMapCmd_VV (Item_p a) { a[0].c = IntersectMap(a[0].v, a[1].v); return IT_column; } ItemTypes JoinCmd_VVS (Item_p a) { a[0].v = JoinView(a[0].v, a[1].v, a[2].s); return IT_view; } ItemTypes LastCmd_VI (Item_p a) { a[0].v = LastView(a[0].v, a[1].i); return IT_view; } ItemTypes MdefCmd_O (Item_p a) { a[0].v = ObjAsMetaView(a[0].o); return IT_view; } ItemTypes MdescCmd_S (Item_p a) { a[0].v = DescToMeta(a[0].s); return IT_view; } ItemTypes MetaCmd_V (Item_p a) { a[0].v = V_Meta(a[0].v); return IT_view; } ItemTypes OmitMapCmd_iI (Item_p a) { a[0].c = OmitColumn(a[0].c, a[1].i); return IT_column; } ItemTypes OneColCmd_VN (Item_p a) { a[0].v = OneColView(a[0].v, a[1].i); return IT_view; } ItemTypes PairCmd_VV (Item_p a) { a[0].v = PairView(a[0].v, a[1].v); return IT_view; } ItemTypes RemapSubCmd_ViII (Item_p a) { a[0].v = RemapSubview(a[0].v, a[1].c, a[2].i, a[3].i); return IT_view; } ItemTypes ReplaceCmd_VIIV (Item_p a) { a[0].v = ViewReplace(a[0].v, a[1].i, a[2].i, a[3].v); return IT_view; } ItemTypes RowCmpCmd_VIVI (Item_p a) { a[0].i = RowCompare(a[0].v, a[1].i, a[2].v, a[3].i); return IT_int; } ItemTypes RowEqCmd_VIVI (Item_p a) { a[0].i = RowEqual(a[0].v, a[1].i, a[2].v, a[3].i); return IT_int; } ItemTypes RowHashCmd_VI (Item_p a) { a[0].i = RowHash(a[0].v, a[1].i); return IT_int; } ItemTypes SizeCmd_V (Item_p a) { a[0].i = ViewSize(a[0].v); return IT_int; } ItemTypes SortMapCmd_V (Item_p a) { a[0].c = SortMap(a[0].v); return IT_column; } ItemTypes StepCmd_VIIII (Item_p a) { a[0].v = StepView(a[0].v, a[1].i, a[2].i, a[3].i, a[4].i); return IT_view; } ItemTypes StrLookupCmd_Ss (Item_p a) { a[0].i = StringLookup(a[0].s, a[1].c); return IT_int; } ItemTypes TagCmd_VS (Item_p a) { a[0].v = TagView(a[0].v, a[1].s); return IT_view; } ItemTypes TakeCmd_VI (Item_p a) { a[0].v = TakeView(a[0].v, a[1].i); return IT_view; } ItemTypes UngroupCmd_VN (Item_p a) { a[0].v = UngroupView(a[0].v, a[1].i); return IT_view; } ItemTypes UniqueMapCmd_V (Item_p a) { a[0].c = UniqMap(a[0].v); return IT_column; } ItemTypes ViewAsColCmd_V (Item_p a) { a[0].c = ViewAsCol(a[0].v); return IT_column; } ItemTypes WidthCmd_V (Item_p a) { a[0].i = ViewWidth(a[0].v); return IT_int; } /* : append ( VV-V ) over size swap insert ; */ ItemTypes AppendCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; t = SizeCmd_V(a+2); /* swap 1 */ a[3] = a[1]; a[1] = a[2]; a[2] = a[3]; t = InsertCmd_VIV(a); return IT_view; } /* : colconv ( C-C ) ; */ ItemTypes ColConvCmd_C (Item_p a) { return IT_column; } /* : counts ( VN-C ) getcol countscol ; */ ItemTypes CountsCmd_VN (Item_p a) { ItemTypes t; t = GetColCmd_VN(a); t = CountsColCmd_C(a); return IT_column; } /* : delete ( VII-V ) 0 countview replace ; */ ItemTypes DeleteCmd_VII (Item_p a) { ItemTypes t; a[3].i = 0; t = CountViewCmd_I(a+3); t = ReplaceCmd_VIIV(a); return IT_view; } /* : except ( VV-V ) over swap exceptmap remap ; */ ItemTypes ExceptCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; /* swap 1 */ a[3] = a[1]; a[1] = a[2]; a[2] = a[3]; t = ExceptMapCmd_VV(a+1); t = RemapCmd_Vi(a); return IT_view; } /* : exceptmap ( VV-C ) over swap isectmap swap size omitmap ; */ ItemTypes ExceptMapCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; /* swap 1 */ a[3] = a[1]; a[1] = a[2]; a[2] = a[3]; t = IsectMapCmd_VV(a+1); /* swap 0 */ a[2] = a[0]; a[0] = a[1]; a[1] = a[2]; t = SizeCmd_V(a+1); t = OmitMapCmd_iI(a); return IT_column; } /* : insert ( VIV-V ) 0 swap replace ; */ ItemTypes InsertCmd_VIV (Item_p a) { ItemTypes t; a[3].i = 0; /* swap 2 */ a[4] = a[2]; a[2] = a[3]; a[3] = a[4]; t = ReplaceCmd_VIIV(a); return IT_view; } /* : intersect ( VV-V ) over swap isectmap remap ; */ ItemTypes IntersectCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; /* swap 1 */ a[3] = a[1]; a[1] = a[2]; a[2] = a[3]; t = IsectMapCmd_VV(a+1); t = RemapCmd_Vi(a); return IT_view; } /* : namecol ( V-V ) meta 0 onecol ; */ ItemTypes NameColCmd_V (Item_p a) { ItemTypes t; t = MetaCmd_V(a); a[1].i = 0; t = OneColCmd_VN(a); return IT_view; } /* : names ( V-C ) meta 0 getcol ; */ ItemTypes NamesCmd_V (Item_p a) { ItemTypes t; t = MetaCmd_V(a); a[1].i = 0; t = GetColCmd_VN(a); return IT_column; } /* : product ( VV-V ) over over size spread rrot swap size repeat pair ; */ ItemTypes ProductCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; /* over 1 */ a[3] = a[1]; t = SizeCmd_V(a+3); t = SpreadCmd_VI(a+2); /* rrot 0 */ a[3] = a[2]; a[2] = a[1]; a[1] = a[0]; a[0] = a[3]; /* swap 1 */ a[3] = a[1]; a[1] = a[2]; a[2] = a[3]; t = SizeCmd_V(a+2); t = RepeatCmd_VI(a+1); t = PairCmd_VV(a); return IT_view; } /* : remap ( Vi-V ) 0 -1 remapsub ; */ ItemTypes RemapCmd_Vi (Item_p a) { ItemTypes t; a[2].i = 0; a[3].i = -1; t = RemapSubCmd_ViII(a); return IT_view; } /* : repeat ( VI-V ) over size imul 0 1 1 step ; */ ItemTypes RepeatCmd_VI (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; t = SizeCmd_V(a+2); /* imul 1 */ a[1].i *= a[2].i; a[2].i = 0; a[3].i = 1; a[4].i = 1; t = StepCmd_VIIII(a); return IT_view; } /* : reverse ( V-V ) dup size -1 1 -1 step ; */ ItemTypes ReverseCmd_V (Item_p a) { ItemTypes t; /* dup 0 */ a[1] = a[0]; t = SizeCmd_V(a+1); a[2].i = -1; a[3].i = 1; a[4].i = -1; t = StepCmd_VIIII(a); return IT_view; } /* : slice ( VIII-V ) rrot 1 swap step ; */ ItemTypes SliceCmd_VIII (Item_p a) { ItemTypes t; /* rrot 1 */ a[4] = a[3]; a[3] = a[2]; a[2] = a[1]; a[1] = a[4]; a[4].i = 1; /* swap 3 */ a[5] = a[3]; a[3] = a[4]; a[4] = a[5]; t = StepCmd_VIIII(a); return IT_view; } /* : sort ( V-V ) dup sortmap remap ; */ ItemTypes SortCmd_V (Item_p a) { ItemTypes t; /* dup 0 */ a[1] = a[0]; t = SortMapCmd_V(a+1); t = RemapCmd_Vi(a); return IT_view; } /* : spread ( VI-V ) over size 0 rot 1 step ; */ ItemTypes SpreadCmd_VI (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; t = SizeCmd_V(a+2); a[3].i = 0; /* rot 1 */ a[4] = a[1]; a[1] = a[2]; a[2] = a[3]; a[3] = a[4]; a[4].i = 1; t = StepCmd_VIIII(a); return IT_view; } /* : types ( V-C ) meta 1 getcol ; */ ItemTypes TypesCmd_V (Item_p a) { ItemTypes t; t = MetaCmd_V(a); a[1].i = 1; t = GetColCmd_VN(a); return IT_column; } /* : union ( VV-V ) over except concat ; */ ItemTypes UnionCmd_VV (Item_p a) { ItemTypes t; /* over 0 */ a[2] = a[0]; t = ExceptCmd_VV(a+1); t = ConcatCmd_VV(a); return IT_view; } /* : unionmap ( VV-C ) swap exceptmap ; */ ItemTypes UnionMapCmd_VV (Item_p a) { ItemTypes t; /* swap 0 */ a[2] = a[0]; a[0] = a[1]; a[1] = a[2]; t = ExceptMapCmd_VV(a); return IT_column; } /* : unique ( V-V ) dup uniquemap remap ; */ ItemTypes UniqueCmd_V (Item_p a) { ItemTypes t; /* dup 0 */ a[1] = a[0]; t = UniqueMapCmd_V(a+1); t = RemapCmd_Vi(a); return IT_view; } /* : viewconv ( V-V ) ; */ ItemTypes ViewConvCmd_V (Item_p a) { return IT_view; } /* end of generated code */ /* %include% */ /* * cmds.c - Implementation of Tcl-specific operators. */ /* * ext_tcl.h - Definitions needed across the Tcl-specific code. */ #include #include #define USE_TCL_STUBS 1 #include /* colobj.c */ extern Tcl_ObjType f_colObjType; Object_p (ColumnAsObj) (Column column); /* ext_tcl.c */ typedef struct SharedInfo { Tcl_Interp *interp; const struct CmdDispatch *cmds; } SharedInfo; #define Interp() (GetShared()->info->interp) #define DecObjRef Tcl_DecrRefCount Object_p (BufferAsTclList) (Buffer_p bp); Object_p (IncObjRef) (Object_p objPtr); /* viewobj.c */ extern Tcl_ObjType f_viewObjType; int (AdjustCmdDef) (Object_p cmd); Object_p (ViewAsObj) (View_p view); ItemTypes DefCmd_OO (Item args[]) { int argc, c, r, cols, rows; View_p meta, result; Object_p obj, *argv; Column column; struct Buffer buffer; if (MdefCmd_O(args) != IT_view) return IT_error; if (args[0].v == NULL) return IT_view; meta = args[0].v; if (Tcl_ListObjGetElements(Interp(), args[1].o, &argc, &argv) != TCL_OK) return IT_unknown; cols = ViewSize(meta); if (cols == 0) { if (argc != 0) { args->e = EC_cizwv; return IT_error; } args->v = NoColumnView(0); return IT_view; } if (argc % cols != 0) { args->e = EC_nmcw; return IT_error; } result = NewView(meta); rows = argc / cols; for (c = 0; c < cols; ++c) { InitBuffer(&buffer); for (r = 0; r < rows; ++r) ADD_PTR_TO_BUF(buffer, argv[c + cols * r]); obj = BufferAsTclList(&buffer); column = CoerceColumn(ViewColType(result, c), obj); DecObjRef(obj); if (column.seq == NULL) return IT_unknown; SetViewCols(result, c, 1, column); } args->v = result; return IT_view; } static Object_p GetViewRows (View_p view, int row, int rows, int tags) { int r, c, cols; View_p meta; Item item; struct Buffer buf; meta = V_Meta(view); cols = ViewSize(meta); InitBuffer(&buf); for (r = 0; r < rows; ++r) for (c = 0; c < cols; ++c) { if (tags) { item.c = ViewCol(meta, 0); ADD_PTR_TO_BUF(buf, ItemAsObj(GetItem(c, &item), &item)); } item.c = ViewCol(view, c); ADD_PTR_TO_BUF(buf, ItemAsObj(GetItem(r + row, &item), &item)); } return BufferAsTclList(&buf); } static int ColumnNumber(Object_p obj, View_p meta) { int col; const char *name = Tcl_GetString(obj); switch (*name) { case '#': return -2; case '*': return -1; case '-': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (Tcl_GetIntFromObj(Interp(), obj, &col) != TCL_OK) return -3; if (col < 0) col += ViewSize(meta); if (col < 0 || col >= ViewSize(meta)) return -4; break; default: col = StringLookup(name, ViewCol(meta, MC_name)); if (col < 0) return -3; } return col; } ItemTypes GetCmd_VX (Item args[]) { View_p view; int i, objc, r, row, col, rows; const Object_p *objv; ItemTypes currtype; view = args[0].v; currtype = IT_view; objv = (const void*) args[1].u.ptr; objc = args[1].u.len; if (objc == 0) { args->o = GetViewRows(view, 0, ViewSize(view), 0); return IT_object; } for (i = 0; i < objc; ++i) { if (currtype == IT_view) view = args[0].v; else /* TODO: make sure the object does not leak if newly created */ view = ObjAsView(ItemAsObj(currtype, args)); if (view == NULL) return IT_unknown; rows = ViewSize(view); if (Tcl_GetIntFromObj(0, objv[i], &row) != TCL_OK) switch (*Tcl_GetString(objv[i])) { case '@': args->v = V_Meta(view); currtype = IT_view; continue; case '#': args->i = rows; currtype = IT_int; continue; case '*': row = -1; break; default: Tcl_GetIntFromObj(Interp(), objv[i], &row); return IT_unknown; } else if (row < 0) { row += rows; if (row < 0) { args->e = EC_rioor; return IT_error; } } if (++i >= objc) { if (row >= 0) args->o = GetViewRows(view, row, 1, 1); /* one tagged row */ else { struct Buffer buf; InitBuffer(&buf); for (r = 0; r < rows; ++r) ADD_PTR_TO_BUF(buf, GetViewRows(view, r, 1, 0)); args->o = BufferAsTclList(&buf); } return IT_object; } col = ColumnNumber(objv[i], V_Meta(view)); if (row >= 0) switch (col) { default: args->c = ViewCol(view, col); currtype = GetItem(row, args); break; case -1: args->o = GetViewRows(view, row, 1, 0); currtype = IT_object; break; case -2: args->i = row; currtype = IT_int; break; case -3: return IT_unknown; case -4: args->e = EC_cioor; return IT_error; } else switch (col) { default: args->c = ViewCol(view, col); currtype = IT_column; break; case -1: args->o = GetViewRows(view, 0, rows, 0); currtype = IT_object; break; case -2: args->c = NewIotaColumn(rows); currtype = IT_column; break; case -3: return IT_unknown; case -4: args->e = EC_cioor; return IT_error; } } return currtype; } ItemTypes MutInfoCmd_V (Item_p a) { int i; Seq_p mods, *seqs; Object_p result; if (!IsMutable(a[0].v)) return IT_unknown; mods = MutPrepare(a[0].v); seqs = (void*) (mods + 1); result = Tcl_NewListObj(0, NULL); for (i = 0; i < MP_delmap; ++i) Tcl_ListObjAppendElement(NULL, result, ViewAsObj(seqs[i])); for (i = MP_delmap; i < MP_limit; ++i) Tcl_ListObjAppendElement(NULL, result, ColumnAsObj(SeqAsCol(seqs[i]))); a->o = result; return IT_object; } ItemTypes RefsCmd_O (Item args[]) { args->i = args[0].o->refCount; return IT_int; } ItemTypes RenameCmd_VO (Item args[]) { int i, c, objc; View_p meta, view, newmeta, newview; Object_p *objv; Item item; if (Tcl_ListObjGetElements(Interp(), args[1].o, &objc, &objv) != TCL_OK) return IT_unknown; if (objc % 2) { args->e = EC_rambe; return IT_error; } view = args[0].v; meta = V_Meta(view); newmeta = meta; for (i = 0; i < objc; i += 2) { c = ColumnByName(meta, objv[i]); if (c < 0) return IT_unknown; item.s = Tcl_GetString(objv[i+1]); newmeta = ViewSet(newmeta, c, MC_name, &item); } newview = NewView(newmeta); for (c = 0; c < ViewWidth(view); ++c) SetViewCols(newview, c, 1, ViewCol(view, c)); args->v = newview; return IT_view; } ItemTypes ToCmd_OO (Item args[]) { Object_p result; result = Tcl_ObjSetVar2(Interp(), args[1].o, 0, args[0].o, TCL_LEAVE_ERR_MSG); if (result == NULL) return IT_unknown; args->o = result; return IT_object; } ItemTypes TypeCmd_O (Item args[]) { args->s = args[0].o->typePtr != NULL ? args[0].o->typePtr->name : ""; return IT_string; } /* %include% */ /* * colobj.c - Implementation of column objects in Tcl. */ static const char *ErrorMessage(ErrorCodes code) { switch (code) { case EC_cioor: return "column index out of range"; case EC_rioor: return "row index out of range"; case EC_cizwv: return "cannot insert in zero-width view"; case EC_nmcw: return "item count not a multiple of column width"; case EC_rambe: return "rename arg count must be even"; case EC_nalor: return "nead at least one row"; case EC_wnoa: return "wrong number of arguments"; } return "?"; } Object_p ItemAsObj (ItemTypes type, Item_p item) { switch (type) { case IT_int: return Tcl_NewIntObj(item->i); case IT_wide: return Tcl_NewWideIntObj(item->w); case IT_float: return Tcl_NewDoubleObj(item->f); case IT_double: return Tcl_NewDoubleObj(item->d); case IT_string: return Tcl_NewStringObj(item->s, -1); case IT_bytes: return Tcl_NewByteArrayObj(item->u.ptr, item->u.len); case IT_object: return item->o; case IT_column: return ColumnAsObj(item->c); case IT_view: if (item->v == NULL) { Tcl_SetResult(Interp(), "invalid view", TCL_STATIC); return NULL; } return ViewAsObj(item->v); case IT_error: Tcl_SetResult(Interp(), (char*) ErrorMessage(item->e), TCL_STATIC); return NULL; default: Assert(0); return NULL; } } int ColumnByName (View_p meta, Object_p obj) { int colnum; const char *str = Tcl_GetString(obj); switch (*str) { case '#': return -2; case '*': return -3; case '-': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (Tcl_GetIntFromObj(NULL, obj, &colnum) != TCL_OK) return -4; if (colnum < 0) colnum += ViewSize(meta); if (colnum < 0 || colnum >= ViewSize(meta)) return -5; return colnum; default: return StringLookup(str, ViewCol(meta, MC_name)); } } int ObjToItem (ItemTypes type, Item_p item) { switch (type) { case IT_int: return Tcl_GetIntFromObj(Interp(), item->o, &item->i) == TCL_OK; case IT_wide: return Tcl_GetWideIntFromObj(Interp(), item->o, (Tcl_WideInt*) &item->w) == TCL_OK; case IT_float: if (Tcl_GetDoubleFromObj(Interp(), item->o, &item->d) != TCL_OK) return 0; item->f = (float) item->d; break; case IT_double: return Tcl_GetDoubleFromObj(Interp(), item->o, &item->d) == TCL_OK; case IT_string: item->s = Tcl_GetString(item->o); break; case IT_bytes: item->u.ptr = Tcl_GetByteArrayFromObj(item->o, &item->u.len); break; case IT_object: break; case IT_column: item->c = ObjAsColumn(item->o); return item->c.seq != NULL && item->c.seq->count >= 0; case IT_view: item->v = ObjAsView(item->o); return item->v != NULL; default: Assert(0); return 0; } return 1; } #define OBJ_TO_COLUMN_P(o) ((Column*) &(o)->internalRep.twoPtrValue) static void FreeColIntRep (Tcl_Obj *obj) { PUSH_KEEP_REFS DecRefCount(OBJ_TO_COLUMN_P(obj)->seq); POP_KEEP_REFS } static void DupColIntRep (Tcl_Obj *src, Tcl_Obj *dup) { Column_p column = OBJ_TO_COLUMN_P(src); IncRefCount(column->seq); *OBJ_TO_COLUMN_P(dup) = *column; dup->typePtr = &f_colObjType; } static void UpdateColStrRep (Tcl_Obj *obj) { int r; Object_p list; Item item; struct Buffer buf; Column column; PUSH_KEEP_REFS InitBuffer(&buf); column = *OBJ_TO_COLUMN_P(obj); if (column.seq != NULL) for (r = 0; r < column.seq->count; ++r) { item.c = column; ADD_PTR_TO_BUF(buf, ItemAsObj(GetItem(r, &item), &item)); } list = BufferAsTclList(&buf); /* this hack avoids creating a second copy of the string rep */ obj->bytes = Tcl_GetStringFromObj(list, &obj->length); list->bytes = NULL; list->length = 0; DecObjRef(list); POP_KEEP_REFS } #define LO_list data[0].o #define LO_objv data[1].p static void ListObjCleaner (Seq_p seq) { DecObjRef(seq->LO_list); } static ItemTypes ListObjGetter (int row, Item_p item) { const Object_p *objv = item->c.seq->LO_objv; item->o = objv[row]; return IT_object; } static struct SeqType ST_ListObj = { "listobj", ListObjGetter, 0, ListObjCleaner }; static int SetColFromAnyRep (Tcl_Interp *interp, Tcl_Obj *obj) { int objc; Object_p dup, *objv; Seq_p seq; /* must duplicate the list because it'll be kept by ObjAsColumn */ dup = Tcl_DuplicateObj(obj); if (Tcl_ListObjGetElements(interp, dup, &objc, &objv) != TCL_OK) { DecObjRef(dup); return TCL_ERROR; } PUSH_KEEP_REFS seq = IncRefCount(NewSequence(objc, &ST_ListObj, 0)); seq->LO_list = IncObjRef(dup); seq->LO_objv = objv; if (obj->typePtr != NULL && obj->typePtr->freeIntRepProc != NULL) obj->typePtr->freeIntRepProc(obj); *OBJ_TO_COLUMN_P(obj) = SeqAsCol(seq); obj->typePtr = &f_colObjType; POP_KEEP_REFS return TCL_OK; } Tcl_ObjType f_colObjType = { "column", FreeColIntRep, DupColIntRep, UpdateColStrRep, SetColFromAnyRep }; Column ObjAsColumn (Object_p obj) { if (Tcl_ConvertToType(Interp(), obj, &f_colObjType) != TCL_OK) { Column column; column.seq = NULL; column.pos = -1; return column; } return *OBJ_TO_COLUMN_P(obj); } Object_p ColumnAsObj (Column column) { Object_p result; result = Tcl_NewObj(); Tcl_InvalidateStringRep(result); IncRefCount(column.seq); *OBJ_TO_COLUMN_P(result) = column; result->typePtr = &f_colObjType; return result; } /* %include% */ /* * loop.c - Implementation of the Tcl-specific "loop" operator. */ /* TODO: code was copied from v3, needs a lot of cleanup */ typedef struct LoopInfo { int row; Object_p view; View_p v; Object_p cursor; } LoopInfo; typedef struct ColTrace { LoopInfo* lip; int col; Object_p name; int lastRow; } ColTrace; static char* cursor_tracer(ClientData cd, Tcl_Interp* ip, const char *name1, const char *name2, int flags) { ColTrace* ct = (ColTrace*) cd; int row = ct->lip->row; if (row != ct->lastRow) { Object_p o; if (ct->col < 0) o = Tcl_NewIntObj(row); else { Item item; item.c = ViewCol(ct->lip->v, ct->col); o = ItemAsObj(GetItem(row, &item), &item); } if (Tcl_ObjSetVar2(ip, ct->lip->cursor, ct->name, o, 0) == 0) return "cursor_tracer?"; ct->lastRow = row; } return 0; } static int loop_vop(int oc, Tcl_Obj* const* ov) { LoopInfo li; const char *cur; struct Buffer result; int type, e = TCL_OK; static const char *options[] = { "-where", "-index", "-collect", 0 }; enum { eLOOP = -1, eWHERE, eINDEX, eCOLLECT }; if (oc < 2 || oc > 4) { Tcl_WrongNumArgs(Interp(), 1, ov, "view ?arrayName? ?-type? body"); return TCL_ERROR; } li.v = ObjAsView(ov[0]); if (li.v == NULL) return TCL_ERROR; --oc; ++ov; if (oc > 1 && *Tcl_GetString(*ov) != '-') { li.cursor = *ov++; --oc; } else li.cursor = Tcl_NewObj(); cur = Tcl_GetString(IncObjRef(li.cursor)); if (Tcl_GetIndexFromObj(0, *ov, options, "", 0, &type) == TCL_OK) { --oc; ++ov; } else type = eLOOP; { int i, nr = ViewSize(li.v), nc = ViewWidth(li.v); ColTrace* ctab = (ColTrace*) ckalloc((nc + 1) * sizeof(ColTrace)); InitBuffer(&result); for (i = 0; i <= nc; ++i) { ColTrace* ctp = ctab + i; ctp->lip = &li; ctp->lastRow = -1; if (i < nc) { ctp->col = i; ctp->name = Tcl_NewStringObj(GetColItem(i, ViewCol(V_Meta(li.v), MC_name), IT_string).s, -1); } else { ctp->col = -1; ctp->name = Tcl_NewStringObj("#", -1); } e = Tcl_TraceVar2(Interp(), cur, Tcl_GetString(ctp->name), TCL_TRACE_READS, cursor_tracer, (ClientData) ctp); } if (e == TCL_OK) switch (type) { case eLOOP: for (li.row = 0; li.row < nr; ++li.row) { e = Tcl_EvalObj(Interp(), *ov); if (e == TCL_CONTINUE) e = TCL_OK; else if (e != TCL_OK) { if (e == TCL_BREAK) e = TCL_OK; else if (e == TCL_ERROR) { char msg[50]; sprintf(msg, "\n (\"loop\" body line %d)", Interp()->errorLine); Tcl_AddObjErrorInfo(Interp(), msg, -1); } break; } } break; case eWHERE: case eINDEX: for (li.row = 0; li.row < nr; ++li.row) { int f; e = Tcl_ExprBooleanObj(Interp(), *ov, &f); if (e != TCL_OK) break; if (f) ADD_INT_TO_BUF(result, li.row); } break; case eCOLLECT: for (li.row = 0; li.row < nr; ++li.row) { Object_p o; e = Tcl_ExprObj(Interp(), *ov, &o); if (e != TCL_OK) break; ADD_PTR_TO_BUF(result, o); } break; default: Assert(0); return TCL_ERROR; } for (i = 0; i <= nc; ++i) { ColTrace* ctp = ctab + i; Tcl_UntraceVar2(Interp(), cur, Tcl_GetString(ctp->name), TCL_TRACE_READS, cursor_tracer, (ClientData) ctp); DecObjRef(ctp->name); } ckfree((char*) ctab); if (e == TCL_OK) switch (type) { case eWHERE: case eINDEX: { Column map = SeqAsCol(BufferAsIntVec(&result)); if (type == eWHERE) Tcl_SetObjResult(Interp(), ViewAsObj(RemapSubview(li.v, map, 0, -1))); else Tcl_SetObjResult(Interp(), ColumnAsObj(map)); break; } case eCOLLECT: { Tcl_SetObjResult(Interp(), BufferAsTclList(&result)); break; } default: ReleaseBuffer(&result, 0); } } DecObjRef(li.cursor); return e; } ItemTypes LoopCmd_X (Item args[]) { int objc; const Object_p *objv; objv = (const void*) args[0].u.ptr; objc = args[0].u.len; if (loop_vop(objc, objv) != TCL_OK) return IT_unknown; args->o = Tcl_GetObjResult(Interp()); return IT_object; } /* %include% */ /* * viewobj.c - Implementation of view objects in Tcl. */ #define DEP_DEBUG 0 #define OBJ_TO_VIEW_P(o) ((o)->internalRep.twoPtrValue.ptr1) #define OBJ_TO_ORIG_P(o) ((o)->internalRep.twoPtrValue.ptr2) #define OBJ_TO_ORIG_CNT(o) (((Seq_p) OBJ_TO_ORIG_P(o))->OR_objc) #define OBJ_TO_ORIG_VEC(o) ((Object_p*) ((Seq_p) OBJ_TO_ORIG_P(o) + 1)) #define OR_depx data[0].o #define OR_objc data[1].i #define OR_depc data[2].i #define OR_depv data[3].p /* forward */ static void SetupViewObj (Object_p, View_p, int objc, Object_p *objv, Object_p); static void ClearViewObj (Object_p obj); static void FreeViewIntRep (Tcl_Obj *obj) { PUSH_KEEP_REFS Assert(((Seq_p) OBJ_TO_ORIG_P(obj))->refs == 1); ClearViewObj(obj); DecRefCount(OBJ_TO_VIEW_P(obj)); DecRefCount(OBJ_TO_ORIG_P(obj)); POP_KEEP_REFS } static void DupViewIntRep (Tcl_Obj *src, Tcl_Obj *dup) { Assert(0); } static void UpdateViewStrRep (Tcl_Obj *obj) { int length; const char *string; Object_p origobj; PUSH_KEEP_REFS /* TODO: avoid creating a Tcl list and copying the string, use a buffer */ origobj = Tcl_NewListObj(OBJ_TO_ORIG_CNT(obj), OBJ_TO_ORIG_VEC(obj)); string = Tcl_GetStringFromObj(origobj, &length); obj->bytes = strcpy(ckalloc(length+1), string); obj->length = length; DecObjRef(origobj); POP_KEEP_REFS } static char *RefTracer (ClientData cd, Tcl_Interp *interp, const char *name1, const char *name2, int flags) { Object_p obj = (Object_p) cd; #if DEBUG+0 DbgIf(DBG_trace) printf(" rt %p var: %s\n", (void*) obj, name1); #endif if (flags && TCL_TRACE_WRITES) { Tcl_UntraceVar2(Interp(), name1, name2, TCL_TRACE_WRITES | TCL_TRACE_UNSETS | TCL_GLOBAL_ONLY, RefTracer, obj); } InvalidateView(obj); DecObjRef(obj); return NULL; } static int SetViewFromAnyRep (Tcl_Interp *interp, Tcl_Obj *obj) { int e = TCL_ERROR, objc, rows; Object_p *objv; View_p view; if (Tcl_ListObjGetElements(interp, obj, &objc, &objv) != TCL_OK) return TCL_ERROR; PUSH_KEEP_REFS switch (objc) { case 0: view = EmptyMetaView(); SetupViewObj(obj, view, objc, objv, NULL); break; case 1: if (Tcl_GetIntFromObj(interp, objv[0], &rows) == TCL_OK && rows >= 0) { view = NoColumnView(rows); SetupViewObj(obj, view, objc, objv, NULL); } else { Object_p o; const char *var = Tcl_GetString(objv[0]) + 1; if (var[-1] != '@') goto FAIL; #if DEBUG+0 DbgIf(DBG_trace) printf("svfar %p var: %s\n", (void*) obj, var); #endif o = (Object_p) Tcl_VarTraceInfo(Interp(), var, TCL_GLOBAL_ONLY, RefTracer, NULL); if (o == NULL) { o = Tcl_GetVar2Ex(interp, var, NULL, TCL_LEAVE_ERR_MSG | TCL_GLOBAL_ONLY); if (o == NULL) goto FAIL; o = NeedMutable(o); Assert(o != NULL); if (Tcl_TraceVar2(interp, var, 0, TCL_TRACE_WRITES|TCL_TRACE_UNSETS|TCL_GLOBAL_ONLY, RefTracer, IncObjRef(o)) != TCL_OK) goto FAIL; } view = ObjAsView(o); Assert(view != NULL); SetupViewObj(obj, view, objc, objv, /*o*/ NULL); } break; default: { Object_p cmd; Tcl_SavedResult state; Assert(interp != NULL); Tcl_SaveResult(interp, &state); cmd = IncObjRef(Tcl_DuplicateObj(obj)); view = NULL; /* def -> cmd namespace name conv can prob be avoided in Tcl 8.5 */ if (AdjustCmdDef(cmd) == TCL_OK) { int ac; Object_p *av; Tcl_ListObjGetElements(NULL, cmd, &ac, &av); /* don't use Tcl_EvalObjEx, it forces a string conversion */ if (Tcl_EvalObjv(interp, ac, av, TCL_EVAL_GLOBAL) == TCL_OK) { /* result to view, may call EvalIndirectView recursively */ view = ObjAsView(Tcl_GetObjResult(interp)); } } DecObjRef(cmd); if (view == NULL) { Tcl_DiscardResult(&state); goto FAIL; } SetupViewObj(obj, view, objc, objv, NULL); Tcl_RestoreResult(interp, &state); } } e = TCL_OK; FAIL: POP_KEEP_REFS return e; } Tcl_ObjType f_viewObjType = { "view", FreeViewIntRep, DupViewIntRep, UpdateViewStrRep, SetViewFromAnyRep }; View_p ObjAsView (Object_p obj) { if (Tcl_ConvertToType(Interp(), obj, &f_viewObjType) != TCL_OK) return NULL; return OBJ_TO_VIEW_P(obj); } static void AddDependency (Object_p obj, Object_p child) { Object_p *deps; Seq_p origin = OBJ_TO_ORIG_P(obj); #if DEBUG+0 DbgIf(DBG_deps) printf(" +dep %p %p\n", (void*) obj, (void*) child); #endif if (origin->OR_depv == NULL) origin->OR_depv = calloc(10, sizeof(Object_p)); Assert(origin->OR_depc < 10); deps = origin->OR_depv; deps[origin->OR_depc++] = child; } static void RemoveDependency (Object_p obj, Object_p child) { Object_p *deps; Seq_p origin = OBJ_TO_ORIG_P(obj); #if DEBUG+0 DbgIf(DBG_deps) printf(" -dep %p %p\n", (void*) obj, (void*) child); #endif deps = origin->OR_depv; Assert(deps != NULL); if (deps != NULL) { int i; /* removed from end in case we're called from the invalidation loop */ for (i = origin->OR_depc; --i >= 0; ) if (deps[i] == child) break; /*printf(" -> i %d n %d\n", i, origin->OR_depc);*/ Assert(i < origin->OR_depc); deps[i] = deps[--origin->OR_depc]; if (origin->OR_depc == 0) { free(deps); origin->OR_depv = NULL; } } } void InvalidateView (Object_p obj) { Object_p *deps; Seq_p origin = OBJ_TO_ORIG_P(obj); #if DEP_DEBUG+0 printf("inval %p deps %d refs %d\n", (void*) obj, origin->OR_depc, obj->refCount); #endif if (obj->typePtr != &f_viewObjType) return; deps = origin->OR_depv; if (deps != NULL) { /* careful, RemoveDependency will remove the item during iteration */ while (origin->OR_depc > 0) { int last = origin->OR_depc - 1; InvalidateView(deps[last]); Assert(origin->OR_depc <= last); /* make sure count went down */ } Assert(origin->OR_depv == NULL); } #if 1 Assert(obj->typePtr == &f_viewObjType); Tcl_GetString(obj); FreeViewIntRep(obj); obj->typePtr = NULL; #else /* FIXME: hack to allow changes to list, even when the object is shared! */ { Object_p nobj = Tcl_NewListObj(OBJ_TO_ORIG_CNT(obj), OBJ_TO_ORIG_VEC(obj)); DecRefCount(OBJ_TO_VIEW_P(obj)); DecRefCount(origin); obj->typePtr = nobj->typePtr; obj->internalRep = nobj->internalRep; nobj->typePtr = NULL; DecObjRef(nobj); /*Tcl_InvalidateStringRep(obj);*/ } #endif } #if 0 static void OriginCleaner (Seq_p seq) { int i, items = seq->OR_objc; const Object_p *objv = (const void*) (seq + 1); for (i = 0; i < items; ++i) DecObjRef(objv[i]); Assert(seq->OR_depc == 0); Assert(seq->OR_depv == NULL); } static ItemTypes OriginGetter (int row, Item_p item) { const Object_p *objv = (const void*) (item->c.seq + 1); item->o = objv[row]; return IT_object; } #endif static struct SeqType ST_Origin = { "origin", NULL, 0, NULL }; static void SetupViewObj (Object_p obj, View_p view, int objc, Object_p *objv, Object_p extradep) { int i; Object_p *vals; Seq_p origin; origin = NewSequenceNoRef(objc, &ST_Origin, objc * sizeof(Object_p)); /* data[0] is a pointer to the reference for "@..." references */ /* data[1] has the number of extra bytes, i.e. objc * sizeof (Seq_p) */ /* data[2] is the dependency count */ /* data[3] is the dependency vector if data[2].i > 0 */ origin->OR_depx = extradep; origin->OR_objc = objc; vals = (void*) (origin + 1); for (i = 0; i < objc; ++i) vals[i] = IncObjRef(objv[i]); if (obj->typePtr != NULL && obj->typePtr->freeIntRepProc != NULL) obj->typePtr->freeIntRepProc(obj); OBJ_TO_VIEW_P(obj) = IncRefCount(view); OBJ_TO_ORIG_P(obj) = IncRefCount(origin); obj->typePtr = &f_viewObjType; for (i = 0; i < objc; ++i) if (vals[i]->typePtr == &f_viewObjType) AddDependency(vals[i], obj); if (extradep != NULL) AddDependency(extradep, obj); } static void ClearViewObj (Object_p obj) { int i, objc; Object_p *objv; Seq_p origin = OBJ_TO_ORIG_P(obj); /* can't have any child dependencies at this stage */ Assert(origin->OR_depc == 0); Assert(origin->OR_depv == NULL); objc = OBJ_TO_ORIG_CNT(obj); objv = OBJ_TO_ORIG_VEC(obj); for (i = 0; i < objc; ++i) { if (objv[i]->typePtr == &f_viewObjType) RemoveDependency(objv[i], obj); DecObjRef(objv[i]); } if (origin->OR_depx != NULL) RemoveDependency(origin->OR_depx, obj); } static Object_p MetaViewAsObj (View_p meta) { char typeCh; int width, rowNum; Object_p result, fieldobj; View_p subv; Column names, types, subvs; names = ViewCol(meta, MC_name); types = ViewCol(meta, MC_type); subvs = ViewCol(meta, MC_subv); result = Tcl_NewListObj(0, NULL); width = ViewSize(meta); for (rowNum = 0; rowNum < width; ++rowNum) { fieldobj = Tcl_NewStringObj(GetColItem(rowNum, names, IT_string).s, -1); /* this ignores all but the first character of the type */ typeCh = *GetColItem(rowNum, types, IT_string).s; switch (typeCh) { case 'S': break; case 'V': subv = GetColItem(rowNum, subvs, IT_view).v; fieldobj = Tcl_NewListObj(1, &fieldobj); Tcl_ListObjAppendElement(NULL, fieldobj, MetaViewAsObj(subv)); break; default: Tcl_AppendToObj(fieldobj, ":", 1); Tcl_AppendToObj(fieldobj, &typeCh, 1); break; } Tcl_ListObjAppendElement(NULL, result, fieldobj); } return result; } Object_p ViewAsObj (View_p view) { View_p meta = V_Meta(view); int c, rows = ViewSize(view), cols = ViewSize(meta); Object_p result; struct Buffer buffer; InitBuffer(&buffer); if (meta == V_Meta(meta)) { if (rows > 0) { ADD_PTR_TO_BUF(buffer, Tcl_NewStringObj("mdef", 4)); ADD_PTR_TO_BUF(buffer, MetaViewAsObj(view)); } } else { if (cols == 0) { ADD_PTR_TO_BUF(buffer, Tcl_NewIntObj(rows)); } else { ADD_PTR_TO_BUF(buffer, Tcl_NewStringObj("data", 4)); ADD_PTR_TO_BUF(buffer, ViewAsObj(meta)); for (c = 0; c < cols; ++c) ADD_PTR_TO_BUF(buffer, ColumnAsObj(ViewCol(view, c))); } } result = Tcl_NewObj(); Tcl_InvalidateStringRep(result); SetupViewObj(result, view, BufferFill(&buffer) / sizeof(Object_p), BufferAsPtr(&buffer, 1), NULL); ReleaseBuffer(&buffer, 0); return result; } View_p ObjAsMetaView (Object_p obj) { int r, rows, objc; Object_p names, types, subvs, *objv, entry, nameobj, subvobj; const char *name, *sep, *type; View_p view = NULL; if (Tcl_ListObjLength(Interp(), obj, &rows) != TCL_OK) return NULL; names = Tcl_NewListObj(0, 0); types = Tcl_NewListObj(0, 0); subvs = Tcl_NewListObj(0, 0); for (r = 0; r < rows; ++r) { Tcl_ListObjIndex(NULL, obj, r, &entry); if (Tcl_ListObjGetElements(Interp(), entry, &objc, &objv) != TCL_OK || objc < 1 || objc > 2) goto DONE; name = Tcl_GetString(objv[0]); sep = strchr(name, ':'); type = objc > 1 ? "V" : "S"; if (sep != NULL) { if (sep[1] != 0) { if (strchr("BDFLISV", sep[1]) == NULL) goto DONE; type = sep+1; } nameobj= Tcl_NewStringObj(name, sep - name); } else nameobj = objv[0]; if (objc > 1) { view = ObjAsMetaView(objv[1]); if (view == NULL) goto DONE; subvobj = ViewAsObj(view); } else subvobj = Tcl_NewObj(); Tcl_ListObjAppendElement(NULL, names, nameobj); Tcl_ListObjAppendElement(NULL, types, Tcl_NewStringObj(type, -1)); Tcl_ListObjAppendElement(NULL, subvs, subvobj); } view = NewView(V_Meta(EmptyMetaView())); SetViewCols(view, MC_name, 1, CoerceColumn(IT_string, names)); SetViewCols(view, MC_type, 1, CoerceColumn(IT_string, types)); SetViewCols(view, MC_subv, 1, CoerceColumn(IT_view, subvs)); DONE: DecObjRef(names); DecObjRef(types); DecObjRef(subvs); return view; } Object_p NeedMutable (Object_p obj) { int objc; Object_p *objv; View_p view; view = ObjAsView(obj); if (view == NULL) return NULL; if (IsMutable(view)) return obj; objc = OBJ_TO_ORIG_CNT(obj); objv = OBJ_TO_ORIG_VEC(obj); if (objc == 1 && *Tcl_GetString(objv[0]) == '@') { const char *var = Tcl_GetString(objv[0]) + 1; Object_p o = (Object_p) Tcl_VarTraceInfo(Interp(), var, TCL_GLOBAL_ONLY, RefTracer, NULL); Assert(o != NULL); return o; } if (objc > 1 && strcmp(Tcl_GetString(objv[0]), "get") == 0) { Object_p origdef, tmp = NeedMutable(objv[1]); /* recursive */ Assert(tmp != NULL); origdef = Tcl_NewListObj(objc, objv); Tcl_ListObjReplace(NULL, origdef, 1, 1, 1, &tmp); return origdef; } return obj; } static void ListOneDep (Buffer_p buf, Object_p obj) { Object_p o, vec[3]; if (obj->typePtr == &f_viewObjType) { View_p view = OBJ_TO_VIEW_P(obj); Seq_p seq = ViewCol(view, 0).seq; vec[0] = Tcl_NewStringObj(seq != NULL ? seq->type->name : "", -1); vec[1] = MetaViewAsObj(V_Meta(view)); vec[2] = Tcl_NewIntObj(ViewSize(view)); o = Tcl_NewListObj(3, vec); } else if (Tcl_ListObjIndex(NULL, obj, 0, &o) != TCL_OK) o = Tcl_NewStringObj("?", 1); ADD_PTR_TO_BUF(*buf, o); } ItemTypes DepsCmd_O (Item_p a) { int i; Object_p obj, *objv; Seq_p origin; struct Buffer buffer; obj = a[0].o; ObjAsView(obj); if (obj->typePtr != &f_viewObjType) return IT_unknown; InitBuffer(&buffer); origin = OBJ_TO_ORIG_P(obj); objv = OBJ_TO_ORIG_VEC(obj); if (origin->OR_depx != NULL) ListOneDep(&buffer, origin->OR_depx); else ADD_PTR_TO_BUF(buffer, Tcl_NewStringObj("-", 1)); for (i = 0; i < origin->OR_depc; ++i) ListOneDep(&buffer, objv[i]); a->o = BufferAsTclList(&buffer); return IT_object; } /* %include% */ /* * ext_tcl.c - Interface to the Tcl scripting language. */ #ifndef PACKAGE_VERSION #define PACKAGE_VERSION "4" #endif /* stub interface code, removes the need to link with libtclstub*.a */ #if STATIC_BUILD+0 #define MyInitStubs(x) 1 #else /* * stubs.h - Internal stub code, adapted from CritLib */ TclStubs *tclStubsPtr = NULL; TclPlatStubs *tclPlatStubsPtr = NULL; struct TclIntStubs *tclIntStubsPtr = NULL; struct TclIntPlatStubs *tclIntPlatStubsPtr = NULL; static int MyInitStubs (Tcl_Interp *ip) { typedef struct HeadOfInterp { char *result; Tcl_FreeProc *freeProc; int errorLine; TclStubs *stubTable; } HeadOfInterp; HeadOfInterp *hoi = (HeadOfInterp*) ip; if (hoi->stubTable == NULL || hoi->stubTable->magic != TCL_STUB_MAGIC) { ip->result = "This extension requires stubs-support."; ip->freeProc = TCL_STATIC; return 0; } tclStubsPtr = hoi->stubTable; if (Tcl_PkgRequire(ip, "Tcl", "8.1", 0) == NULL) { tclStubsPtr = NULL; return 0; } if (tclStubsPtr->hooks != NULL) { tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs; tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs; tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs; } return 1; } #endif #if NO_THREAD_CALLS+0 Shared_p GetShared (void) { static struct Shared data; return &data; } #define UngetShared Tcl_CreateExitHandler #else static Tcl_ThreadDataKey tls_data; Shared_p GetShared (void) { return (Shared_p) Tcl_GetThreadData(&tls_data, sizeof(struct Shared)); } #define UngetShared Tcl_CreateThreadExitHandler #endif typedef struct CmdDispatch { const char *name, *args; ItemTypes (*proc) (Item_p); } CmdDispatch; static CmdDispatch f_commands[] = { /* opdefs_gen.h - generated code, do not edit */ /* 94 definitions generated for Tcl: # name in out inline-code : drop U {} {} : dup U UU {$1 = $0;} : imul II I {$0.i *= $1.i;} : nip UU U {$0 = $1;} : over UU UUU {$2 = $0;} : rot UUU UUU {$3 = $0; $0 = $1; $1 = $2; $2 = $3;} : rrot UUU UUU {$3 = $2; $2 = $1; $1 = $0; $0 = $3;} : swap UU UU {$2 = $0; $0 = $1; $1 = $2;} : tuck UU UUU {$1 = $2; $0 = $1; $2 = $0;} tcl { # name in out : Def OO V : Deps O O : Emit V O : EmitMods V O : Get VX U : Load O V : LoadMods OV V : Loop X O : MutInfo V O : Ref OX O : Refs O I : Rename VO V : Save VS I : To OO O : Type O O : View X O } python { # name in out } ruby { # name in out : AtRow OI O } lua { # name in out } objc { # name in out : At VIO O } # name in out : BitRuns i C : Data VX V : Debug I I : HashCol SO C : Max VN O : Min VN O : Open S V : ResizeCol iII C : Set MIX V : StructDesc V S : Structure V S : Sum VN O : Write VO I # name in out internal-name : Blocked V V BlockedView : Clone V V CloneView : ColMap Vn V ColMapView : ColOmit Vn V ColOmitView : Coerce OS C CoerceCmd : Compare VV I ViewCompare : Compat VV I ViewCompat : Concat VV V ConcatView : CountsCol C C NewCountsColumn : CountView I V NoColumnView : First VI V FirstView : GetCol VN C ViewCol : Group VnS V GroupCol : HashFind VIViii I HashDoFind : Ijoin VV V IjoinView : GetInfo VVI C GetHashInfo : Grouped ViiS V GroupedView : HashView V C HashValues : IsectMap VV C IntersectMap : Iota I C NewIotaColumn : Join VVS V JoinView : Last VI V LastView : Mdef O V ObjAsMetaView : Mdesc S V DescToMeta : Meta V V V_Meta : OmitMap iI C OmitColumn : OneCol VN V OneColView : Pair VV V PairView : RemapSub ViII V RemapSubview : Replace VIIV V ViewReplace : RowCmp VIVI I RowCompare : RowEq VIVI I RowEqual : RowHash VI I RowHash : Size V I ViewSize : SortMap V C SortMap : Step VIIII V StepView : StrLookup Ss I StringLookup : Tag VS V TagView : Take VI V TakeView : Ungroup VN V UngroupView : UniqueMap V C UniqMap : ViewAsCol V C ViewAsCol : Width V I ViewWidth # name in out compound-definition : Append VV V {over size swap insert} : ColConv C C { } : Counts VN C {getcol countscol} : Delete VII V {0 countview replace} : Except VV V {over swap exceptmap remap} : ExceptMap VV C {over swap isectmap swap size omitmap} : Insert VIV V {0 swap replace} : Intersect VV V {over swap isectmap remap} : NameCol V V {meta 0 onecol} : Names V C {meta 0 getcol} : Product VV V {over over size spread rrot swap size repeat pair} : Repeat VI V {over size imul 0 1 1 step} : Remap Vi V {0 -1 remapsub} : Reverse V V {dup size -1 1 -1 step} : Slice VIII V {rrot 1 swap step} : Sort V V {dup sortmap remap} : Spread VI V {over size 0 rot 1 step} : Types V C {meta 1 getcol} : Unique V V {dup uniquemap remap} : Union VV V {over except concat} : UnionMap VV C {swap exceptmap} : ViewConv V V { } # some operators are omitted from restricted execution environments unsafe Open Save */ { "open", "V:S", OpenCmd_S }, { "save", "I:VS", SaveCmd_VS }, #define UNSAFE 2 { "append", "V:VV", AppendCmd_VV }, { "bitruns", "C:i", BitRunsCmd_i }, { "blocked", "V:V", BlockedCmd_V }, { "clone", "V:V", CloneCmd_V }, { "coerce", "C:OS", CoerceCmd_OS }, { "colconv", "C:C", ColConvCmd_C }, { "colmap", "V:Vn", ColMapCmd_Vn }, { "colomit", "V:Vn", ColOmitCmd_Vn }, { "compare", "I:VV", CompareCmd_VV }, { "compat", "I:VV", CompatCmd_VV }, { "concat", "V:VV", ConcatCmd_VV }, { "counts", "C:VN", CountsCmd_VN }, { "countscol", "C:C", CountsColCmd_C }, { "countview", "V:I", CountViewCmd_I }, { "data", "V:VX", DataCmd_VX }, { "debug", "I:I", DebugCmd_I }, { "def", "V:OO", DefCmd_OO }, { "delete", "V:VII", DeleteCmd_VII }, { "deps", "O:O", DepsCmd_O }, { "emit", "O:V", EmitCmd_V }, { "emitmods", "O:V", EmitModsCmd_V }, { "except", "V:VV", ExceptCmd_VV }, { "exceptmap", "C:VV", ExceptMapCmd_VV }, { "first", "V:VI", FirstCmd_VI }, { "get", "U:VX", GetCmd_VX }, { "getcol", "C:VN", GetColCmd_VN }, { "getinfo", "C:VVI", GetInfoCmd_VVI }, { "group", "V:VnS", GroupCmd_VnS }, { "grouped", "V:ViiS", GroupedCmd_ViiS }, { "hashcol", "C:SO", HashColCmd_SO }, { "hashfind", "I:VIViii", HashFindCmd_VIViii }, { "hashview", "C:V", HashViewCmd_V }, { "ijoin", "V:VV", IjoinCmd_VV }, { "insert", "V:VIV", InsertCmd_VIV }, { "intersect", "V:VV", IntersectCmd_VV }, { "iota", "C:I", IotaCmd_I }, { "isectmap", "C:VV", IsectMapCmd_VV }, { "join", "V:VVS", JoinCmd_VVS }, { "last", "V:VI", LastCmd_VI }, { "load", "V:O", LoadCmd_O }, { "loadmods", "V:OV", LoadModsCmd_OV }, { "loop", "O:X", LoopCmd_X }, { "max", "O:VN", MaxCmd_VN }, { "mdef", "V:O", MdefCmd_O }, { "mdesc", "V:S", MdescCmd_S }, { "meta", "V:V", MetaCmd_V }, { "min", "O:VN", MinCmd_VN }, { "mutinfo", "O:V", MutInfoCmd_V }, { "namecol", "V:V", NameColCmd_V }, { "names", "C:V", NamesCmd_V }, { "omitmap", "C:iI", OmitMapCmd_iI }, { "onecol", "V:VN", OneColCmd_VN }, { "pair", "V:VV", PairCmd_VV }, { "product", "V:VV", ProductCmd_VV }, { "ref", "O:OX", RefCmd_OX }, { "refs", "I:O", RefsCmd_O }, { "remap", "V:Vi", RemapCmd_Vi }, { "remapsub", "V:ViII", RemapSubCmd_ViII }, { "rename", "V:VO", RenameCmd_VO }, { "repeat", "V:VI", RepeatCmd_VI }, { "replace", "V:VIIV", ReplaceCmd_VIIV }, { "resizecol", "C:iII", ResizeColCmd_iII }, { "reverse", "V:V", ReverseCmd_V }, { "rowcmp", "I:VIVI", RowCmpCmd_VIVI }, { "roweq", "I:VIVI", RowEqCmd_VIVI }, { "rowhash", "I:VI", RowHashCmd_VI }, { "set", "V:MIX", SetCmd_MIX }, { "size", "I:V", SizeCmd_V }, { "slice", "V:VIII", SliceCmd_VIII }, { "sort", "V:V", SortCmd_V }, { "sortmap", "C:V", SortMapCmd_V }, { "spread", "V:VI", SpreadCmd_VI }, { "step", "V:VIIII", StepCmd_VIIII }, { "strlookup", "I:Ss", StrLookupCmd_Ss }, { "structdesc", "S:V", StructDescCmd_V }, { "structure", "S:V", StructureCmd_V }, { "sum", "O:VN", SumCmd_VN }, { "tag", "V:VS", TagCmd_VS }, { "take", "V:VI", TakeCmd_VI }, { "to", "O:OO", ToCmd_OO }, { "type", "O:O", TypeCmd_O }, { "types", "C:V", TypesCmd_V }, { "ungroup", "V:VN", UngroupCmd_VN }, { "union", "V:VV", UnionCmd_VV }, { "unionmap", "C:VV", UnionMapCmd_VV }, { "unique", "V:V", UniqueCmd_V }, { "uniquemap", "C:V", UniqueMapCmd_V }, { "view", "O:X", ViewCmd_X }, { "viewascol", "C:V", ViewAsColCmd_V }, { "viewconv", "V:V", ViewConvCmd_V }, { "width", "I:V", WidthCmd_V }, { "write", "I:VO", WriteCmd_VO }, /* end of generated code */ { NULL, NULL, NULL } }; Object_p IncObjRef (Object_p objPtr) { Tcl_IncrRefCount(objPtr); return objPtr; } Object_p BufferAsTclList (Buffer_p bp) { int argc; Object_p result; argc = BufferFill(bp) / sizeof(Object_p); result = Tcl_NewListObj(argc, BufferAsPtr(bp, 1)); ReleaseBuffer(bp, 0); return result; } void FailedAssert (const char *msg, const char *file, int line) { Tcl_Panic("Failed assertion at %s, line %d: %s\n", file, line, msg); } ItemTypes RefCmd_OX (Item args[]) { int objc; const Object_p *objv; objv = (const void*) args[1].u.ptr; objc = args[1].u.len; args->o = Tcl_ObjGetVar2(Interp(), args[0].o, 0, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG); return IT_object; } ItemTypes OpenCmd_S (Item args[]) { View_p result; result = OpenDataFile(args[0].s); if (result == NULL) { Tcl_AppendResult(Interp(), "cannot open file: ", args[0].s, NULL); return IT_unknown; } args->v = result; return IT_view; } static void LoadedStringCleaner (MappedFile_p map) { DecObjRef((Object_p) map->data[3].p); } ItemTypes LoadCmd_O (Item args[]) { int len; const char *ptr; View_p view; MappedFile_p map; ptr = (const char*) Tcl_GetByteArrayFromObj(args[0].o, &len); map = InitMappedFile(ptr, len, LoadedStringCleaner); map->data[3].p = IncObjRef(args[0].o); view = MappedToView(map, NULL); if (view == NULL) return IT_unknown; args->v = view; return IT_view; } ItemTypes LoadModsCmd_OV (Item args[]) { int len; const char *ptr; View_p view; MappedFile_p map; ptr = (const char*) Tcl_GetByteArrayFromObj(args[0].o, &len); map = InitMappedFile(ptr, len, LoadedStringCleaner); map->data[3].p = IncObjRef(args[0].o); view = MappedToView(map, args[1].v); if (view == NULL) return IT_unknown; args->v = view; return IT_view; } static void *WriteDataFun(void *chan, const void *ptr, Int_t len) { Tcl_Write(chan, ptr, len); return chan; } ItemTypes SaveCmd_VS (Item args[]) { Int_t bytes; Tcl_Channel chan; chan = Tcl_OpenFileChannel(Interp(), args[1].s, "w", 0666); if (chan == NULL || Tcl_SetChannelOption(Interp(), chan, "-translation", "binary") != TCL_OK) return IT_unknown; bytes = ViewSave(args[0].v, chan, NULL, WriteDataFun, 0); Tcl_Close(Interp(), chan); if (bytes < 0) return IT_unknown; args->w = bytes; return IT_wide; } ItemTypes WriteCmd_VO (Item args[]) { Int_t bytes; Tcl_Channel chan; chan = Tcl_GetChannel(Interp(), Tcl_GetString(args[1].o), NULL); if (chan == NULL || Tcl_SetChannelOption(Interp(), chan, "-translation", "binary") != TCL_OK) return IT_unknown; bytes = ViewSave(args[0].v, chan, NULL, WriteDataFun, 0); if (bytes < 0) return IT_unknown; args->w = bytes; return IT_wide; } #define EmitInitFun ((SaveInitFun) Tcl_SetByteArrayLength) static void *EmitDataFun(void *data, const void *ptr, Int_t len) { memcpy(data, ptr, len); return (char*) data + len; } ItemTypes EmitCmd_V (Item args[]) { Object_p result = Tcl_NewByteArrayObj(NULL, 0); if (ViewSave(args[0].v, result, EmitInitFun, EmitDataFun, 0) < 0) { DecObjRef(result); return IT_unknown; } args->o = result; return IT_object; } ItemTypes EmitModsCmd_V (Item args[]) { Object_p result = Tcl_NewByteArrayObj(NULL, 0); if (ViewSave(args[0].v, result, EmitInitFun, EmitDataFun, 1) < 0) { DecObjRef(result); return IT_unknown; } args->o = result; return IT_object; } int AdjustCmdDef (Object_p cmd) { Object_p origname, newname; Tcl_CmdInfo cmdinfo; /* Use "::vlerq::blah ..." if it exists, else use "vlerq blah ...". */ /* Could perhaps be simplified (optimized?) by using 8.5 ensembles. */ if (Tcl_ListObjIndex(Interp(), cmd, 0, &origname) != TCL_OK) return TCL_ERROR; /* insert "::vlerq::" before the first list element */ newname = Tcl_NewStringObj("::vlerq::", -1); Tcl_AppendObjToObj(newname, origname); if (Tcl_GetCommandInfo(Interp(), Tcl_GetString(newname), &cmdinfo)) Tcl_ListObjReplace(NULL, cmd, 0, 1, 1, &newname); else { Object_p buf[2]; DecObjRef(newname); buf[0] = Tcl_NewStringObj("vlerq", -1); buf[1] = origname; Tcl_ListObjReplace(NULL, cmd, 0, 1, 2, buf); } return TCL_OK; } ItemTypes ViewCmd_X (Item args[]) { int e = TCL_OK, i, n, index, objc; const Object_p *objv; Object_p result, buf[10], *cvec; Tcl_Interp *interp = Interp(); const CmdDispatch *cmds = GetShared()->info->cmds; objv = (const void*) args[0].u.ptr; objc = args[0].u.len; if (objc < 1) { Tcl_WrongNumArgs(interp, 0, objv, "view arg ?op ...? ?| ...?"); return IT_unknown; } Tcl_SetObjResult(interp, objv[0]); --objc; ++objv; while (e == TCL_OK && objc > 0) { for (n = 0; n < objc; ++n) if (objv[n]->bytes != 0 && *objv[n]->bytes == '|' && objv[n]->length == 1) break; if (n > 0) { cvec = n > 8 ? malloc((n+2) * sizeof(Object_p)) : buf; if (Tcl_GetIndexFromObjStruct(NULL, *objv, cmds, sizeof *cmds, "", TCL_EXACT, &index) != TCL_OK) index = -1; cvec[0] = Tcl_NewStringObj("vlerq", -1); cvec[1] = objv[0]; cvec[2] = IncObjRef(Tcl_GetObjResult(interp)); for (i = 1; i < n; ++i) cvec[i+2] = objv[i]; result = Tcl_NewListObj(n+1, cvec+1); if (index < 0 || *cmds[index].args != 'V') { e = AdjustCmdDef(result); if (e == TCL_OK) { int ac; Object_p *av; Tcl_ListObjGetElements(NULL, result, &ac, &av); /* don't use Tcl_EvalObjEx, it forces a string conversion */ e = Tcl_EvalObjv(interp, ac, av, 0); } DecObjRef(result); } else Tcl_SetObjResult(interp, result); DecObjRef(cvec[2]); if (n > 8) free(cvec); } objc -= n+1; objv += n+1; /*++k;*/ } if (e != TCL_OK) { #if 0 char msg[50]; sprintf(msg, "\n (\"view\" step %d)", k); Tcl_AddObjErrorInfo(interp, msg, -1); #endif return IT_unknown; } args->o = Tcl_GetObjResult(interp); return IT_object; } #define MAX_STACK 20 static int VlerqObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { int i, index, ok = TCL_ERROR; ItemTypes type; Object_p result; Item stack [MAX_STACK]; const char *args; const CmdDispatch *cmdtable; PUSH_KEEP_REFS Interp() = interp; if (objc <= 1) { Tcl_WrongNumArgs(interp, 1, objv, "command ..."); goto FAIL; } cmdtable = (const CmdDispatch*) data; if (Tcl_GetIndexFromObjStruct(interp, objv[1], cmdtable, sizeof *cmdtable, "command", TCL_EXACT, &index) != TCL_OK) goto FAIL; objv += 2; objc -= 2; args = cmdtable[index].args + 2; /* skip return type and ':' */ for (i = 0; args[i] != 0; ++i) { Assert(i < MAX_STACK); if (args[i] == 'X') { Assert(args[i+1] == 0); stack[i].u.ptr = (const void*) (objv+i); stack[i].u.len = objc-i; break; } if ((args[i] == 0 && i != objc) || (args[i] != 0 && i >= objc)) { char buf [10*MAX_STACK]; const char* s; *buf = 0; for (i = 0; args[i] != 0; ++i) { if (*buf != 0) strcat(buf, " "); switch (args[i] & ~0x20) { case 'C': s = "list"; break; case 'I': s = "int"; break; case 'N': s = "col"; break; case 'O': s = "any"; break; case 'S': s = "string"; break; case 'V': s = "view"; break; case 'X': s = "..."; break; default: Assert(0); s = "?"; break; } strcat(buf, s); if (args[i] & 0x20) strcat(buf, "*"); } Tcl_WrongNumArgs(interp, 2, objv-2, buf); goto FAIL; } stack[i].o = objv[i]; if (!CastObjToItem(args[i], stack+i)) { if (*Tcl_GetStringResult(interp) == 0) { const char* s = "?"; switch (args[i] & ~0x20) { case 'C': s = "list"; break; case 'I': s = "integer"; break; case 'N': s = "column name"; break; case 'V': s = "view"; break; } Tcl_AppendResult(interp, cmdtable[index].name, ": invalid ", s, NULL); } goto FAIL; /* TODO: append info about which arg is bad */ } } GetShared()->info->cmds = cmdtable; /* for ViewCmd_X */ type = cmdtable[index].proc(stack); if (type == IT_unknown) goto FAIL; result = ItemAsObj(type, stack); if (result == NULL) goto FAIL; Tcl_SetObjResult(interp, result); ok = TCL_OK; FAIL: POP_KEEP_REFS return ok; } static void DoneShared (ClientData cd) { Shared_p sh = (Shared_p) cd; if (--sh->refs == 0) free(sh->info); } static void InitShared (void) { Shared_p sh = GetShared(); if (sh->refs++ == 0) sh->info = calloc(1, sizeof(SharedInfo)); UngetShared(DoneShared, (ClientData) sh); } DLLEXPORT int Vlerq_Init (Tcl_Interp *interp) { if (!MyInitStubs(interp) || Tcl_PkgRequire(interp, "Tcl", "8.4", 0) == NULL) return TCL_ERROR; Tcl_CreateObjCommand(interp, "vlerq", VlerqObjCmd, f_commands, NULL); InitShared(); return Tcl_PkgProvide(interp, "vlerq", PACKAGE_VERSION); } DLLEXPORT int Vlerq_SafeInit (Tcl_Interp *interp) { if (!MyInitStubs(interp) || Tcl_PkgRequire(interp, "Tcl", "8.4", 0) == NULL) return TCL_ERROR; /* UNSAFE is defined in the "opdefs_gen.h" file included above */ Tcl_CreateObjCommand(interp, "vlerq", VlerqObjCmd, f_commands + UNSAFE, NULL); InitShared(); return Tcl_PkgProvide(interp, "vlerq", PACKAGE_VERSION); } /* end of generated code */ vqtcl/library/0000755000076500007650000000000010634027266013263 5ustar jcwjcw00000000000000vqtcl/library/m2mvfs.tcl0000644000076500007650000001674210614456523015213 0ustar jcwjcw00000000000000# m2mvfs.tcl -- In-memory VFS which appends its data as a MK starkit when done. # This VFS driver collects data in memory which then gets saved to a Metakit # data file when unmounted, using vlerq calls. Does not support deletions, # renames, and such. Can only be used with a single mountpoint at a time. # # 1.4 adjusted for vlerq 3 # 1.5 fixed to actually work # 1.6 minor cleanup # 1.7 adjusted for vlerq 4 # 1.8 allow overwriting files package provide vfs::m2m 1.8 package require vfs package require vlerq namespace eval vfs::m2m { namespace eval v { variable outfn ;# output file name # following lists are all indexed by the same directory ordinal number variable dname ;# list of directory names variable prows ;# list of parent row numbers variable files ;# list of list of (name size date contents) tuples } # public proc Mount {mkfile local args} { set v::outfn [file normalize $mkfile] set v::dname [list ] set v::prows [list -1] set v::files [list {}] ::vfs::filesystem mount $local [list ::vfs::m2m::handler -] ::vfs::RegisterMount $local [list ::vfs::m2m::Unmount -] return m2m } proc Unmount {db local} { ::vfs::filesystem unmount $local if {$v::outfn ne ""} { set fd [::open $v::outfn a] vlerq write [makeDirsView] $fd ::close $fd } unset v::outfn v::dname v::prows v::files } # private proc makeDirsView {} { set d {} foreach f $v::files { set x [lsort -index 0 -unique $f] lappend d [vlerq def {name size:I date:I contents:B} \ [eval concat $x]] } set desc {name parent:I {files {name size:I date:I contents:B}}} set dirs [vlerq data [vlerq mdef $desc] $v::dname $v::prows $d] vlerq group $dirs {} dirs } proc handler {db cmd root path actual args} { #puts [list M2M $db <$cmd> r: $root p: $path a: $actual $args] switch $cmd { matchindirectory { eval [linsert $args 0 $cmd $db $path $actual] } fileattributes { eval [linsert $args 0 $cmd $db $root $path] } default { eval [linsert $args 0 $cmd $db $path] } } } proc fail {code} { ::vfs::filesystem posixerror $::vfs::posix($code) } proc lookUp {db path} { set parent 0 if {$path ne "."} { set elems [file split $path] set remain [llength $elems] foreach e $elems { set r "" foreach r [lsearch -exact -int -all $v::prows $parent] { if {$e eq [lindex $v::dname $r]} { set parent $r incr remain -1 break } } if {$parent != $r} { if {$remain == 1} { set i [lsearch -exact \ [subFileNames [list ? ? $parent]] $e] if {$i >= 0} { # eval this 4-item result returns info about a file return [list lindex $v::files $parent $i] } } fail ENOENT } } } # evaluating this 3-item result returns the files subview return [list lindex $v::files $parent] } proc isDir {tag} { return [expr {[llength $tag] == 3}] } proc subDirNums {tag} { lsearch -exact -int -all $v::prows [lindex $tag 2] } proc subFileNames {tag} { set r {} foreach x [lindex $v::files [lindex $tag 2]] { lappend r [lindex $x 0] } return $r } # methods proc matchindirectory {db path actual pattern type} { set o {} if {$type == 0} { set type 20 } set tag [lookUp $db $path] if {$pattern ne ""} { set c {} if {[isDir $tag]} { if {$type & 16} { set c [subFileNames $tag] } if {$type & 4} { foreach r [subDirNums $tag] { lappend c [lindex $v::dname $r] } } } foreach x $c { if {[string match $pattern $x]} { lappend o [file join $actual $x] } } } elseif {$type & ([isDir $tag]?4:16)} { set o [list $actual] } return $o } proc fileattributes {db root path args} { switch -- [llength $args] { 0 { return [::vfs::listAttributes] } 1 { return [eval [linsert $args 0 \ ::vfs::attributesGet $root $path]] } 2 { return [eval [linsert $args 0 \ ::vfs::attributesSet $root $path]] } } } proc open {db file mode permissions} { switch -- $mode { "" - r { set tag [lookUp $db $file] if {[isDir $tag]} { fail ENOENT } foreach {name size date contents} [eval $tag] break if {[string length $contents] != $size} { set contents [vfs::zip -mode decompress $contents] } set fd [vfs::memchan] fconfigure $fd -translation binary puts -nonewline $fd $contents fconfigure $fd -translation auto seek $fd 0 return [list $fd] } w { ;# make sure the parent dir exists and create empty set tag [lookUp $db [file dirname $file]] set dpos [lindex $tag 2] set curr [lindex $v::files $dpos] set fpos [llength $curr] lappend curr [list [file tail $file] 0 [clock seconds] ""] lset v::files $dpos $curr set fd [vfs::memchan] return [list $fd [list ::vfs::m2m::doClose $db $dpos $fpos $fd]] } default { error "unsupported access mode: $mode" } } } proc doClose {db dpos fpos fd} { fconfigure $fd -translation binary seek $fd 0 set d [read $fd] set n [string length $d] set z [vfs::zip -mode compress $d] if {[string length $z] < $n} { set d $z } lset v::files $dpos $fpos 1 $n lset v::files $dpos $fpos 3 $d } proc access {db path mode} { lookUp $db $path } proc stat {db path} { set tag [lookUp $db $path] set l 1 if {[isDir $tag]} { set t directory set s 0 set d 0 set c "" incr l [llength [subFileNames $tag]] incr l [llength [subDirNums $tag]] } else { set t file foreach {n s d c} [eval $tag] break } return [list type $t size $s atime $d ctime $d mtime $d nlink $l \ csize [string length $c] gid 0 uid 0 ino 0 mode 0777] } proc createdirectory {db path} { set tag [lookUp $db [file dirname $path]] lappend v::dname [file tail $path] lappend v::prows [lindex $tag 2] lappend v::files {} } proc utime {db path atime mtime} { set tag [lookUp $db $path] if {![isDir $tag]} { lset v::files [lindex $tag 2] [lindex $tag 3] 2 $mtime } } } vqtcl/library/mkclvfs.tcl0000644000076500007650000001337010611154237015432 0ustar jcwjcw00000000000000# mkclvfs.tcl -- Metakit Compatibility Layer Virtual File System driver # Rewritten from mk4vfs.tcl, orig by Matt Newman and Jean-Claude Wippler # 1.0 initial release # 1.1 view size renamed to count # 1.2 replace view calls by vget (simpler and faster) # 1.3 modified to use the vlerq extension i.s.o. thrive # 1.4 minor cleanup # 1.5 adjusted for vlerq 4 package provide vfs::mkcl 1.5 package require vfs package require vlerq namespace eval ::vfs::mkcl { interp alias {} ::vfs::mkcl::vopen {} ::vlerq open interp alias {} ::vfs::mkcl::vget {} ::vlerq get namespace eval v { variable seq 0 ;# used to generate a unique db handle variable rootv ;# maps handle to the "dirs" root view variable dname ;# maps handle to cached list of directory names variable prows ;# maps handle to cached list of parent row numbers } # public proc Mount {mkfile local args} { set db mkclvfs[incr v::seq] set v::rootv($db) [vget [vopen $mkfile] 0 dirs] set v::dname($db) [vget $v::rootv($db) * name] set v::prows($db) [vget $v::rootv($db) * parent] #parray v::dname #parray v::prows ::vfs::filesystem mount $local [list ::vfs::mkcl::handler $db] ::vfs::RegisterMount $local [list ::vfs::mkcl::Unmount $db] return $db } proc Unmount {db local} { ::vfs::filesystem unmount $local unset v::rootv($db) v::dname($db) v::prows($db) } # private proc handler {db cmd root path actual args} { #puts [list MKCL $db <$cmd> r: $root p: $path a: $actual $args] switch $cmd { matchindirectory { eval [linsert $args 0 $cmd $db $path $actual] } fileattributes { eval [linsert $args 0 $cmd $db $root $path] } default { eval [linsert $args 0 $cmd $db $path] } } } proc fail {code} { ::vfs::filesystem posixerror $::vfs::posix($code) } proc lookUp {db path} { set dirs $v::rootv($db) set parent 0 set elems [file split $path] set remain [llength $elems] foreach e $elems { set r "" foreach r [lsearch -exact -int -all $v::prows($db) $parent] { if {$e eq [lindex $v::dname($db) $r]} { set parent $r incr remain -1 break } } if {$parent != $r} { if {$remain == 1} { set files [vget $dirs $parent files] set i [lsearch -exact [vget $files * name] $e] if {$i >= 0} { # eval this 3-item result returns the info about 1 file return [list vget $files $i] } } fail ENOENT } } # evaluating this 4-item result returns the files subview list vget $dirs $parent files } proc isDir {tag} { expr {[llength $tag] == 4} } if {$::tcl_version eq "8.4"} { proc apply {cmd args} { eval [concat $cmd $args] } } else { proc apply {cmd args} { {*}$cmd {*}$args } } # methods proc matchindirectory {db path actual pattern type} { set o {} if {$type == 0} { set type 20 } set tag [lookUp $db $path] if {$pattern ne ""} { set c {} if {[isDir $tag]} { # collect file names if {$type & 16} { set c [apply $tag * 0] } # collect directory names if {$type & 4} { foreach r [lsearch -exact -int -all $v::prows($db) \ [lindex $tag 2]] { lappend c [lindex $v::dname($db) $r] } } } foreach x $c { if {[string match $pattern $x]} { lappend o [file join $actual $x] } } } elseif {$type & ([isDir $tag]?4:16)} { set o [list $actual] } return $o } proc fileattributes {db root path args} { switch -- [llength $args] { 0 { return [::vfs::listAttributes] } 1 { set index [lindex $args 0] return [::vfs::attributesGet $root $path $index] } 2 { fail EROFS } } } proc open {db file mode permissions} { if {$mode ne "" && $mode ne "r"} { fail EROFS } set tag [lookUp $db $file] if {[isDir $tag]} { fail ENOENT } foreach {name size date contents} [apply $tag *] break if {[string length $contents] != $size} { set contents [::vfs::zip -mode decompress $contents] } set fd [::vfs::memchan] fconfigure $fd -translation binary puts -nonewline $fd $contents fconfigure $fd -translation auto -encoding [encoding system] seek $fd 0 list $fd } proc access {db path mode} { if {$mode & 2} { fail EROFS } lookUp $db $path } proc stat {db path} { set tag [lookUp $db $path] set l 1 if {[isDir $tag]} { set t directory set s 0 set d 0 set c "" incr l [apply $tag #] incr l [llength [lsearch -exact -int -all $v::prows($db) \ [lindex $tag 2]]] } else { set t file foreach {n s d c} [apply $tag *] break } list type $t size $s atime $d ctime $d mtime $d nlink $l \ csize [string length $c] gid 0 uid 0 ino 0 mode 0777 } } vqtcl/library/mklite.tcl0000644000076500007650000002050610611154237015251 0ustar jcwjcw00000000000000# mklite.tcl -- Compatibility layer for Metakit # 0.3 modified to use the vlerq extension i.s.o. thrive # 0.4 adjusted for vlerq 4 # 0.5 support "mk::file open" (no other args) and more mk::select options package provide mklite 0.5 package require vlerq namespace eval mklite { variable mkdb ;# the mkdb array maps open db handles to view references # call emulateMk4tcl to define compatibility aliases in a specific namespace # if the MKLITE_DEBUG env var is defined, all calls and returns will be traced proc emulateMk4tcl {{ns ::mk}} { foreach x {channel cursor file get loop select view} { # NOTE: clobbers existing mk::* cmds, may want to rename 'em first? if {[info exists ::env(MKLITE_DEBUG)]} { interp alias {} ${ns}::$x {} ::mklite::debug ::mklite::$x } else { interp alias {} ${ns}::$x {} ::mklite::$x } } } proc debug {args} { puts ">>> [list $args]" set r [uplevel 1 $args] set s [regsub -all {[^ -~]} $r ?] puts " << [string length $r]: [string range $s 0 49]" return $r } proc mk_obj {path} { variable mkdb # memoize last result (without row number), it's likely to be used again set pre [regsub {!\d+$} $path {}] if {$mkdb(?) eq $pre} { return $mkdb(:) } set n 0 foreach {x y} [regsub -all {[:.!]} :$path { & }] { switch -- $x { : { set r $mkdb($y) } ! { set n $y } . { if {[catch { vlerq get $r $n $y } r]} { return 0 } } } } set mkdb(?) $pre set mkdb(:) $r return $r } # partial emulation of the mk::* commands proc file {cmd args} { variable mkdb variable mkpath set db [lindex $args 0] if {$db eq ""} { return [array get mkpath] } set file [lindex $args 1] switch $cmd { open { set mkdb(?) "" if {$file ne ""} { set mkdb($db) [vlerq open $file] } else { set mkdb($db) 0 } set mkpath($db) $file return $db } load { fconfigure $file -translation binary set mkdb($db) [vlerq load [read $file]] return $db } close { set mkdb(?) "" unset mkdb($db) mkpath($db) return } views { return [vlerq get $mkdb($db) @ * 0] } } error "mkfile $cmd?" } proc view {cmd path args} { set a1 [lindex $args 0] switch $cmd { info { return [vlerq get [mk_obj $path] @ * 0] } layout { set layout "NOTYET" if {[llength $args] > 0 && $layout != $a1} { #error "view restructuring not supported" } return $layout } size { set len [vlerq get [mk_obj $path] #] if {[llength $args] > 0 && $len != $a1} { error "view resizing not supported" } return $len } default { error "mkview $cmd?" } } } proc cursor {cmd cursor args} { upvar $cursor v switch $cmd { create { NOTYET } incr { NOTYET } pos - position { if {$args != ""} { unset v regsub {!-?\d+$} $v {} v append v !$args return $args } if {![regexp {\d+$} $v n]} { set n -1 } return $n } default { error "mkcursor $cmd?" } } } proc get {path args} { set vw [mk_obj $path] set row [regsub {^.*!} $path {}] set sized 0 if {[lindex $args 0] eq "-size"} { incr sized set args [lrange $args 1 end] } set ids 0 if {[llength $args] == 0} { incr ids set args [vlerq get $vw @ * 0] } set r {} foreach x $args { if {$ids} { lappend r $x } set v [vlerq get $vw $row $x] if {$sized} { set v [string length $v] } lappend r $v } if {[llength $args] == 1} { set r [lindex $r 0] } return $r } proc loop {cursor path args} { upvar $cursor v #unset -nocomplain v ;# avoids errors if v already exists as array if {[llength $args] == 0} { set args [list $path] set path $v regsub {!-?\d+$} $path {} path } set first [lindex $args 0] set last [lindex $args 1] switch [llength $args] { 1 { set first 0 set limit [vlerq get [mk_obj $path] #] set step 1 } 2 { set limit [vlerq get [mk_obj $path] #] set step 1 } 3 { set step 1 } 4 { set step [lindex $args 2] } default { error "mkloop arg count?" } } set body [lindex $args end] set code 0 for {set i $first} {$i < $limit} {incr i $step} { set v $path!$i set code [catch [list uplevel 1 $body] err] switch $code { 1 - 2 { return -code $code $err } 3 { break } } } } # from http://wiki.tcl.tk/43 proc _lreverse L { set res {} set i [llength $L] #while {[incr i -1]>=0} {lappend res [lindex $L $i]} while {$i} {lappend res [lindex $L [incr i -1]]} ;# rmax set res } ;# RS, tuned 10% faster by [rmax] proc select {path args} { set vw [mk_obj $path] set n [vlerq get $vw #] set r {} for {set i 0} {$i < $n} {incr i} { lappend r $i } set n [llength $args] set sorts {} for {set i 0} {$i < $n} {incr i} { set match std switch -- [lindex $args $i] { -sort { lappend sorts [lindex $args [incr i]]; continue } -rsort { lappend sorts - [lindex $args [incr i]]; continue } -first { set first [lindex $args [incr i]]; continue } -count { set count [lindex $args [incr i]]; continue } -glob { set match glob; incr i } -globnc { set match globnc; incr i } -keyword { set match keyword; incr i } } set cols [lindex $args $i] set k [lindex $args [incr i]] set kwre "\\m$k" # could use loop -collect, might be faster set r2 {} foreach x $r { foreach c $cols { set v [vlerq get $vw $x $c] switch $match { glob { set ok [string match $k $v] } globnc { set ok [string match -nocase $k $v] } keyword { set ok [regexp -nocase $kwre $v] } default { set ok [expr {$k eq $v}] } } if {$ok} { lappend r2 $x; break } } } set r $r2 } if {[llength $sorts]} { foreach x [_lreverse $sorts] { if {$x eq "-"} { set r [_lreverse $r] } else { set v [vlerq remap [vlerq tag [vlerq colmap $vw $x] N] $r] set r [vlerq get [vlerq sort $v] * N] } } } if {[info exists first]} { set r [lrange $r $first end] } if {[info exists count]} { set r [lrange $r 0 [incr count -1]] } return $r } proc channel {path name mode} { package require vfs ;# TODO: needs vfs, could use "chan create" in 8.5 if {$mode ne "r"} { error "mkchannel? mode $mode" } set fd [vfs::memchan] fconfigure $fd -translation binary puts -nonewline $fd [get $path $name] seek $fd 0 return $fd } } vqtcl/library/ratcl.tcl0000644000076500007650000001754610634027266015111 0ustar jcwjcw00000000000000# ratcl.tcl -- Relational algebra ond other utility operators for vlerq package provide ratcl 4 package require vlerq 4 namespace eval vlerq {} interp alias {} view {} vlerq view namespace eval ratcl { namespace export vopdef proc vopdef {name params body} { proc ::vlerq::$name $params $body } vopdef as {v cmd} { interp alias {} $cmd {} view $v; return $cmd } vopdef asview {l args} { vlerq def $args $l } vopdef collect {v expr} { uplevel 1 [list view $v loop -collect $expr] } vopdef freeze {v} { view $v emit | load } vopdef index {v cond} { uplevel 1 [list view $v loop -index $cond] } vopdef pick {v n} { view $v where {[lindex $n $(#)] != 0} } vopdef project {v args} { view $v colmap $args | unique } vopdef use {v w} { return $w } vopdef where {v cond} { uplevel 1 [list view $v loop -where $cond] } vopdef do {w cmds} { upvar 1 _v v set v $w set x "" foreach c [split $cmds \n] { append x $c "\n " if {![info complete $x]} continue set x [string trim $x] regsub {^#.*} $x {} x if {$x eq ""} continue set cm "view \$_v $x" set v [uplevel 1 $cm] set x "" } set w $v unset v return $w } vopdef debug {w cmds} { upvar 1 _v v set v $w puts " rows-in col msec view-operation" puts " ------- --- ---- --------------" set x "" set w " " foreach c [split $cmds \n] { append x $c \n $w if {![info complete $x]} continue set x [string trim $x] if {[regexp {^#} $x]} { puts [format {%20s %.58s} "" $x] set x "" } switch -- $x { "" { } ? { puts "$w ?\n[view $v dump]" } default { if {[catch { view $v size } nr]} { set nr "" } if {[catch { view $v width } nc]} { set nc "" } set cm "view \$_v $x" set us [lindex [time { set v [uplevel 1 $cm] catch {view $v size} }] 0] puts [format {%8s %4s %5.0f %s} \ $nr $nc [expr {$us/1000.0}] $x] } } set x "" } if {[catch { view $v size } nr]} { set nr " -------" } if {[catch { view $v width } nc]} { set nc " ---" } puts [format {%8s %4s ---- --------------} $nr $nc] set w $v unset v return $w } vopdef dump {vid {maxrows 20}} { set n [view $vid size] if {[view $vid width] == 0} { return " ($n rows, no columns)" } set i -1 if {$n > $maxrows} { set vid [view $vid first $maxrows] } foreach x [view $vid names] y [view $vid types] { set v2 [view $vid onecol [incr i]] switch $y { B { set s { "[string length $($x)]b" } } V { set s { "#[view $($x) size]" } } default { set s { $($x) } } } set c [view $v2 collect $s] set w [string length $x] foreach z $c { if {[string length $z] > $w} { set w [string length $z] } } if {$w > 50} { set w 50 } switch $y { B - I - L - F - D - V { append fmt " " %${w}s } default { append fmt " " %-$w.${w}s } } append hdr " " [format %-${w}s $x] append bar " " [string repeat - $w] lappend d $c } set r [list $hdr $bar] for {set i 0} {$i < $n} {incr i} { if {$i >= $maxrows} break set cmd [list format $fmt] foreach x $d { lappend cmd [regsub -all {[^ -~]} [lindex $x $i] .] } lappend r [eval $cmd] } if {$i < $n} { lappend r [string map {- .} $bar] } ::join $r \n } vopdef html {vid} { set names [view $vid names] set types [view $vid types] set o append o {} append o \n {} foreach x $names { append o } append o \n view $vid loop c { append o { set i -1 foreach x $names y $types val [view $vid get $c(#) *] { switch $y { b - B { set z [string length $val]b } v - V { set z [view $val html] } default { set z [string map {& &\; < <\; > >\;} $val] } } switch $y { s - S - v - V { append o { } append o \n } append o
$x
} $c(#) } } default { append o {} } } append o $z
\n } vopdef transpose {v {p x}} { set n [vlerq size $v] foreach {pn pt} [split ${p}:S :] break set m [view $v size | collect { "$pn$(#):$pt" }] set c [view $v get @ | collect { [vlerq get $v * $(#)] }] view $m def [eval [linsert $c 0 concat]] } vopdef freq {v i} { set n [vlerq iota [vlerq width $v]] llength $n ;# force $n to list, avoids assert in CastObjToItem, case 'n' set g [vlerq group $v $n _] view [vlerq colmap $g $n] pair [view ${i}:I def [vlerq counts $g _]] } vopdef sorton {v args} { set n [view $v size] if {[incr n -1] > 0} { set dir + set cols {} # TODO: optimize, i.e. sort more at once and use faster reverse sort foreach x $args { switch -- $x { + - - { set dir $x } default { set cols [linsert $cols 0 $dir $x ]} } } foreach {dir col} $cols { set c [view $v onecol $col] if {$dir eq "-"} { set map [view $v onecol $col | reverse | sortmap | \ asview N:I | reverse | collect {$n-$(N)}] } else { set map [view $c sortmap] } set v [view $v remap $map] } } return $v } vopdef read {fd {data ""}} { fconfigure $fd -translation binary while {[string length $data] < 8} { append data [::read $fd [expr {8 - [string length $data]}]] } binary scan $data a3cI hdr ext siz switch -- $hdr { "JL\x1A" - "LJ\x1A" { if {$ext < 0} { set siz [expr {(($ext & 0x3F) << 36) + \ (($siz & 0xFFFFFFFF) << 4)}] } } default { set siz -1 } } if {$siz < 0} { while {![eof $fd]} { append data [::read $fd] } } else { incr siz -[string length $data] while {$siz > 0} { set more [::read $fd $siz] append data $more incr siz -[string length $more] } set more "" } vlerq load $data } } vqtcl/license.terms0000644000076500007650000000264110574304471014317 0ustar jcwjcw00000000000000This software is copyrighted by Jean-Claude Wippler and Equi4 Software. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. vqtcl/Makefile.in0000644000076500007650000003646310614457015013675 0ustar jcwjcw00000000000000# Makefile.in -- # # This file is a Makefile for Vlerq TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile. # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== #VLERQ_NEW_VAR = @VLERQ_NEW_VAR@ #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ lib_BINARIES = $(PKG_LIB_FILE) BINARIES = $(lib_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PKG_DIR) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ # This is necessary for packages that use private Tcl headers #TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ # Not used, but retained for reference of what libs Tcl required TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(top_builddir)" TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) pkgIndex.tcl libraries: doc: vlerq.html vlerq.n ratcl.html ratcl.n install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @mkdir -p $(DESTDIR)$(includedir) @echo "Installing header files in $(DESTDIR)$(includedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: doc @mkdir -p $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" @list='$(srcdir)/doc/*.n'; for i in $$list; do \ echo "Installing $$i"; \ rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ done test: binaries libraries $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) -rm -f $(PKG_STUB_LIB_FILE) ${MAKE_STUB_LIB} $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # vlerq.$(OBJEXT): $(srcdir)/generic/vlerq.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/vlerq.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/doc .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # Create the pkgIndex.tcl file. # It is usually easiest to let Tcl do this for you with pkg_mkIndex, but # you may find that you need to customize the package. If so, either # modify the -hand version, or create a pkgIndex.tcl.in file and have # the configure script output the pkgIndex.tcl by editing configure.in. #======================================================================== pkgIndex.tcl-auto: ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) pkgIndex.tcl-hand: (\ echo "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ [list load [file join \$$dir $(PKG_LIB_FILE)]]";\ ) > pkgIndex.tcl #======================================================================== # Distribution creation # You may need to tweak this target to make it work correctly. #======================================================================== #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar COMPRESS = gnutar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) DIST_ROOT = /tmp/dist DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) dist-clean: rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* dist: dist-clean doc mkdir -p $(DIST_DIR) cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ $(DIST_DIR)/ chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in mkdir $(DIST_DIR)/tclconfig cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ $(DIST_DIR)/tclconfig/ chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 chmod +x $(DIST_DIR)/tclconfig/install-sh list='data demos doc generic library mac tests unix win'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ mkdir $(DIST_DIR)/$$p; \ cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ fi; \ done (cd $(DIST_ROOT); $(COMPRESS);) #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log config.status #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: @mkdir -p $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ fi; \ fi; \ fi; \ done @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: @mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) .SUFFIXES: .man .html .n .man.html: dtplite -o "$@" html "`@CYGPATH@ $<`" mv "$@" doc .man.n: dtplite -o "$@" nroff "`@CYGPATH@ $<`" mv "$@" doc Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: vqtcl/pkgIndex.tcl.in0000644000076500007650000000067210574304471014505 0ustar jcwjcw00000000000000package ifneeded vlerq @PACKAGE_VERSION@ \ [list load [file join $dir lib@PACKAGE_NAME@@PACKAGE_VERSION@[info sharedlibext]] vlerq] package ifneeded ratcl @PACKAGE_VERSION@ \ [list source [file join $dir ratcl.tcl]] package ifneeded mklite 0.5 [list source [file join $dir mklite.tcl]] package ifneeded vfs::m2m 1.8 [list source [file join $dir m2mvfs.tcl]] package ifneeded vfs::mkcl 1.5 [list source [file join $dir mkclvfs.tcl]] vqtcl/README0000644000076500007650000000375510574304471012510 0ustar jcwjcw00000000000000This is Vlerq, a Tcl extension for data manipulation and storage. This package is released as open source under the same license as Tcl, see ./license.terms and http://www.tcl.tk/software/tcltk/license.html UNIX BUILD ========== Building under most UNIX systems is easy, just run the configure script and then run make. For more information about the build process, see the tcl/unix/README file in the Tcl src dist. The following will configure, test, build, and install the vlerq extension in the /opt/tcl directory. $ ./configure --prefix=/opt/tcl --exec-prefix=/opt/tcl $ make $ make test $ make install WINDOWS BUILD ============= The recommended method to build extensions under windows is to use the Msys + Mingw build process. This provides a Unix-style build while generating native Windows binaries. Using the Msys + Mingw build tools means that you can use the same configure script as per the Unix build to create a Makefile. See the tcl/win/README file for the URL of the Msys + Mingw download. If you have VC++ then you may wish to use the files in the win subdirectory and build the extension using just VC++. These files have been designed to be as generic as possible but will require some additional maintenance by the project developer to synchronise with the TEA configure.in and Makefile.in files. Instructions for using the VC++ makefile are written in the first part of the Makefile.vc file. INSTALLATION ============ The installation of a TEA package is structured like so: $exec_prefix / \ lib bin | | PACKAGEx.y (dependent .dll files on Windows) | pkgIndex.tcl (.so|.dll|.dylib and .tcl files) The main .so|.dll library file gets installed in the versioned PACKAGE directory, which is OK on all platforms because it will be directly referenced with by 'load' in the pkgIndex.tcl file. Dependent DLL files on Windows must go in the bin directory (or other directory on the user's PATH) in order for them to be found. vqtcl/tclconfig/0000755000076500007650000000000010574304471013566 5ustar jcwjcw00000000000000vqtcl/tclconfig/install-sh0000755000076500007650000000421210574304471015571 0ustar jcwjcw00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 vqtcl/tclconfig/tcl.m40000644000076500007650000036503110574304471014622 0ustar jcwjcw00000000000000# tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: tcl.m4 1241 2007-03-09 16:20:09Z jcw $ AC_PREREQ(2.50) dnl TEA extensions pass us the version of TEA they think they dnl are compatible with (must be set in TEA_INIT below) dnl TEA_VERSION="3.5" # Possible values for key variables defined: # # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') # TEA_PLATFORM - windows unix # #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TCLCONFIG], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_WARN([Can't find Tcl configuration definitions]) exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_WARN([Can't find Tk configuration definitions]) exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . ${TCL_BIN_DIR}/tclConfig.sh else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f ${TCL_BIN_DIR}/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . ${TK_BIN_DIR}/tkConfig.sh else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f ${TK_BIN_DIR}/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then for i in "`cd ${TK_BIN_DIR}; pwd`" \ "`cd ${TK_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" break fi done fi if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is specified # as an arg (optional), threads are enabled by default, "no" means # threads are disabled. "yes" is the default. # # TCL_THREADS is checked so that if you are compiling an extension # against a threaded core, your extension must be compiled threaded # as well. # # Note that it is legal to have a thread enabled extension run in a # threaded or non-threaded Tcl core, but a non-threaded extension may # only run in a non-threaded Tcl core. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [build with threads]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC, 1, [Do we want to use the threaded memory allocator?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) if test "`uname -s`" = "SunOS" ; then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) fi AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = 1; then AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) AC_MSG_RESULT([yes (default)]) else AC_MSG_RESULT([no]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads.]) fi ;; *) if test "${TCL_THREADS}" = "1"; then AC_MSG_WARN([ --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. # Requires the following vars to be set in the Makefile: # CFLAGS_DEFAULT # LDFLAGS_DEFAULT # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # DBGX Formerly used as debug library extension; # always blank now. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SYMBOLS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_CONFIG_CFLAGS]) AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, AC_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi AC_SUBST(TCL_DBGX) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, AC_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, [ AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # TEA_CONFIG_SYSTEM # # Determine what the system is (some things cannot be easily checked # on a feature-driven basis, alas). This can usually be done via the # "uname" command, but there are a few systems, like Next, where # this doesn't work. # # Arguments: # none # # Results: # Defines the following var: # # system - System/platform/version identification code. # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_SYSTEM], [ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_WARN([can't find uname command]) tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi ]) system=$tcl_cv_sys_version ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_CFLAGS], [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, AC_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, AC_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then AC_MSG_CHECKING([if Windows/CE build is requested]) AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) AC_MSG_RESULT([$doWince]) fi # Step 1: set the variable "system" to hold the name and version number # for the system. TEA_CONFIG_SYSTEM # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_PROG(AR, ar, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) AC_MSG_WARN([Ensure latest Platform SDK is installed]) do64bit="no" else AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) fi if test "$GCC" = "yes" ; then AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) fi TEA_PATH_CELIB # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 TEA_ADD_LIBS([bufferoverflowU.lib]) elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) done AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" AC_SUBST(CELIB_DIR) else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported with GCC on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then AC_LIBOBJ([tclLoadAix]) DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) # Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported by gcc]) else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD="${CC} -shared " DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*) # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) if test $tcl_cv_ld_elf = yes; then SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. case `machine` in sparc|sparc64) SHLIB_CFLAGS="-fPIC";; *) SHLIB_CFLAGS="-fpic";; esac SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) if test $tcl_cv_ld_elf = yes; then LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then case `arch` in ppc) AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], tcl_cv_cc_arch_ppc64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, tcl_cv_cc_arch_ppc64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386) AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], tcl_cv_cc_arch_x86_64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, tcl_cv_cc_arch_x86_64=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; *) AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; esac else # Check for combined 32-bit and 64-bit fat build echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ fat_32_64=yes fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ "`echo "${CFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for Tk extensions, remove 64-bit arch flags from # CFLAGS for combined 32-bit and 64-bit fat builds as neither TkAqua # nor TkX11 can be built for 64-bit at present. test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && \ CFLAGS="`echo "$CFLAGS " | sed -e 's/-arch ppc64 / /g' -e 's/-arch x86_64 / /g'`" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported with GCC on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else AC_MSG_WARN([64bit mode not supported for $arch]) fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) fi # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, AC_HELP_STRING([--enable-load], [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(LD_LIBRARY_PATH_VAR) # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN([TEA_SERIAL_PORT], [ AC_CHECK_HEADERS(sys/modem.h) AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; esac ]) #-------------------------------------------------------------------- # TEA_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # # tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and # CHECK on limits.h #-------------------------------------------------------------------- AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) if test $tcl_cv_dirent_h = no; then AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) AC_CHECK_HEADER(limits.h, [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(sys/param.h) ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # PKG_LIBS (appends to) # #-------------------------------------------------------------------- AC_DEFUN([TEA_PATH_X], [ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN([TEA_PATH_UNIX_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test found_xincludes = "no"; then AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([TEA_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) TEA_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([TEA_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN([TEA_BUGGY_STRTOD], [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; double value; value = strtod(infString, &term); if ((term != infString) && (term[-1] == 0)) { exit(1); } value = strtod(nanString, &term); if ((term != nanString) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, tcl_cv_strtod_buggy=buggy)]) if test "$tcl_cv_strtod_buggy" = buggy; then AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # _LARGEFILE_SOURCE64 # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], [char *p = (char *)open64;]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_type_64bit=__int64, tcl_type_64bit="long long") # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_TRY_COMPILE(,[switch (0) { case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, [What type should be used to define wide integers?]) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_VERSION # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN([TEA_INIT], [ # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.5" AC_MSG_CHECKING([for correct TEA configuration]) if test x"${PACKAGE_NAME}" = x ; then AC_MSG_ERROR([ The PACKAGE_NAME variable must be defined by your TEA configure.in]) fi if test x"$1" = x ; then AC_MSG_ERROR([ TEA version not specified.]) elif test "$1" != "${TEA_VERSION}" ; then AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) else AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) # This package name must be replaced statically for AC_SUBST to work AC_SUBST(PKG_LIB_FILE) # Substitute STUB_LIB_FILE in case package creates a stub library too. AC_SUBST(PKG_STUB_LIB_FILE) # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) AC_SUBST(PKG_TCL_SOURCES) AC_SUBST(PKG_HEADERS) AC_SUBST(PKG_INCLUDES) AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_ADD_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_SOURCES # PKG_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_SOURCES], [ vars="$@" for i in $vars; do case $i in [\$]*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find source file '$i']) fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done AC_SUBST(PKG_SOURCES) AC_SUBST(PKG_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_STUB_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_STUB_SOURCES # PKG_STUB_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_STUB_SOURCES], [ vars="$@" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find stub source file '$i']) fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_TCL_SOURCES -- # # Specify one or more Tcl source files. These should be platform # independent runtime files. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_TCL_SOURCES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_TCL_SOURCES], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done AC_SUBST(PKG_TCL_SOURCES) ]) #------------------------------------------------------------------------ # TEA_ADD_HEADERS -- # # Specify one or more source headers. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_HEADERS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_HEADERS], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find header file '${srcdir}/$i']) fi PKG_HEADERS="$PKG_HEADERS $i" done AC_SUBST(PKG_HEADERS) ]) #------------------------------------------------------------------------ # TEA_ADD_INCLUDES -- # # Specify one or more include dirs. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_INCLUDES], [ vars="$@" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done AC_SUBST(PKG_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_ADD_LIBS -- # # Specify one or more libraries. Users should check for # the right platform before adding to their list. For Windows, # libraries provided in "foo.lib" format will be converted to # "-lfoo" when using GCC (mingw). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_LIBS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_LIBS], [ vars="$@" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done AC_SUBST(PKG_LIBS) ]) #------------------------------------------------------------------------ # TEA_ADD_CFLAGS -- # # Specify one or more CFLAGS. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_CFLAGS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_CFLAGS], [ PKG_CFLAGS="$PKG_CFLAGS $@" AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN([TEA_PREFIX], [ if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else AC_MSG_NOTICE([--prefix defaulting to /usr/local]) prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) exec_prefix=${TCL_EXEC_PREFIX} else AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) exec_prefix=$prefix fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER_CC -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.in files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER_CC], [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_PROG_RANLIB #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER], [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_MSG_CHECKING([if the compiler understands -pipe]) OLDCC="$CC" CC="$CC -pipe" AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC" AC_MSG_RESULT([no])) fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- AC_C_BIGENDIAN if test "${TEA_PLATFORM}" = "unix" ; then TEA_TCL_LINK_LIBS TEA_MISSING_POSIX_HEADERS # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library #------------------------------------------------------------------------ AC_DEFUN([TEA_MAKE_LIB], [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(RANLIB_STUB) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN([TEA_LIB_SPEC], [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substs the following vars: # TCL_TOP_DIR_NATIVE # TCL_GENERIC_DIR_NATIVE # TCL_UNIX_DIR_NATIVE # TCL_WIN_DIR_NATIVE # TCL_BMAP_DIR_NATIVE # TCL_TOOL_DIR_NATIVE # TCL_PLATFORM_DIR_NATIVE # TCL_BIN_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl private include files]) TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi ;; esac fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_GENERIC_DIR_NATIVE) AC_SUBST(TCL_UNIX_DIR_NATIVE) AC_SUBST(TCL_WIN_DIR_NATIVE) AC_SUBST(TCL_BMAP_DIR_NATIVE) AC_SUBST(TCL_TOOL_DIR_NATIVE) AC_SUBST(TCL_PLATFORM_DIR_NATIVE) AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ AC_MSG_CHECKING([for Tk private include files]) TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} else TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi ;; esac fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_UNIX_DIR_NATIVE) AC_SUBST(TK_WIN_DIR_NATIVE) AC_SUBST(TK_GENERIC_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_PLATFORM_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files.], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "${TK_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_INCLUDES) if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory or the tclsh installed in a bin # directory. This macro will correctly determine the name # of the tclsh executable even if tclsh has not yet been # built in the build directory. The tclsh found is always # associated with a tclConfig.sh file. This tclsh should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi AC_MSG_RESULT([${TCLSH_PROG}]) AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Determine the fully qualified path name of the wish executable # in the Tk build directory or the wish installed in a bin # directory. This macro will correctly determine the name # of the wish executable even if wish has not yet been # built in the build directory. The wish found is always # associated with a tkConfig.sh file. This wish should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_WISH], [ AC_MSG_CHECKING([for wish]) if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TK_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi AC_MSG_RESULT([${WISH_PROG}]) AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then case ${with_$1config} in */$1Config.sh ) if test -f ${with_$1config}; then AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` fi;; esac if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN([Cannot find $1 configuration definitions]) exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . ${$1_BIN_DIR}/$1Config.sh else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${$1_BIN_DIR}/Makefile ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_BIN_DIR) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) #------------------------------------------------------------------------ # TEA_PATH_CELIB -- # # Locate Keuchel's celib emulation layer for targeting Win/CE # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-celib=... # # Defines the following vars: # CELIB_DIR Full path to the directory containing # the include and platform lib files #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CELIB], [ # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) AC_MSG_CHECKING([for Windows/CE celib directory]) AC_CACHE_VAL(ac_cv_c_celibconfig,[ # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_celibconfig}" = x ; then AC_MSG_ERROR([Cannot find celib support library directory]) else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` AC_MSG_RESULT([found $CELIB_DIR]) fi fi ]) # Local Variables: # mode: autoconf # End: vqtcl/tests/0000755000076500007650000000000010637717020012756 5ustar jcwjcw00000000000000vqtcl/tests/all.tcl0000755000076500007650000000024410574304471014237 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit source [file join [file dir [info script]] initests.tcl] runAllTests eval unset [info vars ?] eval unset [info vars ??] #puts [info vars *]vqtcl/tests/basic.test0000755000076500007650000000277210611154237014750 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version #puts pwd-[pwd] #puts auto-$auto_path #puts loaded-[info loaded] test 1 {} { vlerq type "" } {} test 2 {} { vlerq type [list 1 2 3] } list test 3 {} { vlerq refs [list 1 2 3] } 1 test 4 {} -body { set v [list 1 2 3] vlerq refs $v } -result 2 -cleanup { unset v } test 5 {} { vlerq viewconv [vlerq def A {a b c}] } {data {mdef A} {a b c}} test 6 {0-bit ints} { vlerq def A:I {0 0 0} } {data {mdef A:I} {0 0 0}} test 7 {1-bit ints} { vlerq def A:I {0 1 1 0 1 0 0 0 1} } {data {mdef A:I} {0 1 1 0 1 0 0 0 1}} test 8 {2-bit ints} { vlerq def A:I {0 1 2 3 2 1 0} } {data {mdef A:I} {0 1 2 3 2 1 0}} test 9 {4-bit ints} { vlerq def A:I {0 1 14 15 2 13} } {data {mdef A:I} {0 1 14 15 2 13}} test 10 {8-bit ints} { vlerq def A:I {0 -1 100 -100} } {data {mdef A:I} {0 -1 100 -100}} test 11 {16-bit ints} { vlerq def A:I {1234 2345 3456} } {data {mdef A:I} {1234 2345 3456}} test 12 {32-bit ints} { vlerq def A:I {123456 0 -654321} } {data {mdef A:I} {123456 0 -654321}} test 13 {64-bit ints} { vlerq def A:L {12345678901 23456789012} } {data {mdef A:L} {12345678901 23456789012}} test 14 {32-bit floats} { vlerq def A:F {1.25 2.5 3.75} } {data {mdef A:F} {1.25 2.5 3.75}} test 15 {64-bit floats} { vlerq def A:D {1234567.25 2345678.75} } {data {mdef A:D} {1234567.25 2345678.75}} ::tcltest::cleanupTests vqtcl/tests/bits.test0000755000076500007650000000320510611154237014620 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { vlerq bitruns {} } {} test 2 {} { vlerq bitruns {0 1 0 0 1 1 1 0} } {0 1 1 2 3 1} test 3 {} { vlerq bitruns {1 0 1 1 0 0 0 1} } {1 1 1 2 3 1} test 4 {} { vlerq bitruns [split [string repeat 0 20] ""] } {0 20} test 5 {} { vlerq bitruns [split [string repeat 01 10] ""] } {0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1} test 6 {} { vlerq bitruns [split [string repeat 001 10] ""] } {0 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1} test 7 {} { vlerq bitruns [split [string repeat 00001 10] ""] } {0 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1} test 8 {} { vlerq bitruns [split [string repeat 000000001 10] ""] } {0 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1} test 9 {} { vlerq bitruns [split [string repeat 0011 10] ""] } {0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2} test 10 {} { vlerq bitruns [split [string repeat 0100111 5] ""] } {0 1 1 2 3 1 1 2 3 1 1 2 3 1 1 2 3 1 1 2 3} test 11 {} { vlerq bitruns [split [string repeat 011000 10] ""] } {0 1 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 3} test 12 {} { set z [string repeat 0 100] vlerq bitruns [split ${z}1${z} ""] } {0 100 1 100} test 13 {} { set z [string repeat 0 1000] vlerq bitruns [split ${z}1${z} ""] } {0 1000 1 1000} test 14 {} { set z [string repeat 0 10000] vlerq bitruns [split ${z}1${z} ""] } {0 10000 1 10000} test 15 {} { set z [string repeat 0 10000] vlerq bitruns [split ${z}1${z}1${z} ""] } {0 10000 1 10000 1 10000} unset -nocomplain z ::tcltest::cleanupTests vqtcl/tests/blocked.test0000755000076500007650000000202710611154237015263 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {structure of sample mkblk.db file} { set bdb [vlerq open data/mkblk.db] vlerq structure $bdb } ((II)) test 2 {blocked view has 3 blocks} { vlerq get $bdb 0 bv # } 4 test 3 {blocked view structure and size} { set v [vlerq blocked [vlerq get $bdb 0 bv]] list [vlerq names $v] [vlerq structure $v] [vlerq size $v] } {{k1 k2} II 2500} test 4 {block sizes} { vlerq counts [vlerq get $bdb 0 bv] _B } {999 999 500 2} test 5 {contents of last block} { vlerq get $bdb 0 bv -1 _B * } {{999 -999} {1999 -1999}} test 6 {blocked view access} { foreach x {0 1 998 999 1000 1998 1999 2000 2498 2499} { lappend k1 [vlerq get $v $x k1] lappend k2 [vlerq get $v $x k2] } list $k1 $k2 } {{0 1 998 999 1000 1998 1999 2000 2498 2499}\ {0 -1 -998 -999 -1000 -1998 -1999 -2000 -2498 -2499}} unset -nocomplain v x k1 k2 ::tcltest::cleanupTests vqtcl/tests/column.test0000755000076500007650000000355010611154237015157 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { vlerq colconv {} } {} test 2 {} { vlerq type [vlerq colconv {}] } column test 3 {} { vlerq colconv {1 2 3} } {1 2 3} test 4 {} { vlerq type [vlerq colconv {1 2 3}] } column test 5 {} { vlerq coerce {} I } {} test 6 {} { vlerq coerce {0 1 1000 -0 -1 -1000} I } {0 1 1000 0 -1 -1000} test 7 {} { vlerq coerce {a aa "" 0 1 A AA "" -0 -1} S } {a aa {} 0 1 A AA {} -0 -1} test 8 {} { vlerq iota 0 } {} test 9 {} { vlerq iota 5 } {0 1 2 3 4} test 10 {} { vlerq omitmap {2 3 7} 9 } {0 1 4 5 6 8} test 11 {} { # 2007-02-06 new, allow unsorted map vlerq omitmap {2 7 3} 9 } {0 1 4 5 6 8} test 12 {} { vlerq getcol [vlerq def A {a b c}] 0 } {a b c} test 13 {} { vlerq getcol [vlerq def A {a b c}] -1 } {a b c} test 14 {} { vlerq getcol [vlerq def A {a b c}] A } {a b c} test 15 {} { vlerq getcol [vlerq def A:I {1 2 3}] A } {1 2 3} test 16 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] 0 } {a b c} test 17 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] 1 } {A B C} test 18 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] -2 } {a b c} test 19 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] -1 } {A B C} test 20 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] A } {a b c} test 21 {} { vlerq getcol [vlerq def {A B} {a A b B c C}] B } {A B C} test 22 {} { vlerq resizecol {0 11 22 33 44 55} 3 2 } {0 11 22 0 0 33 44 55} test 23 {} { set v [vlerq resizecol {0 11 22 33 44 55} 2 -3] } {0 11 55} test 24 {} { set v [vlerq resizecol $v 2 7 ] } {0 11 0 0 0 0 0 0 0 55} test 25 {} { set v [vlerq resizecol $v 1 -8] } {0 55} unset -nocomplain v ::tcltest::cleanupTests vqtcl/tests/commit.test0000755000076500007650000001460710611154237015157 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] set tmp [makeDirectory testfiles.tmp] test 0 {load extension} { package require vlerq } $version test 1 {} { set v [vlerq def A a] set e [vlerq emit $v] string length $e } 38 test 2 {} { binary scan $e H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 26 61 00 02 80 83 41 3a 53\ 81 82 88 81 8a 80 80 00 00 00 00 00 00 16 80 00\ 00 0b 00 00 00 0b } test 3 {} { vlerq load $e } {data {mdef A} a} test 4 {} { vlerq emitmods $v } "" test 5 {} { set v [vlerq set $v 0 A x] } {data {mdef A} x} test 6 {} { vlerq mutinfo $v } {{data {mdef A} {}}\ {data {mdef A} x}\ {data {mdef _:I} 1} 0 1 0 0} test 7 {} { set d [vlerq emitmods $v] string length $d } 43 test 8 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 2b 01 01 78 00 02 80 80 80\ 81 88 81 81 89 82 8a 81 8c 80 80 80 00 00 00 00\ 00 00 1b 90 00 00 0e 00 00 00 0d } test 9 {} { vlerq loadmods $d [vlerq def A a] } {data {mdef A} x} test 10 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc}] set e [vlerq emit $v] string length $e } 55 test 11 {} { binary scan $e H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 37 0b 16 21 61 00 62 62 00\ 63 63 63 00 32 04 80 87 41 3a 49 2c 42 3a 53 83\ 83 88 89 8b 82 94 80 80 00 00 00 00 00 00 27 80\ 00 00 11 00 00 00 16 } test 12 {} { vlerq load $e } {data {mdef {A:I B}} {11 22 33} {a bb ccc}} test 13 {} { vlerq emitmods $v } "" test 14 {} { set v [vlerq set $v 1 A 44 B dd] } {data {mdef {A:I B}} {11 44 33} {a dd ccc}} test 15 {} { vlerq mutinfo $v } {{data {mdef {A:I B}} {} {}}\ {data {mdef {A:I B}} 44 dd}\ {data {mdef {_:I _:I}} 1 1} {0 0 0} {0 1 0} {0 0 0} 0} test 16 {} { set d [vlerq emitmods $v] string length $d } 50 test 17 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 32 04 01 2c 01 64 64 00 03\ 80 80 80 81 88 81 81 89 81 8a 81 8b 83 8c 81 8f\ 80 80 80 00 00 00 00 00 00 22 90 00 00 12 00 00\ 00 10 } test 18 {} { vlerq loadmods $d [vlerq def {A:I B} {11 a 22 bb 33 ccc}] } {data {mdef {A:I B}} {11 44 33} {a dd ccc}} test 19 {} { set v [vlerq def {A:I B} {11 a 22 bb}] set w [vlerq insert $v 1 [vlerq def {A:I B} {33 ccc 44 dddd}]] set d [vlerq emitmods $w] string length $d } 51 test 20 {} { vlerq mutinfo $w } {{data {mdef {A:I B}} {33 44} {ccc dddd}} 0 0 {0 0} {0 0} {0 1 1 0} {}} test 21 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 33 21 2c 63 63 63 00 64 64\ 64 64 00 54 14 80 80 80 80 82 82 88 89 8a 81 93\ 80 81 94 80 00 00 00 00 00 00 23 90 00 00 0e 00\ 00 00 15 } test 22 {} { vlerq loadmods $d $v } {data {mdef {A:I B}} {11 33 44 22} {a ccc dddd bb}} test 23 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc}] set w [vlerq delete $v 1 1] set d [vlerq emitmods $w] string length $d } 31 test 24 {} { vlerq mutinfo $w } {{data {mdef {A:I B}} {} {}} 0 0 {0 1 0} {0 0} {0 0} {}} test 25 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 1f 04 80 80 81 88 80 80 80\ 00 00 00 00 00 00 0f 90 00 00 06 00 00 00 09 } test 26 {} { vlerq loadmods $d $v } {data {mdef {A:I B}} {11 33} {a ccc}} test 27 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc}] set w [vlerq insert $v 1 [vlerq def {A:I B} {1 1 2 2}]] vlerq mutinfo $w } {{data {mdef {A:I B}} {1 2} {1 2}} 0 0 {0 0 0} {0 0 0} {0 1 1 0 0} {}} test 28 {} { set w [vlerq insert $w 4 [vlerq def {A:I B} {3 3}]] vlerq mutinfo $w } {{data {mdef {A:I B}} {1 2 3} {1 2 3}} 0 0 {0 0 0} {0 0 0} {0 1 1 0 1 0} {}} test 29 {} { vlerq loadmods [vlerq emitmods $w] $v } {data {mdef {A:I B}} {11 1 2 22 3 33} {a 1 2 bb 3 ccc}} test 30 {} { set v [vlerq def {A:I B} {11 a 22 bb}] set w [vlerq insert $v 1 [vlerq def {A:I B} {1 c 2 d 3 e}]] vlerq mutinfo $w } {{data {mdef {A:I B}} {1 2 3} {c d e}} 0 0 {0 0} {0 0} {0 1 1 1 0} {}} test 31 {} { set w [vlerq delete $w 2 1] vlerq mutinfo $w } {{data {mdef {A:I B}} {1 3} {c e}} 0 0 {0 0} {0 0} {0 1 1 0} {}} test 32 {} { vlerq loadmods [vlerq emitmods $w] $v } {data {mdef {A:I B}} {11 1 3 22} {a c e bb}} test 33 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc 44 dddd 55 eeeee}] set w [vlerq delete $v 1 1] vlerq mutinfo $w } {{data {mdef {A:I B}} {} {}} 0 0 {0 1 0 0 0} {0 0 0 0} {0 0 0 0} {}} test 34 {} { set w [vlerq delete $w 2 1] vlerq mutinfo $w } {{data {mdef {A:I B}} {} {}} 0 0 {0 1 0 1 0} {0 0 0} {0 0 0} {}} test 35 {} { vlerq loadmods [vlerq emitmods $w] $v } {data {mdef {A:I B}} {11 33 55} {a ccc eeeee}} test 36 {bitmaps are compressed} { set v [vlerq tag 10000 A] set w [vlerq set $v 5000 A -123] set d [vlerq emitmods $w] string length $d } 44 ;# would be 1292 uncompressed test 37 {} { vlerq slice $w 4998 1 5 } {data {mdef A:I} {4998 4999 -123 5001 5002}} test 38 {} { lreplace [vlerq mutinfo $w] 3 5 ? ? ? } {{data {mdef A:I} {}} {data {mdef A:I} -123} {data {mdef _:I} 1} ? ? ? 0} test 39 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 2c 00 04 e2 20 01 38 70 01\ 85 80 80 80 87 88 81 81 8f 81 90 80 80 00 00 00\ 00 00 00 1c 90 00 00 0b 00 00 00 11 } test 40 {} { vlerq slice [vlerq loadmods $d $v] 4998 1 5 } {data {mdef A:I} {4998 4999 -123 5001 5002}} test 41 {} { set v [vlerq def {A B} {a A b B c C d D e E}] set w [vlerq set [vlerq set $v 3 A 3] 1 B 1] set d [vlerq emitmods $w] string length $d } 54 test 42 {set high row, then low row} { vlerq mutinfo $w } {{data {mdef {A B}} {} {}}\ {data {mdef {A B}} {b 3} {1 D}}\ {data {mdef {_:I _:I}} {0 1} {1 0}}\ {0 0 0 0 0} {0 1 0 1 0} {0 0 0 0 0} {1 0}} test 43 {} { binary scan $d H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 36 0a 10 33 00 02 01 31 00\ 02 80 80 80 81 88 82 81 89 82 8a 81 8c 80 81 8d\ 82 8e 81 90 80 80 80 00 00 00 00 00 00 26 90 00\ 00 15 00 00 00 11 } test 44 {} { vlerq loadmods $d $v } {data {mdef {A B}} {a b c 3 e} {A 1 C D E}} unset -nocomplain d e v w ::tcltest::cleanupTests vqtcl/tests/emit.test0000755000076500007650000001447510611154237014630 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] set tmp [makeDirectory testfiles.tmp] test 0 {load extension} { package require vlerq } $version test 1 {} { set v [vlerq emit 123] string length $v } 27 test 2 {} { vlerq load $v } 123 test 3 {} -body { binary scan $v H* w regsub -all {..} $w {& } } -match glob -result {4? 4? 1a 00 00 00 00 1b 80 80 fb 80 00 00 00 00\ 00 00 0b 80 00 00 03 00 00 00 08 } test 4 {} { set fd [open $tmp/t1.db w] fconfigure $fd -translation binary set r [vlerq write 124 $fd] close $fd set r } 27 test 5 {} { vlerq open $tmp/t1.db } 124 test 6 {} { vlerq save 125 $tmp/t2.db } 27 test 7 {} { vlerq open $tmp/t2.db } 125 test 8 {} { set v [vlerq emit [vlerq def A {a b c}]] string length $v } 42 test 9 {} { vlerq load $v } {data {mdef A} {a b c}} test 10 {} -body { binary scan $v H* w regsub -all {..} $w {& } } -match glob -result {4? 4? 1a 00 00 00 00 2a 61 00 62 00 63 00 2a 80\ 83 41 3a 53 83 86 88 81 8e 80 80 00 00 00 00 00\ 00 1a 80 00 00 0b 00 00 00 0f } test 11 {} { set fd [open $tmp/t3.db w] fconfigure $fd -translation binary set r [vlerq write [vlerq def A {a b d}] $fd] close $fd set r } 42 test 12 {} { vlerq open $tmp/t3.db } {data {mdef A} {a b d}} test 13 {} { vlerq save [vlerq def A {a b e}] $tmp/t4.db } 42 test 14 {} { vlerq open $tmp/t4.db } {data {mdef A} {a b e}} test 15 {fix binary input conversion: used Tcl string i.s.o. bytearray} { binary scan [vlerq emit [vlerq def A:B \xAB\xAC\xAD\xAE\xAF]] H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 29 ab ac ad ae af 05 80 83\ 41 3a 42 81 85 88 81 8d 80 80 00 00 00 00 00 00\ 19 80 00 00 0b 00 00 00 0e } test 16 {fix to preserve null bytes inside B fields} { binary scan [vlerq emit [vlerq def A:B \xAB\x00\xAC\x00\xAD]] H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 29 ab 00 ac 00 ad 05 80 83\ 41 3a 42 81 85 88 81 8d 80 80 00 00 00 00 00 00\ 19 80 00 00 0b 00 00 00 0e } test 17 {} { set v [vlerq group [vlerq def A {a aa aaa}] {} v] set w [vlerq group 123 {} w] set x [vlerq group [vlerq def {B C} {b c bb cc}] {} x] set y [vlerq pair $v [vlerq pair $w $x]] } {data {mdef {{v A} {w {}} {x {B C}}}} {{data {mdef A} {a aa aaa}}}\ 123\ {{data {mdef {B C}} {b bb} {c cc}}}} test 18 {} { set z [vlerq emit $y] binary scan $z H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 63 61 00 61 61 00 61 61 61\ 00 32 04 80 83 89 88 82 91 80 80 80 fb 62 00 62\ 62 00 32 63 00 63 63 00 32 80 82 85 9d 81 a2 80\ 85 a3 81 a8 80 80 95 76 5b 41 3a 53 5d 2c 77 3a\ 56 2c 78 5b 42 3a 53 2c 43 3a 53 5d 81 87 93 83\ 9a 8c a9 80 00 00 00 00 00 00 53 80 00 00 1e 00\ 00 00 35 } test 19 {} { vlerq load $z } {data {mdef {{v A} {w {}} {x {B C}}}} {{data {mdef A} {a aa aaa}}}\ 123\ {{data {mdef {B C}} {b bb} {c cc}}}} test 20 {} { set z [vlerq emit [vlerq def {{A B}} [list [vlerq def B {1 2}] \ [vlerq def B {3 4 5}]]]] binary scan $z H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 3d 31 00 32 00 22 33 00 34\ 00 35 00 2a 80 82 84 88 81 8c 80 80 83 86 8d 81\ 93 80 80 86 41 5b 42 3a 53 5d 82 8e 94 80 00 00\ 00 00 00 00 2d 80 00 00 0b 00 00 00 22 } test 21 {} { set z [vlerq emit [vlerq def A:V [list [vlerq def B {1 2}] \ [vlerq def C {3 4 5}]]]] binary scan $z H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 42 31 00 32 00 22 33 00 34\ 00 35 00 2a 80 83 42 3a 53 82 84 88 81 8c 80 80\ 83 43 3a 53 83 86 8d 81 93 80 80 83 41 3a 56 82\ 96 94 80 00 00 00 00 00 00 32 80 00 00 08 00 00\ 00 2a } test 22 {} { vlerq load $z } {data {mdef {{A {}}}} {{data {mdef B} {1 2}} {data {mdef C} {3 4 5}}}} test 23 {0-bit ints} { vlerq load [vlerq emit [vlerq def A:I {0 0 0}]] } {data {mdef A:I} {0 0 0}} test 24 {1-bit ints} { vlerq load [vlerq emit [vlerq def A:I {0 1 1 0 1 0 0 0 1}]] } {data {mdef A:I} {0 1 1 0 1 0 0 0 1}} test 25 {2-bit ints} { vlerq load [vlerq emit [vlerq def A:I {0 1 2 3 2 1 0}]] } {data {mdef A:I} {0 1 2 3 2 1 0}} test 26 {4-bit ints} { vlerq load [vlerq emit [vlerq def A:I {0 1 14 15 2 13}]] } {data {mdef A:I} {0 1 14 15 2 13}} test 27 {8-bit ints} { vlerq load [vlerq emit [vlerq def A:I {0 -1 100 -100}]] } {data {mdef A:I} {0 -1 100 -100}} test 28 {16-bit ints} { vlerq load [vlerq emit [vlerq def A:I {1234 2345 3456}]] } {data {mdef A:I} {1234 2345 3456}} test 29 {32-bit ints} { vlerq load [vlerq emit [vlerq def A:I {123456 0 -654321}]] } {data {mdef A:I} {123456 0 -654321}} test 30 {64-bit ints} { vlerq load [vlerq emit [vlerq def A:L {12345678901 23456789012}]] } {data {mdef A:L} {12345678901 23456789012}} test 31 {32-bit floats} { vlerq load [vlerq emit [vlerq def A:F {1.25 2.5 3.75}]] } {data {mdef A:F} {1.25 2.5 3.75}} test 32 {64-bit floats} { vlerq load [vlerq emit [vlerq def A:D {1234567.25 2345678.75}]] } {data {mdef A:D} {1234567.25 2345678.75}} test 33 {} { set v [vlerq tag 10000 A] vlerq get [vlerq meta $v] } {A I {}} test 34 {} { string length [vlerq emit $v] } 20035 test 35 {} { vlerq def A {1 {}} } {data {mdef A} {1 {}}} test 36 {F117, 2006-12-16} { set z [vlerq emit [vlerq def A {1 {}}]] binary scan $z H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 26 31 00 02 80 83 41 3a 53\ 82 82 88 81 8a 80 80 00 00 00 00 00 00 16 80 00\ 00 0b 00 00 00 0b } test 37 {F117, 2006-12-16} { vlerq load [vlerq emit [vlerq def A {1 {}}]] } {data {mdef A} {1 {}}} test 38 {} { vlerq def A {{} 1} } {data {mdef A} {{} 1}} test 39 {} { vlerq load [vlerq emit [vlerq def A {{} 1}]] } {data {mdef A} {{} 1}} unset -nocomplain r v w x y z fd ::tcltest::cleanupTests vqtcl/tests/error.test0000755000076500007650000001513710611154237015017 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {vlerq without command name} -body { vlerq } -returnCodes 1 -result {wrong # args: should be "vlerq command ..."} test 2 {vlerq with a bad command name} -body { vlerq ? } -returnCodes 1 -result {bad command "?": must be open, save, append, bitruns, blocked, clone, coerce, colconv, colmap, colomit, compare, compat, concat, counts, countscol, countview, data, debug, def, delete, deps, emit, emitmods, except, exceptmap, first, get, getcol, getinfo, group, grouped, hashcol, hashfind, hashview, ijoin, insert, intersect, iota, isectmap, join, last, load, loadmods, loop, max, mdef, mdesc, meta, min, mutinfo, namecol, names, omitmap, onecol, pair, product, ref, refs, remap, remapsub, rename, repeat, replace, resizecol, reverse, rowcmp, roweq, rowhash, set, size, slice, sort, sortmap, spread, step, strlookup, structdesc, structure, sum, tag, take, to, type, types, ungroup, union, unionmap, unique, uniquemap, view, viewascol, viewconv, width, or write} test 3 {colconv without list} -body { vlerq colconv } -returnCodes 1 -result {wrong # args: should be "vlerq colconv list"} test 4 {colconv with a non-list} -body { vlerq colconv "\{" } -returnCodes 1 -result {unmatched open brace in list} test 5 {viewconv without value} -body { vlerq viewconv } -returnCodes 1 -result {wrong # args: should be "vlerq viewconv view"} test 6 {type without value} -body { vlerq type } -returnCodes 1 -result {wrong # args: should be "vlerq type any"} test 7 {refs without value} -body { vlerq refs } -returnCodes 1 -result {wrong # args: should be "vlerq refs any"} test 8 {meta without view} -body { vlerq meta } -returnCodes 1 -result {wrong # args: should be "vlerq meta view"} test 9 {size without view} -body { vlerq size } -returnCodes 1 -result {wrong # args: should be "vlerq size view"} test 10 {negative size} { catch { vlerq size -123 } ;# TODO: return proper error message } 1 test 11 {bad variable reference} -body { vlerq size @? } -returnCodes 1 -result {can't read "?": no such variable} test 12 {ref without varname} -body { vlerq ref } -returnCodes 1 -result {wrong # args: should be "vlerq ref any ..."} test 13 {to with too few args} -body { vlerq to ? } -returnCodes 1 -result {wrong # args: should be "vlerq to any any"} test 14 {non-existent view operation} -body { vlerq viewconv {foo bar} } -returnCodes 1 -match glob -result {bad command "foo": must be open, *} test 15 {locate the load path of the vlerq extension} -body { foreach x [info loaded] { foreach {path name} $x break if {$name eq "Vlerq"} break } set path # match either a reasonable real path or the empty string if statically linked } -match regexp -result {^(.*/libvlerq.*\..*|)$} test 16 {open is not allowed in safe interpreters} -body { set i [interp create -safe] load $path Vlerq $i catch { $i eval {vlerq open} } msg interp delete $i set msg } -match glob -result {bad command "open": must be append, *} test 17 {open should be supported in normal interpreters} { catch { vlerq open } msg set msg } {wrong # args: should be "vlerq open string"} test 18 {open file which does not exist} -body { vlerq open blah-blah-blah } -returnCodes 1 -result {cannot open file: blah-blah-blah} test 19 {define zero-width view with data} -body { vlerq def {} {1 2 3} } -returnCodes 1 -result {cannot insert in zero-width view} test 20 {define with incorrect number of items} -body { vlerq def {A B} {1 2 3} } -returnCodes 1 -result {item count not a multiple of column width} test 21 {view cmd without args} -body { vlerq view } -returnCodes 1 -result {wrong # args: should be "view arg ?op ...? ?| ...?"} test 22 {} -body { vlerq view 3 | ? } -returnCodes 1 -match glob -result {bad command "?": must be open, *} test 23 {untyped sum} -body { set x [vlerq sum [vlerq def A {1 2 3 4}] A] } -returnCodes 1 -result {} ;# TODO: sum should return an error message test 24 {} -body { vlerq def A:I [list ""] } -returnCodes 1 -result {expected integer but got ""} test 25 {} -body { vlerq def A:I 1.2 } -returnCodes 1 -result {expected integer but got "1.2"} test 26 {} -body { vlerq def A:L 2.3 } -returnCodes 1 -result {expected integer but got "2.3"} test 27 {} -body { vlerq def A:F a } -returnCodes 1 -result {expected floating-point number but got "a"} test 28 {} -body { vlerq def A:D b } -returnCodes 1 -result {expected floating-point number but got "b"} test 29 {} -body { vlerq def A { {}? } } -returnCodes 1 -result \ {list element in braces followed by "?" instead of space} test 30 {} -body { vlerq data [vlerq mdef A] { {}? } } -returnCodes 1 -result \ {list element in braces followed by "?" instead of space} test 31 {F118, 2006-12-16} -body { vlerq get [vlerq def a {1 2 3 4}] 4 a } -returnCodes 1 -result {row index out of range} test 32 {} -body { vlerq get [vlerq def a {1 2 3 4}] -5 a } -returnCodes 1 -result {row index out of range} test 33 {} -body { vlerq get [vlerq def a {1 2 3 4}] 0 1 } -returnCodes 1 -result {column index out of range} test 34 {} -body { vlerq get [vlerq def a {1 2 3 4}] 0 -2 } -returnCodes 1 -result {column index out of range} test 35 {} -body { vlerq get [vlerq def a {1 2 3 4}] -5 -2 } -returnCodes 1 -result {row index out of range} test 36 {} -body { vlerq mdesc {a]b[,} } -returnCodes 1 -result {invalid view} test 37 {} -body { vlerq mdef {{a b c}} } -returnCodes 1 -result {invalid view} test 38 {} -body { vlerq rename } -returnCodes 1 -result {wrong # args: should be "vlerq rename view any"} test 39 {} -body { vlerq getcol } -returnCodes 1 -result {wrong # args: should be "vlerq getcol view col"} test 40 {} -body { vlerq group } -returnCodes 1 \ -result {wrong # args: should be "vlerq group view col* string"} test 41 {} -body { # F142, 2007-03-02 vlerq def a:0 1 } -returnCodes 1 -result {invalid view} test 42 {F150} -body { vlerq colmap [vlerq def A {}] B } -returnCodes 1 -result {colmap: invalid column name} test 43 {F151 concat} -body { set v [vlerq def {A B} {}] set w [vlerq def A {}] vlerq concat $v $w } -returnCodes 1 -result {invalid view} test 44 {F151 union} -body { vlerq union $v $w } -returnCodes 1 -result {invalid view} test 45 {incompatible intersect} -body { vlerq intersect $v $w } -returnCodes 1 -result {invalid view} unset -nocomplain v w x i ::tcltest::cleanupTests vqtcl/tests/file.test0000755000076500007650000001422010611154237014575 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {} { vlerq meta [vlerq open data/lkit-le.db] } {mdef {{dirs {name parent:I {files {name size:I date:I contents:B}}}}}} test 2 {} { vlerq meta [vlerq open data/lkit-be.db] } {mdef {{dirs {name parent:I {files {name size:I date:I contents:B}}}}}} test 3 {} -body { set v [vlerq get [vlerq open data/lkit-le.db] 0 0] } -match glob -result {data *\ { lib app-listk cgi1.6} {-1 0 1 1}\ {{data * {main.tcl ChangeLog} {67 167} {1039266154 1046092593} {* *}}\ {data * {} {} {} {}}\ {data * {pkgIndex.tcl listk.tcl tcl2html.tcl} {72 2452 5801}\ {1039266186 1046093102 1046093789} {* * *}}\ {data * {pkgIndex.tcl cgi.tcl} {532 65885} {1020940611 1020940611} {* *}}}} test 4 {} { list [string length [vlerq get $v 0 2 0 3]] \ [string length [vlerq get $v 0 2 1 3]] \ [string length [vlerq get $v 2 2 0 3]] \ [string length [vlerq get $v 2 2 1 3]] \ [string length [vlerq get $v 2 2 2 3]] \ [string length [vlerq get $v 3 2 0 3]] \ [string length [vlerq get $v 3 2 1 3]] } {54 130 72 1132 2434 317 15621} test 5 {} -body { set w [vlerq get [vlerq open data/lkit-be.db] 0 0] } -match glob -result {data *\ { lib app-listk cgi1.6} {-1 0 1 1}\ {{data * {ChangeLog main.tcl} {167 67} {1046092593 1039266154} {* *}}\ {data * {} {} {} {}}\ {data * {listk.tcl pkgIndex.tcl tcl2html.tcl} {2452 72 5801}\ {1046093102 1039266186 1046093789} {* * *}}\ {data * {cgi.tcl pkgIndex.tcl} {65885 532} {1020940611 1020940611} {* *}}}} test 6 {} { list [string length [vlerq get $w 0 2 0 3]] \ [string length [vlerq get $w 0 2 1 3]] \ [string length [vlerq get $w 2 2 0 3]] \ [string length [vlerq get $w 2 2 1 3]] \ [string length [vlerq get $w 2 2 2 3]] \ [string length [vlerq get $w 3 2 0 3]] \ [string length [vlerq get $w 3 2 1 3]] } {130 54 1132 72 2434 15621 317} test 7 {} -body { set fd [open data/lkit-le.db] fconfigure $fd -translation binary set data [read $fd] close $fd vlerq get [vlerq load $data] 0 0 } -match glob -result {data *\ { lib app-listk cgi1.6} {-1 0 1 1}\ {{data * {main.tcl ChangeLog} {67 167} {1039266154 1046092593} {* *}}\ {data * {} {} {} {}}\ {data * {pkgIndex.tcl listk.tcl tcl2html.tcl} {72 2452 5801}\ {1039266186 1046093102 1046093789} {* * *}}\ {data * {pkgIndex.tcl cgi.tcl} {532 65885} {1020940611 1020940611} {* *}}}} test 8 {} -body { set fd [open data/lkit-be.db] fconfigure $fd -translation binary set data [read $fd] close $fd vlerq get [vlerq load $data] 0 0 } -match glob -result {data *\ { lib app-listk cgi1.6} {-1 0 1 1}\ {{data * {ChangeLog main.tcl} {167 67} {1046092593 1039266154} {* *}}\ {data * {} {} {} {}}\ {data * {listk.tcl pkgIndex.tcl tcl2html.tcl} {2452 72 5801}\ {1046093102 1039266186 1046093789} {* * *}}\ {data * {cgi.tcl pkgIndex.tcl} {65885 532} {1020940611 1020940611} {* *}}}} test 9 {} { vlerq structure $v } SI(SIIB) test 10 {} { vlerq structdesc $v } {name:S,parent:I,files[name:S,size:I,date:I,contents:B]} test 11 {} { vlerq compat $v $w } 1 test 12 {} { vlerq compare $v $w } 1 test 13 {} { vlerq compare $w $v } -1 test 14 {} { set r {} foreach i {0 1 2 3} { lappend r [vlerq compare [vlerq get $v $i 2] [vlerq get $w $i 2]] } set r } {1 0 1 1} test 15 {} { set r {} foreach i {0 1 2 3} { lappend r [vlerq compare [vlerq get $w $i 2] [vlerq get $v $i 2]] } set r } {-1 0 -1 -1} test 16 {} { set r {} foreach i {0 1 2 3} { lappend r [vlerq compare [vlerq sort [vlerq get $v $i 2]] \ [vlerq sort [vlerq get $w $i 2]]] } set r } {0 0 0 0} test 17 {} { vlerq open data/gtest.db } {data {mdef {{frequents {drinker bar perweek:I}}\ {likes {drinker beer perday:I}}\ {serves {bar beer quantity:I}}}}\ {{data {mdef {drinker bar perweek:I}}\ {adam woody sam norm wilt norm lola norm woody pierre}\ {lolas cheers cheers cheers joes joes lolas lolas lolas frankies}\ {1 5 5 3 2 1 6 2 1 0}}}\ {{data {mdef {drinker beer perday:I}}\ {adam wilt sam norm norm nan woody lola}\ {bud rollingrock bud rollingrock bud sierranevada pabst mickies}\ {2 1 2 3 2 1 2 5}}}\ {{data {mdef {bar beer quantity:I}}\ {cheers cheers joes joes joes lolas lolas winkos frankies}\ {bud samaddams bud samaddams mickies mickies pabst rollingrock snafu}\ {500 255 217 13 2222 1515 333 432 5}}}} test 18 {} { set v [vlerq def {A {B C}} [list a [vlerq def C {1 2 3}] \ b [vlerq def C {4 5 6 7}]]] vlerq get $v } {a {data {mdef C} {1 2 3}} b {data {mdef C} {4 5 6 7}}} test 19 {} { vlerq get [vlerq load [vlerq emit $v]] } {a {data {mdef C} {1 2 3}} b {data {mdef C} {4 5 6 7}}} test 20 {} { set v [vlerq def {A B:V} [list a [vlerq def C {1 2 3}] \ b [vlerq def {D E} {4 5 6 7}]]] vlerq get $v } {a {data {mdef C} {1 2 3}} b {data {mdef {D E}} {4 6} {5 7}}} test 21 {} { vlerq meta [vlerq load [vlerq emit $v]] } {mdef {A {B {}}}} test 22 {} { set z [vlerq emit $v] binary scan $z H* w regsub -all {..} [string replace $w 0 3 4?4?] {& } } {4? 4? 1a 00 00 00 00 5e 61 00 62 00 22 31 00 32\ 00 33 00 2a 34 00 36 00 22 35 00 37 00 22 80 83\ 43 3a 53 83 86 8d 81 93 80 80 87 44 3a 53 2c 45\ 3a 53 82 84 94 81 98 80 84 99 81 9d 80 80 87 41\ 3a 53 2c 42 3a 56 82 84 88 81 8c 80 9f 9e 80 00\ 00 00 00 00 00 4e 80 00 00 11 00 00 00 3d } test 23 {} { vlerq get [vlerq load [vlerq emit $v]] 0 * } {a {data {mdef C} {1 2 3}}} test 24 {} { vlerq get [vlerq load [vlerq emit $v]] 1 * } {b {data {mdef {D E}} {4 6} {5 7}}} unset -nocomplain r v w i z fd ::tcltest::cleanupTests vqtcl/tests/get.test0000755000076500007650000000474610611154237014451 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {} { set v [vlerq data [vlerq mdef {A B}] {a b c} {d e f}] vlerq get $v } {a d b e c f} test 2 {} { vlerq get 5 # } 5 test 3 {} { vlerq get 5 * } {{} {} {} {} {}} test 4 {} { vlerq get 5 * * } {} test 5 {} { vlerq get 5 * # } {0 1 2 3 4} test 6 {} { vlerq get 5 @ # } 0 test 7 {} { vlerq get 5 @ * 0 } {} test 8 {} { vlerq get 5 @ * } {} test 9 {} { vlerq get 5 @ * * } {} test 10 {} { vlerq get 5 @ * # } {} test 11 {} { vlerq get 5 @ @ # } 3 test 12 {} { vlerq get 5 @ @ * 0 } {name type subv} test 13 {} { vlerq get 5 @ @ * 1 } {S S V} test 14 {} { vlerq get 5 @ @ * 2 } {{} {} {}} test 15 {} { vlerq get 5 @ @ * -1 } {{} {} {}} test 16 {} { vlerq get 5 @ @ * -2 } {S S V} test 17 {} { vlerq get 5 @ @ * -3 } {name type subv} test 18 {} { vlerq get 5 @ @ * } {{name S {}} {type S {}} {subv V {}}} test 19 {} { vlerq get 5 @ @ * * } {name S {} type S {} subv V {}} test 20 {} { vlerq get 5 @ @ * # } {0 1 2} test 21 {} { vlerq get "" # } 0 test 22 {} { vlerq get "" * 0 } {} test 23 {} { vlerq get "" * } {} test 24 {} { vlerq get "" * * } {} test 25 {} { vlerq get "" * # } {} test 26 {} { vlerq get "" @ # } 3 test 27 {} { vlerq get "" @ * 0 } {name type subv} test 28 {} { vlerq get "" @ * 1 } {S S V} test 29 {} { vlerq get "" @ * 2 } {{} {} {}} test 30 {} { vlerq get "" @ * -1 } {{} {} {}} test 31 {} { vlerq get "" @ * -2 } {S S V} test 32 {} { vlerq get "" @ * -3 } {name type subv} test 33 {} { vlerq get "" @ * } {{name S {}} {type S {}} {subv V {}}} test 34 {} { vlerq get "" @ * * } {name S {} type S {} subv V {}} test 35 {} { vlerq get "" @ * # } {0 1 2} test 36 {} { vlerq get "" @ * name } {name type subv} test 37 {} { vlerq get "" @ * type } {S S V} test 38 {} { vlerq get "" @ * subv } {{} {} {}} test 39 {} { vlerq get "" @ 0 } {name name type S subv {}} test 40 {} { vlerq get "" @ 1 } {name type type S subv {}} test 41 {} { vlerq get "" @ 2 } {name subv type V subv {}} test 42 {} { vlerq get "" @ # * # } {0 1 2} test 43 {} { vlerq get [vlerq def A {a b c}] * # } {0 1 2} test 43 {} { vlerq get [vlerq def A {a b c}] -2 # } 1 ::tcltest::cleanupTests vqtcl/tests/hash.test0000755000076500007650000002722510611154237014612 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { vlerq hashcol I {} } {} test 2 {} { vlerq hashcol I {0 1 10 -0 -1 -10} } {0 1 10 0 -1 -10} test 3 {} { vlerq hashcol L {0 -0 123456789 12345678901 12345678902} } {0 0 123456789 -539222985 -539222988} test 4 {} tcl8.4 { vlerq hashcol D {0 -0 12345.6789 12345.678901 12345.678902} } {0 -2147483648 -1493572489 -1494073142 -1500863666} test 5 {} tcl8.4 { vlerq hashcol F {0 -0 12345.6789 12345.678901 12345.678902} } {0 -2147483648 1178658487 1178658487 1178658487} test 6 {} { vlerq hashcol S {"" a aa A 0 1 -0} } {0 698601184 1080305280 -107479360 -938362831 1636964016 1298176885} test 7 {} { vlerq hashcol B {"" a aa A 0 1 -0} } {3166080 698601184 1080305280 -107479360 -938362831 1636964016 1298176885} test 8 {} { vlerq hashview {} } {} test 9 {} { vlerq hashview [vlerq meta ""] } {-236896329 -54087954 589683543} test 10 {} { vlerq rowhash [vlerq meta ""] 1 } -54087954 test 11 {} { vlerq rowhash [vlerq def A:B abc] 0 } -307079773 test 12 {} { vlerq getinfo {} {} 0 } {{} {0 0 0 0} {}} test 13 {} { set v [vlerq def A:I {1 2 1 2 1 3}] vlerq getinfo $v $v 0 } {{0 1 5} {0 0 0 2 0 3 0 1} {1 2 1 2 1 3}} test 14 {} { set v [vlerq def A {a b a b a c}] set h [vlerq getinfo $v $v 0] } {{0 1 5} {2 0 3 1 0 0 0 0}\ {698601184 -1021039261 698601184 -1021039261 698601184 1554287586}} test 15 {} { eval [linsert $h 0 vlerq hashfind $v 1 $v] } 1 test 16 {} { eval [linsert $h 0 vlerq hashfind [vlerq def A x] 0 $v] } -1 test 17 {} { vlerq getinfo {} {} 1 } {{} {} {}} test 18 {} { set v [vlerq def A:I {1 2 1 2 1 3}] vlerq getinfo $v $v 1 } {{0 1 5} {3 5 6} {0 2 4 1 3 5}} test 19 {} { set v [vlerq def A {a b a b a c}] vlerq getinfo $v $v 1 } {{0 1 5} {3 5 6} {0 2 4 1 3 5}} test 20 {} { vlerq uniquemap {} } {} test 21 {} { vlerq uniquemap [vlerq def A:I {1 2 1 2 1 3}] } {0 1 5} test 22 {} { vlerq uniquemap [vlerq def A:I {1 2 3 4 5 6}] } {0 1 2 3 4 5} test 23 {} { vlerq uniquemap [vlerq def A {a b a b a c}] } {0 1 5} test 24 {} { vlerq uniquemap [vlerq def A {a a a a a a}] } {0} test 25 {} { vlerq uniquemap [vlerq data [vlerq mdef {A B:I}] {a 0 a 0 a -0} \ {1 0 0 0 -0 0}] } {0 1 2 5} test 26 {} { vlerq unique [vlerq def A {a b a b a c}] } {data {mdef A} {a b c}} test 27 {} { vlerq isectmap [vlerq def A {d b a}] [vlerq def A {a b c}] } {1 2} test 28 {} { vlerq intersect [vlerq def A {a b c}] [vlerq def A {d b a}] } {data {mdef A} {a b}} test 29 {} { vlerq except [vlerq def A {a b c d e}] [vlerq def A {d b a}] } {data {mdef A} {c e}} test 30 {} { vlerq union [vlerq def A {a b c}] [vlerq def A {e b a d}] } {data {mdef A} {a b c e d}} test 31 {} { set v [vlerq def A {a b c d e}] vlerq getinfo $v $v 1 } {{0 1 2 3 4} {1 2 3 4 5} {0 1 2 3 4}} test 32 {} { set v [vlerq def A {a b b c c c}] vlerq getinfo $v $v 1 } {{0 1 3} {1 3 6} {0 1 2 3 4 5}} test 33 {} { set v [vlerq def A {a b a b a c}] vlerq getinfo $v $v 1 } {{0 1 5} {3 5 6} {0 2 4 1 3 5}} test 34 {} { set v [vlerq def A {a b c d d}] vlerq getinfo $v $v 1 } {{0 1 2 3} {1 2 3 5} {0 1 2 3 4}} test 35 {} { vlerq group [vlerq def A {a b c d e}] 0 G } {data {mdef {A {G {}}}} {a b c d e} {1 1 1 1 1}} test 36 {} { vlerq group [vlerq def A {a b b c c c}] 0 G } {data {mdef {A {G {}}}} {a b c} {1 2 3}} test 37 {} { vlerq group [vlerq def A {a b b c c c}] {} G } {data {mdef {{G A}}} {{data {mdef A} {a b b c c c}}}} test 38 {} { vlerq group [vlerq def A {a b a b a c}] 0 G } {data {mdef {A {G {}}}} {a b c} {3 2 1}} test 39 {} { vlerq group [vlerq def A {a b a b a c}] A G } {data {mdef {A {G {}}}} {a b c} {3 2 1}} test 40 {} { set v [vlerq group [vlerq def {A B:I} {a 0 b 1 c 1 d 1 d 0}] 0 G] } {data {mdef {A {G B:I}}} {a b c d} {{data {mdef B:I} 0}\ {data {mdef B:I} 1}\ {data {mdef B:I} 1}\ {data {mdef B:I} {1 0}}}} test 41 {} { vlerq hashcol V [vlerq getcol $v 1] } {1 0 0 3} test 42 {} { vlerq hashcol V [vlerq getcol $v G] } {1 0 0 3} test 43 {} { vlerq getinfo [vlerq def A {a b c}] [vlerq def A {a b c d e a b c d e}] 2 } {{0 1 2} {2 4 6} {0 5 1 6 2 7}} test 44 {} { vlerq getinfo [vlerq def A {a b c}] [vlerq def A {a c a c}] 2 } {{0 1 2} {2 2 4} {0 2 1 3}} test 45 {} { vlerq getinfo [vlerq def A {a b c d}] [vlerq def A {a b c e a b c e}] 2 } {{0 1 2 3} {2 4 6 6} {0 4 1 5 2 6}} test 46 {} { vlerq getinfo [vlerq def A {a b c}] [vlerq def A {d e f}] 2 } {{0 1 2} {0 0 0} {}} test 47 {} { vlerq getinfo [vlerq def A a] [vlerq def A {a b a b a b}] 2 } {0 3 {0 2 4}} test 48 {} { vlerq getinfo [vlerq def A {a a a}] [vlerq def A {a b a b a b}] 2 } {{0 0 0} 3 {0 2 4}} test 49 {} { set v [vlerq def {B C} {c d e f c d d e}] set w [vlerq def {B C} {c d c d d e}] vlerq getinfo $v $w 2 } {{0 1 0 2} {2 2 3} {0 1 2}} test 50 {} { set v [vlerq def {A B} {}] set w [vlerq def {B C} {}] vlerq isectmap [vlerq namecol $v] [vlerq namecol $w] } 1 test 51 {} { vlerq isectmap [vlerq namecol $w] [vlerq namecol $v] } 0 test 52 {} { vlerq join [vlerq def A {a b c}] [vlerq def A {a b c d e a b c d e}] J } {data {mdef {A {J {}}}} {a b c} {2 2 2}} test 53 {} { vlerq join [vlerq def A {a b c}] [vlerq def A {a c a c}] J } {data {mdef {A {J {}}}} {a b c} {2 0 2}} test 54 {} { vlerq join [vlerq def A {a b c d}] [vlerq def A {a b c e a b c e}] J } {data {mdef {A {J {}}}} {a b c d} {2 2 2 0}} test 55 {} { vlerq join [vlerq def A {a b c}] [vlerq def A {d e f}] J } {data {mdef {A {J {}}}} {a b c} {0 0 0}} test 56 {} { vlerq join [vlerq def A a] [vlerq def A {a b a b a b}] J } {data {mdef {A {J {}}}} a 3} test 57 {} { vlerq join [vlerq def A {a a a}] [vlerq def A {a b a b a b}] J } {data {mdef {A {J {}}}} {a a a} {3 3 3}} test 58 {} { set v [vlerq data [vlerq mdef {A B}] {a b c} {A B C}] set w [vlerq data [vlerq mdef {A C}] {a c a c} {1 3 1 3}] vlerq join $v $w J } {data {mdef {A B {J C}}} {a b c} {A B C} {{data {mdef C} {1 1}}\ {data {mdef C} {}}\ {data {mdef C} {3 3}}}} test 59 {} { vlerq ungroup [vlerq join $v $w J] -1 } {data {mdef {A B C}} {a a c c} {A A C C} {1 1 3 3}} test 60 {} { vlerq ungroup [vlerq join $v $w J] J } {data {mdef {A B C}} {a a c c} {A A C C} {1 1 3 3}} test 61 {} { vlerq ijoin $v $w } {data {mdef {A B C}} {a a c c} {A A C C} {1 1 3 3}} test 62 {} { set v [vlerq def {A B C} {a c d a e f e c d a d e}] set w [vlerq def {B C D} {c d e c d f d e f}] vlerq ijoin $v $w } {data {mdef {A B C D}} {a a e e a} {c c c c d} {d d d d e} {e f e f f}} test 63 {} { vlerq join [vlerq def A {a b c}] [vlerq def B {A B C}] J } {data {mdef {A {J B}}} {a b c} {{data {mdef B} {A B C}}\ {data {mdef B} {A B C}}\ {data {mdef B} {A B C}}}} test 64 {} { set v [vlerq data [vlerq mdef {A B}] {a b c} {A B C}] vlerq join $v $v J } {data {mdef {A B {J {}}}} {a b c} {A B C} {1 1 1}} test 65 {} { set v [vlerq def {A B C} {a c d a e f e c d a d e}] set w [vlerq def {B C D} {c d e c d f d e f}] vlerq join $v $w J } {data {mdef {A B C {J D}}} {a a e a} {c e c d} {d f d e}\ {{data {mdef D} {e f}}\ {data {mdef D} {}}\ {data {mdef D} {e f}}\ {data {mdef D} f}}} test 66 {} { set r {} foreach x {a b c d e f g} { lappend r [vlerq strlookup $x {b c d e f}] } set r } {-1 0 1 2 3 4 -1} test 67 {} { # vlerq cvstrac #38 vlerq except [vlerq def {a b} {1 2 3 4 1 2}] [vlerq def {a b} {3 4}] } {data {mdef {a b}} {1 1} {2 2}} test 68 {} { vlerq except [vlerq def {a b} {1 2 3 4}] [vlerq def {a b} {3 4}] } {data {mdef {a b}} 1 2} set v [vlerq group [vlerq def {a b} {1 2 3 4 5 6 7 8}] a g] test 69 {} { vlerq loop $v -collect { [vlerq rowhash $v $(#)] } } {-1702861950 -1165893242 -1501528190 1853940110} test 70 {} { vlerq getinfo $v $v 0 } {{0 1 2 3} {4 0 0 3 0 0 2 1} {-1702861950 -1165893242 -1501528190 1853940110}} test 71 {} { # bt: failed on 2006-12-02 set v [vlerq group [vlerq def {a b} {1 2 3 4 5 6 7 8}] a g] vlerq get [vlerq except $v [vlerq slice $v 2 2 2]] } {3 {data {mdef b} 4} 7 {data {mdef b} 8}} test 72 {} { set v [vlerq def {a b} {1 {2 3 4} 2 {3 4 5} 3 4}] set w [vlerq loop $v -collect { [vlerq def d $(b)] }] set w [vlerq def {{c d}} $w] set v [vlerq pair $v $w] } {data {mdef {a b {c d}}} {1 2 3}\ {{2 3 4} {3 4 5} 4}\ {{data {mdef d} {2 3 4}}\ {data {mdef d} {3 4 5}}\ {data {mdef d} 4}}} test 73 {} { vlerq ungroup $v c } {data {mdef {a b d}} {1 1 1 2 2 2 3}\ {{2 3 4} {2 3 4} {2 3 4} {3 4 5} {3 4 5} {3 4 5} 4}\ {2 3 4 3 4 5 4}} test 74 {join ok} { vlerq join [vlerq def a {1 3}] [vlerq def {a b} {1 2 3 4}] J } {data {mdef {a {J b}}} {1 3} {{data {mdef b} 2} {data {mdef b} 4}}} test 75 {join bad: F115} { vlerq join [vlerq def a:I {1 3}] [vlerq def {a:I b} {1 2 3 4}] J } {data {mdef {a:I {J b}}} {1 3} {{data {mdef b} 2} {data {mdef b} 4}}} test 76 {} { set v [vlerq def A {1 2 3 4 5}] set w [vlerq def A {4 2 2 6 4}] vlerq exceptmap $v $w } {0 2 4} test 77 {} { set v [vlerq def A {4 2 2 6 4}] set w [vlerq def A {1 2 3 4 5}] vlerq unionmap $v $w } {0 2 4} test 78 {} { set v [vlerq def {a b c} {1 a b 2 c d}] vlerq group $v {a c} g } {data {mdef {a c {g b}}} {1 2} {b d} {{data {mdef b} a} {data {mdef b} c}}} test 79 {} { # bt: failed on 2007-02-05, see fff/138 vlerq group $v {c a} g } {data {mdef {c a {g b}}} {b d} {1 2} {{data {mdef b} a} {data {mdef b} c}}} test 80 {} { vlerq getinfo $v $v 1 } {{0 1} {1 2} {0 1}} test 81 {} { vlerq grouped [vlerq colmap $v b] {1 2} {0 1} g } {data {mdef {{g b}}} {{data {mdef b} a} {data {mdef b} c}}} test 82 {} { set v [vlerq def {A B C} {a c d a e f e c d a d e}] set w [vlerq def {B C D} {c d e c d f d e f}] vlerq ijoin $v $w } {data {mdef {A B C D}} {a a e e a} {c c c c d} {d d d d e} {e f e f f}} test 83 {} { vlerq join $v $w J } {data {mdef {A B C {J D}}} {a a e a} {c e c d} {d f d e}\ {{data {mdef D} {e f}}\ {data {mdef D} {}}\ {data {mdef D} {e f}}\ {data {mdef D} f}}} test 84 {} { vlerq isectmap [vlerq meta $v] [vlerq meta $w] } {1 2} test 85 {} { vlerq isectmap [vlerq meta $w] [vlerq meta $v] } {0 1} test 86 {} { # bt: failed on 2007-02-10, see fff/140 set x [vlerq colmap $v {C A B}] vlerq ijoin $x $w } {data {mdef {C A B D}} {d d d d e} {a a e e a} {c c c c d} {e f e f f}} test 87 {} { vlerq join $x $w J } {data {mdef {C A B {J D}}} {d f d e} {a a e a} {c e c d}\ {{data {mdef D} {e f}}\ {data {mdef D} {}}\ {data {mdef D} {e f}}\ {data {mdef D} f}}} test 88 {} { vlerq isectmap [vlerq meta $x] [vlerq meta $w] } {0 2} test 89 {} { vlerq isectmap [vlerq meta $w] [vlerq meta $x] } {0 1} unset -nocomplain r v w x h ::tcltest::cleanupTests vqtcl/tests/indirect.test0000755000076500007650000000425110611154237015462 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { set v [vlerq def A {a b c d e f}] vlerq remap $v {} } {data {mdef A} {}} test 2 {} { vlerq remap $v {1 3 5} } {data {mdef A} {b d f}} test 3 {} { vlerq remap $v {5 3 1 0 2 4} } {data {mdef A} {f d b a c e}} test 4 {} { vlerq remap $v {1 -1 -2 4 3 -1 5} } {data {mdef A} {b b b e d d f}} test 5 {} { vlerq step $v 6 0 1 1 } {data {mdef A} {a b c d e f}} test 6 {} { vlerq step 0 1 1 1 1 } 0 test 7 {} { vlerq step $v 5 1 1 1 } {data {mdef A} {b c d e f}} test 8 {} { vlerq step $v 3 0 2 1 } {data {mdef A} {a a b b c c}} test 9 {} { vlerq step $v 6 0 1 2 } {data {mdef A} {a c e a c e}} test 10 {} { vlerq step $v 6 -1 1 -1 } {data {mdef A} {f e d c b a}} test 11 {} { vlerq step $v 12 3 1 1 } {data {mdef A} {d e f a b c d e f a b c}} test 12 {} { vlerq step $v 12 3 1 -1 } {data {mdef A} {d c b a f e d c b a f e}} test 13 {} { vlerq concat [vlerq def A {}] [vlerq def A {1 2 3}] } {data {mdef A} {1 2 3}} test 14 {} { vlerq concat [vlerq def A {a b c}] [vlerq def A {1 2 3}] } {data {mdef A} {a b c 1 2 3}} test 15 {} { set v [vlerq data [vlerq mdef {A B}] {a b c} {1 2 3}] vlerq meta [vlerq grouped $v {1 2 3} {0 1 2} G] } {mdef {{G {A B}}}} test 16 {} { vlerq grouped $v {1 2 3} {0 1 2} G } {data {mdef {{G {A B}}}} {{data {mdef {A B}} a 1}\ {data {mdef {A B}} b 2}\ {data {mdef {A B}} c 3}}} test 17 {} { set v [vlerq data [vlerq mdef {A B}] {a b c d e f} {1 2 3 4 5 6}] vlerq grouped $v {1 3 6} {0 1 2 3 4 5} G } {data {mdef {{G {A B}}}} {{data {mdef {A B}} a 1}\ {data {mdef {A B}} {b c} {2 3}}\ {data {mdef {A B}} {d e f} {4 5 6}}}} test 18 {} { vlerq grouped $v {1 3 6} {5 3 4 0 1 2} G } {data {mdef {{G {A B}}}} {{data {mdef {A B}} f 6}\ {data {mdef {A B}} {d e} {4 5}}\ {data {mdef {A B}} {a b c} {1 2 3}}}} unset -nocomplain v ::tcltest::cleanupTests vqtcl/tests/initests.tcl0000644000076500007650000000340110574304471015324 0ustar jcwjcw00000000000000# common test setup script #puts "vars: [info vars ?] [info vars ??]" if {[info exists testsInited]} return package require Tcl 8.4 if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.2 namespace import tcltest::* } singleProcess true ;# run without forking testsDirectory [file dirname [info script]] # if run from the tests directory, move one level up if {[pwd] eq [testsDirectory]} { cd .. } temporaryDirectory [pwd] workingDirectory [file dirname [testsDirectory]] # TextMate support on Mac OS X: run make before running any test from editor if {[info exists env(TM_FILENAME)]} { if {[catch { exec make } msg]} { puts stderr $msg exit 1 } } proc readfile {filename} { set fd [open $filename] set data [read $fd] close $fd return $data } # extract version number from pkgIndex.tcl regexp {ifneeded vlerq\s(\S+)\s} [readfile pkgIndex.tcl] - version unset - # make sure the pkgIndex.tcl is found if {[lsearch $auto_path [workingDirectory]] < 0} { lappend auto_path [workingDirectory] } testConstraint 64bit [expr {$tcl_platform(wordSize) == 8}] testConstraint bigendian [expr {$tcl_platform(byteOrder) eq "bigEndian"}] testConstraint kitten [file exists [temporaryDirectory]/kitten.kit] testConstraint metakit [expr {![catch { package require Mk4tcl }]}] testConstraint tcl$tcl_version 1 testConstraint vfs [expr {![catch { package require vfs }]}] set testsInited 1 vqtcl/tests/kitten.test0000755000076500007650000000222210611154237015153 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {load mkclvfs package} vfs { if {[file exists src_tcl/mkclvfs.tcl]} { source src_tcl/mkclvfs.tcl } else { source library/mkclvfs.tcl } package require vfs::mkcl } 1.5 test 2 {} -constraints {vfs kitten} -body { set fs [vfs::mkcl::Mount [temporaryDirectory]/kitten.kit /kitten] } -match glob -result mkclvfs* test 3 {} {vfs kitten} { lsort -dict [glob -directory /kitten -tails -types f *] } {ChangeLog main.tcl} test 4 {} {vfs kitten} { lsort -dict [glob -directory /kitten -tails -types d *] } {doc lib} test 5 {} -constraints {vfs kitten} -body { lsort -dict [glob -directory /kitten/lib -tails -types f *] } -match glob -result {httpdist.tcl * md5.tcl} test 6 {} -constraints {vfs kitten} -body { lsort -dict [glob -directory /kitten/lib -tails -types d *] } -match glob -result {ascenc-0.11 autoproxy * tls-1.4 wcb2.8 wikit yeti-0.4} test 7 {} {vfs kitten} { vfs::unmount /kitten } {} unset -nocomplain fs ::tcltest::cleanupTests vqtcl/tests/l.large.test0000755000076500007650000000334210611154237015205 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% # large file tests, skipped by default because they take a lot of time source [file join [file dir [info script]] initests.tcl] set tmp [makeDirectory testfiles.tmp] test 0 {load extension} { package require vlerq } $version proc bigview {n} { vlerq repeat [vlerq group [vlerq def A [vlerq iota $n]] {} _B] $n } test 1 {} { set v [bigview 10] vlerq structdesc $v } {_B[A:S]} test 2 {} { vlerq size [vlerq blocked $v] } 100 test 3 {} { vlerq save $v $tmp/b1.db } 346 test 4 {} -body { vlerq size [vlerq blocked [vlerq open $tmp/b1.db]] } -result 100 -cleanup { file delete $tmp/b1.db } test 5 {} { # correct: gives same result on 32b- and 64b on 2006-12-13 string length [vlerq emit [bigview 7088]] } 268571360 test 6 {} { # wrong: gave different result (268651792) on 32b and 64b on 2006-12-13 # diff = 16 bytes less string length [vlerq emit [bigview 7089]] } 268651808 test 7 {} { set v [bigview 10000] vlerq size [vlerq blocked $v] } 100000000 test 8 {} { # wrong: gave different result (539080016) on 32b and 64b on 2006-12-13 # diff 40160 bytes = 2510x 16 bytes less vlerq save $v $tmp/b2.db } 539120176 test 9 {} -body { vlerq size [vlerq blocked [vlerq open $tmp/b2.db]] } -result 100000000 -cleanup { file delete $tmp/b2.db } test 10 {} { set v [bigview 20000] vlerq size [vlerq blocked $v] } 400000000 test 11 {} 64bit { vlerq save $v $tmp/b3.db } 2378195504 test 12 {} -constraints 64bit -body { vlerq size [vlerq blocked [vlerq open $tmp/b3.db]] } -result 400000000 -cleanup { file delete $tmp/b3.db } test 13 {} { vlerq size [vlerq blocked [bigview 40000]] } 1600000000 ::tcltest::cleanupTests vqtcl/tests/l.leaks.test0000644000076500007650000000135010636444404015211 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% # memory leaks tests, skipped by default because this may take a lot of time source [file join [file dir [info script]] initests.tcl] set cmd {vlerq open data/mkblk.db} set cmd {vlerq def {A B C} {1 2 3 4 5 6 7 8 9}} set cmd {vlerq loop [vlerq def A {1 2}] { append a $(A) }; unset a "" } proc memuse {} { set out [exec ps l -p [pid]] lindex [split $out \n] 1 [lsearch $out RSS] } test 0 {} { package require vlerq } $version memuse test 1 {} { memuse } [memuse] test 2 {} { eval $cmd return } {} test 3 {} { eval $cmd memuse } [memuse] test 4 {} { for {set i 0} {$i < 10000} {incr i} { eval $cmd } memuse } [memuse] ::tcltest::cleanupTests vqtcl/tests/loop.test0000755000076500007650000000461110611154237014632 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version set v [vlerq def {A B C} {1 2 3 11 22 33 111 222 333}] test 1 {} { set i 0 vlerq loop $v c { incr i } set i } 3 test 2 {} { set r {} vlerq loop $v c { lappend r $c(#) } set r } {0 1 2} test 3 {} { set r {} vlerq loop $v c { lappend r $c(B) $c(A) } set r } {2 1 22 11 222 111} set w [vlerq def A {1 2 3 4 5 6 7 8 9}] test 4 {} { vlerq loop $w c -index 1 } {0 1 2 3 4 5 6 7 8} test 5 {} { vlerq loop $w c -index { $c(A) % 2 } } {0 2 4 6 8} test 6 {} { vlerq loop $w c -index { $c(A) > 3 && $c(A) < 6 } } {3 4} test 7 {} { vlerq loop $w c -index { $c(A) == $c(#) + 1 } } {0 1 2 3 4 5 6 7 8} test 8 {} { vlerq get [vlerq loop $w c -where 1] } {1 2 3 4 5 6 7 8 9} test 9 {} { vlerq get [vlerq loop $w c -where { $c(A) % 2 }] } {1 3 5 7 9} test 10 {} { vlerq get [vlerq loop $w c -where { $c(A) > 3 && $c(A) < 6 }] } {4 5} test 11 {} { vlerq get [vlerq loop $w c -where { $c(A) == $c(#) + 1 }] } {1 2 3 4 5 6 7 8 9} test 12 {loop var must end up in current namespace} { namespace eval t1 { vlerq loop $w c1 -index { $c1(A) % 2 } } list [info exists c1] [array get t1::c1] } {0 {A 9}} namespace forget t1 unset c test 13 {loop with parray} -body { vlerq loop [vlerq def {A B C} {1 2 3 11 22 33 111 222 333}] c {parray c} } -output {} test 14 {loop on single column} { set r {} vlerq loop [vlerq def A {1 2 3}] c { lappend r $c(A) } set r } {1 2 3} unset c test 15 {try to loop on non-array} { set c 1 catch { vlerq loop [vlerq def A {1 2 3}] c { lappend r $c(A) } } r unset c set r } {can't trace "c(#)": variable isn't array} test 16 {} { set r {} vlerq loop [vlerq def A {1 2 3}] { lappend r x$(A) if {$(A) >= 2} break lappend r y$(A) } set r } {x1 y1 x2} test 17 {} { set r {} vlerq loop [vlerq def A {1 2 3}] { lappend r x$(A) if {$(A) >= 2} continue lappend r y$(A) } set r } {x1 y1 x2 x3} test 18 {} { set r {} set c [catch { vlerq loop [vlerq def A {1 2 3}] { lappend r x$(A) if {$(A) >= 2} { error booh! } lappend r y$(A) } } e] lappend r $c $e } {x1 y1 x2 1 booh!} unset -nocomplain r c e v w i ::tcltest::cleanupTests vqtcl/tests/m2m.test0000755000076500007650000000301210611154237014346 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {load m2mvfs package} vfs { if {[file exists src_tcl/m2mvfs.tcl]} { source src_tcl/m2mvfs.tcl } else { source library/m2mvfs.tcl } package require vfs::m2m } 1.8 test 2 {} vfs { vfs::m2m::Mount "" mem } {m2m} test 3 {} vfs { ::vfs::filesystem unmount mem # TODO: detect repeated mounts, should probably be an error vfs::m2m::Mount m2m.tmp mem } {m2m} test 4 {} vfs { glob -nocomplain mem/* } {} test 5 {} -constraints vfs -body { set fd [open mem/aa w] } -match regexp -result {^(rechan\d+|mem\d+)$} test 6 {} vfs { glob -nocomplain mem/* } mem/aa test 7 {} vfs { file size mem/aa } 0 test 8 {} vfs { puts -nonewline $fd haha close $fd file size mem/aa } 4 test 9 {} vfs { file mkdir mem/d } {} test 10 {} vfs { set fd [open mem/d/ff w] puts -nonewline $fd wow close $fd file size mem/d/ff } 3 test 11 {} vfs { set fd [open mem/d/eee w] puts -nonewline $fd "Hello world!" close $fd file size mem/d/eee } 12 test 12 {} vfs { glob mem/* } {mem/aa mem/d} test 13 {} vfs { glob mem/d/* } {mem/d/ff mem/d/eee} test 14 {} vfs { file delete m2m.tmp vfs::unmount mem } {} test 15 {} vfs { file size m2m.tmp } 191 test 16 {} vfs { #puts [exec xxd m2m.tmp] file delete m2m.tmp } {} unset -nocomplain fd ::tcltest::cleanupTests vqtcl/tests/mkcl.test0000755000076500007650000000475610611154237014621 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {load mkclvfs package} vfs { if {[file exists src_tcl/mkclvfs.tcl]} { source src_tcl/mkclvfs.tcl } else { source library/mkclvfs.tcl } package require vfs::mkcl } 1.5 test 2 {} -constraints vfs -body { set fs [vfs::mkcl::Mount data/lkit-le.db /try1] } -match glob -result mkclvfs* test 3 {} vfs { glob /try1/* } {/try1/main.tcl /try1/ChangeLog /try1/lib} test 4 {} -constraints vfs -body { file stat /try1/lib sb puts "" parray sb } -match glob -output { sb(atime) = 0 sb(ctime) = 0 sb(dev) = * sb(gid) = 0 sb(ino) = 0 sb(mode) = 16895 sb(mtime) = 0 sb(nlink) = 3 sb(size) = 0 sb(type) = directory sb(uid) = 0 } test 5 {} -constraints vfs -body { file stat /try1/ChangeLog sb puts "" parray sb } -match glob -output { sb(atime) = 1046092593 sb(ctime) = 1046092593 sb(dev) = * sb(gid) = 0 sb(ino) = 0 sb(mode) = 33279 sb(mtime) = 1046092593 sb(nlink) = 1 sb(size) = 167 sb(type) = file sb(uid) = 0 } test 6 {} vfs { set fd [open /try1/ChangeLog] set data \n append data [read $fd] close $fd set data } { 2003-02-24 jcw * tcl2html.tcl: added Jeff Hobb's code to show tcl file nicely * listk.tcl: adjusted to use the above for *.tcl files * all: added change log } test 7 {} vfs { file size /try1/lib/cgi1.6/cgi.tcl } 65885 test 8 {} vfs { vfs::unmount /try1 } {} test 9 {} -constraints vfs -body { set fs [vfs::mkcl::Mount data/lkit-be.db /try2] } -match glob -result mkclvfs* test 10 {} vfs { glob /try2/* } {/try2/ChangeLog /try2/main.tcl /try2/lib} test 11 {} -constraints vfs -body { file stat /try2/ChangeLog sb puts "" parray sb } -match glob -output { sb(atime) = 1046092593 sb(ctime) = 1046092593 sb(dev) = * sb(gid) = 0 sb(ino) = 0 sb(mode) = 33279 sb(mtime) = 1046092593 sb(nlink) = 1 sb(size) = 167 sb(type) = file sb(uid) = 0 } test 12 {} vfs { set fd [open /try2/ChangeLog] set data \n append data [read $fd] close $fd set data } { 2003-02-24 jcw * tcl2html.tcl: added Jeff Hobb's code to show tcl file nicely * listk.tcl: adjusted to use the above for *.tcl files * all: added change log } test 13 {} vfs { file size /try2/lib/cgi1.6/cgi.tcl } 65885 test 14 {} vfs { vfs::unmount /try2 } {} unset -nocomplain fs fd sb ::tcltest::cleanupTests vqtcl/tests/mklite.test0000755000076500007650000000741110611154237015147 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {load mkclvfs package} { if {[file exists src_tcl/mklite.tcl]} { source src_tcl/mklite.tcl } else { source library/mklite.tcl } package require mklite } 0.5 test 2 {open mk file} { mklite::file open db data/gtest.db -readonly } db test 3 {root names via vlerq} { vlerq names [vlerq open data/gtest.db] } {frequents likes serves} test 4 {root names} { mklite::file views db } {frequents likes serves} test 5 {mk compatibility layer} { mklite::emulateMk4tcl } {} test 6 {view sizes} { set F db.frequents set L db.likes set S db.serves list [mk::view size $F] [mk::view size $L] [mk::view size $S] } {10 8 9} test 7 {view names} { list [mk::view info $F] [mk::view info $L] [mk::view info $S] } {{drinker bar perweek} {drinker beer perday} {bar beer quantity}} test 8 {get all cols} { mk::get $F!2 } {drinker sam bar cheers perweek 5} test 9 {get all cols sizes} { mk::get $F!2 -size } {drinker 3 bar 6 perweek 1} test 10 {get one col} { mk::get $F!2 bar } cheers test 11 {get one col size} { mk::get $F!2 -size bar } 6 test 12 {get several cols} { mk::get $F!2 bar drinker } {cheers sam} test 13 {get several cols sizes} { mk::get $F!2 -size bar drinker } {6 3} test 14 {frequents data} { set r "" mk::loop c $F { append r " " [mk::get $c drinker bar perweek] \n } set r } { \ adam lolas 1 woody cheers 5 sam cheers 5 norm cheers 3 wilt joes 2 norm joes 1 lola lolas 6 norm lolas 2 woody lolas 1 pierre frankies 0 } test 15 {likes data} { set r "" mk::loop c $L { append r " " [mk::get $c drinker beer perday] \n } set r } { \ adam bud 2 wilt rollingrock 1 sam bud 2 norm rollingrock 3 norm bud 2 nan sierranevada 1 woody pabst 2 lola mickies 5 } test 16 {serves data} { set r "" mk::loop c $S { append r " " [mk::get $c bar beer quantity] \n } set r } { \ cheers bud 500 cheers samaddams 255 joes bud 217 joes samaddams 13 joes mickies 2222 lolas mickies 1515 lolas pabst 333 winkos rollingrock 432 frankies snafu 5 } test 17 {select} { mk::select $F drinker norm } {3 5 7} test 18 {select bar} { mk::select $F bar lolas } {0 6 7 8} test 19 {select glob} { mk::select $F -glob bar *e* } {1 2 3 4 5 9} test 20 {select globnc} { mk::select $F -globnc bar *E* } {1 2 3 4 5 9} test 21 {select keyword} { mk::select $S -keyword beer M } {4 5} test 22 {select multiple or} { mk::select $S -glob {bar beer} *e* } {0 1 2 3 4 5 8} test 23 {select sort} { mk::select $S -sort beer } {0 2 4 5 6 7 1 3 8} test 24 {select rsort} { mk::select $S -rsort beer } {8 3 1 7 6 5 4 2 0} test 25 {select count} { mk::select $F -count 2 drinker norm } {3 5} test 26 {select first} { mk::select $F -first 2 drinker norm } 7 test 27 {select glob and count} { mk::select $F -glob bar *e* -count 3 } {1 2 3} test 28 {select multiple criteria} { mk::select $F bar lolas drinker norm } 7 test 29 {select nothing} { mk::select $F bar maid } {} test 30 {select multiple criteria empty} { mk::select $F drinker woody bar joes } {} test 31 {list of open files} { mk::file open } {db data/gtest.db} test 32 {} { mk::file close db } {} test 33 {} { catch { mk::file close db } } 1 test 34 {} { catch { mklite::file views db } } 1 test 35 {load mk file} { mklite::file open db set fd [open data/gtest.db] mklite::file load db $fd close $fd mklite::file views db } {frequents likes serves} test 36 {} { mk::file close db } {} unset -nocomplain c r S F L fd ::tcltest::cleanupTests vqtcl/tests/mutable.test0000755000076500007650000002070710611154237015316 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { vlerq set [vlerq def A {a b c}] 1 A XYZ } {data {mdef A} {a XYZ c}} test 2 {} { vlerq set [vlerq def A:B {d e f}] 1 A ABC } {data {mdef A:B} {d ABC f}} test 3 {} { vlerq set [vlerq def A:I {1 2 3}] 1 A 22 } {data {mdef A:I} {1 22 3}} test 4 {} { vlerq set [vlerq def A:L {1 2 3}] 1 A 112233445566 } {data {mdef A:L} {1 112233445566 3}} test 5 {} { vlerq set [vlerq def A:F {1.5 2.5 3.5}] 1 A 4.5 } {data {mdef A:F} {1.5 4.5 3.5}} test 6 {} { vlerq set [vlerq def A:D {1.1 2.2 3.3}] 1 A 4.567890123 } {data {mdef A:D} {1.1 4.567890123 3.3}} test 7 {} { set v [vlerq group [vlerq def {A B} {a A1 a A2 b B1 b B2}] A G] } {data {mdef {A {G B}}} {a b} {{data {mdef B} {A1 A2}}\ {data {mdef B} {B1 B2}}}} test 8 {} { vlerq set $v 1 G [vlerq def B {1 2 3}] } {data {mdef {A {G B}}} {a b} {{data {mdef B} {A1 A2}}\ {data {mdef B} {1 2 3}}}} test 9 {} { set v [vlerq def A {a b c d e}] vlerq size [vlerq delete $v 1 3] } 2 test 10 {} { vlerq delete $v 1 3 } {data {mdef A} {a e}} test 11 {} { vlerq mutinfo [vlerq delete $v 1 3] } {{data {mdef A} {}} 0 0 {0 1 1 1 0} {0 0} {0 0} {}} test 12 {} { vlerq delete $v 0 3 } {data {mdef A} {d e}} test 13 {} { vlerq delete $v 2 3 } {data {mdef A} {a b}} test 14 {} { vlerq replace $v 1 3 [vlerq def A {1 2 3}] } {data {mdef A} {a 1 2 3 e}} test 15 {} { vlerq mutinfo [vlerq replace $v 1 3 [vlerq def A {1 2 3}]] } {{data {mdef A} {1 2 3}} 0 0 {0 1 1 1 0} {0 0} {0 1 1 1 0} {}} test 16 {} { vlerq append $v [vlerq def A {1 2 3}] } {data {mdef A} {a b c d e 1 2 3}} test 17 {} { vlerq mutinfo [vlerq append $v [vlerq def A {1 2 3}]] } {{data {mdef A} {1 2 3}} 0 0 {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0 1 1 1} {}} test 18 {} { set v [vlerq insert $v 2 [vlerq def A {1 2 3}]] } {data {mdef A} {a b 1 2 3 c d e}} test 19 {} { vlerq mutinfo $v } {{data {mdef A} {1 2 3}} 0 0 {0 0 0 0 0} {0 0 0 0 0} {0 0 1 1 1 0 0 0} {}} test 20 {} { vlerq set $v 3 A zz } {data {mdef A} {a b 1 zz 3 c d e}} set v [vlerq def {A B C} {1 2 3 11 22 33 111 222 333}] test 21 {} { set w [vlerq set $v 1 B x22] } {data {mdef {A B C}} {1 11 111} {2 x22 222} {3 33 333}} test 22 {} { vlerq mutinfo $w } {{data {mdef {A B C}} {} {} {}}\ {data {mdef {A B C}} 11 x22 33}\ {data {mdef {_:I _:I _:I}} 0 1 0} {0 0 0} {0 1 0} {0 0 0} 0} test 23 {check row count is still 3} { vlerq size $w } 3 test 24 {verify new contents} { vlerq get $w } {1 2 3 11 x22 33 111 222 333} test 25 {check v has not changed} { vlerq get $v } {1 2 3 11 22 33 111 222 333} test 26 {insert one row} { set w [vlerq insert $v 1 [vlerq def {A B C} {x y z}]] } {data {mdef {A B C}} {1 x 11 111} {2 y 22 222} {3 z 33 333}} test 27 {} { vlerq size $w } 4 test 28 {verify new contents} { vlerq get $w } {1 2 3 x y z 11 22 33 111 222 333} test 29 {check v has not changed} { vlerq get $v } {1 2 3 11 22 33 111 222 333} test 30 {delete one row} { set w [vlerq delete $v 1 1] } {data {mdef {A B C}} {1 111} {2 222} {3 333}} test 31 {} { vlerq get $w # } 2 test 32 {verify new contents} { vlerq get $w } {1 2 3 111 222 333} test 33 {check v has not changed} { vlerq get $v } {1 2 3 11 22 33 111 222 333} test 34 {} { set w [vlerq group $v A G] vlerq get $w 0 G } {data {mdef {B C}} 2 3} test 35 {set one item in subview} { vlerq set [vlerq get $w 0 G] 0 B bb } {data {mdef {B C}} bb 3} test 36 {set one item in subview} { set w [vlerq group [vlerq set $v 2 A 1] A G] vlerq set [vlerq get $w 0 G] 1 B bb } {data {mdef {B C}} {2 bb} {3 333}} test 37 {} { set v [vlerq def {A B C} {a b c aa bb cc aaa bbb ccc}] vlerq set $v 1 A x B y C z } {data {mdef {A B C}} {a x aaa} {b y bbb} {c z ccc}} test 38 {} { vlerq set [vlerq def {A B C} {a b c aa bb cc}] -1 A xx } {data {mdef {A B C}} {a xx} {b bb} {c cc}} test 39 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] } {data {mdef A} {1 a b 2}} test 40 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq append $v [vlerq def A {x y}] } {data {mdef A} {1 a b 2 x y}} test 41 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq insert $v 0 [vlerq def A {x y}] } {data {mdef A} {x y 1 a b 2}} test 42 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq insert $v 1 [vlerq def A {x y}] } {data {mdef A} {1 x y a b 2}} test 43 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq insert $v 2 [vlerq def A {x y}] } {data {mdef A} {1 a x y b 2}} test 44 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq insert $v 3 [vlerq def A {x y}] } {data {mdef A} {1 a b x y 2}} test 45 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq insert $v 4 [vlerq def A {x y}] } {data {mdef A} {1 a b 2 x y}} test 46 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 0 1 } {data {mdef A} {a b 2}} test 47 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 1 1 } {data {mdef A} {1 b 2}} test 48 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 2 1 } {data {mdef A} {1 a 2}} test 49 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 3 1 } {data {mdef A} {1 a b}} test 50 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 0 2 } {data {mdef A} {b 2}} test 51 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 1 2 } {data {mdef A} {1 2}} test 52 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 2 2 } {data {mdef A} {1 a}} test 53 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 0 3 } {data {mdef A} 2} test 54 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 1 3 } {data {mdef A} 1} test 55 {} { set v [vlerq insert [vlerq def A {1 2}] 1 [vlerq def A {a b}]] vlerq delete $v 0 4 } {data {mdef A} {}} test 56 {insertion when there are no columns} { vlerq insert 3 0 5 } 8 test 57 {} { set v [vlerq def A {a b c d e f g h i j k l m n o p q r s t u v w x y z}] for {set i 1} {$i < 25} {incr i 2} { set v [vlerq set $v $i A $i] } set v } {data {mdef A} {a 1 c 3 e 5 g 7 i 9 k 11 m 13 o 15 q 17 s 19 u 21 w 23 y z}} test 58 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc}] set w [vlerq insert $v 2 [vlerq def {A:I B} {1 1 2 2}]] } {data {mdef {A:I B}} {11 22 1 2 33} {a bb 1 2 ccc}} test 59 {2nd insert before} { set w [vlerq insert $w 1 [vlerq def {A:I B} {3 3}]] } {data {mdef {A:I B}} {11 3 22 1 2 33} {a 3 bb 1 2 ccc}} test 60 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc}] set w [vlerq insert $v 1 [vlerq def {A:I B} {1 1 2 2}]] } {data {mdef {A:I B}} {11 1 2 22 33} {a 1 2 bb ccc}} test 61 {2nd insert after} { set w [vlerq insert $w 4 [vlerq def {A:I B} {3 3}]] } {data {mdef {A:I B}} {11 1 2 22 3 33} {a 1 2 bb 3 ccc}} test 62 {} { set v [vlerq def {A:I B} {11 a 22 bb}] set w [vlerq insert $v 1 [vlerq def {A:I B} {1 c 2 d 3 e}]] } {data {mdef {A:I B}} {11 1 2 3 22} {a c d e bb}} test 63 {delete inside insert} { set w [vlerq delete $w 2 1] } {data {mdef {A:I B}} {11 1 3 22} {a c e bb}} test 64 {} { vlerq mutinfo $w } {{data {mdef {A:I B}} {1 3} {c e}} 0 0 {0 0} {0 0} {0 1 1 0} {}} test 65 {} { set v [vlerq def {A:I B} {11 a 22 bb 33 ccc 44 dddd 55 eeeee}] set w [vlerq delete $v 1 1] } {data {mdef {A:I B}} {11 33 44 55} {a ccc dddd eeeee}} test 66 {two independent deletes} { vlerq delete $w 2 1 } {data {mdef {A:I B}} {11 33 55} {a ccc eeeee}} test 67 {set high row, then low row} { set v [vlerq def {A B} {a A b B c C d D e E}] set w [vlerq set [vlerq set $v 3 A 3] 1 B 1] } {data {mdef {A B}} {a b c 3 e} {A 1 C D E}} test 68 {} { vlerq mutinfo $w } {{data {mdef {A B}} {} {}}\ {data {mdef {A B}} {b 3} {1 D}}\ {data {mdef {_:I _:I}} {0 1} {1 0}}\ {0 0 0 0 0} {0 1 0 1 0} {0 0 0 0 0} {1 0}} test 69 {} { vlerq insert [vlerq def A {}] 0 [vlerq def A {1 2 3}] } {data {mdef A} {1 2 3}} unset -nocomplain v w i ::tcltest::cleanupTests vqtcl/tests/ops.test0000755000076500007650000002230510637717020014465 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {view of empty string} { vlerq viewconv {} } {} test 2 {view with no columns} { vlerq viewconv 5 } 5 test 3 {view type of empty meta view} { vlerq type [vlerq viewconv {}] } view test 4 {view type of no-column view} { vlerq type [vlerq viewconv 5] } view test 5 {refcount of empty meta view} { vlerq refs [vlerq viewconv {}] } 1 test 6 {refcount of no-column view} { vlerq refs [vlerq viewconv 5] } 1 test 7 {size of empty view} { vlerq size "" } 0 test 8 {size of no-column view} { vlerq size 5 } 5 test 9 {width of empty view} { vlerq size [vlerq meta ""] } 3 test 10 {width of no-column view} { vlerq size [vlerq meta 5] } 0 test 11 {meta meta view} { set m [vlerq meta ""] } {mdef {name type {subv {}}}} test 12 {size of meta meta view} { vlerq size $m } 3 test 13 {width of meta meta view} { vlerq size [vlerq meta $m] } 3 test 14 {meta meta meta view} { vlerq meta $m } {mdef {name type {subv {}}}} test 15 {empty meta view} { set e [vlerq get $m 2 2] } {} test 16 {size of empty meta view} { vlerq size $e } 0 test 17 {width of empty meta view} { vlerq size [vlerq meta $e] } 3 test 18 {meta empty meta view} { vlerq meta $e } {mdef {name type {subv {}}}} test 19 {contents of meta meta view} { vlerq get $m } {name S {} type S {} subv V {}} test 20 {empty meta view from list} { # this could trigger a different code path, see updateViewStrRep set v [lreplace x 0 0] vlerq viewconv $v } {} test 21 {no-column view from list} { # this could trigger a different code path, see updateViewStrRep set v [list 7] vlerq viewconv $v } 7 test 22 {to operator} { vlerq to 12 v vlerq size $v } 12 test 23 {to operator result} { vlerq to 12 v } 12 test 24 {to result use} { vlerq size @v } 12 test 25 {to must set local var} -body { # bt: failed on 2006-12-02 unset -nocomplain a proc a {} { vlerq to [vlerq def a {1 2 3 4}] a; set a } a } -result {data {mdef a} {1 2 3 4}} -cleanup { rename a "" } test 26 {data with meta view} { set v [vlerq data [vlerq meta ""] {A B} {S I} {"" ""}] } {mdef {A B:I}} test 27 {mdef operator} { vlerq mdef {A:S B:I} } {mdef {A B:I}} test 28 {mdesc operator} { vlerq mdesc {A,B:I,C[D:L,E:F],F:V} } {mdef {A B:I {C {D:L E:F}} {F {}}}} test 29 {data operator} { set v [vlerq data [vlerq mdef {A:S B:I}] {a b} {1 2}] } {data {mdef {A B:I}} {a b} {1 2}} test 30 {} { set v [vlerq data [vlerq mdef {A B}] {a b c} {d e f}] vlerq colmap $v {} } 3 test 31 {} { vlerq colmap $v 1 } {data {mdef B} {d e f}} test 32 {} { vlerq colmap $v {1 0} } {data {mdef {B A}} {d e f} {a b c}} test 33 {} { vlerq colmap $v {0 1 0} } {data {mdef {A B A}} {a b c} {d e f} {a b c}} test 34 {} { vlerq colmap $v B } {data {mdef B} {d e f}} test 35 {} { vlerq colmap $v {B A} } {data {mdef {B A}} {d e f} {a b c}} test 36 {} { vlerq colmap $v {A B A} } {data {mdef {A B A}} {a b c} {d e f} {a b c}} test 37 {} { vlerq colmap $v {-1 -2} } {data {mdef {B A}} {d e f} {a b c}} test 38 {} { vlerq repeat [vlerq def A {a b c}] 2 } {data {mdef A} {a b c a b c}} test 39 {} { vlerq spread [vlerq def A {a b c}] 2 } {data {mdef A} {a a b b c c}} test 40 {} { set v [vlerq data [vlerq mdef {A B}] {a b} {c d}] set w [vlerq data [vlerq mdef {C D}] {1 2} {3 4}] vlerq product $v $w } {data {mdef {A B C D}} {a a b b} {c c d d} {1 2 1 2} {3 4 3 4}} test 41 {} { vlerq clone [vlerq def A {a b c}] } {data {mdef A} {}} test 42 {} { vlerq reverse [vlerq def A {a b c}] } {data {mdef A} {c b a}} test 43 {} { vlerq first [vlerq def A {a b c}] 0 } {data {mdef A} {}} test 44 {} { vlerq first [vlerq def A {a b c}] 2 } {data {mdef A} {a b}} test 45 {} { vlerq first [vlerq def A {a b c}] 4 } {data {mdef A} {a b c}} test 46 {} { vlerq last [vlerq def A {a b c}] 0 } {data {mdef A} {}} test 47 {} { vlerq last [vlerq def A {a b c}] 2 } {data {mdef A} {b c}} test 48 {} { vlerq last [vlerq def A {a b c}] 4 } {data {mdef A} {a b c}} test 49 {} { vlerq slice [vlerq def A {a b c d e f g h i}] 1 2 3 } {data {mdef A} {b d f}} test 50 {} { vlerq slice [vlerq def A {a b c d e f g h i}] 7 -2 3 } {data {mdef A} {h f d}} test 51 {} { vlerq names "" } {name type subv} test 52 {} { vlerq names [vlerq meta ""] } {name type subv} test 53 {} { vlerq types "" } {S S V} test 54 {} { vlerq types [vlerq meta ""] } {S S V} test 55 {} { vlerq take [vlerq def A {a b c}] 2 } {data {mdef A} {a b}} test 56 {} { vlerq take [vlerq def A {a b c}] 7 } {data {mdef A} {a b c a b c a}} test 57 {} { vlerq take [vlerq def A {a b c}] -2 } {data {mdef A} {c b}} test 58 {} { vlerq take [vlerq def A {a b c}] -7 } {data {mdef A} {c b a c b a c}} test 59 {} { vlerq namecol "" } {data {mdef name} {name type subv}} test 60 {} { vlerq structure 123 } {} test 61 {} { vlerq structure "" } SSV test 62 {} { vlerq structdesc 123 } {} test 63 {} { vlerq structdesc "" } {name:S,type:S,subv:V} test 64 {} { vlerq compat 12 34 } 1 test 65 {} { vlerq compat "" "" } 1 test 66 {} { vlerq compat 12 "" } 0 test 67 {} { vlerq compat "" 34 } 0 test 68 {} { vlerq compat "" [vlerq meta ""] } 1 test 69 {} { vlerq compat [vlerq def A {1 2 3}] [vlerq def B {1 2 3}] } 1 test 70 {} { vlerq compat [vlerq def A {1 2 3}] [vlerq def A:I {1 2 3}] } 0 test 71 {} { vlerq compat [vlerq def {{A {B C}}} {}] [vlerq def {{D {E F}}} {}] } 1 test 72 {} { vlerq compat [vlerq def {{A {B C}}} {}] [vlerq def {{A {B C:I}}} {}] } 0 test 73 {} { vlerq def A "" } {data {mdef A} {}} test 74 {} { vlerq def A {a b c} } {data {mdef A} {a b c}} test 75 {} { vlerq def {A B} "" } {data {mdef {A B}} {} {}} test 76 {} { vlerq def {A B} {a b c d} } {data {mdef {A B}} {a c} {b d}} test 77 {} { vlerq def {A B:I} {a 1 b 02 c -03} } {data {mdef {A B:I}} {a b c} {1 2 -3}} test 78 {} { vlerq tag 0 T } {data {mdef T:I} {}} test 79 {} { vlerq tag 5 T } {data {mdef T:I} {0 1 2 3 4}} test 80 {} { vlerq tag [vlerq def A {a b c}] T } {data {mdef {A T:I}} {a b c} {0 1 2}} test 81 {} { vlerq tag [vlerq def {A B} {a A b B c C}] T } {data {mdef {A B T:I}} {a b c} {A B C} {0 1 2}} test 82 {} { set v [vlerq def {A B C} {1 2 3 4 5 6 7 8 9}] vlerq rename $v {B X} } {data {mdef {A X C}} {1 4 7} {2 5 8} {3 6 9}} test 83 {} { vlerq rename $v {B X -1 Y} } {data {mdef {A X Y}} {1 4 7} {2 5 8} {3 6 9}} test 84 {} { vlerq rename $v {A B B C C A} } {data {mdef {B C A}} {1 4 7} {2 5 8} {3 6 9}} test 85 {omit} { set T [vlerq def {A B C D} {a b c d a b e f b c e f e d c d e d e f a b d e}] vlerq colomit $T {2 3} } {data {mdef {A B}} {a a b e e a} {b b c d d b}} test 86 {omit reorder} { vlerq colomit $T {3 2} } {data {mdef {A B}} {a a b e e a} {b b c d d b}} test 87 {omit named} { set T [vlerq def {A B C D} {a b c d a b e f b c e f e d c d e d e f a b d e}] vlerq colomit $T {C D} } {data {mdef {A B}} {a a b e e a} {b b c d d b}} test 88 {omit named reorder} { vlerq colomit $T {D C} } {data {mdef {A B}} {a a b e e a} {b b c d d b}} test 89 {} { set v [vlerq def {A B C} {1 2 3 4 5 6}] vlerq colomit $v {C B} } {data {mdef A} {1 4}} test 90 {} { vlerq colomit $v {A A} } {data {mdef {B C}} {2 5} {3 6}} test 91 {} { vlerq colomit $v {} } {data {mdef {A B C}} {1 4} {2 5} {3 6}} test 92 {} { vlerq viewascol [vlerq def {A B:I C} {1 2 3 4 5 6 7 8 9}] } {{1 4 7} {2 5 8} {3 6 9}} test 93 {} { set v [vlerq def {A B} {1 2 3 4 1 2}] vlerq rowcmp $v 0 $v 1 } -1 test 94 {} { set v [vlerq def {A B} {1 2 3 4 1 2}] vlerq rowcmp $v 0 $v 2 } 0 test 95 {} { vlerq def {} {} } 0 test 96 {} { set v [vlerq def {A B} {a b c d e f}] vlerq onecol $v A } {data {mdef A} {a c e}} test 97 {} { set v [vlerq def {A B} {a b c d e f}] vlerq onecol $v -1 } {data {mdef B} {b d f}} test 98 {empty string col} { vlerq load [vlerq emit [vlerq def A {"" "" ""}]] } {data {mdef A} {{} {} {}}} test 99 {16-bit getter} { vlerq load [vlerq emit [vlerq def A:I {123 456 789}]] } {data {mdef A:I} {123 456 789}} test 100 {} { vlerq pair [vlerq def A {a b c}] [vlerq def B {1 2 3}] } {data {mdef {A B}} {a b c} {1 2 3}} test 101 {} { vlerq pair [vlerq def A {a b c}] 2 } {data {mdef A} {a b}} test 102 {} { vlerq pair [vlerq def A {a b c}] 3 } {data {mdef A} {a b c}} test 103 {} { vlerq pair [vlerq def A {a b c}] 4 } {data {mdef A} {a b c}} test 104 {} { vlerq pair 2 [vlerq def A {a b c}] } {data {mdef A} {a b}} test 105 {} { vlerq pair 3 [vlerq def A {a b c}] } {data {mdef A} {a b c}} test 106 {} { vlerq pair 4 [vlerq def A {a b c}] } {data {mdef A} {a b c}} test 107 {} { # bt: crashed on 2007-02-10, see fff/139 vlerq pair [vlerq def A {a b c}] [vlerq def B {1 2}] } {data {mdef {A B}} {a b} {1 2}} test 108 {} { vlerq pair [vlerq def A {a b}] [vlerq def B {1 2 3}] } {data {mdef {A B}} {a b} {1 2}} unset -nocomplain T e v w m ::tcltest::cleanupTests vqtcl/tests/ratcl.test0000755000076500007650000002025010634027266014771 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load ratcl package} { if {[file exists src_tcl/ratcl.tcl]} { source src_tcl/ratcl.tcl } else { source library/ratcl.tcl } package require ratcl } 4 test 1 {} { view {A B} def {1 2 11 22 111 222} | reverse | get } {111 222 11 22 1 2} test 2 {} { view {A B} def {1 2 11 22 111 222} | reverse | dump } { \ A B --- --- 111 222 11 22 1 2 } test 3 {} { view 3 | dump } { (3 rows, no columns)} test 4 {} { view "" | dump } { \ name type subv ---- ---- ----} # tests copied from v3 set v [view {A B C} def {1 2 3 11 22 33 111 222 333}] test 5 {} { view $v names } {A B C} test 6 {} { view $v types } {S S S} test 7 {} { view $v width } 3 test 8 {} { vlerq get $v * } {{1 2 3} {11 22 33} {111 222 333}} test 9 {} { view $v first 2 | get * } {{1 2 3} {11 22 33}} test 10 {} { view $v last 2 | get * } {{11 22 33} {111 222 333}} test 11 {} { view $v reverse | get * } {{111 222 333} {11 22 33} {1 2 3}} test 12 {} { view $v repeat 2 | get * } {{1 2 3} {11 22 33} {111 222 333} {1 2 3} {11 22 33} {111 222 333}} test 13 {} { view $v spread 2 | get * } {{1 2 3} {1 2 3} {11 22 33} {11 22 33} {111 222 333} {111 222 333}} test 14 {} { view $v dump } { \ A B C --- --- --- 1 2 3 11 22 33 111 222 333} test 15 {} -body { view $v html } -match glob -result {
ABC
0123
1112233
2111222333
} test 16 {} { namespace eval blah { namespace import ::ratcl::vopdef vopdef haha {v} { return abc } } view - haha } {abc} namespace forget blah test 17 {transpose} { set v [view {A B C} def {1 2 3 4 5 6 7 8 9} | transpose] list [view $v names] [view $v structure] [view $v get] } {{x0 x1 x2} SSS {1 4 7 2 5 8 3 6 9}} test 18 {transpose ints} { set v [view {A:I B:I C:I} def {1 2 3 4 5 6 7 8 9} | transpose X:I] list [view $v names] [view $v structure] [view $v get] } {{X0 X1 X2} III {1 4 7 2 5 8 3 6 9}} test 19 {use vop} { view 1 use 2 } 2 test 20 {do vop} { set T [view {A B C D} def {a b c d a b e f b c e f e d c d e d e f a b d e}] view $T do { transpose get } } {a a b e e a b b c d d b c e e c e d d f f d f e} test 21 {debug vop} -body { set T [view {A B C D} def {a b c d a b e f b c e f e d c d e d e f a b d e}] view $T debug transpose | get } -match glob -output {\ rows-in col msec view-operation ------- --- ---- -------------- 6 4 ?? transpose 4 6 ---- -------------- } -result {a a b e e a b b c d d b c e e c e d d f f d f e} test 22 {use and debug vops} -body { view - debug { use {A B} def {1 2 3 4 5 6} transpose get } } -result {1 3 5 2 4 6} -match glob -output {\ rows-in col msec view-operation ------- --- ---- -------------- ?? use {A B} ?? def {1 2 3 4 5 6} 3 2 ?? transpose 2 3 ?? get ------- --- ---- -------------- } test 23 {debug comments} -body { view $T debug { # start transpose # empty lines are not shown structure # end } } -result SSSSSS -match glob -output {\ rows-in col msec view-operation ------- --- ---- -------------- # start 6 4 ?? transpose # empty lines are not shown 4 6 ?? structure # end ------- --- ---- -------------- } test 24 {frequency table} { view A def {a b a b b c} | freq N | get } {a 2 b 3 c 1} test 25 {frequency table on unique values} { view A def {b a c} | freq N | get } {b 1 a 1 c 1} test 26 {frequency table on a single value} { view A def {a a a a} | freq N | get } {a 4} test 27 {} { view {1 2 3} asview A:I | structdesc } A:I test 28 {} { view {1 2 3} asview A | structdesc } A:S test 29 {} { view 10 asview len:I | get } 10 test 30 {} { view [view 10 asview len:I] min len 50 } 10 test 31 {} { set v [vlerq def {A B} {1 a 1 b 1 b 2 c 3 c}] view $v project A | get } {1 2 3} test 32 {} { view $v project B | get } {a b c} test 33 {} { view $v project A B | get } {1 a 1 b 2 c 3 c} test 34 {} { view $v project | get } {} test 35 {} { view A:I def {1 2 3 4 5 6 9 10 11 12} | pick {1 1 0 1 1 0 0 1 1 0} | get } {1 2 4 5 10 11} test 36 {} { set v [vlerq def {A B} {1 2 3 4}] set w [vlerq reverse $v] } {data {mdef {A B}} {3 1} {4 2}} test 37 {} { set v [vlerq def {A B} {1 2 3 4}] set w [vlerq reverse $v] vlerq pair $v $w } {data {mdef {A B A B}} {1 3} {2 4} {3 1} {4 2}} test 38 {} { set v [vlerq def {A B} {1 2 3 4}] set w [vlerq reverse $v] view $v pair $w | get } {1 2 3 4 3 4 1 2} test 39 {} { set v [vlerq def {A B} {1 2 3 4}] set w [vlerq reverse $v] # 2006-12-08 failed because dump could not handle duplicate column names view $v pair $w | dump } { \ A B A B - - - - 1 2 3 4 3 4 1 2} test 40 {} -body { set v [vlerq def {A B} {1 2 3 4}] set w [vlerq reverse $v] view $v pair $w | html } -match glob -result {
ABAB
01234
13412
} set T [vlerq def {X A B C D} {0 a b c d 1 e d f d 2 a b e f 3 b c e d 4 a b d e 5 e d c f}] test 41 {} { view $T sorton A | get * X } {0 2 4 3 1 5} test 42 {} { view $T sorton - A | get * X } {1 5 3 0 2 4} test 43 {} { view $T sorton B | get * X } {0 2 4 3 1 5} test 44 {} { view $T sorton - B | get * X } {1 5 3 0 2 4} test 45 {} { view $T sorton C | get * X } {0 5 4 2 3 1} test 46 {} { view $T sorton - C | get * X } {1 2 3 4 0 5} test 47 {} { view $T sorton D | get * X } {0 1 3 4 2 5} test 48 {} { view $T sorton - D | get * X } {2 5 4 0 1 3} test 49 {} { view $T sorton D C | get * X } {0 3 1 4 5 2} test 50 {} { view $T sorton D - C | get * X } {1 3 0 4 2 5} test 51 {} { view $T sorton - D C | get * X } {2 5 4 1 3 0} test 52 {} { view $T sorton - D + C | get * X } {5 2 4 0 3 1} test 53 {} { # exercises view args > 8 and total vlerq args > 20 view $T sorton - D + C - A + B - C + D - A + B - C + D | get * X } {5 2 4 0 3 1} test 54 {} { # failed, see F119 set m [view {A,B:I} mdesc] set v [view $m data {a bb ccc} {1 22 333}] vlerq unique [vlerq colmap $v {B B}] } {data {mdef {B:I B:I}} {1 22 333} {1 22 333}} test 55 {} { vlerq unique [vlerq colmap $v {B A}] } {data {mdef {B:I A}} {1 22 333} {a bb ccc}} test 56 {read without hitting eof} { set fd [open data/gtest.db] set v [view $fd read] set r [eof $fd] close $fd set r } 0 test 57 {} { vlerq meta $v } {mdef {{frequents {drinker bar perweek:I}}\ {likes {drinker beer perday:I}}\ {serves {bar beer quantity:I}}}} test 58 {read until eof} { set fd [open data/gtest.db] set w [view $fd read ########] ;# fake a non-header to force reading to eof set r [eof $fd] close $fd set r } 1 test 59 {} { vlerq meta $w } {mdef {{frequents {drinker bar perweek:I}}\ {likes {drinker beer perday:I}}\ {serves {bar beer quantity:I}}}} test 60 {F146 - failed assertion, cannot reproduce} { view {} size; view {} do {use 5} | dump } { (5 rows, no columns)} test 61 {as result} { view $T as tcmd } tcmd test 62 {as use} { tcmd size } 6 rename tcmd "" unset -nocomplain T r v w m fd ::tcltest::cleanupTests vqtcl/tests/ref.test0000755000076500007650000000527310611154237014442 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version test 1 {ref command} { set v "" list [vlerq size @v] [vlerq width @v] } {0 3} test 2 {ref changed value} { set v [vlerq meta ""] list [vlerq size @v] [vlerq width @v] } {3 3} unset v test 3 {} { proc foo {args} { puts [list got: $args] lindex $args 2 } set v [vlerq def A {a b c}] set t {ref v foo bar} list [vlerq size $t] [vlerq size [vlerq meta $t]] } {3 1} test 4 {} -constraints x -body { vlerq set $t 1 A X } -result {data {mdef A} {a X c}} \ -output "got: bar {data {mdef A} {a b c}} set 1 A X\n" test 5 {} { set v [vlerq def A {a b c}] vlerq load [vlerq emit @v] } {data {mdef A} {a b c}} test 6 {} { vlerq set @v 1 A xyz } {data {mdef A} {a xyz c}} test 7 {} { vlerq viewconv $v } {data {mdef A} {a b c}} test 8 {} x { vlerq viewconv @v } {data {mdef A} {a xyz c}} test 9 {} x { vlerq set $v 0 A abc } {data {mdef A} {abc xyz c}} test 10 {} x { vlerq set @v 2 A def } {data {mdef A} {abc xyz def}} test 11 {} { vlerq viewconv $v } {data {mdef A} {a b c}} test 12 {} x { vlerq viewconv @v } {data {mdef A} {a xyz def}} test 13 {} { set v [vlerq group [vlerq def {A B} {a 1 a 2 a 3}] A G] set v [vlerq load [vlerq emit $v]] vlerq load [vlerq emit @v] } {data {mdef {A {G B}}} a {{data {mdef B} {1 2 3}}}} test 14 {} { vlerq get @v 0 G } {data {mdef B} {1 2 3}} test 15 {} { vlerq set @v 0 A b } {data {mdef {A {G B}}} b {{data {mdef B} {1 2 3}}}} test 16 {} { vlerq set {get @v 0 G} 1 B xyz } {data {mdef B} {1 xyz 3}} test 17 {if this works then subviews are mutable} x { set v } {data {mdef {A {G B}}} b {{data {mdef B} {1 xyz 3}}}} #unset v #vlerq debug 3 test 18 {} { set v [vlerq def A {5 3 2 1 4}] vlerq sort @v } {data {mdef A} {1 2 3 4 5}} test 19 {} { vlerq set $v 2 A 6 vlerq sort @v } {data {mdef A} {1 2 3 4 5}} test 20 {} { set v [vlerq set $v 3 A 7] vlerq sort @v } {data {mdef A} {2 3 4 5 7}} test 21 {} { vlerq set @v 2 A 8 set v } {data {mdef A} {5 3 8 7 4}} test 22 {} { vlerq sort @v } {data {mdef A} {3 4 5 7 8}} test 23 {} { set w {sort @v} vlerq viewconv $w } {data {mdef A} {3 4 5 7 8}} test 24 {} { vlerq set @v 2 A 0 } {data {mdef A} {5 3 0 7 4}} test 25 {} { vlerq deps $v } - test 26 {} { set w [vlerq sort $v] vlerq size $w } 5 test 27 {} x { vlerq deps $v } {- {sort A 5}} test 28 {} x { vlerq deps @v } {} test 29 {} x { vlerq viewconv $w } {data {mdef A} {0 3 4 5 7}} unset -nocomplain t v w ::tcltest::cleanupTests vqtcl/tests/sorted.test0000755000076500007650000001260510611154237015163 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {} { package require vlerq } $version test 1 {} { vlerq roweq [vlerq meta ""] 0 [vlerq meta ""] 0 } 1 test 2 {} { vlerq roweq [vlerq meta ""] 0 [vlerq meta ""] 1 } 0 test 3 {} { vlerq roweq [vlerq def {L:L F:F D:D B:B} {1 2 3 4}] 0 \ [vlerq def {L:L F:F D:D B:B} {1 2.0 3.0 4}] 0 } 1 test 4 {} { vlerq sortmap [vlerq def A:I {1 2 1 2 1 3}] } {0 2 4 1 3 5} test 5 {} { vlerq sortmap [vlerq def A {a b a b a c}] } {0 2 4 1 3 5} test 6 {} { vlerq sort [vlerq def A {a b a b a c}] } {data {mdef A} {a a a b b c}} test 7 {} { vlerq sort [vlerq def A {a b a c}] } {data {mdef A} {a a b c}} test 8 {} { vlerq compare "" "" } 0 test 9 {} { vlerq compare 0 0 } 0 test 10 {} { vlerq compare 12 12 } 0 test 11 {} { vlerq compare 12 23 } -1 test 12 {} { vlerq compare "" 12 } 1 test 13 {} { vlerq compare "" [vlerq meta ""] } -1 test 14 {} { vlerq compare [vlerq meta ""] [vlerq meta ""] } 0 test 15 {} { vlerq compare [vlerq def A {}] [vlerq def A {}] } 0 test 16 {} { vlerq compare [vlerq def A a] [vlerq def A a] } 0 test 17 {} { vlerq compare [vlerq def A a] [vlerq def A b] } -1 test 18 {} { vlerq compare [vlerq def A a] [vlerq def A {a b}] } -1 test 19 {} { vlerq compare [vlerq def A {}] [vlerq def A a] } -1 test 20 {} { vlerq compare [vlerq def A b] [vlerq def A {a b}] } 1 test 21 {} { vlerq compare [vlerq def A {}] [vlerq def B {}] } -1 test 22 {} { vlerq compare [vlerq def A b] [vlerq def B a] } -1 test 23 {} { vlerq compare [vlerq def A {}] [vlerq def {A B} {}] } -1 test 24 {} { vlerq compare [vlerq def {A B} {}] [vlerq def {A B} {}] } 0 test 25 {} { vlerq compare [vlerq def {A B} {a b}] [vlerq def {A B} {a b}] } 0 test 26 {} { vlerq compare [vlerq def {A B} {a b aa bb}] [vlerq def {A B} {a b aa bb}] } 0 test 27 {} { vlerq compare [vlerq def {A B} {a b}] [vlerq def {A B} {a b aa bb}] } -1 test 28 {} { vlerq compare [vlerq def {A B} {a b aa bb}] [vlerq def {A B} {a b}] } 1 test 29 {} { vlerq compare [vlerq def {A B} {a b aa bb}] [vlerq def {A B} {a b aaa bb}] } -1 test 30 {} { vlerq compare [vlerq def {A B} {a b aaa bb}] [vlerq def {A B} {a b aa bb}] } 1 test 31 {} { vlerq compare [vlerq def {A B} {a b aa bb}] [vlerq def {A B} {a b aa bbb}] } -1 test 32 {} { vlerq compare [vlerq def {A B} {a b aa bbb}] [vlerq def {A B} {a b aa bb}] } 1 test 33 {} { vlerq compare [vlerq def A {}] [vlerq def A:I {}] } 1 test 34 {} { vlerq compare [vlerq def A {}] [vlerq def A:I {}] } 1 test 35 {} { vlerq compare [vlerq def A:I 1] [vlerq def A:I 01] } 0 test 36 {} { vlerq compare [vlerq def A:I 01] [vlerq def A:I 1] } 0 test 37 {} { vlerq compare [vlerq def A:I 19] [vlerq def A:I 2] } 1 test 38 {} { vlerq compare [vlerq def A:I 2] [vlerq def A:I 19] } -1 test 39 {} { vlerq compare [vlerq def A 19] [vlerq def A 2] } -1 test 40 {} { vlerq compare [vlerq def A 2] [vlerq def A 19] } 1 test 41 {} { vlerq compare [vlerq def {L:L F:F D:D B:B} {1 2 3 4}] \ [vlerq def {L:L F:F D:D B:B} {1 2.0 3.0 4}] } 0 test 42 {} { vlerq max [vlerq def A {a b c}] 0 } c test 43 {} { vlerq max [vlerq def A {a b c}] 0 } c test 44 {} { vlerq max [vlerq def A {a b c}] 0 } c test 45 {} { vlerq max [vlerq def A:I {1 2 3}] 0 } 3 test 46 {} { vlerq max [vlerq def A:I {1 2 3}] 0 } 3 test 47 {} { vlerq max [vlerq def A:I {1 2 3}] A } 3 test 48 {} { vlerq min [vlerq def A {a b c}] 0 d } a test 49 {} { vlerq min [vlerq def A {a b c}] 0 } a test 50 {} { vlerq min [vlerq def A {a b c}] 0 } a test 51 {} { vlerq min [vlerq def A {a b c ""}] 0 } "" test 52 {} { vlerq min [vlerq def A:I {1 2 3}] 0 4 } 1 test 53 {} { vlerq min [vlerq def A:I {1 2 3}] 0 } 1 test 54 {} { vlerq min [vlerq def A:I {1 2 3}] A } 1 test 55 {} { vlerq sum [vlerq def A:I {}] 0 } 0 test 56 {} { vlerq sum [vlerq def A:I {1 2 3}] 0 } 6 test 57 {} { vlerq sum [vlerq def A:I {0 1 -2}] 0 } -1 test 58 {} { vlerq sum [vlerq def A:I {0 1 -2}] A } -1 test 59 {} { vlerq sum [vlerq def A:L {10000000000 20000000000 30000000000}] 0 } 60000000000 test 60 {} { vlerq sum [vlerq def A:F {1000000000.1 2000000000.2 3000000000.3}] 0 } 6000000000.0 test 61 {} { vlerq sum [vlerq def A:D {1000000000.1 2000000000.2 3000000000.3}] 0 } 6000000000.6 test 62 {see F147, this works} { view {a b} def {1 a} | group a g | collect {[view $(g) get]} } {a} test 63 {F147 - this is ok} { view {a b} def {1 a} | group a g | structdesc } {a:S,g[b:S]} test 64 {F147 - so is this} { view {a b} def {1 a} | group a g | dump } { \ a g - -- 1 #1} test 65 {F147 - this throws an error} -constraints x -body { view {a b} def {1 a} | group a g | loop {puts [view $(g) sort | dump]} } -output {?} test 66 {F147 - this throws an assertion} -constraints x -body { view {a b} def {1 a} | group a g | loop {puts [view $(g) sort | freeze | get]} } -output {?} test 67 {F147 - and this crashes!} x { view {a b} def {1 a} | group a g | collect {[view $(g) sort | get]} } {a} ::tcltest::cleanupTests vqtcl/tests/view.test0000755000076500007650000000127010611154237014631 0ustar jcwjcw00000000000000#!/usr/bin/env tclkit # %renumber<^\s*test >% source [file join [file dir [info script]] initests.tcl] test 0 {load extension} { package require vlerq } $version namespace eval ::vlerq {} test 1 {indirect view operation} -body { proc ::vlerq::foo {n} { vlerq viewconv [expr {2*$n}] } vlerq size {foo 123} } -result 246 -cleanup { rename ::vlerq::foo "" } test 2 {recursive indirect view operation} -body { proc ::vlerq::foo {n} { expr {3*$n} } vlerq size {foo 123} } -result 369 -cleanup { rename ::vlerq::foo "" } test 3 {} { vlerq view [vlerq def A {a b c}] size } 3 test 4 {} { vlerq view A def {a b c} | repeat 3 | size } 9 ::tcltest::cleanupTests vqtcl/win/0000755000076500007650000000000010621166172012410 5ustar jcwjcw00000000000000vqtcl/win/makefile.vc0000644000076500007650000003500410621166172014521 0ustar jcwjcw00000000000000# makefile.vc -- -*- Makefile -*- # # Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) # # This makefile is based upon the Tcl 8.4 Makefile.vc and modified to # make it suitable as a general package makefile. Look for the word EDIT # which marks sections that may need modification. As a minumum you will # need to change the PROJECT, DOTVERSION and DLLOBJS variables to values # relevant to your package. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001 ActiveState Corporation. # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2006 Pat Thoyts # #------------------------------------------------------------------------- # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another. !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir) MSG = ^ You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ Platform SDK first to setup the environment. Jump to this line to read^ the build instructions. !error $(MSG) !endif #------------------------------------------------------------------------------ # HOW TO USE this makefile: # # 1) It is now necessary to have %MSVCDir% set in the environment. This is # used as a check to see if vcvars32.bat had been run prior to running # nmake or during the installation of Microsoft Visual C++, MSVCDir had # been set globally and the PATH adjusted. Either way is valid. # # You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin # directory to setup the proper environment, if needed, for your current # setup. This is a needed bootstrap requirement and allows the swapping of # different environments to be easier. # # 2) To use the Platform SDK (not expressly needed), run setenv.bat after # vcvars32.bat according to the instructions for it. This can also turn on # the 64-bit compiler, if your SDK has it. # # 3) Targets are: # all -- Builds everything. # -- Builds the project (eg: nmake vlerq) # test -- Builds and runs the test suite. # install -- Installs the built binaries and libraries to $(INSTALLDIR) # in an appropriate subdirectory. # clean/realclean/distclean -- varying levels of cleaning. # # 4) Macros usable on the commandline: # INSTALLDIR= # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # # OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # # static = Builds a static library of the core instead of a # dll. The shell will be static (and large), as well. # msvcrt = Effects the static option only to switch it from # using libcmt(d) as the C runtime [by default] to # msvcrt(d). This is useful for static embedding # support. # staticpkg = Effects the static option only to switch # tclshXX.exe to have the dde and reg extension linked # inside it. # nothreads = Turns off multithreading support (not recommended) # thrdalloc = Use the thread allocator (shared global free pool). # symbols = Adds symbols for step debugging. # profile = Adds profiling hooks. Map file is assumed. # loimpact = Adds a flag for how NT treats the heap to keep memory # in use, low. This is said to impact alloc performance. # # STATS=memdbg,compdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # # memdbg = Enables the debugging memory allocator. # compdbg = Enables byte compilation logging. # # MACHINE=(IX86|IA64|ALPHA|AMD64) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default # when not specified. If the CPU environment variable has been # set (ie: recent Platform SDK) then MACHINE is set from CPU. # # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be # changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will de $(OUT_DIR)\ by default. # # TESTPAT= # Reads the tests requested to be run from this file. # # CFG_ENCODING=encoding # name of encoding for configuration information. Defaults # to cp1252 # # 5) Examples: # # Basic syntax of calling nmake looks like this: # nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] # # Standard (no frills) # c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat # Setting environment for using Microsoft Visual C++ tools. # c:\tcl_src\win\>nmake -f makefile.vc all # c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl # # Building for Win64 # c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat # Setting environment for using Microsoft Visual C++ tools. # c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL # Targeting Windows pre64 RETAIL # c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64 # #------------------------------------------------------------------------------ #============================================================================== ############################################################################### #------------------------------------------------------------------------------ !if !exist("makefile.vc") MSG = ^ You must run this makefile only from the directory it is in.^ Please `cd` to its location first. !error $(MSG) !endif #------------------------------------------------------------------------- # Project specific information (EDIT) # # You should edit this with the name and version of your project. This # information is used to generate the name of the package library and # it's install location. # # For example, the vlerq extension is going to build vlerq10.dll and # would install it into $(INSTALLDIR)\lib\vlerq10 # # You need to specify the object files that need to be linked into your # binary here. # #------------------------------------------------------------------------- PROJECT = vlerq PRJNAME = vqtcl !include "rules.vc" DOTVERSION = 4.1 VERSION = $(DOTVERSION:.=) STUBPREFIX = $(PROJECT)stub DLLOBJS = \ $(TMP_DIR)\vlerq.obj #------------------------------------------------------------------------- # Target names and paths ( shouldn't need changing ) #------------------------------------------------------------------------- BINROOT = . ROOT = .. PRJIMPLIB = $(OUT_DIR)\$(PRJNAME)$(VERSION)$(SUFX).lib PRJLIBNAME = $(PRJNAME)$(VERSION)$(SUFX).$(EXT) PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) ### Make sure we use backslash only. PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PRJNAME)$(DOTVERSION) LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR) BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR) DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) INCLUDE_INSTALL_DIR = $(_TCLDIR)\include ### The following paths CANNOT have spaces in them. GENERICDIR = $(ROOT)\generic WINDIR = $(ROOT)\win LIBDIR = $(ROOT)\library DOCDIR = $(ROOT)\doc TOOLSDIR = $(ROOT)\tools COMPATDIR = $(ROOT)\compat #--------------------------------------------------------------------- # Compile flags #--------------------------------------------------------------------- !if !$(DEBUG) !if $(OPTIMIZING) ### This cranks the optimization level to maximize speed cdebug = $(OPTIMIZATIONS) !else cdebug = !endif !else if "$(MACHINE)" == "IA64" ### Warnings are too many, can't support warnings into errors. cdebug = -Zi -Od $(DEBUGFLAGS) !else cdebug = -Zi -WX $(DEBUGFLAGS) !endif ### Declarations common to all compiler options cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ # Warning level !if $(FULLWARNINGS) cflags = $(cflags) -W4 !else cflags = $(cflags) -W3 !endif !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else crt = -MD !endif !else !if $(DEBUG) && !$(UNCHECKED) crt = -MTd !else crt = -MT !endif !endif !if !$(STATIC_BUILD) cflags = $(cflags) -DUSE_TCL_STUBS #!if defined(TKSTUBLIB) #cflags = $(cflags) -DUSE_TK_STUBS #!endif !endif INCLUDES = $(TCL_INCLUDES) -I"$(WINDIR)" -I"$(GENERICDIR)" BASE_CFLAGS = $(cflags) $(cdebug) $(crt) $(INCLUDES) CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE TCL_CFLAGS = -DPACKAGE_NAME="\"$(PROJECT)\"" \ -DPACKAGE_VERSION="\"$(DOTVERSION)\"" \ -DBUILD_$(PROJECT) \ $(BASE_CFLAGS) $(OPTDEFINES) #--------------------------------------------------------------------- # Link flags #--------------------------------------------------------------------- !if $(DEBUG) ldebug = -debug:full -debugtype:cv !if $(MSVCRT) ldebug = $(ldebug) -nodefaultlib:msvcrt !endif !else ldebug = -release -opt:ref -opt:icf,3 !endif ### Declarations common to all linker options lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) !if $(FULLWARNINGS) lflags = $(lflags) -warn:3 !endif !if $(PROFILE) lflags = $(lflags) -profile !endif !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 !else if !$(ALIGN98_HACK) && $(STATIC_BUILD) ### Align sections for speed in loading by choosing the virtual page size. lflags = $(lflags) -align:4096 !endif !if $(LOIMPACT) lflags = $(lflags) -ws:aggressive !endif dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows !if !$(STATIC_BUILD) baselibs = $(TCLSTUBLIB) #!if defined(TKSTUBLIB) #baselibs = $(baselibs) $(TKSTUBLIB) #!endif !endif # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" baselibs = $(baselibs) bufferoverflowU.lib !endif #--------------------------------------------------------------------- # TclTest flags #--------------------------------------------------------------------- !IF "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !ENDIF #--------------------------------------------------------------------- # Project specific targets (EDIT) #--------------------------------------------------------------------- all: setup $(PROJECT) $(PROJECT): setup $(PRJLIB) install: install-binaries install-libraries install-docs # Tests need to ensure we load the right dll file we # have to handle the output differently on Win9x. # !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" test: setup $(PROJECT) set TCL_LIBRARY=$(ROOT)/library $(TCLSH) << load [file join [file normalize {$(OUT_DIR)} $(PRJLIBNAME)]] Vlerq cd "$(ROOT)/tests" set argv "$(TESTFLAGS)" source all.tcl << !else test: setup $(PROJECT) echo Please wait while the test results are collected set TCL_LIBRARY=$(ROOT)/library $(TCLSH) << >tests.log load [file join [file normalize {$(OUT_DIR)}] $(PRJLIBNAME)] Vlerq cd "$(ROOT)/tests" set argv "$(TESTFLAGS)" source all.tcl << type tests.log | more !endif setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) $(PRJLIB): $(DLLOBJS) !if $(STATIC_BUILD) $(lib32) -nologo -out:$@ @<< $** << !else $(link32) $(dlllflags) -out:$@ $(baselibs) @<< $** << $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp !endif $(PRJSTUBLIB): $(PRJSTUBOBJS) $(lib32) -nologo -out:$@ $(PRJSTUBOBJS) #--------------------------------------------------------------------- # Implicit rules #--------------------------------------------------------------------- {$(WINDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(COMPATDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ @<< $< << {$(WINDIR)}.rc{$(TMP_DIR)}.res: $(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \ -DCOMMAVERSION=$(DOTVERSION:.=,),0 \ -DDOTVERSION=\"$(DOTVERSION)\" \ -DVERSION=\"$(VERSION)$(SUFX)\" \ !if $(DEBUG) -d DEBUG \ !endif !if $(TCL_THREADS) -d TCL_THREADS \ !endif !if $(STATIC_BUILD) -d STATIC_BUILD \ !endif $< .SUFFIXES: .SUFFIXES:.c .rc #--------------------------------------------------------------------- # Installation. (EDIT) # # You may need to modify this section to reflect the final distribution # of your files and possibly to generate documentation. # #--------------------------------------------------------------------- install-binaries: @echo Installing binaries to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL ### Automatic creation of pkgIndex install-libraries: $(OUT_DIR)\pkgIndex.tcl @echo Installing library files to '$(SCRIPT_INSTALL_DIR)' @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)" $(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in @nmakehlp -s << $** > $@ lib@PACKAGE_NAME@@PACKAGE_VERSION@ $(PRJNAME)$(VERSION)$(SUFX) @PACKAGE_VERSION@ $(DOTVERSION) << install-docs: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.n "$(DOC_INSTALL_DIR)" #--------------------------------------------------------------------- # Clean up #--------------------------------------------------------------------- clean: @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch realclean: clean @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) distclean: realclean @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj vqtcl/win/nmakehlp.c0000644000076500007650000004200110621166172014350 0ustar jcwjcw00000000000000/* * ---------------------------------------------------------------------------- * nmakehlp.c -- * * This is used to fix limitations within nmake and the environment. * * Copyright (c) 2002 by David Gravereaux. * Copyright (c) 2006 by Pat Thoyts * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * ---------------------------------------------------------------------------- * RCS: @(#) $Id: nmakehlp.c 1479 2007-05-11 22:21:46Z jcw $ * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #include #include #if defined(_M_IA64) || defined(_M_AMD64) #pragma comment(lib, "bufferoverflowU") #endif /* ISO hack for dumb VC++ */ #ifdef _MSC_VER #define snprintf _snprintf #endif /* protos */ int CheckForCompilerFeature(const char *option); int CheckForLinkerFeature(const char *option); int IsIn(const char *string, const char *substring); int GrepForDefine(const char *file, const char *string); int SubstituteFile(const char *substs, const char *filename); const char * GetVersionFromFile(const char *filename, const char *match); DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ #define CHUNK 25 #define STATICBUFFERSIZE 1000 typedef struct { HANDLE pipe; char buffer[STATICBUFFERSIZE]; } pipeinfo; pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; /* * exitcodes: 0 == no, 1 == yes, 2 == error */ int main( int argc, char *argv[]) { char msg[300]; DWORD dwWritten; int chars; /* * Make sure children (cl.exe and link.exe) are kept quiet. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); /* * Make sure the compiler and linker aren't effected by the outside world. */ SetEnvironmentVariable("CL", ""); SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c \n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForCompilerFeature(argv[2]); case 'l': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -l \n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForLinkerFeature(argv[2]); case 'f': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -f \n" "Find a substring within another\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } else if (argc == 3) { /* * If the string is blank, there is no match. */ return 0; } else { return IsIn(argv[2], argv[3]); } case 'g': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -g \n" "grep for a #define\n" "exitcodes: integer of the found string (no decimals)\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return GrepForDefine(argv[2], argv[3]); case 's': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -s \n" "Perform a set of string map type substutitions on a file\n" "exitcodes: 0\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return SubstituteFile(argv[2], argv[3]); case 'V': if (argc != 4) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -V filename matchstring\n" "Extract a version from a file:\n" "eg: pkgIndex.tcl \"package ifneeded http\"", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 0; } printf("%s\n", GetVersionFromFile(argv[2], argv[3])); return 0; } } chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c|-l|-f|-g|-V ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } int CheckForCompilerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = FALSE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch "); /* * Append our option for testing */ lstrcat(cmdline, option); /* * Filename to compile, which exists, but is nothing and empty. */ lstrcat(cmdline, " .\\nul"); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL || strstr(Out.buffer, "D9002") != NULL || strstr(Err.buffer, "D9002") != NULL); } int CheckForLinkerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); ZeroMemory(&si, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritible, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "link.exe -nologo "); /* * Append our option for testing. */ lstrcat(cmdline, option); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in the stderr stream. */ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL || strstr(Out.buffer, "LNK4044") != NULL || strstr(Err.buffer, "LNK4044") != NULL); } DWORD WINAPI ReadFromPipe( LPVOID args) { pipeinfo *pi = (pipeinfo *) args; char *lastBuf = pi->buffer; DWORD dwRead; BOOL ok; again: if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { CloseHandle(pi->pipe); return (DWORD)-1; } ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); if (!ok || dwRead == 0) { CloseHandle(pi->pipe); return 0; } lastBuf += dwRead; goto again; return 0; /* makes the compiler happy */ } int IsIn( const char *string, const char *substring) { return (strstr(string, substring) != NULL); } /* * Find a specified #define by name. * * If the line is '#define TCL_VERSION "8.5"', it returns 85 as the result. */ int GrepForDefine( const char *file, const char *string) { char s1[51], s2[51], s3[51]; FILE *f = fopen(file, "rt"); if (f == NULL) { return 0; } do { int r = fscanf(f, "%50s", s1); if (r == 1 && !strcmp(s1, "#define")) { /* * Get next two words. */ r = fscanf(f, "%50s %50s", s2, s3); if (r != 2) { continue; } /* * Is the first word what we're looking for? */ if (!strcmp(s2, string)) { double d1; fclose(f); /* * Add 1 past first double quote char. "8.5" */ d1 = atof(s3 + 1); /* 8.5 */ while (floor(d1) != d1) { d1 *= 10.0; } return ((int) d1); /* 85 */ } } } while (!feof(f)); fclose(f); return 0; } /* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version * following the match where a version is anything acceptable to * package provide or package ifneeded. */ const char * GetVersionFromFile( const char *filename, const char *match) { size_t cbBuffer = 100; static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); if (fp != NULL) { /* * Read data until we see our match string. */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); if (p != NULL) { /* * Skip to first digit. */ while (*p && !isdigit(*p)) { ++p; } /* * Find ending whitespace. */ q = p; while (*q && (isalnum(*q) || *q == '.')) { ++q; } memcpy(szBuffer, p, q - p); szBuffer[q-p] = 0; szResult = szBuffer; break; } } fclose(fp); } return szResult; } /* * List helpers for the SubstituteFile function */ typedef struct list_item_t { struct list_item_t *nextPtr; char * key; char * value; } list_item_t; /* insert a list item into the list (list may be null) */ static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { list_item_t *itemPtr = malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); itemPtr->nextPtr = NULL; while(*listPtrPtr) { listPtrPtr = &(*listPtrPtr)->nextPtr; } *listPtrPtr = itemPtr; } return itemPtr; } static void list_free(list_item_t **listPtrPtr) { list_item_t *tmpPtr, *listPtr = *listPtrPtr; while (listPtr) { tmpPtr = listPtr; listPtr = listPtr->nextPtr; free(tmpPtr->key); free(tmpPtr->value); free(tmpPtr); } } /* * SubstituteFile -- * As windows doesn't provide anything useful like sed and it's unreliable * to use the tclsh you are building against (consider x-platform builds - * eg compiling AMD64 target from IX86) we provide a simple substitution * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ * @PACKAGE_NAME@ $(PACKAGE_NAME) * @PACKAGE_VERSION@ $(PACKAGE_VERSION) * << */ int SubstituteFile( const char *substitutions, const char *filename) { size_t cbBuffer = 1024; static char szBuffer[1024], szCopy[1024]; char *szResult = NULL; list_item_t *substPtr = NULL; FILE *fp, *sp; fp = fopen(filename, "rt"); if (fp != NULL) { /* * Build a list of substutitions from the first filename */ sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { char *ks, *ke, *vs, *ve; ks = szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; vs = ke; while (vs && *vs && isspace(*vs)) ++vs; ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; list_insert(&substPtr, ks, vs); } fclose(sp); } /* debug: dump the list */ #ifdef _DEBUG { int n = 0; list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr, ++n) { fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value); } } #endif /* * Run the substitutions over each line of the input */ while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); if (m) { char *cp, *op, *sp; cp = szCopy; op = szBuffer; while (op != m) *cp++ = *op++; sp = p->value; while (sp && *sp) *cp++ = *sp++; op += strlen(p->key); while (*op) *cp++ = *op++; *cp = 0; memcpy(szBuffer, szCopy, sizeof(szCopy)); } } printf(szBuffer); } list_free(&substPtr); } fclose(fp); return 0; } /* * Local variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * indent-tabs-mode: t * tab-width: 8 * End: */ vqtcl/win/rules.vc0000644000076500007650000003447410621166172014110 0ustar jcwjcw00000000000000#------------------------------------------------------------------------------ # rules.vc -- # # Microsoft Visual C++ makefile include for decoding the commandline # macros. This file does not need editing to build Tcl. # # This version is modified from the Tcl source version to support # building extensions using nmake. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2005 Patrick Thoyts # #------------------------------------------------------------------------------ # RCS: @(#) $Id: rules.vc 1479 2007-05-11 22:21:46Z jcw $ #------------------------------------------------------------------------------ !ifndef _RULES_VC _RULES_VC = 1 cc32 = $(CC) # built-in default. link32 = link lib32 = lib rc32 = $(RC) # built-in default. !ifndef INSTALLDIR ### Assume the normal default. _INSTALLDIR = C:\Program Files\Tcl !else ### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\) !endif !ifndef MACHINE MACHINE = IX86 !endif !ifndef CFG_ENCODING CFG_ENCODING = \"cp1252\" !endif #---------------------------------------------------------- # Set the proper copy method to avoid overwrite questions # to the user when copying files and selecting the right # "delete all" method. #---------------------------------------------------------- !if "$(OS)" == "Windows_NT" RMDIR = rmdir /S /Q ERRNULL = 2>NUL !if ![ver | find "4.0" > nul] CPY = echo y | xcopy /i >NUL COPY = copy >NUL !else CPY = xcopy /i /y >NUL COPY = copy /y >NUL !endif !else # "$(OS)" != "Windows_NT" CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. RMDIR = deltree /Y NULL = \NUL # Used in testing directory existence ERRNULL = >NUL # Win9x shell cannot redirect stderr !endif MKDIR = mkdir !message =============================================================================== #---------------------------------------------------------- # build the helper app we need to overcome nmake's limiting # environment. #---------------------------------------------------------- !if !exist(nmakehlp.exe) !if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] !endif !endif #---------------------------------------------------------- # Test for compiler features #---------------------------------------------------------- ### test for optimizations !if [nmakehlp -c -Ot] !message *** Compiler has 'Optimizations' OPTIMIZING = 1 !else !message *** Compiler doesn't have 'Optimizations' OPTIMIZING = 0 !endif OPTIMIZATIONS = !if [nmakehlp -c -Ot] OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot !endif !if [nmakehlp -c -Oi] OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi !endif !if [nmakehlp -c -Op] OPTIMIZATIONS = $(OPTIMIZATIONS) -Op !endif !if [nmakehlp -c -fp:strict] OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict !endif !if [nmakehlp -c -Gs] OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs !endif !if [nmakehlp -c -GS] OPTIMIZATIONS = $(OPTIMIZATIONS) -GS !endif !if [nmakehlp -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -GL !endif DEBUGFLAGS = !if [nmakehlp -c -RTC1] DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 !elseif [nmakehlp -c -GZ] DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif COMPILERFLAGS =-W3 # In v13 -GL and -YX are incompatible. !if [nmakehlp -c -YX] !if ![nmakehlp -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -YX !endif !endif !if "$(MACHINE)" == "IX86" ### test for pentium errata !if [nmakehlp -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f !else !message *** Compiler doesn't have 'Pentium 0x0f fix' !endif !endif !if "$(MACHINE)" == "IA64" ### test for Itanium errata !if [nmakehlp -c -QIA64_Bx] !message *** Compiler has 'B-stepping errata workarounds' COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx !else !message *** Compiler does not have 'B-stepping errata workarounds' !endif !endif !if "$(MACHINE)" == "IX86" ### test for -align:4096, when align:512 will do. !if [nmakehlp -l -opt:nowin98] !message *** Linker has 'Win98 alignment problem' ALIGN98_HACK = 1 !else !message *** Linker doesn't have 'Win98 alignment problem' ALIGN98_HACK = 0 !endif !else ALIGN98_HACK = 0 !endif LINKERFLAGS = !if [nmakehlp -l -ltcg] LINKERFLAGS =-ltcg !endif #---------------------------------------------------------- # MSVC8 (ships with Visual Studio 2005) generates a manifest # file that we should link into the binaries. This is how. #---------------------------------------------------------- _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ && ![cl -nologo -TC -P vercl.x $(ERRNULL)] !include vercl.i !if $(VCVERSION) >= 1400 VCVER=8 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !elseif $(VCVERSION) >= 1300 VCVER=7 !elseif $(VCVERSION) >= 1200 VCVER=6 !endif !endif #---------------------------------------------------------- # Decode the options requested. #---------------------------------------------------------- !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] STATIC_BUILD = 0 TCL_THREADS = 1 DEBUG = 0 PROFILE = 0 MSVCRT = 0 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 USE_THREAD_STORAGE = 1 UNCHECKED = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static STATIC_BUILD = 1 !else STATIC_BUILD = 0 !endif !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt MSVCRT = 1 !else MSVCRT = 0 !endif !if [nmakehlp -f $(OPTS) "staticpkg"] !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !else TCL_USE_STATIC_PACKAGES = 0 !endif !if [nmakehlp -f $(OPTS) "nothreads"] !message *** Compile explicitly for non-threaded tcl TCL_THREADS = 0 !else TCL_THREADS = 1 !endif !if [nmakehlp -f $(OPTS) "symbols"] !message *** Doing symbols DEBUG = 1 !else DEBUG = 0 !endif !if [nmakehlp -f $(OPTS) "profile"] !message *** Doing profile PROFILE = 1 !else PROFILE = 0 !endif !if [nmakehlp -f $(OPTS) "loimpact"] !message *** Doing loimpact LOIMPACT = 1 !else LOIMPACT = 0 !endif !if [nmakehlp -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 !else USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "thrdstorage"] !message *** Doing thrdstorage USE_THREAD_STORAGE = 1 !else USE_THREAD_STORAGE = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] !message *** Doing unchecked UNCHECKED = 1 !else UNCHECKED = 0 !endif !endif !if !$(STATIC_BUILD) # Make sure we don't build overly fat DLLs. MSVCRT = 1 # We shouldn't statically put the extensions inside the shell when dynamic. TCL_USE_STATIC_PACKAGES = 0 !endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. # We wouldn't want different builds to use the same .obj files # by accident. #---------------------------------------------------------- #---------------------------------------- # Naming convention: # t = full thread support. # s = static library (as opposed to an # import library) # g = linked to the debug enabled C # run-time. # x = special static build when it # links to the dynamic C run-time. #---------------------------------------- SUFX = sgx !if $(DEBUG) BUILDDIRTOP = Debug !else BUILDDIRTOP = Release !endif !if "$(MACHINE)" != "IX86" BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) !endif !if $(VCVER) > 6 BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) !endif !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD) TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll !if $(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib !if !$(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !endif !if !$(TCL_THREADS) TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) SUFX = $(SUFX:t=) !endif !ifndef TMP_DIR TMP_DIR = $(TMP_DIRFULL) !ifndef OUT_DIR OUT_DIR = .\$(BUILDDIRTOP) !endif !else !ifndef OUT_DIR OUT_DIR = $(TMP_DIR) !endif !endif #---------------------------------------------------------- # Decode the statistics requested. #---------------------------------------------------------- !if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] TCL_MEM_DEBUG = 0 TCL_COMPILE_DEBUG = 0 !else !if [nmakehlp -f $(STATS) "memdbg"] !message *** Doing memdbg TCL_MEM_DEBUG = 1 !else TCL_MEM_DEBUG = 0 !endif !if [nmakehlp -f $(STATS) "compdbg"] !message *** Doing compdbg TCL_COMPILE_DEBUG = 1 !else TCL_COMPILE_DEBUG = 0 !endif !endif #---------------------------------------------------------- # Decode the checks requested. #---------------------------------------------------------- !if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] TCL_NO_DEPRECATED = 0 FULLWARNINGS = 0 !else !if [nmakehlp -f $(CHECKS) "nodep"] !message *** Doing nodep check TCL_NO_DEPRECATED = 1 !else TCL_NO_DEPRECATED = 0 !endif !if [nmakehlp -f $(CHECKS) "fullwarn"] !message *** Doing full warnings check FULLWARNINGS = 1 !else FULLWARNINGS = 0 !endif !endif #---------------------------------------------------------- # Set our defines now armed with our options. #---------------------------------------------------------- OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) !if $(TCL_MEM_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG !endif !if $(TCL_COMPILE_DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS !endif !if $(TCL_THREADS) OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 !if $(USE_THREAD_ALLOC) OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 !endif !if $(USE_THREAD_STORAGE) OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_STORAGE=1 !endif !endif !if $(STATIC_BUILD) OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD !endif !if $(TCL_NO_DEPRECATED) OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED !endif !if $(DEBUG) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG !elseif $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED !endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "IA64" OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT !endif #---------------------------------------------------------- # Get common info used when building extensions. #---------------------------------------------------------- !if "$(PROJECT)" != "tcl" # If INSTALLDIR set to tcl root dir then reset to the lib dir. !if exist("$(_INSTALLDIR)\include\tcl.h") _INSTALLDIR=$(_INSTALLDIR)\lib !endif !if !defined(TCLDIR) !if exist("$(_INSTALLDIR)\..\include\tcl.h") TCLINSTALL = 1 _TCLDIR = $(_INSTALLDIR)\.. _TCL_H = $(_INSTALLDIR)\..\include\tcl.h TCLDIR = $(_INSTALLDIR)\.. !else MSG=^ Failed to find tcl.h. Set the TCLDIR macro. !error $(MSG) !endif !else _TCLDIR = $(TCLDIR:/=\) !if exist("$(_TCLDIR)\include\tcl.h") TCLINSTALL = 1 _TCL_H = $(_TCLDIR)\include\tcl.h !elseif exist("$(_TCLDIR)\generic\tcl.h") TCLINSTALL = 0 _TCL_H = $(_TCLDIR)\generic\tcl.h !else MSG =^ Failed to find tcl.h. The TCLDIR macro does not appear correct. !error $(MSG) !endif !endif !if [echo REM = This file is generated from rules.vc > version.vc] !endif !if exist("$(_TCL_H)") !if [echo TCL_DOTVERSION = \>> version.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_VERSION >> version.vc] !endif !endif !include version.vc TCL_VERSION = $(TCL_DOTVERSION:.=) !if $(TCLINSTALL) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" !if !exist($(TCLSH)) && $(TCL_THREADS) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" TCL_LIBRARY = $(_TCLDIR)\lib TCL_INCLUDES = -I"$(_TCLDIR)\include" !else TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" !if !exist($(TCLSH)) && $(TCL_THREADS) TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" TCL_LIBRARY = $(_TCLDIR)\library TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif !endif #---------------------------------------------------------- # Optionally check for Tk info for building extensions. #---------------------------------------------------------- !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" !if !defined(TKDIR) !if exist("$(_INSTALLDIR)\..\include\tk.h") TKINSTALL = 1 _TKDIR = $(_INSTALLDIR)\.. _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !elseif exist("$(_TCLDIR)\include\tk.h") TKINSTALL = 1 _TKDIR = $(_TCLDIR) _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !endif !else _TKDIR = $(TKDIR:/=\) !if exist("$(_TKDIR)\include\tk.h") TKINSTALL = 1 _TK_H = $(_TKDIR)\include\tk.h !elseif exist("$(_TKDIR)\generic\tk.h") TKINSTALL = 0 _TK_H = $(_TKDIR)\generic\tk.h !else MSG =^ Failed to find tk.h. The TKDIR macro does not appear correct. !error $(MSG) !endif !endif !if defined(TKDIR) TK_DOTVERSION = 8.4 !if exist("$(_TK_H)") !if [echo TK_DOTVERSION = \>> version.vc] \ && [nmakehlp -V "$(_TK_H)" TK_VERSION >> version.vc] !endif !endif !include version.vc TK_VERSION = $(TK_DOTVERSION:.=) !if $(TKINSTALL) WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" TK_INCLUDES = -I"$(_TKDIR)\include" !else WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !endif !endif !endif #---------------------------------------------------------- # Display stats being used. #---------------------------------------------------------- !message *** Intermediate directory will be '$(TMP_DIR)' !message *** Output directory will be '$(OUT_DIR)' !message *** Suffix for binaries will be '$(SUFX)' !message *** Optional defines are '$(OPTDEFINES)' !message *** Compiler version $(VCVER). Target machine is $(MACHINE) !message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS)' !message *** Link options '$(LINKERFLAGS)' !endif vqtcl/win/unistd.h0000644000076500007650000000073110606404641014067 0ustar jcwjcw00000000000000/* unistd.h - this file is for MSVC only, it containd only what Vlerq needs! */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #ifdef _MSC_VER typedef unsigned __int64 uint64_t; typedef __int64 int64_t; typedef unsigned __int32 uint32_t; typedef __int32 int32_t; typedef unsigned __int16 uint16_t; typedef __int16 int16_t; /*typedef unsigned __int8 uint8_t;*/ typedef __int8 int8_t; #define strcasecmp _stricmp #endif