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_SEARCH_LIBS(socket, [xnet bsd socket inet], [have_socket=yes])
148 if test x$have_socket = xyes; then
149 AC_SEARCH_LIBS(gethostbyname, [bsd socket inet netinet])
150 AC_CHECK_MEMBERS([struct linger.l_linger], , , [
151 #include <sys/types.h>
152 #include <sys/socket.h>
154 AC_CHECK_FUNCS(pmap_set, , [
155 AC_CHECK_LIB(rpc, pmap_set, [
157 AC_DEFINE(HAVE_PMAP_SET)
159 AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
160 dnl add for source routing support setsockopt
161 AC_CHECK_HEADERS(rpc/pmap_clnt.h, , , [
162 #include <sys/types.h>
163 #include <sys/socket.h>
164 #include <netinet/in.h>
166 #include <rpc/pmap_prot.h>
172 [ --with-mcfs Support mc-specific networking file system [[no]]],
173 [if test "x$withval" != "xno"; then
174 AC_DEFINE(WITH_MCFS, 1, [Define to enable mc-specific networking file system])
175 vfs_flags="$vfs_flags, mcfs"
180 vfs_flags="$vfs_flags, ftpfs, fish"
190 [ --with-samba Support smb virtual file system [[no]]],
191 [if test "x$withval" != "xno"; then
192 AC_DEFINE(WITH_SMBFS, 1, [Define to enable VFS over SMB])
193 vfs_flags="$vfs_flags, smbfs"
198 if test -n "$use_smbfs"; then
199 #################################################
200 # set Samba configuration directory location
202 AC_ARG_WITH(configdir,
203 [ --with-configdir=DIR Where the Samba configuration files are [[/etc]]],
207 # Just in case anybody does it
209 AC_MSG_WARN([--with-configdir called without argument - will use default])
218 AC_ARG_WITH(codepagedir,
219 [ --with-codepagedir=DIR Where the Samba codepage files are],
223 # Just in case anybody does it
225 AC_MSG_WARN([--with-codepagedir called without argument - will use default])
232 dnl Ext2fs undelete support
234 AC_ARG_WITH(ext2undel,
235 [ --with-ext2undel Compile with ext2 undelete code [[yes if found]]],
236 [if test x$withval != xno; then
237 if test x$withval != xyes; then
238 LDFLAGS="$LDFLAGS -L$withval/lib"
239 CPPFLAGS="$CPPFLAGS -I$withval/include"
244 AC_CHECK_LIB(ext2fs, ext2fs_close, [AC_EXT2_UNDEL], , [-lcom_err])
247 AC_DEFINE(USE_VFS, 1, [Define to enable VFS support])
248 if $use_net_code; then
249 AC_DEFINE(USE_NETCODE, 1, [Define to use networked VFS])
255 AC_DEFUN([MC_VFS_CHECKS],[
258 [ --with-vfs Compile with the VFS code [[yes]]],
265 dnl Should we issue a warning?
272 dnl Filesystem information detection
274 dnl To get information about the disk, mount points, etc.
277 AC_DEFUN([AC_GET_FS_INFO], [
278 AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
279 AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
280 AC_CHECK_HEADERS(sys/filsys.h sys/fs_types.h)
281 AC_CHECK_HEADERS(sys/mount.h, , , [
282 #include <sys/param.h>
283 #include <sys/stat.h>
285 AC_CHECK_FUNCS(getmntinfo)
287 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
288 dnl job is to detect a method to get list of mounted filesystems.
290 AC_MSG_CHECKING([for d_ino member in directory struct])
291 AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
293 #include <sys/types.h>
296 #else /* not HAVE_DIRENT_H */
297 # define dirent direct
298 # ifdef HAVE_SYS_NDIR_H
299 # include <sys/ndir.h>
300 # endif /* HAVE_SYS_NDIR_H */
301 # ifdef HAVE_SYS_DIR_H
302 # include <sys/dir.h>
303 # endif /* HAVE_SYS_DIR_H */
306 # endif /* HAVE_NDIR_H */
307 #endif /* HAVE_DIRENT_H */
309 [struct dirent dp; dp.d_ino = 0;],
310 fu_cv_sys_d_ino_in_dirent=yes,
311 fu_cv_sys_d_ino_in_dirent=no)])
312 AC_MSG_RESULT([$fu_cv_sys_d_ino_in_dirent])
313 if test $fu_cv_sys_d_ino_in_dirent = yes; then
314 AC_DEFINE(D_INO_IN_DIRENT, 1,
315 [Define if `d_ino' is member of `struct directory'])
318 # Determine how to get the list of mounted filesystems.
321 # If the getmntent function is available but not in the standard library,
322 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
325 if test $ac_cv_func_getmntent = yes; then
327 # This system has the getmntent function.
328 # Determine whether it's the one-argument variant or the two-argument one.
330 if test -z "$list_mounted_fs"; then
332 AC_MSG_CHECKING([for two-argument getmntent function])
333 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
334 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
335 fu_cv_sys_mounted_getmntent2=yes,
336 fu_cv_sys_mounted_getmntent2=no)])
337 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent2])
338 if test $fu_cv_sys_mounted_getmntent2 = yes; then
339 list_mounted_fs=found
340 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
341 [Define if function `getmntent' takes 2 arguments])
345 if test -z "$list_mounted_fs"; then
346 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
347 AC_MSG_CHECKING([for one-argument getmntent function])
348 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
349 [test $ac_cv_header_mntent_h = yes \
350 && fu_cv_sys_mounted_getmntent1=yes \
351 || fu_cv_sys_mounted_getmntent1=no])
352 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent1])
353 if test $fu_cv_sys_mounted_getmntent1 = yes; then
354 list_mounted_fs=found
355 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
356 [Define if function `getmntent' takes 1 argument])
362 if test -z "$list_mounted_fs"; then
363 # DEC Alpha running OSF/1.
364 AC_MSG_CHECKING([for getfsstat function])
365 AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
367 #include <sys/types.h>
368 #include <sys/mount.h>
369 #include <sys/fs_types.h>],
370 [struct statfs *stats;
371 numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
372 fu_cv_sys_mounted_getsstat=yes,
373 fu_cv_sys_mounted_getsstat=no)])
374 AC_MSG_RESULT([$fu_cv_sys_mounted_getsstat])
375 if test $fu_cv_sys_mounted_getsstat = yes; then
376 list_mounted_fs=found
377 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
378 [Define if function `getfsstat' can be used])
382 if test -z "$list_mounted_fs"; then
384 AC_MSG_CHECKING([for mntctl function and struct vmount])
385 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
386 [AC_TRY_CPP([#include <fshelp.h>],
387 fu_cv_sys_mounted_vmount=yes,
388 fu_cv_sys_mounted_vmount=no)])
389 AC_MSG_RESULT([$fu_cv_sys_mounted_vmount])
390 if test $fu_cv_sys_mounted_vmount = yes; then
391 list_mounted_fs=found
392 AC_DEFINE(MOUNTED_VMOUNT, 1,
393 [Define if function `mntctl' and `struct vmount' can be used])
397 if test -z "$list_mounted_fs"; then
399 AC_MSG_CHECKING([for existence of three headers])
400 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
402 #include <sys/statfs.h>
403 #include <sys/fstyp.h>
404 #include <mnttab.h>],
405 fu_cv_sys_mounted_fread_fstyp=yes,
406 fu_cv_sys_mounted_fread_fstyp=no)])
407 AC_MSG_RESULT([$fu_cv_sys_mounted_fread_fstyp])
408 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
409 list_mounted_fs=found
410 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
411 [Define if sys/statfs.h, sys/fstyp.h and mnttab.h
412 can be used together])
416 if test -z "$list_mounted_fs"; then
417 # 4.4BSD and DEC OSF/1.
418 AC_MSG_CHECKING([for getmntinfo function])
419 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
422 if test $ac_cv_func_getmntinfo = yes; then
423 AC_EGREP_HEADER(f_type;, sys/mount.h,
427 && fu_cv_sys_mounted_getmntinfo=yes \
428 || fu_cv_sys_mounted_getmntinfo=no
430 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo])
431 if test $fu_cv_sys_mounted_getmntinfo = yes; then
432 list_mounted_fs=found
433 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
434 [Define if `getmntinfo' function can be used])
435 AC_MSG_CHECKING([if struct statfs has f_fstypename])
436 AC_CACHE_VAL(fu_cv_sys_mounted_f_fstypename,
437 [AC_EGREP_HEADER([f_fstypename],
439 [fu_cv_sys_mounted_f_fstypename=yes],
440 [fu_cv_sys_mounted_f_fstypename=no])
442 AC_MSG_RESULT([$fu_cv_sys_mounted_f_fstypename])
443 if test $fu_cv_sys_mounted_f_fstypename = yes; then
444 AC_DEFINE(HAVE_F_FSTYPENAME, 1,
445 [Define if `f_fstypename' is member of `struct statfs'])
450 if test -z "$list_mounted_fs"; then
452 AC_MSG_CHECKING([for getmnt function])
453 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
455 #include <sys/fs_types.h>
456 #include <sys/mount.h>],
457 fu_cv_sys_mounted_getmnt=yes,
458 fu_cv_sys_mounted_getmnt=no)])
459 AC_MSG_RESULT([$fu_cv_sys_mounted_getmnt])
460 if test $fu_cv_sys_mounted_getmnt = yes; then
461 list_mounted_fs=found
462 AC_DEFINE(MOUNTED_GETMNT, 1,
463 [Define if `getmnt' function can be used])
467 if test -z "$list_mounted_fs"; then
469 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
470 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
471 [AC_TRY_CPP([#include <mnttab.h>],
472 fu_cv_sys_mounted_fread=yes,
473 fu_cv_sys_mounted_fread=no)])
474 AC_MSG_RESULT([$fu_cv_sys_mounted_fread])
475 if test $fu_cv_sys_mounted_fread = yes; then
476 list_mounted_fs=found
477 AC_DEFINE(MOUNTED_FREAD, 1,
478 [Define if it's possible to resort to fread on /etc/mnttab])
482 if test -z "$list_mounted_fs"; then
483 AC_MSG_WARN([could not determine how to read list of mounted fs])
485 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
486 [Define if the list of mounted filesystems can be determined])
489 dnl This configure.in code has been stolen from GNU fileutils-3.12. Its
490 dnl job is to detect a method to get file system information.
492 AC_MSG_NOTICE([checking how to get filesystem space usage])
495 # Here we'll compromise a little (and perform only the link test)
496 # since it seems there are no variants of the statvfs function.
497 if test $space = no; then
499 AC_CHECK_FUNCS(statvfs)
500 if test $ac_cv_func_statvfs = yes; then
502 AC_DEFINE(STAT_STATVFS, 1,
503 [Define if function `statvfs' can be used])
507 if test $space = no; then
508 # DEC Alpha running OSF/1
509 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
510 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
512 #include <sys/param.h>
513 #include <sys/types.h>
514 #include <sys/mount.h>
519 exit (statfs (".", &fsd, sizeof (struct statfs)));
521 fu_cv_sys_stat_statfs3_osf1=yes,
522 fu_cv_sys_stat_statfs3_osf1=no,
523 fu_cv_sys_stat_statfs3_osf1=no)])
524 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
525 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
527 AC_DEFINE(STAT_STATFS3_OSF1, 1,
528 [Define if function `statfs' takes 3 arguments])
532 if test $space = no; then
534 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
535 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
537 #ifdef HAVE_SYS_PARAM_H
538 #include <sys/param.h>
540 #ifdef HAVE_SYS_MOUNT_H
541 #include <sys/mount.h>
543 #ifdef HAVE_SYS_VFS_H
550 exit (statfs (".", &fsd));
552 fu_cv_sys_stat_statfs2_bsize=yes,
553 fu_cv_sys_stat_statfs2_bsize=no,
554 fu_cv_sys_stat_statfs2_bsize=no)])
555 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
556 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
558 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
559 [Define if function `statfs' takes two arguments and
560 `bsize' is member of `struct statfs'])
564 if test $space = no; then
566 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
567 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
568 [AC_TRY_RUN([#include <sys/types.h>
569 #include <sys/statfs.h>
573 exit (statfs (".", &fsd, sizeof fsd, 0));
575 fu_cv_sys_stat_statfs4=yes,
576 fu_cv_sys_stat_statfs4=no,
577 fu_cv_sys_stat_statfs4=no)])
578 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
579 if test $fu_cv_sys_stat_statfs4 = yes; then
581 AC_DEFINE(STAT_STATFS4, 1,
582 [Define if function `statfs' takes 4 arguments])
586 if test $space = no; then
588 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
589 member (4.4BSD and NetBSD)])
590 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
591 [AC_TRY_RUN([#include <sys/types.h>
592 #ifdef HAVE_SYS_PARAM_H
593 #include <sys/param.h>
595 #ifdef HAVE_SYS_MOUNT_H
596 #include <sys/mount.h>
602 exit (statfs (".", &fsd));
604 fu_cv_sys_stat_statfs2_fsize=yes,
605 fu_cv_sys_stat_statfs2_fsize=no,
606 fu_cv_sys_stat_statfs2_fsize=no)])
607 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
608 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
610 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
611 [Define if function `statfs' takes two arguments and
612 `fsize' is member of `struct statfs'])
616 if test $space = no; then
618 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
619 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
621 #include <sys/types.h>
622 #ifdef HAVE_SYS_PARAM_H
623 #include <sys/param.h>
625 #ifdef HAVE_SYS_MOUNT_H
626 #include <sys/mount.h>
628 #ifdef HAVE_SYS_FS_TYPES_H
629 #include <sys/fs_types.h>
634 /* Ultrix's statfs returns 1 for success,
635 0 for not mounted, -1 for failure. */
636 exit (statfs (".", &fsd) != 1);
638 fu_cv_sys_stat_fs_data=yes,
639 fu_cv_sys_stat_fs_data=no,
640 fu_cv_sys_stat_fs_data=no)])
641 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
642 if test $fu_cv_sys_stat_fs_data = yes; then
644 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
645 [Define if function `statfs' takes two arguments
646 and uses `struct fs_data'])
651 dnl if test $space = no; then
653 dnl AC_TRY_CPP([#include <sys/filsys.h>],
654 dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
660 dnl Try using termcap database and link with libtermcap if possible.
662 AC_DEFUN([MC_USE_TERMCAP], [
663 screen_msg="$screen_msg with termcap database"
664 AC_MSG_NOTICE([using S-Lang screen library with termcap])
665 AC_DEFINE(USE_TERMCAP, 1, [Define to use termcap database])
666 AC_CHECK_LIB(termcap, tgoto, [MCLIBS="$MCLIBS -ltermcap"], , [$LIBS])
671 dnl Check if private functions are available for linking
673 AC_DEFUN([MC_SLANG_PRIVATE], [
674 AC_CACHE_CHECK([if S-Lang exports private functions],
675 [mc_cv_slang_private], [
679 #ifdef HAVE_SLANG_SLANG_H
680 #include <slang/slang.h>
684 #if SLANG_VERSION >= 10000
685 extern unsigned int SLsys_getkey (void);
687 extern unsigned int _SLsys_getkey (void);
690 #if SLANG_VERSION >= 10000
696 [mc_cv_slang_private=yes],
697 [mc_cv_slang_private=no])
701 if test x$mc_cv_slang_private = xyes; then
702 AC_DEFINE(HAVE_SLANG_PRIVATE, 1,
703 [Define if private S-Lang functions are available])
709 dnl Check if the installed S-Lang library uses termcap
711 AC_DEFUN([MC_SLANG_TERMCAP], [
712 AC_CACHE_CHECK([if S-Lang uses termcap], [mc_cv_slang_termcap], [
716 #ifdef HAVE_SLANG_SLANG_H
717 #include <slang/slang.h>
722 [SLtt_get_terminfo(); SLtt_tgetflag("");],
723 [mc_cv_slang_termcap=no],
724 [mc_cv_slang_termcap=yes])
728 if test x$mc_cv_slang_termcap = xyes; then
734 dnl Common code for MC_WITH_SLANG and MC_WITH_MCSLANG
736 AC_DEFUN([_MC_WITH_XSLANG], [
738 AC_DEFINE(HAVE_SLANG, 1,
739 [Define to use S-Lang library for screen management])
744 dnl Check if the system S-Lang library can be used.
745 dnl If not, and $1 is "strict", exit, otherwise fall back to mcslang.
747 AC_DEFUN([MC_WITH_SLANG], [
752 AC_CHECK_HEADERS([slang.h slang/slang.h],
753 [slang_h_found=yes; break])
754 if test -z "$slang_h_found"; then
758 dnl Check if termcap is needed.
759 dnl This check must be done before anything is linked against S-Lang.
760 if test x$with_screen = xslang; then
764 dnl Check the library
765 if test x$with_screen = xslang; then
766 AC_CHECK_LIB([slang], [SLang_init_tty], [MCLIBS="$MCLIBS -lslang"],
767 [with_screen=mcslang], ["$MCLIBS"])
770 dnl Unless external S-Lang was requested, reject S-Lang with UTF-8 hacks
771 if test x$with_screen = xslang; then
773 m4_if([$1], strict, ,
774 [AC_CHECK_LIB([slang], [SLsmg_write_nwchars],
775 [AC_MSG_WARN([Rejecting S-Lang with UTF-8 support, \
776 it's not fully supported yet])
777 with_screen=mcslang])])
780 if test x$with_screen = xslang; then
781 AC_DEFINE(HAVE_SYSTEM_SLANG, 1,
782 [Define to use S-Lang library installed on the system])
785 screen_msg="S-Lang library (installed on the system)"
788 [if test $with_screen != slang; then
789 AC_MSG_ERROR([S-Lang library not found])
800 dnl Use the included S-Lang library.
802 AC_DEFUN([MC_WITH_MCSLANG], [
804 screen_msg="Included S-Lang library (mcslang)"
806 # Search for terminfo database.
808 if test x"$with_termcap" != xyes; then
809 if test x"$with_termcap" = xno; then
812 if test -n "$TERMINFO" && test -r "$TERMINFO/v/vt100"; then
815 for dir in "/usr/share/terminfo" "/usr/lib/terminfo" \
816 "/usr/share/lib/terminfo" "/etc/terminfo" \
817 "/usr/local/lib/terminfo" "$HOME/.terminfo"; do
818 if test -r "$dir/v/vt100"; then
824 # If there is no terminfo, use termcap
825 if test -z "$use_terminfo"; then
834 dnl Use the ncurses library. It can only be requested explicitly,
835 dnl so just fail if anything goes wrong.
837 dnl If ncurses exports the ESCDELAY variable it should be set to 0
838 dnl or you'll have to press Esc three times to dismiss a dialog box.
840 AC_DEFUN([MC_WITH_NCURSES], [
841 dnl has_colors() is specific to ncurses, it's not in the old curses
844 AC_SEARCH_LIBS([has_colors], [ncurses curses], [MCLIBS="$MCLIBS $LIBS"],
845 [AC_MSG_ERROR([Cannot find ncurses library])])
849 AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],
850 [ncurses_h_found=yes; break])
852 if test -z "$ncurses_h_found"; then
853 AC_MSG_ERROR([Cannot find ncurses header file])
857 screen_msg="ncurses library"
858 AC_DEFINE(USE_NCURSES, 1,
859 [Define to use ncurses for screen management])
861 AC_CACHE_CHECK([for ESCDELAY variable],
862 [mc_cv_ncurses_escdelay],
867 [mc_cv_ncurses_escdelay=yes],
868 [mc_cv_ncurses_escdelay=no])
870 if test "$mc_cv_ncurses_escdelay" = yes; then
871 AC_DEFINE(HAVE_ESCDELAY, 1,
872 [Define if ncurses has ESCDELAY variable])
875 AC_CHECK_FUNCS(resizeterm)
881 dnl Check for ext2fs recovery code
883 AC_DEFUN([AC_EXT2_UNDEL], [
885 if test "$ext2fs_undel" = yes; then
886 AC_MSG_NOTICE([using ext2fs file recovery code])
887 vfs_flags="${vfs_flags}, undelfs"
889 MCLIBS="$MCLIBS $EXT2FS_UNDEL_LIBS"
891 AC_MSG_NOTICE([not using ext2fs file recovery code])
895 dnl The next line is for compatibility with gettext 0.10.x
896 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
899 dnl Check whether the g_module_* family of functions works
900 dnl on this system. We need to know that at the compile time to
901 dnl decide whether to link with X11.
903 AC_DEFUN([AC_G_MODULE_SUPPORTED], [
904 AC_CACHE_CHECK([if gmodule functionality is supported], mc_cv_g_module_supported, [
905 ac_save_CFLAGS="$CFLAGS"
907 CFLAGS="$CFLAGS $GMODULE_CFLAGS"
908 LIBS="$GMODULE_LIBS $LIBS"
914 int ret = (g_module_supported () == TRUE) ? 0 : 1;
918 [mc_cv_g_module_supported=yes],
919 [mc_cv_g_module_supported=no],
920 [mc_cv_g_module_supported=no]
922 CFLAGS="$ac_save_CFLAGS"
926 if test "$mc_cv_g_module_supported" = yes; then
927 AC_DEFINE(HAVE_GMODULE, 1,
928 [Define if gmodule functionality is supported])
934 dnl Check if it's possible to use asm labels to rename functions.
935 dnl This macro is necessary because gettext wrongly assumes that gcc
936 dnl can do it regardless of the OS.
938 AC_DEFUN([MC_ASM_LABELS], [
939 AC_CACHE_CHECK([whether functions can be renamed by asm labels],
942 if test -n "$GCC"; then
944 static int function1 (void) __asm__ ("function2");
945 static int function1 (void)
950 ], [mc_cv_asm_labels=yes])
954 if test "$mc_cv_asm_labels" != yes; then
955 AC_DEFINE(_INTL_REDIRECT_MACROS, 1,
956 [Define if functions cannot be renamed by asm labels])