Intergrated test scripts with automake
[gnucomo.git] / configure.in
index d1567df..f7ee27b 100644 (file)
@@ -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.9)
+AM_INIT_AUTOMAKE(GnuCoMo, 0.0.10)
 
 
 dnl Checks for programs.
@@ -41,81 +41,20 @@ AC_CHECK_LIB(AXE, main, , AC_MSG_ERROR(AXE Library is not installed))
 #AC_CHECK_LIB(pthread, pthread_create)
 AC_CHECK_LIB(xml2, xmlParseFile)
 
-# Where are the postgres includes...
-postgres_include_default=
-for usual_suspect in \
-       /usr/local/include/postgresql \
-       /usr/local/include/pgsql \
-       /usr/local/pgsql/include \
-       /usr/local/include \
-       /usr/include/postgresql \
-       /usr/include/pgsql \
-       /usr/include \
-       /opt/postgresql/include \
-       /opt/pgsql/include \
-       /usr/freeware/include \
-; do
-AC_CHECK_FILE([$usual_suspect/libpq-fe.h],
-       [postgres_include_default=$usual_suspect],
-)
-       if test -n "$postgres_include_default" ; then
-               break
-       fi
-done
-
-AC_ARG_WITH(postgres-include,
-       --with-postgres-include  PostgreSQL headers directory
-       
-       ,       test "$withval" = no || with_postgres_include=$withval
-       , with_postgres_include=$postgres_include_default
-)
-
-# ..and libraries?
-postgres_lib_default=
-for usual_suspect in \
-       /usr/local/lib/postgresql \
-       /usr/local/lib/pgsql \
-       /usr/local/pgsql/lib \
-       /usr/local/lib \
-       /usr/lib/postgresql \
-       /usr/lib/pgsql \
-       /usr/lib \
-       /opt/postgresql/lib \
-       /opt/pgsql/lib \
-       /usr/freeware/lib32 \
-; do
-       for library_extension in so a sa ; do
-AC_CHECK_FILE([$usual_suspect/libpq.$library_extension],
-       [postgres_lib_default=$usual_suspect],
-)
-       done
-       if test -n "$postgres_lib_default" ; then
-               break
-       fi
-done
-
-AC_ARG_WITH(postgres-lib,
-       --with-postgres-lib      PostgreSQL library directory containing libpq
-       ,       test "$withval" = no || with_postgres_lib=$withval
-       , with_postgres_lib=$postgres_lib_default
-)
-
-# provide one way to specify both include and lib
-AC_ARG_WITH(postgres,
-       --with-postgres  PostgreSQL common directory. Use this to specify libs & includes rooted at one place
-       ,       test "$withval" = no || with_postgres=$withval
-               with_postgres_lib=${with_postgres}/lib
-               with_postgres_include=${with_postgres}/include
-       , with_postgres=no
-)
+# PostgreSQL includes and libraries
+with_postgres_include="-I/usr/include/pqxx"
+AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include])
+with_postgres_lib="-lpqxx -lpq"
+AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib])
 
 AC_SUBST(with_postgres_lib)
 AC_SUBST(with_postgres_include)
-POSTGRES_LIB="-L${with_postgres_lib} -R${with_postgres_lib} -lpq"
+POSTGRES_LIB="${with_postgres_lib}"
 AC_SUBST(POSTGRES_LIB)
-POSTGRES_INCLUDE="-I${with_postgres_include}"
+POSTGRES_INCLUDE="${with_postgres_include}"
 AC_SUBST(POSTGRES_INCLUDE)
 
+
 # Checks for libraries.
 AC_CHECK_LIB([pq], [PQexec], [], [AC_MSG_ERROR([Failed to find a suitable libpq.
 
@@ -123,18 +62,6 @@ PostgreSQL's libpq needs to be installed.
 Perhaps you need to specify --with-postgres-lib?
 ])], -L${with_postgres_lib})
 
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADER([${with_postgres_include}/libpq-fe.h],,AC_MSG_ERROR(
-[Can't find libpq-fe.h in ${with_postgres_include}.
-Please specify the location of the PostgreSQL include files with
---with-postgres-include=... or --with-postgres=...]
-))
-
-AC_CHECK_HEADER([${with_postgres_include}/libpq/libpq-fs.h],,AC_MSG_ERROR(
-[Can't find libpq-fs.h in ${with_postgres_include}/libpq.
-Please locate it and report your findings so this script can be corrected.]
-))
 
 CXXFLAGS="$CXXFLAGS $POSTGRES_INCLUDE"
 LIBS="$LIBS $POSTGRES_LIB"
@@ -162,4 +89,4 @@ dnl Edit this to be your web server's document root
 DocumentRoot=/var/www/html
 
 #AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile src/web/Makefile)
-AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile test/Makefile)