1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
---|
2 | |
---|
3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. |
---|
4 | dnl This file is free software; the Free Software Foundation |
---|
5 | dnl gives unlimited permission to copy and/or distribute it, |
---|
6 | dnl with or without modifications, as long as this notice is preserved. |
---|
7 | |
---|
8 | dnl This program is distributed in the hope that it will be useful, |
---|
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
---|
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
11 | dnl PARTICULAR PURPOSE. |
---|
12 | |
---|
13 | dnl This file contains the common configuration code which would |
---|
14 | dnl otherwise be duplicated between configure and configure-libafs. |
---|
15 | dnl |
---|
16 | dnl NB: Because this code is a macro, references to positional shell |
---|
17 | dnl parameters must be done like $[]1 instead of $1 |
---|
18 | |
---|
19 | AC_DEFUN(OPENAFS_CONFIGURE_COMMON,[ |
---|
20 | |
---|
21 | AC_CANONICAL_HOST |
---|
22 | SRCDIR_PARENT=`pwd` |
---|
23 | |
---|
24 | #BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia |
---|
25 | AC_ARG_WITH(afs-sysname, |
---|
26 | [ --with-afs-sysname=sys use sys for the afs sysname] |
---|
27 | ) |
---|
28 | AC_ARG_ENABLE( obsolete, |
---|
29 | [ --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no") |
---|
30 | AC_ARG_ENABLE( insecure, |
---|
31 | [ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no") |
---|
32 | AC_ARG_ENABLE( afsdb, |
---|
33 | [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") |
---|
34 | AC_ARG_ENABLE( bos-restricted-mode, |
---|
35 | [ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") |
---|
36 | AC_ARG_ENABLE( namei-fileserver, |
---|
37 | [ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") |
---|
38 | AC_ARG_ENABLE( fast-restart, |
---|
39 | [ --enable-fast-restart enable fast startup of file server without salvaging],, enable_fast_restart="no") |
---|
40 | AC_ARG_ENABLE( bitmap-later, |
---|
41 | [ --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no") |
---|
42 | AC_ARG_ENABLE( full-vos-listvol-switch, |
---|
43 | [ --enable-full-vos-listvol-switch enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no") |
---|
44 | AC_ARG_WITH(dux-kernel-headers, |
---|
45 | [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] |
---|
46 | ) |
---|
47 | AC_ARG_WITH(linux-kernel-headers, |
---|
48 | [ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] |
---|
49 | ) |
---|
50 | AC_ARG_ENABLE(kernel-module, |
---|
51 | [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes" |
---|
52 | ) |
---|
53 | AC_ARG_ENABLE(redhat-buildsys, |
---|
54 | [ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no" |
---|
55 | ) |
---|
56 | AC_ARG_ENABLE(transarc-paths, |
---|
57 | [ --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no" |
---|
58 | ) |
---|
59 | AC_ARG_ENABLE(tivoli-tsm, |
---|
60 | [ --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no" |
---|
61 | ) |
---|
62 | AC_ARG_ENABLE(debug-kernel, |
---|
63 | [ --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no" |
---|
64 | ) |
---|
65 | |
---|
66 | dnl weird ass systems |
---|
67 | AC_AIX |
---|
68 | AC_ISC_POSIX |
---|
69 | AC_MINIX |
---|
70 | |
---|
71 | dnl Various compiler setup. |
---|
72 | AC_TYPE_PID_T |
---|
73 | AC_TYPE_SIZE_T |
---|
74 | AC_TYPE_SIGNAL |
---|
75 | |
---|
76 | dnl Checks for programs. |
---|
77 | AC_PROG_INSTALL |
---|
78 | AC_PROG_LN_S |
---|
79 | AC_PROG_RANLIB |
---|
80 | AC_PROG_YACC |
---|
81 | AM_PROG_LEX |
---|
82 | |
---|
83 | OPENAFS_CHECK_BIGENDIAN |
---|
84 | |
---|
85 | KERN_DEBUG_OPT= |
---|
86 | if test "x$enable_debug_kernel" = "xyes"; then |
---|
87 | KERN_DEBUG_OPT=-g |
---|
88 | fi |
---|
89 | |
---|
90 | AC_MSG_CHECKING(your OS) |
---|
91 | system=$host |
---|
92 | case $system in |
---|
93 | *-linux*) |
---|
94 | MKAFS_OSTYPE=LINUX |
---|
95 | if test "x$enable_redhat_buildsys" = "xyes"; then |
---|
96 | AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem]) |
---|
97 | fi |
---|
98 | if test "x$enable_kernel_module" = "xyes"; then |
---|
99 | if test "x$with_linux_kernel_headers" != "x"; then |
---|
100 | LINUX_KERNEL_PATH="$with_linux_kernel_headers" |
---|
101 | else |
---|
102 | LINUX_KERNEL_PATH="/usr/src/linux" |
---|
103 | fi |
---|
104 | if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then |
---|
105 | linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` |
---|
106 | if test "x$linux_kvers" = "x"; then |
---|
107 | if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then |
---|
108 | linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` |
---|
109 | if test "x$linux_kvers" = "x"; then |
---|
110 | |
---|
111 | AC_MSG_ERROR(Linux headers lack version definition [2]) |
---|
112 | exit 1 |
---|
113 | else |
---|
114 | LINUX_VERSION="$linux_kvers" |
---|
115 | fi |
---|
116 | else |
---|
117 | AC_MSG_ERROR(Linux headers lack version definition) |
---|
118 | exit 1 |
---|
119 | fi |
---|
120 | else |
---|
121 | LINUX_VERSION="$linux_kvers" |
---|
122 | fi |
---|
123 | else |
---|
124 | enable_kernel_module="no" |
---|
125 | fi |
---|
126 | if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then |
---|
127 | enable_kernel_module="no" |
---|
128 | fi |
---|
129 | if test "x$enable_kernel_module" = "xno"; then |
---|
130 | if test "x$with_linux_kernel_headers" != "x"; then |
---|
131 | AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH) |
---|
132 | exit 1 |
---|
133 | else |
---|
134 | AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module) |
---|
135 | fi |
---|
136 | fi |
---|
137 | fi |
---|
138 | AC_MSG_RESULT(linux) |
---|
139 | if test "x$enable_kernel_module" = "xyes"; then |
---|
140 | OMIT_FRAME_POINTER= |
---|
141 | if test "x$enable_debug_kernel" = "xno"; then |
---|
142 | OMIT_FRAME_POINTER=-fomit-frame-pointer |
---|
143 | fi |
---|
144 | AC_SUBST(OMIT_FRAME_POINTER) |
---|
145 | OPENAFS_GCC_SUPPORTS_MARCH |
---|
146 | AC_SUBST(P5PLUS_KOPTS) |
---|
147 | OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE |
---|
148 | OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING |
---|
149 | OPENAFS_GCC_SUPPORTS_NO_COMMON |
---|
150 | AC_SUBST(LINUX_GCC_KOPTS) |
---|
151 | ifdef([OPENAFS_CONFIGURE_LIBAFS], |
---|
152 | [LINUX_BUILD_VNODE_FROM_INODE(config,afs)], |
---|
153 | [LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs/LINUX)] |
---|
154 | ) |
---|
155 | LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK |
---|
156 | LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK |
---|
157 | LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM |
---|
158 | LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS |
---|
159 | LINUX_FS_STRUCT_INODE_HAS_I_DEVICES |
---|
160 | LINUX_INODE_SETATTR_RETURN_TYPE |
---|
161 | LINUX_COMPLETION_H_EXISTS |
---|
162 | LINUX_EXPORTS_TASKLIST_LOCK |
---|
163 | LINUX_NEED_RHCONFIG |
---|
164 | LINUX_WHICH_MODULES |
---|
165 | if test "x$ac_cv_linux_config_modversions" = "xno"; then |
---|
166 | AC_MSG_WARN([Cannot determine sys_call_table status. assuming it's exported]) |
---|
167 | ac_cv_linux_exports_sys_call_table=yes |
---|
168 | else |
---|
169 | LINUX_EXPORTS_SYS_CALL_TABLE |
---|
170 | LINUX_EXPORTS_KALLSYMS_SYMBOL |
---|
171 | LINUX_EXPORTS_KALLSYMS_ADDRESS |
---|
172 | LINUX_EXPORTS_INIT_MM |
---|
173 | if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then |
---|
174 | linux_syscall_method=none |
---|
175 | if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then |
---|
176 | linux_syscall_method=scan |
---|
177 | if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then |
---|
178 | linux_syscall_method=scan_with_kallsyms_address |
---|
179 | fi |
---|
180 | fi |
---|
181 | if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then |
---|
182 | linux_syscall_method=kallsyms_symbol |
---|
183 | fi |
---|
184 | if test "x$linux_syscall_method" = "xnone"; then |
---|
185 | AC_MSG_ERROR([no available sys_call_table access method]) |
---|
186 | fi |
---|
187 | fi |
---|
188 | fi |
---|
189 | if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then |
---|
190 | AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock]) |
---|
191 | fi |
---|
192 | if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then |
---|
193 | AC_DEFINE(EXPORTED_SYS_CALL_TABLE) |
---|
194 | fi |
---|
195 | if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then |
---|
196 | AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL) |
---|
197 | fi |
---|
198 | if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then |
---|
199 | AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS) |
---|
200 | fi |
---|
201 | if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then |
---|
202 | AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if your h_exists exists]) |
---|
203 | fi |
---|
204 | if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then |
---|
205 | AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void]) |
---|
206 | fi |
---|
207 | if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then |
---|
208 | AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock]) |
---|
209 | fi |
---|
210 | if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then |
---|
211 | AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask]) |
---|
212 | fi |
---|
213 | if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then |
---|
214 | AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem]) |
---|
215 | fi |
---|
216 | if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then |
---|
217 | AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices]) |
---|
218 | fi |
---|
219 | if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then |
---|
220 | AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if you struct inode has data_buffers]) |
---|
221 | fi |
---|
222 | : |
---|
223 | fi |
---|
224 | ;; |
---|
225 | *-solaris*) |
---|
226 | MKAFS_OSTYPE=SOLARIS |
---|
227 | AC_MSG_RESULT(sun4) |
---|
228 | SOLARIS_UFSVFS_HAS_DQRWLOCK |
---|
229 | SOLARIS_PROC_HAS_P_COREFILE |
---|
230 | ;; |
---|
231 | *-sunos*) |
---|
232 | MKAFS_OSTYPE=SUNOS |
---|
233 | enable_kernel_module=no |
---|
234 | AC_MSG_RESULT(sun4) |
---|
235 | ;; |
---|
236 | *-hpux*) |
---|
237 | MKAFS_OSTYPE=HPUX |
---|
238 | AC_MSG_RESULT(hp_ux) |
---|
239 | ;; |
---|
240 | *-irix*) |
---|
241 | if test -d /usr/include/sys/SN/SN1; then |
---|
242 | IRIX_BUILD_IP35="IP35" |
---|
243 | fi |
---|
244 | MKAFS_OSTYPE=IRIX |
---|
245 | AC_MSG_RESULT(sgi) |
---|
246 | ;; |
---|
247 | *-aix*) |
---|
248 | MKAFS_OSTYPE=AIX |
---|
249 | AC_MSG_RESULT(rs_aix) |
---|
250 | ;; |
---|
251 | *-osf*) |
---|
252 | MKAFS_OSTYPE=DUX |
---|
253 | AC_MSG_RESULT(alpha_dux) |
---|
254 | if test "x$enable_kernel_module" = "xyes"; then |
---|
255 | if test "x$with_dux_kernel_headers" != "x"; then |
---|
256 | HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` |
---|
257 | else |
---|
258 | HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` |
---|
259 | fi |
---|
260 | fi |
---|
261 | if test "$HEADER_RT" = "*" ; then |
---|
262 | AC_MSG_ERROR([Need a configured kernel directory]) |
---|
263 | fi |
---|
264 | AC_SUBST([HEADER_RT]) |
---|
265 | ;; |
---|
266 | *-darwin*) |
---|
267 | MKAFS_OSTYPE=DARWIN |
---|
268 | AC_MSG_RESULT(ppc_darwin) |
---|
269 | ;; |
---|
270 | *-freebsd*) |
---|
271 | MKAFS_OSTYPE=FBSD |
---|
272 | AC_MSG_RESULT(i386_fbsd) |
---|
273 | ;; |
---|
274 | *-openbsd*) |
---|
275 | MKAFS_OSTYPE=OBSD |
---|
276 | AC_MSG_RESULT(i386_obsd) |
---|
277 | ;; |
---|
278 | *) |
---|
279 | AC_MSG_RESULT($system) |
---|
280 | ;; |
---|
281 | esac |
---|
282 | AC_SUBST(KERN_DEBUG_OPT) |
---|
283 | |
---|
284 | if test "x$with_afs_sysname" != "x"; then |
---|
285 | AFS_SYSNAME="$with_afs_sysname" |
---|
286 | else |
---|
287 | AC_MSG_CHECKING(your AFS sysname) |
---|
288 | case $host in |
---|
289 | i?86-*-freebsd4.2*) |
---|
290 | AFS_SYSNAME="i386_fbsd_42" |
---|
291 | ;; |
---|
292 | i?86-*-freebsd4.3*) |
---|
293 | AFS_SYSNAME="i386_fbsd_43" |
---|
294 | ;; |
---|
295 | i?86-*-freebsd4.4*) |
---|
296 | AFS_SYSNAME="i386_fbsd_44" |
---|
297 | ;; |
---|
298 | i?86-*-freebsd4.5*) |
---|
299 | AFS_SYSNAME="i386_fbsd_45" |
---|
300 | ;; |
---|
301 | i?86-*-freebsd4.6*) |
---|
302 | AFS_SYSNAME="i386_fbsd_46" |
---|
303 | ;; |
---|
304 | hppa*-hp-hpux11*) |
---|
305 | AFS_SYSNAME="hp_ux110" |
---|
306 | ;; |
---|
307 | hppa*-hp-hpux10*) |
---|
308 | AFS_SYSNAME="hp_ux102" |
---|
309 | ;; |
---|
310 | powerpc-apple-darwin1.2*) |
---|
311 | AFS_SYSNAME="ppc_darwin_12" |
---|
312 | ;; |
---|
313 | powerpc-apple-darwin1.3*) |
---|
314 | AFS_SYSNAME="ppc_darwin_13" |
---|
315 | ;; |
---|
316 | powerpc-apple-darwin1.4*) |
---|
317 | AFS_SYSNAME="ppc_darwin_14" |
---|
318 | ;; |
---|
319 | powerpc-apple-darwin5.1*) |
---|
320 | AFS_SYSNAME="ppc_darwin_14" |
---|
321 | ;; |
---|
322 | powerpc-apple-darwin5.2*) |
---|
323 | AFS_SYSNAME="ppc_darwin_14" |
---|
324 | ;; |
---|
325 | powerpc-apple-darwin5.3*) |
---|
326 | AFS_SYSNAME="ppc_darwin_14" |
---|
327 | ;; |
---|
328 | powerpc-apple-darwin5.4*) |
---|
329 | AFS_SYSNAME="ppc_darwin_14" |
---|
330 | ;; |
---|
331 | powerpc-apple-darwin5.5*) |
---|
332 | AFS_SYSNAME="ppc_darwin_14" |
---|
333 | ;; |
---|
334 | powerpc-apple-darwin6.0*) |
---|
335 | AFS_SYSNAME="ppc_darwin_60" |
---|
336 | ;; |
---|
337 | powerpc-apple-darwin6.1*) |
---|
338 | AFS_SYSNAME="ppc_darwin_60" |
---|
339 | ;; |
---|
340 | powerpc-apple-darwin6.2*) |
---|
341 | AFS_SYSNAME="ppc_darwin_60" |
---|
342 | ;; |
---|
343 | sparc-sun-solaris2.5*) |
---|
344 | AFS_SYSNAME="sun4x_55" |
---|
345 | ;; |
---|
346 | sparc-sun-solaris2.6) |
---|
347 | AFS_SYSNAME="sun4x_56" |
---|
348 | ;; |
---|
349 | sparc-sun-solaris2.7) |
---|
350 | AFS_SYSNAME="sun4x_57" |
---|
351 | ;; |
---|
352 | sparc-sun-solaris2.8) |
---|
353 | AFS_SYSNAME="sun4x_58" |
---|
354 | ;; |
---|
355 | sparc-sun-solaris2.9) |
---|
356 | AFS_SYSNAME="sun4x_59" |
---|
357 | ;; |
---|
358 | sparc-sun-sunos4*) |
---|
359 | AFS_SYSNAME="sun4_413" |
---|
360 | ;; |
---|
361 | i386-pc-solaris2.7) |
---|
362 | AFS_SYSNAME="sunx86_57" |
---|
363 | ;; |
---|
364 | i386-pc-solaris2.8) |
---|
365 | AFS_SYSNAME="sunx86_58" |
---|
366 | ;; |
---|
367 | i386-pc-solaris2.9) |
---|
368 | AFS_SYSNAME="sunx86_59" |
---|
369 | ;; |
---|
370 | alpha*-dec-osf4.0*) |
---|
371 | AFS_SYSNAME="alpha_dux40" |
---|
372 | ;; |
---|
373 | alpha*-dec-osf5.0*) |
---|
374 | AFS_SYSNAME="alpha_dux50" |
---|
375 | ;; |
---|
376 | mips-sgi-irix6.5) |
---|
377 | AFS_SYSNAME="sgi_65" |
---|
378 | ;; |
---|
379 | ia64-*-linux*) |
---|
380 | AFS_SYSNAME="ia64_linuxXX" |
---|
381 | ;; |
---|
382 | powerpc-*-linux*) |
---|
383 | AFS_SYSNAME="ppc_linuxXX" |
---|
384 | ;; |
---|
385 | alpha*-linux*) |
---|
386 | AFS_SYSNAME="alpha_linux_XX" |
---|
387 | ;; |
---|
388 | s390-*-linux*) |
---|
389 | AFS_SYSNAME="s390_linuxXX" |
---|
390 | ;; |
---|
391 | sparc-*-linux*) |
---|
392 | AFS_SYSNAME="sparc_linuxXX" |
---|
393 | ;; |
---|
394 | sparc64-*-linux*) |
---|
395 | AFS_SYSNAME="sparc64_linuxXX" |
---|
396 | ;; |
---|
397 | i?86-*-linux*) |
---|
398 | AFS_SYSNAME="i386_linuxXX" |
---|
399 | ;; |
---|
400 | parisc-*-linux-gnu) |
---|
401 | AFS_SYSNAME="parisc_linuxXX" |
---|
402 | ;; |
---|
403 | power*-ibm-aix4.2*) |
---|
404 | AFS_SYSNAME="rs_aix42" |
---|
405 | ;; |
---|
406 | power*-ibm-aix4.3*) |
---|
407 | AFS_SYSNAME="rs_aix42" |
---|
408 | ;; |
---|
409 | *) |
---|
410 | AC_MSG_ERROR(An AFS sysname is required) |
---|
411 | exit 1 |
---|
412 | ;; |
---|
413 | esac |
---|
414 | case $AFS_SYSNAME in |
---|
415 | *_linux*) |
---|
416 | AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'` |
---|
417 | if test "x${AFS_SYSKVERS}" = "x"; then |
---|
418 | AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.) |
---|
419 | fi |
---|
420 | _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` |
---|
421 | AFS_SYSNAME="$_AFS_SYSNAME" |
---|
422 | ;; |
---|
423 | esac |
---|
424 | AC_MSG_RESULT($AFS_SYSNAME) |
---|
425 | fi |
---|
426 | |
---|
427 | case $AFS_SYSNAME in |
---|
428 | *_darwin*) |
---|
429 | DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist |
---|
430 | DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist |
---|
431 | ;; |
---|
432 | esac |
---|
433 | AC_CACHE_VAL(ac_cv_sockaddr_len, |
---|
434 | [ |
---|
435 | AC_MSG_CHECKING([if struct sockaddr has sa_len field]) |
---|
436 | AC_TRY_COMPILE( [#include <sys/types.h> |
---|
437 | #include <sys/socket.h>], |
---|
438 | [struct sockaddr *a; |
---|
439 | a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no) |
---|
440 | AC_MSG_RESULT($ac_cv_sockaddr_len)]) |
---|
441 | if test "$ac_cv_sockaddr_len" = "yes"; then |
---|
442 | AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN, 1, [define if you struct sockaddr sa_len]) |
---|
443 | fi |
---|
444 | if test "x${MKAFS_OSTYPE}" = "xIRIX"; then |
---|
445 | echo Skipping library tests because they confuse Irix. |
---|
446 | else |
---|
447 | AC_CHECK_FUNCS(socket) |
---|
448 | |
---|
449 | if test "$ac_cv_func_socket" = no; then |
---|
450 | for lib in socket inet; do |
---|
451 | if test "$HAVE_SOCKET" != 1; then |
---|
452 | AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET, 1, [define if you have socket])) |
---|
453 | fi |
---|
454 | done |
---|
455 | fi |
---|
456 | |
---|
457 | AC_CHECK_FUNCS(connect) |
---|
458 | |
---|
459 | if test "$ac_cv_func_connect" = no; then |
---|
460 | for lib in nsl; do |
---|
461 | if test "$HAVE_CONNECT" != 1; then |
---|
462 | AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT, 1, [define if you have connect])) |
---|
463 | fi |
---|
464 | done |
---|
465 | fi |
---|
466 | |
---|
467 | AC_CHECK_FUNCS(gethostbyname) |
---|
468 | if test "$ac_cv_func_gethostbyname" = no; then |
---|
469 | for lib in dns nsl resolv; do |
---|
470 | if test "$HAVE_GETHOSTBYNAME" != 1; then |
---|
471 | AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [define if you have gethostbyname])) |
---|
472 | fi |
---|
473 | done |
---|
474 | fi |
---|
475 | |
---|
476 | AC_CHECK_FUNCS(res_search) |
---|
477 | if test "$ac_cv_func_res_search" = no; then |
---|
478 | for lib in dns nsl resolv; do |
---|
479 | if test "$HAVE_RES_SEARCH" != 1; then |
---|
480 | AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH, 1, [define if you have res_search])) |
---|
481 | fi |
---|
482 | done |
---|
483 | if test "$HAVE_RES_SEARCH" = 1; then |
---|
484 | LIB_res_search="-l$lib" |
---|
485 | fi |
---|
486 | fi |
---|
487 | fi |
---|
488 | |
---|
489 | PTHREAD_LIBS=error |
---|
490 | AC_CHECK_LIB(pthread, pthread_attr_init, |
---|
491 | PTHREAD_LIBS="-lpthread") |
---|
492 | if test "x$PTHREAD_LIBS" = xerror; then |
---|
493 | AC_CHECK_LIB(pthreads, pthread_attr_init, |
---|
494 | PTHREAD_LIBS="-lpthreads") |
---|
495 | fi |
---|
496 | if test "x$PTHREAD_LIBS" = xerror; then |
---|
497 | AC_CHECK_LIB(c_r, pthread_attr_init, |
---|
498 | PTHREAD_LIBS="-lc_r") |
---|
499 | fi |
---|
500 | if test "x$PTHREAD_LIBS" = xerror; then |
---|
501 | AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="") |
---|
502 | fi |
---|
503 | if test "x$PTHREAD_LIBS" = xerror; then |
---|
504 | AC_MSG_WARN(*** Unable to locate working posix thread library ***) |
---|
505 | fi |
---|
506 | AC_SUBST(PTHREAD_LIBS) |
---|
507 | |
---|
508 | WITH_OBSOLETE=NO |
---|
509 | if test "$enable_obsolete" = "yes"; then |
---|
510 | WITH_OBSOLETE=YES |
---|
511 | fi |
---|
512 | |
---|
513 | WITH_INSECURE=NO |
---|
514 | if test "$enable_insecure" = "yes"; then |
---|
515 | WITH_INSECURE=YES |
---|
516 | fi |
---|
517 | |
---|
518 | # Fast restart |
---|
519 | if test "$enable_fast_restart" = "yes"; then |
---|
520 | AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart]) |
---|
521 | fi |
---|
522 | |
---|
523 | if test "$enable_bitmap_later" = "yes"; then |
---|
524 | AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later]) |
---|
525 | fi |
---|
526 | |
---|
527 | if test "$enable_full_vos_listvol_switch" = "yes"; then |
---|
528 | AC_DEFINE(FULL_LISTVOL_SWITCH, 1, [define if you want to want listvol switch]) |
---|
529 | fi |
---|
530 | |
---|
531 | if test "$enable_bos_restricted_mode" = "yes"; then |
---|
532 | AC_DEFINE(BOS_RESTRICTED_MODE, 1, [define if you want to want bos restricted mode]) |
---|
533 | fi |
---|
534 | |
---|
535 | if test "$enable_namei_fileserver" = "yes"; then |
---|
536 | AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) |
---|
537 | fi |
---|
538 | |
---|
539 | if test "$enable_afsdb" = "yes"; then |
---|
540 | LIB_AFSDB="$LIB_res_search" |
---|
541 | AC_DEFINE(AFS_AFSDB_ENV, 1, [define if you want to want search afsdb rr]) |
---|
542 | fi |
---|
543 | |
---|
544 | dnl check for tivoli |
---|
545 | AC_MSG_CHECKING(for tivoli tsm butc support) |
---|
546 | XBSA_CFLAGS="" |
---|
547 | if test "$enable_tivoli_tsm" = "yes"; then |
---|
548 | XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen |
---|
549 | XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen |
---|
550 | |
---|
551 | if test -e "$XBSADIR1/xbsa.h"; then |
---|
552 | XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" |
---|
553 | AC_MSG_RESULT([yes, $XBSA_CFLAGS]) |
---|
554 | elif test -e "$XBSADIR2/xbsa.h"; then |
---|
555 | XBSA_CFLAGS="-Dxbsa -I$XBSADIR2" |
---|
556 | AC_MSG_RESULT([yes, $XBSA_CFLAGS]) |
---|
557 | else |
---|
558 | AC_MSG_RESULT([no, missing xbsa.h header file]) |
---|
559 | fi |
---|
560 | else |
---|
561 | AC_MSG_RESULT([no]) |
---|
562 | fi |
---|
563 | AC_SUBST(XBSA_CFLAGS) |
---|
564 | |
---|
565 | dnl checks for header files. |
---|
566 | AC_HEADER_STDC |
---|
567 | AC_HEADER_SYS_WAIT |
---|
568 | AC_HEADER_DIRENT |
---|
569 | AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h) |
---|
570 | AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) |
---|
571 | AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h) |
---|
572 | AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) |
---|
573 | AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h) |
---|
574 | AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h) |
---|
575 | |
---|
576 | AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec) |
---|
577 | AC_CHECK_FUNCS(setprogname getprogname sigaction) |
---|
578 | AC_CHECK_TYPE(ssize_t, int) |
---|
579 | |
---|
580 | AC_CHECK_FUNCS(timegm) |
---|
581 | |
---|
582 | dnl Directory PATH handling |
---|
583 | if test "x$enable_transarc_paths" = "xyes" ; then |
---|
584 | afsconfdir=${afsconfdir=/usr/afs/etc} |
---|
585 | viceetcdir=${viceetcdir=/usr/vice/etc} |
---|
586 | afskerneldir=${afskerneldir=${viceetcdir}} |
---|
587 | afssrvbindir=${afssrvbindir=/usr/afs/bin} |
---|
588 | afssrvsbindir=${afssrvsbindir=/usr/afs/bin} |
---|
589 | afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin} |
---|
590 | afsdbdir=${afsdbdir=/usr/afs/db} |
---|
591 | afslogsdir=${afslogsdir=/usr/afs/logs} |
---|
592 | afslocaldir=${afslocaldir=/usr/afs/local} |
---|
593 | afsbackupdir=${afsbackupdir=/usr/afs/backup} |
---|
594 | afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} |
---|
595 | else |
---|
596 | afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} |
---|
597 | viceetcdir=${viceetcdir='${sysconfdir}/openafs'} |
---|
598 | afskerneldir=${afskerneldir='${libdir}/openafs'} |
---|
599 | afssrvbindir=${afssrvbindir='${bindir}'} |
---|
600 | afssrvsbindir=${afssrvsbindir='${sbindir}'} |
---|
601 | afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'} |
---|
602 | afsdbdir=${afsdbdir='${localstatedir}/openafs/db'} |
---|
603 | afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'} |
---|
604 | afslocaldir=${afslocaldir='${localstatedir}/openafs'} |
---|
605 | afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} |
---|
606 | afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} |
---|
607 | fi |
---|
608 | AC_SUBST(afsconfdir) |
---|
609 | AC_SUBST(viceetcdir) |
---|
610 | AC_SUBST(afskerneldir) |
---|
611 | AC_SUBST(afssrvbindir) |
---|
612 | AC_SUBST(afssrvsbindir) |
---|
613 | AC_SUBST(afssrvlibexecdir) |
---|
614 | AC_SUBST(afsdbdir) |
---|
615 | AC_SUBST(afslogsdir) |
---|
616 | AC_SUBST(afslocaldir) |
---|
617 | AC_SUBST(afsbackupdir) |
---|
618 | AC_SUBST(afsbosconfigdir) |
---|
619 | |
---|
620 | if test "x$enable_kernel_module" = "xyes"; then |
---|
621 | ENABLE_KERNEL_MODULE=libafs |
---|
622 | fi |
---|
623 | |
---|
624 | AC_SUBST(AFS_SYSNAME) |
---|
625 | AC_SUBST(ENABLE_KERNEL_MODULE) |
---|
626 | AC_SUBST(LIB_AFSDB) |
---|
627 | AC_SUBST(LINUX_KERNEL_PATH) |
---|
628 | AC_SUBST(LINUX_VERSION) |
---|
629 | AC_SUBST(MKAFS_OSTYPE) |
---|
630 | AC_SUBST(TOP_SRCDIR) |
---|
631 | AC_SUBST(TOP_INCDIR) |
---|
632 | AC_SUBST(TOP_LIBDIR) |
---|
633 | AC_SUBST(DEST) |
---|
634 | AC_SUBST(WITH_OBSOLETE) |
---|
635 | AC_SUBST(WITH_INSECURE) |
---|
636 | AC_SUBST(DARWIN_INFOFILE) |
---|
637 | AC_SUBST(IRIX_BUILD_IP35) |
---|
638 | |
---|
639 | ]) |
---|
640 | |
---|
641 | |
---|
642 | dnl AM_PROG_LEX |
---|
643 | dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT |
---|
644 | AC_DEFUN(AM_PROG_LEX, |
---|
645 | [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) |
---|
646 | AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") |
---|
647 | AC_PROG_LEX |
---|
648 | AC_DECL_YYTEXT]) |
---|
649 | |
---|
650 | dnl |
---|
651 | dnl $Id: aclocal.m4,v 1.3 2002-12-13 22:06:41 zacheiss Exp $ |
---|
652 | dnl |
---|
653 | |
---|
654 | dnl check if this computer is little or big-endian |
---|
655 | dnl if we can figure it out at compile-time then don't define the cpp symbol |
---|
656 | dnl otherwise test for it and define it. also allow options for overriding |
---|
657 | dnl it when cross-compiling |
---|
658 | |
---|
659 | AC_DEFUN(OPENAFS_CHECK_BIGENDIAN, [ |
---|
660 | AC_ARG_ENABLE(bigendian, |
---|
661 | [ --enable-bigendian the target is big endian], |
---|
662 | openafs_cv_c_bigendian=yes) |
---|
663 | AC_ARG_ENABLE(littleendian, |
---|
664 | [ --enable-littleendian the target is little endian], |
---|
665 | openafs_cv_c_bigendian=no) |
---|
666 | AC_CACHE_CHECK(whether byte order is known at compile time, |
---|
667 | openafs_cv_c_bigendian_compile, |
---|
668 | [AC_TRY_COMPILE([ |
---|
669 | #include <sys/types.h> |
---|
670 | #include <sys/param.h>],[ |
---|
671 | #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN |
---|
672 | bogus endian macros |
---|
673 | #endif], openafs_cv_c_bigendian_compile=yes, openafs_cv_c_bigendian_compile=no)]) |
---|
674 | AC_CACHE_CHECK(whether byte ordering is bigendian, openafs_cv_c_bigendian,[ |
---|
675 | if test "$openafs_cv_c_bigendian_compile" = "yes"; then |
---|
676 | AC_TRY_COMPILE([ |
---|
677 | #include <sys/types.h> |
---|
678 | #include <sys/param.h>],[ |
---|
679 | #if BYTE_ORDER != BIG_ENDIAN |
---|
680 | not big endian |
---|
681 | #endif], openafs_cv_c_bigendian=yes, openafs_cv_c_bigendian=no) |
---|
682 | else |
---|
683 | AC_TRY_RUN([main () { |
---|
684 | /* Are we little or big endian? From Harbison&Steele. */ |
---|
685 | union |
---|
686 | { |
---|
687 | long l; |
---|
688 | char c[sizeof (long)]; |
---|
689 | } u; |
---|
690 | u.l = 1; |
---|
691 | exit (u.c[sizeof (long) - 1] == 1); |
---|
692 | }], openafs_cv_c_bigendian=no, openafs_cv_c_bigendian=yes, |
---|
693 | AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])) |
---|
694 | fi |
---|
695 | ]) |
---|
696 | if test "$openafs_cv_c_bigendian" = "yes"; then |
---|
697 | AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl |
---|
698 | fi |
---|
699 | if test "$openafs_cv_c_bigendian_compile" = "yes"; then |
---|
700 | AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl |
---|
701 | fi |
---|
702 | ]) |
---|
703 | |
---|
704 | |
---|
705 | AC_DEFUN(OPENAFS_GCC_SUPPORTS_MARCH, [ |
---|
706 | AC_MSG_CHECKING(if $CC accepts -march=pentium) |
---|
707 | save_CFLAGS="$CFLAGS" |
---|
708 | CFLAGS="-MARCH=pentium" |
---|
709 | AC_CACHE_VAL(openafs_gcc_supports_march,[ |
---|
710 | AC_TRY_COMPILE( |
---|
711 | [], |
---|
712 | [int x;], |
---|
713 | openafs_gcc_supports_march=yes, |
---|
714 | openafs_gcc_supports_march=no)]) |
---|
715 | AC_MSG_RESULT($openafs_gcc_supports_march) |
---|
716 | if test x$openafs_gcc_supports_march = xyes; then |
---|
717 | P5PLUS_KOPTS="-march=pentium" |
---|
718 | else |
---|
719 | P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2" |
---|
720 | fi |
---|
721 | CFLAGS="$save_CFLAGS" |
---|
722 | ]) |
---|
723 | |
---|
724 | AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING, [ |
---|
725 | AC_MSG_CHECKING(if $CC needs -fno-strict-aliasing) |
---|
726 | save_CFLAGS="$CFLAGS" |
---|
727 | CFLAGS="-fno-strict-aliasing" |
---|
728 | AC_CACHE_VAL(openafs_gcc_needs_no_strict_aliasing,[ |
---|
729 | AC_TRY_COMPILE( |
---|
730 | [], |
---|
731 | [int x;], |
---|
732 | openafs_gcc_needs_no_strict_aliasing=yes, |
---|
733 | openafs_gcc_needs_no_strict_aliasing=no)]) |
---|
734 | AC_MSG_RESULT($openafs_gcc_needs_no_strict_aliasing) |
---|
735 | if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then |
---|
736 | LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing" |
---|
737 | fi |
---|
738 | CFLAGS="$save_CFLAGS" |
---|
739 | ]) |
---|
740 | |
---|
741 | AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE, [ |
---|
742 | AC_MSG_CHECKING(if $CC needs -fno-strength-reduce) |
---|
743 | save_CFLAGS="$CFLAGS" |
---|
744 | CFLAGS="-fno-strength-reduce" |
---|
745 | AC_CACHE_VAL(openafs_gcc_needs_no_strength_reduce,[ |
---|
746 | AC_TRY_COMPILE( |
---|
747 | [], |
---|
748 | [int x;], |
---|
749 | openafs_gcc_needs_no_strength_reduce=yes, |
---|
750 | openafs_gcc_needs_no_strength_reduce=no)]) |
---|
751 | AC_MSG_RESULT($openafs_gcc_needs_no_strength_reduce) |
---|
752 | if test x$openafs_gcc_needs_no_strength_reduce = xyes; then |
---|
753 | LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce" |
---|
754 | fi |
---|
755 | CFLAGS="$save_CFLAGS" |
---|
756 | ]) |
---|
757 | |
---|
758 | AC_DEFUN(OPENAFS_GCC_SUPPORTS_NO_COMMON, [ |
---|
759 | AC_MSG_CHECKING(if $CC supports -fno-common) |
---|
760 | save_CFLAGS="$CFLAGS" |
---|
761 | CFLAGS="-fno-common" |
---|
762 | AC_CACHE_VAL(openafs_gcc_supports_no_common,[ |
---|
763 | AC_TRY_COMPILE( |
---|
764 | [], |
---|
765 | [int x;], |
---|
766 | openafs_gcc_supports_no_common=yes, |
---|
767 | openafs_gcc_supports_no_common=no)]) |
---|
768 | AC_MSG_RESULT($openafs_gcc_supports_no_common) |
---|
769 | if test x$openafs_gcc_supports_no_common = xyes; then |
---|
770 | LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common" |
---|
771 | fi |
---|
772 | CFLAGS="$save_CFLAGS" |
---|
773 | ]) |
---|
774 | |
---|
775 | |
---|
776 | AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [ |
---|
777 | AC_MSG_CHECKING(for gfp_mask in struct address_space) |
---|
778 | save_CPPFLAGS="$CPPFLAGS" |
---|
779 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
780 | AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, |
---|
781 | [ |
---|
782 | AC_TRY_COMPILE( |
---|
783 | [#include <linux/fs.h>], |
---|
784 | [struct address_space _a; |
---|
785 | printf("%d\n", _a.gfp_mask);], |
---|
786 | ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes, |
---|
787 | ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)]) |
---|
788 | AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask) |
---|
789 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
790 | |
---|
791 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [ |
---|
792 | AC_MSG_CHECKING(for i_bytes in struct inode) |
---|
793 | save_CPPFLAGS="$CPPFLAGS" |
---|
794 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
795 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, |
---|
796 | [ |
---|
797 | AC_TRY_COMPILE( |
---|
798 | [#include <linux/fs.h>], |
---|
799 | [struct inode _inode; |
---|
800 | printf("%d\n", _inode.i_bytes);], |
---|
801 | ac_cv_linux_fs_struct_inode_has_i_bytes=yes, |
---|
802 | ac_cv_linux_fs_struct_inode_has_i_bytes=no)]) |
---|
803 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes) |
---|
804 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
805 | |
---|
806 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [ |
---|
807 | AC_MSG_CHECKING(for i_truncate_sem in struct inode) |
---|
808 | save_CPPFLAGS="$CPPFLAGS" |
---|
809 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
810 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem, |
---|
811 | [ |
---|
812 | AC_TRY_COMPILE( |
---|
813 | [#include <linux/fs.h>], |
---|
814 | [struct inode _i; |
---|
815 | printf("%x\n", _i.i_truncate_sem);], |
---|
816 | ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes, |
---|
817 | ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)]) |
---|
818 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem) |
---|
819 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
820 | |
---|
821 | AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [ |
---|
822 | AC_MSG_CHECKING(for page_lock in struct address_space) |
---|
823 | save_CPPFLAGS="$CPPFLAGS" |
---|
824 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
825 | AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, |
---|
826 | [ |
---|
827 | AC_TRY_COMPILE( |
---|
828 | [#include <linux/fs.h>], |
---|
829 | [struct address_space _a_s; |
---|
830 | printf("%x\n", _a_s.page_lock);], |
---|
831 | ac_cv_linux_fs_struct_address_space_has_page_lock=yes, |
---|
832 | ac_cv_linux_fs_struct_address_space_has_page_lock=no)]) |
---|
833 | AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock) |
---|
834 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
835 | |
---|
836 | |
---|
837 | dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir) |
---|
838 | dnl defaults: (src/config, src/afs/LINUX) |
---|
839 | |
---|
840 | AC_DEFUN(LINUX_BUILD_VNODE_FROM_INODE, [ |
---|
841 | AC_MSG_CHECKING(whether to build osi_vfs.h) |
---|
842 | configdir=ifelse([$1], ,src/config,$1) |
---|
843 | outputdir=ifelse([$2], ,src/afs/LINUX,$2) |
---|
844 | chmod +x $configdir/make_vnode.pl |
---|
845 | $configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -o $outputdir |
---|
846 | ]) |
---|
847 | |
---|
848 | AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [ |
---|
849 | AC_MSG_CHECKING(for exported tasklist_lock) |
---|
850 | save_CPPFLAGS="$CPPFLAGS" |
---|
851 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
852 | AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock, |
---|
853 | [ |
---|
854 | AC_TRY_COMPILE( |
---|
855 | [#include <linux/modversions.h>], |
---|
856 | [#ifndef __ver_tasklist_lock |
---|
857 | #error tasklist_lock not exported |
---|
858 | #endif], |
---|
859 | ac_cv_linux_exports_tasklist_lock=yes, |
---|
860 | ac_cv_linux_exports_tasklist_lock=no)]) |
---|
861 | AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock) |
---|
862 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
863 | |
---|
864 | AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [ |
---|
865 | AC_MSG_CHECKING(for exported sys_call_table) |
---|
866 | save_CPPFLAGS="$CPPFLAGS" |
---|
867 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
868 | AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table, |
---|
869 | [ |
---|
870 | AC_TRY_COMPILE( |
---|
871 | [#include <linux/modversions.h>], |
---|
872 | [#ifndef __ver_sys_call_table |
---|
873 | #error sys_call_table not exported |
---|
874 | #endif], |
---|
875 | ac_cv_linux_exports_sys_call_table=yes, |
---|
876 | ac_cv_linux_exports_sys_call_table=no)]) |
---|
877 | AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table) |
---|
878 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
879 | |
---|
880 | AC_DEFUN(LINUX_EXPORTS_INIT_MM, [ |
---|
881 | AC_MSG_CHECKING(for exported init_mm) |
---|
882 | save_CPPFLAGS="$CPPFLAGS" |
---|
883 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
884 | AC_CACHE_VAL(ac_cv_linux_exports_init_mm, |
---|
885 | [ |
---|
886 | AC_TRY_COMPILE( |
---|
887 | [#include <linux/modversions.h>], |
---|
888 | [#ifndef __ver_init_mm |
---|
889 | #error init_mm not exported |
---|
890 | #endif], |
---|
891 | ac_cv_linux_exports_init_mm=yes, |
---|
892 | ac_cv_linux_exports_init_mm=no)]) |
---|
893 | AC_MSG_RESULT($ac_cv_linux_exports_init_mm) |
---|
894 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
895 | |
---|
896 | AC_DEFUN(LINUX_EXPORTS_KALLSYMS_SYMBOL, [ |
---|
897 | AC_MSG_CHECKING(for exported kallsyms_symbol_to_address) |
---|
898 | save_CPPFLAGS="$CPPFLAGS" |
---|
899 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
900 | AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol, |
---|
901 | [ |
---|
902 | AC_TRY_COMPILE( |
---|
903 | [#include <linux/modversions.h>], |
---|
904 | [#ifndef __ver_kallsyms_symbol_to_address |
---|
905 | #error kallsyms_symbol_to_address not exported |
---|
906 | #endif], |
---|
907 | ac_cv_linux_exports_kallsyms_symbol=yes, |
---|
908 | ac_cv_linux_exports_kallsyms_symbol=no)]) |
---|
909 | AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol) |
---|
910 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
911 | |
---|
912 | AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [ |
---|
913 | AC_MSG_CHECKING(for exported kallsyms_address_to_symbol) |
---|
914 | save_CPPFLAGS="$CPPFLAGS" |
---|
915 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
916 | AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address, |
---|
917 | [ |
---|
918 | AC_TRY_COMPILE( |
---|
919 | [#include <linux/modversions.h>], |
---|
920 | [#ifndef __ver_kallsyms_address_to_symbol |
---|
921 | #error kallsyms_address_to_symbol not exported |
---|
922 | #endif], |
---|
923 | ac_cv_linux_exports_kallsyms_address=yes, |
---|
924 | ac_cv_linux_exports_kallsyms_address=no)]) |
---|
925 | AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address) |
---|
926 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
927 | |
---|
928 | AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [ |
---|
929 | AC_MSG_CHECKING(for linux/completion.h existance) |
---|
930 | save_CPPFLAGS="$CPPFLAGS" |
---|
931 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
932 | AC_CACHE_VAL(ac_cv_linux_completion_h_exists, |
---|
933 | [ |
---|
934 | AC_TRY_COMPILE( |
---|
935 | [#include <linux/completion.h> |
---|
936 | #include <linux/version.h>], |
---|
937 | [struct completion _c; |
---|
938 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8) |
---|
939 | lose |
---|
940 | #endif |
---|
941 | ], |
---|
942 | ac_cv_linux_completion_h_exists=yes, |
---|
943 | ac_cv_linux_completion_h_exists=no)]) |
---|
944 | AC_MSG_RESULT($ac_cv_linux_completion_h_exists) |
---|
945 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
946 | |
---|
947 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [ |
---|
948 | AC_MSG_CHECKING(for i_mmap_shared in struct inode) |
---|
949 | save_CPPFLAGS="$CPPFLAGS" |
---|
950 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
951 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared, |
---|
952 | [ |
---|
953 | AC_TRY_COMPILE( |
---|
954 | [#include <linux/fs.h>], |
---|
955 | [struct inode _inode; |
---|
956 | printf("%d\n", _inode.i_mmap_shared);], |
---|
957 | ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes, |
---|
958 | ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)]) |
---|
959 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared) |
---|
960 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
961 | |
---|
962 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [ |
---|
963 | AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode) |
---|
964 | save_CPPFLAGS="$CPPFLAGS" |
---|
965 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
966 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, |
---|
967 | [ |
---|
968 | AC_TRY_COMPILE( |
---|
969 | [#include <linux/fs.h>], |
---|
970 | [struct inode _inode; |
---|
971 | printf("%d\n", _inode.i_dirty_data_buffers);], |
---|
972 | ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes, |
---|
973 | ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)]) |
---|
974 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers) |
---|
975 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
976 | |
---|
977 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [ |
---|
978 | AC_MSG_CHECKING(for i_mapping_overload in struct inode) |
---|
979 | save_CPPFLAGS="$CPPFLAGS" |
---|
980 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
981 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, |
---|
982 | [ |
---|
983 | AC_TRY_COMPILE( |
---|
984 | [#include <linux/fs.h>], |
---|
985 | [struct inode _inode; |
---|
986 | printf("%d\n", _inode.i_mapping_overload);], |
---|
987 | ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes, |
---|
988 | ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)]) |
---|
989 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload) |
---|
990 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
991 | |
---|
992 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [ |
---|
993 | AC_MSG_CHECKING(for i_cdev in struct inode) |
---|
994 | save_CPPFLAGS="$CPPFLAGS" |
---|
995 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
996 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, |
---|
997 | [ |
---|
998 | AC_TRY_COMPILE( |
---|
999 | [#include <linux/fs.h>], |
---|
1000 | [struct inode _inode; |
---|
1001 | printf("%d\n", _inode.i_cdev);], |
---|
1002 | ac_cv_linux_fs_struct_inode_has_i_cdev=yes, |
---|
1003 | ac_cv_linux_fs_struct_inode_has_i_cdev=no)]) |
---|
1004 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev) |
---|
1005 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
1006 | |
---|
1007 | AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [ |
---|
1008 | AC_MSG_CHECKING(for i_devices in struct inode) |
---|
1009 | save_CPPFLAGS="$CPPFLAGS" |
---|
1010 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
1011 | AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, |
---|
1012 | [ |
---|
1013 | AC_TRY_COMPILE( |
---|
1014 | [#include <linux/fs.h>], |
---|
1015 | [struct inode _inode; |
---|
1016 | printf("%d\n", _inode.i_devices);], |
---|
1017 | ac_cv_linux_fs_struct_inode_has_i_devices=yes, |
---|
1018 | ac_cv_linux_fs_struct_inode_has_i_devices=no)]) |
---|
1019 | AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices) |
---|
1020 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
1021 | |
---|
1022 | |
---|
1023 | AC_DEFUN(LINUX_INODE_SETATTR_RETURN_TYPE,[ |
---|
1024 | AC_MSG_CHECKING(for inode_setattr return type) |
---|
1025 | save_CPPFLAGS="$CPPFLAGS" |
---|
1026 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" |
---|
1027 | AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int, |
---|
1028 | [ |
---|
1029 | AC_TRY_COMPILE( |
---|
1030 | [#include <linux/fs.h>], |
---|
1031 | [struct inode _inode; |
---|
1032 | struct iattr _iattr; |
---|
1033 | int i; |
---|
1034 | i = inode_setattr(&_inode, &_iattr);], |
---|
1035 | ac_cv_linux_func_inode_setattr_returns_int=yes, |
---|
1036 | ac_cv_linux_func_inode_setattr_returns_int=no)]) |
---|
1037 | AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int) |
---|
1038 | CPPFLAGS="$save_CPPFLAGS"]) |
---|
1039 | |
---|
1040 | AC_DEFUN(LINUX_NEED_RHCONFIG,[ |
---|
1041 | RHCONFIG_SP="" |
---|
1042 | RHCONFIG_MP="" |
---|
1043 | if test "x$enable_redhat_buildsys" = "xyes"; then |
---|
1044 | AC_MSG_WARN(Configured to build from a Red Hat SPEC file) |
---|
1045 | else |
---|
1046 | AC_MSG_CHECKING(for redhat kernel configuration) |
---|
1047 | if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then |
---|
1048 | ac_linux_rhconfig=yes |
---|
1049 | RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" |
---|
1050 | RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" |
---|
1051 | AC_MSG_RESULT($ac_linux_rhconfig) |
---|
1052 | if test ! -f "/boot/kernel.h"; then |
---|
1053 | AC_MSG_WARN([/boot/kernel.h does not exist. build may fail]) |
---|
1054 | fi |
---|
1055 | else |
---|
1056 | ac_linux_rhconfig=no |
---|
1057 | AC_MSG_RESULT($ac_linux_rhconfig) |
---|
1058 | fi |
---|
1059 | fi |
---|
1060 | AC_SUBST(RHCONFIG_SP) |
---|
1061 | AC_SUBST(RHCONFIG_MP) |
---|
1062 | ]) |
---|
1063 | |
---|
1064 | AC_DEFUN(LINUX_WHICH_MODULES,[ |
---|
1065 | if test "x$enable_redhat_buildsys" = "xyes"; then |
---|
1066 | MPS=Default |
---|
1067 | else |
---|
1068 | save_CPPFLAGS="$CPPFLAGS" |
---|
1069 | CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" |
---|
1070 | AC_MSG_CHECKING(if kernel uses MODVERSIONS) |
---|
1071 | AC_CACHE_VAL(ac_cv_linux_config_modversions,[ |
---|
1072 | AC_TRY_COMPILE( |
---|
1073 | [#include <linux/config.h> |
---|
1074 | ], |
---|
1075 | [#ifndef CONFIG_MODVERSIONS |
---|
1076 | lose; |
---|
1077 | #endif |
---|
1078 | ], |
---|
1079 | ac_cv_linux_config_modversions=yes, |
---|
1080 | ac_cv_linux_config_modversions=no)]) |
---|
1081 | AC_MSG_RESULT($ac_cv_linux_config_modversions) |
---|
1082 | AC_MSG_CHECKING(which kernel modules to build) |
---|
1083 | if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then |
---|
1084 | MPS="MP SP" |
---|
1085 | else |
---|
1086 | AC_CACHE_VAL(ac_cv_linux_config_smp, [ |
---|
1087 | AC_TRY_COMPILE( |
---|
1088 | [#include <linux/config.h> |
---|
1089 | ], |
---|
1090 | [#ifndef CONFIG_SMP |
---|
1091 | lose; |
---|
1092 | #endif |
---|
1093 | ], |
---|
1094 | ac_cv_linux_config_smp=yes, |
---|
1095 | ac_cv_linux_config_smp=no)]) |
---|
1096 | dnl AC_MSG_RESULT($ac_cv_linux_config_smp) |
---|
1097 | if test "x$ac_cv_linux_config_smp" = "xyes"; then |
---|
1098 | MPS=MP |
---|
1099 | else |
---|
1100 | MPS=SP |
---|
1101 | fi |
---|
1102 | fi |
---|
1103 | CPPFLAGS=$save_CPPFLAGS |
---|
1104 | AC_MSG_RESULT($MPS) |
---|
1105 | fi |
---|
1106 | AC_SUBST(MPS) |
---|
1107 | ]) |
---|
1108 | |
---|
1109 | |
---|
1110 | AC_DEFUN(SOLARIS_UFSVFS_HAS_DQRWLOCK, [ |
---|
1111 | AC_MSG_CHECKING(for vfs_dqrwlock in struct ufsvfs) |
---|
1112 | AC_CACHE_VAL(ac_cv_solaris_ufsvfs_has_dqrwlock, |
---|
1113 | [ |
---|
1114 | AC_TRY_COMPILE( |
---|
1115 | [#define _KERNEL |
---|
1116 | #include <sys/fs/ufs_inode.h>], |
---|
1117 | [struct ufsvfs _ufsvfs; |
---|
1118 | (void) _ufsvfs.vfs_dqrwlock;], |
---|
1119 | ac_cv_solaris_ufsvfs_has_dqrwlock=yes, |
---|
1120 | ac_cv_solaris_ufsvfs_has_dqrwlock=no)]) |
---|
1121 | AC_MSG_RESULT($ac_cv_solaris_ufsvfs_has_dqrwlock) |
---|
1122 | if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then |
---|
1123 | AC_DEFINE(HAVE_VFS_DQRWLOCK, 1, [define if struct ufsvfs has vfs_dqrwlock]) |
---|
1124 | fi |
---|
1125 | ]) |
---|
1126 | |
---|
1127 | |
---|
1128 | AC_DEFUN(SOLARIS_PROC_HAS_P_COREFILE, [ |
---|
1129 | AC_MSG_CHECKING(for p_corefile in struct proc) |
---|
1130 | AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile, |
---|
1131 | [ |
---|
1132 | AC_TRY_COMPILE( |
---|
1133 | [#define _KERNEL |
---|
1134 | #include <sys/proc.h>], |
---|
1135 | [struct proc _proc; |
---|
1136 | (void) _proc.p_corefile;], |
---|
1137 | ac_cv_solaris_proc_has_p_corefile=yes, |
---|
1138 | ac_cv_solaris_proc_has_p_corefile=no)]) |
---|
1139 | AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile) |
---|
1140 | if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then |
---|
1141 | AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile]) |
---|
1142 | fi |
---|
1143 | ]) |
---|
1144 | |
---|
1145 | |
---|
1146 | # Do all the work for Automake. This macro actually does too much -- |
---|
1147 | # some checks are only needed if your package does certain things. |
---|
1148 | # But this isn't really a big deal. |
---|
1149 | |
---|
1150 | # serial 1 |
---|
1151 | |
---|
1152 | dnl Usage: |
---|
1153 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
1154 | |
---|
1155 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
1156 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
1157 | PACKAGE=[$1] |
---|
1158 | AC_SUBST(PACKAGE) |
---|
1159 | VERSION=[$2] |
---|
1160 | AC_SUBST(VERSION) |
---|
1161 | dnl test to see if srcdir already configured |
---|
1162 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
1163 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
1164 | fi |
---|
1165 | ifelse([$3],, |
---|
1166 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
1167 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
1168 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
1169 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
1170 | dnl FIXME This is truly gross. |
---|
1171 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
1172 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
1173 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
1174 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
1175 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
1176 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
1177 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
1178 | |
---|
1179 | # |
---|
1180 | # Check to make sure that the build environment is sane. |
---|
1181 | # |
---|
1182 | |
---|
1183 | AC_DEFUN(AM_SANITY_CHECK, |
---|
1184 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
1185 | # Just in case |
---|
1186 | sleep 1 |
---|
1187 | echo timestamp > conftestfile |
---|
1188 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
1189 | # arguments. Must try -L first in case configure is actually a |
---|
1190 | # symlink; some systems play weird games with the mod time of symlinks |
---|
1191 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
1192 | # directory). |
---|
1193 | if ( |
---|
1194 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
1195 | if test "[$]*" = "X"; then |
---|
1196 | # -L didn't work. |
---|
1197 | set X `ls -t $srcdir/configure conftestfile` |
---|
1198 | fi |
---|
1199 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
1200 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
1201 | |
---|
1202 | # If neither matched, then we have a broken ls. This can happen |
---|
1203 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
1204 | # broken ls alias from the environment. This has actually |
---|
1205 | # happened. Such a system could not be considered "sane". |
---|
1206 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
1207 | alias in your environment]) |
---|
1208 | fi |
---|
1209 | |
---|
1210 | test "[$]2" = conftestfile |
---|
1211 | ) |
---|
1212 | then |
---|
1213 | # Ok. |
---|
1214 | : |
---|
1215 | else |
---|
1216 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
1217 | Check your system clock]) |
---|
1218 | fi |
---|
1219 | rm -f conftest* |
---|
1220 | AC_MSG_RESULT(yes)]) |
---|
1221 | |
---|
1222 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
1223 | dnl The program must properly implement --version. |
---|
1224 | AC_DEFUN(AM_MISSING_PROG, |
---|
1225 | [AC_MSG_CHECKING(for working $2) |
---|
1226 | # Run test in a subshell; some versions of sh will print an error if |
---|
1227 | # an executable is not found, even if stderr is redirected. |
---|
1228 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
1229 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
1230 | $1=$2 |
---|
1231 | AC_MSG_RESULT(found) |
---|
1232 | else |
---|
1233 | $1="$3/missing $2" |
---|
1234 | AC_MSG_RESULT(missing) |
---|
1235 | fi |
---|
1236 | AC_SUBST($1)]) |
---|
1237 | |
---|