diff options
| author | Pavel Raiskup <praiskup@redhat.com> | 2015-03-04 16:21:52 +0100 |
|---|---|---|
| committer | Pavel Raiskup <praiskup@redhat.com> | 2015-03-04 16:38:57 +0100 |
| commit | 610bb619cc5e00860c6846fa36a03609aaea3595 (patch) | |
| tree | eece7bb2555e3a6dafd6494bc8b928a7b5295617 /configure.ac | |
| parent | 834c0e34d7828f96550c7a7bbb94f3dcaacd2029 (diff) | |
| download | postgresql-setup-610bb619cc5e00860c6846fa36a03609aaea3595.tar.gz postgresql-setup-610bb619cc5e00860c6846fa36a03609aaea3595.tar.xz postgresql-setup-610bb619cc5e00860c6846fa36a03609aaea3595.zip | |
configury: detect systemd/sysvinit systems
Fix the AC_ARG_WITH misuse. If WANT_SYSVINIT is unset, guess
correct value.
Don't treat intermediate files as those to be checked for correct
syntax errors (or unexpanded @variables@).
* Makefile.am: Move readme_* intermediate files into separate
variable.
* configure.ac: If WANT_SYSVINIT is empty (no explicit request),
try to detect systemd's presence by checking for systemctl
command. Print out after AC_OUTPUT information what init system
will be used.
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index c8c67c5..51f20d3 100644 --- a/configure.ac +++ b/configure.ac @@ -20,11 +20,21 @@ AC_SUBST([TEST_GEN_FILES_LIST], [.generated_files]) AC_ARG_WITH([sysvinit], AS_HELP_STRING([--with-sysvinit], [prepares sys v init script]), - [WANT_SYSVINIT=1], - [WANT_SYSVINIT=0] + [WANT_SYSVINIT=0 + test x"$withval" = xyes && WANT_SYSVINIT=1] ) -test -z "$WANT_SYSVINIT" && WANT_SYSVINIT=0 +if test x = x"$WANT_SYSVINIT" +then + WANT_SYSVINIT=0 + # Try to detect system running systemd + AC_PATH_PROG([SYSTEMCTL], [systemctl]) + test -z "$ac_cv_path_SYSTEMCTL" && WANT_SYSVINIT=1 +fi + +INIT_SYSTEM=systemd +test x"$WANT_SYSVINIT" = x1 && INIT_SYSTEM=sysvinit + AM_CONDITIONAL([WANT_SYSVINIT], [test "$WANT_SYSVINIT" -eq 1]) AC_SUBST([WANT_SYSVINIT]) @@ -212,4 +222,5 @@ AC_MSG_NOTICE([Configured the folowing way: PostgreSQL service: $NAME_SERVICE PostgreSQL package: $NAME_PACKAGE PostgreSQL bin_pfx: $NAME_BINARYBASE + Init system: $INIT_SYSTEM ]) |
