From: Karel Zak Date: Thu, 7 Nov 2019 08:02:23 +0000 (+0100) Subject: build-sys: use parse-date() only for hwclock X-Git-Tag: v2.35-rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e1b131e0aa1063928a830300279f8fce706f407;p=thirdparty%2Futil-linux.git build-sys: use parse-date() only for hwclock The parse-date.y is used only for hwclock, let's keep it together. Note that the file (originally from gnulib) has GPLv3 license, so it's better to make it obvious that we use it really only for hwclock (also GPL). Signed-off-by: Karel Zak --- diff --git a/include/timeutils.h b/include/timeutils.h index 95f1b44daa..9318d2f986 100644 --- a/include/timeutils.h +++ b/include/timeutils.h @@ -88,6 +88,4 @@ int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, si extern time_t timegm(struct tm *tm); #endif -int parse_date(struct timespec *, char const *, struct timespec const *); - #endif /* UTIL_LINUX_TIME_UTIL_H */ diff --git a/lib/Makemodule.am b/lib/Makemodule.am index 90e9a5de6c..b4d0fba2bf 100644 --- a/lib/Makemodule.am +++ b/lib/Makemodule.am @@ -17,7 +17,6 @@ libcommon_la_SOURCES = \ lib/mbsedit.c\ lib/md5.c \ lib/pager.c \ - lib/parse-date.y \ lib/pwdutils.c \ lib/randutils.c \ lib/setproctitle.c \ diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am index 98e2cc29b8..0c0657e131 100644 --- a/sys-utils/Makemodule.am +++ b/sys-utils/Makemodule.am @@ -451,7 +451,8 @@ dist_man_MANS += \ PATHFILES += sys-utils/hwclock.8 hwclock_SOURCES = \ sys-utils/hwclock.c \ - sys-utils/hwclock.h + sys-utils/hwclock.h \ + sys-utils/hwclock-parse-date.y hwclock_LDADD = $(LDADD) libcommon.la -lm if USE_HWCLOCK_CMOS hwclock_SOURCES += \ diff --git a/lib/parse-date.y b/sys-utils/hwclock-parse-date.y similarity index 99% rename from lib/parse-date.y rename to sys-utils/hwclock-parse-date.y index bb5abb5d4c..df95e16b71 100644 --- a/lib/parse-date.y +++ b/sys-utils/hwclock-parse-date.y @@ -42,6 +42,7 @@ #include "c.h" #include "timeutils.h" +#include "hwclock.h" /** * There's no need to extend the stack, so there's no need to involve diff --git a/sys-utils/hwclock.h b/sys-utils/hwclock.h index 92fdb5f82e..627cf51452 100644 --- a/sys-utils/hwclock.h +++ b/sys-utils/hwclock.h @@ -77,4 +77,6 @@ extern int set_epoch_rtc(const struct hwclock_control *ctl); extern void __attribute__((__noreturn__)) hwclock_exit(const struct hwclock_control *ctl, int status); +extern int parse_date(struct timespec *, char const *, struct timespec const *); + #endif /* HWCLOCK_CLOCK_H */