* cmd.c (guess_message_value): Remove the argument. Adjust all
[midnight-commander.git] / configure.in
blob321fb2b9f39609dae777b5e227b302bda7e03902
1 dnl
2 dnl Configure.in file for the Midnight Commander
3 dnl
5 AC_INIT(GNU Midnight Commander, 4.5.99a, mc-devel@gnome.org)
6 AC_PREREQ(2.52)
7 AC_CONFIG_SRCDIR(src/main.c)
8 AC_CONFIG_AUX_DIR(config)
9 AM_INIT_AUTOMAKE(mc, 4.5.99a)
11 AM_CONFIG_HEADER(config.h)
12 AM_MAINTAINER_MODE
14 AC_PROG_LN_S
15 AC_CANONICAL_HOST
17 AC_AIX
18 AC_MINIX
19 AC_ISC_POSIX
21 AC_PROG_CC_STDC
23 AC_HEADER_MAJOR
24 AC_C_CONST
26 AC_SYS_LARGEFILE
28 AC_CHECK_TOOL(AR, ar, ar)
30 dnl Only list browsers here that can be run in background (i.e. with `&')
31 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
33 ALL_LINGUAS="az ca cs da de el es es_ES fi fr hu it ja ko lv nl no pl pt_BR ro ru sk sl sv uk ta tr wa zh_TW zh_CN.GB2312"
35 dnl
36 dnl Internationalization
37 dnl
38 AM_GNU_GETTEXT
39 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
40     CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
43 dnl
44 dnl Hack to make extraconf.h visible even if compiling outside srcdir.
45 dnl
46 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)"
48 dnl
49 dnl Enforce coding standards
50 dnl
51 if test "x$GCC" = xyes; then
52     CFLAGS="$CFLAGS -Wall"
55 dnl
56 dnl We now use glib
57 dnl 
58 AM_PATH_GLIB(1.2.0,,[AC_MSG_ERROR([Test for GLIB failed.  MC requires GLIB.])])
59 LIBS="$LIBS $GLIB_LIBS"
61 dnl
62 dnl OS specific flags.
63 dnl
65 posix_libs=""
66 case $host_os in
67 aux*)
68     # A/UX
69     posix_libs="-lposix"
70     AC_DEFINE(_POSIX_SOURCE)
71     ;;
72 sco*)
73     AC_DEFINE(SCO_FLAVOR, 1, [Define if you want to turn on SCO-specific code])
74     AC_DEFINE(_SVID3, 1, [Needs to be defined on SCO])
75     ;;
76 esac
78 AC_PROG_INSTALL
79 AC_CHECK_HEADERS([unistd.h string.h memory.h crypt.h grp.h limits.h \
80         malloc.h stdlib.h termios.h utime.h fcntl.h pwd.h sys/statfs.h \
81         sys/time.h sys/timeb.h sys/select.h sys/ioctl.h stropts.h])
83 AC_HEADER_TIME
84 AC_HEADER_SYS_WAIT
85 AC_HEADER_DIRENT
86 AC_SHORT_D_NAME_LEN
87 AC_HEADER_STDC
89 dnl Missing structure components
90 AC_STRUCT_ST_BLKSIZE
91 AC_STRUCT_ST_BLOCKS
92 AC_STRUCT_ST_RDEV
94 dnl
95 dnl Check availability of some functions 
96 dnl 
98 AC_CHECK_FUNCS([strerror statfs strcasecmp strncasecmp strftime \
99                 strdup memmove pwdauth truncate initgroups putenv \
100                 memset memcpy tcsetattr tcgetattr cfgetospeed \
101                 sigaction sigemptyset sigprocmask sigaddset \
102                 sysconf setuid setreuid telldir seekdir])
105 dnl getpt is a GNU Extension (glibc 2.1.x)
107 AC_CHECK_FUNCS(getpt)
109 SHADOWLIB=
110 case $host_os in
111 linux*)
112     AC_CHECK_LIB(shadow,pw_encrypt,
113         [shadow_header=yes
114         AC_CHECK_HEADERS(shadow.h,,
115                 [AC_CHECK_HEADERS(shadow/shadow.h,,
116                         [shadow_header=no])])
117         if test $shadow_header = yes; then
118             AC_DEFINE(LINUX_SHADOW, 1,
119                       [Define to use shadow passwords on Linux])
120             SHADOWLIB=-lshadow
121         fi])
122     ;;
123 esac
124 AC_SUBST(SHADOWLIB)
126 NEED_CRYPT_PROTOTYPE=yes
127 if test x$ac_cv_header_crypt_h = xyes; then
128 AC_TRY_WARNINGS([#include <crypt.h>], [char *p = crypt("xxx", "yyy");
129 if (p)
130 return 0;],[
131 NEED_CRYPT_PROTOTYPE=no])
132 else 
133     if test x$ac_cv_header_unistd_h = xyes; then
134 AC_TRY_WARNINGS([#include <unistd.h>], [char *p = crypt("xxx", "yyy");
135 if (p)
136 return 0;],[
137 NEED_CRYPT_PROTOTYPE=no])
138     fi
140 if test x$NEED_CRYPT_PROTOTYPE = xyes; then
141 AC_DEFINE(NEED_CRYPT_PROTOTYPE, 1,
142           [Define if function `crypt' needs a prototype])
146 dnl On SCO and some SVR4, crypt is on libcrypt.a
147 dnl         grantpt in  libpt.a
149 LCRYPT=""
150 AC_CHECK_FUNCS(crypt, , [
151     AC_CHECK_LIB(crypt, crypt, [LCRYPT="-lcrypt"], [
152         AC_CHECK_LIB(crypt_i, crypt, [LCRYPT="-lcrypt_i"])])])
153 AC_SUBST(LCRYPT)
155 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
157 dnl replacing lstat with statlstat on sco makes it more portable between
158 dnl sco clones
159 AC_CHECK_FUNCS(statlstat)
162 dnl If running under AIX, AC_AIX does not tell us that
164 AC_MSG_CHECKING([for AIX defines])
165 AC_EGREP_CPP(yes,
166 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
168 #endif
169 ], [
170 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
171 AC_MSG_RESULT(yes)
172 ], [AC_MSG_RESULT(no)])
175 dnl This is from GNU fileutils, check aclocal.m4 for more information
177 AC_GET_FS_INFO
180 dnl Missing typedefs and replacements
181 dnl 
183 AC_TYPE_MODE_T
184 AC_CHECK_TYPE(umode_t, int)
185 AC_CHECK_TYPE(off_t, long)
186 AC_TYPE_PID_T
187 AC_TYPE_UID_T
188 AC_CHECK_TYPE(nlink_t, unsigned int)
190 AC_FUNC_MMAP
191 AC_FUNC_ALLOCA
192 AC_FUNC_STRCOLL
195 dnl X11 support.
198 dnl These variables are only used when building the MC binary
199 MCCFLAGS=""
200 MCLIBS=""
201 AC_SUBST(MCCFLAGS)
202 AC_SUBST(MCLIBS)
204 textmode_x11_support="no"
205 AC_ARG_WITH(tm-x-support,
206         [--with-tm-x-support        Try getting events from X Window System],
207         [if test x$withval = xyes; then
208                 AC_PATH_XTRA
209                 MCCFLAGS="$X_CFLAGS"
210                 MCLIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
211                 AC_DEFINE(HAVE_TEXTMODE_X11_SUPPORT, 1,
212                           [Define to enable getting events from X Window System])
213                 textmode_x11_support="yes"
214         fi
218 dnl Network related functions
221 AC_CHECK_LIB(nsl, t_accept)
222 AC_CHECK_LIB(socket, socket)
224 have_socket=no
225 AC_CHECK_FUNCS(socket, have_socket=yes)
226 if test $have_socket = no; then
227   # socket is not in the default libraries.  See if it's in some other.
228   for lib in bsd socket inet; do
229     AC_CHECK_LIB($lib, socket, [
230         LIBS="$LIBS -l$lib"
231         have_socket=yes
232         AC_DEFINE(HAVE_SOCKET)
233         break])
234   done
237 have_gethostbyname=no
238 AC_CHECK_FUNC(gethostbyname, [have_gethostbyname=yes])
239 if test $have_gethostbyname = no; then
240   # gethostbyname is not in the default libraries.  See if it's in some other.
241   for lib in bsd socket inet; do
242     AC_CHECK_LIB([$lib], [gethostbyname],
243                  [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
244   done
247 AC_CHECK_FUNCS(socketpair)
250 dnl Sequent wants getprocessstats
252 AC_CHECK_LIB(seq, get_process_stats, [
253         LIBS="$LIBS -lseq"
254         AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
255                   [Define if you have function `get_process_stats' and
256 have to use that instead of gettimeofday])])
258 MC_VFS_CHECKS
261 dnl Install mcserv only if explicitly enabled
263 AC_ARG_ENABLE([mcserv-install],
264               [--enable-mcserv-install    Install mcserv - Midnight Commander file server])
266 NETFILES=
267 if test $have_socket = yes; then
268    NETFILES="\$(NETFILES)"
270 AC_SUBST(NETFILES)
272 vfs_type="normal"
273 if test $use_vfs = yes
274 then
275         AC_MSG_NOTICE([enabling VFS code])
276         vfs_type="Midnight Commander Virtual File System"
279 screen_manager=unknown
280 search_ncurses=false
282 mouse_lib="xterm only"
283 case $host_os in
284 linux*)
285     AC_ARG_WITH(gpm-mouse, 
286         [--with-gpm-mouse[=base-dir]  Compile with gpm mouse support (Linux only)],
287         [if test x$withval != xno
288         then
289                 if test x$withval != xyes
290                 then
291                         LIBS="$LIBS -L$withval/lib"
292                         CPPFLAGS="$CPPFLAGS -I$withval/include"
293                 fi
294                 AC_DEFINE(HAVE_LIBGPM, 1,
295                           [Define to enable gpm mouse support on Linux])
296                 mouse_lib="GPM and xterm"
297                 MCLIBS="-lgpm $MCLIBS"
298         fi],
299         [AC_CHECK_LIB(gpm, Gpm_Repeat,
300                 [AC_DEFINE(HAVE_LIBGPM)
301                 mouse_lib="GPM and xterm"
302                 MCLIBS="-lgpm $MCLIBS"],
303                 [AC_MSG_WARN([libgpm is missing or older than 0.18])],
304                 [$LIBS])
305         ])
306     ;;
307 esac
309 AC_ARG_WITH(ncurses,
310         [--with-ncurses[=base-dir]    Compile with ncurses/locate base dir],
311         [if test x$withval = xyes
312         then
313                 search_ncurses=true
314         else
315                 MCLIBS="$MCLIBS -L$withval/lib -lncurses"
316                 CPPFLAGS="$CPPFLAGS -I$withval/include"
317                 search_ncurses=false
318                 screen_manager="ncurses"
319                 AC_DEFINE(USE_NCURSES)
320         fi
323 AC_ARG_WITH(hsc,
324         [--with-hsc               Compile with support for the HSC firewall],
325         [if test x$withval = xyes; then
326                 AC_DEFINE(HSC_PROXY, 1,
327                           [Define if you want to use the HSC firewall])
328         fi
332 dnl Check for the -mandoc package
334 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
335 if $HAVE_nroff; then
336     AC_MSG_CHECKING([for manual formatting macros])
337     AC_CACHE_VAL(ac_cv_mandoc, [
338     nroff -mandoc < /dev/null > /dev/null 2>&1 /dev/null
339     if test $? = 0
340     then
341         ac_cv_mandoc=-mandoc
342     else
343         ac_cv_mandoc=-man
344     fi
345     ])
346     MANDOC=$ac_cv_mandoc
347     AC_MSG_RESULT([$MANDOC])
348 else
349     MANDOC=-man
351 AC_SUBST(MANDOC)
354 dnl Check if nroff accepts -Tlatin1 or -Tascii
356 if $HAVE_nroff; then
357     AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
358     AC_CACHE_VAL(ac_cv_nroff_tascii, [
359     nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
360     if test $? = 0
361     then
362         ac_cv_nroff_tascii=" -Tlatin1"
363     else
364         nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
365         if test $? = 0
366         then
367             ac_cv_nroff_tascii=" -Tascii"
368         else
369             ac_cv_nroff_tascii=""
370         fi
371     fi
372     ])
373     if test "x$ac_cv_nroff_tascii" = x; then
374         AC_MSG_RESULT([no])
375     else
376         AC_MSG_RESULT([yes,$ac_cv_nroff_tascii])
377     fi
379 TROFFASCII="$ac_cv_nroff_tascii"
380 AC_SUBST(TROFFASCII)
383 dnl Check for - option to file
385 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
386 if $HAVE_FILECMD; then
387     AC_MSG_CHECKING([for - option to file command])
388     AC_CACHE_VAL(ac_cv_filestdin, [[
389     cat > conftest.c <<\EOF
390 /* A comment */
391 #if 0
392 #endif
393 void main(void)
394 { return; }
396     cat > conftest.sed <<\EOF
397 s/^[^:]*:[      ]*//
398 s/[     ]*$//
400     filehyphen_1=`file conftest.c 2>/dev/null | sed -f conftest.sed`
401     filehyphen_2=`cat conftest.c | file - 2>/dev/null | sed -f conftest.sed`
402     if test "x$filehyphen_1" = "x$filehyphen_2"; then
403         ac_cv_filestdin=yes
404     else
405         ac_cv_filestdin=no
406     fi
407     rm conftest.c conftest.sed
408     ]])
410     if test x$ac_cv_filestdin = xyes; then
411         AC_DEFINE(FILE_STDIN, 1,
412                   [Define if the file command accepts - for stdin])
413     fi
414     filestdin=$ac_cv_filestdin
415     AC_MSG_RESULT([$filestdin])
417     dnl
418     dnl Check for -L option to file
419     dnl
421 AC_MSG_CHECKING([for -L option to file command])
422 AC_CACHE_VAL(ac_cv_filel, [
423 file -L . > /dev/null 2>&1
424 if test $? = 0
425 then
426     ac_cv_filel=yes
427 else
428     ac_cv_filel=no
431 if test x$ac_cv_filel = xyes; then
432     AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
434 filel=$ac_cv_filel
435 AC_MSG_RESULT([$filel])
436 fi 
439 dnl Check to see if grep program allowes dash to denote stdin 
441 AC_MSG_CHECKING([for - option to grep command])
442 AC_CACHE_VAL(ac_cv_grep_stdin, [
443     echo "grep_test" | grep grep_test - >/dev/null 2>&1
444     if test $? = 0; then
445         ac_cv_grep_stdin=yes
446     else
447         ac_cv_grep_stdin=no
448     fi
450 if test x$ac_cv_grep_stdin = xyes; then
451     AC_DEFINE(GREP_STDIN, 1, [Define if the grep command accepts - for stdin])
453 AC_MSG_RESULT([$ac_cv_grep_stdin])
456 dnl The subshell support
459 AC_MSG_CHECKING([for subshell support])
460 AC_ARG_WITH(subshell,
461         [--with-subshell            If you want to use a concurrent shell],
462         [result=no
463         if test x$withval = xoptional
464         then
465                 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
466                           [Define to make subshell support optional])
467                 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
468                           [Define to enable subshell support])
469                 result="optional"
470         fi
471         if test x$withval = xyes
472         then 
473                 AC_DEFINE(HAVE_SUBSHELL_SUPPORT)
474                 result="yes"
475         fi],
476         [dnl Default: provide the subshell support on non-ultrix machines
477         case $host_os in
478         ultrix*)
479                 result=no
480                 ;;
481         *)
482                 AC_DEFINE(HAVE_SUBSHELL_SUPPORT)
483                 result=yes
484                 ;;
485         esac
487 AC_MSG_RESULT([$result])
488 subshell="$result"
491 dnl Memory Allocation Debugger
493 mem_debug="none"
494 AC_ARG_WITH(mad,
495 [--with-mad                 Developers only: activates MAD (memory debugger)],
496         [if test x$withval = xyes; then
497         mem_debug="Janne's MAD library"
498         AC_DEFINE(HAVE_MAD, 1,
499                   [Define to use Memory Allocation Debugger (MAD)])
500         AC_MSG_NOTICE([compiling with memory leak detector])
501 fi])
504 dnl Electric Fence - another memory debugger
506 AC_ARG_WITH(efence, 
507 [--with-efence              Developers only: activates Electric Fence],
508         [if test x$withval = xyes; then
509         LIBS="$LIBS -lefence"
510         AC_MSG_NOTICE([compiling with Electric fence])
511         mem_debug="Electric Fence"
512 fi])
515 dnl To force mmap support
516 dnl We use only part of the functionality of mmap, so on AIX,
517 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
519 AC_ARG_WITH(mmap, 
520         [--with-mmap                To force using the mmap call (AIX)],
521         [if test x$withval = xyes; then
522         AC_DEFINE(HAVE_MMAP)
523         AC_MSG_NOTICE([forcing MMAP support])
524 fi])
526 slang_check_lib=true
527 slang_term=""
528 slang_use_system_installed_lib=false
529 AC_CHECK_LIB(slang,SLang_init_tty,
530         [AC_CHECK_HEADERS(slang.h)
531         if test x$ac_cv_header_slang_h = xyes
532         then
533              slang_use_system_installed_lib=true
534              slang_check_lib=false
535         else
536              AC_CHECK_HEADERS(slang/slang.h)
537              if test x$ac_cv_header_slang_slang_h = xyes
538              then
539                  slang_use_system_installed_lib=true
540                  slang_check_lib=false
541              fi
542         fi
545 AC_ARG_WITH(terminfo,
546         [--with-terminfo            SLANG: Force usage of terminfo],[
547         if test x$withval = xyes; then
548                 AC_USE_TERMINFO
549                 slang_check_lib=false
550                 slang_use_system_installed_lib=false
551         fi]
554 AC_ARG_WITH(termcap,
555         [--with-termcap             SLANG: Force usage of termcap],[
556         if test x$withval = xyes; then
557                 AC_USE_TERMCAP
558                 slang_check_lib=false
559                 slang_use_system_installed_lib=false
560         fi]
563 AC_ARG_WITH(included-slang,
564         [--with-included-slang      SLANG: use the SLang library included here],[
565         if test x$withval = xyes; then
566             slang_use_system_installed_lib=false
567             slang_check_lib=true
568         fi]
571 AC_ARG_WITH(slang,
572         [--with-slang              Compile with the slang screen manager],[
573         if test x$withval = xyes; then
574                 AC_WITH_SLANG
575         fi
578 LIBEDIT_A=""
579 MCEDIT=""
580 LEDIT=""
581 EDIT_msg=""
582 AC_ARG_WITH(edit,
583         [--with-edit                Enable internal editpr],
584         [if test x$withval = xyes
585         then
586                 AC_WITH_EDIT
587         else
588                 EDIT_msg="no"
589         fi], 
590         [dnl Default: provide the internal editor
591         AC_WITH_EDIT
593 AC_SUBST(LIBEDIT_A)
594 AC_SUBST(MCEDIT)
595 AC_SUBST(LEDIT)
597 AC_ARG_WITH(netrc,
598         [--with-netrc               Compile with ftp .netrc support],[
599         if test x$withval = xyes; then
600                 AC_DEFINE(USE_NETRC, 1,
601                           [Define to use .netrc for FTP connections])
602                 AC_MSG_NOTICE([ftpfs will use .netrc])
603         fi
606 undelfs_o=""
608 if test $use_vfs = yes; then
609     AC_ARG_WITH(ext2undel,
610         [--with-ext2undel           Compile with ext2 undelete code],[
611         if test x$withval != xno;
612         then
613                 if test x$withval != xyes
614                 then
615                         LIBS="$LIBS -L$withval/lib"
616                         CPPFLAGS="$CPPFLAGS -I$withval/include"
617                 fi
618                 AC_EXT2_UNDEL
619         fi],[
620         dnl Default: detect
621         AC_CHECK_LIB(ext2fs, ext2fs_close, [AC_EXT2_UNDEL], , [-lcom_err])
622     ])
625 AC_SUBST(undelfs_o)
626         
627 if $search_ncurses
628 then
629     AC_MSG_NOTICE([checking location of ncurses.h file])
631     AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
632     AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
633     AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
634     AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
636     AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
638     AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
642 dnl Ncurses specific checks
644 dnl If ncurses exports the ESCDELAY variable it should be set to 0
645 dnl or you'll have to press Esc three times to dismiss a dialog box.
647 if test -n "$ncurses_version"; then
648   save_LIBS="$LIBS"
649   LIBS="$MCLIBS $LIBS"
650   AC_CACHE_CHECK([for ESCDELAY variable],
651                  [mc_cv_ncurses_escdelay],
652                  [AC_TRY_COMPILE([], [
653                         extern int ESCDELAY;
654                         int main ()
655                         {
656                           ESCDELAY = 0;
657                         }
658                         ],
659                         [mc_cv_ncurses_escdelay=yes],
660                         [mc_cv_ncurses_escdelay=no]
661                   )
662   ])
663   if test "$mc_cv_ncurses_escdelay" = yes; then
664     AC_DEFINE(HAVE_ESCDELAY, 1,
665               [Define if ncurses has ESCDELAY variable])
666   fi
668   AC_CHECK_FUNCS(resizeterm)
669   LIBS="$save_LIBS"
672 if test "x$screen_manager" = "xunknown"; then
673     AC_WITH_SLANG
677 dnl The variables used for expanding the auto saver.
679 cons_saver=""
680 install_saver="no"
681 PAMLIBS=""
682 case $host_os in
683 linux*)
684     cons_saver="cons.saver"
685     install_saver="yes"
687     dnl
688     dnl On Linux, check for PAM authentication available
689     dnl
690     AC_CHECK_LIB(pam, pam_start, [
691         AC_DEFINE(HAVE_PAM, 1,
692                   [Define if PAM (Pluggable Authentication Modules) is available])
693         PAMLIBS="-lpam -ldl"
694     ],[],[-ldl])
695     ;;
696 esac
697 AC_SUBST(cons_saver)
698 AC_SUBST(PAMLIBS)
701 dnl User visible support for charset conversion.
703 AC_ARG_ENABLE([charset],
704               [--enable-charset           Support for charset selection and conversion])
705 have_charset=
706 if test "x$enable_charset" = xyes; then
707   if test -z "$am_cv_func_iconv"; then
708     AC_MSG_WARN([Cannot enable charset support because iconv function is missing])
709   else
710     AC_DEFINE(HAVE_CHARSET, 1,
711               [Define to enable charset selection and conversion])
712     have_charset=yes
713   fi
718 dnl This code should be moved to the ac_WITH_SLANG
720 dnl We check for the existance of setupterm on curses library
721 dnl this is required to load certain definitions on some termcaps
722 dnl editions (AIX and OSF/1 I seem to remember).
723 dnl Note that we avoid using setupterm 
724 case $screen_manager in
725 SLang*)
726         case $host_os in
727         linux*)
728                 ;;
729         *)
730                 AC_CHECK_LIB(curses,setupterm,
731                         [AC_TRY_COMPILE([
732 #include <curses.h>
733 #include <term.h>],[
734    if (key_end == parm_insert_line)
735         return 1;
736    return 0;
738                         [MCLIBS="$MCLIBS -lcurses"
739                         AC_DEFINE(USE_SETUPTERM, 1,
740                                   [Define to use function `setupterm'
741 from `curses' library in S-Lang])])
742                 ])
743         esac
744         ;;
745 esac
747 LIBS="$LIBS $posix_libs"
749 AC_SUBST(CFLAGS)
750 AC_SUBST(CPPFLAGS)
751 AC_SUBST(LDFLAGS)
752 AC_SUBST(LIBS)
754 if test "x$SAMBAFILES" != x; then
755   AC_CONFIG_SUBDIRS([vfs/samba])
758 AM_CONDITIONAL(USE_EDIT, [test -n "$LIBEDIT_A"])
759 AM_CONDITIONAL(USE_VFS, [test "x$use_vfs" = xyes])
760 AM_CONDITIONAL(USE_VFS_NET, [test -n "$NETFILES"])
761 AM_CONDITIONAL(USE_UNDEL_FS, [test -n "$undelfs_o"])
762 AM_CONDITIONAL(USE_SAMBA_FS, [test -n "$SAMBAFILES"])
763 AM_CONDITIONAL(MCSERV_INSTALL,
764                [test "x$enable_mcserv_install$mcserv" = xyesmcserv])
765 AM_CONDITIONAL(INCLUDED_SLANG,
766                [test "x$slang_use_system_installed_lib" = xfalse])
767 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
768 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
770 AH_BOTTOM([#include <extraconf.h>])
772 AC_CONFIG_FILES([
773 Makefile 
774 mc.spec
775 doc/Makefile 
776 vfs/Makefile:vfs/Make-mc.in
777 vfs/extfs/Makefile
778 lib/Makefile
779 src/Makefile
780 slang/Makefile 
781 edit/Makefile 
782 syntax/Makefile
783 pc/Makefile
785 lib/mc.ext
786 lib/mc.sh
787 lib/mc.csh
789 mcfn_install
791 vfs/extfs/deb
792 vfs/extfs/ftplist
793 vfs/extfs/lslR
794 vfs/extfs/uar
795 vfs/extfs/ucpio
796 vfs/extfs/ulha 
797 vfs/extfs/uha
798 vfs/extfs/urar
799 vfs/extfs/uzoo
801 doc/mc.1 doc/mcedit.1 doc/mcserv.8
803 intl/Makefile po/Makefile.in
806 AC_CONFIG_COMMANDS(potfiles,
807     [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
809 AC_OUTPUT
811 case $screen_manager in
812 SLang*)
813     screen_manager="${screen_manager}${slang_term}" ;;
814 esac
816 echo "
817 Configuration:
819   Source code location:       ${srcdir}
820   Compiler:                   ${CC}
821   Compiler flags:             ${CFLAGS}
822   File system:                ${vfs_type}
823                               ${vfs_flags}
824   Screen manager:             ${screen_manager}
825   Install console saver:      ${install_saver}
826   Mouse support:              ${mouse_lib}
827   X11 events support:         ${textmode_x11_support}
828   Debugger code:              ${mem_debug}
829   With subshell support:      ${subshell}
830   Internal editor:            ${EDIT_msg}
831   Install path:               ${prefix}/bin, ${prefix}/lib/mc