2 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(src/gcm_input/message.h)
4 AM_INIT_AUTOMAKE(GnuCoMo, 0.0.10)
7 dnl Checks for programs.
18 AC_PATH_PROG(XML_CONFIG,xml2-config,no)
20 if test $XML_CONFIG = "no"
22 echo "XML library not found (see http://xmlsoft.org/)."
27 dnl Checks for libraries.
30 XML_CFLAGS=`$XML_CONFIG --cflags`
31 XML_LFLAGS=`$XML_CONFIG --libs`
33 LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
34 LIBS="$LIBS -L/usr/local/lib $XML_LFLAGS"
35 CFLAGS="$CFLAGS $X_CFLAGS $XML_CFLAGS "
36 CXXFLAGS="$CXXFLAGS -Wno-deprecated $X_CFLAGS $XML_CFLAGS"
38 AC_CHECK_LIB(AXE, main, , AC_MSG_ERROR(AXE Library is not installed))
39 #AC_CHECK_LIB(X11, XOpenDisplay)
40 #AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData)
41 #AC_CHECK_LIB(pthread, pthread_create)
42 AC_CHECK_LIB(xml2, xmlParseFile)
44 # PostgreSQL includes and libraries
45 with_postgres_include="-I/usr/include/pqxx"
46 AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include])
47 with_postgres_lib="-lpqxx -lpq"
48 AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib])
50 AC_SUBST(with_postgres_lib)
51 AC_SUBST(with_postgres_include)
52 POSTGRES_LIB="${with_postgres_lib}"
53 AC_SUBST(POSTGRES_LIB)
54 POSTGRES_INCLUDE="${with_postgres_include}"
55 AC_SUBST(POSTGRES_INCLUDE)
58 # Checks for libraries.
59 AC_CHECK_LIB([pq], [PQexec], [], [AC_MSG_ERROR([Failed to find a suitable libpq.
61 PostgreSQL's libpq needs to be installed.
62 Perhaps you need to specify --with-postgres-lib?
63 ])], -L${with_postgres_lib})
66 CXXFLAGS="$CXXFLAGS $POSTGRES_INCLUDE"
67 LIBS="$LIBS $POSTGRES_LIB"
70 # There is no convenient way to detect libpqxx, so we'll
71 # use fixed paths for the time being.
73 CXXFLAGS="$CXXFLAGS -I/usr/local/pqxx/include"
74 LIBS="$LIBS -L/usr/local/pqxx/lib -lpqxx"
76 dnl Checks for header files.
79 AC_CHECK_HEADERS(unistd.h)
81 dnl Checks for typedefs, structures, and compiler characteristics.
84 dnl Checks for library functions.
85 AC_CHECK_FUNCS(strtod strtol strtoul)
87 dnl Edit this to be your web server's document root
89 DocumentRoot=/var/www/html
91 #AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile src/web/Makefile)
92 AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile test/Makefile)