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} )
14 dnl Enable silent rules by default (if yes)
15 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17 AM_CONFIG_HEADER(config.h)
21 AC_USE_SYSTEM_EXTENSIONS
25 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
42 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
44 dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
47 dnl First try glib 2.x.
48 dnl Keep this check close to the beginning, so that the users
49 dnl without any glib won't have their time wasted by other checks.
52 AC_ARG_WITH([glib_static],
53 [ --with-glib-static Link glib statically [[no]]])
57 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.8], [glib_found=yes], [:])
58 if test x"$glib_found" = xno; then
59 AC_MSG_ERROR([glib-2.0 not found or version too old (must be >= 2.8)])
68 AC_CHECK_TOOL(AR, ar, ar)
70 dnl Only list browsers here that can be run in background (i.e. with `&')
71 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
74 dnl Ovverriding mmap support. This has to be before AC_FUNC_MMAP is used.
75 dnl We use only part of the functionality of mmap, so on AIX,
76 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
79 [ --with-mmap Use the mmap call [[yes if found]]])
80 if test x$with_mmap != xno; then
81 if test x$with_mmap = x; then
84 AC_DEFINE(HAVE_MMAP, 1)
89 dnl Internationalization
91 AM_GNU_GETTEXT(no-libtool, need-ngettext)
92 AM_GNU_GETTEXT_VERSION(0.14.3)
94 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
95 CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
98 dnl Determine which help translations we want to install.
99 ALL_DOC_LINGUAS="es hu it pl ru sr"
102 if test "x$USE_NLS" = xyes; then
103 if test -z "$LINGUAS"; then
104 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
112 for h_lang in $ALL_DOC_LINGUAS; do
113 for lang in $langs; do
114 if test "$lang" = "$h_lang"; then
115 DOC_LINGUAS="$DOC_LINGUAS $lang"
120 AC_SUBST(DOC_LINGUAS)
123 dnl OS specific flags.
129 AC_DEFINE(_POSIX_SOURCE)
134 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
135 utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
136 sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
137 security/pam_misc.h sys/socket.h sys/sysmacros.h sys/types.h \
138 sys/mkdev.h wchar.h wctype.h])
144 dnl Missing structure components
145 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
149 dnl Check availability of some functions
156 setreuid statfs sysconf \
157 tcgetattr tcsetattr truncate \
164 dnl getpt is a GNU Extension (glibc 2.1.x)
166 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
167 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
169 dnl replacing lstat with statlstat on sco makes it more portable between
171 AC_CHECK_FUNCS(statlstat)
174 dnl If running under AIX, AC_AIX does not tell us that
176 AC_MSG_CHECKING([for AIX defines])
178 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
182 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
184 ], [AC_MSG_RESULT(no)])
187 dnl This is from GNU fileutils, check aclocal.m4 for more information
192 dnl Missing typedefs and replacements
195 AC_CHECK_SIZEOF(long)
196 AC_CHECK_SIZEOF(long long)
199 AC_CHECK_SIZEOF(off_t)
202 AC_CHECK_TYPE(nlink_t, unsigned int)
203 AC_CHECK_TYPES([socklen_t],,,
205 #include <sys/types.h>
206 #include <sys/socket.h>
209 dnl This is needed for regex.c only
210 AC_CHECK_TYPE(uintptr_t,
211 [AC_DEFINE(HAVE_UINTPTR_T, 1,
212 [Define if you have the `uintptr_t' type.])
220 dnl Used to read keyboard modifiers when running under X11.
223 dnl Check if the gmodule functionality supported on this system.
224 AC_G_MODULE_SUPPORTED
227 dnl Try to find static libraries for glib and gmodule.
229 if test x$with_glib_static = xyes; then
231 for i in $GLIB_LIBS; do
242 if test -n "$lib"; then
243 lib1=`echo $i | sed 's/^-l//'`
244 if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then
245 add="$GLIB_LIBDIR/lib${lib1}.a"
247 if test -f "$GLIB_LIBDIR/lib${lib}.a"; then
248 add="$GLIB_LIBDIR/lib${lib}.a"
250 AC_MSG_ERROR([Cannot find static $lib])
254 new_GLIB_LIBS="$new_GLIB_LIBS $add"
256 GLIB_LIBS="$new_GLIB_LIBS"
260 dnl Sequent wants getprocessstats
262 AC_CHECK_LIB(seq, get_process_stats, [
264 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
265 [Define if you have function `get_process_stats' and
266 have to use that instead of gettimeofday])])
271 dnl Check for gpm mouse support (Linux only)
273 mouse_lib="xterm only"
274 AC_ARG_WITH(gpm-mouse,
275 [ --with-gpm-mouse Compile with gpm mouse support (Linux only)
280 if test x$with_gpm_mouse != xno; then
281 AC_CHECK_LIB(gpm, Gpm_Repeat,
282 [AC_DEFINE(HAVE_LIBGPM, 1,
283 [Define to enable gpm mouse support on Linux])
284 mouse_lib="gpm and xterm"
285 MCLIBS="$MCLIBS -lgpm"],
286 if test "x$with_gpm_mouse" = "xyes"; then
287 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
289 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
299 dnl Check nroff and the options it supports
301 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
308 AC_MSG_CHECKING([for manual formatting macros])
309 AC_CACHE_VAL(mc_cv_mandoc, [
310 nroff -mandoc < /dev/null > /dev/null 2>&1
318 AC_MSG_RESULT([$MANDOC])
320 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
321 AC_CACHE_VAL(mc_cv_man_nocolor, [
322 nroff -c < /dev/null > /dev/null 2>&1
329 MAN_FLAGS=$mc_cv_man_nocolor
330 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
332 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
333 AC_CACHE_VAL(mc_cv_nroff_tascii, [
335 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
337 mc_cv_nroff_tascii=-Tlatin1
339 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
341 mc_cv_nroff_tascii=-Tascii
345 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
346 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
354 dnl Check for -L option to file
356 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
357 if $HAVE_FILECMD; then
358 AC_MSG_CHECKING([for -L option to file command])
359 AC_CACHE_VAL(mc_cv_filel, [
360 file -L . > /dev/null 2>&1
367 if test x$mc_cv_filel = xyes; then
368 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
371 AC_MSG_RESULT([$filel])
375 AC_MSG_CHECKING([for subshell support])
376 AC_ARG_WITH(subshell,
377 [ --with-subshell Compile in concurrent subshell [[yes]]
378 --with-subshell=optional Don't run concurrent shell by default [[no]]],
380 if test x$withval = xoptional
382 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
383 [Define to make subshell support optional])
386 if test x$withval = xyes
390 [dnl Default: enable the subshell support
393 if test "x$result" != xno; then
394 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
395 [Define to enable subshell support])
397 AC_MSG_RESULT([$result])
405 dnl Internal editor support.
408 [ --with-edit Enable internal editor [[yes]]])
410 if test x$with_edit != xno; then
411 AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
414 AC_MSG_NOTICE([using internal editor])
420 dnl Diff viewer support.
422 AC_ARG_WITH(diff_viewer,
423 [ --with-diff-viewer Compile with diff viewer [[yes]]])
425 if test x$with_diff_viewer != xno; then
426 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
429 AC_MSG_NOTICE([using diff viewer])
435 dnl Check if the OS is supported by the console saver.
443 dnl Support for background operations
444 AC_ARG_ENABLE([background],
445 [ --enable-background Support for background file operations [[yes]]])
446 if test "x$enable_background" != xno; then
447 AC_DEFINE(WITH_BACKGROUND, 1, [Define to enable background file operations])
452 dnl User visible support for charset conversion.
454 AC_ARG_ENABLE([charset],
455 [ --enable-charset Support for charset selection and conversion [[yes]]])
458 if test "x$enable_charset" != "xno"; then
459 AC_DEFINE(HAVE_CHARSET, 1,
460 [Define to enable charset selection and conversion])
465 if test "$GLIBC21" != yes; then
466 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
473 if test "x$CFLAGS" = "x"; then
477 if test x$USE_MAINTAINER_MODE = xyes; then
478 CFLAGS_OPTS="-g3 -O -ggdb"
479 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
484 AC_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors] )
487 if test "x$enable_werror" = xyes; then
488 MC_CHECK_ONE_CFLAG([-Werror])
490 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
497 dnl Libraries used only when building the mc binary
500 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
503 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
504 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
505 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
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"])
515 chmod +x src/man2hlp/man2hlp
522 contrib/dist/Makefile
523 contrib/dist/debian/Makefile
524 contrib/dist/gentoo/Makefile
525 contrib/dist/redhat/Makefile
526 contrib/dist/redhat/mc.spec
528 contrib/dist/prototype
535 src/consaver/Makefile
539 src/diffviewer/Makefile
540 src/filemanager/Makefile
543 lib/filehighlight/Makefile
544 lib/mcconfig/Makefile
550 lib/vfs/mc-vfs/Makefile
551 lib/vfs/mc-vfs/extfs/Makefile
552 lib/vfs/mc-vfs/extfs/a+
553 lib/vfs/mc-vfs/extfs/apt+
554 lib/vfs/mc-vfs/extfs/audio
555 lib/vfs/mc-vfs/extfs/deb
556 lib/vfs/mc-vfs/extfs/deba
557 lib/vfs/mc-vfs/extfs/debd
558 lib/vfs/mc-vfs/extfs/dpkg+
559 lib/vfs/mc-vfs/extfs/iso9660
560 lib/vfs/mc-vfs/extfs/hp48+
561 lib/vfs/mc-vfs/extfs/lslR
562 lib/vfs/mc-vfs/extfs/mailfs
563 lib/vfs/mc-vfs/extfs/patchfs
564 lib/vfs/mc-vfs/extfs/rpms+
565 lib/vfs/mc-vfs/extfs/s3+
566 lib/vfs/mc-vfs/extfs/uace
567 lib/vfs/mc-vfs/extfs/ualz
568 lib/vfs/mc-vfs/extfs/uar
569 lib/vfs/mc-vfs/extfs/uarc
570 lib/vfs/mc-vfs/extfs/uarj
571 lib/vfs/mc-vfs/extfs/uc1541
572 lib/vfs/mc-vfs/extfs/uha
573 lib/vfs/mc-vfs/extfs/ulha
574 lib/vfs/mc-vfs/extfs/urar
575 lib/vfs/mc-vfs/extfs/uzip
576 lib/vfs/mc-vfs/extfs/uzoo
577 lib/vfs/mc-vfs/fish/Makefile
584 doc/man/mc.1 doc/man/mcedit.1 doc/man/mcview.1 doc/man/Makefile
585 doc/man/es/mc.1 doc/man/es/Makefile
586 doc/man/hu/mc.1 doc/man/hu/Makefile
587 doc/man/it/mc.1 doc/man/it/Makefile
588 doc/man/pl/mc.1 doc/man/pl/Makefile
589 doc/man/ru/mc.1 doc/man/ru/Makefile
590 doc/man/sr/mc.1 doc/man/sr/Makefile
609 Source code location: ${srcdir}
611 Compiler flags: ${CFLAGS}
612 File system: ${vfs_type}
614 Screen library: ${screen_msg}
615 Mouse support: ${mouse_lib}
616 X11 events support: ${textmode_x11_support}
617 With subshell support: ${subshell}
618 Internal editor: ${edit_msg}
619 Diff viewer: ${diff_msg}
620 Support for charset: ${charset_msg}
621 Search type: ${SEARCH_TYPE}