# Process this file with autoconf to produce a configure script. AC_INIT(src/SpiffReader.cpp) AM_INIT_AUTOMAKE(libspiff, 0.8.0) AM_CONFIG_HEADER(test/CppTest/config.h) AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_CC AC_PROG_CXX AC_HEADER_STDC # These are for and from CppTest AC_CHECK_HEADERS(sys/time.h) AC_CHECK_FUNCS([gettimeofday]) AC_MSG_CHECKING(for round) AC_TRY_COMPILE( [ #include ], [ double d = round(1.0); ], [ round=yes ],[ round=no ]) AC_MSG_RESULT($round) if test "$round" = "yes"; then AC_DEFINE([HAVE_ROUND],,[Defined if the function exists]) fi # Expat AC_ARG_WITH(expat, [ Dependency locations: --with-expat=DIR override path of Expat ("/lib" and "/include" is appended)], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-expat]) fi LDFLAGS="-L${withval}/lib ${LDFLAGS}" CPPFLAGS="-I${withval}/include ${CPPFLAGS}" ], []) AC_ARG_WITH(expat-inc, [ --with-expat-inc=DIR override include path of Expat], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-expat-inc]) fi CPPFLAGS="-I${withval} ${CPPFLAGS}" ], []) AC_ARG_WITH(expat-lib, [ --with-expat-lib=DIR override library path of Expat], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-expat-lib]) fi LDFLAGS="-L${withval} ${LDFLAGS}" ], []) # uriparser AC_ARG_WITH(uriparser, [ --with-uriparser=DIR override path of uriparser ("/lib" and "/include" is appended)], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-uriparser]) fi LDFLAGS="-L${withval}/lib ${LDFLAGS}" CPPFLAGS="-I${withval}/include ${CPPFLAGS}" ], []) AC_ARG_WITH(uriparser-inc, [ --with-uriparser-inc=D override include path of uriparser], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-uriparser-inc]) fi CPPFLAGS="-I${withval} ${CPPFLAGS}" ], []) AC_ARG_WITH(uriparser-lib, [ --with-uriparser-lib=D override library path of uriparser], [ if test "x${withval}" = "x"; then AC_MSG_ERROR([No path given for option --with-uriparser-lib]) fi LDFLAGS="-L${withval} ${LDFLAGS}" ], []) # Local headers must come very first. Otherwise we # risk including headers of an already installed # libSpiff version if its path is in CPPFLAGS CPPFLAGS="-Iinclude ${CPPFLAGS}" # Append $prefix as a fallback at the very end if test "x${prefix}" != "xNONE"; then WORKING_PREFIX=${prefix} else WORKING_PREFIX=${ac_default_prefix} fi LDFLAGS="${LDFLAGS} -L${WORKING_PREFIX}/lib" CPPFLAGS="${CPPFLAGS} -I${WORKING_PREFIX}/include" # Check presence EXPAT_MISSING="Please install libexpat 1.95.8 or later. On Ubuntu enter 'sudo apt-get install libexpat-dev'." AC_CHECK_LIB(expat, XML_ResumeParser,, AC_MSG_ERROR(${EXPAT_MISSING})) AC_CHECK_HEADER(expat.h,, AC_MSG_ERROR(${EXPAT_MISSING})) URIPARSER_MISSING="Please install uriparser 0.3.0 or later." AC_CHECK_LIB(uriparser, uriParseUriA,, AC_MSG_ERROR(${URIPARSER_MISSING})) AC_CHECK_HEADER(uriparser/Uri.h,, AC_MSG_ERROR(${URIPARSER_MISSING})) AC_OUTPUT(Makefile)