Browse Source

Reorder checks in configure.ac.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 12 years ago
parent
commit
c34fdcf946
2 changed files with 328 additions and 315 deletions
  1. 327 314
      configure.ac
  2. 1 1
      m4.include/mc-cflags.m4

+ 327 - 314
configure.ac

@@ -2,163 +2,192 @@ dnl
 dnl Configure.in file for the Midnight Commander
 dnl
 
-AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
 AC_PREREQ(2.60)
+AC_INIT([GNU Midnight Commander], [], [mc-devel@gnome.org])
 m4_pattern_forbid(MC_)
 AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SRCDIR(src/main.c)
 AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_SRCDIR(src/main.c)
+AC_CONFIG_HEADERS(config.h)
 MC_VERSION
 AM_INIT_AUTOMAKE(mc, ${VERSION} )
-
-LIBMC_VERSION="0.0.1"
-LIBMC_RELEASE="1"
-AC_SUBST(LIBMC_VERSION)
-AC_SUBST(LIBMC_RELEASE)
-
 dnl Enable silent rules by default (if yes)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
+
 AC_CANONICAL_HOST
 
 AC_USE_SYSTEM_EXTENSIONS
 
-AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS],["$ac_configure_args"],[MC configure arguments])
 
-AC_PROG_LIBTOOL
-PKG_PROG_PKG_CONFIG
-AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
-
-AC_ISC_POSIX
+dnl ############################################################################
+dnl Check for compiler
+dnl ############################################################################
 
 AC_PROG_CC_STDC
 AM_PROG_CC_C_O
 
-dnl Doxygen
-
-DX_HTML_FEATURE(ON)
-DX_CHM_FEATURE(OFF)
-DX_CHI_FEATURE(OFF)
-DX_MAN_FEATURE(OFF)
-DX_RTF_FEATURE(OFF)
-DX_XML_FEATURE(OFF)
-DX_PDF_FEATURE(OFF)
-DX_PS_FEATURE(OFF)
-DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
+MC_CHECK_CFLAGS
 
-dnl PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
+CFLAGS_OPTS=""
+if test "x$CFLAGS" = "x"; then
+    CFLAGS_OPTS=" -O2 "
+fi
+if test x$USE_MAINTAINER_MODE = xyes; then
+    CFLAGS_OPTS="-g3 -O -ggdb"
+    AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
+fi
 
-AC_CHECK_GLIB
-AC_G_MODULE_SUPPORTED
+AC_ARG_ENABLE([werror],
+    AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors]))
+if test "x$enable_werror" = xyes; then
+    MC_CHECK_ONE_CFLAG([-Werror])
+fi
 
-AC_ARG_ENABLE([mclib],
-        [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
-        [
-            if test "x$enableval" = "xno" ; then
-                enable_mclib=no
-            else
-                if test "x$enable_shared" = "xno" ; then
-                    AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
-                    enable_mclib=no
-                else
-                    enable_mclib=yes
-                fi
-            fi
-        ],
-        [enable_mclib=no])
+AC_PROG_LIBTOOL
 
-AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
 
-AC_HEADER_MAJOR
-AC_C_CONST
-dnl Check this before type sizeof checks
-AC_SYS_LARGEFILE
+dnl ############################################################################
+dnl Check for programs
+dnl ############################################################################
 
+PKG_PROG_PKG_CONFIG
+AC_PROG_INSTALL
 AC_PROG_LN_S
-AC_CHECK_TOOL(AR, ar, ar)
-
-dnl Only list browsers here that can be run in background (i.e. with `&')
-AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
+AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
 
-dnl
-dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
-dnl We use only part of the functionality of mmap, so on AIX,
-dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
-dnl
-AC_ARG_WITH(mmap,
-	[  --with-mmap              Use the mmap call [[yes if found]]])
-if test x$with_mmap != xno; then
-    if test x$with_mmap = x; then
-	AC_FUNC_MMAP
+dnl Check nroff and the options it supports
+AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
+dnl Default values
+MANDOC=-man
+MAN_FLAGS=
+if $HAVE_nroff; then
+    AC_MSG_CHECKING([for manual formatting macros])
+    AC_CACHE_VAL(mc_cv_mandoc, [
+    nroff -mandoc < /dev/null > /dev/null 2>&1
+    if test $? = 0; then
+	mc_cv_mandoc=-mandoc
     else
-	AC_DEFINE(HAVE_MMAP, 1)
+	mc_cv_mandoc=-man
     fi
-fi
+    ])
+    MANDOC=$mc_cv_mandoc
+    AC_MSG_RESULT([$MANDOC])
 
-dnl
-dnl Internationalization
-dnl
-AM_GNU_GETTEXT(no-libtool, need-ngettext)
-AM_GNU_GETTEXT_VERSION(0.14.3)
+    AC_MSG_CHECKING([for option to disable ANSI color in manuals])
+    AC_CACHE_VAL(mc_cv_man_nocolor, [
+    nroff -c < /dev/null > /dev/null 2>&1
+    if test $? = 0; then
+	mc_cv_man_nocolor=-c
+    else
+	mc_cv_man_nocolor=
+    fi
+    ])
+    MAN_FLAGS=$mc_cv_man_nocolor
+    AC_MSG_RESULT([${MAN_NOCOLOR-none}])
 
-if test "x$USE_INCLUDED_LIBINTL" = xyes; then
-    CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
+    AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
+    AC_CACHE_VAL(mc_cv_nroff_tascii, [
+    mc_cv_nroff_tascii=
+    nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
+    if test $? = 0; then
+	mc_cv_nroff_tascii=-Tlatin1
+    else
+        nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
+        if test $? = 0; then
+	    mc_cv_nroff_tascii=-Tascii
+	fi
+    fi
+    ])
+    AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
+    MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
 fi
 
-dnl Determine which help translations we want to install.
-ALL_DOC_LINGUAS="es hu it pl ru sr"
+AC_SUBST(MANDOC)
+AC_SUBST(MAN_FLAGS)
 
-DOC_LINGUAS=
-if test "x$USE_NLS" = xyes; then
-    if test -z "$LINGUAS"; then
-	langs="`grep -v '^#' $srcdir/po/LINGUAS`"
+dnl Check for -L option to file
+AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
+if $HAVE_FILECMD; then
+    AC_MSG_CHECKING([for -L option to file command])
+    AC_CACHE_VAL(mc_cv_filel, [
+    file -L . > /dev/null 2>&1
+    if test $? = 0; then
+	mc_cv_filel=yes
     else
-	langs="$LINGUAS"
+	mc_cv_filel=no
     fi
-else
-    langs=
+    ])
+    if test x$mc_cv_filel = xyes; then
+	AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
+    fi
+    filel=$mc_cv_filel
+    AC_MSG_RESULT([$filel])
 fi
 
-for h_lang in $ALL_DOC_LINGUAS; do
-    for lang in $langs; do
-	if test "$lang" = "$h_lang"; then
-	    DOC_LINGUAS="$DOC_LINGUAS $lang"
-	    break
-	fi
-    done
-done
-AC_SUBST(DOC_LINGUAS)
+dnl Only list browsers here that can be run in background (i.e. with `&')
+AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
 
-dnl
-dnl OS specific flags.
-dnl
-case $host_os in
-aux*)
-    # A/UX
-    LIBS="$LIBS -lposix"
-    AC_DEFINE(_POSIX_SOURCE)
-    ;;
-esac
 
-AC_PROG_INSTALL
+dnl ############################################################################
+dnl Check for other tools
+dnl ############################################################################
+
+AC_CHECK_TOOL(AR, ar, ar)
+MC_UNIT_TESTS
+
+
+dnl ############################################################################
+dnl Check for main libraies
+dnl ############################################################################
+
+AC_CHECK_GLIB
+AC_G_MODULE_SUPPORTED
+MC_WITH_SCREEN
+MC_CHECK_SEARCH_TYPE
+dnl X11 support. Used to read keyboard modifiers when running under X11.
+MC_WITH_X
+
+
+dnl ############################################################################
+dnl Check for header files
+dnl ############################################################################
+
 AC_CHECK_HEADERS([unistd.h string.h memory.h limits.h malloc.h \
 	utime.h fcntl.h sys/statfs.h sys/vfs.h sys/time.h \
 	sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
 	sys/socket.h sys/sysmacros.h sys/types.h sys/mkdev.h])
-
+AC_HEADER_MAJOR
 AC_HEADER_TIME
 AC_HEADER_DIRENT
 AC_HEADER_ASSERT
 
-dnl Missing structure components
-AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
+
+dnl ############################################################################
+dnl Check for types
+dnl ############################################################################
+
+AC_C_CONST
+dnl Check largefile before type sizeof checks
+AC_SYS_LARGEFILE
+
+AC_CHECK_SIZEOF(long)
+AC_TYPE_UINTMAX_T
+AC_CHECK_SIZEOF(uintmax_t)
+AC_TYPE_OFF_T
+AC_CHECK_SIZEOF(off_t)
+AC_TYPE_MODE_T
+AC_TYPE_PID_T
+AC_TYPE_UID_T
+
 AC_STRUCT_ST_BLOCKS
+AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
 
-dnl
-dnl Check availability of some functions
-dnl
+
+dnl ############################################################################
+dnl Check for functions
+dnl ############################################################################
 
 AC_CHECK_FUNCS([\
 	atoll \
@@ -170,10 +199,9 @@ AC_CHECK_FUNCS([\
 	strncasecmp \
 	realpath
 ])
+AC_FUNC_STRCOLL
 
-dnl
 dnl getpt is a GNU Extension (glibc 2.1.x)
-dnl
 AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
 AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
 
@@ -181,58 +209,93 @@ dnl replacing lstat with statlstat on sco makes it more portable between
 dnl sco clones
 AC_CHECK_FUNCS(statlstat)
 
-dnl
-dnl If running under AIX, AC_AIX does not tell us that
-dnl
-AC_MSG_CHECKING([for AIX defines])
-AC_EGREP_CPP(yes,
-[#if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
-yes
-#endif
-], [
-AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
-AC_MSG_RESULT(yes)
-], [AC_MSG_RESULT(no)])
-
-dnl
-dnl Missing typedefs and replacements
-dnl
-
-AC_CHECK_SIZEOF(long)
-AC_TYPE_UINTMAX_T
-AC_CHECK_SIZEOF(uintmax_t)
-AC_TYPE_OFF_T
-AC_CHECK_SIZEOF(off_t)
-AC_TYPE_MODE_T
-AC_TYPE_PID_T
-AC_TYPE_UID_T
-
-AC_FUNC_STRCOLL
-
-mc_AC_GET_FS_INFO
-
-dnl X11 support.
-dnl Used to read keyboard modifiers when running under X11.
-MC_WITH_X
+dnl Ovverriding mmap support.  This has to be before AC_FUNC_MMAP is used.
+dnl We use only part of the functionality of mmap, so on AIX,
+dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
+AC_ARG_WITH([mmap],
+	AS_HELP_STRING([--with-mmap], [Use the mmap call @<:@yes if found@:>@]))
+if test x$with_mmap != xno; then
+    if test x$with_mmap = x; then
+	AC_FUNC_MMAP
+    else
+	AC_DEFINE(HAVE_MMAP, 1)
+    fi
+fi
 
-dnl
 dnl Sequent wants getprocessstats
-dnl
 AC_CHECK_LIB(seq, get_process_stats, [
 	LIBS="$LIBS -lseq"
 	AC_DEFINE(HAVE_GET_PROCESS_STATS, 1,
 		  [Define if you have function `get_process_stats' and
 have to use that instead of gettimeofday])])
 
-AC_MC_VFS_CHECKS
+mc_AC_GET_FS_INFO
+
+
+dnl ############################################################################
+dnl Internationalization
+dnl ############################################################################
+
+AM_GNU_GETTEXT(no-libtool, need-ngettext)
+AM_GNU_GETTEXT_VERSION(0.14.3)
+
+if test "x$USE_INCLUDED_LIBINTL" = xyes; then
+    CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl -I\$(top_srcdir)/intl"
+fi
+
+dnl User visible support for charset conversion.
+AC_ARG_ENABLE([charset],
+    AS_HELP_STRING([--enable-charset], [Support for charset selection and conversion @<:@yes@:>@]))
+have_charset=
+charset_msg="no"
+if test "x$enable_charset" != "xno"; then
+    AC_DEFINE(HAVE_CHARSET, 1, [Define to enable charset selection and conversion])
+    have_charset=yes
+    charset_msg="yes"
+fi
+
+
+dnl ############################################################################
+dnl OS specific flags
+dnl ############################################################################
+
+AC_ISC_POSIX
+
+case $host_os in
+aux*)
+    # A/UX
+    LIBS="$LIBS -lposix"
+    AC_DEFINE(_POSIX_SOURCE)
+    ;;
+esac
+
+dnl If running under AIX, AC_AIX does not tell us that
+AC_MSG_CHECKING([for AIX defines])
+AC_EGREP_CPP([yes],
+    [
+        #if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
+        yes
+        #endif
+    ],
+    [
+        AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
+        AC_MSG_RESULT(yes)
+    ],
+    [
+        AC_MSG_RESULT(no)
+    ])
+
+dnl Check if the OS is supported by the console saver.
+cons_saver=""
+case $host_os in
+linux*)
+    cons_saver=yes
+esac
 
-dnl
 dnl Check for gpm mouse support (Linux only)
-dnl
 mouse_lib="xterm only"
-AC_ARG_WITH(gpm-mouse,
-	[  --with-gpm-mouse         Compile with gpm mouse support (Linux only)
-                           [[yes if found]]])
+AC_ARG_WITH([gpm-mouse],
+    AS_HELP_STRING([--with-gpm-mouse], [Compile with gpm mouse support (Linux only) @<:@yes if found@:>@]))
 
 case $host_os in
 linux*)
@@ -252,84 +315,78 @@ linux*)
     ;;
 esac
 
-MC_CHECK_SEARCH_TYPE
 
-dnl
-dnl Check nroff and the options it supports
-dnl
-AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
+dnl ############################################################################
+dnl libmc
+dnl ############################################################################
 
-dnl Default values
-MANDOC=-man
-MAN_FLAGS=
+LIBMC_VERSION="0.0.1"
+LIBMC_RELEASE="1"
+AC_SUBST(LIBMC_VERSION)
+AC_SUBST(LIBMC_RELEASE)
 
-if $HAVE_nroff; then
-    AC_MSG_CHECKING([for manual formatting macros])
-    AC_CACHE_VAL(mc_cv_mandoc, [
-    nroff -mandoc < /dev/null > /dev/null 2>&1
-    if test $? = 0; then
-	mc_cv_mandoc=-mandoc
-    else
-	mc_cv_mandoc=-man
-    fi
-    ])
-    MANDOC=$mc_cv_mandoc
-    AC_MSG_RESULT([$MANDOC])
+AC_ARG_ENABLE([mclib],
+        [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
+        [
+            if test "x$enableval" = "xno" ; then
+                enable_mclib=no
+            else
+                if test "x$enable_shared" = "xno" ; then
+                    AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
+                    enable_mclib=no
+                else
+                    enable_mclib=yes
+                fi
+            fi
+        ],
+        [enable_mclib=no])
 
-    AC_MSG_CHECKING([for option to disable ANSI color in manuals])
-    AC_CACHE_VAL(mc_cv_man_nocolor, [
-    nroff -c < /dev/null > /dev/null 2>&1
-    if test $? = 0; then
-	mc_cv_man_nocolor=-c
-    else
-	mc_cv_man_nocolor=
-    fi
-    ])
-    MAN_FLAGS=$mc_cv_man_nocolor
-    AC_MSG_RESULT([${MAN_NOCOLOR-none}])
+AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
 
-    AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
-    AC_CACHE_VAL(mc_cv_nroff_tascii, [
-    mc_cv_nroff_tascii=
-    nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
-    if test $? = 0; then
-	mc_cv_nroff_tascii=-Tlatin1
-    else
-        nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
-        if test $? = 0; then
-	    mc_cv_nroff_tascii=-Tascii
+
+dnl ############################################################################
+dnl Where config files should be placed
+dnl ############################################################################
+
+AC_ARG_WITH([homedir],
+    AS_HELP_STRING([--with-homedir],
+                   [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
+    [
+	if test "x$withval" = "xXDG"; then
+	    with_homedir=XDG
+	else
+	    with_homedir=$withval
 	fi
-    fi
-    ])
-    AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
-    MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
+    ],
+    [with_homedir=XDG])
+
+
+if test x$with_homedir = xXDG; then
+    AC_DEFINE(MC_HOMEDIR_XDG, 1,
+	[Define to enable XDG standard support])
+else
+    AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
 fi
 
-AC_SUBST(MANDOC)
-AC_SUBST(MAN_FLAGS)
 
+dnl ############################################################################
+dnl MC options
+dnl ############################################################################
 
-dnl
-dnl Check for -L option to file
-dnl
-AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
-if $HAVE_FILECMD; then
-    AC_MSG_CHECKING([for -L option to file command])
-    AC_CACHE_VAL(mc_cv_filel, [
-    file -L . > /dev/null 2>&1
-    if test $? = 0; then
-	mc_cv_filel=yes
-    else
-	mc_cv_filel=no
-    fi
-    ])
-    if test x$mc_cv_filel = xyes; then
-	AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
-    fi
-    filel=$mc_cv_filel
-    AC_MSG_RESULT([$filel])
-fi
+MC_WITH_EDIT
+
+dnl Diff viewer support.
+AC_ARG_WITH([diff_viewer],
+    AS_HELP_STRING([--with-diff-viewer], [Compile with diff viewer @<:@yes@:>@]))
 
+if test x$with_diff_viewer != xno; then
+	AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
+	use_diff=yes
+	diff_msg="yes"
+	AC_MSG_NOTICE([using diff viewer])
+else
+	diff_msg="no"
+fi
 
 AC_MSG_CHECKING([for subshell support])
 AC_ARG_WITH(subshell,
@@ -356,127 +413,82 @@ fi
 AC_MSG_RESULT([$result])
 subshell="$result"
 
-MC_WITH_SCREEN
-
-MC_WITH_EDIT
-
-dnl
-dnl Diff viewer support.
-dnl
-AC_ARG_WITH(diff_viewer,
-        [  --with-diff-viewer       Compile with diff viewer [[yes]]])
-
-if test x$with_diff_viewer != xno; then
-	AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
-	use_diff=yes
-	diff_msg="yes"
-	AC_MSG_NOTICE([using diff viewer])
-else
-	diff_msg="no"
-fi
-
-
-dnl Check if the OS is supported by the console saver.
-cons_saver=""
-case $host_os in
-linux*)
-    cons_saver=yes
-esac
+MC_BACKGROUND
 
+AC_MC_VFS_CHECKS
 
-dnl
-dnl Where config files should be placed
-dnl
 
-AC_ARG_WITH([homedir],
-    AS_HELP_STRING([--with-homedir], [Choose any place of user settings relative to home dir, or XDG for respect XDG standards @<:@XDG@:>@]),
-    [
-	if test "x$withval" = "xXDG"; then
-	    with_homedir=XDG
-	else
-	    with_homedir=$withval
-	fi
-    ],
-    [with_homedir=XDG])
+dnl ############################################################################
+dnl Directories
+dnl ############################################################################
 
+dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
+dnl Let define ${prefix} and ${exec_prefix}
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix='${prefix}'
 
-if test x$with_homedir = xXDG; then
-    AC_DEFINE(MC_HOMEDIR_XDG, 1,
-	[Define to enable XDG standard support])
+if test x${libexecdir} = x'${exec_prefix}/libexec'; then
+    EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
 else
-    AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
+    EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
 fi
+AC_SUBST(EXTHELPERSDIR)
 
 
-MC_BACKGROUND
+dnl ############################################################################
+dnl Documentation
+dnl ############################################################################
 
+MAN_DATE="$(LC_ALL=C date "+%B %Y")"
+AC_SUBST(MAN_DATE)
 
-dnl
-dnl User visible support for charset conversion.
-dnl
-AC_ARG_ENABLE([charset],
-	      [  --enable-charset        Support for charset selection and conversion [[yes]]])
-have_charset=
-charset_msg="no"
-if test "x$enable_charset" != "xno"; then
-    AC_DEFINE(HAVE_CHARSET, 1,
-	      [Define to enable charset selection and conversion])
-    have_charset=yes
-    charset_msg="yes"
-fi
+dnl Determine which help translations we want to install.
+ALL_DOC_LINGUAS="es hu it pl ru sr"
 
-if test "$GLIBC21" != yes; then
-    AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
+DOC_LINGUAS=
+if test "x$USE_NLS" = xyes; then
+    if test -z "$LINGUAS"; then
+	langs="`grep -v '^#' $srcdir/po/LINGUAS`"
+    else
+	langs="$LINGUAS"
+    fi
+else
+    langs=
 fi
 
-MC_CHECK_CFLAGS
-
-CFLAGS_OPTS=""
+for h_lang in $ALL_DOC_LINGUAS; do
+    for lang in $langs; do
+	if test "$lang" = "$h_lang"; then
+	    DOC_LINGUAS="$DOC_LINGUAS $lang"
+	    break
+	fi
+    done
+done
+AC_SUBST(DOC_LINGUAS)
 
-if test "x$CFLAGS" = "x"; then
-    CFLAGS_OPTS=" -O2 "
-fi
+DX_HTML_FEATURE(ON)
+DX_CHM_FEATURE(OFF)
+DX_CHI_FEATURE(OFF)
+DX_MAN_FEATURE(OFF)
+DX_RTF_FEATURE(OFF)
+DX_XML_FEATURE(OFF)
+DX_PDF_FEATURE(OFF)
+DX_PS_FEATURE(OFF)
+DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
 
-if test x$USE_MAINTAINER_MODE = xyes; then
-    CFLAGS_OPTS="-g3 -O -ggdb"
-    AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
-fi
 
-AC_ARG_ENABLE(
-    [werror],
-    AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors])
-)
+dnl ############################################################################
+dnl Configure results
+dnl ############################################################################
 
-if test "x$enable_werror" = xyes; then
-    MC_CHECK_ONE_CFLAG([-Werror])
-fi
 CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
 
-MC_UNIT_TESTS
-
+AC_SUBST(MCLIBS)
 AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(LIBS)
 
-dnl Libraries used only when building the mc binary
-AC_SUBST(MCLIBS)
-
-dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
-dnl Let define ${prefix} and ${exec_prefix}
-test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
-test "x$exec_prefix" = "xNONE" && exec_prefix='${prefix}'
-
-if test x${libexecdir} = x'${exec_prefix}/libexec'; then
-    EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
-else
-    EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
-fi
-AC_SUBST(EXTHELPERSDIR)
-
-MAN_DATE="$(LC_ALL=C date "+%B %Y")"
-AC_SUBST(MAN_DATE)
-
 AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
 AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
 AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
@@ -486,6 +498,8 @@ AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
 AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
 AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
 
+AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
+
 AC_CONFIG_FILES(
 [
 src/man2hlp/man2hlp
@@ -621,7 +635,6 @@ tests/lib/vfs/Makefile
 tests/src/Makefile
 tests/src/filemanager/Makefile
 ])
-
 fi
 
 

+ 1 - 1
m4.include/mc-cflags.m4

@@ -9,7 +9,7 @@ dnl @copyright Free Software Foundation, Inc.
 
 AC_DEFUN([MC_CHECK_ONE_CFLAG],[
 
-  AC_MSG_CHECKING([if gcc accepts $1])
+  AC_MSG_CHECKING([whether gcc accepts $1])
 
   safe_CFLAGS=$CFLAGS
   CFLAGS="$1"