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 Missing typedefs and replacements
190 AC_CHECK_SIZEOF(long)
192 AC_CHECK_SIZEOF(uintmax_t)
194 AC_CHECK_SIZEOF(off_t)
198 AC_CHECK_TYPE(nlink_t, unsigned int)
199 AC_CHECK_TYPES([socklen_t],,,
201 #include <sys/types.h>
202 #include <sys/socket.h>
205 dnl This is needed for regex.c only
206 AC_CHECK_TYPE(uintptr_t,
207 [AC_DEFINE(HAVE_UINTPTR_T, 1,
208 [Define if you have the `uintptr_t' type.])
215 dnl This is from GNU fileutils, check aclocal.m4 for more information
216 dnl uintmat_t is required for FS info
222 dnl Used to read keyboard modifiers when running under X11.
225 dnl Check if the gmodule functionality supported on this system.
226 AC_G_MODULE_SUPPORTED
229 dnl Try to find static libraries for glib and gmodule.
231 if test x$with_glib_static = xyes; then
233 for i in $GLIB_LIBS; do
244 if test -n "$lib"; then
245 lib1=`echo $i | sed 's/^-l//'`
246 if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then
247 add="$GLIB_LIBDIR/lib${lib1}.a"
249 if test -f "$GLIB_LIBDIR/lib${lib}.a"; then
250 add="$GLIB_LIBDIR/lib${lib}.a"
252 AC_MSG_ERROR([Cannot find static $lib])
256 new_GLIB_LIBS="$new_GLIB_LIBS $add"
258 GLIB_LIBS="$new_GLIB_LIBS"
262 dnl Sequent wants getprocessstats
264 AC_CHECK_LIB(seq, get_process_stats, [
266 AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
267 [Define if you have function `get_process_stats' and
268 have to use that instead of gettimeofday])])
273 dnl Check for gpm mouse support (Linux only)
275 mouse_lib="xterm only"
276 AC_ARG_WITH(gpm-mouse,
277 [ --with-gpm-mouse Compile with gpm mouse support (Linux only)
282 if test x$with_gpm_mouse != xno; then
283 AC_CHECK_LIB(gpm, Gpm_Repeat,
284 [AC_DEFINE(HAVE_LIBGPM, 1,
285 [Define to enable gpm mouse support on Linux])
286 mouse_lib="gpm and xterm"
287 MCLIBS="$MCLIBS -lgpm"],
288 if test "x$with_gpm_mouse" = "xyes"; then
289 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
291 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
301 dnl Check nroff and the options it supports
303 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
310 AC_MSG_CHECKING([for manual formatting macros])
311 AC_CACHE_VAL(mc_cv_mandoc, [
312 nroff -mandoc < /dev/null > /dev/null 2>&1
320 AC_MSG_RESULT([$MANDOC])
322 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
323 AC_CACHE_VAL(mc_cv_man_nocolor, [
324 nroff -c < /dev/null > /dev/null 2>&1
331 MAN_FLAGS=$mc_cv_man_nocolor
332 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
334 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
335 AC_CACHE_VAL(mc_cv_nroff_tascii, [
337 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
339 mc_cv_nroff_tascii=-Tlatin1
341 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
343 mc_cv_nroff_tascii=-Tascii
347 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
348 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
356 dnl Check for -L option to file
358 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
359 if $HAVE_FILECMD; then
360 AC_MSG_CHECKING([for -L option to file command])
361 AC_CACHE_VAL(mc_cv_filel, [
362 file -L . > /dev/null 2>&1
369 if test x$mc_cv_filel = xyes; then
370 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
373 AC_MSG_RESULT([$filel])
377 AC_MSG_CHECKING([for subshell support])
378 AC_ARG_WITH(subshell,
379 [ --with-subshell Compile in concurrent subshell [[yes]]
380 --with-subshell=optional Don't run concurrent shell by default [[no]]],
382 if test x$withval = xoptional
384 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
385 [Define to make subshell support optional])
388 if test x$withval = xyes
392 [dnl Default: enable the subshell support
395 if test "x$result" != xno; then
396 AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
397 [Define to enable subshell support])
399 AC_MSG_RESULT([$result])
407 dnl Internal editor support.
410 [ --with-edit Enable internal editor [[yes]]])
412 if test x$with_edit != xno; then
413 AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
416 AC_MSG_NOTICE([using internal editor])
422 dnl Diff viewer support.
424 AC_ARG_WITH(diff_viewer,
425 [ --with-diff-viewer Compile with diff viewer [[yes]]])
427 if test x$with_diff_viewer != xno; then
428 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
431 AC_MSG_NOTICE([using diff viewer])
437 dnl Check if the OS is supported by the console saver.
445 dnl Support for background operations
446 AC_ARG_ENABLE([background],
447 [ --enable-background Support for background file operations [[yes]]])
448 if test "x$enable_background" != xno; then
449 AC_DEFINE(WITH_BACKGROUND, 1, [Define to enable background file operations])
454 dnl User visible support for charset conversion.
456 AC_ARG_ENABLE([charset],
457 [ --enable-charset Support for charset selection and conversion [[yes]]])
460 if test "x$enable_charset" != "xno"; then
461 AC_DEFINE(HAVE_CHARSET, 1,
462 [Define to enable charset selection and conversion])
467 if test "$GLIBC21" != yes; then
468 AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
475 if test "x$CFLAGS" = "x"; then
479 if test x$USE_MAINTAINER_MODE = xyes; then
480 CFLAGS_OPTS="-g3 -O -ggdb"
481 AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
486 AC_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors] )
489 if test "x$enable_werror" = xyes; then
490 MC_CHECK_ONE_CFLAG([-Werror])
492 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
499 dnl Libraries used only when building the mc binary
502 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
505 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
506 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
507 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
508 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
509 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
510 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
511 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
518 chmod +x src/man2hlp/man2hlp
525 contrib/dist/Makefile
526 contrib/dist/debian/Makefile
527 contrib/dist/gentoo/Makefile
528 contrib/dist/redhat/Makefile
529 contrib/dist/redhat/mc.spec
531 contrib/dist/prototype
538 src/consaver/Makefile
542 src/diffviewer/Makefile
543 src/filemanager/Makefile
546 lib/filehighlight/Makefile
547 lib/mcconfig/Makefile
553 lib/vfs/mc-vfs/Makefile
554 lib/vfs/mc-vfs/extfs/Makefile
555 lib/vfs/mc-vfs/extfs/a+
556 lib/vfs/mc-vfs/extfs/apt+
557 lib/vfs/mc-vfs/extfs/audio
558 lib/vfs/mc-vfs/extfs/deb
559 lib/vfs/mc-vfs/extfs/deba
560 lib/vfs/mc-vfs/extfs/debd
561 lib/vfs/mc-vfs/extfs/dpkg+
562 lib/vfs/mc-vfs/extfs/iso9660
563 lib/vfs/mc-vfs/extfs/hp48+
564 lib/vfs/mc-vfs/extfs/lslR
565 lib/vfs/mc-vfs/extfs/mailfs
566 lib/vfs/mc-vfs/extfs/patchfs
567 lib/vfs/mc-vfs/extfs/rpms+
568 lib/vfs/mc-vfs/extfs/s3+
569 lib/vfs/mc-vfs/extfs/uace
570 lib/vfs/mc-vfs/extfs/ualz
571 lib/vfs/mc-vfs/extfs/uar
572 lib/vfs/mc-vfs/extfs/uarc
573 lib/vfs/mc-vfs/extfs/uarj
574 lib/vfs/mc-vfs/extfs/uc1541
575 lib/vfs/mc-vfs/extfs//ucab
576 lib/vfs/mc-vfs/extfs/uha
577 lib/vfs/mc-vfs/extfs/ulha
578 lib/vfs/mc-vfs/extfs/urar
579 lib/vfs/mc-vfs/extfs/uzip
580 lib/vfs/mc-vfs/extfs/uzoo
581 lib/vfs/mc-vfs/fish/Makefile
588 doc/man/mc.1 doc/man/mcedit.1 doc/man/mcview.1 doc/man/Makefile
589 doc/man/es/mc.1 doc/man/es/Makefile
590 doc/man/hu/mc.1 doc/man/hu/Makefile
591 doc/man/it/mc.1 doc/man/it/Makefile
592 doc/man/pl/mc.1 doc/man/pl/Makefile
593 doc/man/ru/mc.1 doc/man/ru/Makefile
594 doc/man/sr/mc.1 doc/man/sr/Makefile
613 Source code location: ${srcdir}
615 Compiler flags: ${CFLAGS}
616 File system: ${vfs_type}
618 Screen library: ${screen_msg}
619 Mouse support: ${mouse_lib}
620 X11 events support: ${textmode_x11_support}
621 With subshell support: ${subshell}
622 Internal editor: ${edit_msg}
623 Diff viewer: ${diff_msg}
624 Support for charset: ${charset_msg}
625 Search type: ${SEARCH_TYPE}