summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-24 18:44:38 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-24 18:44:38 +0400
commit2b868bc3016a2d6b7119057f012a3b6ade19b865 (patch)
treedf7fa188a2ec9069a36a0aecc96ad73fa5ee3405
parent74f0726a5ba3830dc8f7c8861acfef12f41fd7d8 (diff)
downloadfaketime-ng-2b868bc3016a2d6b7119057f012a3b6ade19b865.tar.gz
Search for GNU date
-rw-r--r--configure.ac7
-rw-r--r--src/faketime.c6
2 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index cd9979b..eaa6605 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,13 @@ AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([src/faketime.c])
AC_CONFIG_HEADERS([config.h])
+AC_ARG_WITH([gnu-date],
+ AS_HELP_STRING([--with-gnu-date=PATH], [Path to GNU date utility]),
+ [GNUDATE="$with_gnu_date"],
+ [AC_PATH_PROGS([GNUDATE], [gnu-date gnudate gdate date], [date])]
+)
+AC_DEFINE_UNQUOTED([GNUDATE], ["$GNUDATE"], [Path to GNU date utility])
+
# Checks for programs.
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
diff --git a/src/faketime.c b/src/faketime.c
index f574038..c143272 100644
--- a/src/faketime.c
+++ b/src/faketime.c
@@ -54,11 +54,7 @@
const char version[] = "0.9.6";
-#ifdef __APPLE__
-static const char *date_cmd = "gdate";
-#else
-static const char *date_cmd = "date";
-#endif
+static const char *date_cmd = GNUDATE;
#define PATH_BUFSIZE 4096