2 dnl Check for ext2fs undel support.
3 dnl Set shell variable ext2fs_undel to "yes" if we have it,
4 dnl "no" otherwise. May define USE_EXT2FSLIB for cpp.
5 dnl Will set EXT2FS_UNDEL_LIBS to required libraries.
7 AC_DEFUN([MC_UNDELFS_CHECKS], [
10 AC_CHECK_HEADERS(linux/ext2_fs.h)
11 if test x$ac_cv_header_linux_ext2_fs_h = xyes
13 AC_CHECK_HEADERS(ext2fs/ext2fs.h, , , [#include <stdio.h>
14 #include <linux/ext2_fs.h>])
15 if test x$ac_cv_header_ext2fs_ext2fs_h = xyes
17 AC_DEFINE(USE_EXT2FSLIB, 1,
18 [Define to enable undelete support on ext2])
20 EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
21 AC_CHECK_TYPE(ext2_ino_t, ,
22 [AC_DEFINE(ext2_ino_t, ino_t,
23 [Define to ino_t if undefined.])],
28 /* asm/types.h defines its own umode_t :-( */
30 #include <linux/ext2_fs.h>
31 #include <ext2fs/ext2fs.h>])
39 dnl Check for tools used in extfs scripts.
40 AC_DEFUN([MC_EXTFS_CHECKS], [
41 AC_PATH_PROG([ZIP], [zip], [/usr/bin/zip])
42 AC_PATH_PROG([UNZIP], [unzip], [/usr/bin/unzip])
43 AC_CACHE_CHECK([for zipinfo code in unzip], [mc_cv_have_zipinfo],
44 [mc_cv_have_zipinfo=no
45 if $UNZIP -Z </dev/null 2>&1 >/dev/null; then
46 mc_cv_have_zipinfo=yes
48 if test "x$mc_cv_have_zipinfo" = xyes; then
53 AC_SUBST([HAVE_ZIPINFO])
54 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
59 dnl MC_MCSERVER_CHECKS
60 dnl Check how mcserver should check passwords.
61 dnl Possible methods are PAM, pwdauth and crypt.
62 dnl The later works with both /etc/shadow and /etc/passwd.
63 dnl If PAM is found, other methods are not checked.
65 AC_DEFUN([MC_MCSERVER_CHECKS], [
67 dnl Check if PAM can be used for mcserv
68 AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
69 AC_CHECK_LIB(pam, pam_start, [
70 AC_DEFINE(HAVE_PAM, 1,
71 [Define if PAM (Pluggable Authentication Modules) is available])
72 MCSERVLIBS="-lpam $LIB_DL"
73 mcserv_pam=yes], [], [$LIB_DL])
75 dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
76 if test -z "$mcserv_pam"; then
78 dnl Check for pwdauth() - used on SunOS.
79 AC_CHECK_FUNCS([pwdauth])
82 AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
83 if test -n "$crypt_header"; then
86 AC_SEARCH_LIBS(crypt, [crypt crypt_i], [mcserv_auth=crypt])
89 if test -n "$mcserv_auth"; then
90 AC_DEFINE(HAVE_CRYPT, 1,
91 [Define to use crypt function in mcserv])
93 dnl Check for shadow passwords
94 AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
95 [shadow_header=yes; break])
96 if test -n "$shadow_header"; then
99 AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
102 if test -n "$mcserv_auth"; then
103 AC_DEFINE(HAVE_SHADOW, 1,
104 [Define to use shadow passwords for mcserv])
117 dnl Check for various functions needed by libvfs.
118 dnl This has various effects:
119 dnl Sets MC_VFS_LIBS to libraries required
120 dnl Sets vfs_flags to "pretty" list of vfs implementations we include.
121 dnl Sets shell variable use_vfs to yes (default, --with-vfs) or
122 dnl "no" (--without-vfs).
125 AC_DEFUN([MC_WITH_VFS],[
128 dnl FIXME: network checks should probably be in their own macro.
129 AC_CHECK_LIB(nsl, t_accept)
130 AC_CHECK_LIB(socket, socket)
133 AC_CHECK_FUNCS(socket, have_socket=yes)
134 if test $have_socket = no; then
135 # socket is not in the default libraries. See if it's in some other.
136 for lib in bsd socket inet; do
137 AC_CHECK_LIB([$lib], [socket], [
140 AC_DEFINE(HAVE_SOCKET)
145 have_gethostbyname=no
146 AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
147 if test $have_gethostbyname = no; then
148 # gethostbyname is not in the default libraries. See if it's in some other.
149 for lib in bsd socket inet; do
150 AC_CHECK_LIB([$lib], [gethostbyname],
151 [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
155 vfs_flags="cpiofs, extfs, tarfs"
157 if test $have_socket = yes; then
159 AC_CHECK_FUNCS(pmap_set, , [
160 AC_CHECK_LIB(rpc, pmap_set, [
162 AC_DEFINE(HAVE_PMAP_SET)
164 AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
165 dnl add for source routing support setsockopt
166 AC_CHECK_HEADERS(rpc/pmap_clnt.h, , , [
167 #include <sys/types.h>
168 #include <sys/socket.h>
169 #include <netinet/in.h>
171 #include <rpc/pmap_prot.h>
177 [ --with-mcfs Support mc-specific networking file system [[no]]],
178 [if test "x$withval" != "xno"; then
179 AC_DEFINE(WITH_MCFS, 1, [Define to enable mc-specific networking file system])
180 vfs_flags="$vfs_flags, mcfs"
185 vfs_flags="$vfs_flags, ftpfs, fish"
194 [ --with-samba Support smb virtual file system [[no]]],
195 [if test "x$withval" != "xno"; then
196 AC_DEFINE(WITH_SMBFS, 1, [Define to enable VFS over SMB])
197 vfs_flags="$vfs_flags, smbfs"
202 if test -n "$use_smbfs"; then
203 #################################################
204 # set Samba configuration directory location
206 AC_ARG_WITH(configdir,
207 [ --with-configdir=DIR Where the Samba configuration files are [[/etc]]],
211 # Just in case anybody does it
213 AC_MSG_WARN([--with-configdir called without argument - will use default])
222 AC_ARG_WITH(codepagedir,
223 [ --with-codepagedir=DIR Where the Samba codepage files are],
227 # Just in case anybody does it
229 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
235 AC_DEFINE(USE_VFS, 1, [Define to enable VFS support])
236 if $use_net_code; then
237 AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
243 AC_DEFUN([MC_VFS_CHECKS],[
246 [ --with-vfs Compile with the VFS code [[yes]]],
253 dnl Should we issue a warning?
260 dnl Check for struct linger
262 AC_DEFUN([AC_STRUCT_LINGER], [
264 AC_MSG_CHECKING([struct linger is available])
266 #include <sys/types.h>
267 #include <sys/socket.h>
278 AC_DEFINE(HAVE_STRUCT_LINGER, 1,
279 [Define if `struct linger' is available])
286 AC_MSG_RESULT([$av_struct_linger])
291 dnl Filesystem information detection
293 dnl To get information about the disk, mount points, etc.
296 AC_DEFUN([AC_GET_FS_INFO], [
297 AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
298 AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
299 AC_CHECK_HEADERS(sys/filsys.h sys/fs_types.h)
300 AC_CHECK_HEADERS(sys/mount.h, , , [
301 #include <sys/param.h>
302 #include <sys/stat.h>
304 AC_CHECK_FUNCS(getmntinfo)
306 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
307 dnl job is to detect a method to get list of mounted filesystems.
309 AC_MSG_CHECKING([for d_ino member in directory struct])
310 AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
312 #include <sys/types.h>
315 #else /* not HAVE_DIRENT_H */
316 # define dirent direct
317 # ifdef HAVE_SYS_NDIR_H
318 # include <sys/ndir.h>
319 # endif /* HAVE_SYS_NDIR_H */
320 # ifdef HAVE_SYS_DIR_H
321 # include <sys/dir.h>
322 # endif /* HAVE_SYS_DIR_H */
325 # endif /* HAVE_NDIR_H */
326 #endif /* HAVE_DIRENT_H */
328 [struct dirent dp; dp.d_ino = 0;],
329 fu_cv_sys_d_ino_in_dirent=yes,
330 fu_cv_sys_d_ino_in_dirent=no)])
331 AC_MSG_RESULT([$fu_cv_sys_d_ino_in_dirent])
332 if test $fu_cv_sys_d_ino_in_dirent = yes; then
333 AC_DEFINE(D_INO_IN_DIRENT, 1,
334 [Define if `d_ino' is member of `struct directory'])
337 # Determine how to get the list of mounted filesystems.
340 # If the getmntent function is available but not in the standard library,
341 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
344 if test $ac_cv_func_getmntent = yes; then
346 # This system has the getmntent function.
347 # Determine whether it's the one-argument variant or the two-argument one.
349 if test -z "$list_mounted_fs"; then
351 AC_MSG_CHECKING([for two-argument getmntent function])
352 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
353 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
354 fu_cv_sys_mounted_getmntent2=yes,
355 fu_cv_sys_mounted_getmntent2=no)])
356 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent2])
357 if test $fu_cv_sys_mounted_getmntent2 = yes; then
358 list_mounted_fs=found
359 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
360 [Define if function `getmntent' takes 2 arguments])
364 if test -z "$list_mounted_fs"; then
365 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
366 AC_MSG_CHECKING([for one-argument getmntent function])
367 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
368 [test $ac_cv_header_mntent_h = yes \
369 && fu_cv_sys_mounted_getmntent1=yes \
370 || fu_cv_sys_mounted_getmntent1=no])
371 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent1])
372 if test $fu_cv_sys_mounted_getmntent1 = yes; then
373 list_mounted_fs=found
374 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
375 [Define if function `getmntent' takes 1 argument])
381 if test -z "$list_mounted_fs"; then
382 # DEC Alpha running OSF/1.
383 AC_MSG_CHECKING([for getfsstat function])
384 AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
386 #include <sys/types.h>
387 #include <sys/mount.h>
388 #include <sys/fs_types.h>],
389 [struct statfs *stats;
390 numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
391 fu_cv_sys_mounted_getsstat=yes,
392 fu_cv_sys_mounted_getsstat=no)])
393 AC_MSG_RESULT([$fu_cv_sys_mounted_getsstat])
394 if test $fu_cv_sys_mounted_getsstat = yes; then
395 list_mounted_fs=found
396 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
397 [Define if function `getfsstat' can be used])
401 if test -z "$list_mounted_fs"; then
403 AC_MSG_CHECKING([for mntctl function and struct vmount])
404 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
405 [AC_TRY_CPP([#include <fshelp.h>],
406 fu_cv_sys_mounted_vmount=yes,
407 fu_cv_sys_mounted_vmount=no)])
408 AC_MSG_RESULT([$fu_cv_sys_mounted_vmount])
409 if test $fu_cv_sys_mounted_vmount = yes; then
410 list_mounted_fs=found
411 AC_DEFINE(MOUNTED_VMOUNT, 1,
412 [Define if function `mntctl' and `struct vmount' can be used])
416 if test -z "$list_mounted_fs"; then
418 AC_MSG_CHECKING([for existence of three headers])
419 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
421 #include <sys/statfs.h>
422 #include <sys/fstyp.h>
423 #include <mnttab.h>],
424 fu_cv_sys_mounted_fread_fstyp=yes,
425 fu_cv_sys_mounted_fread_fstyp=no)])
426 AC_MSG_RESULT([$fu_cv_sys_mounted_fread_fstyp])
427 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
428 list_mounted_fs=found
429 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
430 [Define if sys/statfs.h, sys/fstyp.h and mnttab.h
431 can be used together])
435 if test -z "$list_mounted_fs"; then
436 # 4.4BSD and DEC OSF/1.
437 AC_MSG_CHECKING([for getmntinfo function])
438 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
441 if test $ac_cv_func_getmntinfo = yes; then
442 AC_EGREP_HEADER(f_type;, sys/mount.h,
446 && fu_cv_sys_mounted_getmntinfo=yes \
447 || fu_cv_sys_mounted_getmntinfo=no
449 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo])
450 if test $fu_cv_sys_mounted_getmntinfo = yes; then
451 list_mounted_fs=found
452 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
453 [Define if `getmntinfo' function can be used])
454 AC_MSG_CHECKING([if struct statfs has f_fstypename])
455 AC_CACHE_VAL(fu_cv_sys_mounted_f_fstypename,
456 [AC_EGREP_HEADER([f_fstypename],
458 [fu_cv_sys_mounted_f_fstypename=yes],
459 [fu_cv_sys_mounted_f_fstypename=no])
461 AC_MSG_RESULT([$fu_cv_sys_mounted_f_fstypename])
462 if test $fu_cv_sys_mounted_f_fstypename = yes; then
463 AC_DEFINE(HAVE_F_FSTYPENAME, 1,
464 [Define if `f_fstypename' is member of `struct statfs'])
469 if test -z "$list_mounted_fs"; then
471 AC_MSG_CHECKING([for getmnt function])
472 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
474 #include <sys/fs_types.h>
475 #include <sys/mount.h>],
476 fu_cv_sys_mounted_getmnt=yes,
477 fu_cv_sys_mounted_getmnt=no)])
478 AC_MSG_RESULT([$fu_cv_sys_mounted_getmnt])
479 if test $fu_cv_sys_mounted_getmnt = yes; then
480 list_mounted_fs=found
481 AC_DEFINE(MOUNTED_GETMNT, 1,
482 [Define if `getmnt' function can be used])
486 if test -z "$list_mounted_fs"; then
488 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
489 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
490 [AC_TRY_CPP([#include <mnttab.h>],
491 fu_cv_sys_mounted_fread=yes,
492 fu_cv_sys_mounted_fread=no)])
493 AC_MSG_RESULT([$fu_cv_sys_mounted_fread])
494 if test $fu_cv_sys_mounted_fread = yes; then
495 list_mounted_fs=found
496 AC_DEFINE(MOUNTED_FREAD, 1,
497 [Define if it's possible to resort to fread on /etc/mnttab])
501 if test -z "$list_mounted_fs"; then
502 AC_MSG_WARN([could not determine how to read list of mounted fs])
504 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
505 [Define if the list of mounted filesystems can be determined])
508 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
509 dnl job is to detect a method to get file system information.
511 AC_MSG_NOTICE([checking how to get filesystem space usage])
514 # Here we'll compromise a little (and perform only the link test)
515 # since it seems there are no variants of the statvfs function.
516 if test $space = no; then
518 AC_CHECK_FUNCS(statvfs)
519 if test $ac_cv_func_statvfs = yes; then
521 AC_DEFINE(STAT_STATVFS, 1,
522 [Define if function `statfs' can be used])
526 if test $space = no; then
527 # DEC Alpha running OSF/1
528 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
529 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
531 #include <sys/param.h>
532 #include <sys/types.h>
533 #include <sys/mount.h>
538 exit (statfs (".", &fsd, sizeof (struct statfs)));
540 fu_cv_sys_stat_statfs3_osf1=yes,
541 fu_cv_sys_stat_statfs3_osf1=no,
542 fu_cv_sys_stat_statfs3_osf1=no)])
543 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
544 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
546 AC_DEFINE(STAT_STATFS3_OSF1, 1,
547 [Define if function `statfs' takes 3 arguments])
551 if test $space = no; then
553 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
554 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
556 #ifdef HAVE_SYS_PARAM_H
557 #include <sys/param.h>
559 #ifdef HAVE_SYS_MOUNT_H
560 #include <sys/mount.h>
562 #ifdef HAVE_SYS_VFS_H
569 exit (statfs (".", &fsd));
571 fu_cv_sys_stat_statfs2_bsize=yes,
572 fu_cv_sys_stat_statfs2_bsize=no,
573 fu_cv_sys_stat_statfs2_bsize=no)])
574 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
575 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
577 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
578 [Define if function `statfs' takes two arguments and
579 `bsize' is member of `struct statfs'])
583 if test $space = no; then
585 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
586 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
587 [AC_TRY_RUN([#include <sys/types.h>
588 #include <sys/statfs.h>
592 exit (statfs (".", &fsd, sizeof fsd, 0));
594 fu_cv_sys_stat_statfs4=yes,
595 fu_cv_sys_stat_statfs4=no,
596 fu_cv_sys_stat_statfs4=no)])
597 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
598 if test $fu_cv_sys_stat_statfs4 = yes; then
600 AC_DEFINE(STAT_STATFS4, 1,
601 [Define if function `statfs' takes 4 arguments])
605 if test $space = no; then
607 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
608 member (4.4BSD and NetBSD)])
609 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
610 [AC_TRY_RUN([#include <sys/types.h>
611 #ifdef HAVE_SYS_PARAM_H
612 #include <sys/param.h>
614 #ifdef HAVE_SYS_MOUNT_H
615 #include <sys/mount.h>
621 exit (statfs (".", &fsd));
623 fu_cv_sys_stat_statfs2_fsize=yes,
624 fu_cv_sys_stat_statfs2_fsize=no,
625 fu_cv_sys_stat_statfs2_fsize=no)])
626 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
627 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
629 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
630 [Define if function `statfs' takes two arguments and
631 `fsize' is member of `struct statfs'])
635 if test $space = no; then
637 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
638 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
640 #include <sys/types.h>
641 #ifdef HAVE_SYS_PARAM_H
642 #include <sys/param.h>
644 #ifdef HAVE_SYS_MOUNT_H
645 #include <sys/mount.h>
647 #ifdef HAVE_SYS_FS_TYPES_H
648 #include <sys/fs_types.h>
653 /* Ultrix's statfs returns 1 for success,
654 0 for not mounted, -1 for failure. */
655 exit (statfs (".", &fsd) != 1);
657 fu_cv_sys_stat_fs_data=yes,
658 fu_cv_sys_stat_fs_data=no,
659 fu_cv_sys_stat_fs_data=no)])
660 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
661 if test $fu_cv_sys_stat_fs_data = yes; then
663 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
664 [Define if function `statfs' takes two arguments
665 and uses `struct fs_data'])
670 dnl if test $space = no; then
672 dnl AC_TRY_CPP([#include <sys/filsys.h>],
673 dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
679 dnl Try using termcap database and link with libtermcap if possible.
681 AC_DEFUN([MC_USE_TERMCAP], [
682 screen_msg="$screen_msg with termcap database"
683 AC_MSG_NOTICE([using S-Lang screen library with termcap])
684 AC_DEFINE(USE_TERMCAP, 1, [Define to use termcap database])
685 AC_CHECK_LIB(termcap, tgoto, [MCLIBS="$MCLIBS -ltermcap"], , [$LIBS])
690 dnl Common code for MC_WITH_SLANG and MC_WITH_MCSLANG
692 dnl We check for the existance of setupterm on curses library
693 dnl this is required to load certain definitions on some termcaps
694 dnl editions (AIX and OSF/1 I seem to remember).
695 dnl Note that we avoid using setupterm
697 AC_DEFUN([_MC_WITH_XSLANG], [
699 AC_DEFINE(HAVE_SLANG, 1,
700 [Define to use S-Lang library for screen management])
706 AC_CHECK_LIB(curses,setupterm,
710 [return (key_end == parm_insert_line);],
711 [MCLIBS="$MCLIBS -lcurses"
712 AC_DEFINE(USE_SETUPTERM, 1,
713 [Define to use function `setupterm'
714 from `curses' library in S-Lang])])
722 dnl Check if the system S-Lang library can be used.
723 dnl If not, and $1 is "strict", exit, otherwise fall back to mcslang.
725 AC_DEFUN([MC_WITH_SLANG], [
728 dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
729 m4_if([$1], strict, ,
730 [AC_CHECK_LIB([slang], [SLsmg_write_nwchars],
731 [AC_MSG_WARN([Rejecting S-Lang with UTF-8 support, \
732 it doesn't work well])
733 with_screen=mcslang])])
735 if test x$with_screen = xslang; then
736 AC_CHECK_LIB([slang], [SLang_init_tty], [MCLIBS="$MCLIBS -lslang"],
737 [with_screen=mcslang])
741 if test x$with_screen = xslang; then
743 AC_CHECK_HEADERS([slang.h slang/slang.h],
744 [slang_h_found=yes; break])
746 if test -z "$slang_h_found"; then
751 dnl Check if the installed S-Lang library uses termcap
752 if test x$with_screen = xslang; then
754 screen_msg="S-Lang library (installed on the system)"
755 AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
756 [Define to use S-Lang library installed on the system])
760 #ifdef HAVE_SLANG_SLANG_H
761 #include <slang/slang.h>
765 [SLtt_get_terminfo();
767 [LIBS="$ac_save_LIBS"],
768 [LIBS="$ac_save_LIBS"; MC_USE_TERMCAP])
772 [if test $with_screen != slang; then
773 AC_MSG_ERROR([S-Lang library not found])
782 dnl Use the included S-Lang library.
784 AC_DEFUN([MC_WITH_MCSLANG], [
786 screen_msg="Included S-Lang library (mcslang)"
788 # Search for terminfo database.
790 if test x"$with_termcap" != xyes; then
791 if test x"$with_termcap" = xno; then
794 if test -n "$TERMINFO" && test -r "$TERMINFO/v/vt100"; then
797 for dir in "/usr/share/terminfo" "/usr/lib/terminfo" \
798 "/usr/share/lib/terminfo" "/etc/terminfo" \
799 "/usr/local/lib/terminfo" "$HOME/.terminfo"; do
800 if test -r "$dir/v/vt100"; then
806 # If there is no terminfo, use termcap
807 if test -z "$use_terminfo"; then
816 dnl Use the ncurses library. It can only be requested explicitly,
817 dnl so just fail if anything goes wrong.
819 dnl If ncurses exports the ESCDELAY variable it should be set to 0
820 dnl or you'll have to press Esc three times to dismiss a dialog box.
822 AC_DEFUN([MC_WITH_NCURSES], [
823 dnl has_colors() is specific to ncurses, it's not in the old curses
824 AC_CHECK_LIB([ncurses], [has_colors], [MCLIBS="$MCLIBS -lncurses"],
825 [AC_MSG_ERROR([Cannot find ncurses library])])
829 AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],
830 [ncurses_h_found=yes; break])
832 if test -z "$ncurses_h_found"; then
833 AC_MSG_ERROR([Cannot find ncurses header file])
837 screen_msg="ncurses library"
838 AC_DEFINE(USE_NCURSES, 1,
839 [Define to use ncurses for screen management])
842 LIBS="$LIBS -lncurses"
843 AC_CACHE_CHECK([for ESCDELAY variable],
844 [mc_cv_ncurses_escdelay],
845 [AC_TRY_COMPILE([], [
852 [mc_cv_ncurses_escdelay=yes],
853 [mc_cv_ncurses_escdelay=no])
855 if test "$mc_cv_ncurses_escdelay" = yes; then
856 AC_DEFINE(HAVE_ESCDELAY, 1,
857 [Define if ncurses has ESCDELAY variable])
860 AC_CHECK_FUNCS(resizeterm)
866 dnl Check for ext2fs recovery code
868 AC_DEFUN([AC_EXT2_UNDEL], [
870 if test "$ext2fs_undel" = yes; then
871 AC_MSG_NOTICE([using ext2fs file recovery code])
872 vfs_flags="${vfs_flags}, undelfs"
874 MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
876 AC_MSG_NOTICE([not using ext2fs file recovery code])
880 dnl The next line is for compatibility with gettext 0.10.x
881 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])