#!/usr/make
#
# Makefile for SQLITE
+#
+# This makefile is suppose to be configured automatically using the
+# autoconf. But if that does not work for you, you can configure
+# the makefile manually. Just set the parameters below to values that
+# work well for your system.
+#
+# If the configure script does not work out-of-the-box, you might
+# be able to get it to work by giving it some hints. See the comment
+# at the beginning of configure.in for additional information.
+#
-# The toplevel directory of the source tree
+# The toplevel directory of the source tree. This is the directory
+# that contains this "Makefile.in" and the "configure.in" script.
#
TOP = @srcdir@
BCC = @BUILD_CC@ @BUILD_CFLAGS@
# C Compile and options for use in building executables that
-# will run on the target platform.
+# will run on the target platform. (BCC and TCC are usually the
+# same unless your are cross-compiling.)
#
TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
AR = @TARGET_AR@
RANLIB = @TARGET_RANLIB@
-# Compiler options needed for programs that use the GDBM library.
-#
-GDBM_FLAGS = @TARGET_GDBM_INC@
-
-# The library that programs using GDBM must link against.
-#
-LIBGDBM = @TARGET_GDBM_LIBS@
-
# Compiler options needed for programs that use the TCL library.
#
TCL_FLAGS = @TARGET_TCL_INC@
#
LIBREADLINE = @TARGET_READLINE_LIBS@
+# Should the database engine assume text is coded as UTF-8 or iso8859?
+#
+# ENCODING = UTF8
+# ENCODING = ISO8859
+ENCODING = @ENCODING@
+
+# You should not have to change anything below this line
+###############################################################################
+
# Object files for the SQLite library.
#
LIBOBJ = btree.o build.o delete.o expr.o insert.o \
sqlite: $(TOP)/src/shell.c libsqlite.a sqlite.h
$(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \
- libsqlite.a $(LIBGDBM) $(LIBREADLINE)
+ libsqlite.a $(LIBREADLINE)
# Rules to build the LEMON compiler generator
#
parse.h
btree.o: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/btree.c
+ $(TCC) -c $(TOP)/src/btree.c
build.o: $(TOP)/src/build.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/build.c
+ $(TCC) -c $(TOP)/src/build.c
main.o: $(TOP)/src/main.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/main.c
+ $(TCC) -c $(TOP)/src/main.c
pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/pager.c
+ $(TCC) -c $(TOP)/src/pager.c
parse.o: parse.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c parse.c
+ $(TCC) -c parse.c
parse.h: parse.c
sqlite.h: $(TOP)/src/sqlite.h.in
sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \
- -e s/--ENCODING--/@ENCODING@/ \
+ -e s/--ENCODING--/$(ENCODING)/ \
$(TOP)/src/sqlite.h.in >sqlite.h
tokenize.o: $(TOP)/src/tokenize.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/tokenize.c
+ $(TCC) -c $(TOP)/src/tokenize.c
util.o: $(TOP)/src/util.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/util.c
+ $(TCC) -c $(TOP)/src/util.c
vdbe.o: $(TOP)/src/vdbe.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/vdbe.c
+ $(TCC) -c $(TOP)/src/vdbe.c
where.o: $(TOP)/src/where.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/where.c
+ $(TCC) -c $(TOP)/src/where.c
delete.o: $(TOP)/src/delete.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/delete.c
+ $(TCC) -c $(TOP)/src/delete.c
expr.o: $(TOP)/src/expr.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/expr.c
+ $(TCC) -c $(TOP)/src/expr.c
insert.o: $(TOP)/src/insert.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/insert.c
+ $(TCC) -c $(TOP)/src/insert.c
random.o: $(TOP)/src/random.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/random.c
+ $(TCC) -c $(TOP)/src/random.c
select.o: $(TOP)/src/select.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/select.c
+ $(TCC) -c $(TOP)/src/select.c
table.o: $(TOP)/src/table.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/table.c
+ $(TCC) -c $(TOP)/src/table.c
update.o: $(TOP)/src/update.c $(HDR)
- $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/update.c
+ $(TCC) -c $(TOP)/src/update.c
tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR)
- $(TCC) $(GDBM_FLAGS) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
+ $(TCC) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c
printf.o: $(TOP)/src/printf.c $(HDR)
- $(TCC) $(GDBM_FLAGS) $(TCL_FLAGS) -c $(TOP)/src/printf.c
-
-gdbmdump: $(TOP)/tool/gdbmdump.c
- $(TCC) $(GDBM_FLAGS) -o gdbmdump $(TOP)/tool/gdbmdump.c $(LIBGDBM)
+ $(TCC) $(TCL_FLAGS) -c $(TOP)/src/printf.c
tclsqlite: $(TOP)/src/tclsqlite.c libsqlite.a
$(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
- $(TOP)/src/tclsqlite.c libsqlite.a $(LIBGDBM) $(LIBTCL)
+ $(TOP)/src/tclsqlite.c libsqlite.a $(LIBTCL)
testfixture: $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC)
$(TCC) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -o testfixture \
$(TESTSRC) $(TOP)/src/tclsqlite.c \
- libsqlite.a $(LIBGDBM) $(LIBTCL)
+ libsqlite.a $(LIBTCL)
test: testfixture sqlite
./testfixture $(TOP)/test/all.test
--with-hints=FILE Read configuration options from FILE"
ac_help="$ac_help
--enable-utf8 Use UTF-8 encodings"
-ac_help="$ac_help
- --disable-gdbm Omit the GDBM drivers"
# Initialize some variables set by options.
# The variables have the same names as the options, with
# The following RCS revision string applies to configure.in
-# $Revision: 1.10 $
+# $Revision: 1.11 $
#########
# Make sure we are not building in a subdirectory of the source tree.
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:608: checking for $ac_word" >&5
+echo "configure:606: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:638: checking for $ac_word" >&5
+echo "configure:636: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:689: checking for $ac_word" >&5
+echo "configure:687: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:721: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:719: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 732 "configure"
+#line 730 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:768: checking whether we are using GNU C" >&5
+echo "configure:766: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:794: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
BUILD_CC=$config_BUILD_CC
echo $ac_n "checking host compiler""... $ac_c" 1>&6
-echo "configure:835: checking host compiler" >&5
+echo "configure:833: checking host compiler" >&5
CC=$BUILD_CC
echo "$ac_t""$BUILD_CC" 1>&6
fi
echo $ac_n "checking switches for the host compiler""... $ac_c" 1>&6
-echo "configure:840: checking switches for the host compiler" >&5
+echo "configure:838: checking switches for the host compiler" >&5
if test "$config_BUILD_CFLAGS" != ""; then
CFLAGS=$config_BUILD_CFLAGS
BUILD_CFLAGS=$config_BUILD_CFLAGS
# the target machine.
#
echo $ac_n "checking target compiler""... $ac_c" 1>&6
-echo "configure:860: checking target compiler" >&5
+echo "configure:858: checking target compiler" >&5
if test "$config_TARGET_CC" != ""; then
TARGET_CC=$config_TARGET_CC
else
fi
echo "$ac_t""$TARGET_CC" 1>&6
echo $ac_n "checking switches on the target compiler""... $ac_c" 1>&6
-echo "configure:868: checking switches on the target compiler" >&5
+echo "configure:866: checking switches on the target compiler" >&5
if test "$config_TARGET_CFLAGS" != ""; then
TARGET_CFLAGS=$config_TARGET_CFLAGS
else
fi
echo "$ac_t""$TARGET_CFLAGS" 1>&6
echo $ac_n "checking target linker""... $ac_c" 1>&6
-echo "configure:876: checking target linker" >&5
+echo "configure:874: checking target linker" >&5
if test "$config_TARGET_LINK" = ""; then
TARGET_LINK=$TARGET_CC
else
fi
echo "$ac_t""$TARGET_LINK" 1>&6
echo $ac_n "checking switches on the target compiler""... $ac_c" 1>&6
-echo "configure:884: checking switches on the target compiler" >&5
+echo "configure:882: checking switches on the target compiler" >&5
if test "$config_TARGET_TFLAGS" != ""; then
TARGET_TFLAGS=$config_TARGET_TFLAGS
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:896: checking for $ac_word" >&5
+echo "configure:894: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# it 0 if we are not.
#
echo $ac_n "checking if host and target compilers are the same""... $ac_c" 1>&6
-echo "configure:942: checking if host and target compilers are the same" >&5
+echo "configure:940: checking if host and target compilers are the same" >&5
if test "$BUILD_CC" = "$TARGET_CC"; then
cross=0
echo "$ac_t""yes" 1>&6
fi
echo $ac_n "checking character encoding""... $ac_c" 1>&6
-echo "configure:963: checking character encoding" >&5
+echo "configure:961: checking character encoding" >&5
if test "$enable_utf8" = "no"; then
ENCODING=ISO8859
echo "$ac_t""iso8859" 1>&6
# things accordingly.
#
echo $ac_n "checking if executables have the .exe suffix""... $ac_c" 1>&6
-echo "configure:979: checking if executables have the .exe suffix" >&5
+echo "configure:977: checking if executables have the .exe suffix" >&5
if test "$config_BUILD_EXEEXT" = ".exe"; then
CYGWIN=yes
echo "$ac_t""yes" 1>&6
fi
if test "$CYGWIN" != "yes"; then
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:988: checking for Cygwin environment" >&5
+echo "configure:986: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 993 "configure"
+#line 991 "configure"
#include "confdefs.h"
int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
fi
CC=$TARGET_CC
echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:1068: checking for sin" >&5
+echo "configure:1066: checking for sin" >&5
if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1073 "configure"
+#line 1071 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char sin(); below. */
; return 0; }
EOF
-if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_sin=yes"
else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1117: checking for dlopen in -ldl" >&5
+echo "configure:1115: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1125 "configure"
+#line 1123 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LIBS=""
echo $ac_n "checking for library containing Tcl_Init""... $ac_c" 1>&6
-echo "configure:1170: checking for library containing Tcl_Init" >&5
+echo "configure:1168: checking for library containing Tcl_Init" >&5
if eval "test \"`echo '$''{'ac_cv_search_Tcl_Init'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_Tcl_Init="no"
cat > conftest.$ac_ext <<EOF
-#line 1177 "configure"
+#line 1175 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Tcl_Init()
; return 0; }
EOF
-if { (eval echo configure:1188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_Tcl_Init="none required"
else
test "$ac_cv_search_Tcl_Init" = "no" && for i in tcl8.4 tcl8.3 tcl8.2 tcl8.1 tcl8.0 tcl80 tcl; do
LIBS="-l$i $otherlibs $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1199 "configure"
+#line 1197 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Tcl_Init()
; return 0; }
EOF
-if { (eval echo configure:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_Tcl_Init="-l$i"
break
# Figure out where to get the TCL header files.
#
echo $ac_n "checking TCL header files""... $ac_c" 1>&6
-echo "configure:1239: checking TCL header files" >&5
+echo "configure:1237: checking TCL header files" >&5
found=no
if test "$config_TARGET_TCL_INC" != ""; then
TARGET_TCL_INC=$config_TARGET_TCL_INC
else
echo "$ac_t""not specified: still searching..." 1>&6
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1258: checking how to run the C preprocessor" >&5
+echo "configure:1256: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1273 "configure"
+#line 1271 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1290 "configure"
+#line 1288 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1307 "configure"
+#line 1305 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
ac_safe=`echo "tcl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tcl.h""... $ac_c" 1>&6
-echo "configure:1339: checking for tcl.h" >&5
+echo "configure:1337: checking for tcl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1344 "configure"
+#line 1342 "configure"
#include "confdefs.h"
#include <tcl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_safe=`echo "$dir/include/tcl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $dir/include/tcl.h""... $ac_c" 1>&6
-echo "configure:1376: checking for $dir/include/tcl.h" >&5
+echo "configure:1374: checking for $dir/include/tcl.h" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
-##########
-# Figure out what C libraries are required to compile programs
-# that use GDBM.
-#
-use_gdbm=true
-# Check whether --enable-gdbm or --disable-gdbm was given.
-if test "${enable_gdbm+set}" = set; then
- enableval="$enable_gdbm"
- use_gdbm=$enableval
-else
- use_gdbm=true
-
-fi
-
-if test "$use_gdbm" = "no"; then use_gdbm=false; fi
-if test "$use_gdbm" = "yes"; then use_gdbm=true; fi
-if $use_gdbm; then
- if test "$config_TARGET_GDBM_LIBS" != ""; then
- TARGET_GDBM_LIBS="$config_TARGET_GDBM_LIBS"
- else
- CC=$TARGET_CC
- LIBS=""
-
-echo $ac_n "checking for library containing gdbm_open""... $ac_c" 1>&6
-echo "configure:1433: checking for library containing gdbm_open" >&5
-if eval "test \"`echo '$''{'ac_cv_search_gdbm_open'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_gdbm_open="no"
-cat > conftest.$ac_ext <<EOF
-#line 1440 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gdbm_open();
-
-int main() {
-gdbm_open()
-; return 0; }
-EOF
-if { (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_search_gdbm_open="none required"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-test "$ac_cv_search_gdbm_open" = "no" && for i in gdbm; do
-LIBS="-l$i $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1462 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gdbm_open();
-
-int main() {
-gdbm_open()
-; return 0; }
-EOF
-if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_search_gdbm_open="-l$i"
-break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
-LIBS="$ac_func_search_save_LIBS"
-fi
-
-echo "$ac_t""$ac_cv_search_gdbm_open" 1>&6
-if test "$ac_cv_search_gdbm_open" != "no"; then
- test "$ac_cv_search_gdbm_open" = "none required" || LIBS="$ac_cv_search_gdbm_open $LIBS"
-
-else :
-
-fi
- TARGET_GDBM_LIBS="$LIBS"
- fi
-fi
-
-
-##########
-# Figure out where to get the GDBM header files.
-#
-if $use_gdbm; then
- echo $ac_n "checking GDBM header files""... $ac_c" 1>&6
-echo "configure:1503: checking GDBM header files" >&5
- found=no
- if test "$config_TARGET_GDBM_INC" != ""; then
- TARGET_GDBM_INC=$config_TARGET_GDBM_INC
- found=yes
- fi
- if test "$found" = "yes"; then
- echo "$ac_t""$TARGET_GDBM_INC" 1>&6
- else
- echo "$ac_t""not specified: still searching..." 1>&6
- ac_safe=`echo "gdbm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for gdbm.h""... $ac_c" 1>&6
-echo "configure:1515: checking for gdbm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1520 "configure"
-#include "confdefs.h"
-#include <gdbm.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- found=yes
-else
- echo "$ac_t""no" 1>&6
-fi
-
- fi
- if test "$found" = "no"; then
- for dir in /usr/local /usr/pkg /usr/contrib; do
-
-ac_safe=`echo "$dir/include/gdbm.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $dir/include/gdbm.h""... $ac_c" 1>&6
-echo "configure:1552: checking for $dir/include/gdbm.h" >&5
-if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
-else
- if test -r $dir/include/gdbm.h; then
- eval "ac_cv_file_$ac_safe=yes"
- else
- eval "ac_cv_file_$ac_safe=no"
- fi
-fi
-fi
-if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- found=yes
-else
- echo "$ac_t""no" 1>&6
-
-fi
-
- if test "$found" = "yes"; then
- TARGET_GDBM_INC="-I$dir/include"
- break
- fi
- done
- fi
-else
- TARGET_GDBM_INC="-DDISABLE_GDBM"
-fi
-
-
##########
# Figure out what C libraries are required to compile programs
# that use "readline()" library.
LIBS=""
echo $ac_n "checking for library containing readline""... $ac_c" 1>&6
-echo "configure:1596: checking for library containing readline" >&5
+echo "configure:1418: checking for library containing readline" >&5
if eval "test \"`echo '$''{'ac_cv_search_readline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_readline="no"
cat > conftest.$ac_ext <<EOF
-#line 1603 "configure"
+#line 1425 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
readline()
; return 0; }
EOF
-if { (eval echo configure:1614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_readline="none required"
else
test "$ac_cv_search_readline" = "no" && for i in readline; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1625 "configure"
+#line 1447 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
readline()
; return 0; }
EOF
-if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_readline="-l$i"
break
# Figure out where to get the READLINE header files.
#
echo $ac_n "checking readline header files""... $ac_c" 1>&6
-echo "configure:1664: checking readline header files" >&5
+echo "configure:1486: checking readline header files" >&5
found=no
if test "$config_TARGET_READLINE_INC" != ""; then
TARGET_READLINE_INC=$config_TARGET_READLINE_INC
echo "$ac_t""not specified: still searching..." 1>&6
ac_safe=`echo "readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for readline.h""... $ac_c" 1>&6
-echo "configure:1676: checking for readline.h" >&5
+echo "configure:1498: checking for readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1681 "configure"
+#line 1503 "configure"
#include "confdefs.h"
#include <readline.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_safe=`echo "$dir/include/readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $dir/include/readline.h""... $ac_c" 1>&6
-echo "configure:1713: checking for $dir/include/readline.h" >&5
+echo "configure:1535: checking for $dir/include/readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_safe=`echo "$dir/include/readline/readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $dir/include/readline/readline.h""... $ac_c" 1>&6
-echo "configure:1742: checking for $dir/include/readline/readline.h" >&5
+echo "configure:1564: checking for $dir/include/readline/readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Figure out whether or not we have a "usleep()" function.
#
echo $ac_n "checking for usleep""... $ac_c" 1>&6
-echo "configure:1786: checking for usleep" >&5
+echo "configure:1608: checking for usleep" >&5
if eval "test \"`echo '$''{'ac_cv_func_usleep'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1791 "configure"
+#line 1613 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char usleep(); below. */
; return 0; }
EOF
-if { (eval echo configure:1814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_usleep=yes"
else
s%@TARGET_TCL_LIBS@%$TARGET_TCL_LIBS%g
s%@CPP@%$CPP%g
s%@TARGET_TCL_INC@%$TARGET_TCL_INC%g
-s%@TARGET_GDBM_LIBS@%$TARGET_GDBM_LIBS%g
-s%@TARGET_GDBM_INC@%$TARGET_GDBM_INC%g
s%@TARGET_READLINE_LIBS@%$TARGET_READLINE_LIBS%g
s%@TARGET_READLINE_INC@%$TARGET_READLINE_INC%g
s%@TARGET_HAVE_READLINE@%$TARGET_HAVE_READLINE%g
+++ /dev/null
-/*
-** Copyright (c) 1999, 2000 D. Richard Hipp
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of the GNU General Public
-** License as published by the Free Software Foundation; either
-** version 2 of the License, or (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** General Public License for more details.
-**
-** You should have received a copy of the GNU General Public
-** License along with this library; if not, write to the
-** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-** Boston, MA 02111-1307, USA.
-**
-** Author contact information:
-** drh@hwaci.com
-** http://www.hwaci.com/drh/
-**
-*************************************************************************
-** A utility print statistics about the content of a GDBM database.
-*/
-#include <stdio.h>
-#include <ctype.h>
-#include <gdbm.h>
-#include <stdlib.h>
-
-static int bins[] = {
- 4, 8, 12, 16, 24,
- 32, 40, 48, 56, 64,
- 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
- 288, 320, 352, 384, 416, 448, 480, 512, 1024, 2048, 4096, 8192,
- 16384, 32768, 65536,
-};
-#define NBIN (sizeof(bins)/sizeof(bins[0])+1)
-
-static int gAllSize[NBIN];
-static int gCount;
-static int gTotal;
-static int gMax;
-static int gKey;
-static int gMaxKey;
-
-static int gdbm_stat(char *zFilename){
- GDBM_FILE p;
- datum data, key, next;
- int nEntry = 0;
- int keyTotal = 0;
- int dataTotal = 0;
- int allTotal = 0;
- int lMax = 0;
- int keySize[NBIN], dataSize[NBIN], allSize[NBIN];
- int i, priorSize;
-
- p = gdbm_open(zFilename, 0, GDBM_READER, 0, 0);
- if( p==0 ){
- fprintf(stderr,"can't open file \"%s\"\n", zFilename);
- return 1;
- }
- for(i=0; i<NBIN; i++){
- keySize[i] = 0;
- dataSize[i] = 0;
- allSize[i] = 0;
- }
- key = gdbm_firstkey(p);
- while( key.dptr ){
- int all;
- nEntry++;
- gCount++;
- keyTotal += key.dsize;
- for(i=0; i<NBIN-1 && key.dsize>bins[i]; i++){}
- keySize[i]++;
- gKey += key.dsize;
- if( key.dsize>gMaxKey ) gMaxKey = key.dsize;
- data = gdbm_fetch(p, key);
- if( data.dptr==0 ) data.dsize = 0;
- dataTotal += data.dsize;
- for(i=0; i<NBIN-1 && data.dsize>bins[i]; i++){}
- dataSize[i]++;
- all = key.dsize + data.dsize;
- allTotal += all;
- gTotal += all;
- if( all>gMax ) gMax = all;
- if( all>lMax ) lMax = all;
- for(i=0; i<NBIN-1 && all>bins[i]; i++){}
- allSize[i]++;
- gAllSize[i]++;
- next = gdbm_nextkey(p, key);
- free( key.dptr );
- key = next;
- }
- gdbm_close(p);
- printf("%s:\n", zFilename);
- printf(" entries: %d\n", nEntry);
- printf(" keysize: %d (%d per entry)\n",
- keyTotal, nEntry>0 ? (keyTotal+nEntry-1)/nEntry : 0);
- printf(" datasize: %d (%d per entry)\n",
- dataTotal, nEntry>0 ? (dataTotal+nEntry-1)/nEntry : 0);
- printf(" size: %d (%d per entry)\n",
- allTotal, nEntry>0 ? (allTotal+nEntry-1)/nEntry : 0);
- priorSize = 0;
- for(i=0; i<NBIN-1; i++){
- if( keySize[i]==0 && dataSize[i]==0 ) continue;
- printf("%5d..%-5d %7d %7d %7d\n", priorSize, bins[i], keySize[i],
- dataSize[i], allSize[i]);
- priorSize = bins[i]+1;
- }
- if( keySize[NBIN-1]>0 || dataSize[NBIN-1]>0 ){
- printf("%5d..%-5d %7d %7d %7d\n", priorSize, lMax,
- keySize[NBIN-1], dataSize[NBIN-1], allSize[NBIN-1]);
- }
- return 0;
-}
-
-int main(int argc, char **argv){
- int i, ps, sum;
- int nErr = 0;
- for(i=1; i<argc; i++){
- nErr += gdbm_stat(argv[i]);
- }
- printf("*****************************************************************\n");
- printf("Entries: %d\n", gCount);
- printf("Size: %d\n", gTotal);
- printf("Avg Size: %d\n", gCount>0 ? (gTotal + gCount - 1)/gCount : 0);
- printf("Key Size: %d\n", gKey);
- printf("Avg Key Size: %d\n", gCount>0 ? (gKey + gCount - 1)/gCount : 0);
- printf("Max Key Size: %d\n\n", gMaxKey);
- ps = 0;
- sum = 0;
- for(i=0; i<NBIN-1; i++){
- if( gAllSize[i]==0 ) continue;
- sum += gAllSize[i];
- printf("%5d..%-5d %8d %3d%%\n",
- ps, bins[i], gAllSize[i], sum*100/gCount);
- ps = bins[i]+1;
- }
- if( gAllSize[NBIN-1]>0 ){
- printf("%5d..%-5d %8d 100%%\n", ps, gMax, gAllSize[NBIN-1]);
- }
- return nErr;
-}