*** empty log message ***
[arla.git] / configure.in
blobc8b2bf4b4275a9e8b5c767c9a7df04b343433d21
1 AC_REVISION($Revision$)dnl
2 AC_PREREQ(2.59)
3 AC_INIT(arla, 0.42pre, [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     netbsd*)
144     default_sys=${SYSDIR:-/usr/src/sys}
145     ;;
146     *)
147     default_sys=${SYSDIR:-/sys}
148     ;;
149 esac
151 AC_ARG_WITH(sys,
152 [  --with-sys=dir          use dir as your kernel source code directory
153                           default $default_sys],
154 [SYS=$withval],
155 [SYS="$default_sys"])
156 AC_SUBST(SYS)
158 AC_ARG_WITH(kernel-obj,
159 [  --with-kernel-obj=dir   use dir as your kernel build directory (used on
160                           FreeBSD to find your actual kernel parameters)],
161 [FBSDKERNBUILDDIR=KERNBUILDDIR\=$withval],
163 AC_SUBST(FBSDKERNBUILDDIR)
165 AC_ARG_WITH(bsd-make,
166 [  --with-bsd-make=prog    when using a bsd and cross compiling we need 
167                           to know your make, default /usr/bin/make],
168 [BSDMAKE=$withval],
169 [BSDMAKE="/usr/bin/make"])
170 AC_SUBST(BSDMAKE)
173 nnpfs_target="$target_os"
174 AC_ARG_ENABLE(nnpfs,
175 [  --disable-nnpfs         build arla w/o nnpfs],
176 [if test "$enableval" = "no" ; then
177   nnpfs_target="without_nnpfs";
178 fi])
180 AC_MSG_CHECKING(for kernel stuff)
181 case "$nnpfs_target" in
182 sunos4.1*) 
183   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/sunos
184   KERNEL_SRCS='sunos-subr.c'
185   KERNEL_HDRS=''
186   NNPFS_SUBDIR=sunos
187   KERNEL=/vmunix
188   AC_MSG_RESULT(SunOS 4.1.x)
189   ;;
190 solaris*)
191   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/solaris
192   KERNEL_SRCS='solaris-subr.c'
193   KERNEL_HDRS=''
194   NNPFS_SUBDIR=solaris
195   KERNEL=/dev/ksyms
196   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_KERNEL"
197   AC_MSG_RESULT(Solaris)
198   case "$target_cpu" in
199   sparc64) AC_DEFINE(NEED_VICEIOCTL32, 1,
200         [define if you need 32 bit compat pioctl])
201            KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_SYSCALL32 -D_SYSCALL32_IMPL"
202            ;;
203   esac
204   ;;
205 irix*)
206   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/irix
207   KERNEL_SRCS='irix-subr.c'
208   KERNEL_HDRS=''
209   ip=`hinv -c processor | awk '$4 ~ /IP/ { print $4}'`
210   cpu=`hinv -t cpu | awk '{print $3}'`
211   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D$ip -D$cpu -DR4000"
212   NNPFS_SUBDIR=irix
213   KERNEL=/unix
214   case "$target_os" in
215   irix6.[[4-9]])
216     AC_DEFINE(IRIX_64, 1, [define this if on Irix6.4 or higher]) ;;
217   esac
218   AC_MSG_RESULT(Irix)
219   ;;
220 hpux*)
221   KERNEL_SRCS='hpux-subr.c'
222   AC_MSG_RESULT(hp-ux)
223   KERNEL=/hp-ux
224   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
225   AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff)
226   ;;
227 aix*)
228   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/aix
229   KERNEL_SRCS='aix-subr.c'
230   KERNEL_HDRS=''
231   NNPFS_SUBDIR=aix
232   AC_MSG_RESULT(AIX)
233   ;;  
234 openbsd*)
235   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
236   KERNEL_SRCS='bsd-subr.c'
237   KERNEL_HDRS=''
238   AC_WERROR(BSD_WERROR)
239   MODULE=nnpfs_mod.o
240   cat > conftest.mk << END
241 .include <bsd.lkm.mk>
242 .if defined(UVM) && (\${UVM} != "no")
243 CFLAGS+=-DUVM
244 .endif
245 .if PMAP_NEW
246 CFLAGS+=-DPMAP_NEW
247 .endif
248 echo:
249         @echo \$(CFLAGS) \$(CPPFLAGS)
251   ac_out=`$BSDMAKE S=$SYS -f conftest.mk echo 2> /dev/null`
252   incl=-I$SYS
253   defs= flags=
254   for i in $ac_out; do
255         case "$i" in
256                 -I*)    if test "$i" != -I. -a "$i" != "-I`pwd`"; then
257                                 incl="$incl${incl:+ }$i"
258                         fi
259                         ;;
260                 -D*)    defs="$defs${defs:+ }$i" ;;
261                 -m*)    flags="$flags${flags:+ }$i" ;;
262                 -f*)    flags="$flags${flags:+ }$i" ;;
263                 *)      ;;
264         esac
265   done
266 ## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
267   # make sure we compile with -mno-fp-regs on alpha
268   if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
269   then
270         flags="$flags${flags:+ }-mno-fp-regs"
271   fi
272   if test `uname -m` = pmax
273   then
274         KERNEL_CFLAGS="${KERNEL_CFLAGS} -G 0 -mno-abicalls -mno-half-pic"
275         KERNEL_LDFLAGS="${KERNEL_LDFLAGS} -G 0 -Ttext 0x80030000 -T ${SYS}/arch/mips/conf/kern.ldscript"
276   fi
277   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_LKM"
278   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
279   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
280   KERNEL_LD='ld'
281   if test `uname -m` = pmax
282   then
283       ac_kernel_ld='${KERNEL_LD} ${KERNEL_LDFLAGS} -o conftest $LDFLAGS -R $KERNEL conftest.o -e _foo 1>&5'
284   fi
286   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'
287   NNPFS_SUBDIR=bsd
288   KERNEL=/bsd
289   MODLOAD=modload
290   MODUNLOAD=modunload
291   AC_MSG_RESULT(OpenBSD)
292   ;;
293 netbsd* | netbsdelf*)
294   AC_WERROR(BSD_WERROR)
295   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
296   KERNEL_SRCS='bsd-subr.c'
297   KERNEL_HDRS=''
298   MODULE=nnpfs_mod.o
299   cat > conftest.mk << END
300 .include <bsd.kmod.mk>
301 .if UVM
302 CFLAGS+=-DUVM
303 .endif
304 .if PMAP_NEW
305 CFLAGS+=-DPMAP_NEW
306 .endif
307 echo:
308         @echo \$(CFLAGS) \$(CPPFLAGS)
310   ac_out=`$BSDMAKE S=$SYS -f conftest.mk echo 2> /dev/null`
311   incl=-I$SYS
312   defs= flags=
313   set X $ac_out ; shift
314   while test $# != 0; do
315         case "$1" in
316                 -I*|-nostdinc)
317                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
318                                 incl="$incl${incl:+ }$1"
319                         fi
320                         ;;
321                 -isystem)
322                         shift
323                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
324                                 incl="$incl${incl:+ }-isystem $1"
325                         fi
326                         ;;
328                 -D*)    defs="$defs${defs:+ }$1" ;;
329                 -m*)    flags="$flags${flags:+ }$1" ;;
330                 -f*)    flags="$flags${flags:+ }$1" ;;
331                 *)      ;;
332         esac
333         shift
334   done
335 ## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
336   # make sure we compile with -mno-fp-regs on alpha
337   if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
338   then
339         flags="$flags${flags:+ }-mno-fp-regs"
340   fi
341   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
342   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
343   KERNEL_LD='ld'
344   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'
345   NNPFS_SUBDIR=bsd
346   KERNEL=/netbsd
347   MODLOAD=modload
348   MODUNLOAD=modunload
350   dnl
351   dnl Ok, lets build the symlinks the lkm needs
352   dnl  First make sure the directory and file exists
353   dnl  Then run make depend to create the symlinks
354   dnl  And a last thing in this ugly hack, add a -I to that directory
356   test -d include/netbsd-lkm || \
357        "$srcdir"/mkinstalldirs include/netbsd-lkm > /dev/null 2>/dev/null
359   kakasrcdir=`cd $srcdir && pwd`
361   (cd include/netbsd-lkm &&  \
362    $BSDMAKE S="$SYS" foosrc=$kakasrcdir/include/netbsd-lkm \
363         -f "$kakasrcdir"/include/netbsd-lkm/Makefile depend>/dev/null)
365   KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -I`pwd`/include/netbsd-lkm"
367   if test "X$smp" != "Xno" -a "X$smp" != "X"; then
368         KERNEL_CPPFLAGS="$KERNEL_CPPFLAGS -DMULTIPROCESSOR"
369   fi
371   AC_MSG_RESULT(NetBSD)
372   ;;
373 dragonfly*)
374   AC_WERROR(BSD_WERROR)
375   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
376   KERNEL_SRCS='bsd-subr.c'
377   KERNEL_HDRS=''
378   KERNEL=/kernel
379   MODULE=nnpfs.ko
381   if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
382         smp="-DAPIC_IO $smp"
383   else
384         smp=""
385   fi
387   KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-O"
388   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DVFS_KLD -DKLD_MODULE -I$SYS/arch -I$SYS -I."
389   KERNEL_LD='ld'
391   NNPFS_SUBDIR=bsd
392   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'
393   MODLOAD=modload
394   MODUNLOAD=modunload
395   AC_MSG_RESULT(DragonFly)
396   ;;
397 freebsd[[56789]]* | freebsdelf[[56789]]*)
398   AC_MSG_RESULT([FreeBSD [[56789]].x])
399   KERNEL=`sysctl -n kern.bootfile`
400   AC_WERROR(BSD_WERROR)
401   NNPFS_SUBDIR=freebsd
402   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
403   KERNEL_SRCS='bsd-subr.c'
405   KERNEL=`sysctl -n kern.bootfile`
407   cat > conftest.mk << END
408 KMOD= nonesuch
409 SRCS= nonesuch.c
410 .include <bsd.kmod.mk>
411 echo:
412         @echo \$(CFLAGS) \$(CPPFLAGS)
414   ac_out=`$BSDMAKE S=$SYS -f conftest.mk echo 2> /dev/null`
415   incl=-I$SYS
416   defs= flags=
417   set X $ac_out ; shift
418   while test $# != 0; do
419         case "$1" in
420                 -I*|-nostdinc)
421                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
422                                 incl="$incl${incl:+ }$1"
423                         fi
424                         ;;
425                 -isystem)
426                         shift
427                         if test "$1" != -I. -a "$1" != "-I`pwd`"; then
428                                 incl="$incl${incl:+ }-isystem $1"
429                         fi
430                         ;;
432                 -D*)    defs="$defs${defs:+ }$1" ;;
433                 -m*)    flags="$flags${flags:+ }$1" ;;
434                 -f*)    flags="$flags${flags:+ }$1" ;;
435                 *)      ;;
436         esac
437         shift
438   done
439   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -I. $defs${defs:+ }$flags${flags:+ }$incl"
440   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
441   KERNEL_LD='ld'
443   ;;
445 freebsd[[34]]* | freebsdelf[[34]]*)
446   AC_MSG_RESULT([FreeBSD [[34]].x])
447   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
448   KERNEL_SRCS='bsd-subr.c'
449   KERNEL_HDRS=''
450   KERNEL=`sysctl -n kern.bootfile`
451   AC_WERROR(BSD_WERROR)
452   AC_MSG_CHECKING(for kernel object format)
453   kernobjformat=aout
454   case `file $KERNEL 2>/dev/null` in
455   *ELF*)  kernobjformat=elf ;;
456   esac
457   AC_MSG_RESULT($kernobjformat)
459   AC_MSG_CHECKING(for kld)
460   dnl Default to kld if freebsd4.0
461   case "$target_os" in
462         freebsd4*)
463         if test "X$kld" = "X"; then
464                 kld="yes";
465         fi
466         if test "X$smp" != "Xno" -a "X$xmp" != "X"; then
467                 smp="-DAPIC_IO $smp"
468         else
469                 smp=""
470         fi
471         ;;
472   esac
473   AC_SUBST(FREEBSD_GENSETDEFS)
475   dnl Or if the kernel is ELF
476   case "$kernobjformat" in
477         elf*)
478         if test "X$kld" = "X"; then
479                 kld=yes;
480         fi
481         ;;
482   esac
483   KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-O"
484   if test `uname -m` = alpha -a `expr X"$KERNEL_CFLAGS" : ".*-mno-fp-regs"` -eq 0
485   then
486         KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-mno-fp-regs"
487   fi
488   if test "$kld" = "yes"; then
489     KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DVFS_KLD -DKLD_MODULE -I$SYS/arch -I$SYS -I."
490     test_KERNEL_CFLAGS="-$kernobjformat ${KERNEL_CFLAGS}"
491     KERNEL_LD='ld'
492     case "$kernobjformat" in
493     aout) extra_LDFLAGS="-A" ;;
494     elf)  extra_LDFLAGS="-R" ;;
495     *) AC_MSG_ERROR([Unknown object format $kernobjformat])
496     esac
497     ac_kernel_ld='${LD-ld} -$kernobjformat -o conftest $LDFLAGS $extra_LDFLAGS $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
498     MODULE=nnpfs.ko
499     AC_MSG_RESULT(yes)
500   else
501     if test "$kernobjformat" != "aout"; then
502       AC_MSG_WARN([You cannot build LKMs against $kernobjformat kernels])
503     fi
504     KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DLKM -D_LKM -DVFS_LKM -DACTUALLY_LKM_NOT_KERNEL -I$SYS/arch -I$SYS -I."
505     test_KERNEL_CFLAGS="-aout ${KERNEL_CFLAGS}"
506     KERNEL_LD='ld -aout'
507     ac_kernel_ld='${LD-ld} -aout -o conftest $LDFLAGS -A $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
508     MODULE=nnpfs_mod.o
509     AC_MSG_RESULT(no)
510   fi
512   NNPFS_SUBDIR=bsd
513   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'
514   MODLOAD=modload
515   MODUNLOAD=modunload
517   ;;
518 darwin*)
519   AC_MSG_RESULT(MacOS)
520   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/bsd
521   KERNEL_SRCS='bsd-subr.c'
522   KERNEL_HDRS=''
523   KERNEL=/mach
524   case "$nnpfs_target" in
525     darwin6.*) COM_APPLE_KERNEL_BSD="6.0" ;;
526     darwin7.*) COM_APPLE_KERNEL_BSD="6.0" ;;
527     darwin8.*) COM_APPLE_KERNEL_BSD="6.0" ;;
528     darwin*)  COM_APPLE_KERNEL_BSD="1.1" ;;
529     *) AC_MSG_ERROR([Unknown kernel version])
530   esac
531   AC_CONFIG_FILES([nnpfs/bsd/Info.plist])
533   AC_SUBST(COM_APPLE_KERNEL_BSD)
535   ac_cv_func_mmap_fixed_mapped=no               dnl disable mmap for darwin
537   KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -DKERNEL -D_KERNEL -I/System/Library/Frameworks/Kernel.framework/Headers -static -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API"
538   case "$nnpfs_target" in
539     darwin[[789]].*)
540           ;;
541     *) 
542           KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
543           CPPFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
544           CFLAGS="${KERNEL_CPPFLAGS} -traditional-cpp"
545           ;;
546   esac
548   YDR_CPPFLAGS="-traditional-cpp"
550   LDFLAGS="${LDFLAGS} -flat_namespace"
551   KERNEL_CFLAGS="${KERNEL_CFLAGS} -fno-common -Wno-format -pipe -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch -fno-builtin"
552   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
553   KERNEL_LD='ld'
554   MODULE=nnpfs_mod.o
556   MODLOAD=kmodload
557   MODUNLOAD=kmodunload
559   NNPFS_SUBDIR=bsd
560   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'
562   AC_DEFINE([BIND_8_COMPAT], 1,
563         [Define to pull in bind8 glue for darwin.])
565   ;;
566 linux*)
567   AC_MSG_RESULT(Linux)
568   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/linux
569   KERNEL_SRCS='bsd-subr.c'
570   KERNEL_HDRS=''
572   if test "X$smp" = "Xno"; then
573     smp=
574   fi
576   KERNEL_CPPFLAGS="-I$SYS/include -DMODULE -D__KERNEL__ $smp ${KERNEL_CPPFLAGS} "
577   case "$target_cpu" in
578   alpha*)
579     KERNEL_CC=${KERNEL_CC:-$CC}
580     KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fp-regs -ffixed-8" ;;
581   sparc64*)
582     KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fpu -ffixed-g4 -fcall-used-g5 -fcall-used-g7"
583     KERNEL_LD_FLAGS="-m elf64_sparc"
584     KERNEL_CC=${KERNEL_CC:-sparc64-linux-gcc}
585     AC_DEFINE(NEED_VICEIOCTL32, 1,
586         [define if you need 32 bit compat pioctl]) ;;
587   ia64*)
588     LINUX_IA64=yes
589     KERNEL_CC=${KERNEL_CC:-$CC} ;;
590   *)
591     KERNEL_CC=${KERNEL_CC:-$CC} ;;
592   esac
593   test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
594   NNPFS_SUBDIR=linux
595   KERNEL=/dev/null
596   ;;
597 mingw32*)
598   AC_MSG_RESULT(mingw32)
599   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
600   KERNEL_SRCS=unknown-subr.c
601   KERNEL_HDRS=
602   KERNEL=/dev/null
603   NNPFS_SUBDIR=
604   ;;
605 cygwin*)
606   AC_MSG_RESULT(cygwin/VC)
607   AC_MSG_WARN([No kernel support for NT])
608   if test "$with_pthreads" = "windows"; then
609     AC_MSG_WARN([Using LWP on windows native threads])
610     LWP_PROCESS=""
611     LWP_C="plwp.c"
612     LWP_O="plwp.o"
613     LWP_H="plwp.h"
614     PLWP_INC_FLAGS="-DWINDOWS_THREADS_LWP"
615   else
616     AC_MSG_WARN([Using LWP on asm threads or pthreads])
617   fi
618   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
619   KERNEL_SRCS=unknown-subr.c
620   KERNEL_HDRS=
621   KERNEL=/dev/null
622   NNPFS_SUBDIR=
623   ;;
625   AC_MSG_RESULT(none)
626   if test "$nnpfs_target" != "without_nnpfs"; then
627     AC_MSG_WARN([No kernel support for $target_os, compiling only user-level stuff])
628   fi
629   KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/nnpfs/unknown
630   KERNEL_SRCS=unknown-subr.c
631   KERNEL_HDRS=
632   KERNEL=/dev/null
633   NNPFS_SUBDIR=
634   ;;
635 esac
637 dnl ydr need special flags
638 AC_SUBST(YDR_CPPFLAGS)
640 dnl are we dragonfly
641 AM_CONDITIONAL(DFLY, expr "$target_os" : "dragonfly.*" >/dev/null 2>&1)
643 dnl are we freebsd5
644 AM_CONDITIONAL(FBSD5, test X"$FREEBSD5" = Xyes)
646 dnl are we linux-ia64
647 AM_CONDITIONAL(LINUX_IA64, test X"$LINUX_IA64" = Xyes)
649 dnl support for native readdir
650 AM_CONDITIONAL(NNPFS_AFS_READDIR, false)
652 AC_SUBST(BSD_WERROR)
654 AM_CONDITIONAL(DCE, false)
655 AM_CONDITIONAL(MACOSX, test `expr "$nnpfs_target" : darwin` != 0)
657 AC_ARG_WITH(lwp-redzone,
658 [  --without-lwp-redzone   don't use redzone for (asm)lwp],
659 [lwpredzone=$withval],
660 [lwpredzone=yes])
662 AM_CONDITIONAL(LWP_REDZONE, test X$lwpredzone != Xno)
664 # Check where to put the cache
666 AC_ARG_WITH(arlacachedir,
667 [  --with-arlacachedir=dir use dir as cachedir instead of \$prefix/cache],
668 [ARLACACHEDIR=$withval],
669 [ARLACACHEDIR='${prefix}/cache'])
671 # Check where to find the configuration
673 AC_ARG_WITH(arlaconffile,
674 [  --with-arlaconffile=file use file for configuration instead of \$prefix/etc/arla.conf],
675 [ARLACONFFILE=$withval],
676 [ARLACONFFILE='${sysconfdir}/arla.conf'])
678 # Check where to store partitions
680 AC_ARG_WITH(milkopart,
681 [  --with-milkopart=dir    location of milko partitions (default /)],
682 [MILKO_ROOT='-DMILKO_ROOT=\"$withval\"'],
683 [MILKO_ROOT='-DMILKO_ROOT=\"/\"'])
685 # Do we want knfs ?
687 ARLA_KNFS=""
688 AC_ARG_ENABLE(knfs,
689 [  --enable-knfs           make afs nfs-mountable],
690 [ARLA_KNFS="-DARLA_KNFS"])
691 AC_SUBST(ARLA_KNFS)
695 dnl If we want to use pthreads
698 AC_SUBST(LWP_PROCESS)
699 AC_SUBST(PLWP_LIB_FLAGS)
700 AC_SUBST(PLWP_INC_FLAGS)
701 AC_SUBST(LWP_C)
702 AC_SUBST(LWP_O)
703 AC_SUBST(LWP_H)
705 AC_TYPE_MSGHDR
706 AC_TYPE_IOVEC
708 dnl AC_TYPE_MODE_T
709 dnl AC_CHECK_TYPE(nlink_t, int)
712 dnl Tests for readline/editline
715 rk_TEST_PACKAGE(readline,
716 [#include <stdio.h>
717  #include <readline.h>],-lreadline,,, READLINE)
719 if test "$with_readline" = "no"; then
720         AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
721         if test "$ac_cv_funclib_tgetent" = "no"; then
722                 AC_MSG_ERROR([Could not find tgetent, needed by edit/editline])
723         fi
724         AC_FIND_FUNC_NO_LIBS(readline, editline edit readline, [], [], [$LIB_tgetent])
725         if test "$ac_cv_func_readline" = "no"; then
726                 AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
727                 if test "$ac_cv_func_el_init" = yes; then
728                         editline_OBJS=edit_compat.o
729                         LIB_readline='-L'`pwd`'/lib/editline -leditline '"$LIB_el_init";
730                         INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
731                 else
732                         editline_OBJS="editline.o complete.o sysunix.o"
733                         LIB_readline='-L'`pwd`'/lib/editline -leditline'
734                         INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
735                 fi
736         fi
738 AC_DEFINE(HAVE_READLINE, 1, [define if you have a function readline])
740 LIB_readline_ac="$LIB_readline $LIB_tgetent"
741 LIB_readline="$LIB_readline \$(LIB_tgetent)"
747 AC_ARG_ENABLE(mmap,
748 [  --disable-mmap          don't use mmap],
749 [if test "$enableval" = "no"; then
750   ac_cv_func_mmap_fixed_mapped=no
751  fi])
753 aix_dynamic_afs=yes
754 AC_ARG_ENABLE(dynamic-afs,
755 [  --disable-dynamic-afs   don't use loaded AFS library with AIX],[
756 if test "$enableval" = "no"; then
757         aix_dynamic_afs=no
761 syscallhack=yes
762 AC_ARG_ENABLE(linux-syscall,
763         AC_HELP_STRING([--disable-linux-syscall],[don't modify the syscall table on linux]),
764 [if test "$enableval" = "no" ; then
765         syscallhack=no
766 fi])
767 if test "$syscallhack" = "yes"; then
768         AC_DEFINE(SYSCALLHACK, 1, [define to enable syscall table modification on linux])
771 grouppags=yes
772 AC_ARG_ENABLE(linux-group-pags,
773         AC_HELP_STRING([--disable-linux-group-pags],[don't use groups for pags on linux]),
774 [if test "$enableval" = "no" ; then
775         grouppags=no
776 fi])
777 if test "$grouppags" = "yes"; then
778         AC_DEFINE(GROUPPAGS, 1, [define to enable groups-based pags on linux])
781 AC_CHECK_LFS
782 AC_CHECK_GLIBC
784 AC_SUBST(LIB_readline)
785 AC_SUBST(INCLUDE_readline)
786 AC_SUBST(editline_OBJS)dnl
787 if test "$editline_OBJS" != ""; then
788   editline_dir=editline
790 AC_SUBST(editline_dir)
792 AC_SUBST(GCC)
793 AC_SUBST(CFLAGS)
794 AC_SUBST(LDFLAGS)
795 AC_SUBST(KERNEL_INCLUDE)
796 AC_SUBST(KERNEL_SRCS)
797 AC_SUBST(KERNEL_HDRS)
798 AC_SUBST(KERNEL_CPPFLAGS)
799 AC_SUBST(KERNEL_CFLAGS)
800 AC_SUBST(KERNEL_LD_FLAGS)
801 AC_SUBST(KERNEL_CC)
802 AC_SUBST(KERNEL_LD)
803 AC_SUBST(MODLOAD)
804 AC_SUBST(MODUNLOAD)
805 AC_SUBST(MODULE)
806 AC_SUBST(NNPFS_SUBDIR)
807 AC_SUBST(NNPFS_SRCS)
808 AC_SUBST(RXKAD_LIBS)
809 AC_SUBST(ARLACACHEDIR)
810 AC_SUBST(ARLACONFFILE)
811 AC_SUBST(MILKO_ROOT)
812 AC_FUNC_MMAP
815 dnl Various checks for headers and their contents
818 AC_HEADER_STDC
819 AC_HEADER_TIME
821 AC_CHECK_HEADERS([                              \
822                 arpa/inet.h                     \
823                 arpa/nameser.h                  \
824                 dbm.h                           \
825                 db.h                            \
826                 dirent.h                        \
827                 err.h                           \
828                 errno.h                         \
829                 elflib/nlist.h                  \
830                 fcntl.h                         \
831                 fnmatch.h                       \
832                 gdbm/ndbm.h                     \
833                 glob.h                          \
834                 ifaddrs.h                       \
835                 kvm.h                           \
836                 libelf/nlist.h                  \
837                 limits.h                        \
838                 machine/asm.h                   \
839                 machine/regdef.h                \
840                 mach/alpha/asm.h                \
841                 ndbm.h                          \
842                 netdb.h                         \
843                 net/if_dl.h                     \
844                 net/if_types.h                  \
845                 netinet/in6.h                   \
846                 netinet/in6_machtypes.h         \
847                 netinet/in.h                    \
848                 nlist.h                         \
849                 openssl/ui.h                    \
850                 pwd.h                           \
851                 regdef.h                        \
852                 rpcsvc/dbm.h                    \
853                 shadow.h                        \
854                 stdint.h                        \
855                 sys/attr.h                      \
856                 sys/bitypes.h                   \
857                 sys/cdefs.h                     \
858                 sys/dir.h                       \
859                 sys/file.h                      \
860                 sys/ioccom.h                    \
861                 sys/ioctl.h                     \
862                 sys/inttypes.h                  \
863                 sys/libkern.h                   \
864                 sys/lkm.h                       \
865                 sys/lock.h                      \
866                 sys/mkdev.h                     \
867                 sys/mman.h                      \
868                 sys/module.h                    \
869                 sys/mutex.h                     \
870                 sys/param.h                     \
871                 sys/prctl.h                     \
872                 sys/poll.h                      \
873                 sys/pool.h                      \
874                 sys/queue.h                     \
875                 sys/resource.h                  \
876                 sys/sa.h                        \
877                 sys/select.h                    \
878                 sys/selinfo.h                   \
879                 sys/socket.h                    \
880                 sys/sockio.h                    \
881                 sys/stat.h                      \
882                 sys/statvfs.h                   \
883                 sys/statfs.h                    \
884                 sys/exec.h                      \
885                 sys/sysent.h                    \
886                 sys/sysproto.h                  \
887                 sys/systm.h                     \
888                 sys/time.h                      \
889                 sys/types.h                     \
890                 sys/ubc.h                       \
891                 sys/utsname.h                   \
892                 sys/vfs.h                       \
893                 sys/vfs_proto.h                 \
894                 sys/vnode.h                     \
895                 sys/wait.h                      \
896                 vis.h                           \
897                 unistd.h                        \
898                 winsock.h                       \
901 AC_CHECK_HEADERS([net/if.h], , , [AC_INCLUDES_DEFAULT
902 #if HAVE_SYS_SOCKET_H
903 #include <sys/socket.h>
904 #endif])
906 AC_CHECK_HEADERS(netinet6/in6_var.h, , , [AC_INCLUDES_DEFAULT
907 #ifdef HAVE_NETINET6_IN6_H
908 #include <netinet6/in6.h>
909 #endif
912 AC_CHECK_HEADERS([                      \
913                 sys/proc.h              \
914                 sys/mount.h             \
915                 sys/signalvar.h         \
916                 sys/user.h              \
917 ], , , [AC_INCLUDES_DEFAULT
918 #ifdef HAVE_SYS_PARAM_H
919 #include <sys/param.h>
920 #endif
923 AC_CHECK_HEADERS([                      \
924                 sys/syscallargs.h       \
925 ], , , [AC_INCLUDES_DEFAULT
926 #ifdef HAVE_SYS_PARAM_H
927 #include <sys/param.h>
928 #endif
929 #ifdef HAVE_SYS_MOUNT_H
930 #include <sys/mount.h>
931 #endif
932 #ifdef HAVE_SYS_SA_H
933 #include <sys/sa.h>
934 #endif
937 AC_CHECK_HEADERS([resolv.h], , , [AC_INCLUDES_DEFAULT
938 #ifdef HAVE_SYS_TYPES_H
939 #include <sys/types.h>
940 #endif
941 #ifdef HAVE_NETINET_IN_H
942 #include <netinet/in.h>
943 #endif
944 #ifdef HAVE_ARPA_NAMESER_H
945 #include <arpa/nameser.h>
946 #endif
949 AC__EXTENSIONS__
952 dnl These need to before roken checks
955 AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
956 AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
957 AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
958 AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
959 AM_CONDITIONAL(have_glob_h, test "$ac_cv_header_glob_h" = yes)
960 AM_CONDITIONAL(do_roken_rename, true)
963 dnl and this is for kernel header files
966 save_CPPFLAGS="${CPPFLAGS}"
967 CPPFLAGS="${KERNEL_CPPFLAGS}"
969 AC_CHECK_HEADERS([                              \
970                 miscfs/genfs/genfs.h            \
971                 miscfs/syncfs/syncfs.h          \
972                 uvm/uvm_extern.h                \
973                 vm/vm.h                         \
974                 vm/vm_extern.h                  \
975                 vm/vm_object.h                  \
976                 vm/vm_pager.h                   \
977                 vm/vm_zone.h                    \
978                 vm/vnode_pager.h                \
979                 vm/uma.h                        \
980 ], , , -)
982 CPPFLAGS="${save_CPPFLAGS}"
986 dnl Check for endian-ness
988 KRB_C_BIGENDIAN
991 dnl check for const
994 AC_C_CONST
997 dnl Check for inline
1000 AC_C_INLINE
1003 dnl Check for __FUNCTION__
1006 AC_C___FUNCTION__
1009 dnl Check for __attribute__
1012 AC_C___ATTRIBUTE__
1015 dnl roken stuff
1018 AC_ENABLE_SHARED(no)
1019 AC_PROG_LIBTOOL
1021 rk_DB
1024 # It is said that the kerberos junk needs to be after ac_check_roken,
1025 # but I didn't notice that, so we include some to have a good place
1026 # to check for existing roken in 
1029 AC_CHECK_KERBEROS(54auto)
1030 AC_CHECK_KAFS
1031 #end krb, continue roken stuff
1033 AC_CHECK_ROKEN()
1035 # oh, and put sl here, too
1036 AC_CHECK_SL
1037 # done!
1039 if test "X$ac_cv_arla_with_roken" = "Xyes" ; then
1040    rk_ROKEN(lib/roken)
1041    #LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"
1042 else
1043   dnl inlined parts of rk_ROKEN, seems to be needed by sl and rx sometimes.
1044   AC_BROKEN([                                   \
1045         err                                     \
1046         errx                                    \
1047         strdup                                  \
1048         strtok_r                                \
1049         strupr                                  \
1050         warn                                    \
1051         warnx                                   \
1052   ])
1054 AM_CONDITIONAL(ARLA_LOCAL_ROKEN, test X$ac_cv_arla_with_roken = Xyes)
1056 rk_CHECK_MAN
1058 if test "X$ac_cv_found_krb5" = "Xyes" ; then
1059   RXKAD_LIBS_extra="$RXKAD_LIBS_extra $KRB5_LIB_FLAGS"
1062 if test "X$RXKAD_LIBS_extra" != "X" ; then
1063   RXKAD_LIBS="\$(top_builddir)/rxkad/librxkad.la $RXKAD_LIBS_extra"
1065 AM_CONDITIONAL(RXKAD, test "X$RXKAD_LIBS_extra" != "X")
1067 dnl AC_TYPE_KRB_PRINCIPAL
1068 dnl AC_FUNC_KRB_GET_ERR_TEXT
1069 dnl AC_FUNC_KRB_GET_DEFAULT_TKT_ROOT
1070 dnl AC_FUNC_KRB_GET_DEFAULT_PRINCIPAL
1071 dnl AC_FUNC_KRB_KDCTIMEOFDAY
1072 AC_FUNC_KAFS_SETTOKEN_RXKAD
1075 # check for tf_util
1078 dnl AC_FIND_FUNC_NO_LIBS2(tf_init, "", , , [$KRB4_LIB_FLAGS])
1079 dnl 
1080 dnl if test "$ac_cv_func_tf_init" = yes; then
1081 dnl     APPL_SUBDIRS="$APPL_SUBDIRS kalog"
1082 dnl fi
1083 dnl 
1086 dnl Check for strange operating systems that you need to handle differently
1089 AC_KRB_SYS_AIX
1091 if test "$krb_cv_sys_aix" = yes ;then
1092         if test "$aix_dynamic_afs" = yes; then
1093                 AFS_EXTRA_OBJS='$(srcdir)/afsl.exp dlfcn.o'
1094                 AFS_EXTRA_LIBS=afslib.so
1095                 # this works differently in AIX <=3 and 4
1096                 if test `uname -v` = 4 ; then
1097                         AFS_EXTRA_LD="-bnoentry"
1098                 else
1099                         AFS_EXTRA_LD="-e _nostart"
1100                 fi
1101                 AFS_EXTRA_DEFS=
1102                 AIX_EXTRA_KAFS="-lld"
1103         else
1104                 AFS_EXTRA_OBJS='$(srcdir)/afsl.exp afslib.o'
1105                 AFS_EXTRA_LIBS=
1106                 AFS_EXTRA_DEFS='-DSTATIC_AFS_SYSCALLS'
1107                 AIX_EXTRA_KAFS=
1108         fi
1109         AC_SUBST(AFS_EXTRA_OBJS)dnl
1110         AC_SUBST(AFS_EXTRA_LIBS)dnl
1111         AC_SUBST(AFS_EXTRA_LD)dnl
1112         AC_SUBST(AFS_EXTRA_DEFS)dnl
1113         AC_SUBST(AIX_EXTRA_KAFS)dnl
1117 dnl Check for struct winsize
1120 AC_KRB_STRUCT_WINSIZE
1123 dnl Various checks for libraries and their contents
1126 AC_FIND_FUNC(syslog, syslog)
1129 dnl System V is have misplaced the socket routines, should really be in libc
1132 AC_FIND_FUNC(socket, socket)
1133 AC_FIND_FUNC(gethostbyname, nsl)
1134 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
1136 dnl we don't actually use v6 functions in this code, but some generic
1137 dnl functions such as getnameinfo et al can reside in libraries that are
1138 dnl found by this macro
1140 AC_KRB_IPV6
1142 AC_FIND_FUNC(res_search, resolv,
1144 #include <stdio.h>
1145 #ifdef HAVE_SYS_TYPES_H
1146 #include <sys/types.h>
1147 #endif
1148 #ifdef HAVE_NETINET_IN_H
1149 #include <netinet/in.h>
1150 #endif
1151 #ifdef HAVE_ARPA_NAMESER_H
1152 #include <arpa/nameser.h>
1153 #endif
1154 #ifdef HAVE_RESOLV_H
1155 #include <resolv.h>
1156 #endif
1158 [0,0,0,0,0])
1160 AC_FIND_FUNC(res_init, resolv,
1162 #include <stdio.h>
1163 #ifdef HAVE_SYS_TYPES_H
1164 #include <sys/types.h>
1165 #endif
1166 #ifdef HAVE_NETINET_IN_H
1167 #include <netinet/in.h>
1168 #endif
1169 #ifdef HAVE_ARPA_NAMESER_H
1170 #include <arpa/nameser.h>
1171 #endif
1172 #ifdef HAVE_RESOLV_H
1173 #include <resolv.h>
1174 #endif
1178 AC_FIND_FUNC(dn_expand, resolv,
1180 #include <stdio.h>
1181 #ifdef HAVE_SYS_TYPES_H
1182 #include <sys/types.h>
1183 #endif
1184 #ifdef HAVE_NETINET_IN_H
1185 #include <netinet/in.h>
1186 #endif
1187 #ifdef HAVE_ARPA_NAMESER_H
1188 #include <arpa/nameser.h>
1189 #endif
1190 #ifdef HAVE_RESOLV_H
1191 #include <resolv.h>
1192 #endif
1194 [0,0,0,0,0])
1196 AC_BROKEN_SNPRINTF
1198 AC_CHECK_FUNCS(strtoll strtoq getrusage thr_yield)
1200 AC_EGREP_HEADER(sigaction, signal.h,
1201         AC_DEFINE(HAVE_POSIX_SIGNALS, 1, [define if you have sigaction]))
1203 save_CPPFLAGS="${CPPFLAGS}"
1204 AC_HAVE_TYPES([int8_t int16_t int32_t int64_t])
1205 AC_HAVE_TYPES([int16 int32])
1206 AC_HAVE_TYPES([u_int8_t u_int16_t u_int32_t u_int64_t])
1207 AC_HAVE_TYPES([uint8_t uint16_t uint32_t uint64_t])
1208 AC_HAVE_TYPES([u_int16 u_int32])
1209 AC_HAVE_TYPES([bool ssize_t])
1210 AC_HAVE_TYPES([register_t])     dnl really only needed for bsd nnpfs
1211 AC_HAVE_TYPES([uintptr_t])      dnl really only needed for bsd nnpfs
1212 AC_HAVE_TYPES([intptr_t])
1213 AC_HAVE_TYPES([off64_t])
1214 AC_CHECK_HEADERS([ktypes.h com_err.h et/com_err.h])
1215 COMERR_CPPFLAGS="$CPPFLAGS"
1216 AC_SUBST(COMERR_CPPFLAGS)
1217 CPPFLAGS="${save_CPPFLAGS}"
1219 AC_TYPE_SIGNAL
1222 dnl check for old libkafs
1225 dnl AC_FIND_FUNC_NO_LIBS2(krb_afslog_uid, "", , , [$KAFS_LIBS $KRB4_LIB_FLAGS])
1228 AC_CHECK_FUNC(localtime_r,[
1229 AC_DEFINE([HAVE_LOCALTIME_R], 1, [define if there exists a localtime_r])])
1232 # libroken
1235 AC_CHECK_FUNCS(getfh fhopen)
1237 AC_CHECK_FUNCS(getattrlist setattrlist)
1239 AC_CHECK_FUNCS(statvfs)
1241 rk_CHECK_VAR(optreset,[#include <stdlib.h>])dnl
1244 dnl prototypes
1247 AC_NEED_PROTO([
1248 #include <sys/types.h> 
1249 #include <sys/time.h>
1250 #ifdef HAVE_UNISTD_H
1251 #include <unistd.h>
1252 #endif
1253 #ifdef HAVE_WINSOCK_H
1254 #include <winsock.h>
1255 #endif
1256 ], 
1257 select)
1259 AC_DIRENT_SYS_DIR_H
1261 AC_HAVE_STRUCT_FIELD(struct dirent, d_type,
1262 [#ifdef HAVE_SYS_TYPES_H
1263 #include <sys/types.h>
1264 #endif
1265 #include <dirent.h>
1269 dnl Check for sa_len in sys/socket.h
1272 AC_HAVE_STRUCT_FIELD(struct sockaddr,
1273 sa_len,
1274 [#include <sys/types.h>
1275 #include <sys/socket.h>])
1278 dnl Check for sin_len
1281 AC_HAVE_STRUCT_FIELD(struct sockaddr_in,
1282 sin_len,
1283 [#include <sys/types.h>
1284 #include <sys/socket.h>
1285 #ifdef HAVE_NETINET_IN_H
1286 #include <netinet/in.h>
1287 #endif])
1290 dnl check for strange as stuff on solaris
1293 case "$target_os" in
1294 solaris*)
1295   AC_CACHE_CHECK(if as supports .register, ac_cv_prog_as_register,[
1296   cat > conftest.s <<EOF
1297         .register       %g2, #scratch
1298         .register       %g3, #scratch
1299         .register       %g6, #scratch
1300         .register       %g7, #scratch
1302   if $AS conftest.s >/dev/null 2>&1; then
1303     ac_cv_prog_as_register=yes
1304   else
1305     ac_cv_prog_as_register=no
1306   fi
1307   rm -f conftest.s a.out
1309   if test "$ac_cv_prog_as_register" = "yes"; then
1310     AC_DEFINE([PROG_AS_UNDERSTANDS_REGISTER], 1,
1311         [define this if your as understands .register])
1312   fi
1313 esac
1316 dnl kernel checks
1320 dnl bsd style
1323 if test "$NNPFS_SUBDIR" = "bsd" -o "$NNPFS_SUBDIR" = "freebsd" ; then
1325 AC_CONFIG_FILES([nnpfs/bsd/Makefile nnpfs/bsd/bin/Makefile nnpfs/freebsd/Makefile])
1327 AC_ELF_OBJECT_FORMAT
1328 AC_KERNEL
1330 AC_CHECK_KERNEL_FUNCS([                         \
1331 cdevsw_add                                      \
1332 debuglockmgr                                    \
1333 findcdev                                        \
1334 lockmgr                                         \
1335 vop_revoke                                      \
1336 vop_stdpathconf                                 \
1337 genfs_mmap                                      \
1338 genfs_revoke                                    \
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 namei_hash                                      \
1361 nosys                                           \
1362 sys_nosys                                       \
1363 sys_lkmnosys                                    \
1364 cache_purgevfs                                  \
1366 AC_CHECK_KERNEL_FUNC(memcpy, [0,0,0])
1368 AC_BSD_HEADER_VNODE_IF_H
1370 AC_KERNEL_NEED_PROTO([
1371 #ifdef HAVE_SYS_TYPES_H
1372 #include <sys/types.h>
1373 #endif
1374 #ifdef HAVE_SYS_PARAM_H
1375 #include <sys/param.h>
1376 #endif
1377 #ifdef HAVE_SYS_TIME_H
1378 #include <sys/time.h>
1379 #endif
1380 #ifdef HAVE_SYS_PROC_H
1381 #include <sys/proc.h>
1382 #endif
1383 #ifdef HAVE_SYS_VNODE_H
1384 #include <sys/vnode.h>
1385 #endif
1387 vgonel)
1389 AC_KERNEL_NEED_PROTO([
1390 #ifdef HAVE_SYS_TYPES_H
1391 #include <sys/types.h>
1392 #endif
1393 #ifdef HAVE_SYS_PARAM_H
1394 #include <sys/param.h>
1395 #endif
1396 #ifdef HAVE_SYS_TIME_H
1397 #include <sys/time.h>
1398 #endif
1399 #ifdef HAVE_SYS_PROC_H
1400 #include <sys/proc.h>
1401 #endif
1402 #include <sys/signal.h>
1403 #include <sys/signalvar.h>
1405 issignal)
1407 AC_KERNEL_NEED_PROTO([
1408 #ifdef HAVE_SYS_TYPES_H
1409 #include <sys/types.h>
1410 #endif
1411 #ifdef HAVE_SYS_PARAM_H
1412 #include <sys/param.h>
1413 #endif
1414 #ifdef HAVE_SYS_TIME_H
1415 #include <sys/time.h>
1416 #endif
1417 #ifdef HAVE_SYS_PROC_H
1418 #include <sys/proc.h>
1419 #endif
1420 #ifdef HAVE_SYS_VNODE_H
1421 #include <sys/vnode.h>
1422 #endif
1423 #ifdef HAVE_SYS_VFS_PROTO_H
1424 #include <sys/vfs_proto.h>
1425 #endif
1427 vn_writechk)
1429 AC_KERNEL_NEED_PROTO([
1430 #ifdef HAVE_SYS_TYPES_H
1431 #include <sys/types.h>
1432 #endif
1433 #ifdef HAVE_SYS_PARAM_H
1434 #include <sys/param.h>
1435 #endif
1436 #ifdef HAVE_SYS_LIBKERN_H
1437 #include <sys/libkern.h>
1438 #endif
1439 #ifdef HAVE_SYS_SYSTM_H
1440 #include <sys/systm.h>
1441 #endif
1443 strncmp)
1445 AC_CHECK_KERNEL_VAR(doforce, int)
1446 AC_CHECK_KERNEL_VAR(aout_sysent, struct sysent*,[#include <sys/systm.h>])
1447 AC_CHECK_KERNEL_VOP_T
1448 AC_BSD_FUNC_VFS_OBJECT_CREATE
1449 AC_BSD_FUNC_VOP_LOCK
1450 AC_BSD_FUNC_VFS_BUSY
1451 AC_BSD_FUNC_VGET
1452 AC_BSD_FUNC_SUSER
1453 AC_BSD_FUNC_VFS_GETNEWFSID
1454 AC_BSD_FUNC_LOCKMGR
1455 AC_BSD_FUNC_LOCKSTATUS
1456 AC_BSD_FUNC_SELRECORD
1457 AC_BSD_FHTOVP
1459 AC_CHECK_DIRSIZ
1462 dnl Find out if have have proc.p_sigmask
1465 AC_HAVE_STRUCT_FIELD(
1466 struct proc,
1467 p_sigmask,
1468 [#ifdef HAVE_SYS_TYPES_H
1469 #include <sys/types.h>
1470 #endif
1471 #ifdef HAVE_SYS_PARAM_H
1472 #include <sys/param.h>
1473 #endif
1474 #ifdef HAVE_SYS_TIME_H
1475 #include <sys/time.h>
1476 #endif
1477 #ifdef HAVE_SYS_PROC_H
1478 #include <sys/proc.h>
1479 #endif])
1481 AC_HAVE_STRUCT_FIELD(
1482 struct proc,
1483 p_sigctx,
1484 [#ifdef HAVE_SYS_TYPES_H
1485 #include <sys/types.h>
1486 #endif
1487 #ifdef HAVE_SYS_PARAM_H
1488 #include <sys/param.h>
1489 #endif
1490 #ifdef HAVE_SYS_TIME_H
1491 #include <sys/time.h>
1492 #endif
1493 #ifdef HAVE_SYS_PROC_H
1494 #include <sys/proc.h>
1495 #endif])
1497 AC_HAVE_KERNEL_STRUCT_FIELD([
1498 #ifdef HAVE_SYS_TYPES_H
1499 #include <sys/types.h>
1500 #endif
1501 #ifdef HAVE_SYS_PARAM_H
1502 #include <sys/param.h>
1503 #endif
1504 #ifdef HAVE_SYS_TIME_H
1505 #include <sys/time.h>
1506 #endif
1507 #ifdef HAVE_SYS_PROC_H
1508 #include <sys/proc.h>
1509 #endif
1510 #ifdef HAVE_SYS_VNODE_H
1511 #include <sys/vnode.h>
1512 #endif
1513 #ifdef HAVE_SYS_MOUNT_H
1514 #include <sys/mount.h>
1515 #endif
1517 mount,
1518 struct vnode *,
1519 mnt_syncer)
1521 AC_HAVE_KERNEL_STRUCT_FIELD([
1522 #ifdef HAVE_SYS_TYPES_H
1523 #include <sys/types.h>
1524 #endif
1525 #ifdef HAVE_SYS_PARAM_H
1526 #include <sys/param.h>
1527 #endif
1528 #ifdef HAVE_SYS_TIME_H
1529 #include <sys/time.h>
1530 #endif
1531 #ifdef HAVE_SYS_PROC_H
1532 #include <sys/proc.h>
1533 #endif
1534 #ifdef HAVE_SYS_VNODE_H
1535 #include <sys/vnode.h>
1536 #endif
1537 #ifdef HAVE_SYS_MOUNT_H
1538 #include <sys/mount.h>
1539 #endif
1541 mount,
1542 qaddr_t,
1543 m_info)
1545 AC_HAVE_KERNEL_STRUCT_FIELD([
1546 #include <sys/types.h>
1547 #include <sys/param.h>
1548 #include <sys/mount.h>
1550 vfsconf,
1551 int,
1552 vfc_refcount)
1554 AC_HAVE_KERNEL_STRUCT_FIELD([
1555 #include <sys/types.h>
1556 #include <sys/param.h>
1557 #include <sys/mount.h>
1559 vfsconf,
1560 int (*)(void),
1561 vfc_mountroot)
1563 AC_HAVE_KERNEL_STRUCT_FIELD([
1564 #include <sys/types.h>
1565 #ifdef HAVE_SYS_CDEFS_H
1566 #include <sys/cdefs.h>
1567 #endif
1568 #include <sys/uio.h>
1570 uio,
1571 struct proc *,
1572 uio_procp)
1574 AC_HAVE_KERNEL_STRUCT_FIELD([
1575 #include <sys/types.h>
1576 #include <sys/param.h>
1577 #include <sys/mount.h>
1579 vfsops,
1580 struct vnodeopv_desc **,
1581 vfs_opv_descs)
1583 AC_HAVE_KERNEL_STRUCT_FIELD([
1584 #include <sys/types.h>
1585 #include <sys/param.h>
1586 #include <sys/mount.h>
1588 vfsops,
1589 char *,
1590 vfs_name)
1592 AC_HAVE_KERNEL_STRUCT_FIELD([
1593 #include <sys/types.h>
1594 #include <sys/param.h>
1595 #include <sys/mount.h>
1597 vfsops,
1598 void *,
1599 vfs_uninit)
1601 AC_HAVE_KERNEL_STRUCT_FIELD([
1602 #include <sys/types.h>
1603 #include <sys/param.h>
1604 #include <sys/mount.h>
1606 vfsops,
1607 void *,
1608 vfs_reinit)
1610 AC_HAVE_KERNEL_STRUCT_FIELD([
1611 #include <sys/types.h>
1612 #include <sys/param.h>
1613 #include <sys/mount.h>
1615 vfsops,
1616 struct sysctl_oid *,
1617 vfs_oid)
1619 AC_HAVE_KERNEL_STRUCT_FIELD([
1620 #include <sys/types.h>
1621 #include <sys/param.h>
1622 #include <sys/mount.h>
1624 vfsops,
1625 int,
1626 vfs_done)
1628 save_test_KERNEL_CFLAGS="$test_KERNEL_CFLAGS"
1629 test_KERNEL_CFLAGS="$test_KERNEL_CFLAGS $BSD_WERROR"
1631 AC_HAVE_KERNEL_STRUCT_FIELD([
1632 #include <sys/types.h>
1633 #include <sys/param.h>
1634 #include <sys/time.h>
1635 #include <sys/proc.h>
1636 #include <sys/mount.h>
1637 typedef int (*mount_type)(struct mount *, const char *, void *, struct nameidata *, struct proc *);
1639 vfsops,
1640 mount_type,
1641 vfs_mount)
1643 test_KERNEL_CFLAGS="$save_test_KERNEL_CFLAGS"
1645 AC_HAVE_KERNEL_STRUCT_FIELD([
1646 #include <sys/types.h>
1647 #include <sys/param.h>
1648 #include <sys/mount.h>
1650 vfsops,
1651 void *,
1652 vfs_checkexp)
1654 AC_HAVE_KERNEL_STRUCT_FIELD([
1655 #include <sys/types.h>
1656 #include <sys/param.h>
1657 #include <sys/mount.h>
1659 vfsops,
1660 void *,
1661 vfs_sysctl)  
1663 AC_HAVE_KERNEL_STRUCT_FIELD([
1664 #include <sys/types.h>
1665 #include <sys/param.h>
1666 #include <sys/mount.h>
1668 vfsops,
1669 void *,
1670 vfs_snapshot)
1672 AC_HAVE_KERNEL_STRUCT_FIELD([
1673 #include <sys/types.h>
1674 #include <sys/param.h>
1675 #include <sys/mount.h>
1677 vfsops,
1678 void *,
1679 vfs_extattrctl)
1681 AC_HAVE_KERNEL_STRUCT_FIELD([
1682 #include <sys/types.h>
1683 #include <sys/param.h>
1684 #include <sys/mount.h>
1686 vfsops,
1687 void *,
1688 vfs_mountroot)
1690 AC_HAVE_KERNEL_STRUCT_FIELD([
1691 #include <sys/types.h>
1692 #include <sys/param.h>
1693 #include <sys/mount.h>
1695 vfsops,
1696 void *,
1697 vfs_swapvp)
1699 AC_HAVE_KERNEL_STRUCT_FIELD([
1700 #include <sys/types.h>
1701 #include <sys/param.h>
1702 #include <sys/mount.h>
1704 vfsops,
1705 void *,
1706 vfs_smoothsync)
1708 AC_HAVE_KERNEL_STRUCT_FIELD([
1709 #include <sys/types.h>
1710 #include <sys/systm.h>
1711 #ifdef HAVE_SYS_SYSENT_H
1712 #include <sys/sysent.h>
1713 #endif
1715 sysent,
1716 int,
1717 sy_flags)
1719 AC_HAVE_KERNEL_STRUCT_FIELD([
1720 #include <sys/types.h>
1721 #include <sys/systm.h>
1722 #ifdef HAVE_SYS_SYSENT_H
1723 #include <sys/sysent.h>
1724 #endif
1726 sysent,
1727 unsigned char,
1728 sy_info)
1730 AC_HAVE_KERNEL_STRUCT_FIELD([
1731 #ifdef HAVE_SYS_TYPES_H
1732 #include <sys/types.h>
1733 #endif
1734 #ifdef HAVE_SYS_PARAM_H
1735 #include <sys/param.h>
1736 #endif
1737 #ifdef HAVE_SYS_TIME_H
1738 #include <sys/time.h>
1739 #endif
1740 #ifdef HAVE_SYS_PROC_H
1741 #include <sys/proc.h>
1742 #endif
1743 #ifdef HAVE_SYS_VNODE_H
1744 #include <sys/vnode.h>
1745 #endif
1746 #ifdef HAVE_SYS_MOUNT_H
1747 #include <sys/mount.h>
1748 #endif
1750 vnode,
1751 u_long,
1752 v_id)
1754 AC_HAVE_KERNEL_STRUCT_FIELD([
1755 #include <sys/types.h>
1756 #include <sys/param.h>
1757 #include <sys/vnode.h>
1759 vop_fsync_args,
1760 int,
1761 a_flags)
1763 AC_HAVE_KERNEL_STRUCT_FIELD([
1764 #include <sys/types.h>
1765 #include <sys/param.h>
1766 #include <sys/vnode.h>
1768 vop_putpages_args,
1769 int,
1770 a_sync)
1772 AC_HAVE_KERNEL_STRUCT_FIELD([
1773 #include <sys/types.h>
1774 #include <sys/param.h>
1775 #include <sys/vnode.h>
1777 vop_getpages_args,
1778 voff_t,
1779 a_offset)
1781 AC_HAVE_KERNEL_DEF([
1782 #ifdef HAVE_SYS_TYPES_H
1783 #include <sys/types.h>
1784 #endif
1785 #ifdef HAVE_SYS_PARAM_H
1786 #include <sys/param.h>
1787 #endif
1788 #ifdef HAVE_SYS_MOUNT_H
1789 #include <sys/mount.h>
1790 #endif
1791 #ifdef HAVE_SYS_TIME_H
1792 #include <sys/time.h>
1793 #endif
1794 #ifdef HAVE_SYS_PROC_H
1795 #include <sys/proc.h>
1796 #endif
1797 #ifdef HAVE_SYS_SA_H
1798 #include <sys/sa.h>
1799 #endif
1800 #ifdef HAVE_SYS_SYSPROTO_H
1801 #include <sys/sysproto.h>
1802 #endif
1803 #ifdef HAVE_SYS_SYSCALLARGS_H
1804 #include <sys/syscallargs.h>
1805 #endif
1807 struct setgroups_args)
1809 AC_HAVE_KERNEL_DEF([
1810 #ifdef HAVE_SYS_TYPES_H
1811 #include <sys/types.h>
1812 #endif
1813 #ifdef HAVE_SYS_PARAM_H
1814 #include <sys/param.h>
1815 #endif
1816 #ifdef HAVE_SYS_MOUNT_H
1817 #include <sys/mount.h>
1818 #endif
1819 #ifdef HAVE_SYS_TIME_H
1820 #include <sys/time.h>
1821 #endif
1822 #ifdef HAVE_SYS_PROC_H
1823 #include <sys/proc.h>
1824 #endif
1825 #ifdef HAVE_SYS_SA_H
1826 #include <sys/sa.h>
1827 #endif
1828 #ifdef HAVE_SYS_SYSPROTO_H
1829 #include <sys/sysproto.h>
1830 #endif
1831 #ifdef HAVE_SYS_SYSCALLARGS_H
1832 #include <sys/syscallargs.h>
1833 #endif
1835 struct sys_setgroups_args)
1837 AC_HAVE_KERNEL_STRUCT_FIELD([
1838 #include <sys/types.h>
1839 #include <sys/time.h>
1840 #ifdef HAVE_SYS_CDEFS_H
1841 #include <sys/cdefs.h>
1842 #endif
1843 #include <sys/conf.h>
1845 cdevsw,
1846 d_stop_t *,
1847 d_stop)
1849 AC_HAVE_KERNEL_STRUCT_FIELD([
1850 #include <sys/types.h>
1851 #include <sys/time.h>
1852 #ifdef HAVE_SYS_CDEFS_H
1853 #include <sys/cdefs.h>
1854 #endif
1855 #include <sys/conf.h>
1857 cdevsw,
1858 d_reset_t *,
1859 d_reset)
1861 AC_HAVE_KERNEL_STRUCT_FIELD([
1862 #include <sys/types.h>
1863 #include <sys/time.h>
1864 #ifdef HAVE_SYS_CDEFS_H
1865 #include <sys/cdefs.h>
1866 #endif
1867 #include <sys/conf.h>
1869 cdevsw,
1870 d_reset_t *,
1871 d_bogoreset)
1873 AC_HAVE_KERNEL_STRUCT_FIELD([
1874 #include <sys/types.h>
1875 #include <sys/time.h>
1876 #ifdef HAVE_SYS_CDEFS_H
1877 #include <sys/cdefs.h>
1878 #endif
1879 #include <sys/conf.h>
1881 cdevsw,
1882 d_kqfilter_t *,
1883 d_kqfilter)
1885 AC_HAVE_KERNEL_STRUCT_FIELD([
1886 #include <sys/types.h>
1887 #include <sys/time.h>
1888 #ifdef HAVE_SYS_CDEFS_H
1889 #include <sys/cdefs.h>
1890 #endif
1891 #include <sys/conf.h>
1893 cdevsw,
1894 size_t,
1895 d_psize)
1897 AC_HAVE_KERNEL_STRUCT_FIELD([
1898 #include <sys/types.h>
1899 #include <sys/time.h>
1900 #ifdef HAVE_SYS_CDEFS_H
1901 #include <sys/cdefs.h>
1902 #endif
1903 #include <sys/conf.h>
1905 cdevsw,
1906 d_devtotty_t *,
1907 d_devtotty)
1909 AC_HAVE_KERNEL_STRUCT_FIELD([
1910 #include <sys/types.h>
1911 #include <sys/time.h>
1912 #ifdef HAVE_SYS_CDEFS_H
1913 #include <sys/cdefs.h>
1914 #endif
1915 #include <sys/conf.h>
1917 cdevsw,
1918 d_parms_t *,
1919 d_bogoparms)
1921 AC_HAVE_KERNEL_STRUCT_FIELD([
1922 #include <sys/types.h>
1923 #include <sys/time.h>
1924 #ifdef HAVE_SYS_CDEFS_H
1925 #include <sys/cdefs.h>
1926 #endif
1927 #include <sys/conf.h>
1929 cdevsw,
1930 void *,
1931 d_spare)
1933 AC_HAVE_KERNEL_STRUCT_FIELD([
1934 #include <sys/types.h>
1935 #include <sys/time.h>
1936 #ifdef HAVE_SYS_CDEFS_H
1937 #include <sys/cdefs.h>
1938 #endif
1939 #include <sys/conf.h>
1941 cdevsw,
1942 d_mmap_t,
1943 d_mmap)
1945 AC_HAVE_KERNEL_STRUCT_FIELD([
1946 #include <sys/types.h>
1947 #include <sys/time.h>
1948 #ifdef HAVE_SYS_CDEFS_H
1949 #include <sys/cdefs.h>
1950 #endif
1951 #include <sys/conf.h>
1953 cdevsw,
1954 d_strategy_t,
1955 d_strategy)
1957 AC_HAVE_KERNEL_STRUCT_FIELD([
1958 #include <sys/types.h>
1959 #include <sys/time.h>
1960 #ifdef HAVE_SYS_CDEFS_H
1961 #include <sys/cdefs.h>
1962 #endif
1963 #include <sys/conf.h>
1965 cdevsw,
1966 dumper_t,
1967 d_dump)
1969 AC_HAVE_KERNEL_STRUCT_FIELD([
1970 #include <sys/types.h>
1971 #include <sys/time.h>
1972 #ifdef HAVE_SYS_CDEFS_H
1973 #include <sys/cdefs.h>
1974 #endif
1975 #include <sys/conf.h>
1977 cdevsw,
1978 int,
1979 d_maxio)
1981 AC_HAVE_KERNEL_STRUCT_FIELD([
1982 #include <sys/types.h>
1983 #include <sys/time.h>
1984 #ifdef HAVE_SYS_CDEFS_H
1985 #include <sys/cdefs.h>
1986 #endif
1987 #include <sys/conf.h>
1989 cdevsw,
1990 int,
1991 d_bmaj)
1993 AC_HAVE_KERNEL_STRUCT_FIELD([
1994 #include <sys/types.h>
1995 #ifdef HAVE_SYS_CDEFS_H
1996 #include <sys/cdefs.h>
1997 #endif
1998 #include <sys/uio.h>
1999 #include <sys/namei.h>
2001 componentname,
2002 u_long,
2003 cn_hash)
2005 AC_CHECK_BSD_UVM_ONLY
2008 dnl linux
2011 elif test "$NNPFS_SUBDIR" = "linux"; then
2013 AC_CONFIG_FILES([nnpfs/linux/Makefile nnpfs/linux/bin/Makefile])
2015 dnl Linux devfs check
2016 AC_CHECK_HEADERS(linux/devfs_fs.h linux/stddef.h)
2018 AC_HAVE_KERNEL_STRUCT_FIELD([
2019 #define __KERNEL__
2020 #include <asm/current.h>
2021 #include <linux/fs.h>
2023 ViceIoctl,
2024 caddr_t,
2027 AC_HAVE_LINUX_KERNEL_TYPES(int8_t int16_t int32_t int64_t)
2028 AC_HAVE_LINUX_KERNEL_TYPES(uint8_t uint16_t uint32_t uint64_t)
2030 AC_LINUX_FUNC_INIT_MUTEX
2031 AC_LINUX_GETATTR_THREE_ARGS
2033 elif test "$NNPFS_SUBDIR" = "solaris"; then
2035 AC_CONFIG_FILES([nnpfs/solaris/Makefile nnpfs/solaris/bin/Makefile])
2037 AC_HAVE_KERNEL_STRUCT_FIELD([
2038 #include <sys/types.h>
2039 #include <sys/vfs.h>
2040 typedef void (*freevfs_type)(struct vfs *);
2042 vfsops,
2043 freevfs_type,
2044 vfs_freevfs)
2046 elif test "$NNPFS_SUBDIR" = "irix"; then
2048 AC_CONFIG_FILES([nnpfs/irix/Makefile nnpfs/irix/bin/Makefile])
2050 elif test "$NNPFS_SUBDIR" = "aix"; then
2052 AC_CONFIG_FILES([nnpfs/aix/Makefile nnpfs/aix/bin/Makefile])
2054 fi # end of OS-specific tests
2057 dnl Global kernel checks
2060 AC_CHECK_KERNEL_FUNCS(strlcpy)
2063 dnl Arla configuration. Default values, overrided below if needed
2066 arla_AC_SUBST_VALUE(ARLA_CONF_HIGHVNODES,4000)
2067 arla_AC_SUBST_VALUE(ARLA_CONF_LOWVNODES,3000)
2068 arla_AC_SUBST_VALUE(ARLA_CONF_HIGHBYTES,1400M)
2069 arla_AC_SUBST_VALUE(ARLA_CONF_LOWBYTES,700M)
2071 dnl override section
2073 case "$target_os" in
2074     linux*|darwin*)
2075         ARLA_CONF_HIGHVNODES=40000
2076         ARLA_CONF_LOWVNODES=30000
2077         ;;
2078 esac
2081 # Libtool vs automake stuff
2084 LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's/\.o/\.lo/g'`
2085 AC_SUBST(LTLIBOBJS)
2087 AH_BOTTOM([#ifdef ROKEN_RENAME
2088 #include "roken_rename.h"
2089 #endif])
2091 # Almost done....
2093 AC_OUTPUT(Makefile                              \
2094         include/Makefile                        \
2095         arlad/Makefile                          \
2096         lwp/Makefile                            \
2097         nnpfs/Makefile                          \
2098         rx/Makefile                             \
2099         rxdef/Makefile                          \
2100         rxgk/Makefile                           \
2101         rxkad/Makefile                          \
2102         appl/Makefile                           \
2103         appl/lib/Makefile                       \
2104         appl/aafs/Makefile                      \
2105         appl/aafs-perl/Makefile                 \
2106         appl/kalog/Makefile                     \
2107         appl/afsmgr/Makefile                    \
2108         appl/afsutils/Makefile                  \
2109         appl/amon/Makefile                      \
2110         appl/afstool/Makefile                   \
2111         appl/fs/Makefile                        \
2112         appl/pts/Makefile                       \
2113         appl/perf/Makefile                      \
2114         appl/udebug/Makefile                    \
2115         appl/vos/Makefile                       \
2116         appl/bos/Makefile                       \
2117         appl/mac/Makefile                       \
2118         appl/mac/install/Info.plist             \
2119         appl/mac/Arla_Configuration/Makefile    \
2120         appl/mac/Arla_Configuration/Info.plist  \
2121         appl/mac/arlacmm/Makefile               \
2122         appl/mac/mafslog/Makefile               \
2123         doc/Makefile                            \
2124         lib/Makefile                            \
2125         lib/roken/Makefile                      \
2126         lib/sl/Makefile                         \
2127         lib/editline/Makefile                   \
2128         lib/ko/Makefile                         \
2129         lib/vers/Makefile                       \
2130         lib/bufdir/Makefile                     \
2131         util/Makefile                           \
2132         ydr/Makefile                            \
2133         conf/Makefile                           \
2134         tools/Makefile                          \
2135         tools/gnats/Makefile                    \
2136         tools/release-tools/Makefile            \
2137         milko/Makefile                          \
2138         milko/lib/Makefile                      \
2139         milko/lib/vstatus/Makefile              \
2140         milko/lib/dpart/Makefile                \
2141         milko/lib/voldb/Makefile                \
2142         milko/lib/vld/Makefile                  \
2143         milko/lib/ropa/Makefile                 \
2144         milko/lib/msecurity/Makefile            \
2145         milko/lib/mlog/Makefile                 \
2146         milko/lib/mdb/Makefile                  \
2147         milko/appl/Makefile                     \
2148         milko/appl/sked/Makefile                \
2149         milko/appl/bootstrap/Makefile           \
2150         milko/fs/Makefile                       \
2151         milko/vldb/Makefile                     \
2152         milko/pts/Makefile                      \
2153         milko/bos/Makefile                      \
2154         tests/Makefile)
2156 AC_KRB_VERSION(arla)