Skip to content

Commit

Permalink
fix regression when no systemd is present on linux
Browse files Browse the repository at this point in the history
on Scientific Linux release 6.10 (Carbon), a RHEL clone maintained at CERN
I have noticed that configure fails with the following error:

checking for LIBSYSTEMD... ./configure: line 4877: syntax error near unexpected token `else'
./configure: line 4877: `else'

if libsystemd is not found. The empty square bracket in configure.ac:
  PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd], [AC_DEFINE(HAVE_SYSTEMD)], [ ])
suppresses a human readable configure error but produces invalid shell code.
Printing out a message that we haven't found libsystemd solves the problem.
  • Loading branch information
mrbaseman committed Oct 26, 2018
1 parent e66e1d3 commit 06d3241
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
PKG_CHECK_MODULES(OPENSSL, [libcrypto >= 0.9.8 libssl >= 0.9.8], [], [AC_MSG_ERROR([Cannot find OpenSSL 0.9.8 or higher.])])
AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([Cannot find libpthread.])])
AC_CHECK_LIB([util], [forkpty], [], [AC_MSG_ERROR([Cannot find libutil.])])
PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd], [AC_DEFINE(HAVE_SYSTEMD)], [ ])
PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd], [AC_DEFINE(HAVE_SYSTEMD)], [AC_MSG_RESULT([libsystemd not present])])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h errno.h fcntl.h getopt.h ifaddrs.h limits.h netdb.h net/if.h netinet/in.h netinet/tcp.h pthread.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/ioctl.h syslog.h sys/socket.h sys/stat.h sys/types.h sys/wait.h termios.h unistd.h], [], AC_MSG_ERROR([Required header not found]))
Expand Down

0 comments on commit 06d3241

Please sign in to comment.