9a7348ca02f1f356e9c2a005bdacde56de7e8215
[FAPG] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.61)
3 AC_INIT(fapg.c)
4 AM_INIT_AUTOMAKE(fapg, 0.41)
5
6 AC_PROG_INSTALL
7 AC_PROG_CC
8 AC_HEADER_STDC
9
10
11 # XSPF
12 AC_ARG_ENABLE(xspf, [
13 Extra options:
14   --enable-xspf           enable XSPF support (default)
15   --disable-xspf          disable XSPF support], [
16         FAPG_XSPF=$enableval
17 ], [
18         FAPG_XSPF=1
19 ])
20
21 if test "${FAPG_XSPF}" = "1"; then
22         AC_MSG_NOTICE(XSPF support enabled (configure with --disable-xspf to disable))
23 else
24         AC_MSG_NOTICE(XSPF support disabled)
25 fi
26
27
28 # uriparser
29 AC_ARG_WITH(uriparser, [  --with-uriparser=DIR    override path of uriparser
30                           ("/lib" and "/include" is appended)], [
31         if test "x${withval}" = "x"; then
32                 AC_MSG_ERROR([No path given for option --with-uriparser])
33         fi
34         LDFLAGS="-L${withval}/lib ${LDFLAGS}"
35         CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
36 ], [])
37
38 AC_ARG_WITH(uriparser-inc, [  --with-uriparser-inc=D  override include path of uriparser], [
39         if test "x${withval}" = "x"; then
40                 AC_MSG_ERROR([No path given for option --with-uriparser-inc])
41         fi
42         CPPFLAGS="-I${withval} ${CPPFLAGS}"
43 ], [])
44
45 AC_ARG_WITH(uriparser-lib, [  --with-uriparser-lib=D  override library path of uriparser], [
46         if test "x${withval}" = "x"; then
47                 AC_MSG_ERROR([No path given for option --with-uriparser-lib])
48         fi
49         LDFLAGS="-L${withval} ${LDFLAGS}"
50 ], [])
51
52
53 # checks
54 if test "${FAPG_XSPF}" = "1"; then
55         URIPARSER_MISSING="Please install uriparser 0.6.3 or later.
56    On a Debian-based system enter 'sudo apt-get install liburiparser-dev'."
57         AC_CHECK_LIB(uriparser, uriParseUriA,, AC_MSG_ERROR(${URIPARSER_MISSING}))
58         AC_CHECK_HEADER(uriparser/Uri.h,, AC_MSG_ERROR(${URIPARSER_MISSING}))
59
60         URIPARSER_TOO_OLD="uriparser 0.6.3 or later is required, your copy is too old."
61         AC_COMPILE_IFELSE([
62 #include <uriparser/Uri.h>
63 #if (defined(URI_VER_MAJOR) && defined(URI_VER_MINOR) && defined(URI_VER_RELEASE) \
64 && ((URI_VER_MAJOR > 0) \
65 || ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 6)) \
66 || ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 6) && (URI_VER_RELEASE >= 3)) \
67 ))
68 /* FINE */
69 #else
70 # error uriparser not recent enough
71 #endif
72         ],,AC_MSG_ERROR(${URIPARSER_TOO_OLD}))
73 fi
74
75
76 AC_OUTPUT(Makefile)
77