2 dnl XView & SlingShot library checking
3 dnl (c) 1995 Jakub Jelinek
6 dnl Set xview_includes, xview_libraries, and no_xview (initially yes).
7 dnl Also sets xview_no_private_headers to yes if there are no xview_private
8 dnl headers in the system.
9 AC_DEFUN(AC_PATH_XVIEW,
12 AC_ARG_WITH(xview, [--with-xview Use the XView toolkit],no_xview=)
14 AC_ARG_WITH(xview-includes, [--with-xview-includes=path Specifies XView includes directory],
16 if test x$withval = xyes; then
17 AC_MSG_WARN(Usage is: --with-xview-includes=path)
21 xview_includes=$withval
27 AC_ARG_WITH(xview-libraries, [--with-xview-libraries=path Specifies XView libraries directory],
29 if test x$withval = xyes; then
30 AC_MSG_WARN(Usage is: --with-xview-libraries=path)
34 xview_libraries=$withval
41 if test "$no_xview" != yes; then
42 if test "$no_x" = yes; then
46 if test "$no_xview" != yes; then
47 AC_MSG_CHECKING(for XView)
48 if test x$xview_libraries = xNONE; then
49 if test x$xview_includes = xNONE; then
50 AC_CACHE_VAL(ac_cv_path_xview,
54 if test "x$no_xview" = xyes; then
57 if test "x$no_xview" = xyes; then
58 ac_cv_path_xview="no_xview=yes"
60 ac_cv_path_xview="no_xview= ac_xview_includes=$ac_xview_includes ac_xview_libraries=$ac_xview_libraries ac_xview_no_private_headers=$ac_xview_no_private_headers"
63 eval "$ac_cv_path_xview"
67 if test "x$no_xview" = xyes; then
70 if test "x$xview_includes" = x || test "x$xview_includes" = xNONE; then
71 xview_includes=$ac_xview_includes
73 if test "x$xview_libraries" = x || test "x$xview_libraries" = xNONE; then
74 xview_libraries=$ac_xview_libraries
76 xview_no_private_headers=$ac_xview_no_private_headers
77 ac_cv_path_xview="no_xview= ac_xview_includes=$xview_includes ac_xview_libraries=$xview_libraries ac_xview_no_private_headers=$ac_xview_no_private_headers"
78 if test "x$xview_libraries" != x; then
79 ac_msg_xview="libraries $xview_libraries"
83 if test "x$xview_includes" != x; then
84 if test "x$ac_msg_xview" != x; then
85 ac_msg_xview="$ac_msg_xview, "
87 ac_msg_xview="${ac_msg_xview}headers $xview_includes"
89 if test "x$xview_no_private_headers" = xyes; then
90 if test "x$ac_msg_xview" != x; then
91 ac_msg_xview="$ac_msg_xview, "
93 ac_msg_xview="${ac_msg_xview}without xview_private headers"
95 AC_MSG_RESULT([$ac_msg_xview])
100 dnl Internal subroutine of AC_PATH_XVIEW
101 dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
102 AC_DEFUN(AC_PATH_XVIEW_XMKMF,
104 if mkdir conftestdir; then
106 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
107 cat > Imakefile <<'EOF'
108 #include <XView.tmpl>
110 @echo 'ac_im_library_dest="${LIBRARY_DEST}"; ac_im_header_dest="${HEADER_DEST}"'
112 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
114 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
115 eval `make acfindxv 2>/dev/null | grep -v make`
116 # Screen out bogus values from the imake configuration.
117 if test -f "$ac_im_header_dest/xview/xview.h"; then
118 ac_xview_includes="$ac_im_header_dest"
122 if test -d "$ac_im_library_dest"; then
123 ac_xview_libraries="$ac_im_library_dest"
128 if test "x$no_xview" != xyes; then
129 if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
130 ac_xview_no_private_headers=
132 ac_xview_no_private_headers=yes
140 dnl Internal subroutine of AC_PATH_XVIEW
141 dnl Set ac_xview_includes, ac_xview_libraries, and no_xview (initially yes).
142 AC_DEFUN(AC_PATH_XVIEW_DIRECT,
143 [test -z "$xview_direct_test_library" && xview_direct_test_library=xview
144 test -z "$xview_direct_test_function" && xview_direct_test_function=xv_unique_key
145 test -z "$xview_direct_test_include" && xview_direct_test_include=xview/xview.h
146 AC_TRY_CPP([#include <$xview_direct_test_include>],
147 [no_xview= ac_xview_includes=],
149 $OPENWINHOME/include \
150 /usr/openwin/include \
151 /usr/openwin/share/include \
161 /usr/local/X11R6/include \
162 /usr/local/X11R5/include \
163 /usr/local/X11R4/include \
165 /usr/local/include/X11R6 \
166 /usr/local/include/X11R5 \
167 /usr/local/include/X11R4 \
171 /usr/local/X11/include \
172 /usr/local/include/X11 \
176 /usr/XFree86/include/X11 \
180 /usr/unsupported/include \
181 /usr/athena/include \
182 /usr/local/x11r5/include \
183 /usr/lpp/Xamples/include \
186 if test -r "$ac_dir/$xview_direct_test_include"; then
187 no_xview= ac_xview_includes=$ac_dir
192 if test "x$no_xview" != xyes; then
193 if test "x$ac_xview_includes" != x; then
194 if test -f "$ac_xview_includes/xview_private/draw_impl.h"; then
195 ac_xview_no_private_headers=
197 ac_xview_no_private_headers=yes
200 AC_TRY_CPP([#include <xview_private/draw_impl.h>],
201 [ac_xview_no_private_headers=],[ac_xview_no_private_headers=yes])
205 # Check for the libraries.
206 # See if we find them without any special options.
207 # Don't add to $LIBS permanently.
209 ac_save_LDFLAGS="$LDFLAGS"
210 LDFLAGS="$LDFLAGS $X_LIBS"
211 LIBS="-l$xview_direct_test_library -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
212 AC_TRY_LINK([#include <$xview_direct_test_include>
213 ], [${xview_direct_test_function}()],
214 [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_xview= ac_xview_libraries=],
215 [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
216 # First see if replacing the include by lib works.
217 for ac_dir in `echo "$ac_xview_includes" | sed s/include/lib/` \
219 $OPENWINHOME/share/lib \
221 /usr/openwin/share/lib \
231 /usr/local/X11R6/lib \
232 /usr/local/X11R5/lib \
233 /usr/local/X11R4/lib \
235 /usr/local/lib/X11R6 \
236 /usr/local/lib/X11R5 \
237 /usr/local/lib/X11R4 \
246 /usr/XFree86/lib/X11 \
250 /usr/unsupported/lib \
252 /usr/local/x11r5/lib \
253 /usr/lpp/Xamples/lib \
256 for ac_extension in a so sl; do
257 if test -r $ac_dir/lib${xview_direct_test_library}.$ac_extension; then
258 no_xview= ac_xview_libraries=$ac_dir
264 dnl Substitute XVIEW_LIBS and XVIEW_CFLAGS and
265 dnl HAVE_XVIEW, which is either yes or no.
266 dnl Both contain X_LIBS resp. X_CFLAGS inside
267 dnl Also substitutes HAVE_XVIEW_PRIVATE_HEADERS
268 dnl if there are xview_private headers in the system
269 AC_DEFUN(AC_PATH_XVIEW_XTRA,
270 [AC_REQUIRE([AC_PATH_XVIEW])dnl
271 if test "$no_xview" = yes; then
272 # Not all programs may use this symbol, but it does not hurt to define it.
273 XVIEW_CFLAGS="$X_CFGLAGS $XVIEW_CFLAGS -DXVIEW_MISSING"
275 if test -n "$xview_includes"; then
276 XVIEW_CFLAGS="$X_CFLAGS $XVIEW_CFGLAGS"
277 if test "$xview_includes" != "$x_includes"; then
278 XVIEW_CPPFLAGS="-I$xview_includes"
282 # It would be nice to have a more robust check for the -R ld option than
283 # just checking for Solaris.
284 # It would also be nice to do this for all -L options, not just this one.
285 if test -n "$xview_libraries"; then
286 if test "$xview_libraries" = "$x_libraries"; then
287 XVIEW_LIBS="$X_LIBS $XVIEW_LIBS"
289 XVIEW_LIBS="$X_LIBS $XVIEW_LIBS -L$xview_libraries"
290 if test "`(uname) 2>/dev/null`" = SunOS &&
291 uname -r | grep '^5' >/dev/null; then
292 XVIEW_LIBS="$XVIEW_LIBS -R$xview_libraries"
297 if test "x$no_xview" = xyes; then
302 if test "x$xview_no_private_headers" = xyes; then
303 HAVE_XVIEW_PRIVATE_HEADERS=no
305 HAVE_XVIEW_PRIVATE_HEADERS=yes
307 AC_SUBST(XVIEW_CFLAGS)dnl
308 AC_SUBST(XVIEW_CPPFLAGS)dnl
309 AC_SUBST(XVIEW_LIBS)dnl
310 AC_SUBST(HAVE_XVIEW)dnl
311 AC_SUBST(HAVE_XVIEW_PRIVATE_HEADERS)dnl
314 dnl Internal subroutine of AC_PATH_SLINGSHOT
315 AC_DEFUN(AC_PATH_SLINGSHOT_DIRECT,
317 AC_TRY_CPP([#include <sspkg/rectobj.h>],[no_ss= ac_ss_includes=],
319 $OPENWINHOME/include \
320 /usr/openwin/include \
321 /usr/openwin/share/include \
331 /usr/local/X11R6/include \
332 /usr/local/X11R5/include \
333 /usr/local/X11R4/include \
335 /usr/local/include/X11R6 \
336 /usr/local/include/X11R5 \
337 /usr/local/include/X11R4 \
341 /usr/local/X11/include \
342 /usr/local/include/X11 \
346 /usr/XFree86/include/X11 \
350 /usr/unsupported/include \
351 /usr/athena/include \
352 /usr/local/x11r5/include \
353 /usr/lpp/Xamples/include \
356 if test -r "$ac_dir/sspkg/rectobj.h"; then
357 no_ss= ac_ss_includes=$ac_dir
362 # Check for the libraries.
363 # See if we find them without any special options.
364 # Don't add to $LIBS permanently.
366 ac_save_LDFLAGS="$LDFLAGS"
367 LDFLAGS="$LDFLAGS $XVIEW_LIBS"
368 LIBS="-lsspkg -lm -lxview -lolgx $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
369 AC_TRY_LINK([#include <sspkg/rectobj.h>
370 ], [rectobj_get_selected_list()],
371 [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS" no_ss= ac_ss_libraries=],
372 [LIBS="$ac_save_LIBS" LDFLAGS="$ac_save_LDFLAGS"
373 # First see if replacing the include by lib works.
374 for ac_dir in `echo "$ac_ss_includes" | sed s/include/lib/` \
376 $OPENWINHOME/share/lib \
378 /usr/openwin/share/lib \
388 /usr/local/X11R6/lib \
389 /usr/local/X11R5/lib \
390 /usr/local/X11R4/lib \
392 /usr/local/lib/X11R6 \
393 /usr/local/lib/X11R5 \
394 /usr/local/lib/X11R4 \
403 /usr/XFree86/lib/X11 \
407 /usr/unsupported/lib \
409 /usr/local/x11r5/lib \
410 /usr/lpp/Xamples/lib \
413 for ac_extension in a so sl; do
414 if test -r $ac_dir/libsspkg.$ac_extension; then
415 no_ss= ac_ss_libraries=$ac_dir
421 dnl Set ss_includes, ss_libraries, and no_ss (initially yes).
422 AC_DEFUN(AC_PATH_SLINGSHOT,
423 [AC_REQUIRE([AC_PATH_XVIEW_XTRA])dnl
424 AC_MSG_CHECKING(for SlingShot)
425 AC_ARG_WITH(ss, [--with-ss Use the SlingShot extension])
427 AC_ARG_WITH(ss-includes, [--with-ss-includes=path Specifies SlingShot includes directory],
429 if test x$withval = xyes; then
430 AC_MSG_WARN(Usage is: --with-ss-includes=path)
439 AC_ARG_WITH(ss-libraries, [--with-ss-libraries=path Specifies SlingShot libraries directory],
441 if test x$withval = xyes; then
442 AC_MSG_WARN(Usage is: --with-ss-libraries=path)
445 ss_libraries=$withval
452 if test "x$with_ss" = xno; then
455 if test "x$ss_includes" != xNONE && test "x$ss_libraries" != xNONE; then
458 AC_CACHE_VAL(ac_cv_path_ss,
461 AC_PATH_SLINGSHOT_DIRECT
462 if test "x$no_ss" = xyes; then
463 ac_cv_path_ss="ac_noss=yes"
465 ac_cv_path_ss="ac_ss_includes=$ac_ss_includes ac_ss_libraries=$ac_ss_libraries"
468 eval "$ac_cv_path_ss"
472 if test "x$no_ss" = xyes; then
475 if test "x$ss_includes" = x || test "x$ss_includes" = xNONE; then
476 ss_includes=$ac_ss_includes
478 if test "x$ss_libraries" = x || test "x$ss_libraries" = xNONE; then
479 ss_libraries=$ac_ss_libraries
481 ac_cv_path_ss="no_ss= ac_ss_includes=$ss_includes ac_ss_libraries=$ss_libraries"
482 if test "x$ss_libraries" = x; then
483 if test "x$ss_includes" = x; then
486 AC_MSG_RESULT([headers $ss_includes])
489 if test "x$ss_includes" = x; then
490 AC_MSG_RESULT([libraries $ss_libraries])
492 AC_MSG_RESULT([libraries $ss_libraries, headers $ss_includes])
498 dnl Substitute SLINGSHOT_LIBS and SLINGSHOT_CFLAGS and
499 dnl HAVE_SLINGSHOT, which is either yes or no.
500 dnl Both contain XVIEW_LIBS resp. XVIEW_CFLAGS inside
501 AC_DEFUN(AC_PATH_SLINGSHOT_XTRA,
502 [AC_REQUIRE([AC_PATH_SLINGSHOT])dnl
503 if test "$no_ss" = yes; then
504 # Not all programs may use this symbol, but it does not hurt to define it.
505 SLINGSHOT_CFLAGS="$XVIEW_CFGLAGS $SLINGSHOT_CFLAGS -DSLINGSHOT_MISSING"
507 if test -n "$ss_includes"; then
508 SLINGSHOT_CFLAGS="$XVIEW_CFLAGS $SLINGSHOT_CFGLAGS -I$ss_includes"
511 # It would be nice to have a more robust check for the -R ld option than
512 # just checking for Solaris.
513 # It would also be nice to do this for all -L options, not just this one.
514 if test -n "$ss_libraries"; then
515 SLINGSHOT_LIBS="$XVIEW_LIBS $SLINGSHOT_LIBS -L$ss_libraries"
516 if test "`(uname) 2>/dev/null`" = SunOS &&
517 uname -r | grep '^5' >/dev/null; then
518 SLINGSHOT_LIBS="$SLINGSHOT_LIBS -R$ss_libraries"
522 if test "x$no_ss" = xyes; then
527 AC_SUBST(SLINGSHOT_CFLAGS)dnl
528 AC_SUBST(SLINGSHOT_LIBS)dnl
529 AC_SUBST(HAVE_SLINGSHOT)dnl
533 dnl XView library checking end
537 dnl Check for size of d_name dirent member
539 AC_DEFUN(AC_SHORT_D_NAME_LEN, [
540 AC_MSG_CHECKING(filename fits on dirent.d_name)
541 AC_CACHE_VAL(ac_cv_dnamesize, [
543 CFLAGS="$CFLAGS -I$srcdir"
551 if (sizeof (ddd.d_name) < 12)
560 ac_cv_dnamesize="yes"
562 # Cannot find out, so assume no
567 if test x$ac_cv_dnamesize = xno; then
568 AC_DEFINE(NEED_EXTRA_DIRENT_BUFFER)
570 AC_MSG_RESULT($ac_cv_dnamesize)
574 dnl Filesystem information detection
576 dnl To get information about the disk, mount points, etc.
579 AC_DEFUN(AC_GET_FS_INFO, [
580 AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
581 AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
582 AC_CHECK_HEADERS(sys/mount.h sys/filsys.h sys/fs_types.h)
583 AC_CHECK_FUNCS(getmntinfo)
585 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
586 dnl job is to detect a method to get list of mounted filesystems.
588 AC_MSG_CHECKING([for d_ino member in directory struct])
589 AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
591 #include <sys/types.h>
594 #else /* not HAVE_DIRENT_H */
595 # define dirent direct
596 # ifdef HAVE_SYS_NDIR_H
597 # include <sys/ndir.h>
598 # endif /* HAVE_SYS_NDIR_H */
599 # ifdef HAVE_SYS_DIR_H
600 # include <sys/dir.h>
601 # endif /* HAVE_SYS_DIR_H */
604 # endif /* HAVE_NDIR_H */
605 #endif /* HAVE_DIRENT_H */
607 [struct dirent dp; dp.d_ino = 0;],
608 fu_cv_sys_d_ino_in_dirent=yes,
609 fu_cv_sys_d_ino_in_dirent=no)])
610 AC_MSG_RESULT($fu_cv_sys_d_ino_in_dirent)
611 if test $fu_cv_sys_d_ino_in_dirent = yes; then
612 AC_DEFINE(D_INO_IN_DIRENT)
615 # Determine how to get the list of mounted filesystems.
618 # If the getmntent function is available but not in the standard library,
619 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
622 if test $ac_cv_func_getmntent = yes; then
624 # This system has the getmntent function.
625 # Determine whether it's the one-argument variant or the two-argument one.
627 if test -z "$list_mounted_fs"; then
629 AC_MSG_CHECKING([for two-argument getmntent function])
630 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
631 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
632 fu_cv_sys_mounted_getmntent2=yes,
633 fu_cv_sys_mounted_getmntent2=no)])
634 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
635 if test $fu_cv_sys_mounted_getmntent2 = yes; then
636 list_mounted_fs=found
637 AC_DEFINE(MOUNTED_GETMNTENT2)
641 if test -z "$list_mounted_fs"; then
642 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
643 AC_MSG_CHECKING([for one-argument getmntent function])
644 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
645 [test $ac_cv_header_mntent_h = yes \
646 && fu_cv_sys_mounted_getmntent1=yes \
647 || fu_cv_sys_mounted_getmntent1=no])
648 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
649 if test $fu_cv_sys_mounted_getmntent1 = yes; then
650 list_mounted_fs=found
651 AC_DEFINE(MOUNTED_GETMNTENT1)
655 if test -z "$list_mounted_fs"; then
656 AC_WARN([could not determine how to read list of mounted fs])
657 CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
662 if test -z "$list_mounted_fs"; then
663 # DEC Alpha running OSF/1.
664 AC_MSG_CHECKING([for getfsstat function])
665 AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
667 #include <sys/types.h>
668 #include <sys/mount.h>
669 #include <sys/fs_types.h>],
670 [struct statfs *stats;
671 numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
672 fu_cv_sys_mounted_getsstat=yes,
673 fu_cv_sys_mounted_getsstat=no)])
674 AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
675 if test $fu_cv_sys_mounted_getsstat = yes; then
676 list_mounted_fs=found
677 AC_DEFINE(MOUNTED_GETFSSTAT)
681 if test -z "$list_mounted_fs"; then
683 AC_MSG_CHECKING([for mntctl function and struct vmount])
684 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
685 [AC_TRY_CPP([#include <fshelp.h>],
686 fu_cv_sys_mounted_vmount=yes,
687 fu_cv_sys_mounted_vmount=no)])
688 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
689 if test $fu_cv_sys_mounted_vmount = yes; then
690 list_mounted_fs=found
691 AC_DEFINE(MOUNTED_VMOUNT)
695 if test -z "$list_mounted_fs"; then
697 AC_MSG_CHECKING([for existence of three headers])
698 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
700 #include <sys/statfs.h>
701 #include <sys/fstyp.h>
702 #include <mnttab.h>],
703 fu_cv_sys_mounted_fread_fstyp=yes,
704 fu_cv_sys_mounted_fread_fstyp=no)])
705 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
706 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
707 list_mounted_fs=found
708 AC_DEFINE(MOUNTED_FREAD_FSTYP)
712 if test -z "$list_mounted_fs"; then
713 # 4.4BSD and DEC OSF/1.
714 AC_MSG_CHECKING([for getmntinfo function])
715 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
718 if test $ac_cv_func_getmntinfo = yes; then
719 AC_EGREP_HEADER(f_type;, sys/mount.h,
723 && fu_cv_sys_mounted_getmntinfo=yes \
724 || fu_cv_sys_mounted_getmntinfo=no
726 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
727 if test $fu_cv_sys_mounted_getmntinfo = yes; then
728 list_mounted_fs=found
729 AC_DEFINE(MOUNTED_GETMNTINFO)
733 # FIXME: add a test for netbsd-1.1 here
735 if test -z "$list_mounted_fs"; then
737 AC_MSG_CHECKING([for getmnt function])
738 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
740 #include <sys/fs_types.h>
741 #include <sys/mount.h>],
742 fu_cv_sys_mounted_getmnt=yes,
743 fu_cv_sys_mounted_getmnt=no)])
744 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
745 if test $fu_cv_sys_mounted_getmnt = yes; then
746 list_mounted_fs=found
747 AC_DEFINE(MOUNTED_GETMNT)
751 if test -z "$list_mounted_fs"; then
753 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
754 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
755 [AC_TRY_CPP([#include <mnttab.h>],
756 fu_cv_sys_mounted_fread=yes,
757 fu_cv_sys_mounted_fread=no)])
758 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
759 if test $fu_cv_sys_mounted_fread = yes; then
760 list_mounted_fs=found
761 AC_DEFINE(MOUNTED_FREAD)
765 if test -z "$list_mounted_fs"; then
766 AC_MSG_WARN([could not determine how to read list of mounted fs])
767 CPPFLAGS="$CPPFLAGS -DNO_INFOMOUNT"
768 # FIXME -- no need to abort building the whole package
769 # Can't build mountlist.c or anything that needs its functions
772 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
773 dnl job is to detect a method to get file system information.
775 AC_CHECKING(how to get filesystem space usage)
778 # Here we'll compromise a little (and perform only the link test)
779 # since it seems there are no variants of the statvfs function.
780 if test $space = no; then
782 AC_CHECK_FUNCS(statvfs)
783 if test $ac_cv_func_statvfs = yes; then
785 AC_DEFINE(STAT_STATVFS)
789 if test $space = no; then
790 # DEC Alpha running OSF/1
791 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
792 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
794 #include <sys/param.h>
795 #include <sys/types.h>
796 #include <sys/mount.h>
801 exit (statfs (".", &fsd, sizeof (struct statfs)));
803 fu_cv_sys_stat_statfs3_osf1=yes,
804 fu_cv_sys_stat_statfs3_osf1=no,
805 fu_cv_sys_stat_statfs3_osf1=no)])
806 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
807 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
809 AC_DEFINE(STAT_STATFS3_OSF1)
813 if test $space = no; then
815 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
816 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
818 #ifdef HAVE_SYS_PARAM_H
819 #include <sys/param.h>
821 #ifdef HAVE_SYS_MOUNT_H
822 #include <sys/mount.h>
824 #ifdef HAVE_SYS_VFS_H
831 exit (statfs (".", &fsd));
833 fu_cv_sys_stat_statfs2_bsize=yes,
834 fu_cv_sys_stat_statfs2_bsize=no,
835 fu_cv_sys_stat_statfs2_bsize=no)])
836 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
837 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
839 AC_DEFINE(STAT_STATFS2_BSIZE)
843 if test $space = no; then
845 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
846 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
847 [AC_TRY_RUN([#include <sys/types.h>
848 #include <sys/statfs.h>
852 exit (statfs (".", &fsd, sizeof fsd, 0));
854 fu_cv_sys_stat_statfs4=yes,
855 fu_cv_sys_stat_statfs4=no,
856 fu_cv_sys_stat_statfs4=no)])
857 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
858 if test $fu_cv_sys_stat_statfs4 = yes; then
860 AC_DEFINE(STAT_STATFS4)
864 if test $space = no; then
866 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
867 member (4.4BSD and NetBSD)])
868 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
869 [AC_TRY_RUN([#include <sys/types.h>
870 #ifdef HAVE_SYS_PARAM_H
871 #include <sys/param.h>
873 #ifdef HAVE_SYS_MOUNT_H
874 #include <sys/mount.h>
880 exit (statfs (".", &fsd));
882 fu_cv_sys_stat_statfs2_fsize=yes,
883 fu_cv_sys_stat_statfs2_fsize=no,
884 fu_cv_sys_stat_statfs2_fsize=no)])
885 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
886 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
888 AC_DEFINE(STAT_STATFS2_FSIZE)
892 if test $space = no; then
894 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
895 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
897 #include <sys/types.h>
898 #ifdef HAVE_SYS_PARAM_H
899 #include <sys/param.h>
901 #ifdef HAVE_SYS_MOUNT_H
902 #include <sys/mount.h>
904 #ifdef HAVE_SYS_FS_TYPES_H
905 #include <sys/fs_types.h>
910 /* Ultrix's statfs returns 1 for success,
911 0 for not mounted, -1 for failure. */
912 exit (statfs (".", &fsd) != 1);
914 fu_cv_sys_stat_fs_data=yes,
915 fu_cv_sys_stat_fs_data=no,
916 fu_cv_sys_stat_fs_data=no)])
917 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
918 if test $fu_cv_sys_stat_fs_data = yes; then
920 AC_DEFINE(STAT_STATFS2_FS_DATA)
925 dnl if test $space = no; then
927 dnl AC_TRY_CPP([#include <sys/filsys.h>],
928 dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
932 dnl AC_CHECK_HEADER_IN_PATH(HEADER-FILE, ADDITIONAL_PATH, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
933 AC_DEFUN(AC_CHECK_HEADER_IN_PATH,
934 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
935 ac_safe=`echo "$1" | tr './\055' '___'`
936 AC_MSG_CHECKING([for $1])
937 AC_CACHE_VAL(ac_cv_header_in_path_$ac_safe,
938 [AC_TRY_CPP([#include <$1>], ac_header_in_path=yes, [
939 ac_header_in_path_found=no
940 for ac_header_in_path_value in [$2]; do
941 ac_in_path_save_CPPFLAGS=$CPPFLAGS
942 CPPFLAGS="$CPPFLAGS -I$ac_header_in_path_value"
943 AC_TRY_CPP([#include <$1>], [
944 ac_header_in_path_found=yes
945 ac_header_in_path=$ac_header_in_path_value
947 CPPFLAGS=$ac_in_path_save_CPPFLAGS
948 if test x$ac_header_in_path_found = xyes; then
952 if test $ac_header_in_path_found = xno; then
956 eval "ac_cv_header_in_path_$ac_safe=$ac_header_in_path"
958 eval "ac_header_in_path=`echo '$ac_cv_header_in_path_'$ac_safe`"
959 if test "$ac_header_in_path" = no; then
964 if test -n "$ac_header_in_path"; then
965 AC_MSG_RESULT($ac_header_in_path)
969 if test x$ac_header_in_path = xyes; then
971 eval "ac_cv_header_in_path_$ac_safe="
978 dnl Hope I can check for libXpm only in the X11 library directory
979 AC_DEFUN(AC_LIB_XPM, [
980 AC_MSG_CHECKING(for -lXpm)
981 AC_CACHE_VAL(ac_cv_has_xpm, [
983 if test x$no_x = xyes; then
986 has_xpm_save_LIBS=$LIBS
987 LIBS="-lXpm $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
988 has_xpm_save_LDFLAGS=$LDFLAGS
989 LDFLAGS="$LDFLAGS $X_LIBS"
990 has_xpm_save_CFLAGS=$CFLAGS
991 CFLAGS="$CFLAGS $X_CFLAGS"
993 #include <X11/Xlib.h>
995 ], [XpmLibraryVersion();], ac_cv_has_xpm=yes)
996 CFLAGS="$has_xpm_save_CFLAGS"
997 LDFLAGS="$has_xpm_save_LDFLAGS"
998 LIBS="$has_xpm_save_LIBS"
1001 AC_MSG_RESULT($ac_cv_has_xpm)
1004 dnl Hope I can check for libXext only in the X11 library directory
1005 dnl and shape.h will be in X11/extensions/shape.h
1006 AC_DEFUN(AC_X_SHAPE_EXTENSION, [
1007 AC_MSG_CHECKING(for X11 non-rectangular shape extension)
1008 AC_CACHE_VAL(ac_cv_has_shape, [
1010 if test x$no_x = xyes; then
1013 has_shape_save_LIBS=$LIBS
1014 LIBS="-lXext $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $LIBS"
1015 has_shape_save_LDFLAGS=$LDFLAGS
1016 LDFLAGS="$LDFLAGS $X_LIBS"
1017 has_shape_save_CFLAGS=$CFLAGS
1018 CFLAGS="$CFLAGS $X_CFLAGS"
1020 #include <X11/Xlib.h>
1021 #include <X11/Xutil.h>
1022 #include <X11/extensions/shape.h>
1024 Display *dpy = (Display *)NULL;
1026 XShapeQueryVersion(dpy,&a,&b);
1027 ], ac_cv_has_shape=yes)
1028 CFLAGS="$has_shape_save_CFLAGS"
1029 LDFLAGS="$has_shape_save_LDFLAGS"
1030 LIBS="$has_shape_save_LIBS"
1033 AC_MSG_RESULT($ac_cv_has_shape)
1036 dnl AC_TRY_WARNINGS(INCLUDES, FUNCTION-BODY,
1037 dnl ACTION-IF-NO-WARNINGS [, ACTION-IF-WARNINGS-OR-ERROR])
1038 AC_DEFUN(AC_TRY_WARNINGS,
1039 [cat > conftest.$ac_ext <<EOF
1040 dnl This sometimes fails to find confdefs.h, for some reason.
1041 dnl [#]line __oline__ "[$]0"
1042 [#]line __oline__ "configure"
1043 #include "confdefs.h"
1045 int main() { return 0; }
1050 ac_compile_warn='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1'
1051 if { if eval $ac_compile_warn; then :; else echo arning; fi; } | grep arning 1>&AC_FD_CC 2>&AC_FD_CC; then
1052 ifelse([$4], , :, [rm -rf conftest*
1054 ifelse([$3], , , [else
1062 dnl Find if make is GNU make.
1063 AC_DEFUN(AC_PROG_GNU_MAKE,
1064 [AC_MSG_CHECKING(whether we are using GNU make)
1065 set dummy ${MAKE-make}; ac_make=[$]2
1066 AC_CACHE_VAL(ac_cv_prog_gnu_make,
1067 [cat > conftestmake <<\EOF
1071 if ${MAKE-make} --version -f conftestmake 2>/dev/null | grep GNU >/dev/null 2>&1; then
1072 ac_cv_prog_gnu_make=yes
1074 ac_cv_prog_gnu_make=no
1076 rm -f conftestmake])dnl
1077 if test $ac_cv_prog_gnu_make = yes; then
1079 GNU_MAKE="GNU_MAKE=yes"
1084 AC_SUBST([GNU_MAKE])dnl
1088 dnl Local additions to Autoconf macros.
1089 dnl Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
1090 dnl François Pinard <pinard@iro.umontreal.ca>, 1992.
1092 dnl ## ----------------------------------------- ##
1093 dnl ## ANSIfy the C compiler whenever possible. ##
1094 dnl ## ----------------------------------------- ##
1096 dnl @defmac AC_PROG_CC_STDC
1097 dnl @maindex PROG_CC_STDC
1099 dnl If the C compiler in not in ANSI C mode by default, try to add an option
1100 dnl to output variable @code{CC} to make it so. This macro tries various
1101 dnl options that select ANSI C on some system or another. It considers the
1102 dnl compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
1103 dnl handles function prototypes correctly.
1105 dnl If you use this macro, you should check after calling it whether the C
1106 dnl compiler has been set to accept ANSI C; if not, the shell variable
1107 dnl @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
1108 dnl code in ANSI C, you can make an un-ANSIfied copy of it by using the
1109 dnl program @code{ansi2knr}, which comes with Ghostscript.
1112 dnl Unixware 2.1 defines __STDC__ to 1 only when some useful extensions are
1113 dnl turned off. They are on by default and turned off with the option -Xc.
1114 dnl The consequence is that __STDC__ is defined but e.g. struct sigaction
1115 dnl is not defined. -- Norbert
1117 dnl Below all tests but the one for HP-UX are removed. They caused more
1118 dnl problems than they soved, sigh. -- Norbert
1120 AC_DEFUN(MC_HPUX_PROG_CC_STDC,
1121 [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
1122 AC_CACHE_VAL(ac_cv_prog_cc_stdc,
1123 [ac_cv_prog_cc_stdc=no
1124 ac_save_CFLAGS="$CFLAGS"
1125 dnl Don't try gcc -ansi; that turns off useful extensions and
1126 dnl breaks some systems' header files.
1127 dnl AIX -qlanglvl=ansi (removed -- Norbert)
1128 dnl Ultrix and OSF/1 -std1 (removed -- Norbert)
1129 dnl HP-UX -Aa -D_HPUX_SOURCE
1130 dnl SVR4 -Xc (removed -- Norbert)
1131 for ac_arg in "" "-Aa -D_HPUX_SOURCE"
1133 CFLAGS="$ac_save_CFLAGS $ac_arg"
1135 [#include <signal.h>
1136 #if !defined(__STDC__) || __STDC__ != 1
1139 ], [int test (int i, double x);
1140 struct sigaction sa;
1141 struct s1 {int (*f) (int a);};
1142 struct s2 {int (*f) (double a);};],
1143 [ac_cv_prog_cc_stdc="$ac_arg"; break])
1145 CFLAGS="$ac_save_CFLAGS"
1147 AC_MSG_RESULT($ac_cv_prog_cc_stdc)
1148 case "x$ac_cv_prog_cc_stdc" in
1150 *) CC="$CC $ac_cv_prog_cc_stdc" ;;