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])
51 dnl ############################################################################
52 dnl Check for programs
53 dnl ############################################################################
58 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
59 AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
60 AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
62 dnl Check nroff and the options it supports
63 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
68 AC_MSG_CHECKING([for manual formatting macros])
69 AC_CACHE_VAL(mc_cv_mandoc, [
70 nroff -mandoc < /dev/null > /dev/null 2>&1
78 AC_MSG_RESULT([$MANDOC])
80 AC_MSG_CHECKING([for option to disable ANSI color in manuals])
81 AC_CACHE_VAL(mc_cv_man_nocolor, [
82 nroff -c < /dev/null > /dev/null 2>&1
89 MAN_FLAGS=$mc_cv_man_nocolor
90 AC_MSG_RESULT([${MAN_NOCOLOR-none}])
92 AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
93 AC_CACHE_VAL(mc_cv_nroff_tascii, [
95 nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
97 mc_cv_nroff_tascii=-Tlatin1
99 nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
101 mc_cv_nroff_tascii=-Tascii
105 AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
106 MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
112 dnl Check for -L option to file
113 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
114 if $HAVE_FILECMD; then
115 AC_MSG_CHECKING([for -L option to file command])
116 AC_CACHE_VAL(mc_cv_filel, [
117 file -L . > /dev/null 2>&1
124 if test x$mc_cv_filel = xyes; then
125 AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
128 AC_MSG_RESULT([$filel])
131 dnl Only list browsers here that can be run in background (i.e. with `&')
132 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
135 dnl ############################################################################
136 dnl Check for other tools
137 dnl ############################################################################
139 AC_CHECK_TOOL(AR, ar, ar)
143 dnl ############################################################################
144 dnl Check for main libraies
145 dnl ############################################################################
148 AC_G_MODULE_SUPPORTED
151 dnl X11 support. Used to read keyboard modifiers when running under X11.
155 dnl ############################################################################
156 dnl Check for header files
157 dnl ############################################################################
159 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
160 utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
161 sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
162 sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
169 dnl ############################################################################
171 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)
187 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
189 AH_TEMPLATE([sig_atomic_t],
190 [/* Define to `int' if <signal.h> doesn't define.])
191 AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
192 [Some systems declare sig_atomic_t as volatile, some others -- no.
193 This define will have value `sig_atomic_t' or
194 `volatile sig_atomic_t' accordingly.])
196 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
197 AC_EGREP_HEADER(sig_atomic_t,signal.h,
199 ac_cv_type_sig_atomic_t=yes;
200 AC_EGREP_HEADER(volatile.*sig_atomic_t,
203 is_sig_atomic_t_volatile=yes;
204 AC_MSG_RESULT([yes, volatile])
207 is_sig_atomic_t_volatile=no;
208 AC_MSG_RESULT([yes, non volatile])
213 AC_CHECK_TYPE(sig_atomic_t, int)
214 is_sig_atomic_t_volatile=no
216 if test $is_sig_atomic_t_volatile = 'yes'
218 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
220 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
224 dnl ############################################################################
225 dnl Check for functions
226 dnl ############################################################################
231 tcgetattr tcsetattr \
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.14.3)
279 dnl ############################################################################
280 dnl OS specific flags
281 dnl ############################################################################
289 AC_DEFINE(_POSIX_SOURCE)
293 dnl If running under AIX, AC_AIX does not tell us that
294 AC_MSG_CHECKING([for AIX defines])
297 #if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
302 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
309 dnl Check if the OS is supported by the console saver.
316 dnl Check for gpm mouse support (Linux only)
317 mouse_lib="xterm only"
318 AC_ARG_WITH([gpm-mouse],
319 AS_HELP_STRING([--with-gpm-mouse], [Compile with gpm mouse support (Linux only) @<:@yes if found@:>@]))
323 if test x$with_gpm_mouse != xno; then
324 AC_CHECK_LIB(gpm, Gpm_Repeat,
325 [AC_DEFINE(HAVE_LIBGPM, 1,
326 [Define to enable gpm mouse support on Linux])
327 mouse_lib="gpm and xterm"
328 MCLIBS="$MCLIBS -lgpm"],
329 if test "x$with_gpm_mouse" = "xyes"; then
330 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
332 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
340 dnl ############################################################################
342 dnl ############################################################################
344 LIBMC_VERSION="0.0.1"
346 AC_SUBST(LIBMC_VERSION)
347 AC_SUBST(LIBMC_RELEASE)
349 AC_ARG_ENABLE([mclib],
350 [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
352 if test "x$enableval" = "xno" ; then
355 if test "x$enable_shared" = "xno" ; then
356 AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
365 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
368 dnl ############################################################################
369 dnl Where config files should be placed
370 dnl ############################################################################
372 AC_ARG_WITH([homedir],
373 AS_HELP_STRING([--with-homedir],
374 [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
376 if test "x$withval" = "xXDG"; then
379 with_homedir=$withval
385 if test x$with_homedir = xXDG; then
386 AC_DEFINE(MC_HOMEDIR_XDG, 1,
387 [Define to enable XDG standard support])
389 AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
393 dnl ############################################################################
395 dnl ############################################################################
399 dnl Diff viewer support.
400 AC_ARG_WITH([diff_viewer],
401 AS_HELP_STRING([--with-diff-viewer], [Compile with diff viewer @<:@yes@:>@]))
403 if test x$with_diff_viewer != xno; then
404 AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
407 AC_MSG_NOTICE([using diff viewer])
416 dnl ############################################################################
418 dnl ############################################################################
420 dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
421 dnl Let define ${prefix} and ${exec_prefix}
422 test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
423 test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
425 if test x${libexecdir} = x'${exec_prefix}/libexec'; then
426 EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
427 elif test x${libexecdir} = x'${exec_prefix}/lib'; then
428 EXTHELPERSDIR=${prefix}/lib/${PACKAGE}/ext.d
430 EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
432 AC_SUBST(EXTHELPERSDIR)
435 dnl ############################################################################
437 dnl ############################################################################
439 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
442 dnl Determine which help translations we want to install.
443 ALL_DOC_LINGUAS="es hu it pl ru sr"
446 if test "x$USE_NLS" = xyes; then
447 if test -z "$LINGUAS"; then
448 langs="`grep -v '^#' $srcdir/po/LINGUAS`"
456 for h_lang in $ALL_DOC_LINGUAS; do
457 for lang in $langs; do
458 if test "$lang" = "$h_lang"; then
459 DOC_LINGUAS="$DOC_LINGUAS $lang"
464 AC_SUBST(DOC_LINGUAS)
474 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
477 dnl ############################################################################
478 dnl Configure results
479 dnl ############################################################################
481 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
489 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
490 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
491 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
492 AM_CONDITIONAL(USE_EDIT, [test x"$use_edit" = xyes ])
493 AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ])
494 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
495 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
496 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
498 AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
505 chmod +x src/man2hlp/man2hlp
512 contrib/dist/Makefile
513 contrib/dist/gentoo/Makefile
514 contrib/dist/redhat/Makefile
515 contrib/dist/redhat/mc.spec
517 contrib/dist/prototype
526 misc/macros.d/Makefile
530 src/consaver/Makefile
534 src/diffviewer/Makefile
535 src/filemanager/Makefile
539 src/vfs/cpio/Makefile
541 src/vfs/extfs/Makefile
542 src/vfs/extfs/helpers/Makefile
543 src/vfs/extfs/helpers/a+
544 src/vfs/extfs/helpers/apt+
545 src/vfs/extfs/helpers/audio
546 src/vfs/extfs/helpers/deb
547 src/vfs/extfs/helpers/deba
548 src/vfs/extfs/helpers/debd
549 src/vfs/extfs/helpers/dpkg+
550 src/vfs/extfs/helpers/iso9660
551 src/vfs/extfs/helpers/hp48+
552 src/vfs/extfs/helpers/lslR
553 src/vfs/extfs/helpers/mailfs
554 src/vfs/extfs/helpers/patchfs
555 src/vfs/extfs/helpers/rpms+
556 src/vfs/extfs/helpers/s3+
557 src/vfs/extfs/helpers/uace
558 src/vfs/extfs/helpers/ualz
559 src/vfs/extfs/helpers/uar
560 src/vfs/extfs/helpers/uarc
561 src/vfs/extfs/helpers/uarj
562 src/vfs/extfs/helpers/uc1541
563 src/vfs/extfs/helpers/ucab
564 src/vfs/extfs/helpers/uha
565 src/vfs/extfs/helpers/ulha
566 src/vfs/extfs/helpers/ulib
567 src/vfs/extfs/helpers/urar
568 src/vfs/extfs/helpers/uzip
569 src/vfs/extfs/helpers/uzoo
571 src/vfs/fish/Makefile
572 src/vfs/fish/helpers/Makefile
574 src/vfs/ftpfs/Makefile
576 src/vfs/sftpfs/Makefile
578 src/vfs/local/Makefile
582 src/vfs/smbfs/Makefile
586 src/vfs/undelfs/Makefile
590 lib/filehighlight/Makefile
591 lib/mcconfig/Makefile
607 doc/hints/l10n/Makefile
629 if test x$enable_tests != xno; then
633 tests/lib/mcconfig/Makefile
634 tests/lib/search/Makefile
635 tests/lib/strutil/Makefile
636 tests/lib/vfs/Makefile
637 tests/lib/widget/Makefile
639 tests/src/filemanager/Makefile
640 tests/src/editor/Makefile
641 tests/src/editor/test-data.txt
651 Source code location: ${srcdir}
653 Compiler flags: ${CFLAGS}
654 File system: ${vfs_type}
656 Screen library: ${screen_msg}
657 Mouse support: ${mouse_lib}
658 X11 events support: ${textmode_x11_support}
659 With subshell support: ${subshell}
660 With background operations: ${enable_background}
661 Internal editor: ${edit_msg}
662 Diff viewer: ${diff_msg}
663 Support for charset: ${charset_msg}
664 Search type: ${SEARCH_TYPE}