]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Allow RTC support to be excluded at compile time.
authorVladimir Michl <vladimir.michl@seznam.cz>
Tue, 26 Jun 2007 21:08:49 +0000 (22:08 +0100)
committerRichard P. Curnow <rc@rc0.org.uk>
Tue, 26 Jun 2007 21:08:49 +0000 (22:08 +0100)
Add a new option to configure script, allowing
to disable (and exclude) RTC module. It saves same memory.

configure
rtc.c

index 786e9e1c9743e507752e5c4999ba7ad483099989..c100c29172a784a50682cf164c6bddb7d4f93d58 100755 (executable)
--- a/configure
+++ b/configure
@@ -133,6 +133,7 @@ For better control, use the options below.
   --readline-inc-dir=DIR Specify where readline include directory is
   --readline-lib-dir=DIR Specify where readline lib directory is
   --with-ncurses-library=DIR Specify where ncurses lib directory is
+  --disable-rtc          Don't include RTC even on Linux
 
 Fine tuning of the installation directories:
   --infodir=DIR          info documentation [PREFIX/info]
@@ -172,6 +173,7 @@ SYSDEFS=""
 
 # Support for readline (on by default)
 feat_readline=1
+feat_rtc=1
 readline_lib=""
 readline_inc=""
 ncurses_lib=""
@@ -206,6 +208,9 @@ do
     --mandir=* )
       SETMANDIR=`echo $option | sed -e 's/^.*=//;'`
     ;;
+    --disable-rtc)
+      feat_rtc=0
+    ;;
     --help | -h )
       usage
       exit 0
@@ -238,7 +243,11 @@ case $SYSTEM in
     esac
     ;;
     Linux* )
-        EXTRA_OBJECTS="sys_linux.o wrap_adjtimex.o rtc_linux.o"
+        EXTRA_OBJECTS="sys_linux.o wrap_adjtimex.o"
+       if [ $feat_rtc -eq 1 ] ; then
+           EXTRA_OBJECTS+=" rtc_linux.o"
+           EXTRA_DEFS+=" -DFEAT_RTC=1"
+       fi
         SYSDEFS="-DLINUX"
         echo "Configuring for " $SYSTEM
         if [ "${MACHINE}" = "alpha" ]; then
diff --git a/rtc.c b/rtc.c
index bde61cb201901c37941543ce32940628410334ef..8ff83cb6c691da2f181403b386cf65b37986a522 100644 (file)
--- a/rtc.c
+++ b/rtc.c
@@ -33,7 +33,7 @@
 #include "logging.h"
 #include "conf.h"
 
-#if defined LINUX
+#if defined LINUX && defined FEAT_RTC
 #include "rtc_linux.h"
 #endif /* defined LINUX */
 
@@ -53,7 +53,7 @@ static struct {
   void (*cycle_logfile)(void);
 } driver =
 {
-#if defined LINUX
+#if defined LINUX && defined FEAT_RTC
   RTC_Linux_Initialise,
   RTC_Linux_Finalise,
   RTC_Linux_TimePreInit,