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])
56 AC_ARG_ENABLE([mclib],
57 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
59 if test "x$enableval" = "xno" ; then
62 if test "x$enable_shared" = "xno" ; then
63 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
72 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
76 dnl Check this before type sizeof checks
80 AC_CHECK_TOOL(AR, ar, ar)
82 dnl Only list browsers here that can be run in background (i.e. with `&')
83 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
86 dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
87 dnl We use only part of the functionality of mmap, so on AIX,
88 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
91 [ --with-mmap Use the mmap call [[yes if found]]])
92 if test x$with_mmap != xno; then
93 if test x$with_mmap = x; then
96 AC_DEFINE(HAVE_MMAP, 1)
101 dnl Internationalization
103 AM_GNU_GETTEXT(no-libtool, need-ngettext)
104 AM_GNU_GETTEXT_VERSION(0.14.3)
106 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
107 CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
110 dnl Determine which help translations we want to install.
111 ALL_DOC_LINGUAS="es hu it pl ru sr"
114 if test "x$USE_NLS" = xyes; then
115 if test -z "$LINGUAS"; then
116 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
124 for h_lang in $ALL_DOC_LINGUAS; do
125 for lang in $langs; do
126 if test "$lang" = "$h_lang"; then
127 DOC_LINGUAS="$DOC_LINGUAS $lang"
132 AC_SUBST(DOC_LINGUAS)
135 dnl OS specific flags.
141 AC_DEFINE(_POSIX_SOURCE)
146 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
147 utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
148 sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
149 sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
155 dnl Missing structure components
156 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
160 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)
215 dnl Used to read keyboard modifiers when running under X11.
219 dnl Sequent wants getprocessstats
221 AC_CHECK_LIB(seq, get_process_stats, [
223 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
224 [Define if you have function `get_process_stats' and
225 have to use that instead of gettimeofday])])
230 dnl Check for gpm mouse support (Linux only)
232 mouse_lib="xterm only"
233 AC_ARG_WITH(gpm-mouse,
234 [ --with-gpm-mouse Compile with gpm mouse support (Linux only)
239 if test x$with_gpm_mouse != xno; then
240 AC_CHECK_LIB(gpm, Gpm_Repeat,
241 [AC_DEFINE(HAVE_LIBGPM, 1,
242 [Define to enable gpm mouse support on Linux])
243 mouse_lib="gpm and xterm"
244 MCLIBS="$MCLIBS -lgpm"],
245 if test "x$with_gpm_mouse" = "xyes"; then
246 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
248 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
258 dnl Check nroff and the options it supports
260 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
267 AC_MSG_CHECKING([for manual formatting macros])
268 AC_CACHE_VAL(mc_cv_mandoc, [
269 nroff -mandoc < /dev/null > /dev/null 2>&1
277 AC_MSG_RESULT([$MANDOC])
279 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
280 AC_CACHE_VAL(mc_cv_man_nocolor, [
281 nroff -c < /dev/null > /dev/null 2>&1
288 MAN_FLAGS=$mc_cv_man_nocolor
289 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
291 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
292 AC_CACHE_VAL(mc_cv_nroff_tascii, [
294 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
296 mc_cv_nroff_tascii=-Tlatin1
298 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
300 mc_cv_nroff_tascii=-Tascii
304 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
305 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
313 dnl Check for -L option to file
315 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
316 if $HAVE_FILECMD; then
317 AC_MSG_CHECKING([for -L option to file command])
318 AC_CACHE_VAL(mc_cv_filel, [
319 file -L . > /dev/null 2>&1
326 if test x$mc_cv_filel = xyes; then
327 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
330 AC_MSG_RESULT([$filel])
334 AC_MSG_CHECKING([for subshell support])
335 AC_ARG_WITH(subshell,
336 [ --with-subshell Compile in concurrent subshell [[yes]]
337 --with-subshell=optional Don't run concurrent shell by default [[no]]],
339 if test x$withval = xoptional
341 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
342 [Define to make subshell support optional])
345 if test x$withval = xyes
349 [dnl Default: enable the subshell support
352 if test "x$result" != xno; then
353 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
354 [Define to enable subshell support])
356 AC_MSG_RESULT([$result])
364 dnl Diff viewer support.
366 AC_ARG_WITH(diff_viewer,
367 [ --with-diff-viewer Compile with diff viewer [[yes]]])
369 if test x$with_diff_viewer != xno; then
370 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
373 AC_MSG_NOTICE([using diff viewer])
379 dnl Check if the OS is supported by the console saver.
388 dnl Where config files should be placed
391 AC_ARG_WITH([homedir],
392 AS_HELP_STRING([--with-homedir], [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
394 if test "x$withval" = "xXDG"; then
397 with_homedir=$withval
403 if test x$with_homedir = xXDG; then
404 AC_DEFINE(MC_HOMEDIR_XDG, 1,
405 [Define to enable XDG standard support])
407 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
415 dnl User visible support for charset conversion.
417 AC_ARG_ENABLE([charset],
418 [ --enable-charset Support for charset selection and conversion [[yes]]])
421 if test "x$enable_charset" != "xno"; then
422 AC_DEFINE(HAVE_CHARSET, 1,
423 [Define to enable charset selection and conversion])
428 if test "$GLIBC21" != yes; then
429 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
436 if test "x$CFLAGS" = "x"; then
440 if test x$USE_MAINTAINER_MODE = xyes; then
441 CFLAGS_OPTS="-g3 -O -ggdb"
442 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
447 AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors])
450 if test "x$enable_werror" = xyes; then
451 MC_CHECK_ONE_CFLAG([-Werror])
453 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
462 dnl Libraries used only when building the mc binary
466 if test x${libexecdir} = x'${exec_prefix}/libexec'; then
467 EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
469 EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
471 AC_SUBST(EXTHELPERSDIR)
473 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
476 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
477 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
478 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
479 AM_CONDITIONAL(USE_EDIT, [test x"$use_edit" = xyes ])
480 AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ])
481 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
482 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
483 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
490 chmod +x src/man2hlp/man2hlp
497 contrib/dist/Makefile
498 contrib/dist/debian/Makefile
499 contrib/dist/gentoo/Makefile
500 contrib/dist/redhat/Makefile
501 contrib/dist/redhat/mc.spec
503 contrib/dist/prototype
512 misc/macros.d/Makefile
516 src/consaver/Makefile
520 src/diffviewer/Makefile
521 src/filemanager/Makefile
525 src/vfs/cpio/Makefile
527 src/vfs/extfs/Makefile
528 src/vfs/extfs/helpers/Makefile
529 src/vfs/extfs/helpers/a+
530 src/vfs/extfs/helpers/apt+
531 src/vfs/extfs/helpers/audio
532 src/vfs/extfs/helpers/deb
533 src/vfs/extfs/helpers/deba
534 src/vfs/extfs/helpers/debd
535 src/vfs/extfs/helpers/dpkg+
536 src/vfs/extfs/helpers/iso9660
537 src/vfs/extfs/helpers/hp48+
538 src/vfs/extfs/helpers/lslR
539 src/vfs/extfs/helpers/mailfs
540 src/vfs/extfs/helpers/patchfs
541 src/vfs/extfs/helpers/rpms+
542 src/vfs/extfs/helpers/s3+
543 src/vfs/extfs/helpers/uace
544 src/vfs/extfs/helpers/ualz
545 src/vfs/extfs/helpers/uar
546 src/vfs/extfs/helpers/uarc
547 src/vfs/extfs/helpers/uarj
548 src/vfs/extfs/helpers/uc1541
549 src/vfs/extfs/helpers/ucab
550 src/vfs/extfs/helpers/uha
551 src/vfs/extfs/helpers/ulha
552 src/vfs/extfs/helpers/ulib
553 src/vfs/extfs/helpers/urar
554 src/vfs/extfs/helpers/uzip
555 src/vfs/extfs/helpers/uzoo
557 src/vfs/fish/Makefile
558 src/vfs/fish/helpers/Makefile
560 src/vfs/ftpfs/Makefile
562 src/vfs/sftpfs/Makefile
564 src/vfs/local/Makefile
568 src/vfs/smbfs/Makefile
572 src/vfs/undelfs/Makefile
576 lib/filehighlight/Makefile
577 lib/mcconfig/Makefile
611 if test x$enable_tests != xno; then
615 tests/lib/mcconfig/Makefile
616 tests/lib/search/Makefile
617 tests/lib/vfs/Makefile
619 tests/src/filemanager/Makefile
630 Source code location: ${srcdir}
632 Compiler flags: ${CFLAGS}
633 File system: ${vfs_type}
635 Screen library: ${screen_msg}
636 Mouse support: ${mouse_lib}
637 X11 events support: ${textmode_x11_support}
638 With subshell support: ${subshell}
639 With background operations: ${enable_background}
640 Internal editor: ${edit_msg}
641 Diff viewer: ${diff_msg}
642 Support for charset: ${charset_msg}
643 Search type: ${SEARCH_TYPE}