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 linux/fs.h for FICLONE to support BTRFS's file clone operation
310 AC_CHECK_HEADERS([linux/fs.h])
313 dnl Check if the OS is supported by the console saver.
320 dnl Check for gpm mouse support (Linux only)
321 mouse_lib="xterm only"
322 AC_ARG_WITH([gpm-mouse],
323 AS_HELP_STRING([--with-gpm-mouse], [Compile with gpm mouse support (Linux only) @<:@yes if found@:>@]))
327 if test x$with_gpm_mouse != xno; then
328 AC_CHECK_LIB(gpm, Gpm_Repeat,
329 [AC_DEFINE(HAVE_LIBGPM, 1,
330 [Define to enable gpm mouse support on Linux])
331 mouse_lib="gpm and xterm"
332 MCLIBS="$MCLIBS -lgpm"],
333 if test "x$with_gpm_mouse" = "xyes"; then
334 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
336 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
344 dnl ############################################################################
346 dnl ############################################################################
348 LIBMC_VERSION="0.0.1"
350 AC_SUBST(LIBMC_VERSION)
351 AC_SUBST(LIBMC_RELEASE)
353 AC_ARG_ENABLE([mclib],
354 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
356 if test "x$enableval" = "xno" ; then
359 if test "x$enable_shared" = "xno" ; then
360 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
369 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
372 dnl ############################################################################
373 dnl Where config files should be placed
374 dnl ############################################################################
376 AC_ARG_WITH([homedir],
377 AS_HELP_STRING([--with-homedir],
378 [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
380 dnl Unfortunately, there is no way to tell AC_ARG_WITH that the
381 dnl argument value is required, so we can't differentiate
382 dnl between `--with-homedir` and `--with-homedir=yes`, because
383 dnl `with_homedir` is set to `yes` in both cases.
385 dnl We opt to set `with_homedir` to `.mc` if the value is `yes`
386 dnl in order to avoid the surprise for users using
387 dnl `--with-homedir` w/o any value and then getting mc to store
388 dnl settings in the `yes` directory.
390 if test "x$withval" = "xXDG"; then
392 elif test "x$withval" = "xyes"; then
395 with_homedir=$withval
401 if test x$with_homedir = xXDG; then
402 AC_DEFINE(MC_HOMEDIR_XDG, 1, [Define to enable XDG standard support])
404 AC_DEFINE(MC_HOMEDIR_XDG, 0, [Define to disable XDG standard support])
405 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
409 dnl ############################################################################
411 dnl ############################################################################
415 mc_WITH_INTERNAL_EDIT
417 dnl Diff viewer support.
418 AC_ARG_WITH([diff_viewer],
419 AS_HELP_STRING([--with-diff-viewer], [Compile with diff viewer @<:@yes@:>@]))
421 if test x$with_diff_viewer != xno; then
422 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
425 AC_MSG_NOTICE([using diff viewer])
434 dnl ############################################################################
436 dnl ############################################################################
438 dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
439 dnl Let define ${prefix} and ${exec_prefix}
440 test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
441 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
443 if test x${libexecdir} = x'${exec_prefix}/libexec'; then
444 EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
445 elif test x${libexecdir} = x'${exec_prefix}/lib'; then
446 EXTHELPERSDIR=${prefix}/lib/${PACKAGE}/ext.d
448 EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
450 AC_SUBST(EXTHELPERSDIR)
453 dnl ############################################################################
455 dnl ############################################################################
457 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
460 dnl Determine which help translations we want to install.
461 ALL_DOC_LINGUAS="es hu it pl ru sr"
464 if test "x$USE_NLS" = xyes; then
465 if test -z "$LINGUAS"; then
466 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
474 for h_lang in $ALL_DOC_LINGUAS; do
475 for lang in $langs; do
476 if test "$lang" = "$h_lang"; then
477 DOC_LINGUAS="$DOC_LINGUAS $lang"
482 AC_SUBST(DOC_LINGUAS)
492 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
495 dnl ############################################################################
496 dnl Configure results
497 dnl ############################################################################
499 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
507 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
508 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
509 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
510 AM_CONDITIONAL(USE_INTERNAL_EDIT, [test x"$use_internal_edit" = xyes ])
511 AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ])
512 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
513 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
514 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
515 dnl Clarify do we really need GModule
516 AM_CONDITIONAL([HAVE_GMODULE], [test -n "$g_module_supported" && \
517 test x"$textmode_x11_support" = x"yes" -o x"$enable_aspell" = x"yes"])
519 AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
526 chmod +x src/man2hlp/man2hlp
533 contrib/dist/Makefile
534 contrib/dist/gentoo/Makefile
535 contrib/dist/redhat/Makefile
536 contrib/dist/redhat/mc.spec
538 contrib/dist/prototype
549 misc/macros.d/Makefile
553 src/consaver/Makefile
556 src/subshell/Makefile
558 src/diffviewer/Makefile
559 src/filemanager/Makefile
563 src/vfs/cpio/Makefile
565 src/vfs/extfs/Makefile
566 src/vfs/extfs/helpers/Makefile
567 src/vfs/extfs/helpers/a+
568 src/vfs/extfs/helpers/apt+
569 src/vfs/extfs/helpers/audio
570 src/vfs/extfs/helpers/deb
571 src/vfs/extfs/helpers/deba
572 src/vfs/extfs/helpers/debd
573 src/vfs/extfs/helpers/dpkg+
574 src/vfs/extfs/helpers/iso9660
575 src/vfs/extfs/helpers/hp48+
576 src/vfs/extfs/helpers/lslR
577 src/vfs/extfs/helpers/mailfs
578 src/vfs/extfs/helpers/patchfs
579 src/vfs/extfs/helpers/rpms+
580 src/vfs/extfs/helpers/s3+
581 src/vfs/extfs/helpers/uace
582 src/vfs/extfs/helpers/ualz
583 src/vfs/extfs/helpers/uar
584 src/vfs/extfs/helpers/uarc
585 src/vfs/extfs/helpers/uarj
586 src/vfs/extfs/helpers/uc1541
587 src/vfs/extfs/helpers/ucab
588 src/vfs/extfs/helpers/uha
589 src/vfs/extfs/helpers/ulha
590 src/vfs/extfs/helpers/ulib
591 src/vfs/extfs/helpers/urar
592 src/vfs/extfs/helpers/uzip
593 src/vfs/extfs/helpers/uzoo
595 src/vfs/fish/Makefile
596 src/vfs/fish/helpers/Makefile
598 src/vfs/ftpfs/Makefile
600 src/vfs/sftpfs/Makefile
602 src/vfs/local/Makefile
606 src/vfs/smbfs/Makefile
610 src/vfs/undelfs/Makefile
614 lib/filehighlight/Makefile
615 lib/mcconfig/Makefile
631 doc/hints/l10n/Makefile
656 tests/lib/mcconfig/Makefile
657 tests/lib/search/Makefile
658 tests/lib/strutil/Makefile
659 tests/lib/vfs/Makefile
660 tests/lib/widget/Makefile
662 tests/src/filemanager/Makefile
663 tests/src/editor/Makefile
664 tests/src/editor/test-data.txt
665 tests/src/vfs/Makefile
666 tests/src/vfs/extfs/Makefile
667 tests/src/vfs/extfs/helpers-list/Makefile
668 tests/src/vfs/extfs/helpers-list/data/config.sh
669 tests/src/vfs/extfs/helpers-list/misc/Makefile
678 Source code location: ${srcdir}
680 Compiler flags: ${CFLAGS}
681 Assertions: ${enable_assert}
682 Unit tests: ${tests_msg}
683 File system: ${vfs_type}
685 Screen library: ${screen_msg}
686 Mouse support: ${mouse_lib}
687 X11 events support: ${textmode_x11_support}
688 With subshell support: ${subshell}
689 With background operations: ${enable_background}
690 Internal editor: ${edit_msg}
691 Diff viewer: ${diff_msg}
692 Support for charset: ${charset_msg}
693 Search type: ${SEARCH_TYPE}
696 dnl option checking is disable by default due to AC_CONFIG_SUBDIRS
697 dnl we enable it back for top-level ./configure
698 if test -n "$ac_unrecognized_opts"; then
699 case $enable_option_checking in
700 fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
701 *) AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;