X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=configure.in;h=cc36f33787a945b02dfb7e7122fcff7ba37a90f1;hb=19b622a4495a56bb6213a86319ec9c5025d239a3;hp=2047ae312222ecb4dab23c73ad80ad96b71423c1;hpb=d24903ef58eac9061cd57ec44f2929afef9edb43;p=gnucomo.git diff --git a/configure.in b/configure.in index 2047ae3..cc36f33 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.6) +AM_INIT_AUTOMAKE(GnuCoMo, 0.0.10) dnl Checks for programs. @@ -17,7 +17,7 @@ AC_PROG_AWK AC_PATH_PROG(XML_CONFIG,xml2-config,no) -if test $XML_CONFIG = "no" +if test $XML_CONFIG = "no" then echo "XML library not found (see http://xmlsoft.org/)." exit 1; @@ -30,17 +30,53 @@ 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" -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" +LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS" +LIBS="$LIBS -L/usr/local/lib $XML_LFLAGS" +CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS " +CXXFLAGS="$CXXFLAGS -Wno-deprecated $X_CFLAGS $XML_CFLAGS" -AC_CHECK_LIB(AXE, main) -AC_CHECK_LIB(X11, XOpenDisplay) -AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData) -AC_CHECK_LIB(pthread, pthread_create) +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) +# Find PostgreSQL includes and libraries +AC_PATH_PROGS(PG_CONFIG, pqxx-config) +if test -z "$PG_CONFIG" || test ! -r "$PG_CONFIG"; then + AC_MSG_ERROR([libpqxx configuration script was not found]) +fi +with_postgres_include=`$PG_CONFIG --cflags` +AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include]) +with_postgres_lib=`$PG_CONFIG --libs` +AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib]) + +AC_SUBST(with_postgres_lib) +AC_SUBST(with_postgres_include) +POSTGRES_LIB="${with_postgres_lib}" +AC_SUBST(POSTGRES_LIB) +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. + +PostgreSQL's libpq needs to be installed. +Perhaps you need to specify --with-postgres-lib? +])], -L${with_postgres_lib}) + + +CXXFLAGS="$CXXFLAGS $POSTGRES_INCLUDE" +LIBS="$LIBS $POSTGRES_LIB" + +# +# 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" +LIBS="$LIBS -L/usr/local/pqxx/lib -lpqxx" + dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC