Add edit_add_window() function.
[midnight-commander.git] / configure.ac
blobbf22dfdbfd8505729de17a5d49a4d40329a879b0
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 LIBMC_VERSION="0.0.1"
15 LIBMC_RELEASE="1"
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)
23 AM_MAINTAINER_MODE
24 AC_CANONICAL_HOST
26 AC_USE_SYSTEM_EXTENSIONS
28 AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS],["$ac_configure_args"],[MC configure arguments])
30 AC_PROG_LIBTOOL
31 PKG_PROG_PKG_CONFIG
32 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
34 AC_ISC_POSIX
36 AC_PROG_CC_STDC
37 AM_PROG_CC_C_O
39 dnl Doxygen
41 DX_HTML_FEATURE(ON)
42 DX_CHM_FEATURE(OFF)
43 DX_CHI_FEATURE(OFF)
44 DX_MAN_FEATURE(OFF)
45 DX_RTF_FEATURE(OFF)
46 DX_XML_FEATURE(OFF)
47 DX_PDF_FEATURE(OFF)
48 DX_PS_FEATURE(OFF)
49 DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
51 dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
53 AC_CHECK_GLIB
55 AC_ARG_ENABLE([mclib],
56         [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
57         [
58             if test "x$enableval" = "xno" ; then
59                 enable_mclib=no
60             else
61                 if test "x$enable_shared" = "xno" ; then
62                     AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
63                     enable_mclib=no
64                 else
65                     enable_mclib=yes
66                 fi
67             fi
68         ],
69         [enable_mclib=no])
71 AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
73 AC_HEADER_MAJOR
74 AC_C_CONST
75 dnl Check this before type sizeof checks
76 AC_SYS_LARGEFILE
78 AC_PROG_LN_S
79 AC_CHECK_TOOL(AR, ar, ar)
81 dnl Only list browsers here that can be run in background (i.e. with `&')
82 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
84 dnl
85 dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
86 dnl We use only part of the functionality of mmap, so on AIX,
87 dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
88 dnl
89 AC_ARG_WITH(mmap,
90         [  --with-mmap              Use the mmap call [[yes if found]]])
91 if test x$with_mmap != xno; then
92     if test x$with_mmap = x; then
93         AC_FUNC_MMAP
94     else
95         AC_DEFINE(HAVE_MMAP, 1)
96     fi
99 dnl
100 dnl Internationalization
102 AM_GNU_GETTEXT(no-libtool, need-ngettext)
103 AM_GNU_GETTEXT_VERSION(0.14.3)
105 if test "x$USE_INCLUDED_LIBINTL" = xyes; then
106     CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
109 dnl Determine which help translations we want to install.
110 ALL_DOC_LINGUAS="es hu it pl ru sr"
112 DOC_LINGUAS=
113 if test "x$USE_NLS" = xyes; then
114     if test -z "$LINGUAS"; then
115         langs="`grep -v '^#' $srcdir/po/LINGUAS`"
116     else
117         langs="$LINGUAS"
118     fi
119 else
120     langs=
123 for h_lang in $ALL_DOC_LINGUAS; do
124     for lang in $langs; do
125         if test "$lang" = "$h_lang"; then
126             DOC_LINGUAS="$DOC_LINGUAS $lang"
127             break
128         fi
129     done
130 done
131 AC_SUBST(DOC_LINGUAS)
134 dnl OS specific flags.
136 case $host_os in
137 aux*)
138     # A/UX
139     LIBS="$LIBS -lposix"
140     AC_DEFINE(_POSIX_SOURCE)
141     ;;
142 esac
144 AC_PROG_INSTALL
145 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
146         utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
147         sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
148         sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
150 AC_HEADER_TIME
151 AC_HEADER_DIRENT
152 AC_HEADER_ASSERT
154 dnl Missing structure components
155 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
156 AC_STRUCT_ST_BLOCKS
159 dnl Check availability of some functions
162 AC_CHECK_FUNCS([\
163         atoll \
164         isascii \
165         statfs sysconf \
166         tcgetattr tcsetattr \
167         ftruncate \
168         strverscmp \
169         strncasecmp \
170         realpath
174 dnl getpt is a GNU Extension (glibc 2.1.x)
176 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
177 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
179 dnl replacing lstat with statlstat on sco makes it more portable between
180 dnl sco clones
181 AC_CHECK_FUNCS(statlstat)
184 dnl If running under AIX, AC_AIX does not tell us that
186 AC_MSG_CHECKING([for AIX defines])
187 AC_EGREP_CPP(yes,
188 [#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
190 #endif
191 ], [
192 AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
193 AC_MSG_RESULT(yes)
194 ], [AC_MSG_RESULT(no)])
197 dnl Missing typedefs and replacements
200 AC_CHECK_SIZEOF(long)
201 AC_TYPE_UINTMAX_T
202 AC_CHECK_SIZEOF(uintmax_t)
203 AC_TYPE_OFF_T
204 AC_CHECK_SIZEOF(off_t)
205 AC_TYPE_MODE_T
206 AC_TYPE_PID_T
207 AC_TYPE_UID_T
209 AC_FUNC_STRCOLL
211 AC_MC_GET_FS_INFO
214 dnl X11 support.
215 dnl Used to read keyboard modifiers when running under X11.
216 AC_PATH_XTRA
219 dnl Check if the gmodule functionality supported on this system.
220 AC_G_MODULE_SUPPORTED
223 dnl Sequent wants getprocessstats
225 AC_CHECK_LIB(seq, get_process_stats, [
226         LIBS="$LIBS -lseq"
227         AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
228                   [Define if you have function `get_process_stats' and
229 have to use that instead of gettimeofday])])
231 AC_MC_VFS_CHECKS
234 dnl Check for gpm mouse support (Linux only)
236 mouse_lib="xterm only"
237 AC_ARG_WITH(gpm-mouse,
238         [  --with-gpm-mouse         Compile with gpm mouse support (Linux only)
239                            [[yes if found]]])
241 case $host_os in
242 linux*)
243     if test x$with_gpm_mouse != xno; then
244         AC_CHECK_LIB(gpm, Gpm_Repeat,
245             [AC_DEFINE(HAVE_LIBGPM, 1,
246                        [Define to enable gpm mouse support on Linux])
247             mouse_lib="gpm and xterm"
248             MCLIBS="$MCLIBS -lgpm"],
249             if test "x$with_gpm_mouse" = "xyes"; then
250                 [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
251             else
252                 [AC_MSG_WARN([libgpm is missing or older than 0.18])]
253             fi
254         )
255     fi
256     ;;
257 esac
259 MC_CHECK_SEARCH_TYPE
262 dnl Check nroff and the options it supports
264 AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
266 dnl Default values
267 MANDOC=-man
268 MAN_FLAGS=
270 if $HAVE_nroff; then
271     AC_MSG_CHECKING([for manual formatting macros])
272     AC_CACHE_VAL(mc_cv_mandoc, [
273     nroff -mandoc < /dev/null > /dev/null 2>&1
274     if test $? = 0; then
275         mc_cv_mandoc=-mandoc
276     else
277         mc_cv_mandoc=-man
278     fi
279     ])
280     MANDOC=$mc_cv_mandoc
281     AC_MSG_RESULT([$MANDOC])
283     AC_MSG_CHECKING([for option to disable ANSI color in manuals])
284     AC_CACHE_VAL(mc_cv_man_nocolor, [
285     nroff -c < /dev/null > /dev/null 2>&1
286     if test $? = 0; then
287         mc_cv_man_nocolor=-c
288     else
289         mc_cv_man_nocolor=
290     fi
291     ])
292     MAN_FLAGS=$mc_cv_man_nocolor
293     AC_MSG_RESULT([${MAN_NOCOLOR-none}])
295     AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
296     AC_CACHE_VAL(mc_cv_nroff_tascii, [
297     mc_cv_nroff_tascii=
298     nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
299     if test $? = 0; then
300         mc_cv_nroff_tascii=-Tlatin1
301     else
302         nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
303         if test $? = 0; then
304             mc_cv_nroff_tascii=-Tascii
305         fi
306     fi
307     ])
308     AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
309     MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
312 AC_SUBST(MANDOC)
313 AC_SUBST(MAN_FLAGS)
317 dnl Check for -L option to file
319 AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
320 if $HAVE_FILECMD; then
321     AC_MSG_CHECKING([for -L option to file command])
322     AC_CACHE_VAL(mc_cv_filel, [
323     file -L . > /dev/null 2>&1
324     if test $? = 0; then
325         mc_cv_filel=yes
326     else
327         mc_cv_filel=no
328     fi
329     ])
330     if test x$mc_cv_filel = xyes; then
331         AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
332     fi
333     filel=$mc_cv_filel
334     AC_MSG_RESULT([$filel])
338 AC_MSG_CHECKING([for subshell support])
339 AC_ARG_WITH(subshell,
340         [  --with-subshell          Compile in concurrent subshell [[yes]]
341   --with-subshell=optional Don't run concurrent shell by default [[no]]],
342         [result=no
343         if test x$withval = xoptional
344         then
345                 AC_DEFINE(SUBSHELL_OPTIONAL, 1,
346                           [Define to make subshell support optional])
347                 result="optional"
348         fi
349         if test x$withval = xyes
350         then
351                 result="yes"
352         fi],
353         [dnl Default: enable the subshell support
354         result="yes"
356 if test "x$result" != xno; then
357         AC_DEFINE(HAVE_SUBSHELL_SUPPORT, 1,
358                   [Define to enable subshell support])
360 AC_MSG_RESULT([$result])
361 subshell="$result"
364 MC_WITH_SCREEN
368 dnl Internal editor support.
370 AC_ARG_WITH(edit,
371         [  --with-edit              Enable internal editor [[yes]]])
373 if test x$with_edit != xno; then
374         AC_DEFINE(USE_INTERNAL_EDIT, 1, [Define to enable internal editor])
375         use_edit=yes
376         edit_msg="yes"
377         AC_MSG_NOTICE([using internal editor])
378 else
379         edit_msg="no"
383 dnl Diff viewer support.
385 AC_ARG_WITH(diff_viewer,
386         [  --with-diff-viewer       Compile with diff viewer [[yes]]])
388 if test x$with_diff_viewer != xno; then
389         AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
390         use_diff=yes
391         diff_msg="yes"
392         AC_MSG_NOTICE([using diff viewer])
393 else
394         diff_msg="no"
398 dnl Check if the OS is supported by the console saver.
399 cons_saver=""
400 case $host_os in
401 linux*)
402     cons_saver=yes
403 esac
407 dnl Where config files should be placed
410 AC_ARG_WITH([homedir],
411     AS_HELP_STRING([--with-homedir], [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
412     [
413         if test "x$withval" = "xXDG"; then
414             with_homedir=XDG
415         else
416             with_homedir=$withval
417         fi
418     ],
419     [with_homedir=XDG])
422 if test x$with_homedir = xXDG; then
423     AC_DEFINE(MC_HOMEDIR_XDG, 1,
424         [Define to enable XDG standard support])
425 else
426     AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
430 MC_BACKGROUND
434 dnl User visible support for charset conversion.
436 AC_ARG_ENABLE([charset],
437               [  --enable-charset        Support for charset selection and conversion [[yes]]])
438 have_charset=
439 charset_msg="no"
440 if test "x$enable_charset" != "xno"; then
441     AC_DEFINE(HAVE_CHARSET, 1,
442               [Define to enable charset selection and conversion])
443     have_charset=yes
444     charset_msg="yes"
447 if test "$GLIBC21" != yes; then
448     AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
451 MC_CHECK_CFLAGS
453 CFLAGS_OPTS=""
455 if test "x$CFLAGS" = "x"; then
456     CFLAGS_OPTS=" -O2 "
459 if test x$USE_MAINTAINER_MODE = xyes; then
460     CFLAGS_OPTS="-g3 -O -ggdb"
461     AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
464 AC_ARG_ENABLE(
465     [werror],
466     AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors])
469 if test "x$enable_werror" = xyes; then
470     MC_CHECK_ONE_CFLAG([-Werror])
472 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
474 MC_UNIT_TESTS
476 AC_SUBST(CFLAGS)
477 AC_SUBST(CPPFLAGS)
478 AC_SUBST(LDFLAGS)
479 AC_SUBST(LIBS)
481 dnl Libraries used only when building the mc binary
482 AC_SUBST(MCLIBS)
485 EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
486 AC_SUBST(EXTHELPERSDIR)
488 MAN_DATE="$(LC_ALL=C date "+%B %Y")"
489 AC_SUBST(MAN_DATE)
491 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
492 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
493 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
494 AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
495 AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
496 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
497 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
499 AC_CONFIG_FILES(
501 src/man2hlp/man2hlp
504 chmod +x src/man2hlp/man2hlp
507 AC_CONFIG_FILES([
508 Makefile
510 contrib/Makefile
511 contrib/dist/Makefile
512 contrib/dist/debian/Makefile
513 contrib/dist/gentoo/Makefile
514 contrib/dist/redhat/Makefile
515 contrib/dist/redhat/mc.spec
516 contrib/dist/pkginfo
517 contrib/dist/prototype
519 misc/Makefile
520 misc/skins/Makefile
521 misc/ext.d/Makefile
522 misc/ext.d/doc.sh
523 misc/ext.d/misc.sh
524 misc/ext.d/text.sh
525 misc/ext.d/web.sh
526 misc/macros.d/Makefile
527 misc/mc.ext
529 src/Makefile
530 src/consaver/Makefile
531 src/editor/Makefile
532 src/man2hlp/Makefile
533 src/viewer/Makefile
534 src/diffviewer/Makefile
535 src/filemanager/Makefile
537 src/vfs/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/local/Makefile
578 src/vfs/sfs/Makefile
580 src/vfs/smbfs/Makefile
582 src/vfs/tar/Makefile
584 src/vfs/undelfs/Makefile
586 lib/Makefile
587 lib/event/Makefile
588 lib/filehighlight/Makefile
589 lib/mcconfig/Makefile
590 lib/search/Makefile
591 lib/skin/Makefile
592 lib/strutil/Makefile
593 lib/tty/Makefile
595 lib/vfs/Makefile
597 lib/widget/Makefile
599 misc/syntax/Makefile
601 doc/Makefile
602 doc/hints/Makefile
603 doc/man/Makefile
604 doc/man/es/Makefile
605 doc/man/hu/Makefile
606 doc/man/it/Makefile
607 doc/man/pl/Makefile
608 doc/man/ru/Makefile
609 doc/man/sr/Makefile
611 doc/hlp/Makefile
612 doc/hlp/es/Makefile
613 doc/hlp/hu/Makefile
614 doc/hlp/it/Makefile
615 doc/hlp/pl/Makefile
616 doc/hlp/ru/Makefile
617 doc/hlp/sr/Makefile
619 intl/Makefile
620 po/Makefile.in
623 if test x$enable_tests != xno; then
624     AC_CONFIG_FILES([
625 tests/Makefile
626 tests/lib/Makefile
627 tests/lib/mcconfig/Makefile
628 tests/lib/search/Makefile
629 tests/lib/vfs/Makefile
630 tests/src/Makefile
631 tests/src/filemanager/Makefile
637 AC_OUTPUT
639 echo "
640 Configuration:
642   Source code location:       ${srcdir}
643   Compiler:                   ${CC}
644   Compiler flags:             ${CFLAGS}
645   File system:                ${vfs_type}
646                               ${vfs_flags}
647   Screen library:             ${screen_msg}
648   Mouse support:              ${mouse_lib}
649   X11 events support:         ${textmode_x11_support}
650   With subshell support:      ${subshell}
651   With background operations: ${enable_background}
652   Internal editor:            ${edit_msg}
653   Diff viewer:                ${diff_msg}
654   Support for charset:        ${charset_msg}
655   Search type:                ${SEARCH_TYPE}