source: trunk/third/openafs/aclocal.m4 @ 19059

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