2 dnl Configure.in file for the Midnight Commander
5 AC_CONFIG_HEADER(config.h)
9 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
10 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
14 dnl This is path where we're looking for headers in addition to /usr/include
15 dnl and whatever cpp defaults to.
16 include_additional_path="/usr/local/include /usr/contrib/include /opt/gnu/include"
18 dnl This sets/resets compiling with -g by default. It should be set to yes for
19 dnl development versions and set to no for release versions.
22 dnl We want autoconf to check whether -g is available
23 dnl We reset it back soon.
33 if test x"$AWK" = x; then
40 # test whether awk needs -v for variables (e.g. Solaris) or not (e.g. SunOs 4)
41 if test x"`echo | $AWK 'BEGIN { print variable; exit }' variable=123`" = x123; then
47 AC_SUBST(AWK_VAR_OPTION)
57 AC_PATH_PROG(MV, mv, mv)
58 AC_PATH_PROG(CP, cp, cp)
59 AC_PATH_PROG(RM, rm, rm)
60 AC_PATH_PROG(CHMOD, chmod, :)
61 AC_PATH_PROG(AR, ar, ar)
63 AC_CHECK_PROG(system,uname,`uname`,unknown)
64 AC_CHECK_PROGS(X11_WWW,netscape arena Mosaic chimera)
65 if test x"$X11_WWW" = x; then
69 ALL_LINGUAS="cs da de es fr it ko no pl ru"
71 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
74 dnl This part supplies reasonable defaults for CFLAGS, if they weren't
75 dnl specified by ''CFLAGS=flags ./configure''
78 if test x$GCC = xyes; then
79 if test x$ac_cv_prog_gcc_g = xyes; then
86 dnl Debug mode is turned ON for now
87 if test "x$CCOPTS" = x; then
91 if test "x$CCOPTS" = x; then
92 if test x$GCC = xyes; then
93 if test x$system = xLinux; then
94 CCOPTS='-O2 -fno-strength-reduce'
95 if test x$use_cc_g_flag = xyes; then
96 if test $cc_uses_g = yes; then
102 if test x$use_cc_g_flag = xyes; then
103 if test $cc_uses_g = yes; then
109 if test x$use_cc_g_flag = xyes; then
122 AM_PATH_GLIB(,,AC_MSG_ERROR(Test for GLIB failed. MC requires GLIB.))
123 LIBS="$LIBS $GLIB_LIBS"
124 CFLAGS="$CFLAGS $GLIB_CFLAGS"
127 dnl For A/UX. Do not move
131 if test $system = A/UX
134 AC_DEFINE(_POSIX_SOURCE)
138 AC_CHECK_HEADERS(unistd.h string.h memory.h crypt.h grp.h limits.h malloc.h)
139 AC_CHECK_HEADERS(stdlib.h termios.h)
141 if test x$ac_cv_header_malloc_h = xno; then
142 echo '/* NeXTStep malloc.h stub */' > $srcdir/malloc.h
151 #Let me check for an incompatible regcomp in HP-UX before making this
157 dnl Missing structure components
163 dnl Check availability of some functions
166 AC_CHECK_FUNCS(strerror statfs getwd strcasecmp strncasecmp)
167 AC_CHECK_FUNCS(strdup memmove pwdauth truncate initgroups putenv)
168 AC_CHECK_FUNCS(memset memcpy tcsetattr tcgetattr cfgetospeed)
169 AC_CHECK_FUNCS(sigaction sigemptyset sigprocmask sigaddset)
170 AC_CHECK_FUNCS(sysconf setuid setreuid)
173 if test x$system = xLinux; then
174 AC_CHECK_LIB(shadow,pw_encrypt,[
176 AC_CHECK_HEADERS(shadow.h)
177 if test x$ac_cv_header_shadow_h = xyes; then
180 AC_CHECK_HEADERS(shadow/shadow.h)
181 if test x$ac_cv_shadow_shadow_h = xyes; then
185 if test $shadow_header = yes; then
186 AC_DEFINE(LINUX_SHADOW)
193 NEED_CRYPT_PROTOTYPE=yes
194 if test x$ac_cv_header_crypt_h = xyes; then
195 AC_TRY_WARNINGS([#include <crypt.h>], [char *p = crypt("xxx", "yyy");],[
196 NEED_CRYPT_PROTOTYPE=no])
198 if test x$ac_cv_header_unistd_h = xyes; then
199 AC_TRY_WARNINGS([#include <unistd.h>], [char *p = crypt("xxx", "yyy");],[
200 NEED_CRYPT_PROTOTYPE=no])
203 if test x$NEED_CRYPT_PROTOTYPE=xyes; then
204 AC_DEFINE(NEED_CRYPT_PROTOTYPE)
208 dnl AIX and Sequent need <sys/select.h> for fd_set
210 AC_CHECK_HEADERS(sys/select.h)
213 dnl On SCO and some SVR4, crypt is on libcrypt.a
214 dnl grantpt in libpt.a
217 AC_CHECK_FUNCS(crypt, , [
218 AC_CHECK_LIB(crypt, crypt, LCRYPT="-lcrypt",[
219 AC_CHECK_LIB(crypt_i, crypt, LCRYPT="-lcrypt_i")])])
222 dnl This is the correct version
223 dnl AC_CHECK_FUNCS(grantpt, , AC_CHECK_LIB(pt, grantpt))
225 dnl And workaround for a Autoconf 2.4 bug:
226 AC_CHECK_FUNCS(grantpt)
227 if test x$ac_cv_func_grantpt = xyes; then
230 AC_CHECK_LIB(pt, grantpt)
234 dnl libintl.a required on SCO to provide proper NLS support
235 dnl (using native cc links it by default)
237 if test x$GCC = xyes; then
238 AC_CHECK_LIB(intl, tolower)
241 dnl replacing lstat with statlstat on sco makes it more portable between
243 AC_CHECK_FUNCS(statlstat)
246 dnl If running under AIX, AC_AIX does not tell us that
248 AC_MSG_CHECKING(for AIX defines)
250 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
256 ], AC_MSG_RESULT(no))
259 dnl This hack is here until autoconf adds it
260 dnl Needed for Unixware: getmntent is on libgen.a
262 AC_CHECK_LIB(gen, getmntent, [LIBS="-lgen $LIBS"])
265 dnl This is from GNU fileutils, check aclocal.m4 for more information
270 dnl Missing typedefs and replacements
274 AC_CHECK_TYPE(umode_t, int)
275 AC_CHECK_TYPE(off_t, long)
278 AC_CHECK_TYPE(nlink_t, unsigned int)
284 dnl Cool hack, but we don't use it currently
286 dnl AC_MSG_CHECKING(for token pasting method)
287 dnl AC_EGREP_CPP(portable,[
288 dnl #define tken(a, b) a##b
290 dnl ], [AC_DEFINE(HAVE_PORTABLE_TOKEN_PASTING)
291 dnl AC_MSG_RESULT(portable)
293 dnl AC_MSG_RESULT(non-portable)
299 dnl Network related functions
302 AC_CHECK_LIB(nsl, t_accept)
303 AC_CHECK_LIB(socket, socket)
306 AC_CHECK_FUNCS(socket, have_socket=yes)
307 if test $have_socket = no; then
308 # socket is not in the default libraries. See if it's in some other.
309 for lib in bsd socket inet; do
310 AC_CHECK_LIB($lib, socket, [
313 AC_DEFINE(HAVE_SOCKET)
318 have_gethostbyname=no
319 AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
320 if test $have_gethostbyname = no; then
321 # gethostbyname is not in the default libraries. See if it's in some other.
322 for lib in bsd socket inet; do
323 AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
327 AC_CHECK_FUNCS(socketpair)
330 dnl Sequent wants getprocessstats
332 AC_CHECK_LIB(seq, get_process_stats, [
334 AC_DEFINE(HAVE_GET_PROCESS_STATS)])
338 if test $have_socket = yes; then
339 NETFILES="\$(NETFILES)"
343 screen_manager=unknown
347 LDFLAGS=${LDFLAGS--O}
349 AC_DEFUN(AC_USE_SUNOS_CURSES, [
351 screen_manager="SunOS 4.x /usr/5include curses"
352 AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
353 AC_DEFINE(USE_SUNOS_CURSES)
354 AC_DEFINE(NO_COLOR_CURSES)
355 AC_DEFINE(USE_SYSV_CURSES)
356 CPPFLAGS="$CPPFLAGS -I/usr/5include"
357 XCURSES="xcurses.o /usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
358 AC_MSG_RESULT(Please note that some screen refreshs may fail)
359 AC_WARN(Reconsider using Slang)
362 AC_DEFUN(AC_USE_OSF1_CURSES, [
363 AC_MSG_RESULT(Using OSF1 curses)
365 screen_manager="OSF1 curses"
366 AC_DEFINE(NO_COLOR_CURSES)
367 AC_DEFINE(USE_SYSV_CURSES)
369 LIBS="$LIBS -lcurses"
372 AC_DEFUN(AC_USE_SYSV_CURSES, [
373 AC_MSG_RESULT(Using SysV curses)
374 AC_DEFINE(USE_SYSV_CURSES)
377 screen_manager="SysV/curses"
378 LIBS="$LIBS -lcurses"
384 dnl AC_ARG_WITH(bsd-curses,
385 dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
386 dnl search_ncurses=false
387 dnl screen_manager="Ultrix/cursesX"
388 dnl if test $system = ULTRIX
390 dnl THIS_CURSES=cursesX
392 dnl THIS_CURSES=curses
395 dnl LIBS="$LIBS -l$THIS_CURSES -ltermcap"
396 dnl AC_DEFINE(USE_BSD_CURSES)
397 dnl XCURSES="xcurses.o"
398 dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
399 dnl AC_WARN(Use of the bsdcurses extension has some)
400 dnl AC_WARN(display/input problems.)
401 dnl AC_WARN(Reconsider using xcurses)
405 [--with-sco Use this to turn on SCO-specific code],[
406 if test x$withval = xyes; then
407 AC_DEFINE(SCO_FLAVOR)
408 CFLAGS="$CFLAGS -D_SVID3"
412 AC_ARG_WITH(sunos-curses,
413 [--with-sunos-curses Used to force SunOS 4.x curses],[
414 if test x$withval = xyes; then
419 AC_ARG_WITH(osf1-curses,
420 [--with-osf1-curses Used to force OSF/1 curses],[
421 if test x$withval = xyes; then
427 [--with-vcurses[=incdir] Used to force SysV curses],
428 if test x$withval = xyes; then
431 CPPFLAGS="$CPPFLAGS -I$withval"
436 mouse_lib="xterm only"
438 AC_ARG_WITH(gpm-mouse,
439 [--with-gpm-mouse[=base-dir] Compile with gpm mouse support],[
440 if test x$withval != xno
442 if test x$withval != xyes
444 LIBS="$LIBS -L$withval/lib"
445 CPPFLAGS="$CPPFLAGS -I$withval/include"
447 AC_DEFINE(HAVE_LIBGPM)
448 mouse_lib="GPM and xterm"
452 AC_CHECK_LIB(gpm, Gpm_Repeat,[
453 AC_DEFINE(HAVE_LIBGPM)
454 mouse_lib="GPM and xterm"
456 if test $system = Linux
458 AC_MSG_WARN("libgpm.a is missing or older than 0.18")
466 [--with-ncurses[=base-dir] Compile with ncurses/locate base dir],
467 if test x$withval = xyes
471 LIBS="$LIBS -L$withval/lib -lncurses"
472 CPPFLAGS="$CPPFLAGS -I$withval/include"
474 screen_manager="ncurses"
475 AC_DEFINE(USE_NCURSES)
480 [--with-hsc Compile with support for the HSC firewall],
481 if test x$withval = xyes; then
497 libgtkedit="libgtkedit.a"
498 insticons=install_icons
499 if test x"$xvers" = xnone; then
504 gnomeicondir=`gnome-config --prefix`/share/pixmaps
506 AC_SUBST(gnomeicondir)
510 AC_SUBST(GNOMEGNORBA_LIBS)
513 dnl Check for the -mandoc package
515 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
517 AC_MSG_CHECKING(for manual formatting macros)
518 AC_CACHE_VAL(ac_cv_mandoc, [
519 nroff -mandoc < /dev/null > /dev/null 2>&1 /dev/null
528 AC_MSG_RESULT($MANDOC)
535 dnl Check if nroff accepts -Tascii
538 AC_MSG_CHECKING(If nroff accepts -Tascii)
539 AC_CACHE_VAL(ac_cv_nroff_tascii, [
540 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
543 ac_cv_nroff_tascii=" -Tascii"
546 ac_cv_nroff_tascii=""
551 TROFFASCII="$ac_cv_nroff_tascii"
555 dnl Check for - option to file
557 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
558 if $HAVE_FILECMD; then
559 AC_MSG_CHECKING(for - option to file command)
560 AC_CACHE_VAL(ac_cv_filestdin, [
561 cat > conftest.c <<EOF
569 cat > conftest.sed <<EOF
573 filehyphen_1=`file conftest.c 2>/dev/null | sed -f conftest.sed`
574 filehyphen_2=`cat conftest.c | file - 2>/dev/null | sed -f conftest.sed`
575 if test "$filehyphen_1" = "$filehyphen_2"; then
581 rm conftest.c conftest.sed
586 if test x$ac_cv_filestdin = xyes; then
587 AC_DEFINE(FILE_STDIN)
589 filestdin=$ac_cv_filestdin
590 AC_MSG_RESULT($filestdin)
593 dnl Check for -L option to file
596 AC_MSG_CHECKING(for -L option to file command)
597 AC_CACHE_VAL(ac_cv_filel, [
598 file -L . > /dev/null 2>&1
606 if test x$ac_cv_filel = xyes; then
610 AC_MSG_RESULT($filel)
614 dnl Check to see if grep program allowes dash to denote stdin
616 AC_MSG_CHECKING(for - option to grep command)
617 AC_CACHE_VAL(ac_cv_grep_stdin, [
618 grep ac_cv_grep_stdin - > /dev/null 2>&1 < ./configure
625 if test x$ac_cv_grep_stdin = xyes; then
626 AC_DEFINE(GREP_STDIN)
628 AC_MSG_RESULT($ac_cv_grep_stdin)
631 dnl The termnet support
635 [--with-termnet If you want a termified net support],[
636 if test x$withval = xyes; then
637 AC_DEFINE(USE_TERMNET)
643 dnl The subshell support
646 AC_MSG_CHECKING(for subshell support)
647 AC_ARG_WITH(subshell,
648 [--with-subshell If you want to use a concurrent shell],
650 if test x$withval = xoptional
652 AC_DEFINE(SUBSHELL_OPTIONAL)
653 AC_DEFINE(HAVE_SUBSHELL_SUPPORT)
656 if test x$withval = xyes
658 AC_DEFINE(HAVE_SUBSHELL_SUPPORT)
661 dnl Default: provide the subshell support on non-ultrix machines
662 if test $system = ULTRIX
666 AC_DEFINE(HAVE_SUBSHELL_SUPPORT)
670 AC_MSG_RESULT($result)
683 dnl This option is only inteded for being used by me :-)
684 dnl It has some nasty hacks built in.
688 [--with-debug For use by developers only: activates -Wall and MAD],
689 [if test x$withval = xyes; then
690 CFLAGS="$CFLAGS -Wall"
691 mem_debug="Janne's MAD library"
694 if [ echo `uname -s -r` | grep -q 'SunOS 4.1' ]
696 CFLAGS="$CFLAGS -Wno-implicit"
698 if echo "$CFLAGS" | grep -e -g >/dev/null 2>&1; then
701 if test $cc_uses_g = yes; then
705 AC_MSG_RESULT(compiling with -Wall and the memory leak detector)
709 dnl This option is only inteded for being used by me :-)
710 dnl It has some nasty hacks built in.
713 [--with-efence Developers only: activates -Wall and efence],
714 [if test x$withval = xyes; then
715 CFLAGS="$CFLAGS -Wall"
717 LIBS="$LIBS -lefence"
718 if [ echo `uname -s -r` | grep -q 'SunOS 4.1' ]
720 CFLAGS="$CFLAGS -Wno-implicit"
722 if echo "$CFLAGS" | grep -e -g >/dev/null 2>&1; then
725 if test $cc_uses_g = yes; then
729 AC_MSG_RESULT(compiling with -Wall and Electric fence)
730 mem_debug="Electric Fence"
735 if test x$USE_NLS = xyes; then
736 if test x$USE_INCLUDED_LIBINTL = xyes; then
737 CPPFLAGS="$CPPFLAGS -I\$(builddir)/intl"
738 LINTL="-L\$(builddir)/intl -lintl"
746 dnl To force mmap support
747 dnl We use only part of the functionality of mmap, so on AIX,
748 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
751 [--with-mmap To force using the mmap call (AIX)],
752 [if test x$withval = xyes; then
754 AC_MSG_RESULT(forcing MMAP support)
757 AC_DEFUN(AC_USE_TERMINFO,
758 AC_DEFINE(SLANG_TERMINFO)
759 AC_MSG_RESULT(Using SLang screen manager/terminfo)
760 slang_term=" with terminfo"
763 AC_DEFUN(AC_USE_TERMCAP,
764 AC_MSG_RESULT(Using SLang screen manager/termcap)
765 AC_DEFINE(USE_TERMCAP)
766 dnl Check with $LIBS at the end so that it works with ELF libs.
767 AC_CHECK_LIB(termcap, tgoto, LIBS="$LIBS -ltermcap", , $LIBS)
768 slang_term=" with termcap"
773 slang_use_system_installed_lib=false
774 AC_CHECK_LIB(slang,SLang_init_tty,
775 AC_CHECK_HEADERS(slang.h)
776 if test x$ac_cv_header_slang_h = xyes
778 slang_use_system_installed_lib=true
779 slang_check_lib=false
781 AC_CHECK_HEADERS(slang/slang.h)
782 if test x$ac_cv_header_slang_slang_h = xyes
784 slang_use_system_installed_lib=true
785 slang_check_lib=false
786 AC_DEFINE(SLANG_H_INSIDE_SLANG_DIR)
791 AC_ARG_WITH(terminfo,
792 [--with-terminfo SLANG: Force usage of terminfo],[
794 slang_check_lib=false
795 slang_use_system_installed_lib=false
800 [--with-termcap SLANG: Force usage of termcap],[
802 slang_check_lib=false
803 slang_use_system_installed_lib=false
807 AC_ARG_WITH(included-slang,
808 [--with-included-slang SLANG: use the SLang library included here],[
809 slang_use_system_installed_lib=false
814 AC_DEFUN(AC_WITH_SLANG,
815 AC_DEFINE(HAVE_SLANG)
817 if $slang_use_system_installed_lib
819 AC_DEFINE(HAVE_SYSTEM_SLANG)
821 screen_manager="SLang (system-installed library)"
822 AC_MSG_RESULT(Using system installed SLang library)
828 #ifdef SLANG_H_INSIDE_SLANG_DIR
829 #include <slang/slang.h>
838 [LIBS="$ac_save_LIBS"; AC_USE_TERMINFO],
839 [LIBS="$ac_save_LIBS"; AC_USE_TERMCAP])
841 MCCPPFLAGS="$MCCPPFLAGS -I\$(slangdir)"
842 LIBSLANG="libmcslang.a"
843 screen_manager="SLang"
845 CPPFLAGS="$CPPFLAGS -I../slang"
846 fastdepslang=fastdepslang
848 ln -s ../$srcdir/slang/slang-mc.h slang/slang.h
853 for dir in /usr/lib /usr/share/lib /usr/local/lib /lib \
854 /usr/local/share /usr/share
856 if test -d $dir/terminfo; then
861 if $use_terminfo; then
873 [--with-slang Compile with the slang screen manager],[
874 if test x$withval = xyes; then
881 AC_SUBST(fastdepslang)
884 AC_DEFUN(AC_WITH_VFS, [
886 if $use_net_code; then
887 AC_DEFINE(USE_NETCODE)
891 fastdepvfs=fastdepvfs
892 MCCPPFLAGS="$MCCPPFLAGS -I\$(vfsdir)"
893 AC_MSG_RESULT(Using the VFS switch code)
894 vfs_type="Midnight Commander Virtual File System"
903 [--with-vfs Compile with the VFS code],
904 if test x$withval = xyes
912 dnl Default: provide the VFS code
919 AC_DEFUN(AC_WITH_EDIT, [
920 AC_DEFINE(USE_INTERNAL_EDIT)
921 LIBEDIT_A="libedit.a"
924 CPPFLAGS="$CPPFLAGS -I\$(rootdir)"
926 AC_MSG_RESULT(will call internal editor)
934 [--with-edit Define INTERNAL_EDIT],
935 if test x$withval = xyes
941 dnl Default: provide the internal editor
949 [--with-netrc Compile with ftp .netrc support],[
951 AC_MSG_RESULT(ftpfs will have .netrc parsing code)
955 AC_DEFUN(AC_EXT2_UNDEL, [
957 if test "$ext2fs_undel" = yes; then
958 AC_MSG_RESULT(With ext2fs file recovery code)
959 vfs_flags="${vfs_flags} undelfs"
960 undelfs_o="undelfs.o"
961 LIBS="$LIBS $EXT2FS_UNDEL_LIBS"
963 AC_MSG_WARN(No ext2fs file recovery code)
967 AC_ARG_WITH(ext2undel,
968 [--with-ext2undel Compile with ext2 undelete code],[
969 if test x$withval != xno;
971 if test x$withval != xyes
973 LIBS="$LIBS -L$withval/lib"
974 CPPFLAGS="$CPPFLAGS -I$withval/include"
979 AC_CHECK_LIB(ext2fs, ext2fs_close, AC_EXT2_UNDEL,,-lcom_err)
985 dnl Parameters: directory filename LIBS_append CPPFLAGS_append nicename
987 AC_DEFUN(AC_NCURSES, [
992 AC_MSG_RESULT(Found ncurses on $1/$2)
994 CPPFLAGS="$CPPFLAGS $4"
997 AC_DEFINE(USE_NCURSES)
1004 AC_CHECKING("location of ncurses.h file")
1006 AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
1007 AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
1008 AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
1009 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")
1011 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")
1013 AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
1016 dnl We couldn't find ncurses, try SysV curses
1020 AC_EGREP_HEADER(init_color, /usr/include/curses.h,
1022 AC_EGREP_CPP(USE_NCURSES,[
1029 CPPFLAGS="$CPPFLAGS -DRENAMED_NCURSES"
1030 AC_DEFINE(USE_NCURSES)
1031 search_ncurses=false
1032 screen_manager="ncurses installed as curses"
1037 dnl Try SunOS 4.x /usr/5{lib,include} ncurses
1038 dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
1039 dnl should be replaced by a more fine grained selection routine
1043 if test -f /usr/5include/curses.h
1048 # check for ncurses version, to properly ifdef mouse-fix
1049 AC_MSG_CHECKING(for ncurses version)
1050 ncurses_version=unknown
1051 cat > conftest.$ac_ext <<EOF
1052 [#]line __oline__ "configure"
1053 #include "confdefs.h"
1054 #ifdef RENAMED_NCURSES
1057 #include <ncurses.h>
1060 VERSION:NCURSES_VERSION
1062 if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
1063 egrep "VERSION:" >conftest.out 2>&1; then
1065 ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
1069 AC_MSG_RESULT($ncurses_version)
1070 case "$ncurses_version" in
1074 AC_DEFINE(NCURSES_970530,2)
1077 AC_DEFINE(NCURSES_970530,1)
1080 AC_DEFINE(NCURSES_970530,0)
1086 dnl Ncurses may be linked against libgpm. Change LIBS temporary for
1087 dnl check for resizeterm and keyok.
1091 AC_CHECK_FUNCS(resizeterm keyok)
1094 if test "x$screen_manager" = "xunknown"; then
1099 dnl The variables used for expanding the auto saver.
1106 if test $system = Linux
1108 saver="install.saver"
1109 saver_target="cons.saver"
1110 vcs="install.create_vcs"
1114 dnl On Linux, check for PAM authentication available
1116 AC_CHECK_LIB(pam, pam_start, [
1118 PAMLIBS="-lpam -ldl"
1122 AC_SUBST(saver_target)
1128 dnl We need sed in order to fix the library files
1130 SEDCMD="sed 's/-man/$MANDOC/'"
1131 SEDCMD2="sed 's%@prefix@%\$(prefix)%'"
1135 if test x$no_xview = xyes; then
1139 if test x$ac_cv_has_xpm = xyes; then
1142 AC_X_SHAPE_EXTENSION
1143 if test x$ac_cv_has_shape = xyes; then
1144 AC_DEFINE(HAVE_XPM_SHAPE)
1153 dnl This code should be moved to the ac_WITH_SLANG
1155 dnl We check for the existance of setupterm on curses library
1156 dnl this is required to load certain definitions on some termcaps
1157 dnl editions (AIX and OSF/1 I seem to remember).
1158 dnl Note that we avoid using setupterm
1159 case $screen_manager in
1161 [Ss][Ll][Aa][Nn][Gg]*)
1162 changequote([, ])dnl
1163 if test $system = Linux
1167 AC_CHECK_LIB(curses,setupterm,[
1170 #include <term.h>],[
1171 if (key_end == parm_insert_line)
1175 LIBS="$LIBS -lcurses"
1176 AC_DEFINE(USE_SETUPTERM)])])
1181 LIBS="$LIBS $posix_libs"
1183 CPPFLAGS="-I.. $CPPFLAGS"
1186 AC_SUBST(MCCPPFLAGS)
1190 ac_cv_make_with_percent_rules=no
1191 if test x$ac_cv_prog_gnu_make = xyes; then
1192 MCFG='include ../Make.common'
1193 MCFGR='include ./Make.common'
1196 DOTDEPEND='ifeq (.depend,$(wildcard .depend)) \
1200 ac_cv_make_with_percent_rules=yes
1207 WRITEDEP='sed "/^. \*\*\*Dependencies\*\*\*/,/^. \*\*\*End of dependencies\*\*\*/d" < Makefile > Makefile.conf; { cat Makefile.conf; echo "# ***Dependencies***Do not edit***"; cat .depend; echo "# ***End of dependencies***" } > Makefile; $(RMF) Makefile.conf .depend'
1216 if test x$ac_cv_make_with_percent_rules = xyes; then
1226 SHELL=${SHELL-"/bin/sh"}
1230 dnl Output configuration filesn
1239 vfs/Makefile:vfs/Make-mc.in
1255 vfs/extfs/ftplist vfs/extfs/uzip vfs/extfs/uzoo vfs/extfs/lslR
1256 vfs/extfs/ulha vfs/extfs/ucpio vfs/extfs/deb vfs/extfs/urar vfs/extfs/uar
1258 doc/mc.1 doc/mcedit.1 doc/mcserv.8
1260 intl/Makefile po/Makefile.in
1261 ],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
1263 if test x$srcdir != x; then
1264 if test $srcdir != .; then
1265 cp $srcdir/VERSION VERSION
1268 cp $srcdir/pc/Makefile nt/Makefile
1272 if echo "$screen_manager" | grep -q "SLang" ; then
1273 screen_manager="${screen_manager}${slang_term}"
1279 Source code location: ${srcdir}
1281 Compiler flags: ${CFLAGS}
1282 File system: ${vfs_type}
1284 Text mode screen manager: ${screen_manager}
1285 Install console saver: ${install_saver}
1286 Text mode mouse library: ${mouse_lib}
1287 Debugger code: ${mem_debug}
1288 With subshell support: ${subshell}
1289 X11 versions: ${xvers}
1290 Internal editor: ${EDIT_msg}
1291 Install path: ${prefix}/bin, ${prefix}/lib/mc"
1292 if test -n "$xv_bindir"; then
1293 echo " XView version install path: ${xv_bindir}"