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])
33 AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
34 AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
51 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
53 dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
57 AC_ARG_ENABLE([mclib],
58 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
60 if test "x$enableval" = "xno" ; then
63 if test "x$enable_shared" = "xno" ; then
64 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
73 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
77 dnl Check this before type sizeof checks
81 AC_CHECK_TOOL(AR, ar, ar)
83 dnl Only list browsers here that can be run in background (i.e. with `&')
84 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
87 dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
88 dnl We use only part of the functionality of mmap, so on AIX,
89 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
92 [ --with-mmap Use the mmap call [[yes if found]]])
93 if test x$with_mmap != xno; then
94 if test x$with_mmap = x; then
97 AC_DEFINE(HAVE_MMAP, 1)
102 dnl Internationalization
104 AM_GNU_GETTEXT(no-libtool, need-ngettext)
105 AM_GNU_GETTEXT_VERSION(0.14.3)
107 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
108 CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
111 dnl Determine which help translations we want to install.
112 ALL_DOC_LINGUAS="es hu it pl ru sr"
115 if test "x$USE_NLS" = xyes; then
116 if test -z "$LINGUAS"; then
117 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
125 for h_lang in $ALL_DOC_LINGUAS; do
126 for lang in $langs; do
127 if test "$lang" = "$h_lang"; then
128 DOC_LINGUAS="$DOC_LINGUAS $lang"
133 AC_SUBST(DOC_LINGUAS)
136 dnl OS specific flags.
142 AC_DEFINE(_POSIX_SOURCE)
147 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
148 utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
149 sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
150 sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
156 dnl Missing structure components
157 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
161 dnl Check availability of some functions
167 tcgetattr tcsetattr \
175 dnl getpt is a GNU Extension (glibc 2.1.x)
177 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
178 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
180 dnl replacing lstat with statlstat on sco makes it more portable between
182 AC_CHECK_FUNCS(statlstat)
185 dnl If running under AIX, AC_AIX does not tell us that
187 AC_MSG_CHECKING([for AIX defines])
189 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
193 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
195 ], [AC_MSG_RESULT(no)])
198 dnl Missing typedefs and replacements
201 AC_CHECK_SIZEOF(long)
203 AC_CHECK_SIZEOF(uintmax_t)
205 AC_CHECK_SIZEOF(off_t)
210 AH_TEMPLATE([sig_atomic_t],
211 [/* Define to `int' if <signal.h> doesn't define.])
212 AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
213 [Some systems declare sig_atomic_t as volatile, some others -- no.
214 This define will have value `sig_atomic_t' or
215 `volatile sig_atomic_t' accordingly.])
217 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
218 AC_EGREP_HEADER(sig_atomic_t,signal.h,
220 ac_cv_type_sig_atomic_t=yes;
221 AC_EGREP_HEADER(volatile.*sig_atomic_t,
224 is_sig_atomic_t_volatile=yes;
225 AC_MSG_RESULT([yes, volatile])
228 is_sig_atomic_t_volatile=no;
229 AC_MSG_RESULT([yes, non volatile])
234 AC_CHECK_TYPE(sig_atomic_t, int)
235 is_sig_atomic_t_volatile=no
237 if test $is_sig_atomic_t_volatile = 'yes'
239 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
241 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
250 dnl Used to read keyboard modifiers when running under X11.
254 dnl Check if the gmodule functionality supported on this system.
255 AC_G_MODULE_SUPPORTED
258 dnl Sequent wants getprocessstats
260 AC_CHECK_LIB(seq, get_process_stats, [
262 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
263 [Define if you have function `get_process_stats' and
264 have to use that instead of gettimeofday])])
269 dnl Check for gpm mouse support (Linux only)
271 mouse_lib="xterm only"
272 AC_ARG_WITH(gpm-mouse,
273 [ --with-gpm-mouse Compile with gpm mouse support (Linux only)
278 if test x$with_gpm_mouse != xno; then
279 AC_CHECK_LIB(gpm, Gpm_Repeat,
280 [AC_DEFINE(HAVE_LIBGPM, 1,
281 [Define to enable gpm mouse support on Linux])
282 mouse_lib="gpm and xterm"
283 MCLIBS="$MCLIBS -lgpm"],
284 if test "x$with_gpm_mouse" = "xyes"; then
285 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
287 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
297 dnl Check nroff and the options it supports
299 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
306 AC_MSG_CHECKING([for manual formatting macros])
307 AC_CACHE_VAL(mc_cv_mandoc, [
308 nroff -mandoc < /dev/null > /dev/null 2>&1
316 AC_MSG_RESULT([$MANDOC])
318 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
319 AC_CACHE_VAL(mc_cv_man_nocolor, [
320 nroff -c < /dev/null > /dev/null 2>&1
327 MAN_FLAGS=$mc_cv_man_nocolor
328 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
330 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
331 AC_CACHE_VAL(mc_cv_nroff_tascii, [
333 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
335 mc_cv_nroff_tascii=-Tlatin1
337 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
339 mc_cv_nroff_tascii=-Tascii
343 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
344 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
352 dnl Check for -L option to file
354 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
355 if $HAVE_FILECMD; then
356 AC_MSG_CHECKING([for -L option to file command])
357 AC_CACHE_VAL(mc_cv_filel, [
358 file -L . > /dev/null 2>&1
365 if test x$mc_cv_filel = xyes; then
366 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
369 AC_MSG_RESULT([$filel])
373 AC_MSG_CHECKING([for subshell support])
374 AC_ARG_WITH(subshell,
375 [ --with-subshell Compile in concurrent subshell [[yes]]
376 --with-subshell=optional Don't run concurrent shell by default [[no]]],
378 if test x$withval = xoptional
380 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
381 [Define to make subshell support optional])
384 if test x$withval = xyes
388 [dnl Default: enable the subshell support
391 if test "x$result" != xno; then
392 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
393 [Define to enable subshell support])
395 AM_CONDITIONAL(HAVE_SUBSHELL_SUPPORT, [test "x$result" != xno])
396 AC_MSG_RESULT([$result])
404 dnl Internal editor support.
407 [ --with-edit Enable internal editor [[yes]]])
409 if test x$with_edit != xno; then
410 AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
413 AC_MSG_NOTICE([using internal editor])
419 dnl Diff viewer support.
421 AC_ARG_WITH(diff_viewer,
422 [ --with-diff-viewer Compile with diff viewer [[yes]]])
424 if test x$with_diff_viewer != xno; then
425 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
428 AC_MSG_NOTICE([using diff viewer])
434 dnl Check if the OS is supported by the console saver.
443 dnl Where config files should be placed
446 AC_ARG_WITH([homedir],
447 AS_HELP_STRING([--with-homedir], [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
449 if test "x$withval" = "xXDG"; then
452 with_homedir=$withval
458 if test x$with_homedir = xXDG; then
459 AC_DEFINE(MC_HOMEDIR_XDG, 1,
460 [Define to enable XDG standard support])
462 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
470 dnl User visible support for charset conversion.
472 AC_ARG_ENABLE([charset],
473 [ --enable-charset Support for charset selection and conversion [[yes]]])
476 if test "x$enable_charset" != "xno"; then
477 AC_DEFINE(HAVE_CHARSET, 1,
478 [Define to enable charset selection and conversion])
483 if test "$GLIBC21" != yes; then
484 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
491 if test "x$CFLAGS" = "x"; then
495 if test x$USE_MAINTAINER_MODE = xyes; then
496 CFLAGS_OPTS="-g3 -O -ggdb"
497 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
502 AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors])
505 if test "x$enable_werror" = xyes; then
506 MC_CHECK_ONE_CFLAG([-Werror])
508 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
517 dnl Libraries used only when building the mc binary
520 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
523 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
524 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
525 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
526 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
527 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
528 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
529 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
536 chmod +x src/man2hlp/man2hlp
543 contrib/dist/Makefile
544 contrib/dist/gentoo/Makefile
545 contrib/dist/redhat/Makefile
546 contrib/dist/redhat/mc.spec
548 contrib/dist/prototype
552 misc/macros.d/Makefile
556 src/consaver/Makefile
560 src/diffviewer/Makefile
561 src/filemanager/Makefile
565 src/vfs/cpio/Makefile
567 src/vfs/extfs/Makefile
568 src/vfs/extfs/helpers/Makefile
569 src/vfs/extfs/helpers/a+
570 src/vfs/extfs/helpers/apt+
571 src/vfs/extfs/helpers/audio
572 src/vfs/extfs/helpers/deb
573 src/vfs/extfs/helpers/deba
574 src/vfs/extfs/helpers/debd
575 src/vfs/extfs/helpers/dpkg+
576 src/vfs/extfs/helpers/iso9660
577 src/vfs/extfs/helpers/hp48+
578 src/vfs/extfs/helpers/lslR
579 src/vfs/extfs/helpers/mailfs
580 src/vfs/extfs/helpers/patchfs
581 src/vfs/extfs/helpers/rpms+
582 src/vfs/extfs/helpers/s3+
583 src/vfs/extfs/helpers/uace
584 src/vfs/extfs/helpers/ualz
585 src/vfs/extfs/helpers/uar
586 src/vfs/extfs/helpers/uarc
587 src/vfs/extfs/helpers/uarj
588 src/vfs/extfs/helpers/uc1541
589 src/vfs/extfs/helpers/ucab
590 src/vfs/extfs/helpers/uha
591 src/vfs/extfs/helpers/ulha
592 src/vfs/extfs/helpers/urar
593 src/vfs/extfs/helpers/uzip
594 src/vfs/extfs/helpers/uzoo
596 src/vfs/fish/Makefile
597 src/vfs/fish/helpers/Makefile
599 src/vfs/ftpfs/Makefile
601 src/vfs/local/Makefile
605 src/vfs/smbfs/Makefile
609 src/vfs/undelfs/Makefile
613 lib/filehighlight/Makefile
614 lib/mcconfig/Makefile
649 if test x$enable_tests != xno; then
653 tests/lib/mcconfig/Makefile
654 tests/lib/search/Makefile
655 tests/lib/vfs/Makefile
657 tests/src/filemanager/Makefile
668 Source code location: ${srcdir}
670 Compiler flags: ${CFLAGS}
671 File system: ${vfs_type}
673 Screen library: ${screen_msg}
674 Mouse support: ${mouse_lib}
675 X11 events support: ${textmode_x11_support}
676 With subshell support: ${subshell}
677 With background operations: ${enable_background}
678 Internal editor: ${edit_msg}
679 Diff viewer: ${diff_msg}
680 Support for charset: ${charset_msg}
681 Search type: ${SEARCH_TYPE}