3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- ntp-4.1.2/./configure.in~configure
7 +++ ntp-4.1.2/./configure.in
10 dnl Process this file with autoconf to produce a configure script.
11 -AC_INIT(ntpd/ntp_refclock.c)
14 +AC_CONFIG_SRCDIR([ntpd/ntp_refclock.c])
15 +AC_CANONICAL_TARGET([])
16 AC_DEFINE_UNQUOTED(STR_SYSTEM, "$host", [canonical system (cpu-vendor-os) string])
17 AM_CONFIG_HEADER(config.h)
19 AM_INIT_AUTOMAKE(ntp, 4.1.2)
24 ac_cv_var_oncore_ok=no
27 dnl we need to check for cross compile tools for vxWorks here
35 AC_CHECK_HEADER(nlist.h,
36 [AC_DEFINE(NLIST_STRUCT, 1, [nlist stuff])
37 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
38 -[AC_TRY_COMPILE([#include <nlist.h>],
39 -[struct nlist n; n.n_un.n_name = 0;],
40 -ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
41 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]], [[struct nlist n; n.n_un.n_name = 0;]])],[ac_cv_struct_nlist_n_un=yes],[ac_cv_struct_nlist_n_un=no])])
42 if test $ac_cv_struct_nlist_n_un = yes; then
43 AC_DEFINE(NLIST_NAME_UNION, 1, [does struct nlist use a name union?])
47 AC_CACHE_CHECK(for basic volatile support, ac_cv_c_volatile,
50 - ac_cv_c_volatile=yes,
51 - ac_cv_c_volatile=no)
52 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
53 +volatile int x;]])],[ac_cv_c_volatile=yes],[ac_cv_c_volatile=no])
55 case "$ac_cv_c_volatile" in
60 AC_CACHE_CHECK(if C compiler permits function prototypes, ac_cv_have_prototypes,
62 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
63 extern int foo (short);
64 -int foo(short i) { return i; }],[
65 -int i;], ac_cv_have_prototypes=yes, ac_cv_have_prototypes=no)
66 +int foo(short i) { return i; }]], [[
67 +int i;]])],[ac_cv_have_prototypes=yes],[ac_cv_have_prototypes=no])
69 if test "$ac_cv_have_prototypes" = yes; then
70 AC_DEFINE(HAVE_PROTOTYPES, 1, [Are function prototypes OK?])
74 dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
75 -dnl [AC_TRY_LINK([#include <sys/types.h>
76 -dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
77 -dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
78 +dnl [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
79 +dnl #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[dnl ac_cv_func_ut_host_in_utmp=yes],[ac_cv_func_ut_host_in_utmp=no])])
80 dnl if test $su_cv_func_ut_host_in_utmp = yes; then
81 dnl AC_DEFINE(HAVE_UT_HOST)
84 struct sigaction for sa_sigaction,
85 ac_cv_struct_sigaction_has_sa_sigaction,
88 - [#include <signal.h>],
89 - [struct sigaction act; act.sa_sigaction = 0;],
90 - ac_cv_struct_sigaction_has_sa_sigaction=yes,
91 - ac_cv_struct_sigaction_has_sa_sigaction=no
93 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[struct sigaction act; act.sa_sigaction = 0;]])],[ac_cv_struct_sigaction_has_sa_sigaction=yes],[ac_cv_struct_sigaction_has_sa_sigaction=no
97 if test $ac_cv_struct_sigaction_has_sa_sigaction = yes; then
101 AC_CACHE_CHECK(for struct ppsclockev, ac_cv_struct_ppsclockev,
103 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
104 #include <sys/types.h>
105 #ifdef HAVE_SYS_TERMIOS_H
106 # include <sys/termios.h>
107 @@ -424,24 +416,20 @@
109 #ifdef HAVE_SYS_PPSCLOCK_H
110 # include <sys/ppsclock.h>
113 extern struct ppsclockev *pce;
114 -return pce->serial;],
115 - ac_cv_struct_ppsclockev=yes,
116 - ac_cv_struct_ppsclockev=no)
117 +return pce->serial;]])],[ac_cv_struct_ppsclockev=yes],[ac_cv_struct_ppsclockev=no])
119 if test $ac_cv_struct_ppsclockev = yes; then
120 AC_DEFINE(HAVE_STRUCT_PPSCLOCKEV, 1, [Does a system header define struct ppsclockev?])
123 AC_CACHE_CHECK(struct sockaddr for sa_len, ac_cv_struct_sockaddr_has_sa_len,
125 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
126 #include <sys/types.h>
127 -#include <sys/socket.h>],[
128 +#include <sys/socket.h>]], [[
129 extern struct sockaddr *ps;
130 -return ps->sa_len;],
131 - ac_cv_struct_sockaddr_has_sa_len=yes,
132 - ac_cv_struct_sockaddr_has_sa_len=no)
133 +return ps->sa_len;]])],[ac_cv_struct_sockaddr_has_sa_len=yes],[ac_cv_struct_sockaddr_has_sa_len=no])
135 if test $ac_cv_struct_sockaddr_has_sa_len = yes; then
136 AC_DEFINE(HAVE_SA_LEN_IN_STRUCT_SOCKADDR, 1, [Should be obvious...])
137 @@ -450,17 +438,15 @@
138 case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
140 AC_CACHE_CHECK([for struct snd_size], ac_cv_struct_snd_size,
142 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
143 #ifdef HAVE_MACHINE_SOUNDCARD_H
144 # include <machine/soundcard.h>
146 #ifdef HAVE_SYS_SOUNDCARD_H
147 # include <sys/soundcard.h>
150 extern struct snd_size *ss;
151 -return ss->rec_size;],
152 - ac_cv_struct_snd_size=yes,
153 - ac_cv_struct_snd_size=no)
154 +return ss->rec_size;]])],[ac_cv_struct_snd_size=yes],[ac_cv_struct_snd_size=no])
156 case "$ac_cv_struct_snd_size" in
157 yes) AC_DEFINE(HAVE_STRUCT_SND_SIZE, 1,[Do we have struct snd_size?]) ;;
158 @@ -469,31 +455,27 @@
161 AC_CACHE_CHECK(struct clockinfo for hz, ac_cv_struct_clockinfo_has_hz,
163 -#include <sys/time.h>],[
164 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
165 +#include <sys/time.h>]], [[
166 extern struct clockinfo *pc;
168 - ac_cv_struct_clockinfo_has_hz=yes,
169 - ac_cv_struct_clockinfo_has_hz=no)
170 +return pc->hz;]])],[ac_cv_struct_clockinfo_has_hz=yes],[ac_cv_struct_clockinfo_has_hz=no])
172 if test $ac_cv_struct_clockinfo_has_hz = yes; then
173 AC_DEFINE(HAVE_HZ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
176 AC_CACHE_CHECK(struct clockinfo for tickadj, ac_cv_struct_clockinfo_has_tickadj,
178 -#include <sys/time.h>],[
179 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
180 +#include <sys/time.h>]], [[
181 extern struct clockinfo *pc;
182 -return pc->tickadj;],
183 - ac_cv_struct_clockinfo_has_tickadj=yes,
184 - ac_cv_struct_clockinfo_has_tickadj=no)
185 +return pc->tickadj;]])],[ac_cv_struct_clockinfo_has_tickadj=yes],[ac_cv_struct_clockinfo_has_tickadj=no])
187 if test $ac_cv_struct_clockinfo_has_tickadj = yes; then
188 AC_DEFINE(HAVE_TICKADJ_IN_STRUCT_CLOCKINFO, 1, [Obvious...])
191 AC_CACHE_CHECK([for struct timespec], ac_cv_struct_timespec,
193 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
194 #include <sys/time.h>
195 /* Under SunOS, timespec is in sys/timepps.h, which needs errno.h and FRAC */
197 @@ -502,19 +484,15 @@
198 #ifdef HAVE_SYS_TIMEPPS_H
199 # define FRAC 4294967296
200 # include <sys/timepps.h>
202 -[struct timespec n;],
203 -ac_cv_struct_timespec=yes, ac_cv_struct_timespec=no)])
204 +#endif]], [[struct timespec n;]])],[ac_cv_struct_timespec=yes],[ac_cv_struct_timespec=no])])
205 if test $ac_cv_struct_timespec = yes; then
206 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [Do we have struct timespec?])
209 AC_CACHE_CHECK([for struct ntptimeval], ac_cv_struct_ntptimeval,
211 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
212 #include <sys/time.h>
213 -#include <sys/timex.h>],
214 -[struct ntptimeval n;],
215 -ac_cv_struct_ntptimeval=yes, ac_cv_struct_ntptimeval=no)])
216 +#include <sys/timex.h>]], [[struct ntptimeval n;]])],[ac_cv_struct_ntptimeval=yes],[ac_cv_struct_ntptimeval=no])])
217 if test $ac_cv_struct_ntptimeval = yes; then
218 AC_DEFINE(HAVE_STRUCT_NTPTIMEVAL, 1, [Do we have struct ntptimeval?])
221 # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
222 # (returning ENOSYS). I didn't check 4.2. If, in the future,
223 # IBM pulls its thumbs out long enough to implement clock_settime,
224 - # this conditional will need to change. Maybe use AC_TRY_RUN
225 + # this conditional will need to change. Maybe use AC_RUN_IFELSE([AC_LANG_SOURCE([[]])],[],[],[])
226 # instead to try to set the time to itself and check errno.
228 *) AC_CHECK_FUNCS(clock_gettime clock_settime)
230 [AC_MSG_CHECKING(for isfinite with <math.h>)
233 - AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
234 - [AC_MSG_RESULT(yes)
235 - AC_DEFINE(HAVE_ISFINITE)],
237 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isfinite(f)]])],[AC_MSG_RESULT(yes)
238 + AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])
240 AC_CHECK_FUNCS(getbootfile getclock getdtablesize getrusage)
241 AC_CHECK_FUNC(gettimeofday, ,[
242 @@ -691,26 +667,24 @@
243 AC_CHECK_FUNCS(uname updwtmp updwtmpx vsprintf)
245 AC_CACHE_CHECK(number of arguments to gettimeofday(), ac_cv_func_Xettimeofday_nargs,
246 -[AC_TRY_COMPILE([#include <sys/time.h>],[
247 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[
248 gettimeofday((struct timeval*)0,(struct timezone*)0);
249 settimeofday((struct timeval*)0,(struct timezone*)0);
251 - ac_cv_func_Xettimeofday_nargs=2, ac_cv_func_Xettimeofday_nargs=1)
252 +]])],[ac_cv_func_Xettimeofday_nargs=2],[ac_cv_func_Xettimeofday_nargs=1])
254 if test $ac_cv_func_Xettimeofday_nargs = 1; then
255 AC_DEFINE(SYSV_TIMEOFDAY, 1, [Does Xettimeofday take 1 arg?])
258 AC_CACHE_CHECK(number of arguments taken by setpgrp(), ac_cv_func_setpgrp_nargs,
260 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
261 #ifdef HAVE_SYS_TYPES_H
262 # include <sys/types.h>
268 - ac_cv_func_setpgrp_nargs=2, ac_cv_func_setpgrp_nargs=0)
269 +]], [[setpgrp(0,0);]])],[ac_cv_func_setpgrp_nargs=2],[ac_cv_func_setpgrp_nargs=0])
271 if test $ac_cv_func_setpgrp_nargs = 0; then
272 AC_DEFINE(HAVE_SETPGRP_0, 1, [define if setpgrp takes 0 arguments])
275 AC_CACHE_CHECK(argument pointer type of qsort()'s compare function and base,
276 ac_cv_func_qsort_argtype,
278 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
279 #include "l_stdlib.h"
281 #ifdef HAVE_PROTOTYPES
285 const void *b; { return 0; }
288 qsort(base, 2, sizeof(char *), sortfunc);
290 - ac_cv_func_qsort_argtype=void, ac_cv_func_qsort_argtype=char)
291 +]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
293 case "$ac_cv_func_qsort_argtype" in
298 AC_CACHE_CHECK(if we need to declare 'errno', ac_cv_decl_errno,
299 -[AC_TRY_COMPILE([#ifdef HAVE_ERRNO_H
300 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_ERRNO_H
304 - ac_cv_decl_errno=no, ac_cv_decl_errno=yes)])
305 +#endif]], [[errno = 0;]])],[ac_cv_decl_errno=no],[ac_cv_decl_errno=yes])])
306 case "$ac_cv_decl_errno" in
307 yes) AC_DEFINE(DECL_ERRNO, 1, [Declare errno?]) ;;
310 dnl without breaking any other platforms.
312 AC_CACHE_CHECK(if we may declare 'h_errno', ac_cv_decl_h_errno,
313 -[AC_TRY_COMPILE([#include <sys/types.h>
314 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
315 #ifdef HAVE_NETINET_IN_H
316 #include <netinet/in.h>
318 @@ -779,28 +750,24 @@
323 - [extern int h_errno;],
324 - ac_cv_decl_h_errno=yes, ac_cv_decl_h_errno=no)])
325 +#endif]], [[extern int h_errno;]])],[ac_cv_decl_h_errno=yes],[ac_cv_decl_h_errno=no])])
326 case "$ac_cv_decl_h_errno" in
327 yes) AC_DEFINE(DECL_H_ERRNO, 1, [Declare h_errno?]) ;;
330 dnl See if char *sys_errlist[] is OK.
331 AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
332 -[AC_TRY_COMPILE([#include <stdio.h>
333 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
337 - [extern char *sys_errlist[];
339 - ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])
340 +#endif]], [[extern char *sys_errlist[];
341 +]])],[ac_cv_decl_sys_errlist=yes],[ac_cv_decl_sys_errlist=no])])
342 case "$ac_cv_decl_sys_errlist" in
343 yes) AC_DEFINE(CHAR_SYS_ERRLIST, 1, [Declare char *sys_errlist array]) ;;
346 AC_CACHE_CHECK(if declaring 'syscall()' is ok, ac_cv_decl_syscall,
348 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
349 #ifdef HAVE_SYS_TYPES_H
350 # include <sys/types.h>
357 - [extern int syscall P((int, ...));],
358 - ac_cv_decl_syscall=yes, ac_cv_decl_syscall=no)])
359 +]], [[extern int syscall P((int, ...));]])],[ac_cv_decl_syscall=yes],[ac_cv_decl_syscall=no])])
360 case "$ac_cv_decl_syscall" in
361 yes) AC_DEFINE(DECL_SYSCALL, 1, [Declare syscall()?]) ;;