]> git.ipfire.org Git - location/libloc.git/blobdiff - configure.ac
importer: Fix Python syntax error
[location/libloc.git] / configure.ac
index c469cbc34bef3a159bd667d68a8096e4f4c0a3d4..faf896b7d242d4e281e2620722701d6e1025b60f 100644 (file)
@@ -1,6 +1,6 @@
 AC_PREREQ(2.60)
 AC_INIT([libloc],
-        [0.9.14],
+        [0.9.17],
         [location@lists.ipfire.org],
         [libloc],
         [https://location.ipfire.org/])
@@ -55,6 +55,41 @@ AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
 if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then
        AC_MSG_ERROR([Required program 'asciidoc' not found])
 fi
+
+# - pkg-config -----------------------------------------------------------------
+
+m4_ifndef([PKG_PROG_PKG_CONFIG],
+       [m4_fatal([Could not locate the pkg-config autoconf
+               macros. These are usually located in /usr/share/aclocal/pkg.m4.
+               If your macros are in a different location, try setting the
+               environment variable AL_OPTS="-I/other/macro/dir" before running
+               ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])])
+
+PKG_PROG_PKG_CONFIG
+PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig'])
+
+# - bash-completion ------------------------------------------------------------
+
+#enable_bash_completion=yes
+AC_ARG_WITH([bashcompletiondir],
+       AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+       [],
+       [AS_IF([`$PKG_CONFIG --exists bash-completion`], [
+               with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion`
+       ], [
+               with_bashcompletiondir=${datadir}/bash-completion/completions
+       ])
+])
+
+AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
+
+AC_ARG_ENABLE([bash-completion],
+       AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]),
+       [], [enable_bash_completion=yes]
+)
+
+AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
+
 # - debug ----------------------------------------------------------------------
 
 AC_ARG_ENABLE([debug],
@@ -122,7 +157,7 @@ CC_CHECK_FLAGS_APPEND([my_LDFLAGS], [LDFLAGS], [-fno-semantic-interposition])
 
 AC_ARG_WITH([database-path],
        AS_HELP_STRING([--with-database-path], [The default database path]),
-       [], [with_database_path=/var/lib/${PACKAGE_NAME}/database.db]
+       [], [with_database_path=/var/lib/location/database.db]
 )
 
 if test -z "${with_database_path}"; then
@@ -175,10 +210,18 @@ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
 AC_PATH_PROG(PERL, perl, no)
 AC_SUBST(PERL)
 
-AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
+AX_PROG_PERL_MODULES(Config ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
 
 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
+AS_IF([test "$enable_perl" = "yes"],
+      [
+       PERL_MODPATH=$($PERL -MConfig -e 'print $Config{installvendorarch}')
+       PERL_MANPATH=$($PERL -MConfig -e 'print $Config{installvendorman3dir}')
+       AC_SUBST(PERL_MODPATH)
+       AC_SUBST(PERL_MANPATH)
+       ],
+)
 
 dnl Checking for libresolv
 case "${host}" in
@@ -221,7 +264,10 @@ AC_MSG_RESULT([
         database path:          ${with_database_path}
         debug:                  ${enable_debug}
         systemd support:        ${have_systemd}
+       bash-completion:        ${enable_bash_completion}
 
        Bindings:
-         perl:                 ${enable_perl}
+         Perl:                 ${enable_perl}
+         Perl module path:     ${PERL_MODPATH}
+         Perl manual path:     ${PERL_MANPATH}
 ])