]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: support ./configure ADJTIME_PATH=
authorKarel Zak <kzak@redhat.com>
Thu, 19 Jun 2014 08:18:46 +0000 (10:18 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 19 Jun 2014 08:30:56 +0000 (10:30 +0200)
.. to override the default /etc/adjtime path.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am
configure.ac
include/pathnames.h
sys-utils/.gitignore
sys-utils/Makemodule.am
sys-utils/hwclock.8.in [moved from sys-utils/hwclock.8 with 99% similarity]
sys-utils/rtcwake.8.in [moved from sys-utils/rtcwake.8 with 97% similarity]

index 1c52c5382815a9dd3ade81ee5b367ea0d699e4f6..79b5aea782bf412609e4187b50001d471c13665a 100644 (file)
@@ -117,6 +117,7 @@ edit_cmd = sed \
         -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
         -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
         -e 's|@VERSION[@]|$(VERSION)|g' \
+        -e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \
         -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
         -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \
         -e 's|@LIBSMARTCOLS_VERSION[@]|$(LIBSMARTCOLS_VERSION)|g' \
index cf29f6bcd1b197789a866479fe3adba54d13b36c..1e9669ae90b807ab5c3c8221ec23d834dfa76be8 100644 (file)
@@ -1776,6 +1776,12 @@ AC_ARG_VAR([SOLIB_CFLAGS],
 AC_ARG_VAR([SOLIB_LDFLAGS],
           [LDFLAGS used for shared libraries])
 
+AC_ARG_VAR([ADJTIME_PATH],
+          [Path to hwclock adjtime file, default /etc/adjtime])
+AS_IF([test "x$ADJTIME_PATH" = x], [ADJTIME_PATH="/etc/adjtime"])
+AC_DEFINE_UNQUOTED([CONFIG_ADJTIME_PATH], "$ADJTIME_PATH", [Path to hwclock adjtime file])
+
+
 LIBS=""
 
 
index b6efdb7dc6e5c61454e11e88bad1f31cf5fe658d..1cc4e15e6e4fd488ae066a4150c68388ff2ea594 100644 (file)
 #define _PATH_DEV_BYPARTUUID   "/dev/disk/by-partuuid"
 
 /* hwclock paths */
+#ifdef CONFIG_ADJTIME_PATH
+# define _PATH_ADJTIME         CONFIG_ADJTIME_PATH
+#else
 # define _PATH_ADJTIME         "/etc/adjtime"
+#endif
 
 #define _PATH_LASTDATE         "/var/lib/lastdate"
 #ifdef __ia64__
index d378b1d2ff8e3f2aaaf7ef7afffee8c5c33f5470..0185a0e6e36ece97a0dc455386456d3f952539ad 100644 (file)
@@ -20,3 +20,5 @@ sparc64.8
 sparc.8
 uname26.8
 x86_64.8
+hwclock.8
+rtcwake.8
index a2a1d6df26fce48e9ee4b5fb6b1de20484ee3b87..68fd0304603c7f0d186a58725282a2a0bb984f35 100644 (file)
@@ -104,6 +104,7 @@ endif
 if BUILD_RTCWAKE
 usrsbin_exec_PROGRAMS += rtcwake
 dist_man_MANS += sys-utils/rtcwake.8
+PATHFILES += sys-utils/rtcwake.8
 rtcwake_SOURCES = sys-utils/rtcwake.c
 rtcwake_LDADD = $(LDADD) libcommon.la
 endif
@@ -334,6 +335,7 @@ endif
 if BUILD_HWCLOCK
 sbin_PROGRAMS += hwclock
 dist_man_MANS += sys-utils/hwclock.8
+PATHFILES += sys-utils/hwclock.8
 hwclock_SOURCES = \
        sys-utils/hwclock.c \
        sys-utils/hwclock.h \
similarity index 99%
rename from sys-utils/hwclock.8
rename to sys-utils/hwclock.8.in
index 09f1edc5ed9123dfcd7ffc23f09e2c5da3fde621..1e77269b127f5b7be5e5bdab5eabdbb2b034d60c 100644 (file)
@@ -193,7 +193,7 @@ exist, the default is UTC time.
 .TP
 .B \-\-noadjfile
 Disables the facilities provided by
-.IR /etc/adjtime .
+.IR @ADJTIME_PATH@ .
 .B hwclock
 will not read nor write to that file with this option.  Either
 .B \-\-utc
@@ -203,7 +203,7 @@ must be specified when using this option.
 
 .TP
 .BI \-\-adjfile= filename
-Overrides the default /etc/adjtime.
+Overrides the default @ADJTIME_PATH@.
 
 .TP
 .BR \-f , \ \-\-rtc=\fIfilename\fB
@@ -493,7 +493,7 @@ systematic drift.
 It works like this:
 .B hwclock
 keeps a file,
-.IR /etc/adjtime ,
+.IR @ADJTIME_PATH@ ,
 that keeps some historical information.  This is called the adjtime file.
 .PP
 Suppose you start with no adjtime file.  You issue a
@@ -628,7 +628,7 @@ are supported by the hardware.
 .I TZ
 
 .SH FILES
-.I /etc/adjtime
+.I @ADJTIME_PATH@
 .I /usr/share/zoneinfo/
 .RI ( /usr/lib/zoneinfo
 on old systems)
similarity index 97%
rename from sys-utils/rtcwake.8
rename to sys-utils/rtcwake.8.in
index 02ab5cc1541e22c0dde0cd621a3f90cf5fdd14c3..643b59def2046eb1ea3283af9390ab6855f6d49a 100644 (file)
@@ -61,17 +61,17 @@ Specifies an alternative path to the adjust file.
 .TP
 \fB-a\fP | \fB--auto\fP
 Reads the clock mode (whether the hardware clock is set to UTC or local time)
-from \fI/etc/adjtime\fP. That's the location where the
+from \fIadjtime\fP file. That's the location where the
 .BR hwclock (8)
 stores that information. This is the default.
 .TP
 \fB-l\fP | \fB--local\fP
 Assumes that the hardware clock is set to local time, regardless of the
-contents of \fI/etc/adjtime\fP.
+contents of \fIadjtime\fP file.
 .TP
 \fB-u\fP | \fB--utc\fP
 Assumes that the hardware clock is set to UTC (Universal Time Coordinated),
-regardless of the contents of \fI/etc/adjtime\fP.
+regardless of the contents of \fIadjtime\fP file.
 .TP
 \fB-d\fP \fIdevice\fP | \fB--device\fP \fIdevice\fP
 Uses \fIdevice\fP instead of \fIrtc0\fP as realtime clock. This option
@@ -132,6 +132,8 @@ Print alarm information in format: "alarm: off|on  <time>".
 The time is in ctime() output format, e.g. "alarm: on  Tue Nov 16 04:48:45 2010".
 .RE
 .PP
+.SH FILES
+.I @ADJTIME_PATH@
 .SH NOTES
 Some PC systems can't currently exit sleep states such as \fImem\fP
 using only the kernel code accessed by this driver.