2 dnl Configure.in file for the Midnight Commander
6 AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_AUX_DIR(config)
10 AC_CONFIG_SRCDIR(src/main.c)
11 AC_CONFIG_HEADERS(config.h)
13 AM_INIT_AUTOMAKE(mc, ${VERSION} )
14 dnl Enable silent rules by default (if yes)
15 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
21 AC_USE_SYSTEM_EXTENSIONS
24 dnl ############################################################################
25 dnl Check for compiler
26 dnl ############################################################################
34 if test "x$CFLAGS" = "x"; then
37 if test x$USE_MAINTAINER_MODE = xyes; then
38 CFLAGS_OPTS="-g3 -O -ggdb"
39 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
42 AC_ARG_ENABLE([werror],
43 AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors]))
44 if test "x$enable_werror" = xyes; then
45 mc_CHECK_ONE_CFLAG([-Werror])
48 AX_GCC_FUNC_ATTRIBUTE([fallthrough])
53 dnl ############################################################################
54 dnl Check for programs
55 dnl ############################################################################
60 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
61 AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
62 AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
64 dnl Check nroff and the options it supports
65 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
70 AC_MSG_CHECKING([for manual formatting macros])
71 AC_CACHE_VAL(mc_cv_mandoc, [
72 nroff -mandoc < /dev/null > /dev/null 2>&1
80 AC_MSG_RESULT([$MANDOC])
82 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
83 AC_CACHE_VAL(mc_cv_man_nocolor, [
84 nroff -c < /dev/null > /dev/null 2>&1
91 MAN_FLAGS=$mc_cv_man_nocolor
92 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
94 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
95 AC_CACHE_VAL(mc_cv_nroff_tascii, [
97 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
99 mc_cv_nroff_tascii=-Tlatin1
101 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
103 mc_cv_nroff_tascii=-Tascii
107 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
108 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
114 dnl Check for -L option to file
115 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
116 if $HAVE_FILECMD; then
117 AC_MSG_CHECKING([for -L option to file command])
118 AC_CACHE_VAL(mc_cv_filel, [
119 file -L . > /dev/null 2>&1
126 if test x$mc_cv_filel = xyes; then
127 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
130 AC_MSG_RESULT([$filel])
133 dnl Only list browsers here that can be run in background (i.e. with `&')
134 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
137 dnl ############################################################################
138 dnl Check for other tools
139 dnl ############################################################################
141 AC_CHECK_TOOL(AR, ar, ar)
145 dnl ############################################################################
146 dnl Check for main libraies
147 dnl ############################################################################
150 mc_G_MODULE_SUPPORTED
153 dnl X11 support. Used to read keyboard modifiers when running under X11.
157 dnl ############################################################################
158 dnl Check for header files
159 dnl ############################################################################
161 AC_CHECK_HEADERS([string.h memory.h limits.h malloc.h \
162 utime.h sys/statfs.h sys/vfs.h \
163 sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
165 dnl This macro is redefined in m4.include/sys_types_h.m4
166 dnl to work around a buggy version in autoconf <= 2.69.
170 dnl ############################################################################
172 dnl ############################################################################
174 dnl Check largefile before type sizeof checks
177 AC_CHECK_SIZEOF(long)
179 AC_CHECK_SIZEOF(uintmax_t)
181 AC_CHECK_SIZEOF(off_t)
183 gl_PROMOTED_TYPE_MODE_T
188 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev, struct stat.st_mtim])
191 AH_TEMPLATE([sig_atomic_t],
192 [/* Define to `int' if <signal.h> doesn't define.])
193 AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
194 [Some systems declare sig_atomic_t as volatile, some others -- no.
195 This define will have value `sig_atomic_t' or
196 `volatile sig_atomic_t' accordingly.])
198 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
199 AC_EGREP_HEADER(sig_atomic_t,signal.h,
201 ac_cv_type_sig_atomic_t=yes;
202 AC_EGREP_HEADER(volatile.*sig_atomic_t,
205 is_sig_atomic_t_volatile=yes;
206 AC_MSG_RESULT([yes, volatile])
209 is_sig_atomic_t_volatile=no;
210 AC_MSG_RESULT([yes, non volatile])
215 AC_CHECK_TYPE(sig_atomic_t, int)
216 is_sig_atomic_t_volatile=no
218 if test $is_sig_atomic_t_volatile = 'yes'
220 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
222 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
226 dnl ############################################################################
227 dnl Check for functions
228 dnl ############################################################################
236 dnl utimensat is supported since glibc 2.6 and specified in POSIX.1-2008
237 AC_CHECK_FUNCS([utimensat])
239 dnl getpt is a GNU Extension (glibc 2.1.x)
240 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
241 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
243 dnl replacing lstat with statlstat on sco makes it more portable between
245 AC_CHECK_FUNCS(statlstat)
247 dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
248 dnl We use only part of the functionality of mmap, so on AIX,
249 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
251 AS_HELP_STRING([--with-mmap], [Use the mmap call @<:@yes if found@:>@]))
252 if test x$with_mmap != xno; then
253 if test x$with_mmap = x; then
256 AC_DEFINE(HAVE_MMAP, 1)
260 dnl Sequent wants getprocessstats
261 AC_CHECK_LIB(seq, get_process_stats, [
263 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
264 [Define if you have function `get_process_stats' and
265 have to use that instead of gettimeofday])])
270 dnl ############################################################################
271 dnl Internationalization
272 dnl ############################################################################
274 AM_GNU_GETTEXT([no-libtool], [need-ngettext])
275 AM_GNU_GETTEXT_VERSION([0.18.1])
279 dnl ############################################################################
280 dnl OS specific flags
281 dnl ############################################################################
287 AC_DEFINE(_POSIX_SOURCE)
291 dnl If running under AIX, AC_AIX does not tell us that
292 AC_MSG_CHECKING([for AIX defines])
295 #if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
300 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
307 dnl Check if the OS is supported by the console saver.
314 dnl Check for gpm mouse support (Linux only)
315 mouse_lib="xterm only"
316 AC_ARG_WITH([gpm-mouse],
317 AS_HELP_STRING([--with-gpm-mouse], [Compile with gpm mouse support (Linux only) @<:@yes if found@:>@]))
321 if test x$with_gpm_mouse != xno; then
322 AC_CHECK_LIB(gpm, Gpm_Repeat,
323 [AC_DEFINE(HAVE_LIBGPM, 1,
324 [Define to enable gpm mouse support on Linux])
325 mouse_lib="gpm and xterm"
326 MCLIBS="$MCLIBS -lgpm"],
327 if test "x$with_gpm_mouse" = "xyes"; then
328 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
330 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
338 dnl ############################################################################
340 dnl ############################################################################
342 LIBMC_VERSION="0.0.1"
344 AC_SUBST(LIBMC_VERSION)
345 AC_SUBST(LIBMC_RELEASE)
347 AC_ARG_ENABLE([mclib],
348 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
350 if test "x$enableval" = "xno" ; then
353 if test "x$enable_shared" = "xno" ; then
354 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
363 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
366 dnl ############################################################################
367 dnl Where config files should be placed
368 dnl ############################################################################
370 AC_ARG_WITH([homedir],
371 AS_HELP_STRING([--with-homedir],
372 [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
374 dnl Unfortunately, there is no way to tell AC_ARG_WITH that the
375 dnl argument value is required, so we can't differentiate
376 dnl between `--with-homedir` and `--with-homedir=yes`, because
377 dnl `with_homedir` is set to `yes` in both cases.
379 dnl We opt to set `with_homedir` to `.mc` if the value is `yes`
380 dnl in order to avoid the surprise for users using
381 dnl `--with-homedir` w/o any value and then getting mc to store
382 dnl settings in the `yes` directory.
384 if test "x$withval" = "xXDG"; then
386 elif test "x$withval" = "xyes"; then
389 with_homedir=$withval
395 if test x$with_homedir = xXDG; then
396 AC_DEFINE(MC_HOMEDIR_XDG, 1, [Define to enable XDG standard support])
398 AC_DEFINE(MC_HOMEDIR_XDG, 0, [Define to disable XDG standard support])
399 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
403 dnl ############################################################################
405 dnl ############################################################################
409 mc_WITH_INTERNAL_EDIT
411 dnl Diff viewer support.
412 AC_ARG_WITH([diff_viewer],
413 AS_HELP_STRING([--with-diff-viewer], [Compile with diff viewer @<:@yes@:>@]))
415 if test x$with_diff_viewer != xno; then
416 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
419 AC_MSG_NOTICE([using diff viewer])
428 dnl ############################################################################
430 dnl ############################################################################
432 dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
433 dnl Let define ${prefix} and ${exec_prefix}
434 test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
435 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
437 if test x${libexecdir} = x'${exec_prefix}/libexec'; then
438 EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
439 elif test x${libexecdir} = x'${exec_prefix}/lib'; then
440 EXTHELPERSDIR=${prefix}/lib/${PACKAGE}/ext.d
442 EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
444 AC_SUBST(EXTHELPERSDIR)
447 dnl ############################################################################
449 dnl ############################################################################
451 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
454 dnl Determine which help translations we want to install.
455 ALL_DOC_LINGUAS="es hu it pl ru sr"
458 if test "x$USE_NLS" = xyes; then
459 if test -z "$LINGUAS"; then
460 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
468 for h_lang in $ALL_DOC_LINGUAS; do
469 for lang in $langs; do
470 if test "$lang" = "$h_lang"; then
471 DOC_LINGUAS="$DOC_LINGUAS $lang"
476 AC_SUBST(DOC_LINGUAS)
486 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
489 dnl ############################################################################
490 dnl Configure results
491 dnl ############################################################################
493 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
501 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
502 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
503 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
504 AM_CONDITIONAL(USE_INTERNAL_EDIT, [test x"$use_internal_edit" = xyes ])
505 AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ])
506 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
507 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
508 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
509 dnl Clarify do we really need GModule
510 AM_CONDITIONAL([HAVE_GMODULE], [test -n "$g_module_supported" && \
511 test x"$textmode_x11_support" = x"yes" -o x"$enable_aspell" = x"yes"])
513 AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
520 chmod +x src/man2hlp/man2hlp
527 contrib/dist/Makefile
528 contrib/dist/gentoo/Makefile
529 contrib/dist/redhat/Makefile
530 contrib/dist/redhat/mc.spec
532 contrib/dist/prototype
543 misc/macros.d/Makefile
547 src/consaver/Makefile
550 src/subshell/Makefile
552 src/diffviewer/Makefile
553 src/filemanager/Makefile
557 src/vfs/cpio/Makefile
559 src/vfs/extfs/Makefile
560 src/vfs/extfs/helpers/Makefile
561 src/vfs/extfs/helpers/a+
562 src/vfs/extfs/helpers/apt+
563 src/vfs/extfs/helpers/audio
564 src/vfs/extfs/helpers/deb
565 src/vfs/extfs/helpers/deba
566 src/vfs/extfs/helpers/debd
567 src/vfs/extfs/helpers/dpkg+
568 src/vfs/extfs/helpers/iso9660
569 src/vfs/extfs/helpers/hp48+
570 src/vfs/extfs/helpers/lslR
571 src/vfs/extfs/helpers/mailfs
572 src/vfs/extfs/helpers/patchfs
573 src/vfs/extfs/helpers/rpms+
574 src/vfs/extfs/helpers/s3+
575 src/vfs/extfs/helpers/uace
576 src/vfs/extfs/helpers/ualz
577 src/vfs/extfs/helpers/uar
578 src/vfs/extfs/helpers/uarc
579 src/vfs/extfs/helpers/uarj
580 src/vfs/extfs/helpers/uc1541
581 src/vfs/extfs/helpers/ucab
582 src/vfs/extfs/helpers/uha
583 src/vfs/extfs/helpers/ulha
584 src/vfs/extfs/helpers/ulib
585 src/vfs/extfs/helpers/urar
586 src/vfs/extfs/helpers/uzip
587 src/vfs/extfs/helpers/uzoo
589 src/vfs/fish/Makefile
590 src/vfs/fish/helpers/Makefile
592 src/vfs/ftpfs/Makefile
594 src/vfs/sftpfs/Makefile
596 src/vfs/local/Makefile
600 src/vfs/smbfs/Makefile
604 src/vfs/undelfs/Makefile
608 lib/filehighlight/Makefile
609 lib/mcconfig/Makefile
625 doc/hints/l10n/Makefile
650 tests/lib/mcconfig/Makefile
651 tests/lib/search/Makefile
652 tests/lib/strutil/Makefile
653 tests/lib/vfs/Makefile
654 tests/lib/widget/Makefile
656 tests/src/filemanager/Makefile
657 tests/src/editor/Makefile
658 tests/src/editor/test-data.txt
659 tests/src/vfs/Makefile
660 tests/src/vfs/extfs/Makefile
661 tests/src/vfs/extfs/helpers-list/Makefile
662 tests/src/vfs/extfs/helpers-list/data/config.sh
663 tests/src/vfs/extfs/helpers-list/misc/Makefile
672 Source code location: ${srcdir}
674 Compiler flags: ${CFLAGS}
675 Assertions: ${enable_assert}
676 Unit tests: ${tests_msg}
677 File system: ${vfs_type}
679 Screen library: ${screen_msg}
680 Mouse support: ${mouse_lib}
681 X11 events support: ${textmode_x11_support}
682 With subshell support: ${subshell}
683 With background operations: ${enable_background}
684 Internal editor: ${edit_msg}
685 Diff viewer: ${diff_msg}
686 Support for charset: ${charset_msg}
687 Search type: ${SEARCH_TYPE}
690 dnl option checking is disable by default due to AC_CONFIG_SUBDIRS
691 dnl we enable it back for top-level ./configure
692 if test -n "$ac_unrecognized_opts"; then
693 case $enable_option_checking in
694 fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
695 *) AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;