update .gitignore for src/vfs/extfs/helpers/
[midnight-commander.git] / configure.ac
blob64b39f28b4caf63ae0783fde01992e43ec2df22f
1 dnl
2 dnl Configure.in file for the Midnight Commander
3 dnl
5 AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
6 AC_PREREQ(2.60)
7 m4_pattern_forbid(MC_)
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_SRCDIR(src/main.c)
10 AC_CONFIG_AUX_DIR(config)
11 MC_VERSION
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)
18 AM_MAINTAINER_MODE
19 AC_CANONICAL_HOST
21 AC_USE_SYSTEM_EXTENSIONS
23 AC_PROG_LIBTOOL
24 PKG_PROG_PKG_CONFIG
25 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
27 AC_ISC_POSIX
29 AC_PROG_CC_STDC
30 AM_PROG_CC_C_O
32 dnl Doxygen
34 DX_HTML_FEATURE(ON)
35 DX_CHM_FEATURE(OFF)
36 DX_CHI_FEATURE(OFF)
37 DX_MAN_FEATURE(OFF)
38 DX_RTF_FEATURE(OFF)
39 DX_XML_FEATURE(OFF)
40 DX_PDF_FEATURE(OFF)
41 DX_PS_FEATURE(OFF)
42 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
44 dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
46 AC_CHECK_GLIB
48 AC_HEADER_MAJOR
49 AC_C_CONST
50 AC_SYS_LARGEFILE
52 AC_PROG_LN_S
53 AC_CHECK_TOOL(AR, ar, ar)
55 dnl Only list browsers here that can be run in background (i.e. with `&')
56 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla konqueror opera netscape])
58 dnl
59 dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
60 dnl We use only part of the functionality of mmap, so on AIX,
61 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
62 dnl
63 AC_ARG_WITH(mmap,
64         [  --with-mmap              Use the mmap call [[yes if found]]])
65 if test x$with_mmap != xno; then
66     if test x$with_mmap = x; then
67         AC_FUNC_MMAP
68     else
69         AC_DEFINE(HAVE_MMAP, 1)
70     fi
73 dnl
74 dnl Internationalization
75 dnl
76 AM_GNU_GETTEXT(no-libtool, need-ngettext)
77 AM_GNU_GETTEXT_VERSION(0.14.3)
79 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
80     CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
83 dnl Determine which help translations we want to install.
84 ALL_DOC_LINGUAS="es hu it pl ru sr"
86 DOC_LINGUAS=
87 if test "x$USE_NLS" = xyes; then
88     if test -z "$LINGUAS"; then
89         langs="`grep -v '^#' $srcdir/po/LINGUAS`"
90     else
91         langs="$LINGUAS"
92     fi
93 else
94     langs=
97 for h_lang in $ALL_DOC_LINGUAS; do
98     for lang in $langs; do
99         if test "$lang" = "$h_lang"; then
100             DOC_LINGUAS="$DOC_LINGUAS $lang"
101             break
102         fi
103     done
104 done
105 AC_SUBST(DOC_LINGUAS)
108 dnl OS specific flags.
110 case $host_os in
111 aux*)
112     # A/UX
113     LIBS="$LIBS -lposix"
114     AC_DEFINE(_POSIX_SOURCE)
115     ;;
116 esac
118 AC_PROG_INSTALL
119 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
120         utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
121         sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
122         security/pam_misc.h sys/socket.h sys/sysmacros.h sys/types.h \
123         sys/mkdev.h wchar.h wctype.h])
125 AC_HEADER_TIME
126 AC_HEADER_DIRENT
127 AC_HEADER_STDC
129 dnl Missing structure components
130 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
131 AC_STRUCT_ST_BLOCKS
134 dnl Check availability of some functions
137 AC_CHECK_FUNCS([\
138         atoll \
139         cfgetospeed \
140         initgroups isascii \
141         setreuid statfs sysconf \
142         tcgetattr tcsetattr truncate \
143         strverscmp \
144         strncasecmp \
145         realpath
149 dnl getpt is a GNU Extension (glibc 2.1.x)
151 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
152 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
154 dnl replacing lstat with statlstat on sco makes it more portable between
155 dnl sco clones
156 AC_CHECK_FUNCS(statlstat)
159 dnl If running under AIX, AC_AIX does not tell us that
161 AC_MSG_CHECKING([for AIX defines])
162 AC_EGREP_CPP(yes,
163 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
165 #endif
166 ], [
167 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
168 AC_MSG_RESULT(yes)
169 ], [AC_MSG_RESULT(no)])
172 dnl This is from GNU fileutils, check aclocal.m4 for more information
174 AC_GET_FS_INFO
177 dnl Missing typedefs and replacements
180 AC_CHECK_SIZEOF(long)
181 AC_CHECK_SIZEOF(long long)
182 AC_TYPE_MODE_T
183 AC_TYPE_OFF_T
184 AC_CHECK_SIZEOF(off_t)
185 AC_TYPE_PID_T
186 AC_TYPE_UID_T
187 AC_CHECK_TYPE(nlink_t, unsigned int)
188 AC_CHECK_TYPES([socklen_t],,,
190 #include <sys/types.h>
191 #include <sys/socket.h>
194 dnl This is needed for regex.c only
195 AC_CHECK_TYPE(uintptr_t,
196               [AC_DEFINE(HAVE_UINTPTR_T, 1,
197                          [Define if you have the `uintptr_t' type.])
200 AC_FUNC_ALLOCA
201 AC_FUNC_STRCOLL
204 dnl X11 support.
205 dnl Used to read keyboard modifiers when running under X11.
206 AC_PATH_XTRA
209 dnl Check if the gmodule functionality supported on this system.
210 AC_G_MODULE_SUPPORTED
213 dnl Sequent wants getprocessstats
215 AC_CHECK_LIB(seq, get_process_stats, [
216         LIBS="$LIBS -lseq"
217         AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
218                   [Define if you have function `get_process_stats' and
219 have to use that instead of gettimeofday])])
221 AC_MC_VFS_CHECKS
224 dnl Check for gpm mouse support (Linux only)
226 mouse_lib="xterm only"
227 AC_ARG_WITH(gpm-mouse,
228         [  --with-gpm-mouse         Compile with gpm mouse support (Linux only)
229                            [[yes if found]]])
231 case $host_os in
232 linux*)
233     if test x$with_gpm_mouse != xno; then
234         AC_CHECK_LIB(gpm, Gpm_Repeat,
235             [AC_DEFINE(HAVE_LIBGPM, 1,
236                        [Define to enable gpm mouse support on Linux])
237             mouse_lib="gpm and xterm"
238             MCLIBS="$MCLIBS -lgpm"],
239             if test "x$with_gpm_mouse" = "xyes"; then
240                 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
241             else
242                 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
243             fi
244         )
245     fi
246     ;;
247 esac
249 MC_CHECK_SEARCH_TYPE
252 dnl Check nroff and the options it supports
254 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
256 dnl Default values
257 MANDOC=-man
258 MAN_FLAGS=
260 if $HAVE_nroff; then
261     AC_MSG_CHECKING([for manual formatting macros])
262     AC_CACHE_VAL(mc_cv_mandoc, [
263     nroff -mandoc < /dev/null > /dev/null 2>&1
264     if test $? = 0; then
265         mc_cv_mandoc=-mandoc
266     else
267         mc_cv_mandoc=-man
268     fi
269     ])
270     MANDOC=$mc_cv_mandoc
271     AC_MSG_RESULT([$MANDOC])
273     AC_MSG_CHECKING([for option to disable ANSI color in manuals])
274     AC_CACHE_VAL(mc_cv_man_nocolor, [
275     nroff -c < /dev/null > /dev/null 2>&1
276     if test $? = 0; then
277         mc_cv_man_nocolor=-c
278     else
279         mc_cv_man_nocolor=
280     fi
281     ])
282     MAN_FLAGS=$mc_cv_man_nocolor
283     AC_MSG_RESULT([${MAN_NOCOLOR-none}])
285     AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
286     AC_CACHE_VAL(mc_cv_nroff_tascii, [
287     mc_cv_nroff_tascii=
288     nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
289     if test $? = 0; then
290         mc_cv_nroff_tascii=-Tlatin1
291     else
292         nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
293         if test $? = 0; then
294             mc_cv_nroff_tascii=-Tascii
295         fi
296     fi
297     ])
298     AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
299     MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
302 AC_SUBST(MANDOC)
303 AC_SUBST(MAN_FLAGS)
307 dnl Check for -L option to file
309 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
310 if $HAVE_FILECMD; then
311     AC_MSG_CHECKING([for -L option to file command])
312     AC_CACHE_VAL(mc_cv_filel, [
313     file -L . > /dev/null 2>&1
314     if test $? = 0; then
315         mc_cv_filel=yes
316     else
317         mc_cv_filel=no
318     fi
319     ])
320     if test x$mc_cv_filel = xyes; then
321         AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
322     fi
323     filel=$mc_cv_filel
324     AC_MSG_RESULT([$filel])
328 AC_MSG_CHECKING([for subshell support])
329 AC_ARG_WITH(subshell,
330         [  --with-subshell          Compile in concurrent subshell [[yes]]
331   --with-subshell=optional Don't run concurrent shell by default [[no]]],
332         [result=no
333         if test x$withval = xoptional
334         then
335                 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
336                           [Define to make subshell support optional])
337                 result="optional"
338         fi
339         if test x$withval = xyes
340         then
341                 result="yes"
342         fi],
343         [dnl Default: enable the subshell support
344         result="yes"
346 if test "x$result" != xno; then
347         AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
348                   [Define to enable subshell support])
350 AC_MSG_RESULT([$result])
351 subshell="$result"
354 MC_WITH_SCREEN
358 dnl Internal editor support.
360 AC_ARG_WITH(edit,
361         [  --with-edit              Enable internal editor [[yes]]])
363 if test x$with_edit != xno; then
364         AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
365         use_edit=yes
366         edit_msg="yes"
367         AC_MSG_NOTICE([using internal editor])
368 else
369         edit_msg="no"
373 dnl Diff viewer support.
375 AC_ARG_WITH(diff_viewer,
376         [  --with-diff-viewer       Compile with diff viewer [[yes]]])
378 if test x$with_diff_viewer != xno; then
379         AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
380         use_diff=yes
381         diff_msg="yes"
382         AC_MSG_NOTICE([using diff viewer])
383 else
384         diff_msg="no"
388 dnl Check if the OS is supported by the console saver.
389 cons_saver=""
390 case $host_os in
391 linux*)
392     cons_saver=yes
393 esac
396 dnl Support for background operations
397 AC_ARG_ENABLE([background],
398               [  --enable-background     Support for background file operations [[yes]]])
399 if test "x$enable_background" != xno; then
400     AC_DEFINE(WITH_BACKGROUND, 1, [Define to enable background file operations])
405 dnl User visible support for charset conversion.
407 AC_ARG_ENABLE([charset],
408               [  --enable-charset        Support for charset selection and conversion [[yes]]])
409 have_charset=
410 charset_msg="no"
411 if test "x$enable_charset" != "xno"; then
412     AC_DEFINE(HAVE_CHARSET, 1,
413               [Define to enable charset selection and conversion])
414     have_charset=yes
415     charset_msg="yes"
418 if test "$GLIBC21" != yes; then
419     AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
422 MC_CHECK_CFLAGS
424 CFLAGS_OPTS=""
426 if test "x$CFLAGS" = "x"; then
427     CFLAGS_OPTS=" -O2 "
430 if test x$USE_MAINTAINER_MODE = xyes; then
431     CFLAGS_OPTS="-g3 -O -ggdb"
432     AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
435 AC_ARG_ENABLE(
436     [werror],
437     AC_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors] )
440 if test "x$enable_werror" = xyes; then
441     MC_CHECK_ONE_CFLAG([-Werror])
443 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
445 MC_UNIT_TESTS
447 AC_SUBST(CFLAGS)
448 AC_SUBST(CPPFLAGS)
449 AC_SUBST(LDFLAGS)
450 AC_SUBST(LIBS)
452 dnl Libraries used only when building the mc binary
453 AC_SUBST(MCLIBS)
455 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
456 AC_SUBST(MAN_DATE)
458 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
459 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
460 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
461 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
462 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
463 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
465 AC_CONFIG_FILES(
467 src/man2hlp/man2hlp
470 chmod +x src/man2hlp/man2hlp
473 AC_CONFIG_FILES([
474 Makefile
476 contrib/Makefile
477 contrib/dist/Makefile
478 contrib/dist/debian/Makefile
479 contrib/dist/gentoo/Makefile
480 contrib/dist/redhat/Makefile
481 contrib/dist/redhat/mc.spec
482 contrib/dist/pkginfo
483 contrib/dist/prototype
485 misc/Makefile
486 misc/skins/Makefile
487 misc/macros.d/Makefile
488 misc/mc.ext
490 src/Makefile
491 src/consaver/Makefile
492 src/editor/Makefile
493 src/man2hlp/Makefile
494 src/viewer/Makefile
495 src/diffviewer/Makefile
496 src/filemanager/Makefile
498 src/vfs/Makefile
500 src/vfs/cpio/Makefile
502 src/vfs/extfs/Makefile
503 src/vfs/extfs/helpers/Makefile
504 src/vfs/extfs/helpers/a+
505 src/vfs/extfs/helpers/apt+
506 src/vfs/extfs/helpers/audio
507 src/vfs/extfs/helpers/deb
508 src/vfs/extfs/helpers/deba
509 src/vfs/extfs/helpers/debd
510 src/vfs/extfs/helpers/dpkg+
511 src/vfs/extfs/helpers/iso9660
512 src/vfs/extfs/helpers/hp48+
513 src/vfs/extfs/helpers/lslR
514 src/vfs/extfs/helpers/mailfs
515 src/vfs/extfs/helpers/patchfs
516 src/vfs/extfs/helpers/rpms+
517 src/vfs/extfs/helpers/s3+
518 src/vfs/extfs/helpers/uace
519 src/vfs/extfs/helpers/ualz
520 src/vfs/extfs/helpers/uar
521 src/vfs/extfs/helpers/uarc
522 src/vfs/extfs/helpers/uarj
523 src/vfs/extfs/helpers/uc1541
524 src/vfs/extfs/helpers/uha
525 src/vfs/extfs/helpers/ulha
526 src/vfs/extfs/helpers/urar
527 src/vfs/extfs/helpers/uzip
528 src/vfs/extfs/helpers/uzoo
530 src/vfs/fish/Makefile
531 src/vfs/fish/helpers/Makefile
533 src/vfs/ftpfs/Makefile
535 src/vfs/local/Makefile
537 src/vfs/sfs/Makefile
539 src/vfs/smbfs/Makefile
541 src/vfs/tar/Makefile
543 src/vfs/undelfs/Makefile
545 lib/Makefile
546 lib/event/Makefile
547 lib/filehighlight/Makefile
548 lib/mcconfig/Makefile
549 lib/search/Makefile
550 lib/skin/Makefile
551 lib/strutil/Makefile
552 lib/tty/Makefile
554 lib/vfs/Makefile
556 lib/widget/Makefile
558 misc/syntax/Makefile
560 doc/Makefile
561 doc/hints/Makefile
562 doc/man/mc.1 doc/man/mcedit.1 doc/man/mcview.1 doc/man/Makefile
563 doc/man/es/mc.1 doc/man/es/Makefile
564 doc/man/hu/mc.1 doc/man/hu/Makefile
565 doc/man/it/mc.1 doc/man/it/Makefile
566 doc/man/pl/mc.1 doc/man/pl/Makefile
567 doc/man/ru/mc.1 doc/man/ru/Makefile
568 doc/man/sr/mc.1 doc/man/sr/Makefile
570 doc/hlp/Makefile
571 doc/hlp/es/Makefile
572 doc/hlp/hu/Makefile
573 doc/hlp/it/Makefile
574 doc/hlp/pl/Makefile
575 doc/hlp/ru/Makefile
576 doc/hlp/sr/Makefile
578 intl/Makefile
579 po/Makefile.in
582 AC_OUTPUT
584 echo "
585 Configuration:
587   Source code location:       ${srcdir}
588   Compiler:                   ${CC}
589   Compiler flags:             ${CFLAGS}
590   File system:                ${vfs_type}
591                               ${vfs_flags}
592   Screen library:             ${screen_msg}
593   Mouse support:              ${mouse_lib}
594   X11 events support:         ${textmode_x11_support}
595   With subshell support:      ${subshell}
596   Internal editor:            ${edit_msg}
597   Diff viewer:                ${diff_msg}
598   Support for charset:        ${charset_msg}
599   Search type:                ${SEARCH_TYPE}