configure: unify macro naming for optional features

This commit is contained in:
Miroslav Lichvar
2014-09-19 17:03:33 +02:00
parent 111b63bb16
commit 285fae856d
11 changed files with 60 additions and 56 deletions

34
configure vendored
View File

@@ -112,7 +112,7 @@ For better control, use the options below.
--disable-pps Disable PPS refclock driver
--disable-ipv6 Disable IPv6 support
--disable-rtc Don't include RTC even on Linux
--disable-linuxcaps Disable Linux capabilities support
--disable-linuxcaps Disable libcap (Linux capabilities) support
--disable-asyncdns Disable asynchronous name resolving
--disable-forcednsretry Don't retry on permanent DNS error
--with-ntp-era=SECONDS Specify earliest assumed NTP time in seconds
@@ -183,7 +183,7 @@ EXTRA_OBJECTS=""
EXTRA_DEFS=""
SYSDEFS=""
debug=0
feat_debug=0
feat_cmdmon=1
feat_ntp=1
feat_refclock=1
@@ -194,8 +194,8 @@ try_nss=1
try_tomcrypt=1
feat_rtc=1
try_rtc=0
feat_linuxcaps=1
try_linuxcaps=0
feat_droproot=1
try_libcap=0
readline_lib=""
readline_inc=""
ncurses_lib=""
@@ -215,7 +215,7 @@ for option
do
case "$option" in
--enable-debug )
debug=1
feat_debug=1
;;
--disable-readline )
feat_readline=0
@@ -290,7 +290,7 @@ do
feat_pps=0
;;
--disable-linuxcaps)
feat_linuxcaps=0
feat_droproot=0
;;
--disable-asyncdns)
feat_asyncdns=0
@@ -355,7 +355,7 @@ case $SYSTEM in
;;
Linux* )
EXTRA_OBJECTS="sys_generic.o sys_linux.o wrap_adjtimex.o"
try_linuxcaps=1
try_libcap=1
try_rtc=1
try_setsched=1
try_lockmem=1
@@ -404,6 +404,11 @@ case $SYSTEM in
;;
esac
if [ $feat_debug = "1" ]; then
add_def FEAT_DEBUG
fi
add_def DEBUG $feat_debug
if [ $feat_cmdmon = "1" ]; then
add_def FEAT_CMDMON
EXTRA_OBJECTS="$EXTRA_OBJECTS cmdmon.o manual.o pktlength.o"
@@ -488,7 +493,7 @@ if [ $feat_ipv6 = "1" ] && \
n.sin6_addr = in6addr_any;
return !inet_ntop(AF_INET6, &n.sin6_addr.s6_addr, p, sizeof(p));'
then
add_def HAVE_IPV6
add_def FEAT_IPV6
if test_code 'in6_pktinfo' 'sys/socket.h netinet/in.h' '' '' '
return sizeof(struct in6_pktinfo);'
then
@@ -538,17 +543,17 @@ if [ "x$timepps_h" != "x" ] && \
struct timespec ts;
return time_pps_fetch(h, PPS_TSFMT_TSPEC, &i, &ts);'
then
add_def HAVE_PPSAPI
add_def FEAT_PPS
fi
if [ $feat_linuxcaps = "1" ] && [ $try_linuxcaps = "1" ] && \
if [ $feat_droproot = "1" ] && [ $try_libcap = "1" ] && \
test_code \
linuxcaps \
libcap \
'sys/types.h pwd.h sys/prctl.h sys/capability.h grp.h' \
'' '-lcap' \
'prctl(PR_SET_KEEPCAPS, 1);cap_set_proc(cap_from_text("cap_sys_time=ep"));'
then
add_def FEAT_LINUXCAPS
add_def FEAT_PRIVDROP
EXTRA_LIBS="$EXTRA_LIBS -lcap"
fi
@@ -659,7 +664,7 @@ if [ $try_nss = "1" ]; then
HASH_COMPILE="$test_cflags"
HASH_LINK="$test_link"
LIBS="$LIBS $HASH_LINK"
add_def GENERATE_SHA1_KEY
add_def FEAT_SECHASH
fi
fi
@@ -671,7 +676,7 @@ if [ "x$HASH_LINK" = "x" ] && [ $try_tomcrypt = "1" ]; then
HASH_COMPILE="-I/usr/include/tomcrypt"
HASH_LINK="-ltomcrypt"
LIBS="$LIBS $HASH_LINK"
add_def GENERATE_SHA1_KEY
add_def FEAT_SECHASH
fi
fi
@@ -730,7 +735,6 @@ if [ "x$SETCHRONYVARDIR" != "x" ]; then
CHRONYVARDIR=$SETCHRONYVARDIR
fi
add_def DEBUG $debug
add_def DEFAULT_CONF_FILE "\"$SYSCONFDIR/chrony.conf\""
add_def DEFAULT_USER "\"$default_user\""
add_def MAIL_PROGRAM "\"$mail_program\""