From: arjen Date: Sun, 17 Aug 2003 18:49:10 +0000 (+0000) Subject: Changed the gnucomo_database class to the new PostgreSQL X-Git-Tag: V0_0_8~19 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=90c1513c3549903aca8860c1eea70e3208f99497 Changed the gnucomo_database class to the new PostgreSQL library, libpqxx. --- diff --git a/configure b/configure index a8d1b7a..b9cfae1 100755 --- a/configure +++ b/configure @@ -691,9 +691,9 @@ else fi -PACKAGE=GNUCOMO +PACKAGE=GnuCoMo -VERSION=0.0.7 +VERSION=0.0.8 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1671,7 +1671,7 @@ else fi -if test $XML_CONFIG = "no" +if test $XML_CONFIG = "no" then echo "XML library not found (see http://xmlsoft.org/)." exit 1; @@ -2516,169 +2516,66 @@ fi XML_CFLAGS=`$XML_CONFIG --cflags` XML_LFLAGS=`$XML_CONFIG --libs` -LIBS="$LIBS -lAXE -lpq++ $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" +LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" LDFLAGS="$LDFLAGS -L/usr/local/lib $XML_LFLAGS" -CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS -I/usr/include/postgresql" -CXXFLAGS="$CXXFLAGS $X_CFLAGS $XML_CFLAGS -I/usr/include/postgresql" +CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS " +CXXFLAGS="$CXXFLAGS $X_CFLAGS $XML_CFLAGS" -echo $ac_n "checking for main in -lAXE""... $ac_c" 1>&6 -echo "configure:2526: checking for main in -lAXE" >&5 -ac_lib_var=`echo AXE'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo $ac_n "checking for -lpqxx""... $ac_c" 1>&6 +echo "configure:2526: checking for -lpqxx" >&5 +if eval "test \"`echo '$''{'ac_cv_lib_pqxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lAXE $LIBS" +LIBS="-lpqxx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo AXE | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - -echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:2569: checking for XOpenDisplay in -lX11" >&5 -ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lX11 $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2540: \"$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" + ac_cv_lib_pqxx=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + ac_cv_lib_pqxx=no fi rm -f conftest* LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo X11 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - -echo $ac_n "checking for XpmCreatePixmapFromData in -lXpm""... $ac_c" 1>&6 -echo "configure:2616: checking for XpmCreatePixmapFromData in -lXpm" >&5 -ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromData | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lXpm $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo Xpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 +if test "$ac_cv_lib_pqxx" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LIBPQXX 1 EOF - LIBS="-lXpm $LIBS" + LIBS="-lpqxx $LIBS" -else - echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2663: checking for pthread_create in -lpthread" >&5 -ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +echo $ac_n "checking for main in -lAXE""... $ac_c" 1>&6 +echo "configure:2564: checking for main in -lAXE" >&5 +ac_lib_var=`echo AXE'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lpthread $LIBS" +LIBS="-lAXE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2579: \"$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 @@ -2693,20 +2590,24 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo AXE | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 +{ echo "configure: error: AXE Library is not installed" 1>&2; exit 1; } fi +#AC_CHECK_LIB(X11, XOpenDisplay) +#AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData) +#AC_CHECK_LIB(pthread, pthread_create) echo $ac_n "checking for xmlParseFile in -lxml2""... $ac_c" 1>&6 -echo "configure:2710: checking for xmlParseFile in -lxml2" >&5 +echo "configure:2611: checking for xmlParseFile in -lxml2" >&5 ac_lib_var=`echo xml2'_'xmlParseFile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2714,7 +2615,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxml2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2630: \"$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 @@ -2753,17 +2654,25 @@ else fi + +# +# There is no convenient way to detect libpqxx, so we'll +# use fixed paths for the time being. + +CXXFLAGS="$CXXFLAGS -I/usr/local/pqxx/include" +LDFLAGS="$LDFLAGS -L/usr/local/pqxx/lib -lpqxx" + ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:2762: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2671: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -2771,7 +2680,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2796,7 +2705,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2800: checking for opendir in -ldir" >&5 +echo "configure:2709: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2804,7 +2713,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2728: \"$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 @@ -2837,7 +2746,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2841: checking for opendir in -lx" >&5 +echo "configure:2750: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2845,7 +2754,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2769: \"$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 @@ -2879,12 +2788,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2883: checking for ANSI C header files" >&5 +echo "configure:2792: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2892,7 +2801,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2805: \"$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* @@ -2909,7 +2818,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2927,7 +2836,7 @@ 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 < EOF @@ -2948,7 +2857,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2959,7 +2868,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2986,17 +2895,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2990: checking for $ac_hdr" >&5 +echo "configure:2899: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2909: \"$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* @@ -3024,12 +2933,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3028: checking for working const" >&5 +echo "configure:2937: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3102,12 +3011,12 @@ fi for ac_func in strtod strtol strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3106: checking for $ac_func" >&5 +echo "configure:3015: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/configure.in b/configure.in index b781f6d..a1b23b8 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/gcm_input/message.h) -AM_INIT_AUTOMAKE(GNUCOMO, 0.0.7) +AM_INIT_AUTOMAKE(GnuCoMo, 0.0.8) dnl Checks for programs. @@ -30,17 +30,26 @@ AC_PATH_XTRA XML_CFLAGS=`$XML_CONFIG --cflags` XML_LFLAGS=`$XML_CONFIG --libs` -LIBS="$LIBS -lAXE -lpq++ $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" +LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" LDFLAGS="$LDFLAGS -L/usr/local/lib $XML_LFLAGS" -CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS -I/usr/include/postgresql" -CXXFLAGS="$CXXFLAGS $X_CFLAGS $XML_CFLAGS -I/usr/include/postgresql" - -AC_CHECK_LIB(AXE, main) -AC_CHECK_LIB(X11, XOpenDisplay) -AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData) -AC_CHECK_LIB(pthread, pthread_create) +CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS " +CXXFLAGS="$CXXFLAGS $X_CFLAGS $XML_CFLAGS" + +AC_HAVE_LIBRARY(pqxx) +AC_CHECK_LIB(AXE, main, , AC_MSG_ERROR(AXE Library is not installed)) +#AC_CHECK_LIB(X11, XOpenDisplay) +#AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData) +#AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_LIB(xml2, xmlParseFile) + +# +# There is no convenient way to detect libpqxx, so we'll +# use fixed paths for the time being. + +CXXFLAGS="$CXXFLAGS -I/usr/local/pqxx/include" +LDFLAGS="$LDFLAGS -L/usr/local/pqxx/lib -lpqxx" + dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC