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([ext2fs/ext2_fs.h linux/ext2_fs.h], [ext2_fs_h=yes; break])
11 if test x$ext2_fs_h = xyes; then
12 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [ext2fs_ext2fs_h=yes], ,
15 #ifdef HAVE_EXT2FS_EXT2_FS_H
16 #include <ext2fs/ext2_fs.h>
19 #include <linux/ext2_fs.h>
22 if test x$ext2fs_ext2fs_h = xyes; then
23 AC_DEFINE(USE_EXT2FSLIB, 1,
24 [Define to enable undelete support on ext2])
26 EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
27 AC_CHECK_TYPE(ext2_ino_t, ,
28 [AC_DEFINE(ext2_ino_t, ino_t,
29 [Define to ino_t if undefined.])],
35 #ifdef HAVE_EXT2FS_EXT2_FS_H
36 #include <ext2fs/ext2_fs.h>
39 #include <linux/ext2_fs.h>
41 #include <ext2fs/ext2fs.h>
50 dnl Check for tools used in extfs scripts.
51 AC_DEFUN([MC_EXTFS_CHECKS], [
52 AC_PATH_PROG([ZIP], [zip], [/usr/bin/zip])
53 AC_PATH_PROG([UNZIP], [unzip], [/usr/bin/unzip])
54 AC_CACHE_CHECK([for zipinfo code in unzip], [mc_cv_have_zipinfo],
55 [mc_cv_have_zipinfo=no
56 if $UNZIP -Z </dev/null >/dev/null 2>&1; then
57 mc_cv_have_zipinfo=yes
59 if test "x$mc_cv_have_zipinfo" = xyes; then
64 AC_SUBST([HAVE_ZIPINFO])
65 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
70 dnl MC_MCSERVER_CHECKS
71 dnl Check how mcserver should check passwords.
72 dnl Possible methods are PAM, pwdauth and crypt.
73 dnl The later works with both /etc/shadow and /etc/passwd.
74 dnl If PAM is found, other methods are not checked.
76 AC_DEFUN([MC_MCSERVER_CHECKS], [
78 dnl Check if PAM can be used for mcserv
79 AC_CHECK_LIB(dl, dlopen, [LIB_DL="-ldl"])
80 AC_CHECK_LIB(pam, pam_start, [
81 AC_DEFINE(HAVE_PAM, 1,
82 [Define if PAM (Pluggable Authentication Modules) is available])
83 MCSERVLIBS="-lpam $LIB_DL"
84 mcserv_pam=yes], [], [$LIB_DL])
86 dnl Check for crypt() - needed for both /etc/shadow and /etc/passwd.
87 if test -z "$mcserv_pam"; then
89 dnl Check for pwdauth() - used on SunOS.
90 AC_CHECK_FUNCS([pwdauth])
93 AC_CHECK_HEADERS([crypt.h], [crypt_header=yes])
94 if test -n "$crypt_header"; then
97 AC_SEARCH_LIBS(crypt, [crypt crypt_i], [mcserv_auth=crypt])
100 if test -n "$mcserv_auth"; then
101 AC_DEFINE(HAVE_CRYPT, 1,
102 [Define to use crypt function in mcserv])
104 dnl Check for shadow passwords
105 AC_CHECK_HEADERS([shadow.h shadow/shadow.h],
106 [shadow_header=yes; break])
107 if test -n "$shadow_header"; then
110 AC_SEARCH_LIBS(getspnam, [shadow], [mcserv_auth=shadow])
113 if test -n "$mcserv_auth"; then
114 AC_DEFINE(HAVE_SHADOW, 1,
115 [Define to use shadow passwords for mcserv])
128 dnl Check for various functions needed by libvfs.
129 dnl This has various effects:
130 dnl Sets MC_VFS_LIBS to libraries required
131 dnl Sets vfs_flags to "pretty" list of vfs implementations we include.
132 dnl Sets shell variable use_vfs to yes (default, --with-vfs) or
133 dnl "no" (--without-vfs).
136 AC_DEFUN([MC_WITH_VFS],[
139 vfs_flags="cpiofs, extfs, tarfs"
142 AC_ARG_ENABLE([netcode],
143 [ --enable-netcode Support for networking [[yes]]])
145 if test "x$enable_netcode" != xno; then
146 dnl FIXME: network checks should probably be in their own macro.
147 AC_CHECK_LIB(nsl, main)
148 AC_SEARCH_LIBS(socket, [xnet bsd socket inet], [have_socket=yes])
149 if test x$have_socket = xyes; then
150 AC_SEARCH_LIBS(gethostbyname, [bsd socket inet netinet])
151 AC_CHECK_MEMBERS([struct linger.l_linger], , , [
152 #include <sys/types.h>
153 #include <sys/socket.h>
155 AC_CHECK_FUNCS(pmap_set, , [
156 AC_CHECK_LIB(rpc, pmap_set, [
158 AC_DEFINE(HAVE_PMAP_SET)
160 AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
161 dnl add for source routing support setsockopt
162 AC_CHECK_HEADERS(rpc/pmap_clnt.h, , , [
163 #include <sys/types.h>
164 #include <sys/socket.h>
165 #include <netinet/in.h>
167 #include <rpc/pmap_prot.h>
173 [ --with-mcfs Support mc-specific networking file system [[no]]],
174 [if test "x$withval" != "xno"; then
175 AC_DEFINE(WITH_MCFS, 1, [Define to enable mc-specific networking file system])
176 vfs_flags="$vfs_flags, mcfs"
181 vfs_flags="$vfs_flags, ftpfs, fish"
191 [ --with-samba Support smb virtual file system [[no]]],
192 [if test "x$withval" != "xno"; then
193 AC_DEFINE(WITH_SMBFS, 1, [Define to enable VFS over SMB])
194 vfs_flags="$vfs_flags, smbfs"
199 if test -n "$use_smbfs"; then
200 #################################################
201 # set Samba configuration directory location
203 AC_ARG_WITH(configdir,
204 [ --with-configdir=DIR Where the Samba configuration files are [[/etc]]],
208 # Just in case anybody does it
210 AC_MSG_WARN([--with-configdir called without argument - will use default])
219 AC_ARG_WITH(codepagedir,
220 [ --with-codepagedir=DIR Where the Samba codepage files are],
224 # Just in case anybody does it
226 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
233 dnl Ext2fs undelete support
235 AC_ARG_WITH(ext2undel,
236 [ --with-ext2undel Compile with ext2 undelete code [[yes if found]]],
237 [if test x$withval != xno; then
238 if test x$withval != xyes; then
239 LDFLAGS="$LDFLAGS -L$withval/lib"
240 CPPFLAGS="$CPPFLAGS -I$withval/include"
245 AC_CHECK_LIB(ext2fs, ext2fs_close, [AC_EXT2_UNDEL], , [-lcom_err])
248 AC_DEFINE(USE_VFS, 1, [Define to enable VFS support])
249 if $use_net_code; then
250 AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
256 AC_DEFUN([MC_VFS_CHECKS],[
259 [ --with-vfs Compile with the VFS code [[yes]]],
266 dnl Should we issue a warning?
273 dnl Filesystem information detection
275 dnl To get information about the disk, mount points, etc.
278 AC_DEFUN([AC_GET_FS_INFO], [
279 AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
280 AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
281 AC_CHECK_HEADERS(sys/filsys.h sys/fs_types.h)
282 AC_CHECK_HEADERS(sys/mount.h, , , [
283 #include <sys/param.h>
284 #include <sys/stat.h>
286 AC_CHECK_FUNCS(getmntinfo)
288 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
289 dnl job is to detect a method to get list of mounted filesystems.
291 AC_MSG_CHECKING([for d_ino member in directory struct])
292 AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
294 #include <sys/types.h>
297 #else /* not HAVE_DIRENT_H */
298 # define dirent direct
299 # ifdef HAVE_SYS_NDIR_H
300 # include <sys/ndir.h>
301 # endif /* HAVE_SYS_NDIR_H */
302 # ifdef HAVE_SYS_DIR_H
303 # include <sys/dir.h>
304 # endif /* HAVE_SYS_DIR_H */
307 # endif /* HAVE_NDIR_H */
308 #endif /* HAVE_DIRENT_H */
310 [struct dirent dp; dp.d_ino = 0;],
311 fu_cv_sys_d_ino_in_dirent=yes,
312 fu_cv_sys_d_ino_in_dirent=no)])
313 AC_MSG_RESULT([$fu_cv_sys_d_ino_in_dirent])
314 if test $fu_cv_sys_d_ino_in_dirent = yes; then
315 AC_DEFINE(D_INO_IN_DIRENT, 1,
316 [Define if `d_ino' is member of `struct directory'])
319 # Determine how to get the list of mounted filesystems.
322 # If the getmntent function is available but not in the standard library,
323 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
326 if test $ac_cv_func_getmntent = yes; then
328 # This system has the getmntent function.
329 # Determine whether it's the one-argument variant or the two-argument one.
331 if test -z "$list_mounted_fs"; then
333 AC_MSG_CHECKING([for two-argument getmntent function])
334 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
335 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
336 fu_cv_sys_mounted_getmntent2=yes,
337 fu_cv_sys_mounted_getmntent2=no)])
338 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent2])
339 if test $fu_cv_sys_mounted_getmntent2 = yes; then
340 list_mounted_fs=found
341 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
342 [Define if function `getmntent' takes 2 arguments])
346 if test -z "$list_mounted_fs"; then
347 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
348 AC_MSG_CHECKING([for one-argument getmntent function])
349 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
350 [test $ac_cv_header_mntent_h = yes \
351 && fu_cv_sys_mounted_getmntent1=yes \
352 || fu_cv_sys_mounted_getmntent1=no])
353 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent1])
354 if test $fu_cv_sys_mounted_getmntent1 = yes; then
355 list_mounted_fs=found
356 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
357 [Define if function `getmntent' takes 1 argument])
363 if test -z "$list_mounted_fs"; then
364 # DEC Alpha running OSF/1.
365 AC_MSG_CHECKING([for getfsstat function])
366 AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
368 #include <sys/types.h>
369 #include <sys/mount.h>
370 #include <sys/fs_types.h>],
371 [struct statfs *stats;
372 numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
373 fu_cv_sys_mounted_getsstat=yes,
374 fu_cv_sys_mounted_getsstat=no)])
375 AC_MSG_RESULT([$fu_cv_sys_mounted_getsstat])
376 if test $fu_cv_sys_mounted_getsstat = yes; then
377 list_mounted_fs=found
378 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
379 [Define if function `getfsstat' can be used])
383 if test -z "$list_mounted_fs"; then
385 AC_MSG_CHECKING([for mntctl function and struct vmount])
386 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
387 [AC_TRY_CPP([#include <fshelp.h>],
388 fu_cv_sys_mounted_vmount=yes,
389 fu_cv_sys_mounted_vmount=no)])
390 AC_MSG_RESULT([$fu_cv_sys_mounted_vmount])
391 if test $fu_cv_sys_mounted_vmount = yes; then
392 list_mounted_fs=found
393 AC_DEFINE(MOUNTED_VMOUNT, 1,
394 [Define if function `mntctl' and `struct vmount' can be used])
398 if test -z "$list_mounted_fs"; then
400 AC_MSG_CHECKING([for existence of three headers])
401 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
403 #include <sys/statfs.h>
404 #include <sys/fstyp.h>
405 #include <mnttab.h>],
406 fu_cv_sys_mounted_fread_fstyp=yes,
407 fu_cv_sys_mounted_fread_fstyp=no)])
408 AC_MSG_RESULT([$fu_cv_sys_mounted_fread_fstyp])
409 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
410 list_mounted_fs=found
411 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
412 [Define if sys/statfs.h, sys/fstyp.h and mnttab.h
413 can be used together])
417 if test -z "$list_mounted_fs"; then
418 # 4.4BSD and DEC OSF/1.
419 AC_MSG_CHECKING([for getmntinfo function])
420 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
423 if test $ac_cv_func_getmntinfo = yes; then
424 AC_EGREP_HEADER(f_type;, sys/mount.h,
428 && fu_cv_sys_mounted_getmntinfo=yes \
429 || fu_cv_sys_mounted_getmntinfo=no
431 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo])
432 if test $fu_cv_sys_mounted_getmntinfo = yes; then
433 list_mounted_fs=found
434 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
435 [Define if `getmntinfo' function can be used])
436 AC_MSG_CHECKING([if struct statfs has f_fstypename])
437 AC_CACHE_VAL(fu_cv_sys_mounted_f_fstypename,
438 [AC_EGREP_HEADER([f_fstypename],
440 [fu_cv_sys_mounted_f_fstypename=yes],
441 [fu_cv_sys_mounted_f_fstypename=no])
443 AC_MSG_RESULT([$fu_cv_sys_mounted_f_fstypename])
444 if test $fu_cv_sys_mounted_f_fstypename = yes; then
445 AC_DEFINE(HAVE_F_FSTYPENAME, 1,
446 [Define if `f_fstypename' is member of `struct statfs'])
451 if test -z "$list_mounted_fs"; then
453 AC_MSG_CHECKING([for getmnt function])
454 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
456 #include <sys/fs_types.h>
457 #include <sys/mount.h>],
458 fu_cv_sys_mounted_getmnt=yes,
459 fu_cv_sys_mounted_getmnt=no)])
460 AC_MSG_RESULT([$fu_cv_sys_mounted_getmnt])
461 if test $fu_cv_sys_mounted_getmnt = yes; then
462 list_mounted_fs=found
463 AC_DEFINE(MOUNTED_GETMNT, 1,
464 [Define if `getmnt' function can be used])
468 if test -z "$list_mounted_fs"; then
470 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
471 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
472 [AC_TRY_CPP([#include <mnttab.h>],
473 fu_cv_sys_mounted_fread=yes,
474 fu_cv_sys_mounted_fread=no)])
475 AC_MSG_RESULT([$fu_cv_sys_mounted_fread])
476 if test $fu_cv_sys_mounted_fread = yes; then
477 list_mounted_fs=found
478 AC_DEFINE(MOUNTED_FREAD, 1,
479 [Define if it's possible to resort to fread on /etc/mnttab])
483 if test -z "$list_mounted_fs"; then
484 AC_MSG_WARN([could not determine how to read list of mounted fs])
486 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
487 [Define if the list of mounted filesystems can be determined])
490 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
491 dnl job is to detect a method to get file system information.
493 AC_MSG_NOTICE([checking how to get filesystem space usage])
496 # Here we'll compromise a little (and perform only the link test)
497 # since it seems there are no variants of the statvfs function.
498 if test $space = no; then
500 AC_CHECK_FUNCS(statvfs)
501 if test $ac_cv_func_statvfs = yes; then
503 AC_DEFINE(STAT_STATVFS, 1,
504 [Define if function `statfs' can be used])
508 if test $space = no; then
509 # DEC Alpha running OSF/1
510 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
511 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
513 #include <sys/param.h>
514 #include <sys/types.h>
515 #include <sys/mount.h>
520 exit (statfs (".", &fsd, sizeof (struct statfs)));
522 fu_cv_sys_stat_statfs3_osf1=yes,
523 fu_cv_sys_stat_statfs3_osf1=no,
524 fu_cv_sys_stat_statfs3_osf1=no)])
525 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
526 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
528 AC_DEFINE(STAT_STATFS3_OSF1, 1,
529 [Define if function `statfs' takes 3 arguments])
533 if test $space = no; then
535 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
536 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
538 #ifdef HAVE_SYS_PARAM_H
539 #include <sys/param.h>
541 #ifdef HAVE_SYS_MOUNT_H
542 #include <sys/mount.h>
544 #ifdef HAVE_SYS_VFS_H
551 exit (statfs (".", &fsd));
553 fu_cv_sys_stat_statfs2_bsize=yes,
554 fu_cv_sys_stat_statfs2_bsize=no,
555 fu_cv_sys_stat_statfs2_bsize=no)])
556 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
557 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
559 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
560 [Define if function `statfs' takes two arguments and
561 `bsize' is member of `struct statfs'])
565 if test $space = no; then
567 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
568 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
569 [AC_TRY_RUN([#include <sys/types.h>
570 #include <sys/statfs.h>
574 exit (statfs (".", &fsd, sizeof fsd, 0));
576 fu_cv_sys_stat_statfs4=yes,
577 fu_cv_sys_stat_statfs4=no,
578 fu_cv_sys_stat_statfs4=no)])
579 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
580 if test $fu_cv_sys_stat_statfs4 = yes; then
582 AC_DEFINE(STAT_STATFS4, 1,
583 [Define if function `statfs' takes 4 arguments])
587 if test $space = no; then
589 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
590 member (4.4BSD and NetBSD)])
591 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
592 [AC_TRY_RUN([#include <sys/types.h>
593 #ifdef HAVE_SYS_PARAM_H
594 #include <sys/param.h>
596 #ifdef HAVE_SYS_MOUNT_H
597 #include <sys/mount.h>
603 exit (statfs (".", &fsd));
605 fu_cv_sys_stat_statfs2_fsize=yes,
606 fu_cv_sys_stat_statfs2_fsize=no,
607 fu_cv_sys_stat_statfs2_fsize=no)])
608 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
609 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
611 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
612 [Define if function `statfs' takes two arguments and
613 `fsize' is member of `struct statfs'])
617 if test $space = no; then
619 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
620 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
622 #include <sys/types.h>
623 #ifdef HAVE_SYS_PARAM_H
624 #include <sys/param.h>
626 #ifdef HAVE_SYS_MOUNT_H
627 #include <sys/mount.h>
629 #ifdef HAVE_SYS_FS_TYPES_H
630 #include <sys/fs_types.h>
635 /* Ultrix's statfs returns 1 for success,
636 0 for not mounted, -1 for failure. */
637 exit (statfs (".", &fsd) != 1);
639 fu_cv_sys_stat_fs_data=yes,
640 fu_cv_sys_stat_fs_data=no,
641 fu_cv_sys_stat_fs_data=no)])
642 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
643 if test $fu_cv_sys_stat_fs_data = yes; then
645 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
646 [Define if function `statfs' takes two arguments
647 and uses `struct fs_data'])
652 dnl if test $space = no; then
654 dnl AC_TRY_CPP([#include <sys/filsys.h>],
655 dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
661 dnl Try using termcap database and link with libtermcap if possible.
663 AC_DEFUN([MC_USE_TERMCAP], [
664 screen_msg="$screen_msg with termcap database"
665 AC_MSG_NOTICE([using S-Lang screen library with termcap])
666 AC_DEFINE(USE_TERMCAP, 1, [Define to use termcap database])
667 AC_CHECK_LIB(termcap, tgoto, [MCLIBS="$MCLIBS -ltermcap"], , [$LIBS])
672 dnl Check if private functions are available for linking
674 AC_DEFUN([MC_SLANG_PRIVATE], [
675 AC_CACHE_CHECK([if S-Lang exports private functions],
676 [mc_cv_slang_private], [
680 #ifdef HAVE_SLANG_SLANG_H
681 #include <slang/slang.h>
685 #if SLANG_VERSION >= 10000
686 extern unsigned int SLsys_getkey (void);
688 extern unsigned int _SLsys_getkey (void);
691 #if SLANG_VERSION >= 10000
697 [mc_cv_slang_private=yes],
698 [mc_cv_slang_private=no])
702 if test x$mc_cv_slang_private = xyes; then
703 AC_DEFINE(HAVE_SLANG_PRIVATE, 1,
704 [Define if private S-Lang functions are available])
710 dnl Check if the installed S-Lang library uses termcap
712 AC_DEFUN([MC_SLANG_TERMCAP], [
713 AC_CACHE_CHECK([if S-Lang uses termcap], [mc_cv_slang_termcap], [
717 #ifdef HAVE_SLANG_SLANG_H
718 #include <slang/slang.h>
723 [SLtt_get_terminfo(); SLtt_tgetflag("");],
724 [mc_cv_slang_termcap=no],
725 [mc_cv_slang_termcap=yes])
729 if test x$mc_cv_slang_termcap = xyes; then
735 dnl Common code for MC_WITH_SLANG and MC_WITH_MCSLANG
737 AC_DEFUN([_MC_WITH_XSLANG], [
739 AC_DEFINE(HAVE_SLANG, 1,
740 [Define to use S-Lang library for screen management])
745 dnl Check if the system S-Lang library can be used.
746 dnl If not, and $1 is "strict", exit, otherwise fall back to mcslang.
748 AC_DEFUN([MC_WITH_SLANG], [
753 AC_CHECK_HEADERS([slang.h slang/slang.h],
754 [slang_h_found=yes; break])
755 if test -z "$slang_h_found"; then
759 dnl Check if termcap is needed.
760 dnl This check must be done before anything is linked against S-Lang.
761 if test x$with_screen = xslang; then
765 dnl Check the library
766 if test x$with_screen = xslang; then
767 AC_CHECK_LIB([slang], [SLang_init_tty], [MCLIBS="$MCLIBS -lslang"],
768 [with_screen=mcslang], ["$MCLIBS"])
771 dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
772 if test x$with_screen = xslang; then
774 m4_if([$1], strict, ,
775 [AC_CHECK_LIB([slang], [SLsmg_write_nwchars],
776 [AC_MSG_WARN([Rejecting S-Lang with UTF-8 support, \
777 it's not fully supported yet])
778 with_screen=mcslang])])
781 if test x$with_screen = xslang; then
782 AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
783 [Define to use S-Lang library installed on the system])
786 screen_msg="S-Lang library (installed on the system)"
789 [if test $with_screen != slang; then
790 AC_MSG_ERROR([S-Lang library not found])
801 dnl Use the included S-Lang library.
803 AC_DEFUN([MC_WITH_MCSLANG], [
805 screen_msg="Included S-Lang library (mcslang)"
807 # Search for terminfo database.
809 if test x"$with_termcap" != xyes; then
810 if test x"$with_termcap" = xno; then
813 if test -n "$TERMINFO" && test -r "$TERMINFO/v/vt100"; then
816 for dir in "/usr/share/terminfo" "/usr/lib/terminfo" \
817 "/usr/share/lib/terminfo" "/etc/terminfo" \
818 "/usr/local/lib/terminfo" "$HOME/.terminfo"; do
819 if test -r "$dir/v/vt100"; then
825 # If there is no terminfo, use termcap
826 if test -z "$use_terminfo"; then
835 dnl Use the ncurses library. It can only be requested explicitly,
836 dnl so just fail if anything goes wrong.
838 dnl If ncurses exports the ESCDELAY variable it should be set to 0
839 dnl or you'll have to press Esc three times to dismiss a dialog box.
841 AC_DEFUN([MC_WITH_NCURSES], [
842 dnl has_colors() is specific to ncurses, it's not in the old curses
845 AC_SEARCH_LIBS([has_colors], [ncurses curses], [MCLIBS="$MCLIBS $LIBS"],
846 [AC_MSG_ERROR([Cannot find ncurses library])])
850 AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],
851 [ncurses_h_found=yes; break])
853 if test -z "$ncurses_h_found"; then
854 AC_MSG_ERROR([Cannot find ncurses header file])
858 screen_msg="ncurses library"
859 AC_DEFINE(USE_NCURSES, 1,
860 [Define to use ncurses for screen management])
862 AC_CACHE_CHECK([for ESCDELAY variable],
863 [mc_cv_ncurses_escdelay],
868 [mc_cv_ncurses_escdelay=yes],
869 [mc_cv_ncurses_escdelay=no])
871 if test "$mc_cv_ncurses_escdelay" = yes; then
872 AC_DEFINE(HAVE_ESCDELAY, 1,
873 [Define if ncurses has ESCDELAY variable])
876 AC_CHECK_FUNCS(resizeterm)
882 dnl Check for ext2fs recovery code
884 AC_DEFUN([AC_EXT2_UNDEL], [
886 if test "$ext2fs_undel" = yes; then
887 AC_MSG_NOTICE([using ext2fs file recovery code])
888 vfs_flags="${vfs_flags}, undelfs"
890 MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
892 AC_MSG_NOTICE([not using ext2fs file recovery code])
896 dnl The next line is for compatibility with gettext 0.10.x
897 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
900 dnl Check whether the g_module_* family of functions works
901 dnl on this system. We need to know that at the compile time to
902 dnl decide whether to link with X11.
904 AC_DEFUN([AC_G_MODULE_SUPPORTED], [
905 AC_CACHE_CHECK([if gmodule functionality is supported], mc_cv_g_module_supported, [
906 ac_save_CFLAGS="$CFLAGS"
908 CFLAGS="$CFLAGS $GMODULE_CFLAGS"
909 LIBS="$GMODULE_LIBS $LIBS"
915 int ret = (g_module_supported () == TRUE) ? 0 : 1;
919 [mc_cv_g_module_supported=yes],
920 [mc_cv_g_module_supported=no],
921 [mc_cv_g_module_supported=no]
923 CFLAGS="$ac_save_CFLAGS"
927 if test "$mc_cv_g_module_supported" = yes; then
928 AC_DEFINE(HAVE_GMODULE, 1,
929 [Define if gmodule functionality is supported])
935 dnl Check if it's possible to use asm labels to rename functions.
936 dnl This macro is necessary because gettext wrongly assumes that gcc
937 dnl can do it regardless of the OS.
939 AC_DEFUN([MC_ASM_LABELS], [
940 AC_CACHE_CHECK([whether functions can be renamed by asm labels],
943 if test -n "$GCC"; then
945 static int function1 (void) __asm__ ("function2");
946 static int function1 (void)
951 ], [mc_cv_asm_labels=yes])
955 if test "$mc_cv_asm_labels" != yes; then
956 AC_DEFINE(_INTL_REDIRECT_MACROS, 1,
957 [Define if functions cannot be renamed by asm labels])