2acd795b30cf48dc9c3f5aa5320df3833d38cd30
[ipfire.org.git] / configure.ac
1 AC_PREREQ([2.64])
2
3 AC_INIT([ipfire.org],
4         [000],
5         [michael.tremer@ipfire.org],
6         [ipfire.org],
7         [https://www.ipfire.org/])
8
9 AC_CONFIG_AUX_DIR([build-aux])
10
11 AC_PREFIX_DEFAULT([/usr])
12
13 AM_INIT_AUTOMAKE([
14         foreign
15         1.11
16         -Wall
17         -Wno-portability
18         silent-rules
19         tar-pax
20         subdir-objects
21 ])
22 AM_SILENT_RULES([yes])
23
24 AC_PROG_LN_S
25 AC_PROG_MKDIR_P
26 AC_PROG_SED
27
28 # Python
29 AM_PATH_PYTHON([3.5])
30
31 # scss
32 AC_CHECK_PROG(SASSC, [sassc], [sassc])
33
34 # ------------------------------------------------------------------------------
35
36 AC_ARG_WITH([systemd],
37         AS_HELP_STRING([--with-systemd], [Enable systemd support.])
38 )
39
40 AS_IF([test "x$with_systemd" != "xno"],
41       [PKG_CHECK_MODULES(systemd, [libsystemd],
42       [have_systemd=yes], [have_systemd=no])],
43       [have_systemd=no]
44 )
45
46 AS_IF([test "x$have_systemd" = "xyes"],
47       [AC_MSG_CHECKING([for systemd system unit directory])
48         AC_ARG_WITH([systemdsystemunitdir],
49                 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
50                 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
51         )
52
53         AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
54
55         if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
56                 AC_MSG_RESULT([$systemdsystemunitdir])
57         else
58                 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
59         fi
60       ],
61       [AS_IF([test "x$with_systemd" = "xyes"],
62              [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
63       ])
64 ])
65
66 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
67
68 datadir="${datadir}/ipfire.org"
69 localedir="${datadir}/translations"
70
71 AC_CONFIG_FILES([
72         Makefile
73 ])
74
75 AC_OUTPUT
76 AC_MSG_RESULT([
77         ${PACKAGE_NAME} ${VERSION}
78
79         prefix:                 ${prefix}
80         sysconfdir:             ${sysconfdir}
81         datadir:                ${datadir}
82         localedir:              ${localedir}
83
84         systemd support         ${have_systemd}
85         Python version:         ${PYTHON_VERSION}
86 ])