steps to support modern FreeBSD. After Robert Watson <rwatson@FreeBSD.org> and Alec...
[arla.git] / configure.in
blob5582b30f37771c174ca5d96e1a79b10d05c70e17
1 AC_REVISION($Revision$)dnl
2 AC_PREREQ(2.59)
3 AC_INIT(arla, 0.91pre, [arla-drinkers@stacken.kth.se])
4 arla_CANONICAL
5 arla_OPENSSL_COMPAT
6 AM_INIT_AUTOMAKE([foreign no-dependencies 1.9])
7 AM_MAINTAINER_MODE
8 AM_CONFIG_HEADER(include/config.h)
9 AC_CONFIG_SRCDIR([arlad/arla.c])
11 dnl
12 dnl definitions
13 dnl
15 CFLAGS="-g ${CFLAGS}"
17 if test "$AS" = ""; then
18   AS=as
20 AC_SUBST(AS)dnl
22 AC_PROG_CC
23 AC_PROG_CC_FLAGS
24 AC_PROG_CPP
26 # This may be overridden using --prefix=/usr to configure
27 AC_PREFIX_DEFAULT(/usr/arla)
29 CANONICAL_HOST=$host
30 AC_SUBST(CANONICAL_HOST)
32 dnl
33 dnl this is needed to run the configure tests against glibc
34 dnl
35 AC_DEFINE([_GNU_SOURCE], 1,
36         [Define to enable extensions on glibc-based systems such as Linux.])
38 AC_OBJEXT
39 AC_EXEEXT
41 AM_PROG_LEX
42 AC_PROG_MAKE_SET
43 AC_PROG_INSTALL
44 AC_PROG_LN_S
45 AC_PROG_YACC
46 dnl remove ifdef when we use 2.54
47 m4_ifdef([AC_PROG_EGREP], [AC_PROG_EGREP],)
49 AC_CHECK_PROGS(SYMORDER, symorder, :)
50 AC_CHECK_PROGS(MAKEINFO, makeinfo, :)
51 AC_CHECK_PROGS(DVI2PS, dvi2ps, :)
52 AC_CHECK_PROGS(TEXI2DVI, texi2dvi, :)
53 AC_CHECK_PROGS(TEXI2PDF, texi2pdf, :)
54 AC_CHECK_PROGS(TEXI2HTML, texi2html, :)
55 AC_CHECK_PROGS(DVIPS, dvips, :)
56 AC_CHECK_PROGS(chmod, chmod, :)
57 AC_PATH_PROGS(GUILE_GTK, guile-gtk, /bin/false)
59 case $target_os in
60     linux*)
61         force_large_file=yes ;;
62     *)
63         force_large_file=no ;;
64 esac
66 if test "${force_large_file}" = "yes" ; then
67     AC_DEFINE(_LARGEFILE_SOURCE, 1,
68         [Define if you have largefile support])
69     AC_DEFINE(_LARGEFILE64_SOURCE, 1,
70         [Define if you have largefile support])
71     AC_DEFINE(_FILE_OFFSET_BITS, 64,
72         [Define how big file offset is in your OS. 32/64 are valid values.])
76 dnl 
77 dnl See if there is any X11 present
78 dnl
79 KRB_CHECK_X
80 AM_CONDITIONAL(X11, test X"$no_x" != X"yes")
82 AC_FUNC_NTOHL
84 AC_ARG_ENABLE(smp,
85 [  --enable-smp            compile for SMP (for Linux, FreeBSD, and NetBSD)],
86 [if test "$enableval" = "yes"; then
87   smp="-DSMP -DCONFIG_SMP"
88 else
89   smp="no"
93 AC_ARG_ENABLE(kld,
94 [  --enable-kld            build kld modules (only FreeBSD 3.0)],
95 [if test "$enableval" = "yes"; then
96   kld="yes"
97 else
98   kld="no"
102 # what kind of lwp
104 LWP_PROCESS="process.o"
105 LWP_C="lwp_asm.c"
106 LWP_O="lwp_asm.o"
107 LWP_H="lwp_asm.h"
108 PLWP_LIB_FLAGS=""
109 PLWP_INC_FLAGS=""
111 AC_ARG_WITH(pthreads,
112 [  --with-pthreads=dir       compile liblwp as pthreads wrapper using pthreads in dir],
113 [if test "$with_pthreads" = "windows"; then
114   with_pthreads=win
115 elif test "$with_pthreads" != "no"; then
116   LWP_PROCESS=""
117   LWP_C="plwp.c"
118   LWP_O="plwp.o"
119   LWP_H="plwp.h"
120   PLWP_INC_FLAGS="-DPTHREADS_LWP"
121   if test "$with_pthreads" != "yes"; then
122     AC_FIND_FUNC_NO_LIBS(pthread_create, pthread,,,[-L${with_pthreads}/lib])
123     PLWP_LIB_FLAGS="-L${with_pthreads}/lib $LIB_pthread_create"
124     PLWP_INC_FLAGS="-I${with_pthreads}/include -DPTHREADS_LWP"
125   else
126     AC_FIND_FUNC_NO_LIBS(pthread_create, pthread)
127     PLWP_LIB_FLAGS="$LIB_pthread_create"
128     PLWP_INC_FLAGS="-DPTHREADS_LWP"
129   fi
130   AC_FIND_FUNC_NO_LIBS(sched_yield, pthread,,,[${PLWP_LIB_FLAGS}])
131 fi],[with_pthreads=no])
133 # where the source tree is located
135 case "$target_os" in
136     linux*)
137     if test -d /lib/modules/`uname -r`/build; then
138         default_sys=/lib/modules/`uname -r`/build
139     else
140         default_sys=/usr/src/linux
141     fi
142     ;;
143     *)
144     default_sys=${SYSDIR:-/usr/src/sys}
145     ;;
146 esac
148 AC_ARG_WITH(sys,
149 [  --with-sys=dir          use dir as your kernel source code directory
150                           default $default_sys],
151 [SYS=$withval],
152 [SYS="$default_sys"])
153 AC_SUBST(SYS)
155 AC_ARG_WITH(kernel-obj,
156 [  --with-kernel-obj=dir   use dir as your kernel build directory (used on
157                           FreeBSD to find your actual kernel parameters)],
158 [FBSDKERNBUILDDIR=KERNBUILDDIR\=$withval],
160 AC_SUBST(FBSDKERNBUILDDIR)
162 AC_ARG_WITH(bsd-make,
163 [  --with-bsd-make=prog    when using a bsd and cross compiling we need 
164                           to know your make, default /usr/bin/make],
165 [BSDMAKE=$withval],
166 [BSDMAKE="/usr/bin/make"])
167 AC_SUBST(BSDMAKE)
170 nnpfs_target="$target_os"
171 AC_ARG_ENABLE(nnpfs,
172 [  --disable-nnpfs         build arla w/o nnpfs],
173 [if test "$enableval" = "no" ; then
174   nnpfs_target="without_nnpfs";
175 fi])
177 AC_MSG_CHECKING(for kernel stuff)
178 case "$nnpfs_target" in
179 sunos4.1*) 
180   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/sunos
181   KERNEL_SRCS='sunos-subr.c'
182   KERNEL_HDRS=''
183   NNPFS_SUBDIR=sunos
184   KERNEL=/vmunix
185   AC_MSG_RESULT(SunOS 4.1.x)
186   ;;
187 solaris*)
188   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/solaris
189   KERNEL_SRCS='solaris-subr.c'
190   KERNEL_HDRS=''
191   NNPFS_SUBDIR=solaris
192   KERNEL=/dev/ksyms
193   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_KERNEL"
194   AC_MSG_RESULT(Solaris)
195   case "$target_cpu" in
196   sparc64) AC_DEFINE(NEED_VICEIOCTL32, 1,
197         [define if you need 32 bit compat pioctl])
198            KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_SYSCALL32 -D_SYSCALL32_IMPL"
199            ;;
200   esac
201   ;;
202 irix*)
203   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/irix
204   KERNEL_SRCS='irix-subr.c'
205   KERNEL_HDRS=''
206   ip=`hinv -c processor | awk '$4 ~ /IP/ { print $4}'`
207   cpu=`hinv -t cpu | awk '{print $3}'`
208   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D$ip -D$cpu -DR4000"
209   NNPFS_SUBDIR=irix
210   KERNEL=/unix
211   case "$target_os" in
212   irix6.[[4-9]])
213     AC_DEFINE(IRIX_64, 1, [define this if on Irix6.4 or higher]) ;;
214   esac
215   AC_MSG_RESULT(Irix)
216   ;;
217 hpux*)
218   KERNEL_SRCS='hpux-subr.c'
219   AC_MSG_RESULT(hp-ux)
220   KERNEL=/hp-ux
221   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
222   AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff)
223   ;;
224 aix*)
225   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/aix
226   KERNEL_SRCS='aix-subr.c'
227   KERNEL_HDRS=''
228   NNPFS_SUBDIR=aix
229   AC_MSG_RESULT(AIX)
230   ;;  
231 openbsd*)
232   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
233   KERNEL_SRCS='bsd-subr.c'
234   KERNEL_HDRS=''
235   AC_WERROR(BSD_WERROR)
236   MODULE=nnpfs_mod.o
237   cat > conftest.mk << END
238 .include <bsd.lkm.mk>
239 .if defined(UVM) && (\${UVM} != "no")
240 CFLAGS+=-DUVM
241 .endif
242 .if PMAP_NEW
243 CFLAGS+=-DPMAP_NEW
244 .endif
245 echo:
246         @echo \$(CFLAGS) \$(CPPFLAGS)
248   ac_out=`$BSDMAKE S=$SYS -f conftest.mk echo 2> /dev/null`
249   incl=-I$SYS
250   defs= flags=
251   for i in $ac_out; do
252         case "$i" in
253                 -I*)    if test "$i" != -I. -a "$i" != "-I`pwd`"; then
254                                 incl="$incl${incl:+ }$i"
255                         fi
256                         ;;
257                 -D*)    defs="$defs${defs:+ }$i" ;;
258                 -m*)    flags="$flags${flags:+ }$i" ;;
259                 -f*)    flags="$flags${flags:+ }$i" ;;
260                 *)      ;;
261         esac
262   done
263 ## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
264   # make sure we compile with -mno-fp-regs on alpha
265   if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
266   then
267         flags="$flags${flags:+ }-mno-fp-regs"
268   fi
269   if test `uname -m` = pmax
270   then
271         KERNEL_CFLAGS="${KERNEL_CFLAGS} -G 0 -mno-abicalls -mno-half-pic"
272         KERNEL_LDFLAGS="${KERNEL_LDFLAGS} -G 0 -Ttext 0x80030000 -T ${SYS}/arch/mips/conf/kern.ldscript"
273   fi
274   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_LKM"
275   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
276   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
277   KERNEL_LD='ld'
278   if test `uname -m` = pmax
279   then
280       ac_kernel_ld='${KERNEL_LD} ${KERNEL_LDFLAGS} -o conftest $LDFLAGS -R $KERNEL conftest.o -e _foo 1>&5'
281   fi
283   NNPFS_SRCS='nnpfs_wrap-bsd.c nnpfs_common-bsd.c nnpfs_dev-common.c nnpfs_dev-bsd.c nnpfs_dev-openbsd.c nnpfs_syscalls-common.c nnpfs_syscalls-wrap-bsd.c nnpfs_node-bsd.c nnpfs_vfsops-common.c nnpfs_vfsops-bsd.c nnpfs_vfsops-openbsd.c nnpfs_vnodeops-common.c nnpfs_vnodeops-bsd.c'
284   NNPFS_SUBDIR=bsd
285   KERNEL=/bsd
286   MODLOAD=modload
287   MODUNLOAD=modunload
288   AC_MSG_RESULT(OpenBSD)
289   ;;
290 netbsd* | netbsdelf*)
291   AC_WERROR(BSD_WERROR)
292   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
293   KERNEL_SRCS='bsd-subr.c'
294   KERNEL_HDRS=''
295   MODULE=nnpfs_mod.o
296   cat > conftest.mk << END
297 .include <bsd.kmod.mk>
298 .if UVM
299 CFLAGS+=-DUVM
300 .endif
301 .if PMAP_NEW
302 CFLAGS+=-DPMAP_NEW
303 .endif
304 echo:
305         @echo \$(CFLAGS) \$(CPPFLAGS)
307   ac_out=`$BSDMAKE S=$SYS -f conftest.mk echo 2> /dev/null`
308   incl=-I$SYS
309   defs= flags=
310   set X $ac_out ; shift
311   while test $# != 0; do
312         case "$1" in
313                 -I*|-nostdinc)
314                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
315                                 incl="$incl${incl:+ }$1"
316                         fi
317                         ;;
318                 -isystem)
319                         shift
320                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
321                                 incl="$incl${incl:+ }-isystem $1"
322                         fi
323                         ;;
325                 -D*)    defs="$defs${defs:+ }$1" ;;
326                 -m*)    flags="$flags${flags:+ }$1" ;;
327                 -f*)    flags="$flags${flags:+ }$1" ;;
328                 *)      ;;
329         esac
330         shift
331   done
332 ## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
333   # make sure we compile with -mno-fp-regs on alpha
334   if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
335   then
336         flags="$flags${flags:+ }-mno-fp-regs"
337   fi
338   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
339   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
340   KERNEL_LD='ld'
341   NNPFS_SRCS='nnpfs_wrap-bsd.c nnpfs_common-bsd.c nnpfs_dev-common.c nnpfs_dev-bsd.c nnpfs_dev-netbsd.c nnpfs_syscalls-common.c nnpfs_syscalls-wrap-bsd.c nnpfs_node-bsd.c nnpfs_vfsops-common.c nnpfs_vfsops-bsd.c nnpfs_vfsops-netbsd.c nnpfs_vnodeops-common.c nnpfs_vnodeops-bsd.c nnpfs_vnodeops-netbsd.c'
342   NNPFS_SUBDIR=bsd
343   KERNEL=/netbsd
344   MODLOAD=modload
345   MODUNLOAD=modunload
347   dnl
348   dnl Ok, lets build the symlinks the lkm needs
349   dnl  First make sure the directory and file exists
350   dnl  Then run make depend to create the symlinks
351   dnl  And a last thing in this ugly hack, add a -I to that directory
353   test -d include/netbsd-lkm || \
354        "$srcdir"/mkinstalldirs include/netbsd-lkm > /dev/null 2>/dev/null
356   kakasrcdir=`cd $srcdir && pwd`
358   (cd include/netbsd-lkm &&  \
359    $BSDMAKE S="$SYS" foosrc=$kakasrcdir/include/netbsd-lkm \
360         -f "$kakasrcdir"/include/netbsd-lkm/Makefile depend>/dev/null)
362   KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -I`pwd`/include/netbsd-lkm"
364   if test "X$smp" != "Xno" -a "X$smp" != "X"; then
365         KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -DMULTIPROCESSOR"
366   fi
368   AC_MSG_RESULT(NetBSD)
369   ;;
370 dragonfly*)
371   AC_WERROR(BSD_WERROR)
372   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
373   KERNEL_SRCS='bsd-subr.c'
374   KERNEL_HDRS=''
375   KERNEL=/kernel
376   MODULE=nnpfs.ko
378   if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
379         smp="-DAPIC_IO $smp"
380   else
381         smp=""
382   fi
384   KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-O"
385   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DVFS_KLD -DKLD_MODULE -I$SYS/arch -I$SYS -I."
386   KERNEL_LD='ld'
388   NNPFS_SUBDIR=bsd
389   NNPFS_SRCS='nnpfs_wrap-bsd.c nnpfs_common-bsd.c nnpfs_dev-common.c nnpfs_dev-bsd.c nnpfs_syscalls-common.c nnpfs_syscalls-wrap-dragonfly.c nnpfs_node-bsd.c nnpfs_vfsops-common.c nnpfs_vfsops-bsd.c nnpfs_vfsops-freebsd.c nnpfs_vnodeops-common.c nnpfs_vnodeops-bsd.c'
390   MODLOAD=modload
391   MODUNLOAD=modunload
392   AC_MSG_RESULT(DragonFly)
393   ;;
394 freebsd[[56789]]* | freebsdelf[[56789]]*)
395   AC_MSG_RESULT([FreeBSD [[56789]].x])
396   KERNEL=`sysctl -n kern.bootfile`
397   AC_WERROR(BSD_WERROR)
398   NNPFS_SUBDIR=freebsd
399   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
400   KERNEL_SRCS='bsd-subr.c'
402   KERNEL=`sysctl -n kern.bootfile`
404   cat > conftest.mk << END
405 KMOD= nonesuch
406 SRCS= nonesuch.c
407 .include <bsd.kmod.mk>
408 echo:
409         @echo \$(CFLAGS) \$(CPPFLAGS)
411   ac_out=`$BSDMAKE SYSDIR=$SYS -f conftest.mk echo 2> /dev/null`
412   incl=-I$SYS
413   defs= flags=
414   set X $ac_out ; shift
415   while test $# != 0; do
416         case "$1" in
417                 -I*|-nostdinc)
418                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
419                                 incl="$incl${incl:+ }$1"
420                         fi
421                         ;;
422                 -isystem)
423                         shift
424                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
425                                 incl="$incl${incl:+ }-isystem $1"
426                         fi
427                         ;;
429                 -D*)    defs="$defs${defs:+ }$1" ;;
430                 -m*)    flags="$flags${flags:+ }$1" ;;
431                 -f*)    flags="$flags${flags:+ }$1" ;;
432                 *)      ;;
433         esac
434         shift
435   done
436   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -I. $defs${defs:+ }$flags${flags:+ }$incl"
437   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
438   KERNEL_LD='ld'
440   ;;
442 freebsd[[34]]* | freebsdelf[[34]]*)
443   AC_MSG_RESULT([FreeBSD [[34]].x])
444   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
445   KERNEL_SRCS='bsd-subr.c'
446   KERNEL_HDRS=''
447   KERNEL=`sysctl -n kern.bootfile`
448   AC_WERROR(BSD_WERROR)
449   AC_MSG_CHECKING(for kernel object format)
450   kernobjformat=aout
451   case `file $KERNEL 2>/dev/null` in
452   *ELF*)  kernobjformat=elf ;;
453   esac
454   AC_MSG_RESULT($kernobjformat)
456   AC_MSG_CHECKING(for kld)
457   dnl Default to kld if freebsd4.0
458   case "$target_os" in
459         freebsd4*)
460         if test "X$kld" = "X"; then
461                 kld="yes";
462         fi
463         if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
464                 smp="-DAPIC_IO $smp"
465         else
466                 smp=""
467         fi
468         ;;
469   esac
470   AC_SUBST(FREEBSD_GENSETDEFS)
472   dnl Or if the kernel is ELF
473   case "$kernobjformat" in
474         elf*)
475         if test "X$kld" = "X"; then
476                 kld=yes;
477         fi
478         ;;
479   esac
480   KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-O"
481   if test `uname -m` = alpha -a `expr X"$KERNEL_CFLAGS" : ".*-mno-fp-regs"` -eq 0
482   then
483         KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-mno-fp-regs"
484   fi
485   if test "$kld" = "yes"; then
486     KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DVFS_KLD -DKLD_MODULE -I$SYS/arch -I$SYS -I."
487     test_KERNEL_CFLAGS="-$kernobjformat ${KERNEL_CFLAGS}"
488     KERNEL_LD='ld'
489     case "$kernobjformat" in
490     aout) extra_LDFLAGS="-A" ;;
491     elf)  extra_LDFLAGS="-R" ;;
492     *) AC_MSG_ERROR([Unknown object format $kernobjformat])
493     esac
494     ac_kernel_ld='${LD-ld} -$kernobjformat -o conftest $LDFLAGS $extra_LDFLAGS $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
495     MODULE=nnpfs.ko
496     AC_MSG_RESULT(yes)
497   else
498     if test "$kernobjformat" != "aout"; then
499       AC_MSG_WARN([You cannot build LKMs against $kernobjformat kernels])
500     fi
501     KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DLKM -D_LKM -DVFS_LKM -DACTUALLY_LKM_NOT_KERNEL -I$SYS/arch -I$SYS -I."
502     test_KERNEL_CFLAGS="-aout ${KERNEL_CFLAGS}"
503     KERNEL_LD='ld -aout'
504     ac_kernel_ld='${LD-ld} -aout -o conftest $LDFLAGS -A $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
505     MODULE=nnpfs_mod.o
506     AC_MSG_RESULT(no)
507   fi
509   NNPFS_SUBDIR=bsd
510   NNPFS_SRCS='nnpfs_wrap-bsd.c nnpfs_common-bsd.c nnpfs_dev-common.c nnpfs_dev-bsd.c nnpfs_dev-freebsd.c nnpfs_syscalls-common.c nnpfs_syscalls-wrap-freebsd.c nnpfs_node-bsd.c nnpfs_vfsops-common.c nnpfs_vfsops-bsd.c nnpfs_vfsops-freebsd.c nnpfs_vnodeops-common.c nnpfs_vnodeops-bsd.c'
511   MODLOAD=modload
512   MODUNLOAD=modunload
514   ;;
515 darwin*)
516   AC_MSG_RESULT(MacOS)
517   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
518   KERNEL_SRCS='bsd-subr.c'
519   KERNEL_HDRS=''
520   KERNEL=/mach
521   case "$nnpfs_target" in
522     darwin6.*) COM_APPLE_KERNEL_BSD="6.0" ;;
523     darwin7.*) COM_APPLE_KERNEL_BSD="6.0" ;;
524     darwin8.*) COM_APPLE_KERNEL_BSD="6.0" ;;
525     darwin*)  COM_APPLE_KERNEL_BSD="1.1" ;;
526     *) AC_MSG_ERROR([Unknown kernel version])
527   esac
528   AC_CONFIG_FILES([nnpfs/bsd/Info.plist])
530   AC_SUBST(COM_APPLE_KERNEL_BSD)
532   ac_cv_func_mmap_fixed_mapped=no               dnl disable mmap for darwin
534   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -DKERNEL -D_KERNEL -I/System/Library/Frameworks/Kernel.framework/Headers -static -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API"
535   case "$nnpfs_target" in
536     darwin[[789]].*)
537           ;;
538     *) 
539           KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
540           CPPFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
541           CFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
542           ;;
543   esac
545   YDR_CPPFLAGS="-traditional-cpp"
547   LDFLAGS="${LDFLAGS} -flat_namespace"
548   KERNEL_CFLAGS="${KERNEL_CFLAGS} -fno-common -Wno-format -pipe -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch -fno-builtin"
549   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
550   KERNEL_LD='ld'
551   MODULE=nnpfs_mod.o
553   MODLOAD=kmodload
554   MODUNLOAD=kmodunload
556   NNPFS_SUBDIR=bsd
557   NNPFS_SRCS='nnpfs_wrap-bsd.c nnpfs_common-bsd.c nnpfs_dev-common.c nnpfs_dev-bsd.c nnpfs_dev-macos.c nnpfs_syscalls-common.c nnpfs_syscalls-wrap-macos.c nnpfs_node-bsd.c nnpfs_vfsops-common.c nnpfs_vfsops-bsd.c nnpfs_vfsops-macos.c nnpfs_vnodeops-common.c nnpfs_vnodeops-macos.c nnpfs_info.c'
559   AC_DEFINE([BIND_8_COMPAT], 1,
560         [Define to pull in bind8 glue for darwin.])
562   ;;
563 linux*)
564   AC_MSG_RESULT(Linux)
565   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/linux
566   KERNEL_SRCS='bsd-subr.c'
567   KERNEL_HDRS=''
569   if test "X$smp" = "Xno"; then
570     smp=
571   fi
573   KERNEL_CPPFLAGS="-I$SYS/include -DMODULE -D__KERNEL__ $smp ${KERNEL_CPPFLAGS} "
574   case "$target_cpu" in
575   alpha*)
576     KERNEL_CC=${KERNEL_CC:-$CC}
577     KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fp-regs -ffixed-8" ;;
578   sparc64*)
579     KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fpu -ffixed-g4 -fcall-used-g5 -fcall-used-g7"
580     KERNEL_LD_FLAGS="-m elf64_sparc"
581     KERNEL_CC=${KERNEL_CC:-sparc64-linux-gcc}
582     AC_DEFINE(NEED_VICEIOCTL32, 1,
583         [define if you need 32 bit compat pioctl]) ;;
584   ia64*)
585     LINUX_IA64=yes
586     KERNEL_CC=${KERNEL_CC:-$CC} ;;
587   *)
588     KERNEL_CC=${KERNEL_CC:-$CC} ;;
589   esac
590   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
591   NNPFS_SUBDIR=linux
592   KERNEL=/dev/null
593   ;;
594 mingw32*)
595   AC_MSG_RESULT(mingw32)
596   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
597   KERNEL_SRCS=unknown-subr.c
598   KERNEL_HDRS=
599   KERNEL=/dev/null
600   NNPFS_SUBDIR=
601   ;;
602 cygwin*)
603   AC_MSG_RESULT(cygwin/VC)
604   AC_MSG_WARN([No kernel support for NT])
605   if test "$with_pthreads" = "windows"; then
606     AC_MSG_WARN([Using LWP on windows native threads])
607     LWP_PROCESS=""
608     LWP_C="plwp.c"
609     LWP_O="plwp.o"
610     LWP_H="plwp.h"
611     PLWP_INC_FLAGS="-DWINDOWS_THREADS_LWP"
612   else
613     AC_MSG_WARN([Using LWP on asm threads or pthreads])
614   fi
615   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
616   KERNEL_SRCS=unknown-subr.c
617   KERNEL_HDRS=
618   KERNEL=/dev/null
619   NNPFS_SUBDIR=
620   ;;
622   AC_MSG_RESULT(none)
623   if test "$nnpfs_target" != "without_nnpfs"; then
624     AC_MSG_WARN([No kernel support for $target_os, compiling only user-level stuff])
625   fi
626   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
627   KERNEL_SRCS=unknown-subr.c
628   KERNEL_HDRS=
629   KERNEL=/dev/null
630   NNPFS_SUBDIR=
631   ;;
632 esac
634 dnl ydr need special flags
635 AC_SUBST(YDR_CPPFLAGS)
637 dnl are we dragonfly
638 AM_CONDITIONAL(DFLY, expr "$target_os" : "dragonfly.*" >/dev/null 2>&1)
640 dnl are we freebsd5
641 AM_CONDITIONAL(FBSD5, test X"$FREEBSD5" = Xyes)
643 dnl are we linux-ia64
644 AM_CONDITIONAL(LINUX_IA64, test X"$LINUX_IA64" = Xyes)
646 dnl support for native readdir
647 AM_CONDITIONAL(NNPFS_AFS_READDIR, false)
649 AC_SUBST(BSD_WERROR)
651 AM_CONDITIONAL(DCE, false)
652 AM_CONDITIONAL(MACOSX, test `expr "$nnpfs_target" : darwin` != 0)
654 AC_ARG_WITH(lwp-redzone,
655 [  --without-lwp-redzone   don't use redzone for (asm)lwp],
656 [lwpredzone=$withval],
657 [lwpredzone=yes])
659 AM_CONDITIONAL(LWP_REDZONE, test X$lwpredzone != Xno)
661 # Check where to put the cache
663 AC_ARG_WITH(arlacachedir,
664 [  --with-arlacachedir=dir use dir as cachedir instead of \$prefix/cache],
665 [ARLACACHEDIR=$withval],
666 [ARLACACHEDIR='${prefix}/cache'])
668 # Check where to find the configuration
670 AC_ARG_WITH(arlaconffile,
671 [  --with-arlaconffile=file use file for configuration instead of \$prefix/etc/arla.conf],
672 [ARLACONFFILE=$withval],
673 [ARLACONFFILE='${sysconfdir}/arla.conf'])
675 # Check where to store partitions
677 AC_ARG_WITH(milkopart,
678 [  --with-milkopart=dir    location of milko partitions (default /)],
679 [MILKO_ROOT='-DMILKO_ROOT=\"$withval\"'],
680 [MILKO_ROOT='-DMILKO_ROOT=\"/\"'])
682 # Do we want knfs ?
684 ARLA_KNFS=""
685 AC_ARG_ENABLE(knfs,
686 [  --enable-knfs           make afs nfs-mountable],
687 [ARLA_KNFS="-DARLA_KNFS"])
688 AC_SUBST(ARLA_KNFS)
692 dnl If we want to use pthreads
695 AC_SUBST(LWP_PROCESS)
696 AC_SUBST(PLWP_LIB_FLAGS)
697 AC_SUBST(PLWP_INC_FLAGS)
698 AC_SUBST(LWP_C)
699 AC_SUBST(LWP_O)
700 AC_SUBST(LWP_H)
702 AC_TYPE_MSGHDR
703 AC_TYPE_IOVEC
705 dnl AC_TYPE_MODE_T
706 dnl AC_CHECK_TYPE(nlink_t, int)
709 dnl Tests for readline/editline
712 rk_TEST_PACKAGE(readline,
713 [#include <stdio.h>
714  #include <readline.h>],-lreadline,,, READLINE)
716 if test "$with_readline" = "no"; then
717         AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
718         if test "$ac_cv_funclib_tgetent" = "no"; then
719                 AC_MSG_ERROR([Could not find tgetent, needed by edit/editline])
720         fi
721         AC_FIND_FUNC_NO_LIBS(readline, editline edit readline, [], [], [$LIB_tgetent])
722         if test "$ac_cv_func_readline" = "no"; then
723                 AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
724                 if test "$ac_cv_func_el_init" = yes; then
725                         editline_OBJS=edit_compat.o
726                         LIB_readline='-L'`pwd`'/lib/editline -leditline '"$LIB_el_init";
727                         INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
728                 else
729                         editline_OBJS="editline.o complete.o sysunix.o"
730                         LIB_readline='-L'`pwd`'/lib/editline -leditline'
731                         INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
732                 fi
733         fi
735 AC_DEFINE(HAVE_READLINE, 1, [define if you have a function readline])
737 LIB_readline_ac="$LIB_readline $LIB_tgetent"
738 LIB_readline="$LIB_readline \$(LIB_tgetent)"
744 AC_ARG_ENABLE(mmap,
745 [  --disable-mmap          don't use mmap],
746 [if test "$enableval" = "no"; then
747   ac_cv_func_mmap_fixed_mapped=no
748  fi])
750 aix_dynamic_afs=yes
751 AC_ARG_ENABLE(dynamic-afs,
752 [  --disable-dynamic-afs   don't use loaded AFS library with AIX],[
753 if test "$enableval" = "no"; then
754         aix_dynamic_afs=no
758 syscallhack=yes
759 AC_ARG_ENABLE(linux-syscall,
760         AC_HELP_STRING([--disable-linux-syscall],[don't modify the syscall table on linux]),
761 [if test "$enableval" = "no" ; then
762         syscallhack=no
763 fi])
764 if test "$syscallhack" = "yes"; then
765         AC_DEFINE(SYSCALLHACK, 1, [define to enable syscall table modification on linux])
768 grouppags=yes
769 AC_ARG_ENABLE(linux-group-pags,
770         AC_HELP_STRING([--disable-linux-group-pags],[don't use groups for pags on linux]),
771 [if test "$enableval" = "no" ; then
772         grouppags=no
773 fi])
774 if test "$grouppags" = "yes"; then
775         AC_DEFINE(GROUPPAGS, 1, [define to enable groups-based pags on linux])
778 AC_CHECK_LFS
779 AC_CHECK_GLIBC
781 AC_SUBST(LIB_readline)
782 AC_SUBST(INCLUDE_readline)
783 AC_SUBST(editline_OBJS)dnl
784 if test "$editline_OBJS" != ""; then
785   editline_dir=editline
787 AC_SUBST(editline_dir)
789 AC_SUBST(GCC)
790 AC_SUBST(CFLAGS)
791 AC_SUBST(LDFLAGS)
792 AC_SUBST(KERNEL_INCLUDE)
793 AC_SUBST(KERNEL_SRCS)
794 AC_SUBST(KERNEL_HDRS)
795 AC_SUBST(KERNEL_CPPFLAGS)
796 AC_SUBST(KERNEL_CFLAGS)
797 AC_SUBST(KERNEL_LD_FLAGS)
798 AC_SUBST(KERNEL_CC)
799 AC_SUBST(KERNEL_LD)
800 AC_SUBST(MODLOAD)
801 AC_SUBST(MODUNLOAD)
802 AC_SUBST(MODULE)
803 AC_SUBST(NNPFS_SUBDIR)
804 AC_SUBST(NNPFS_SRCS)
805 AC_SUBST(RXKAD_LIBS)
806 AC_SUBST(ARLACACHEDIR)
807 AC_SUBST(ARLACONFFILE)
808 AC_SUBST(MILKO_ROOT)
809 AC_FUNC_MMAP
812 dnl Various checks for headers and their contents
815 AC_HEADER_STDC
816 AC_HEADER_TIME
818 AC_CHECK_HEADERS([                              \
819                 arpa/inet.h                     \
820                 arpa/nameser.h                  \
821                 dbm.h                           \
822                 db.h                            \
823                 dirent.h                        \
824                 err.h                           \
825                 errno.h                         \
826                 elflib/nlist.h                  \
827                 fcntl.h                         \
828                 fnmatch.h                       \
829                 gdbm/ndbm.h                     \
830                 glob.h                          \
831                 ifaddrs.h                       \
832                 libelf/nlist.h                  \
833                 limits.h                        \
834                 machine/asm.h                   \
835                 machine/regdef.h                \
836                 mach/alpha/asm.h                \
837                 ndbm.h                          \
838                 netdb.h                         \
839                 net/if_dl.h                     \
840                 net/if_types.h                  \
841                 netinet/in6.h                   \
842                 netinet/in6_machtypes.h         \
843                 netinet/in.h                    \
844                 nlist.h                         \
845                 openssl/ui.h                    \
846                 pwd.h                           \
847                 regdef.h                        \
848                 rpcsvc/dbm.h                    \
849                 shadow.h                        \
850                 stdint.h                        \
851                 sys/attr.h                      \
852                 sys/bitypes.h                   \
853                 sys/cdefs.h                     \
854                 sys/dir.h                       \
855                 sys/exec.h                      \
856                 sys/file.h                      \
857                 sys/ioccom.h                    \
858                 sys/ioctl.h                     \
859                 sys/inttypes.h                  \
860                 sys/kauth.h                     \
861                 sys/libkern.h                   \
862                 sys/lkm.h                       \
863                 sys/lock.h                      \
864                 sys/mkdev.h                     \
865                 sys/mman.h                      \
866                 sys/module.h                    \
867                 sys/mutex.h                     \
868                 sys/param.h                     \
869                 sys/prctl.h                     \
870                 sys/priv.h                      \
871                 sys/poll.h                      \
872                 sys/pool.h                      \
873                 sys/queue.h                     \
874                 sys/resource.h                  \
875                 sys/sa.h                        \
876                 sys/select.h                    \
877                 sys/selinfo.h                   \
878                 sys/socket.h                    \
879                 sys/sockio.h                    \
880                 sys/stat.h                      \
881                 sys/statvfs.h                   \
882                 sys/statfs.h                    \
883                 sys/stdint.h                    \
884                 sys/sysent.h                    \
885                 sys/sysproto.h                  \
886                 sys/systm.h                     \
887                 sys/time.h                      \
888                 sys/types.h                     \
889                 sys/ubc.h                       \
890                 sys/utsname.h                   \
891                 sys/vfs.h                       \
892                 sys/vfs_proto.h                 \
893                 sys/vnode.h                     \
894                 sys/wait.h                      \
895                 vis.h                           \
896                 unistd.h                        \
897                 winsock.h                       \
900 AC_CHECK_HEADERS([net/if.h], , , [AC_INCLUDES_DEFAULT
901 #if HAVE_SYS_SOCKET_H
902 #include <sys/socket.h>
903 #endif])
905 AC_CHECK_HEADERS(netinet6/in6_var.h, , , [AC_INCLUDES_DEFAULT
906 #ifdef HAVE_NETINET6_IN6_H
907 #include <netinet6/in6.h>
908 #endif
911 AC_CHECK_HEADERS([                      \
912                 sys/proc.h              \
913                 sys/mount.h             \
914                 sys/signalvar.h         \
915                 sys/user.h              \
916 ], , , [AC_INCLUDES_DEFAULT
917 #ifdef HAVE_SYS_PARAM_H
918 #include <sys/param.h>
919 #endif
922 AC_CHECK_HEADERS([                      \
923                 sys/syscallargs.h       \
924 ], , , [AC_INCLUDES_DEFAULT
925 #ifdef HAVE_SYS_PARAM_H
926 #include <sys/param.h>
927 #endif
928 #ifdef HAVE_SYS_MOUNT_H
929 #include <sys/mount.h>
930 #endif
931 #ifdef HAVE_SYS_SA_H
932 #include <sys/sa.h>
933 #endif
936 AC_CHECK_HEADERS([resolv.h], , , [AC_INCLUDES_DEFAULT
937 #ifdef HAVE_SYS_TYPES_H
938 #include <sys/types.h>
939 #endif
940 #ifdef HAVE_NETINET_IN_H
941 #include <netinet/in.h>
942 #endif
943 #ifdef HAVE_ARPA_NAMESER_H
944 #include <arpa/nameser.h>
945 #endif
948 AC__EXTENSIONS__
951 dnl These need to before roken checks
954 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
955 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
956 AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
957 AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
958 AM_CONDITIONAL(have_glob_h, test "$ac_cv_header_glob_h" = yes)
959 AM_CONDITIONAL(do_roken_rename, true)
962 dnl and this is for kernel header files
965 save_CPPFLAGS="${CPPFLAGS}"
966 CPPFLAGS="${KERNEL_CPPFLAGS}"
968 AC_CHECK_HEADERS([                              \
969                 miscfs/genfs/genfs.h            \
970                 miscfs/syncfs/syncfs.h          \
971                 uvm/uvm_extern.h                \
972                 vm/vm.h                         \
973                 vm/vm_extern.h                  \
974                 vm/vm_object.h                  \
975                 vm/vm_pager.h                   \
976                 vm/vm_zone.h                    \
977                 vm/vnode_pager.h                \
978                 vm/uma.h                        \
979 ], , , -)
981 CPPFLAGS="${save_CPPFLAGS}"
985 dnl Check for endian-ness
987 KRB_C_BIGENDIAN
990 dnl check for const
993 AC_C_CONST
996 dnl Check for inline
999 AC_C_INLINE
1002 dnl Check for __FUNCTION__
1005 AC_C___FUNCTION__
1008 dnl Check for __attribute__
1011 AC_C___ATTRIBUTE__
1014 dnl roken stuff
1017 AC_ENABLE_SHARED(no)
1018 AC_PROG_LIBTOOL
1020 rk_DB
1023 # It is said that the kerberos junk needs to be after ac_check_roken,
1024 # but I didn't notice that, so we include some to have a good place
1025 # to check for existing roken in 
1028 AC_CHECK_KERBEROS(54auto)
1029 AC_CHECK_KAFS
1030 #end krb, continue roken stuff
1032 AC_CHECK_ROKEN()
1034 # oh, and put sl here, too
1035 AC_CHECK_SL
1036 # done!
1038 if test "X$ac_cv_arla_with_roken" = "Xyes" ; then
1039    rk_ROKEN(lib/roken)
1040    #LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
1041 else
1042   dnl inlined parts of rk_ROKEN, seems to be needed by sl and rx sometimes.
1043   AC_BROKEN([                                   \
1044         err                                     \
1045         errx                                    \
1046         strdup                                  \
1047         strtok_r                                \
1048         strupr                                  \
1049         warn                                    \
1050         warnx                                   \
1051   ])
1053 AM_CONDITIONAL(ARLA_LOCAL_ROKEN, test X$ac_cv_arla_with_roken = Xyes)
1055 rk_CHECK_MAN
1057 if test "X$ac_cv_found_krb5" = "Xyes" ; then
1058   RXKAD_LIBS_extra="$RXKAD_LIBS_extra $KRB5_LIB_FLAGS"
1061 if test "X$RXKAD_LIBS_extra" != "X" ; then
1062   RXKAD_LIBS="\$(top_builddir)/rxkad/librxkad.la $RXKAD_LIBS_extra"
1064 AM_CONDITIONAL(RXKAD, test "X$RXKAD_LIBS_extra" != "X")
1066 dnl AC_TYPE_KRB_PRINCIPAL
1067 dnl AC_FUNC_KRB_GET_ERR_TEXT
1068 dnl AC_FUNC_KRB_GET_DEFAULT_TKT_ROOT
1069 dnl AC_FUNC_KRB_GET_DEFAULT_PRINCIPAL
1070 dnl AC_FUNC_KRB_KDCTIMEOFDAY
1071 AC_FUNC_KAFS_SETTOKEN_RXKAD
1074 # check for tf_util
1077 dnl AC_FIND_FUNC_NO_LIBS2(tf_init, "", , , [$KRB4_LIB_FLAGS])
1078 dnl 
1079 dnl if test "$ac_cv_func_tf_init" = yes; then
1080 dnl     APPL_SUBDIRS="$APPL_SUBDIRS kalog"
1081 dnl fi
1082 dnl 
1085 dnl Check for strange operating systems that you need to handle differently
1088 AC_KRB_SYS_AIX
1090 if test "$krb_cv_sys_aix" = yes ;then
1091         if test "$aix_dynamic_afs" = yes; then
1092                 AFS_EXTRA_OBJS='$(srcdir)/afsl.exp dlfcn.o'
1093                 AFS_EXTRA_LIBS=afslib.so
1094                 # this works differently in AIX <=3 and 4
1095                 if test `uname -v` = 4 ; then
1096                         AFS_EXTRA_LD="-bnoentry"
1097                 else
1098                         AFS_EXTRA_LD="-e _nostart"
1099                 fi
1100                 AFS_EXTRA_DEFS=
1101                 AIX_EXTRA_KAFS="-lld"
1102         else
1103                 AFS_EXTRA_OBJS='$(srcdir)/afsl.exp afslib.o'
1104                 AFS_EXTRA_LIBS=
1105                 AFS_EXTRA_DEFS='-DSTATIC_AFS_SYSCALLS'
1106                 AIX_EXTRA_KAFS=
1107         fi
1108         AC_SUBST(AFS_EXTRA_OBJS)dnl
1109         AC_SUBST(AFS_EXTRA_LIBS)dnl
1110         AC_SUBST(AFS_EXTRA_LD)dnl
1111         AC_SUBST(AFS_EXTRA_DEFS)dnl
1112         AC_SUBST(AIX_EXTRA_KAFS)dnl
1116 dnl Check for struct winsize
1119 AC_KRB_STRUCT_WINSIZE
1122 dnl Various checks for libraries and their contents
1125 AC_FIND_FUNC(syslog, syslog)
1128 dnl System V is have misplaced the socket routines, should really be in libc
1131 AC_FIND_FUNC(socket, socket)
1132 AC_FIND_FUNC(gethostbyname, nsl)
1133 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
1135 dnl we don't actually use v6 functions in this code, but some generic
1136 dnl functions such as getnameinfo et al can reside in libraries that are
1137 dnl found by this macro
1139 AC_KRB_IPV6
1141 AC_FIND_FUNC(res_search, resolv,
1143 #include <stdio.h>
1144 #ifdef HAVE_SYS_TYPES_H
1145 #include <sys/types.h>
1146 #endif
1147 #ifdef HAVE_NETINET_IN_H
1148 #include <netinet/in.h>
1149 #endif
1150 #ifdef HAVE_ARPA_NAMESER_H
1151 #include <arpa/nameser.h>
1152 #endif
1153 #ifdef HAVE_RESOLV_H
1154 #include <resolv.h>
1155 #endif
1157 [0,0,0,0,0])
1159 AC_FIND_FUNC(res_init, resolv,
1161 #include <stdio.h>
1162 #ifdef HAVE_SYS_TYPES_H
1163 #include <sys/types.h>
1164 #endif
1165 #ifdef HAVE_NETINET_IN_H
1166 #include <netinet/in.h>
1167 #endif
1168 #ifdef HAVE_ARPA_NAMESER_H
1169 #include <arpa/nameser.h>
1170 #endif
1171 #ifdef HAVE_RESOLV_H
1172 #include <resolv.h>
1173 #endif
1177 AC_FIND_FUNC(dn_expand, resolv,
1179 #include <stdio.h>
1180 #ifdef HAVE_SYS_TYPES_H
1181 #include <sys/types.h>
1182 #endif
1183 #ifdef HAVE_NETINET_IN_H
1184 #include <netinet/in.h>
1185 #endif
1186 #ifdef HAVE_ARPA_NAMESER_H
1187 #include <arpa/nameser.h>
1188 #endif
1189 #ifdef HAVE_RESOLV_H
1190 #include <resolv.h>
1191 #endif
1193 [0,0,0,0,0])
1195 AC_BROKEN_SNPRINTF
1197 AC_CHECK_FUNCS(strtoll strtoq getrusage thr_yield)
1199 AC_EGREP_HEADER(sigaction, signal.h,
1200         AC_DEFINE(HAVE_POSIX_SIGNALS, 1, [define if you have sigaction]))
1202 save_CPPFLAGS="${CPPFLAGS}"
1203 AC_HAVE_TYPES([int8_t int16_t int32_t int64_t])
1204 AC_HAVE_TYPES([int16 int32])
1205 AC_HAVE_TYPES([u_int8_t u_int16_t u_int32_t u_int64_t])
1206 AC_HAVE_TYPES([uint8_t uint16_t uint32_t uint64_t])
1207 AC_HAVE_TYPES([u_int16 u_int32])
1208 AC_HAVE_TYPES([bool ssize_t])
1209 AC_HAVE_TYPES([register_t])     dnl really only needed for bsd nnpfs
1210 AC_HAVE_TYPES([uintptr_t])      dnl really only needed for bsd nnpfs
1211 AC_HAVE_TYPES([intptr_t])
1212 AC_HAVE_TYPES([off64_t])
1213 AC_CHECK_HEADERS([ktypes.h com_err.h et/com_err.h])
1214 COMERR_CPPFLAGS="$CPPFLAGS"
1215 AC_SUBST(COMERR_CPPFLAGS)
1216 CPPFLAGS="${save_CPPFLAGS}"
1218 AC_TYPE_SIGNAL
1221 dnl check for old libkafs
1224 dnl AC_FIND_FUNC_NO_LIBS2(krb_afslog_uid, "", , , [$KAFS_LIBS $KRB4_LIB_FLAGS])
1227 AC_CHECK_FUNC(localtime_r,[
1228 AC_DEFINE([HAVE_LOCALTIME_R], 1, [define if there exists a localtime_r])])
1231 # libroken
1234 AC_CHECK_FUNCS(getfh fhopen)
1236 AC_CHECK_FUNCS(getattrlist setattrlist)
1238 AC_CHECK_FUNCS(statvfs)
1240 rk_CHECK_VAR(optreset,[#include <stdlib.h>])dnl
1243 dnl prototypes
1246 AC_NEED_PROTO([
1247 #include <sys/types.h> 
1248 #include <sys/time.h>
1249 #ifdef HAVE_UNISTD_H
1250 #include <unistd.h>
1251 #endif
1252 #ifdef HAVE_WINSOCK_H
1253 #include <winsock.h>
1254 #endif
1255 ], 
1256 select)
1258 AC_DIRENT_SYS_DIR_H
1260 AC_HAVE_STRUCT_FIELD(struct dirent, d_type,
1261 [#ifdef HAVE_SYS_TYPES_H
1262 #include <sys/types.h>
1263 #endif
1264 #include <dirent.h>
1268 dnl Check for sa_len in sys/socket.h
1271 AC_HAVE_STRUCT_FIELD(struct sockaddr,
1272 sa_len,
1273 [#include <sys/types.h>
1274 #include <sys/socket.h>])
1277 dnl Check for sin_len
1280 AC_HAVE_STRUCT_FIELD(struct sockaddr_in,
1281 sin_len,
1282 [#include <sys/types.h>
1283 #include <sys/socket.h>
1284 #ifdef HAVE_NETINET_IN_H
1285 #include <netinet/in.h>
1286 #endif])
1289 dnl check for strange as stuff on solaris
1292 case "$target_os" in
1293 solaris*)
1294   AC_CACHE_CHECK(if as supports .register, ac_cv_prog_as_register,[
1295   cat > conftest.s <<EOF
1296         .register       %g2, #scratch
1297         .register       %g3, #scratch
1298         .register       %g6, #scratch
1299         .register       %g7, #scratch
1301   if $AS conftest.s >/dev/null 2>&1; then
1302     ac_cv_prog_as_register=yes
1303   else
1304     ac_cv_prog_as_register=no
1305   fi
1306   rm -f conftest.s a.out
1308   if test "$ac_cv_prog_as_register" = "yes"; then
1309     AC_DEFINE([PROG_AS_UNDERSTANDS_REGISTER], 1,
1310         [define this if your as understands .register])
1311   fi
1312 esac
1315 dnl kernel checks
1319 dnl bsd style
1322 if test "$NNPFS_SUBDIR" = "bsd" -o "$NNPFS_SUBDIR" = "freebsd" ; then
1324 AC_CONFIG_FILES([nnpfs/bsd/Makefile nnpfs/bsd/bin/Makefile nnpfs/freebsd/Makefile])
1326 AC_ELF_OBJECT_FORMAT
1327 AC_KERNEL
1329 AC_CHECK_KERNEL_FUNCS([                         \
1330 cdevsw_add                                      \
1331 debuglockmgr                                    \
1332 findcdev                                        \
1333 lockmgr                                         \
1334 vop_revoke                                      \
1335 vop_stdpathconf                                 \
1336 genfs_mmap                                      \
1337 genfs_revoke                                    \
1338 kauth_cred_getuid                               \
1339 lf_advlock                                      \
1340 vfs_opv_init                                    \
1341 vfs_opv_init_default                            \
1342 vfs_opv_init_explicit                           \
1343 vfs_add_vnodeops                                \
1344 vfs_attach                                      \
1345 vfs_deallocate_syncvnode                        \
1346 vfs_register                                    \
1347 vfs_getvfs                                      \
1348 vgonel                                          \
1349 zfree                                           \
1350 zfreei                                          \
1351 uma_zfree_arg                                   \
1352 vfs_cache_lookup                                \
1353 vnode_pager_generic_putpages                    \
1354 vnode_pager_generic_getpages                    \
1355 vnode_pager_setsize                             \
1356 devtoname                                       \
1357 udev2dev                                        \
1358 snprintf                                        \
1359 suser_ucred                                     \
1360 priv_check                                      \
1361 namei_hash                                      \
1362 nosys                                           \
1363 sys_nosys                                       \
1364 sys_lkmnosys                                    \
1365 cache_purgevfs                                  \
1366 insmntque                                       \
1368 AC_CHECK_KERNEL_FUNC(memcpy, [0,0,0])
1370 AC_BSD_HEADER_VNODE_IF_H
1372 AC_KERNEL_NEED_PROTO([
1373 #ifdef HAVE_SYS_TYPES_H
1374 #include <sys/types.h>
1375 #endif
1376 #ifdef HAVE_SYS_PARAM_H
1377 #include <sys/param.h>
1378 #endif
1379 #ifdef HAVE_SYS_TIME_H
1380 #include <sys/time.h>
1381 #endif
1382 #ifdef HAVE_SYS_PROC_H
1383 #include <sys/proc.h>
1384 #endif
1385 #ifdef HAVE_SYS_VNODE_H
1386 #include <sys/vnode.h>
1387 #endif
1389 vgonel)
1391 AC_KERNEL_NEED_PROTO([
1392 #ifdef HAVE_SYS_TYPES_H
1393 #include <sys/types.h>
1394 #endif
1395 #ifdef HAVE_SYS_PARAM_H
1396 #include <sys/param.h>
1397 #endif
1398 #ifdef HAVE_SYS_TIME_H
1399 #include <sys/time.h>
1400 #endif
1401 #ifdef HAVE_SYS_PROC_H
1402 #include <sys/proc.h>
1403 #endif
1404 #include <sys/signal.h>
1405 #include <sys/signalvar.h>
1407 issignal)
1409 AC_KERNEL_NEED_PROTO([
1410 #ifdef HAVE_SYS_TYPES_H
1411 #include <sys/types.h>
1412 #endif
1413 #ifdef HAVE_SYS_PARAM_H
1414 #include <sys/param.h>
1415 #endif
1416 #ifdef HAVE_SYS_TIME_H
1417 #include <sys/time.h>
1418 #endif
1419 #ifdef HAVE_SYS_PROC_H
1420 #include <sys/proc.h>
1421 #endif
1422 #ifdef HAVE_SYS_VNODE_H
1423 #include <sys/vnode.h>
1424 #endif
1425 #ifdef HAVE_SYS_VFS_PROTO_H
1426 #include <sys/vfs_proto.h>
1427 #endif
1429 vn_writechk)
1431 AC_KERNEL_NEED_PROTO([
1432 #ifdef HAVE_SYS_TYPES_H
1433 #include <sys/types.h>
1434 #endif
1435 #ifdef HAVE_SYS_PARAM_H
1436 #include <sys/param.h>
1437 #endif
1438 #ifdef HAVE_SYS_LIBKERN_H
1439 #include <sys/libkern.h>
1440 #endif
1441 #ifdef HAVE_SYS_SYSTM_H
1442 #include <sys/systm.h>
1443 #endif
1445 strncmp)
1447 AC_CHECK_KERNEL_VAR(doforce, int)
1448 AC_CHECK_KERNEL_VAR(aout_sysent, struct sysent*,[#include <sys/systm.h>])
1449 AC_CHECK_KERNEL_VOP_T
1450 AC_BSD_FUNC_VFS_OBJECT_CREATE
1451 AC_BSD_FUNC_VOP_LOCK
1452 AC_BSD_FUNC_VOP_UNLOCK
1453 AC_BSD_FUNC_VOP_OPEN
1454 AC_BSD_FUNC_VFS_BUSY
1455 AC_BSD_FUNC_VFS_QUOTACTL
1456 AC_BSD_FUNC_VGET
1457 AC_BSD_FUNC_VNODE_CREATE_VOBJECT
1458 AC_BSD_FUNC_SUSER
1459 AC_BSD_FUNC_VFS_GETNEWFSID
1460 AC_BSD_FUNC_LOCKMGR
1461 AC_BSD_FUNC_LOCKSTATUS
1462 AC_BSD_FUNC_SELRECORD
1463 AC_BSD_FHTOVP
1465 AC_CHECK_DIRSIZ
1468 dnl Find out if have have proc.p_sigmask
1471 AC_HAVE_STRUCT_FIELD(
1472 struct proc,
1473 p_sigmask,
1474 [#ifdef HAVE_SYS_TYPES_H
1475 #include <sys/types.h>
1476 #endif
1477 #ifdef HAVE_SYS_PARAM_H
1478 #include <sys/param.h>
1479 #endif
1480 #ifdef HAVE_SYS_TIME_H
1481 #include <sys/time.h>
1482 #endif
1483 #ifdef HAVE_SYS_PROC_H
1484 #include <sys/proc.h>
1485 #endif])
1487 AC_HAVE_STRUCT_FIELD(
1488 struct proc,
1489 p_sigctx,
1490 [#ifdef HAVE_SYS_TYPES_H
1491 #include <sys/types.h>
1492 #endif
1493 #ifdef HAVE_SYS_PARAM_H
1494 #include <sys/param.h>
1495 #endif
1496 #ifdef HAVE_SYS_TIME_H
1497 #include <sys/time.h>
1498 #endif
1499 #ifdef HAVE_SYS_PROC_H
1500 #include <sys/proc.h>
1501 #endif])
1503 AC_HAVE_KERNEL_STRUCT_FIELD([
1504 #ifdef HAVE_SYS_TYPES_H
1505 #include <sys/types.h>
1506 #endif
1507 #ifdef HAVE_SYS_PARAM_H
1508 #include <sys/param.h>
1509 #endif
1510 #ifdef HAVE_SYS_TIME_H
1511 #include <sys/time.h>
1512 #endif
1513 #ifdef HAVE_SYS_PROC_H
1514 #include <sys/proc.h>
1515 #endif
1516 #ifdef HAVE_SYS_VNODE_H
1517 #include <sys/vnode.h>
1518 #endif
1519 #ifdef HAVE_SYS_MOUNT_H
1520 #include <sys/mount.h>
1521 #endif
1523 mount,
1524 struct vnode *,
1525 mnt_syncer)
1527 AC_HAVE_KERNEL_STRUCT_FIELD([
1528 #ifdef HAVE_SYS_TYPES_H
1529 #include <sys/types.h>
1530 #endif
1531 #ifdef HAVE_SYS_PARAM_H
1532 #include <sys/param.h>
1533 #endif
1534 #ifdef HAVE_SYS_TIME_H
1535 #include <sys/time.h>
1536 #endif
1537 #ifdef HAVE_SYS_PROC_H
1538 #include <sys/proc.h>
1539 #endif
1540 #ifdef HAVE_SYS_VNODE_H
1541 #include <sys/vnode.h>
1542 #endif
1543 #ifdef HAVE_SYS_MOUNT_H
1544 #include <sys/mount.h>
1545 #endif
1547 mount,
1548 qaddr_t,
1549 m_info)
1551 AC_HAVE_KERNEL_STRUCT_FIELD([
1552 #include <sys/types.h>
1553 #include <sys/param.h>
1554 #include <sys/mount.h>
1556 vfsconf,
1557 int,
1558 vfc_refcount)
1560 AC_HAVE_KERNEL_STRUCT_FIELD([
1561 #include <sys/types.h>
1562 #include <sys/param.h>
1563 #include <sys/mount.h>
1565 vfsconf,
1566 int (*)(void),
1567 vfc_mountroot)
1569 AC_HAVE_KERNEL_STRUCT_FIELD([
1570 #include <sys/types.h>
1571 #ifdef HAVE_SYS_CDEFS_H
1572 #include <sys/cdefs.h>
1573 #endif
1574 #include <sys/uio.h>
1576 uio,
1577 struct proc *,
1578 uio_procp)
1580 AC_HAVE_KERNEL_STRUCT_FIELD([
1581 #include <sys/types.h>
1582 #include <sys/param.h>
1583 #include <sys/mount.h>
1585 vfsops,
1586 struct vnodeopv_desc **,
1587 vfs_opv_descs)
1589 AC_HAVE_KERNEL_STRUCT_FIELD([
1590 #include <sys/types.h>
1591 #include <sys/param.h>
1592 #include <sys/mount.h>
1594 vfsops,
1595 char *,
1596 vfs_name)
1598 AC_HAVE_KERNEL_STRUCT_FIELD([
1599 #include <sys/types.h>
1600 #include <sys/param.h>
1601 #include <sys/mount.h>
1603 vfsops,
1604 void *,
1605 vfs_uninit)
1607 AC_HAVE_KERNEL_STRUCT_FIELD([
1608 #include <sys/types.h>
1609 #include <sys/param.h>
1610 #include <sys/mount.h>
1612 vfsops,
1613 void *,
1614 vfs_reinit)
1616 AC_HAVE_KERNEL_STRUCT_FIELD([
1617 #include <sys/types.h>
1618 #include <sys/param.h>
1619 #include <sys/mount.h>
1621 vfsops,
1622 struct sysctl_oid *,
1623 vfs_oid)
1625 AC_HAVE_KERNEL_STRUCT_FIELD([
1626 #include <sys/types.h>
1627 #include <sys/param.h>
1628 #include <sys/mount.h>
1630 vfsops,
1631 int,
1632 vfs_done)
1634 save_test_KERNEL_CFLAGS="$test_KERNEL_CFLAGS"
1635 test_KERNEL_CFLAGS="$test_KERNEL_CFLAGS $BSD_WERROR"
1637 AC_HAVE_KERNEL_STRUCT_FIELD([
1638 #include <sys/types.h>
1639 #include <sys/param.h>
1640 #include <sys/time.h>
1641 #include <sys/proc.h>
1642 #include <sys/mount.h>
1643 typedef int (*mount_type)(struct mount *, const char *, void *, struct nameidata *, struct proc *);
1645 vfsops,
1646 mount_type,
1647 vfs_mount)
1649 test_KERNEL_CFLAGS="$save_test_KERNEL_CFLAGS"
1651 AC_HAVE_KERNEL_STRUCT_FIELD([
1652 #include <sys/types.h>
1653 #include <sys/param.h>
1654 #include <sys/mount.h>
1656 vfsops,
1657 void *,
1658 vfs_checkexp)
1660 AC_HAVE_KERNEL_STRUCT_FIELD([
1661 #include <sys/types.h>
1662 #include <sys/param.h>
1663 #include <sys/mount.h>
1665 vfsops,
1666 void *,
1667 vfs_wassysctl)
1669 AC_HAVE_KERNEL_STRUCT_FIELD([
1670 #include <sys/types.h>
1671 #include <sys/param.h>
1672 #include <sys/mount.h>
1674 vfsops,
1675 void *,
1676 vfs_snapshot)
1678 AC_HAVE_KERNEL_STRUCT_FIELD([
1679 #include <sys/types.h>
1680 #include <sys/param.h>
1681 #include <sys/mount.h>
1683 vfsops,
1684 void *,
1685 vfs_extattrctl)
1687 AC_HAVE_KERNEL_STRUCT_FIELD([
1688 #include <sys/types.h>
1689 #include <sys/param.h>
1690 #include <sys/mount.h>
1692 vfsops,
1693 void *,
1694 vfs_mountroot)
1696 AC_HAVE_KERNEL_STRUCT_FIELD([
1697 #include <sys/types.h>
1698 #include <sys/param.h>
1699 #include <sys/mount.h>
1701 vfsops,
1702 void *,
1703 vfs_swapvp)
1705 AC_HAVE_KERNEL_STRUCT_FIELD([
1706 #include <sys/types.h>
1707 #include <sys/param.h>
1708 #include <sys/mount.h>
1710 vfsops,
1711 void *,
1712 vfs_smoothsync)
1714 AC_HAVE_KERNEL_STRUCT_FIELD([
1715 #include <sys/types.h>
1716 #include <sys/systm.h>
1717 #ifdef HAVE_SYS_SYSENT_H
1718 #include <sys/sysent.h>
1719 #endif
1721 sysent,
1722 int,
1723 sy_flags)
1725 AC_HAVE_KERNEL_STRUCT_FIELD([
1726 #include <sys/types.h>
1727 #include <sys/systm.h>
1728 #ifdef HAVE_SYS_SYSENT_H
1729 #include <sys/sysent.h>
1730 #endif
1732 sysent,
1733 unsigned char,
1734 sy_info)
1736 AC_HAVE_KERNEL_STRUCT_FIELD([
1737 #ifdef HAVE_SYS_TYPES_H
1738 #include <sys/types.h>
1739 #endif
1740 #ifdef HAVE_SYS_PARAM_H
1741 #include <sys/param.h>
1742 #endif
1743 #ifdef HAVE_SYS_TIME_H
1744 #include <sys/time.h>
1745 #endif
1746 #ifdef HAVE_SYS_PROC_H
1747 #include <sys/proc.h>
1748 #endif
1749 #ifdef HAVE_SYS_VNODE_H
1750 #include <sys/vnode.h>
1751 #endif
1752 #ifdef HAVE_SYS_MOUNT_H
1753 #include <sys/mount.h>
1754 #endif
1756 vnode,
1757 u_long,
1758 v_id)
1760 AC_HAVE_KERNEL_STRUCT_FIELD([
1761 #include <sys/types.h>
1762 #include <sys/param.h>
1763 #include <sys/vnode.h>
1765 vop_fsync_args,
1766 int,
1767 a_flags)
1769 AC_HAVE_KERNEL_STRUCT_FIELD([
1770 #include <sys/types.h>
1771 #include <sys/param.h>
1772 #include <sys/vnode.h>
1774 vop_putpages_args,
1775 int,
1776 a_sync)
1778 AC_HAVE_KERNEL_STRUCT_FIELD([
1779 #include <sys/types.h>
1780 #include <sys/param.h>
1781 #include <sys/vnode.h>
1783 vop_getpages_args,
1784 voff_t,
1785 a_offset)
1787 AC_HAVE_KERNEL_DEF([
1788 #ifdef HAVE_SYS_TYPES_H
1789 #include <sys/types.h>
1790 #endif
1791 #ifdef HAVE_SYS_PARAM_H
1792 #include <sys/param.h>
1793 #endif
1794 #ifdef HAVE_SYS_MOUNT_H
1795 #include <sys/mount.h>
1796 #endif
1797 #ifdef HAVE_SYS_TIME_H
1798 #include <sys/time.h>
1799 #endif
1800 #ifdef HAVE_SYS_PROC_H
1801 #include <sys/proc.h>
1802 #endif
1803 #ifdef HAVE_SYS_SA_H
1804 #include <sys/sa.h>
1805 #endif
1806 #ifdef HAVE_SYS_SYSPROTO_H
1807 #include <sys/sysproto.h>
1808 #endif
1809 #ifdef HAVE_SYS_SYSCALLARGS_H
1810 #include <sys/syscallargs.h>
1811 #endif
1813 struct setgroups_args)
1815 AC_HAVE_KERNEL_DEF([
1816 #ifdef HAVE_SYS_TYPES_H
1817 #include <sys/types.h>
1818 #endif
1819 #ifdef HAVE_SYS_PARAM_H
1820 #include <sys/param.h>
1821 #endif
1822 #ifdef HAVE_SYS_MOUNT_H
1823 #include <sys/mount.h>
1824 #endif
1825 #ifdef HAVE_SYS_TIME_H
1826 #include <sys/time.h>
1827 #endif
1828 #ifdef HAVE_SYS_PROC_H
1829 #include <sys/proc.h>
1830 #endif
1831 #ifdef HAVE_SYS_SA_H
1832 #include <sys/sa.h>
1833 #endif
1834 #ifdef HAVE_SYS_SYSPROTO_H
1835 #include <sys/sysproto.h>
1836 #endif
1837 #ifdef HAVE_SYS_SYSCALLARGS_H
1838 #include <sys/syscallargs.h>
1839 #endif
1841 struct sys_setgroups_args)
1843 AC_HAVE_KERNEL_STRUCT_FIELD([
1844 #include <sys/types.h>
1845 #include <sys/time.h>
1846 #ifdef HAVE_SYS_CDEFS_H
1847 #include <sys/cdefs.h>
1848 #endif
1849 #include <sys/conf.h>
1851 cdevsw,
1852 d_stop_t *,
1853 d_stop)
1855 AC_HAVE_KERNEL_STRUCT_FIELD([
1856 #include <sys/types.h>
1857 #include <sys/time.h>
1858 #ifdef HAVE_SYS_CDEFS_H
1859 #include <sys/cdefs.h>
1860 #endif
1861 #include <sys/conf.h>
1863 cdevsw,
1864 d_reset_t *,
1865 d_reset)
1867 AC_HAVE_KERNEL_STRUCT_FIELD([
1868 #include <sys/types.h>
1869 #include <sys/time.h>
1870 #ifdef HAVE_SYS_CDEFS_H
1871 #include <sys/cdefs.h>
1872 #endif
1873 #include <sys/conf.h>
1875 cdevsw,
1876 d_reset_t *,
1877 d_bogoreset)
1879 AC_HAVE_KERNEL_STRUCT_FIELD([
1880 #include <sys/types.h>
1881 #include <sys/time.h>
1882 #ifdef HAVE_SYS_CDEFS_H
1883 #include <sys/cdefs.h>
1884 #endif
1885 #include <sys/conf.h>
1887 cdevsw,
1888 d_kqfilter_t *,
1889 d_kqfilter)
1891 AC_HAVE_KERNEL_STRUCT_FIELD([
1892 #include <sys/types.h>
1893 #include <sys/time.h>
1894 #ifdef HAVE_SYS_CDEFS_H
1895 #include <sys/cdefs.h>
1896 #endif
1897 #include <sys/conf.h>
1899 cdevsw,
1900 size_t,
1901 d_psize)
1903 AC_HAVE_KERNEL_STRUCT_FIELD([
1904 #include <sys/types.h>
1905 #include <sys/time.h>
1906 #ifdef HAVE_SYS_CDEFS_H
1907 #include <sys/cdefs.h>
1908 #endif
1909 #include <sys/conf.h>
1911 cdevsw,
1912 d_devtotty_t *,
1913 d_devtotty)
1915 AC_HAVE_KERNEL_STRUCT_FIELD([
1916 #include <sys/types.h>
1917 #include <sys/time.h>
1918 #ifdef HAVE_SYS_CDEFS_H
1919 #include <sys/cdefs.h>
1920 #endif
1921 #include <sys/conf.h>
1923 cdevsw,
1924 d_parms_t *,
1925 d_bogoparms)
1927 AC_HAVE_KERNEL_STRUCT_FIELD([
1928 #include <sys/types.h>
1929 #include <sys/time.h>
1930 #ifdef HAVE_SYS_CDEFS_H
1931 #include <sys/cdefs.h>
1932 #endif
1933 #include <sys/conf.h>
1935 cdevsw,
1936 void *,
1937 d_spare)
1939 AC_HAVE_KERNEL_STRUCT_FIELD([
1940 #include <sys/types.h>
1941 #include <sys/time.h>
1942 #ifdef HAVE_SYS_CDEFS_H
1943 #include <sys/cdefs.h>
1944 #endif
1945 #include <sys/conf.h>
1947 cdevsw,
1948 d_mmap_t,
1949 d_mmap)
1951 AC_HAVE_KERNEL_STRUCT_FIELD([
1952 #include <sys/types.h>
1953 #include <sys/time.h>
1954 #ifdef HAVE_SYS_CDEFS_H
1955 #include <sys/cdefs.h>
1956 #endif
1957 #include <sys/conf.h>
1959 cdevsw,
1960 d_strategy_t,
1961 d_strategy)
1963 AC_HAVE_KERNEL_STRUCT_FIELD([
1964 #include <sys/types.h>
1965 #include <sys/time.h>
1966 #ifdef HAVE_SYS_CDEFS_H
1967 #include <sys/cdefs.h>
1968 #endif
1969 #include <sys/conf.h>
1971 cdevsw,
1972 dumper_t,
1973 d_dump)
1975 AC_HAVE_KERNEL_STRUCT_FIELD([
1976 #include <sys/types.h>
1977 #include <sys/time.h>
1978 #ifdef HAVE_SYS_CDEFS_H
1979 #include <sys/cdefs.h>
1980 #endif
1981 #include <sys/conf.h>
1983 cdevsw,
1984 int,
1985 d_maxio)
1987 AC_HAVE_KERNEL_STRUCT_FIELD([
1988 #include <sys/types.h>
1989 #include <sys/time.h>
1990 #ifdef HAVE_SYS_CDEFS_H
1991 #include <sys/cdefs.h>
1992 #endif
1993 #include <sys/conf.h>
1995 cdevsw,
1996 int,
1997 d_bmaj)
1999 AC_HAVE_KERNEL_STRUCT_FIELD([
2000 #include <sys/types.h>
2001 #ifdef HAVE_SYS_CDEFS_H
2002 #include <sys/cdefs.h>
2003 #endif
2004 #include <sys/uio.h>
2005 #include <sys/namei.h>
2007 componentname,
2008 u_long,
2009 cn_hash)
2011 AC_CHECK_BSD_UVM_ONLY
2014 dnl linux
2017 elif test "$NNPFS_SUBDIR" = "linux"; then
2019 AC_CONFIG_FILES([nnpfs/linux/Makefile nnpfs/linux/bin/Makefile])
2021 dnl Linux devfs check
2022 AC_CHECK_HEADERS(linux/devfs_fs.h linux/stddef.h)
2024 AC_HAVE_KERNEL_STRUCT_FIELD([
2025 #define __KERNEL__
2026 #include <asm/current.h>
2027 #include <linux/fs.h>
2029 ViceIoctl,
2030 caddr_t,
2033 AC_HAVE_LINUX_KERNEL_TYPES(int8_t int16_t int32_t int64_t)
2034 AC_HAVE_LINUX_KERNEL_TYPES(uint8_t uint16_t uint32_t uint64_t)
2036 AC_LINUX_FUNC_INIT_MUTEX
2038 elif test "$NNPFS_SUBDIR" = "solaris"; then
2040 AC_CONFIG_FILES([nnpfs/solaris/Makefile nnpfs/solaris/bin/Makefile])
2042 AC_HAVE_KERNEL_STRUCT_FIELD([
2043 #include <sys/types.h>
2044 #include <sys/vfs.h>
2045 typedef void (*freevfs_type)(struct vfs *);
2047 vfsops,
2048 freevfs_type,
2049 vfs_freevfs)
2051 elif test "$NNPFS_SUBDIR" = "irix"; then
2053 AC_CONFIG_FILES([nnpfs/irix/Makefile nnpfs/irix/bin/Makefile])
2055 elif test "$NNPFS_SUBDIR" = "aix"; then
2057 AC_CONFIG_FILES([nnpfs/aix/Makefile nnpfs/aix/bin/Makefile])
2059 fi # end of OS-specific tests
2062 dnl Global kernel checks
2065 AC_CHECK_KERNEL_FUNCS(strlcpy)
2068 dnl Arla configuration. Default values, overrided below if needed
2071 arla_AC_SUBST_VALUE(ARLA_CONF_HIGHVNODES,4000)
2072 arla_AC_SUBST_VALUE(ARLA_CONF_LOWVNODES,3000)
2073 arla_AC_SUBST_VALUE(ARLA_CONF_HIGHBYTES,1400M)
2074 arla_AC_SUBST_VALUE(ARLA_CONF_LOWBYTES,700M)
2076 dnl override section
2078 case "$target_os" in
2079     linux*|darwin*)
2080         ARLA_CONF_HIGHVNODES=40000
2081         ARLA_CONF_LOWVNODES=30000
2082         ;;
2083 esac
2086 # Libtool vs automake stuff
2089 LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's/\.o/\.lo/g'`
2090 AC_SUBST(LTLIBOBJS)
2092 AH_BOTTOM([#ifdef ROKEN_RENAME
2093 #include "roken_rename.h"
2094 #endif])
2096 # Almost done....
2098 AC_OUTPUT(Makefile                              \
2099         include/Makefile                        \
2100         arlad/Makefile                          \
2101         lwp/Makefile                            \
2102         nnpfs/Makefile                          \
2103         nnpfs/dummer/Makefile                   \
2104         rx/Makefile                             \
2105         rxdef/Makefile                          \
2106         rxgk/Makefile                           \
2107         rxkad/Makefile                          \
2108         appl/Makefile                           \
2109         appl/lib/Makefile                       \
2110         appl/aafs/Makefile                      \
2111         appl/aafs-perl/Makefile                 \
2112         appl/kalog/Makefile                     \
2113         appl/afsmgr/Makefile                    \
2114         appl/afsutils/Makefile                  \
2115         appl/amon/Makefile                      \
2116         appl/afstool/Makefile                   \
2117         appl/fs/Makefile                        \
2118         appl/rxgklog/Makefile                   \
2119         appl/pts/Makefile                       \
2120         appl/perf/Makefile                      \
2121         appl/udebug/Makefile                    \
2122         appl/vos/Makefile                       \
2123         appl/bos/Makefile                       \
2124         appl/mac/Makefile                       \
2125         appl/mac/install/Info.plist             \
2126         appl/mac/Arla_Configuration/Makefile    \
2127         appl/mac/Arla_Configuration/Info.plist  \
2128         appl/mac/arlacmm/Makefile               \
2129         appl/mac/mafslog/Makefile               \
2130         doc/Makefile                            \
2131         lib/Makefile                            \
2132         lib/roken/Makefile                      \
2133         lib/sl/Makefile                         \
2134         lib/editline/Makefile                   \
2135         lib/ko/Makefile                         \
2136         lib/vers/Makefile                       \
2137         lib/bufdir/Makefile                     \
2138         util/Makefile                           \
2139         ydr/Makefile                            \
2140         conf/Makefile                           \
2141         tools/Makefile                          \
2142         tools/gnats/Makefile                    \
2143         tools/release-tools/Makefile            \
2144         milko/Makefile                          \
2145         milko/lib/Makefile                      \
2146         milko/lib/vstatus/Makefile              \
2147         milko/lib/dpart/Makefile                \
2148         milko/lib/voldb/Makefile                \
2149         milko/lib/vld/Makefile                  \
2150         milko/lib/ropa/Makefile                 \
2151         milko/lib/msecurity/Makefile            \
2152         milko/lib/mlog/Makefile                 \
2153         milko/lib/mdb/Makefile                  \
2154         milko/appl/Makefile                     \
2155         milko/appl/sked/Makefile                \
2156         milko/appl/bootstrap/Makefile           \
2157         milko/fs/Makefile                       \
2158         milko/vldb/Makefile                     \
2159         milko/pts/Makefile                      \
2160         milko/bos/Makefile                      \
2161         tests/Makefile)
2163 AC_KRB_VERSION(arla)