AM_CONDITIONAL([BUILD_HWCLOCK], [test "x$build_hwclock" = xyes])
+AC_ARG_ENABLE([hwclock-cmos],
+ AS_HELP_STRING([--disable-hwclock-cmos], [do not use CMOS clock]),
+ [], [use_hwclock_cmos="$build_hwclock"]
+)
+
+AS_IF([test "x$use_hwclock_cmos" = xyes], [
+ AM_CONDITIONAL([USE_HWCLOCK_CMOS], [true])
+ AC_DEFINE([USE_HWCLOCK_CMOS], [1], [Define to 1 if want to use CMOS clock.])
+],[
+ AM_CONDITIONAL([USE_HWCLOCK_CMOS], [false])
+])
+
+
UL_BUILD_INIT([mkfs], [yes])
AM_CONDITIONAL([BUILD_MKFS], [test "x$build_mkfs" = xyes])
PATHFILES += sys-utils/hwclock.8
hwclock_SOURCES = \
sys-utils/hwclock.c \
- sys-utils/hwclock.h \
- sys-utils/hwclock-cmos.c
+ sys-utils/hwclock.h
hwclock_LDADD = $(LDADD) libcommon.la -lm
+if USE_HWCLOCK_CMOS
+hwclock_SOURCES += \
+ sys-utils/hwclock-cmos.c
+endif
if LINUX
hwclock_SOURCES += \
sys-utils/hwclock-rtc.c \
#include "pathnames.h"
/* for inb, outb */
-#if defined(__i386__) || defined(__x86_64__)
-# ifdef HAVE_SYS_IO_H
-# include <sys/io.h>
-# elif defined(HAVE_ASM_IO_H)
-# include <asm/io.h>
-# else
-# undef __i386__
-# undef __x86_64__
-# warning "disable cmos access - no sys/io.h or asm/io.h"
-static void outb(int a __attribute__((__unused__)),
- int b __attribute__((__unused__)))
-{
-}
-
-static int inb(int c __attribute__((__unused__)))
-{
- return 0;
-}
-# endif /* __i386__ __x86_64__ */
+#ifdef HAVE_SYS_IO_H
+# include <sys/io.h>
+#elif defined(HAVE_ASM_IO_H)
+# include <asm/io.h>
#else
-# warning "disable cmos access - not i386 or x86_64"
-static void outb(int a __attribute__((__unused__)),
- int b __attribute__((__unused__)))
-{
-}
-
-static int inb(int c __attribute__((__unused__)))
-{
- return 0;
-}
-#endif /* for inb, outb */
+# error "no sys/io.h or asm/io.h"
+#endif /* HAVE_SYS_IO_H, HAVE_ASM_IO_H */
#include "hwclock.h"
return 0;
}
-#if defined(__i386__) || defined(__x86_64__)
# if defined(HAVE_IOPL)
static int i386_iopl(const int level)
{
return ioperm(clock_ctl_addr, 2, 1);
}
# endif
-#else
-static int i386_iopl(const int level __attribute__ ((__unused__)))
-{
- return IOPL_NOT_IMPLEMENTED;
-}
-#endif
static int get_permissions_cmos(void)
{
*/
struct clock_ops *probe_for_cmos_clock(void)
{
-#if defined(__i386__) || defined(__x86_64__)
return &cmos_interface;
-#else
- return NULL;
-#endif
}