Git

diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..edf19be
--- /dev/null
@@ -0,0 +1,77 @@
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.61)
+AC_INIT(fapg.c)
+AM_INIT_AUTOMAKE(fapg, 0.39)
+
+AC_PROG_INSTALL
+AC_PROG_CC
+AC_HEADER_STDC
+
+
+# XSPF
+AC_ARG_ENABLE(xspf, [
+Extra options:
+  --enable-xspf           enable XSPF support (default)
+  --disable-xspf          disable XSPF support], [
+       FAPG_XSPF=$enableval
+], [
+       FAPG_XSPF=1
+])
+
+if test "${FAPG_XSPF}" = "1"; then
+       AC_MSG_NOTICE(XSPF support enabled (configure with --disable-xspf to disable))
+else
+       AC_MSG_NOTICE(XSPF support disabled)
+fi
+
+
+# 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}"
+], [])
+
+
+# checks
+if test "${FAPG_XSPF}" = "1"; then
+       URIPARSER_MISSING="Please install uriparser 0.6.3 or later.
+   On a Debian-based system enter 'sudo apt-get install liburiparser-dev'."
+       AC_CHECK_LIB(uriparser, uriParseUriA,, AC_MSG_ERROR(${URIPARSER_MISSING}))
+       AC_CHECK_HEADER(uriparser/Uri.h,, AC_MSG_ERROR(${URIPARSER_MISSING}))
+
+       URIPARSER_TOO_OLD="uriparser 0.6.3 or later is required, your copy is too old."
+       AC_COMPILE_IFELSE([
+#include <uriparser/Uri.h>
+#if (defined(URI_VER_MAJOR) && defined(URI_VER_MINOR) && defined(URI_VER_RELEASE) \
+&& ((URI_VER_MAJOR > 0) \
+|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 6)) \
+|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 6) && (URI_VER_RELEASE >= 3)) \
+))
+/* FINE */
+#else
+# error uriparser not recent enough
+#endif
+       ],,AC_MSG_ERROR(${URIPARSER_TOO_OLD}))
+fi
+
+
+AC_OUTPUT(Makefile)
+