From d060ebf7b2b5bc7a4978fe5972050b910ca5997b Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Thu, 22 Jul 2004 08:14:37 +0000 Subject: [PATCH] Allow ntpd to be compiled w/o readline when NO_GNU is defined. Part of a larger patchset to get a GNU-free world. Patch rewritten to cope with the 4.2.0 changes. Submitted by: des --- usr.sbin/ntp/config.h | 6 +++--- usr.sbin/ntp/ntpdc/Makefile | 11 +++++++++-- usr.sbin/ntp/ntpq/Makefile | 11 +++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h index 05d499ea26d..e58cad5b360 100644 --- a/usr.sbin/ntp/config.h +++ b/usr.sbin/ntp/config.h @@ -405,7 +405,7 @@ /* #undef HAVE_LIBPOSIX4 */ /* Define to 1 if you have the `readline' library (-lreadline). */ -#define HAVE_LIBREADLINE 1 +/* #undef HAVE_LIBREADLINE */ /* Define to 1 if you have the `rt' library (-lrt). */ /* #undef HAVE_LIBRT */ @@ -519,10 +519,10 @@ /* #undef HAVE_RANDOM */ /* Define to 1 if you have the header file. */ -#define HAVE_READLINE_HISTORY_H 1 +/* #undef HAVE_READLINE_HISTORY_H */ /* Define to 1 if you have the header file. */ -#define HAVE_READLINE_READLINE_H 1 +/* #undef HAVE_READLINE_READLINE_H */ /* Define to 1 if you have the `readlink' function. */ #define HAVE_READLINK 1 diff --git a/usr.sbin/ntp/ntpdc/Makefile b/usr.sbin/ntp/ntpdc/Makefile index 9bb3a5430df..94947f5345f 100644 --- a/usr.sbin/ntp/ntpdc/Makefile +++ b/usr.sbin/ntp/ntpdc/Makefile @@ -8,8 +8,15 @@ SRCS= ntpdc.c ntpdc_ops.c version.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ -DPADD= ${LIBNTP} ${LIBREADLINE} ${LIBTERMCAP} ${LIBMD} -LDADD= ${LIBNTP} -lreadline -ltermcap -lmd +DPADD= ${LIBNTP} ${LIBMD} +LDADD= ${LIBNTP} -lmd + +.if !defined(NO_GNU) +DPADD+= ${LIBREADLINE} ${LIBTERMCAP} +LDADD+= -lreadline -ltermcap +CFLAGS+= -DHAVE_LIBREADLINE -DHAVE_READLINE_HISTORY_H \ + -DHAVE_READLINE_READLINE_H +.endif CLEANFILES+= .version version.c diff --git a/usr.sbin/ntp/ntpq/Makefile b/usr.sbin/ntp/ntpq/Makefile index 67687e96141..7d3e1e5e07a 100644 --- a/usr.sbin/ntp/ntpq/Makefile +++ b/usr.sbin/ntp/ntpq/Makefile @@ -10,8 +10,15 @@ SRCS= ntpq.c ntpq_ops.c version.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ -DPADD= ${LIBNTP} ${LIBREADLINE} ${LIBTERMCAP} ${LIBMD} -LDADD= ${LIBNTP} -lreadline -ltermcap -lmd +DPADD= ${LIBNTP} ${LIBMD} +LDADD= ${LIBNTP} -lmd + ++ .if !defined(NO_GNU) +DPADD+= ${LIBREADLINE} ${LIBTERMCAP} +LDADD+= -lreadline -ltermcap +CFLAGS+= -DHAVE_LIBREADLINE -DHAVE_READLINE_HISTORY_H \ +i -DHAVE_READLINE_READLINE_H +.endif CLEANFILES+= .version version.c