2 dnl Configure.in file for the Midnight Commander
5 AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_SRCDIR(src/main.c)
10 AC_CONFIG_AUX_DIR(config)
12 AM_INIT_AUTOMAKE(mc, ${VERSION} )
16 AC_SUBST(LIBMC_VERSION)
17 AC_SUBST(LIBMC_RELEASE)
19 dnl Enable silent rules by default (if yes)
20 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22 AM_CONFIG_HEADER(config.h)
26 AC_USE_SYSTEM_EXTENSIONS
28 AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS],["$ac_configure_args"],[MC configure arguments])
32 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
49 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
51 dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
55 AC_ARG_ENABLE([mclib],
56 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
58 if test "x$enableval" = "xno" ; then
61 if test "x$enable_shared" = "xno" ; then
62 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
71 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
78 AC_CHECK_TOOL(AR, ar, ar)
80 dnl Only list browsers here that can be run in background (i.e. with `&')
81 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
84 dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
85 dnl We use only part of the functionality of mmap, so on AIX,
86 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
89 [ --with-mmap Use the mmap call [[yes if found]]])
90 if test x$with_mmap != xno; then
91 if test x$with_mmap = x; then
94 AC_DEFINE(HAVE_MMAP, 1)
99 dnl Internationalization
101 AM_GNU_GETTEXT(no-libtool, need-ngettext)
102 AM_GNU_GETTEXT_VERSION(0.14.3)
104 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
105 CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
108 dnl Determine which help translations we want to install.
109 ALL_DOC_LINGUAS="es hu it pl ru sr"
112 if test "x$USE_NLS" = xyes; then
113 if test -z "$LINGUAS"; then
114 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
122 for h_lang in $ALL_DOC_LINGUAS; do
123 for lang in $langs; do
124 if test "$lang" = "$h_lang"; then
125 DOC_LINGUAS="$DOC_LINGUAS $lang"
130 AC_SUBST(DOC_LINGUAS)
133 dnl OS specific flags.
139 AC_DEFINE(_POSIX_SOURCE)
144 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
145 utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
146 sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
147 security/pam_misc.h sys/socket.h sys/sysmacros.h sys/types.h \
148 sys/mkdev.h wchar.h wctype.h])
154 dnl Missing structure components
155 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
159 dnl Check availability of some functions
166 setreuid statfs sysconf \
167 tcgetattr tcsetattr truncate \
174 dnl getpt is a GNU Extension (glibc 2.1.x)
176 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
177 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
179 dnl replacing lstat with statlstat on sco makes it more portable between
181 AC_CHECK_FUNCS(statlstat)
184 dnl If running under AIX, AC_AIX does not tell us that
186 AC_MSG_CHECKING([for AIX defines])
188 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
192 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
194 ], [AC_MSG_RESULT(no)])
197 dnl Missing typedefs and replacements
200 AC_CHECK_SIZEOF(long)
202 AC_CHECK_SIZEOF(uintmax_t)
204 AC_CHECK_SIZEOF(off_t)
213 dnl This is from GNU fileutils, check aclocal.m4 for more information
214 dnl uintmat_t is required for FS info
220 dnl Used to read keyboard modifiers when running under X11.
224 dnl Check if the gmodule functionality supported on this system.
225 AC_G_MODULE_SUPPORTED
228 dnl Sequent wants getprocessstats
230 AC_CHECK_LIB(seq, get_process_stats, [
232 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
233 [Define if you have function `get_process_stats' and
234 have to use that instead of gettimeofday])])
239 dnl Check for gpm mouse support (Linux only)
241 mouse_lib="xterm only"
242 AC_ARG_WITH(gpm-mouse,
243 [ --with-gpm-mouse Compile with gpm mouse support (Linux only)
248 if test x$with_gpm_mouse != xno; then
249 AC_CHECK_LIB(gpm, Gpm_Repeat,
250 [AC_DEFINE(HAVE_LIBGPM, 1,
251 [Define to enable gpm mouse support on Linux])
252 mouse_lib="gpm and xterm"
253 MCLIBS="$MCLIBS -lgpm"],
254 if test "x$with_gpm_mouse" = "xyes"; then
255 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
257 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
267 dnl Check nroff and the options it supports
269 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
276 AC_MSG_CHECKING([for manual formatting macros])
277 AC_CACHE_VAL(mc_cv_mandoc, [
278 nroff -mandoc < /dev/null > /dev/null 2>&1
286 AC_MSG_RESULT([$MANDOC])
288 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
289 AC_CACHE_VAL(mc_cv_man_nocolor, [
290 nroff -c < /dev/null > /dev/null 2>&1
297 MAN_FLAGS=$mc_cv_man_nocolor
298 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
300 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
301 AC_CACHE_VAL(mc_cv_nroff_tascii, [
303 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
305 mc_cv_nroff_tascii=-Tlatin1
307 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
309 mc_cv_nroff_tascii=-Tascii
313 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
314 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
322 dnl Check for -L option to file
324 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
325 if $HAVE_FILECMD; then
326 AC_MSG_CHECKING([for -L option to file command])
327 AC_CACHE_VAL(mc_cv_filel, [
328 file -L . > /dev/null 2>&1
335 if test x$mc_cv_filel = xyes; then
336 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
339 AC_MSG_RESULT([$filel])
343 AC_MSG_CHECKING([for subshell support])
344 AC_ARG_WITH(subshell,
345 [ --with-subshell Compile in concurrent subshell [[yes]]
346 --with-subshell=optional Don't run concurrent shell by default [[no]]],
348 if test x$withval = xoptional
350 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
351 [Define to make subshell support optional])
354 if test x$withval = xyes
358 [dnl Default: enable the subshell support
361 if test "x$result" != xno; then
362 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
363 [Define to enable subshell support])
365 AC_MSG_RESULT([$result])
373 dnl Internal editor support.
376 [ --with-edit Enable internal editor [[yes]]])
378 if test x$with_edit != xno; then
379 AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
382 AC_MSG_NOTICE([using internal editor])
388 dnl Diff viewer support.
390 AC_ARG_WITH(diff_viewer,
391 [ --with-diff-viewer Compile with diff viewer [[yes]]])
393 if test x$with_diff_viewer != xno; then
394 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
397 AC_MSG_NOTICE([using diff viewer])
403 dnl Check if the OS is supported by the console saver.
411 dnl Support for background operations
412 AC_ARG_ENABLE([background],
413 [ --enable-background Support for background file operations [[yes]]])
414 if test "x$enable_background" != xno; then
415 AC_DEFINE(WITH_BACKGROUND, 1, [Define to enable background file operations])
420 dnl User visible support for charset conversion.
422 AC_ARG_ENABLE([charset],
423 [ --enable-charset Support for charset selection and conversion [[yes]]])
426 if test "x$enable_charset" != "xno"; then
427 AC_DEFINE(HAVE_CHARSET, 1,
428 [Define to enable charset selection and conversion])
433 if test "$GLIBC21" != yes; then
434 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
441 if test "x$CFLAGS" = "x"; then
445 if test x$USE_MAINTAINER_MODE = xyes; then
446 CFLAGS_OPTS="-g3 -O -ggdb"
447 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
452 AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors])
455 if test "x$enable_werror" = xyes; then
456 MC_CHECK_ONE_CFLAG([-Werror])
458 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
467 dnl Libraries used only when building the mc binary
470 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
473 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
474 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
475 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
476 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
477 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
478 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
479 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
486 chmod +x src/man2hlp/man2hlp
493 contrib/dist/Makefile
494 contrib/dist/debian/Makefile
495 contrib/dist/gentoo/Makefile
496 contrib/dist/redhat/Makefile
497 contrib/dist/redhat/mc.spec
499 contrib/dist/prototype
503 misc/macros.d/Makefile
507 src/consaver/Makefile
511 src/diffviewer/Makefile
512 src/filemanager/Makefile
516 src/vfs/cpio/Makefile
518 src/vfs/extfs/Makefile
519 src/vfs/extfs/helpers/Makefile
520 src/vfs/extfs/helpers/a+
521 src/vfs/extfs/helpers/apt+
522 src/vfs/extfs/helpers/audio
523 src/vfs/extfs/helpers/deb
524 src/vfs/extfs/helpers/deba
525 src/vfs/extfs/helpers/debd
526 src/vfs/extfs/helpers/dpkg+
527 src/vfs/extfs/helpers/iso9660
528 src/vfs/extfs/helpers/hp48+
529 src/vfs/extfs/helpers/lslR
530 src/vfs/extfs/helpers/mailfs
531 src/vfs/extfs/helpers/patchfs
532 src/vfs/extfs/helpers/rpms+
533 src/vfs/extfs/helpers/s3+
534 src/vfs/extfs/helpers/uace
535 src/vfs/extfs/helpers/ualz
536 src/vfs/extfs/helpers/uar
537 src/vfs/extfs/helpers/uarc
538 src/vfs/extfs/helpers/uarj
539 src/vfs/extfs/helpers/uc1541
540 src/vfs/extfs/helpers/ucab
541 src/vfs/extfs/helpers/uha
542 src/vfs/extfs/helpers/ulha
543 src/vfs/extfs/helpers/urar
544 src/vfs/extfs/helpers/uzip
545 src/vfs/extfs/helpers/uzoo
547 src/vfs/fish/Makefile
548 src/vfs/fish/helpers/Makefile
550 src/vfs/ftpfs/Makefile
552 src/vfs/local/Makefile
556 src/vfs/smbfs/Makefile
560 src/vfs/undelfs/Makefile
564 lib/filehighlight/Makefile
565 lib/mcconfig/Makefile
579 doc/man/mc.1 doc/man/mcedit.1 doc/man/mcview.1 doc/man/Makefile
580 doc/man/es/mc.1 doc/man/es/Makefile
581 doc/man/hu/mc.1 doc/man/hu/Makefile
582 doc/man/it/mc.1 doc/man/it/Makefile
583 doc/man/pl/mc.1 doc/man/pl/Makefile
584 doc/man/ru/mc.1 doc/man/ru/Makefile
585 doc/man/sr/mc.1 doc/man/sr/Makefile
599 if test x$enable_tests != xno; then
603 tests/lib/mcconfig/Makefile
604 tests/lib/search/Makefile
605 tests/lib/vfs/Makefile
616 Source code location: ${srcdir}
618 Compiler flags: ${CFLAGS}
619 File system: ${vfs_type}
621 Screen library: ${screen_msg}
622 Mouse support: ${mouse_lib}
623 X11 events support: ${textmode_x11_support}
624 With subshell support: ${subshell}
625 Internal editor: ${edit_msg}
626 Diff viewer: ${diff_msg}
627 Support for charset: ${charset_msg}
628 Search type: ${SEARCH_TYPE}