summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2018-08-08 17:19:34 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2018-08-08 17:22:16 -0400
commitca2637e4ddd64a85d7e0300b27b3765906265d7f (patch)
treeb23339c31712bd5180434db3cfb45dfa0f3a2d46 /configure.ac
parente6f6b0f854e531ce2a96de8b7fa827cbd924da5e (diff)
downloadrandom-seed-ca2637e4ddd64a85d7e0300b27b3765906265d7f.tar.xz
random-seed-ca2637e4ddd64a85d7e0300b27b3765906265d7f.zip
Fix stuff.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
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)