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 # Find PostgreSQL includes and libraries
45 AC_PATH_PROGS(PG_CONFIG, pqxx-config)
46 if test -z "$PG_CONFIG" || test ! -r "$PG_CONFIG"; then
47 AC_MSG_ERROR([libpqxx configuration script was not found])
49 with_postgres_include=`$PG_CONFIG --cflags`
50 AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include])
51 with_postgres_lib=`$PG_CONFIG --libs`
52 AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib])
54 AC_SUBST(with_postgres_lib)
55 AC_SUBST(with_postgres_include)
56 POSTGRES_LIB="${with_postgres_lib}"
57 AC_SUBST(POSTGRES_LIB)
58 POSTGRES_INCLUDE="${with_postgres_include}"
59 AC_SUBST(POSTGRES_INCLUDE)
62 # Checks for libraries.
63 AC_CHECK_LIB([pq], [PQexec], [], [AC_MSG_ERROR([Failed to find a suitable libpq.
65 PostgreSQL's libpq needs to be installed.
66 Perhaps you need to specify --with-postgres-lib?
67 ])], -L${with_postgres_lib})
70 CXXFLAGS="$CXXFLAGS $POSTGRES_INCLUDE"
71 LIBS="$LIBS $POSTGRES_LIB"
74 # There is no convenient way to detect libpqxx, so we'll
75 # use fixed paths for the time being.
77 CXXFLAGS="$CXXFLAGS -I/usr/local/pqxx/include"
78 LIBS="$LIBS -L/usr/local/pqxx/lib -lpqxx"
80 dnl Checks for header files.
83 AC_CHECK_HEADERS(unistd.h)
85 dnl Checks for typedefs, structures, and compiler characteristics.
88 dnl Checks for library functions.
89 AC_CHECK_FUNCS(strtod strtol strtoul)
91 dnl Edit this to be your web server's document root
93 DocumentRoot=/var/www/html
95 #AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile src/web/Makefile)
96 AC_OUTPUT(Makefile src/Makefile src/lib/Makefile src/gcm_input/Makefile)