diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 22 insertions, 6 deletions
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) |