From ca2637e4ddd64a85d7e0300b27b3765906265d7f Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Wed, 8 Aug 2018 17:19:34 -0400 Subject: Fix stuff. --- configure.ac | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 386fa5e..a624294 100644 --- a/configure.ac +++ b/configure.ac @@ -3,22 +3,38 @@ AC_LANG(C) AC_CONFIG_HEADERS(config.h) AC_PROG_CC +AC_PROG_CC_C99 +AS_IF([test "$ac_cv_prog_cc_c99" = no], + [AC_MSG_ERROR([a C99 compatible compiler is required])]) + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L" -CFLAGS="$CFLAGS -std=c99" -PKG_HAVE_DEFINE_WITH_MODULES(SYSTEMD, libsystemd, , , [use libsystemd to get machine id]) -AS_IF([test "$with_systemd" = yes], - [PKG_CHECK_VAR(systemdsystemunitdir, systemd, systemdsystemunitdir)]) +PKG_CHECK_VAR(systemdsystemunitdir, systemd, systemdsystemunitdir) AC_ARG_ENABLE(debug, - AC_HELP_STRING(--enable-debug, [enable debug output [default=no]]), + AC_HELP_STRING(--enable-debug, [enable debug output [no]]), [enable_debug=$enableval], [enable_debug=no] - ) +) AS_CASE([$enable_debug], [yes], [AC_DEFINE(DEBUG, [], [enable debug output])], [no], [], [AC_MSG_ERROR([invalid argument to --enable-debug])] ) +AC_ARG_WITH([machine-id], + AC_HELP_STRING(--with-machine-id, [manually specify machine-id location [/etc/machine-id, /var/lib/dbus/machine-id]]), + [machine_id=$withval] +) + +AS_IF([test -n "$machine_id"], + [ + AS_CASE($machine_id, + [/*], [], + [AC_MSG_ERROR([relative machine id path is invalid])] + ) + AC_DEFINE_UNQUOTED(MACHINE_ID_PATH, "$machine_id", [machine id location]) + ] +) + AC_OUTPUT(Makefile) -- cgit v1.2.3-54-g00ecf