From: Miroslav Lichvar Date: Tue, 8 Dec 2015 15:43:08 +0000 (+0100) Subject: configure: rework setting of privops macros X-Git-Tag: 2.3-pre1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fedc605956a0bfedb10b2e218308c38d692268a5;p=thirdparty%2Fchrony.git configure: rework setting of privops macros Prepare a list of required privileged operations first and from that define the PRIVOPS macros. This will reduce the amount of code that will be needed when the privileged helper is used on other platforms. --- diff --git a/configure b/configure index d268f770..ff95b17e 100755 --- a/configure +++ b/configure @@ -202,6 +202,7 @@ try_libcap=-1 try_clockctl=0 feat_scfilter=0 try_seccomp=-1 +priv_ops="" readline_lib="" readline_inc="" ncurses_lib="" @@ -393,12 +394,8 @@ case $OPERATINGSYSTEM in EXTRA_CLI_LIBS="-lresolv" add_def MACOSX if [ $feat_droproot = "1" ]; then - EXTRA_OBJECTS="$EXTRA_OBJECTS privops.o" - add_def PRIVOPS_ADJUSTTIME - add_def PRIVOPS_SETTIME - add_def PRIVOPS_BINDSOCKET - add_def PRIVOPS_HELPER add_def FEAT_PRIVDROP + priv_ops="ADJUSTTIME SETTIME BINDSOCKET" fi echo "Configuring for MacOS X (" $SYSTEM "MacOS X version" $VERSION ")" ;; @@ -627,6 +624,14 @@ then EXTRA_LIBS="$EXTRA_LIBS -lseccomp" fi +if [ "x$priv_ops" != "x" ]; then + EXTRA_OBJECTS="$EXTRA_OBJECTS privops.o" + add_def PRIVOPS_HELPER + for o in $priv_ops; do + add_def PRIVOPS_$o + done +fi + if [ $feat_rtc = "1" ] && [ $try_rtc = "1" ] && \ test_code '' 'sys/ioctl.h linux/rtc.h' '' '' \ 'ioctl(1, RTC_UIE_ON&RTC_UIE_OFF&RTC_RD_TIME&RTC_SET_TIME, 0&RTC_UF);'