Committed some stilistic changes to the italian manual pages.
[midnight-commander.git] / configure.in
blobe361239321cd09c162fdc44eb5b0bfce090171b3
1 dnl
2 dnl Configure.in file for the Midnight Commander
3 dnl
5 AC_INIT([GNU Midnight Commander], [], [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.6.0a)
11 AM_CONFIG_HEADER(config.h)
12 AM_MAINTAINER_MODE
14 AC_CANONICAL_HOST
16 AC_AIX
17 AC_MINIX
18 AC_ISC_POSIX
20 AC_PROG_CC_STDC
22 dnl
23 dnl First try glib 2.x.  If it's not found, use glib 1.2.x.
24 dnl Keep this check close to the beginning, so that the users
25 dnl without any glib won't have their time wasted by other checks.
26 dnl
28 AC_ARG_WITH(glib12, 
29         [  --with-glib12            Force using glib 1.2.x [[no]]])
31 glib_found=no
32 if test "x$with_glib12" != "xyes"; then
33         PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib_found=yes], [:])
36 dnl Fall back to glib-1.2, don't use pkgconfig to find it.
37 if test "x$glib_found" != "xyes" ; then
38         dnl This temporary variable is a workaround for a bug in Autoconf-2.53
39         glib_path=$PATH:/usr/local/bin
41         dnl Klugde for FreeBSD, where glib-config is renamed to glib12-config.
42         AC_PATH_PROGS([GLIB_CONFIG], [glib-config glib12-config],,[$glib_path])
44         AC_ARG_VAR([GLIB_CONFIG], [Path to glib-config (version 1.2.x only)])
45         AM_PATH_GLIB(1.2.6, , [AC_MSG_ERROR([Test for glib failed.
46 GNU Midnight Commander requires glib 1.2.6 or above.])])
47         dnl Save GLIB_CFLAGS and GLIB_LIBS, since the following call to
48         dnl AM_PATH_GLIB will overwrite them.
49         save_GLIB_CFLAGS="$GLIB_CFLAGS"
50         save_GLIB_LIBS="$GLIB_LIBS"
51         dnl Check for gmodule.  Store the flags necessary to compile and
52         dnl link programs using gmodule functionality in GMODULE_CFLAGS
53         dnl and GMODULE_LIBS.
54         AM_PATH_GLIB(1.2.6, [gmodule_found=yes], , [gmodule])
55         GMODULE_CFLAGS="$GLIB_CFLAGS"
56         GMODULE_LIBS="$GLIB_LIBS"
57         GLIB_CFLAGS="$save_GLIB_CFLAGS"
58         GLIB_LIBS="$save_GLIB_LIBS"
59 else
60         PKG_CHECK_MODULES(GMODULE, [gmodule-2.0], [gmodule_found=yes])
63 if test "x$gmodule_found" = "xyes" ; then
64         dnl Check if the gmodule functionality supported on this system.
65         AC_G_MODULE_SUPPORTED
68 AC_HEADER_MAJOR
69 AC_C_CONST
70 AC_SYS_LARGEFILE
72 AC_PROG_LN_S
73 AC_CHECK_TOOL(AR, ar, ar)
75 dnl Only list browsers here that can be run in background (i.e. with `&')
76 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
78 dnl
79 dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
80 dnl We use only part of the functionality of mmap, so on AIX,
81 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
82 dnl
83 AC_ARG_WITH(mmap, 
84         [  --with-mmap              Force using the mmap call (only useful on AIX)],
85         [case $withval in
86 yes)
87         ac_cv_func_mmap_fixed_mapped=yes
88         AC_MSG_NOTICE([forcing MMAP support])
89         ;;
90 no)
91         ac_cv_func_mmap_fixed_mapped=no
92         AC_MSG_NOTICE([disabling MMAP support])
93         ;;
94 esac])
95 AC_FUNC_MMAP
97 dnl
98 dnl Internationalization
99 dnl
100 AM_GNU_GETTEXT
101 AM_GNU_GETTEXT_VERSION(0.11.5)
103 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
104     CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
107 dnl Determine which help translations we want to install.
108 ALL_DOC_LINGUAS="es hu it pl ru"
110 DOC_LINGUAS=
111 if test "x$USE_NLS" = xyes; then
112     if test -z "$LINGUAS"; then
113         langs="`grep -v '^#' $srcdir/po/LINGUAS`"
114     else
115         langs="$LINGUAS"
116     fi
117 else
118     langs=
121 for h_lang in $ALL_DOC_LINGUAS; do
122     for lang in $langs; do
123         if test "$lang" = "$h_lang"; then
124             DOC_LINGUAS="$DOC_LINGUAS $lang"
125             break
126         fi
127     done
128 done
129 AC_SUBST(DOC_LINGUAS)
132 dnl Hack to make extraconf.h visible even if compiling outside srcdir.
134 CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)"
137 dnl Enforce coding standards
139 if test "x$GCC" = xyes; then
140     CFLAGS="$CFLAGS -Wall"
144 dnl OS specific flags.
146 case $host_os in
147 aux*)
148     # A/UX
149     LIBS="$LIBS -lposix"
150     AC_DEFINE(_POSIX_SOURCE)
151     ;;
152 sco*)
153     AC_DEFINE(SCO_FLAVOR, 1, [Define if you want to turn on SCO-specific code])
154     AC_DEFINE(_SVID3, 1, [Needs to be defined on SCO])
155     ;;
156 esac
159 AC_PROG_INSTALL
160 AC_CHECK_HEADERS([unistd.h string.h memory.h grp.h limits.h malloc.h \
161         stdlib.h termios.h utime.h fcntl.h pwd.h sys/statfs.h sys/time.h \
162         sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h])
164 AC_HEADER_TIME
165 AC_HEADER_SYS_WAIT
166 AC_HEADER_DIRENT
167 AC_HEADER_STDC
169 dnl Missing structure components
170 AC_STRUCT_ST_BLKSIZE
171 AC_STRUCT_ST_BLOCKS
172 AC_STRUCT_ST_RDEV
175 dnl Check availability of some functions 
176 dnl 
178 AC_CHECK_FUNCS([strerror statfs strftime \
179                 memmove truncate initgroups putenv \
180                 memset memcpy tcsetattr tcgetattr cfgetospeed \
181                 sigaction sigemptyset sigprocmask sigaddset \
182                 sysconf setuid setreuid telldir seekdir])
185 dnl getpt is a GNU Extension (glibc 2.1.x)
187 AC_CHECK_FUNCS(getpt)
188 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
190 dnl replacing lstat with statlstat on sco makes it more portable between
191 dnl sco clones
192 AC_CHECK_FUNCS(statlstat)
195 dnl If running under AIX, AC_AIX does not tell us that
197 AC_MSG_CHECKING([for AIX defines])
198 AC_EGREP_CPP(yes,
199 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
201 #endif
202 ], [
203 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
204 AC_MSG_RESULT(yes)
205 ], [AC_MSG_RESULT(no)])
208 dnl This is from GNU fileutils, check aclocal.m4 for more information
210 AC_GET_FS_INFO
213 dnl Missing typedefs and replacements
214 dnl 
216 AC_TYPE_MODE_T
217 AC_CHECK_TYPE(umode_t, int)
218 AC_CHECK_TYPE(off_t, long)
219 AC_TYPE_PID_T
220 AC_TYPE_UID_T
221 AC_CHECK_TYPE(nlink_t, unsigned int)
223 dnl This is needed for regex.c only
224 AC_CHECK_TYPE(uintptr_t,
225               [AC_DEFINE(HAVE_UINTPTR_T, 1,
226                          [Define if you have the `uintptr_t' type.])
229 AC_FUNC_ALLOCA
230 AC_FUNC_STRCOLL
233 dnl X11 support.
234 dnl Used to read keyboard modifiers when running under X11.
237 AC_PATH_XTRA
238 if test "x$no_x" = xyes; then
239     textmode_x11_support="no"
240 else
241     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
242     if test "x$mc_cv_g_module_supported" = "xyes" ; then
243         dnl Replace the contents of GLIB_CFLAGS and GLIB_LIBS with those of
244         dnl GMODULE_CFLAGS and GMODULE_LIBS, only if X is available and gmodule
245         dnl functionality is supported on the system.  This way, mc will be
246         dnl linked against the gmodule library only when it's really required.
247         GLIB_CFLAGS="$GMODULE_CFLAGS"
248         GLIB_LIBS="$GMODULE_LIBS"
249     else
250         MCLIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
251     fi
252     AC_DEFINE(HAVE_TEXTMODE_X11_SUPPORT, 1,
253               [Define to enable getting events from X Window System])
254     textmode_x11_support="yes"
258 dnl Network related functions
261 AC_CHECK_LIB(nsl, t_accept)
262 AC_CHECK_LIB(socket, socket)
264 have_socket=no
265 AC_CHECK_FUNCS(socket, have_socket=yes)
266 if test $have_socket = no; then
267   # socket is not in the default libraries.  See if it's in some other.
268   for lib in bsd socket inet; do
269     AC_CHECK_LIB($lib, socket, [
270         LIBS="$LIBS -l$lib"
271         have_socket=yes
272         AC_DEFINE(HAVE_SOCKET)
273         break])
274   done
277 have_gethostbyname=no
278 AC_CHECK_FUNC(gethostbyname, [have_gethostbyname=yes])
279 if test $have_gethostbyname = no; then
280   # gethostbyname is not in the default libraries.  See if it's in some other.
281   for lib in bsd socket inet; do
282     AC_CHECK_LIB([$lib], [gethostbyname],
283                  [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
284   done
287 AC_CHECK_FUNCS(socketpair)
290 dnl Sequent wants getprocessstats
292 AC_CHECK_LIB(seq, get_process_stats, [
293         LIBS="$LIBS -lseq"
294         AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
295                   [Define if you have function `get_process_stats' and
296 have to use that instead of gettimeofday])])
298 MC_VFS_CHECKS
300 vfs_type="normal"
301 if test x$use_vfs = xyes; then
302         AC_MSG_NOTICE([enabling VFS code])
303         vfs_type="Midnight Commander Virtual File System"
307 dnl Check for gpm mouse support (Linux only)
309 mouse_lib="xterm only"
310 AC_ARG_WITH(gpm-mouse, 
311         [  --with-gpm-mouse         Compile with gpm mouse support (Linux only)
312                            [[yes if found]]])
314 case $host_os in
315 linux*)
316     if test x$with_gpm_mouse != xno; then
317         AC_CHECK_LIB(gpm, Gpm_Repeat,
318             [AC_DEFINE(HAVE_LIBGPM, 1,
319                        [Define to enable gpm mouse support on Linux])
320             mouse_lib="gpm and xterm"
321             MCLIBS="$MCLIBS -lgpm"],
322             [AC_MSG_WARN([libgpm is missing or older than 0.18])
323         ])
324     fi
325     ;;
326 esac
329 dnl Check nroff and the options it supports
331 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
333 dnl Default values
334 MANDOC=-man
335 MAN_FLAGS=
337 if $HAVE_nroff; then
338     AC_MSG_CHECKING([for manual formatting macros])
339     AC_CACHE_VAL(ac_cv_mandoc, [
340     nroff -mandoc < /dev/null > /dev/null 2>&1
341     if test $? = 0; then
342         ac_cv_mandoc=-mandoc
343     else
344         ac_cv_mandoc=-man
345     fi
346     ])
347     MANDOC=$ac_cv_mandoc
348     AC_MSG_RESULT([$MANDOC])
350     AC_MSG_CHECKING([for option to disable ANSI color in manuals])
351     AC_CACHE_VAL(ac_cv_man_nocolor, [
352     nroff -c < /dev/null > /dev/null 2>&1
353     if test $? = 0; then
354         ac_cv_man_nocolor=-c
355     else
356         ac_cv_man_nocolor=
357     fi
358     ])
359     MAN_FLAGS=$ac_cv_man_nocolor
360     AC_MSG_RESULT([${MAN_NOCOLOR-none}])
362     AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
363     AC_CACHE_VAL(ac_cv_nroff_tascii, [
364     ac_cv_nroff_tascii=
365     nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
366     if test $? = 0; then
367         ac_cv_nroff_tascii=-Tlatin1
368     else
369         nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
370         if test $? = 0; then
371             ac_cv_nroff_tascii=-Tascii
372         fi
373     fi
374     ])
375     AC_MSG_RESULT([${ac_cv_nroff_tascii-no}])
376     MAN_FLAGS="$MAN_FLAGS $ac_cv_nroff_tascii"
379 AC_SUBST(MANDOC)
380 AC_SUBST(MAN_FLAGS)
384 dnl Check for - option to file
386 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
387 if $HAVE_FILECMD; then
388     AC_MSG_CHECKING([for - option to file command])
389     AC_CACHE_VAL(ac_cv_filestdin, [[
390     cat > conftest.c <<\EOF
391 /* A comment */
392 #if 0
393 #endif
394 void main(void)
395 { return; }
397     cat > conftest.sed <<\EOF
398 s/^[^:]*:[      ]*//
399 s/[     ]*$//
401     filehyphen_1=`file conftest.c 2>/dev/null | sed -f conftest.sed`
402     filehyphen_2=`cat conftest.c | file - 2>/dev/null | sed -f conftest.sed`
403     if test "x$filehyphen_1" = "x$filehyphen_2"; then
404         ac_cv_filestdin=yes
405     else
406         ac_cv_filestdin=no
407     fi
408     rm conftest.c conftest.sed
409     ]])
411     if test x$ac_cv_filestdin = xyes; then
412         AC_DEFINE(FILE_STDIN, 1,
413                   [Define if the file command accepts - for stdin])
414     fi
415     filestdin=$ac_cv_filestdin
416     AC_MSG_RESULT([$filestdin])
418     dnl
419     dnl Check for -L option to file
420     dnl
422 AC_MSG_CHECKING([for -L option to file command])
423 AC_CACHE_VAL(ac_cv_filel, [
424 file -L . > /dev/null 2>&1
425 if test $? = 0
426 then
427     ac_cv_filel=yes
428 else
429     ac_cv_filel=no
432 if test x$ac_cv_filel = xyes; then
433     AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
435 filel=$ac_cv_filel
436 AC_MSG_RESULT([$filel])
437 fi 
440 AC_MSG_CHECKING([for subshell support])
441 AC_ARG_WITH(subshell,
442         [  --with-subshell          Compile in concurrent subshell [[yes]]
443   --with-subshell=optional Don't run concurrent shell by default [[no]]],
444         [result=no
445         if test x$withval = xoptional
446         then
447                 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
448                           [Define to make subshell support optional])
449                 result="optional"
450         fi
451         if test x$withval = xyes
452         then 
453                 result="yes"
454         fi],
455         [dnl Default: enable the subshell support
456         result="yes"
458 if test "x$result" != xno; then
459         AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
460                   [Define to enable subshell support])
462 AC_MSG_RESULT([$result])
463 subshell="$result"
467 dnl Select the screen library.  mcslang is the included S-Lang library.
469 AC_ARG_WITH(screen,
470         [  --with-screen=LIB        Compile with screen library: slang, mcslang or
471                            ncurses [[slang if found, else mcslang]]])
473 case x$with_screen in
474 xslang)
475         MC_WITH_SLANG(strict)
476         ;;
477 xmcslang)
478         MC_WITH_MCSLANG
479         ;;
480 xncurses)
481         MC_WITH_NCURSES
482         ;;
484         MC_WITH_SLANG
485         ;;
487         AC_MSG_ERROR([Value of the screen library is incorrect])
488         ;;
489 esac
493 dnl Force using termcap.  This option is processed in MC_WITH_MCSLANG.
494 dnl Report an error if this option is not applicable.
496 AC_ARG_WITH(termcap,
497         [  --with-termcap           Try using termcap database [[only if no terminfo]]],
498         [if test x$with_screen != xmcslang; then
499                 AC_MSG_ERROR([Option `--with-termcap' only works with `--with-screen=mcslang'])
500         fi
505 dnl Internal editor support.
507 AC_ARG_WITH(edit,
508         [  --with-edit              Enable internal editor [[yes]]])
510 if test x$with_edit != xno; then
511         AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
512         use_edit=yes
513         edit_msg="yes"
514         AC_MSG_NOTICE([using internal editor])
515 else
516         edit_msg="no"
520 if test $use_vfs = yes; then
521     AC_ARG_WITH(ext2undel,
522         [  --with-ext2undel         Compile with ext2 undelete code [[yes if found]]],
523         [if test x$withval != xno; then
524                 if test x$withval != xyes; then
525                         LDFLAGS="$LDFLAGS -L$withval/lib"
526                         CPPFLAGS="$CPPFLAGS -I$withval/include"
527                 fi
528                 AC_EXT2_UNDEL
529         fi],[
530         dnl Default: detect
531         AC_CHECK_LIB(ext2fs, ext2fs_close, [AC_EXT2_UNDEL], , [-lcom_err])
532     ])
536 dnl Check if the OS is supported by the console saver.
537 cons_saver=""
538 case $host_os in
539 linux*)
540     cons_saver=yes
541 esac
545 dnl User visible support for charset conversion.
547 AC_ARG_ENABLE([charset],
548               [  --enable-charset         Support for charset selection and conversion [[no]]])
549 have_charset=
550 if test "x$enable_charset" = xyes; then
551   if test "x$am_cv_func_iconv" != xyes; then
552     AC_MSG_WARN([Cannot enable charset support because iconv function is missing])
553   else
554     AC_DEFINE(HAVE_CHARSET, 1,
555               [Define to enable charset selection and conversion])
556     have_charset=yes
557   fi
560 if test "$GLIBC21" != yes; then
561     AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
564 AC_SUBST(CFLAGS)
565 AC_SUBST(CPPFLAGS)
566 AC_SUBST(LDFLAGS)
567 AC_SUBST(LIBS)
569 dnl Libraries used only when building the mc binary
570 AC_SUBST(MCLIBS)
572 dnl Version for the RedHat package, without dashes
573 RPM_VERSION=`echo $VERSION | sed 's/-//g'`
574 AC_SUBST(RPM_VERSION)
576 if test -n "$use_smbfs"; then
577   AC_CONFIG_SUBDIRS([vfs/samba])
580 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
581 AM_CONDITIONAL(USE_VFS, [test "x$use_vfs" = xyes])
582 AM_CONDITIONAL(USE_VFS_NET, [test x"$use_net_code" = xtrue])
583 AM_CONDITIONAL(USE_UNDEL_FS, [test -n "$use_undelfs"])
584 AM_CONDITIONAL(USE_SAMBA_FS, [test -n "$use_smbfs"])
585 AM_CONDITIONAL(USE_MCFS, [test -n "$use_mcfs"])
586 AM_CONDITIONAL(INCLUDED_SLANG, [test "x$with_screen" = xmcslang])
587 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
588 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
590 AH_BOTTOM([#include <extraconf.h>])
592 AC_CONFIG_FILES([
593 Makefile 
594 mc.spec
595 doc/Makefile 
596 vfs/Makefile
597 vfs/extfs/Makefile
598 lib/Makefile
599 src/Makefile
600 slang/Makefile 
601 edit/Makefile 
602 syntax/Makefile
603 pc/Makefile
604 m4/Makefile
606 lib/mc.ext
608 vfs/extfs/a
609 vfs/extfs/apt
610 vfs/extfs/audio
611 vfs/extfs/deb
612 vfs/extfs/deba
613 vfs/extfs/debd
614 vfs/extfs/dpkg
615 vfs/extfs/hp48
616 vfs/extfs/lslR
617 vfs/extfs/mailfs
618 vfs/extfs/patchfs
619 vfs/extfs/rpms
620 vfs/extfs/uar
621 vfs/extfs/uarj
622 vfs/extfs/uha
623 vfs/extfs/ulha 
624 vfs/extfs/urar
625 vfs/extfs/uzip
626 vfs/extfs/uzoo
628 doc/mc.1 doc/mcedit.1 doc/mcview.1 doc/mcserv.8
629 doc/es/mc.1 doc/es/Makefile
630 doc/hu/mc.1 doc/hu/Makefile
631 doc/it/mc.1 doc/it/Makefile
632 doc/pl/mc.1 doc/pl/Makefile
633 doc/ru/mc.1 doc/ru/Makefile
635 intl/Makefile
636 po/Makefile.in
639 AC_OUTPUT
641 echo "
642 Configuration:
644   Source code location:       ${srcdir}
645   Compiler:                   ${CC}
646   Compiler flags:             ${CFLAGS}
647   File system:                ${vfs_type}
648                               ${vfs_flags}
649   Screen library:             ${screen_msg}
650   Mouse support:              ${mouse_lib}
651   X11 events support:         ${textmode_x11_support}
652   With subshell support:      ${subshell}
653   Internal editor:            ${edit_msg}