rev 385 - in trunk: . ac-macros include/prothon modules modules/DBM src

SVN User <[email protected]> Sun, 18 Apr 2004 00:36:38 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: bcollins
Date: 2004-04-18 00:36:32 -0400 (Sun, 18 Apr 2004)
New Revision: 385

Added:
   trunk/ac-macros/find_apu.m4
   trunk/modules/DBM/
   trunk/modules/DBM/DBM.vcproj
   trunk/modules/DBM/Makefile.in
Removed:
   trunk/modules/DBM/dbm.vcproj
   trunk/modules/dbm/
Modified:
   trunk/configure
   trunk/configure.in
   trunk/include/prothon/prothon.h
   trunk/include/prothon/prothon_dll.h
   trunk/modules/DBM/DBM.c
   trunk/modules/Makefile.in
   trunk/src/Makefile.in
   trunk/src/builtins-string.c
   trunk/src/parser_routines.c
   trunk/src/pr_snprintf.c
   trunk/src/pr_snprintf.h
   trunk/src/prothon.y
Log:
Get rid of all the compiler warnings.

Add DBM module to unix build.

Bring in aprutil usage for DBM.


Added: trunk/ac-macros/find_apu.m4
===================================================================
--- trunk/ac-macros/find_apu.m4	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/ac-macros/find_apu.m4	2004-04-18 04:36:32 UTC (rev 385)
@@ -0,0 +1,103 @@
+dnl
+dnl find_apu.m4 : locate the APR-util (APU) include files and libraries
+dnl
+dnl This macro file can be used by applications to find and use the APU
+dnl library. It provides a standardized mechanism for using APU. It supports
+dnl embedding APU into the application source, or locating an installed
+dnl copy of APU.
+dnl
+dnl APR_FIND_APU([srcdir, path, implicit-install-check])
+dnl
+dnl   where srcdir is the location of the bundled APU source directory, or
+dnl   empty if source is not bundled.
+dnl   where path is the prefix to the location where the bundled APU will
+dnl   will be built.
+dnl   where implicit-install-check set to 1 indicates if there is no
+dnl   --with-apr option specified, we will look for installed copies.
+dnl
+dnl Sets the following variables on exit:
+dnl
+dnl   apu_found : "yes", "no", "reconfig"
+dnl
+dnl   apu_config : If the apu-config tool exists, this refers to it.  If
+dnl                apu_found is "reconfig", then the bundled directory
+dnl                should be reconfigured *before* using apu_config.
+dnl
+dnl Note: At this time, we cannot find *both* a source dir and a build dir.
+dnl       If both are available, the build directory should be passed to
+dnl       the --with-apr-util switch.
+dnl
+dnl Note: the installation layout is presumed to follow the standard
+dnl       PREFIX/lib and PREFIX/include pattern. If the APU config file
+dnl       is available (and can be found), then non-standard layouts are
+dnl       possible, since it will be described in the config file.
+dnl
+dnl If a bundled source directory is available and needs to be (re)configured,
+dnl then apu_found is set to "reconfig". The caller should reconfigure the
+dnl (passed-in) source directory, placing the result in the build directory,
+dnl as appropriate.
+dnl
+dnl If apu_found is "yes" or "reconfig", then the caller should use the
+dnl value of apu_config to fetch any necessary build/link information.
+dnl
+
+AC_DEFUN(APR_FIND_APU, [
+  apu_found="no"
+
+  AC_MSG_CHECKING(for APR-util)
+  AC_ARG_WITH(apr-util,
+  [  --with-apr-util=DIR     prefix for installed APU, or path to APU build tree],
+  [
+    if test "$withval" = "no" || test "$withval" = "yes"; then
+      AC_MSG_ERROR([--with-apr-util requires a directory to be provided])
+    fi
+
+    if test -x "$withval/bin/apu-config"; then
+       apu_found="yes"
+       apu_config="$withval/bin/apu-config"
+    elif test -x "$withval/apu-config"; then
+       dnl Already configured build dir
+       apu_found="yes"
+       apu_config="$withval/apu-config"
+    elif test -x "$withval" && $withval --help > /dev/null 2>&1 ; then
+       apu_found="yes"
+       apu_config="$withval"
+    fi
+
+    dnl if --with-apr-util is used, then the target prefix/directory must
+    dnl be valid
+    if test "$apu_found" != "yes"; then
+      AC_MSG_ERROR([
+The directory given to --with-apr-util does not specify a prefix for an 
+installed APU, nor an APR-util build directory.])
+    fi
+  ],[
+    dnl if we have a bundled source directory, use it
+    if test -d "$1"; then
+      apu_found="reconfig"
+      if test -n "$2"; then
+        apu_config="$2/apu-config"
+      else
+        apu_config="$1/apu-config"
+      fi
+    fi
+    if test "$apu_found" = "no" && test -n "$3" && test "$3" = "1"; then
+      if apu-config --help > /dev/null 2>&1 ; then
+        apu_found="yes"
+        apu_config="apu-config"
+      else
+        dnl look in the some standard places (apparently not in builtin/default)
+        for lookdir in /usr /usr/local /usr/local/apr \
+                       /opt/apr /usr/local/apache2 ; do
+          if test -x "$lookdir/bin/apu-config"; then
+            apu_found="yes"
+            apu_config="$lookdir/bin/apu-config"
+            break
+          fi
+        done
+      fi
+    fi
+  ])
+
+  AC_MSG_RESULT($apu_found)
+])

Modified: trunk/configure
===================================================================
--- trunk/configure	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/configure	2004-04-18 04:36:32 UTC (rev 385)
@@ -1036,6 +1036,7 @@
                           include additional configurations [automatic]
   --with-apr=DIR|FILE     prefix for installed APR, path to APR build tree,
                           or the full path to apr-config
+  --with-apr-util=DIR     prefix for installed APU, or path to APU build tree
 
 Some influential environment variables:
   CC          C compiler command
@@ -1495,6 +1496,9 @@
 
 
 
+
+
+
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
 ## Free Software Foundation, Inc.
@@ -3510,7 +3514,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3513 "configure"' > conftest.$ac_ext
+  echo '#line 3517 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4965,7 +4969,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:4968:" \
+echo "$as_me:4972:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6001,11 +6005,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6004: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6008: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6008: \$? = $ac_status" >&5
+   echo "$as_me:6012: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6234,11 +6238,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6237: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6241: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6241: \$? = $ac_status" >&5
+   echo "$as_me:6245: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6294,11 +6298,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6297: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6301: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6301: \$? = $ac_status" >&5
+   echo "$as_me:6305: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8469,7 +8473,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8472 "configure"
+#line 8476 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -8567,7 +8571,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8570 "configure"
+#line 8574 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10748,11 +10752,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10751: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10755: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:10755: \$? = $ac_status" >&5
+   echo "$as_me:10759: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -10808,11 +10812,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10811: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10815: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10815: \$? = $ac_status" >&5
+   echo "$as_me:10819: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12162,7 +12166,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12165 "configure"
+#line 12169 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12260,7 +12264,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12263 "configure"
+#line 12267 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13087,11 +13091,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13090: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13094: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13094: \$? = $ac_status" >&5
+   echo "$as_me:13098: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -13147,11 +13151,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13150: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13154: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13154: \$? = $ac_status" >&5
+   echo "$as_me:13158: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15183,11 +15187,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15186: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15190: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15190: \$? = $ac_status" >&5
+   echo "$as_me:15194: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15416,11 +15420,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15419: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15423: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15423: \$? = $ac_status" >&5
+   echo "$as_me:15427: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15476,11 +15480,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15479: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15483: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15483: \$? = $ac_status" >&5
+   echo "$as_me:15487: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17651,7 +17655,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17654 "configure"
+#line 17658 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17749,7 +17753,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17752 "configure"
+#line 17756 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19427,12 +19431,86 @@
 echo "${ECHO_T}$apr_found" >&6
 
 
+  apu_found="no"
+
+  echo "$as_me:$LINENO: checking for APR-util" >&5
+echo $ECHO_N "checking for APR-util... $ECHO_C" >&6
+
+# Check whether --with-apr-util or --without-apr-util was given.
+if test "${with_apr_util+set}" = set; then
+  withval="$with_apr_util"
+
+    if test "$withval" = "no" || test "$withval" = "yes"; then
+      { { echo "$as_me:$LINENO: error: --with-apr-util requires a directory to be provided" >&5
+echo "$as_me: error: --with-apr-util requires a directory to be provided" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    if test -x "$withval/bin/apu-config"; then
+       apu_found="yes"
+       apu_config="$withval/bin/apu-config"
+    elif test -x "$withval/apu-config"; then
+              apu_found="yes"
+       apu_config="$withval/apu-config"
+    elif test -x "$withval" && $withval --help > /dev/null 2>&1 ; then
+       apu_found="yes"
+       apu_config="$withval"
+    fi
+
+            if test "$apu_found" != "yes"; then
+      { { echo "$as_me:$LINENO: error:
+The directory given to --with-apr-util does not specify a prefix for an
+installed APU, nor an APR-util build directory." >&5
+echo "$as_me: error:
+The directory given to --with-apr-util does not specify a prefix for an
+installed APU, nor an APR-util build directory." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+else
+
+        if test -d ""$srcdir/apr-util""; then
+      apu_found="reconfig"
+      if test -n ""./apr-util""; then
+        apu_config=""./apr-util"/apu-config"
+      else
+        apu_config=""$srcdir/apr-util"/apu-config"
+      fi
+    fi
+    if test "$apu_found" = "no" && test -n "1" && test "1" = "1"; then
+      if apu-config --help > /dev/null 2>&1 ; then
+        apu_found="yes"
+        apu_config="apu-config"
+      else
+                for lookdir in /usr /usr/local /usr/local/apr \
+                       /opt/apr /usr/local/apache2 ; do
+          if test -x "$lookdir/bin/apu-config"; then
+            apu_found="yes"
+            apu_config="$lookdir/bin/apu-config"
+            break
+          fi
+        done
+      fi
+    fi
+
+fi;
+
+  echo "$as_me:$LINENO: result: $apu_found" >&5
+echo "${ECHO_T}$apu_found" >&6
+
+
 if test $apr_found = "no"; then
 	{ { echo "$as_me:$LINENO: error: no suitable apr found" >&5
 echo "$as_me: error: no suitable apr found" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+if test $apu_found = "no"; then
+	{ { echo "$as_me:$LINENO: error: no suitable aprutil found" >&5
+echo "$as_me: error: no suitable aprutil found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
 if test $? -ne 0; then
 	{ { echo "$as_me:$LINENO: error: apr-config --cppflags failed" >&5
@@ -19461,14 +19539,14 @@
    { (exit 1); exit 1; }; }
 fi
 
-LINK_LD="`$apr_config --link-ld --libs`"
+LINK_LD="$LINK_LD `$apr_config --link-ld --libs`"
 if test $? -ne 0; then
 	{ { echo "$as_me:$LINENO: error: apr-config --link-ld --libs failed" >&5
 echo "$as_me: error: apr-config --link-ld --libs failed" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-LINK_LIBTOOL="`$apr_config --link-libtool --libs`"
+LINK_LIBTOOL="$LINK_LIBTOOL `$apr_config --link-libtool --libs`"
 if test $? -ne 0; then
 	{ { echo "$as_me:$LINENO: error: apr-config --link-libtool --libs failed" >&5
 echo "$as_me: error: apr-config --link-libtool --libs failed" >&2;}
@@ -19476,9 +19554,39 @@
 fi
 
 
+CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
+if test $? -ne 0; then
+        { { echo "$as_me:$LINENO: error: apu-config --includes" >&5
+echo "$as_me: error: apu-config --includes" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
+if test $? -ne 0; then
+        { { echo "$as_me:$LINENO: error: apu-config --ldflags failed" >&5
+echo "$as_me: error: apu-config --ldflags failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-                                                                                          ac_config_files="$ac_config_files Rules.mk Makefile src/Makefile modules/Makefile modules/File/Makefile modules/Re/Makefile modules/Prosist/Makefile modules/SQLite/Makefile modules/OS/Makefile"
+LINK_LD="$LINK_LD `$apu_config --link-ld --libs`"
+if test $? -ne 0; then
+        { { echo "$as_me:$LINENO: error: apu-config --link-ld --libs failed" >&5
+echo "$as_me: error: apu-config --link-ld --libs failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+LINK_LIBTOOL="$LINK_LIBTOOL `$apu_config --link-libtool --libs`"
+if test $? -ne 0; then
+        { { echo "$as_me:$LINENO: error: apu-config --link-libtool --libs failed" >&5
+echo "$as_me: error: apu-config --link-libtool --libs failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+                                                                                                    ac_config_files="$ac_config_files Rules.mk Makefile src/Makefile modules/Makefile modules/File/Makefile modules/Re/Makefile modules/Prosist/Makefile modules/SQLite/Makefile modules/OS/Makefile modules/DBM/Makefile"
 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
@@ -20013,6 +20121,7 @@
   "modules/Prosist/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/Prosist/Makefile" ;;
   "modules/SQLite/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/SQLite/Makefile" ;;
   "modules/OS/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/OS/Makefile" ;;
+  "modules/DBM/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/DBM/Makefile" ;;
   "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/configure.in	2004-04-18 04:36:32 UTC (rev 385)
@@ -5,6 +5,7 @@
 
 dnl Grab some of our macros
 sinclude(ac-macros/find_apr.m4)
+sinclude(ac-macros/find_apu.m4)
 sinclude(ac-macros/libtool.m4)
 sinclude(ac-macros/pkg.m4)
 
@@ -41,11 +42,16 @@
 ])
 
 APR_FIND_APR("$srcdir/apr", "./apr", 1)
+APR_FIND_APU("$srcdir/apr-util", "./apr-util", 1)
 
 if test $apr_found = "no"; then
 	AC_MSG_ERROR([no suitable apr found])
 fi
 
+if test $apu_found = "no"; then
+	AC_MSG_ERROR([no suitable aprutil found])
+fi
+
 CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
 if test $? -ne 0; then
 	AC_MSG_ERROR([apr-config --cppflags failed])
@@ -66,20 +72,43 @@
 	AC_MSG_ERROR([apr-config --ldflags failed])
 fi
 
-LINK_LD="`$apr_config --link-ld --libs`"
+LINK_LD="$LINK_LD `$apr_config --link-ld --libs`"
 if test $? -ne 0; then
 	AC_MSG_ERROR([apr-config --link-ld --libs failed])
 fi
 
-LINK_LIBTOOL="`$apr_config --link-libtool --libs`"
+LINK_LIBTOOL="$LINK_LIBTOOL `$apr_config --link-libtool --libs`"
 if test $? -ne 0; then
 	AC_MSG_ERROR([apr-config --link-libtool --libs failed])
 fi
 
+dnl APU
+
+CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
+if test $? -ne 0; then
+        AC_MSG_ERROR([apu-config --includes])
+fi
+
+LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
+if test $? -ne 0; then
+        AC_MSG_ERROR([apu-config --ldflags failed])
+fi
+
+LINK_LD="$LINK_LD `$apu_config --link-ld --libs`"
+if test $? -ne 0; then
+        AC_MSG_ERROR([apu-config --link-ld --libs failed])
+fi
+
+LINK_LIBTOOL="$LINK_LIBTOOL `$apu_config --link-libtool --libs`"
+if test $? -ne 0; then
+        AC_MSG_ERROR([apu-config --link-libtool --libs failed])
+fi
+
+
 AC_SUBST(LINK_LD)
 AC_SUBST(LINK_LIBTOOL)
 
 AC_OUTPUT(Rules.mk Makefile src/Makefile modules/Makefile
 	  modules/File/Makefile modules/Re/Makefile
 	  modules/Prosist/Makefile modules/SQLite/Makefile
-	  modules/OS/Makefile)
+	  modules/OS/Makefile modules/DBM/Makefile)

Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/include/prothon/prothon.h	2004-04-18 04:36:32 UTC (rev 385)
@@ -60,8 +60,8 @@
 //#define DEBUG_THREADS
 //#define DEBUG_MEM_MGR
 //#define TRACE_PARSER
-#define DUMP_MODULE_CODE
-#define TRACE_INTERPRETER
+//#define DUMP_MODULE_CODE
+//#define TRACE_INTERPRETER
 //#define DUMP_OBJECTS_AT_END
 
 //*****************************************************************************
@@ -560,7 +560,7 @@
 #define NEW_FLOAT(num) new_float_obj(ist, num)
 
 // NEW_STRING_OBJ: Create a new string object from a C string.
-obj_p new_string_obj(isp ist, char* string);
+obj_p new_string_obj(isp ist, const char* string);
 #define NEW_STRING(string)  new_string_obj(ist, string)
 
 // NEW_STRING_OBJ_N: Create a new string object from a C string of N chars long.

Modified: trunk/include/prothon/prothon_dll.h
===================================================================
--- trunk/include/prothon/prothon_dll.h	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/include/prothon/prothon_dll.h	2004-04-18 04:36:32 UTC (rev 385)
@@ -89,7 +89,7 @@
 	obj_p		(*new_hash_obj)(isp ist, i32_t num);
 	obj_p		(*new_int_obj)(isp ist, i64_t num);
 	obj_p		(*new_float_obj)(isp ist, double num);
-	obj_p		(*new_string_obj)(isp ist, char* string);
+	obj_p		(*new_string_obj)(isp ist, const char* string);
 	obj_p		(*new_string_n_obj)(isp ist, char* string, size_t n);
 	obj_p		(*new_tuple_obj)(isp ist, int fixed_size);
 	obj_p		(*new_list_obj)(isp ist, size_t initial_size);

Copied: trunk/modules/DBM (from rev 383, trunk/modules/dbm)

Modified: trunk/modules/DBM/DBM.c
===================================================================
--- trunk/modules/dbm/DBM.c	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/modules/DBM/DBM.c	2004-04-18 04:36:32 UTC (rev 385)
@@ -115,7 +115,8 @@
 	apr_status_t aprerr;
 	apr_pool_t* pool;
 	obj_p res;
-	char *name, *type, *used1, *used2;
+	char *name, *type;
+	const char *used1, *used2;
 
 	STRING_PARAM(1, name);
 	STRING_PARAM(2, type);
Copied: trunk/modules/DBM/DBM.vcproj (from rev 383, trunk/modules/dbm/dbm.vcproj)

Added: trunk/modules/DBM/Makefile.in
===================================================================
--- trunk/modules/dbm/Makefile.in	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/modules/DBM/Makefile.in	2004-04-18 04:36:32 UTC (rev 385)
@@ -0,0 +1,28 @@
+# prothon
+#
+# Copyright (C) 2004 Mark Hahn <[email protected]>
+
+srcdir=@srcdir@
+top_builddir=@top_builddir@
+
+include $(top_builddir)/Rules.mk
+
+MODULE_NAME=DBM
+
+TARGET = $(MODULE_NAME).la
+
+OBJS = $(MODULE_NAME).lo
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+	$(LINK_MODULE) $(OBJS) -o $@
+
+install: $(TARGET)
+	$(LIB_INSTALL) $(TARGET) $(DESTDIR)$(PROTHON_DEFAULT_MODDIR)/
+
+distclean: clean
+	rm -f Makefile
+
+clean:
+	rm -fr *.o *.lo *.la .libs

Deleted: trunk/modules/DBM/dbm.vcproj
===================================================================
--- trunk/modules/dbm/dbm.vcproj	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/modules/DBM/dbm.vcproj	2004-04-18 04:36:32 UTC (rev 385)
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="7.10"
-	Name="dbm"
-	ProjectGUID="{9178A30F-B02E-4D57-9786-D417A42CD026}"
-	Keyword="Win32Proj">
-	<Platforms>
-		<Platform
-			Name="Win32"/>
-	</Platforms>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="Debug"
-			IntermediateDirectory="Debug"
-			ConfigurationType="2"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="c:\prothon\include;c:\prothon\apr\apr\include;c:\prothon\apr\apr-util\include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DBM_EXPORTS;APR_DECLARE_STATIC;APU_DECLARE_STATIC"
-				MinimalRebuild="TRUE"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				WarnAsError="TRUE"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="4"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="apr.lib aprutil.lib wsock32.lib"
-				OutputFile="$(OutDir)/dbm.dll"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories="C:\prothon\apr\apr\LibR;C:\prothon\apr\apr-util\LibR"
-				IgnoreDefaultLibraryNames="LIBCMTD.LIB"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/dbm.pdb"
-				SubSystem="2"
-				ImportLibrary="$(OutDir)/dbm.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
-			ConfigurationType="2"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="c:\prothon\include;c:\prothon\apr\apr\include;c:\prothon\apr\apr-util\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DBM_EXPORTS;APR_DECLARE_STATIC;APU_DECLARE_STATIC"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				WarnAsError="TRUE"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="apr.lib aprutil.lib wsock32.lib"
-				OutputFile="$(OutDir)/dbm.dll"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="C:\prothon\apr\apr\LibR;C:\prothon\apr\apr-util\LibR"
-				IgnoreDefaultLibraryNames="LIBCMTD.LIB"
-				GenerateDebugInformation="TRUE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/dbm.lib"
-				TargetMachine="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File
-				RelativePath=".\DBM.c">
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
Modified: trunk/modules/Makefile.in
===================================================================
--- trunk/modules/Makefile.in	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/modules/Makefile.in	2004-04-18 04:36:32 UTC (rev 385)
@@ -7,7 +7,7 @@
 
 include $(top_builddir)/Rules.mk
 
-MODULES = File Prosist OS
+MODULES = File Prosist OS DBM
 
 ifeq (@HAVE_BOOST_REGEX@,yes)
 MODULES += Re

Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/Makefile.in	2004-04-18 04:36:32 UTC (rev 385)
@@ -15,7 +15,7 @@
 
 OBJS = main.o $(BUILTIN_MOD_OBJS) object.o argproc.o clist.o lock.o \
 	memory_mgr.o parser.o prmalloc.o sys.o interp.o parser_routines.o \
-	symbol.o getline.o console.o
+	symbol.o getline.o console.o pr_snprintf.o
 
 all: $(TARGET)
 

Modified: trunk/src/builtins-string.c
===================================================================
--- trunk/src/builtins-string.c	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/builtins-string.c	2004-04-18 04:36:32 UTC (rev 385)
@@ -71,7 +71,7 @@
 //********************************* new_string_obj ****************************
 // this cannot be used with binary data, for C strings only
 // for binary data with embedded nulls use NEW_STRINGN()
-obj_p new_string_obj(isp ist, char* str){
+obj_p new_string_obj(isp ist, const char* str){
 	obj_p obj;
 	pr_str_p obj_str;
 	size_t len;
@@ -262,7 +262,7 @@
 			argv[i].arg.str = pr_strptr(arg_obj);
 			argv[i].type    = ARG_TYPE_STRING;
 		} else {
-			raise_exception(ist, OBJ(TYPE_EXC), "invalid type for string (%) format");
+			raise_exception(ist, OBJ(TYPE_EXC), "invalid type for string (%%) format");
 			return NULL;
 		}
 	}

Modified: trunk/src/parser_routines.c
===================================================================
--- trunk/src/parser_routines.c	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/parser_routines.c	2004-04-18 04:36:32 UTC (rev 385)
@@ -939,7 +939,6 @@
 // expr param is list comprehension expr
 code_p expr_for_lcc_to_listcomp(void* param, code_p expr, clist_p forlst, clist_p lcc) {
 	int k=0, len=1, stack_depth=1, max_stack_depth=1;
-	int llen = clist_len(forlst)-1;
 	code_p res;
 	clist_p loc_list = new_clist(9);
 

Modified: trunk/src/pr_snprintf.c
===================================================================
--- trunk/src/pr_snprintf.c	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/pr_snprintf.c	2004-04-18 04:36:32 UTC (rev 385)
@@ -483,84 +483,6 @@
 }
 
 
-
-static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len)
-{
-    unsigned addr = ntohl(ia->s_addr);
-    char *p = buf_end;
-    bool_int is_negative;
-    int sub_len;
-
-    p = conv_10((addr & 0x000000FF)      , TRUE, &is_negative, p, &sub_len);
-    *--p = '.';
-    p = conv_10((addr & 0x0000FF00) >>  8, TRUE, &is_negative, p, &sub_len);
-    *--p = '.';
-    p = conv_10((addr & 0x00FF0000) >> 16, TRUE, &is_negative, p, &sub_len);
-    *--p = '.';
-    p = conv_10((addr & 0xFF000000) >> 24, TRUE, &is_negative, p, &sub_len);
-
-    *len = (int)(buf_end - p);
-    return (p);
-}
-
-
-
-static char *conv_apr_sockaddr(apr_sockaddr_t *sa, char *buf_end, int *len)
-{
-    char *p = buf_end;
-    bool_int is_negative;
-    int sub_len;
-    char *ipaddr_str;
-
-    p = conv_10(sa->port, TRUE, &is_negative, p, &sub_len);
-    *--p = ':';
-    apr_sockaddr_ip_get(&ipaddr_str, sa);
-    sub_len = (int) strlen(ipaddr_str);
-#if APR_HAVE_IPV6
-    if (sa->family == APR_INET6 &&
-        !IN6_IS_ADDR_V4MAPPED(&sa->sa.sin6.sin6_addr)) {
-        *(p - 1) = ']';
-        p -= sub_len + 2;
-        *p = '[';
-        memcpy(p + 1, ipaddr_str, sub_len);
-    }
-    else
-#endif
-    {
-        p -= sub_len;
-        memcpy(p, ipaddr_str, sub_len);
-    }
-
-    *len = (int)(buf_end - p);
-    return (p);
-}
-
-
-
-#if APR_HAS_THREADS
-static char *conv_os_thread_t(apr_os_thread_t *tid, char *buf_end, int *len)
-{
-    union {
-        apr_os_thread_t tid;
-        apr_uint64_t alignme;
-    } u;
-    int is_negative;
-
-    u.tid = *tid;
-    switch(sizeof(u.tid)) {
-    case sizeof(apr_int32_t):
-        return conv_10(*(apr_uint32_t *)&u.tid, TRUE, &is_negative, buf_end, len);
-    case sizeof(apr_int64_t):
-        return conv_10_quad(*(apr_uint64_t *)&u.tid, TRUE, &is_negative, buf_end, len);
-    default:
-        /* not implemented; stick 0 in the buffer */
-        return conv_10(0, TRUE, &is_negative, buf_end, len);
-    }
-}
-#endif
-
-
-
 /*
  * Convert a floating point number to a string formats 'f', 'e' or 'E'.
  * The result is placed in buf, and len denotes the length of the string
@@ -654,61 +576,6 @@
 
 
 /*
- * Convert num to a base X number where X is a power of 2. nbits determines X.
- * For example, if nbits is 3, we do base 8 conversion
- * Return value:
- *      a pointer to a string containing the number
- *
- * The caller provides a buffer for the string: that is the buf_end argument
- * which is a pointer to the END of the buffer + 1 (i.e. if the buffer
- * is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
- *
- * As with conv_10, we have a faster version which is used when
- * the number isn't quad size.
- */
-static char *conv_p2(register u_wide_int num, register int nbits,
-                     char format, char *buf_end, register int *len)
-{
-    register int mask = (1 << nbits) - 1;
-    register char *p = buf_end;
-    static const char low_digits[] = "0123456789abcdef";
-    static const char upper_digits[] = "0123456789ABCDEF";
-    register const char *digits = (format == 'X') ? upper_digits : low_digits;
-
-    do {
-        *--p = digits[num & mask];
-        num >>= nbits;
-    }
-    while (num);
-
-    *len = (int)(buf_end - p);
-    return (p);
-}
-
-static char *conv_p2_quad(u_widest_int num, register int nbits,
-                     char format, char *buf_end, register int *len)
-{
-    register int mask = (1 << nbits) - 1;
-    register char *p = buf_end;
-    static const char low_digits[] = "0123456789abcdef";
-    static const char upper_digits[] = "0123456789ABCDEF";
-    register const char *digits = (format == 'X') ? upper_digits : low_digits;
-
-    if (num <= ULONG_MAX)
-        return(conv_p2((u_wide_int)num, nbits, format, buf_end, len));
-
-    do {
-        *--p = digits[num & mask];
-        num >>= nbits;
-    }
-    while (num);
-
-    *len = (int)(buf_end - p);
-    return (p);
-}
-
-
-/*
  * Do format conversion placing the output in buffer
  */
 APR_DECLARE(int) apr_pr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
Modified: trunk/src/pr_snprintf.h
===================================================================
--- trunk/src/pr_snprintf.h	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/pr_snprintf.h	2004-04-18 04:36:32 UTC (rev 385)
@@ -70,7 +70,7 @@
 } arg_type_t;
 
 typedef union {
-	__int64		i64;
+	apr_int64_t	i64;
 	double		f64;
 	char*		str;
 } arg_arg_t;
@@ -98,4 +98,4 @@
 
 APR_DECLARE(int) apr_pr_vsnprintf(char *buf, apr_size_t len, const char *format, pr_arg_p ap);
 
-#endif // #ifndef PR_ARG_H
\ No newline at end of file
+#endif // #ifndef PR_ARG_H
Modified: trunk/src/prothon.y
===================================================================
--- trunk/src/prothon.y	2004-04-18 04:15:48 UTC (rev 384)
+++ trunk/src/prothon.y	2004-04-18 04:36:32 UTC (rev 385)
@@ -195,25 +195,33 @@
 %nonassoc <str_type>	STRING			/*  python strs & \b[xX]['"][0-9a-fA-F]+['"]	*/
 %nonassoc <str_type>	LABEL			/*  \b\w+\b										*/
 
-%type <list_type>   import_path import_param import_params target target_params
-					function_params brace_params brace_params2 brace_param mul_except
-					ass_expr_list formal_params elif mul_elif list_params list_params2
-					for_refs for_refs1 for_refs2 arg_list arg_list2 tuple_params tuple_params2
-					for_lc_clause lc_clauses if_lc_clause
+%type <list_type>	import_path import_param import_params target
+			target_params function_params brace_params
+			brace_params2 brace_param mul_except ass_expr_list
+			formal_params elif mul_elif list_params
+			list_params2 for_refs for_refs1 for_refs2 arg_list
+			arg_list2 tuple_params tuple_params2 for_lc_clause
+			lc_clauses if_lc_clause
 
-%type <code_type> 	statement_block statement mul_statement mul_statements compound_statement
-					expr obj assignment_statement assignment_statement2 def_statement
-					import_statement small_statement if_statement while_statement
-					for_statement gen_ref try_except_statement except else_except
-					try_finally_statement def_ref print_statement assert_statement
-					target_param attr_ref unbound_ref ass_add_statement ass_sub_statement ass_mul_statement
-					ass_div_statement  ass_tdv_statement ass_rem_statement
-					ass_band_statement ass_bor_statement ass_bxor_statement
-					ass_shr_statement  ass_shl_statement ass_exp_statement
-					compound_body else slice slice_param formal_param is_not_check
-					function_param break_statement return_statement yield_statement with_statement
-					continue_statement del_statement del_tgt exec_statement raise_statement
-					if_statement for_statement list_comp
+%type <code_type>	statement_block statement mul_statement
+			mul_statements compound_statement expr obj
+			assignment_statement assignment_statement2
+			def_statement import_statement small_statement
+			if_statement while_statement for_statement gen_ref
+			try_except_statement except else_except
+			try_finally_statement def_ref print_statement
+			assert_statement target_param attr_ref unbound_ref
+			ass_add_statement ass_sub_statement
+			ass_mul_statement ass_div_statement
+			ass_tdv_statement ass_rem_statement
+			ass_band_statement ass_bor_statement
+			ass_bxor_statement ass_shr_statement
+			ass_shl_statement ass_exp_statement compound_body
+			else slice slice_param formal_param is_not_check
+			function_param break_statement return_statement
+			yield_statement with_statement continue_statement
+			del_statement del_tgt exec_statement
+			raise_statement list_comp