doc, fix, do not use structure (@unnumberedsec) inside @enumerate
[sxemacs] / configure.ac
index b62310e..a6d48ef 100644 (file)
@@ -31,6 +31,7 @@ AC_COPYRIGHT(
 #### Copyright (C) 2005 Malcolm Purvis.
 #### Copyright (C) 2005, 2006, 2007 Steve Youngs.
 #### Copyright (C) 2006, 2007, 2008 Sebastian Freundt.
+#### Copyright (C) 2007, 2010, 2011, 2012 Nelson Ferreira
 
 ### Don't edit this script!
 ### This script was automatically generated by the `autoconf' program
@@ -64,7 +65,7 @@ AC_COPYRIGHT(
 ### If configure succeeds, it leaves its status in config.status.
 ### A log of configuration tests can be found in config.log.
 ### If configure fails after disturbing the status quo,
-###    config.status is removed.
+###    config.status is removed.
 ])
 
 AC_REVISION([SXEM4CS_GIT_VERSION])
@@ -316,7 +317,7 @@ OG_ARG_WITH([regex-malloc],
 
 OG_ARG_WITH([ffi],
        AS_HELP_STRING([--with-ffi],
-               [Compile in experimental support for 
+               [Compile in experimental support for
                Foreign Function Interface.]),
        [yes], [YES])
 
@@ -345,9 +346,6 @@ OG_MULTIARG_WITH([static-modules], [dnl
        OG_MULTIARG_ITEM([cl], [cl], [fast Common Lisp implementation])
 ])
 
-dnl _OG_MULTIARG_ITEM([ent], [int], [int], [native integer arithmetics])
-dnl _OG_MULTIARG_ITEM([ent], [fpfloat], [fpfloat], [native fixed precision floats])
-dnl _OG_MULTIARG_ITEM([ent], [indef], [indef], [abstract indefinites])
 OG_MULTIARG_WITH([ent], [dnl
        AS_HELP_STRING([--with-ent], [
                Compile in support for enhanced number types,
@@ -381,6 +379,13 @@ OG_MULTIARG_WITH([ase], [dnl
        OG_MULTIARG_ITEM([resclass], [resclass], [Residue Class Rings and Classes])
 ])
 
+OG_ARG_WITH([compre],
+       AS_HELP_STRING([--with-compre],[
+               Provide exhaustive caching of compiled regexps. This will
+               mean that frequently used regexps will be faster to use
+               since the compile step will not be needed after first use.]),
+       [yes], [By default do cache compiled regexps.])
+
 OG_MULTIARG_WITH([experimental-features], [dnl
        AS_HELP_STRING([--with-experimental-features], [
                Activate experimental code, that is code which is
@@ -393,7 +398,6 @@ OG_MULTIARG_WITH([experimental-features], [dnl
                can switch off some portions.])],
        [all nobdwgc], [ALL but bdwgc], [dnl
        OG_MULTIARG_ITEM([bdwgc], [bdwgc], [the Boehm-Demers-Weiser collector])
-       OG_MULTIARG_ITEM([compre], [compre], [exhaustive caching of compiled regexps])
        OG_MULTIARG_ITEM([asyneq], [asyneq], [asynchronous event queues])
 ])
        dnl stop that pom stuff
@@ -445,6 +449,8 @@ OG_MULTIARG_WITH([error-checking], [dnl
        OG_MULTIARG_ITEM([byte_code], [byte_code], [checks on byte compiled code])
        OG_MULTIARG_ITEM([bufpos], [bufpos], [checks on buffer position])
        OG_MULTIARG_ITEM([glyphs], [glyphs], [checks on glyph data])
+       OG_MULTIARG_ITEM([stack], [stack], [checks on stack barriers])
+       OG_MULTIARG_ITEM([malldbg], [malldbg], [malloc debugging code])
 ])
 
 OG_ARG_WITH([purify],
@@ -478,54 +484,38 @@ OG_ARG_WITH([external-widget],
 
 OG_ARG_WITH([menubars],
        AS_HELP_STRING([--with-menubars=TYPE],
-               [Type of menubars to use.  The Lucid menubars emulate
-               Motif (mostly) but are faster.
-               *WARNING*  The gtk menubar is gtk-1.2 only and unmaintained.]),
-       [lucid], [Lucid], [lucid gtk no])
+               [Type of menubars to use.  The Lucid menubars emulate
+               Motif (mostly) but are faster.]),
+       [lucid], [Lucid], [lucid no])
 
 OG_ARG_WITH([scrollbars],
        AS_HELP_STRING([--with-scrollbars=TYPE],
-               [Type of scrollbars to use.
-               *WARNING*  The Motif scrollbars are currently broken.
-               *WARNING*  The gtk scrollbars are gtk-1.2 only and unmaintained.]),
-       [lucid], [Lucid], [lucid motif athena gtk no])
+               [Type of scrollbars to use.
+               *WARNING*  The Motif scrollbars are currently broken.]),
+       [lucid], [Lucid], [lucid motif athena no])
 
 OG_ARG_WITH([dialogs],
        AS_HELP_STRING([--with-dialogs=TYPE],
-               [Type of dialog boxes to use.  Athena dialogs will
-                 be used if Athena can be found.
-                *WARNING*  The gtk dialogs are gtk-1.2 only and unmaintained.]),
-       [athena], [], [athena motif gtk no])
+               [Type of dialog boxes to use.  Athena dialogs will
+                be used if Athena can be found.]),
+       [athena], [], [athena motif no])
 
 OG_ARG_WITH([widgets],
        AS_HELP_STRING([--with-widgets=TYPE],
-               [Type of native widgets to use.  Athena widgets will
-               be used if Athena can be found.
-               *WARNING*  The gtk widgets are gtk-1.2 only and unmaintained.]),
-       [athena], [], [athena motif gtk no])
+               [Type of native widgets to use.  Athena widgets will
+               be used if Athena can be found.]),
+       [athena], [], [athena motif no])
 
 OG_ARG_WITH([athena],
        AS_HELP_STRING([--with-athena=TYPE],
-               [Type of Athena widgets to use.]),
+               [Type of Athena widgets to use.]),
        [auto], [Autodetect], [auto xaw 3d next 95 xpm no])
 
 OG_ARG_WITH([xim],
        AS_HELP_STRING([--with-xim],
-               [Type of Mule input method to use.]),
+               [Type of Mule input method to use.]),
        [auto], [Autodetect], [yes no xlib motif])
 
-OG_ARG_WITH([gtk],
-       AS_HELP_STRING([--with-gtk],
-               [Support GTK (version 1.x) on the X Window System.
-               (EXPERIMENTAL)]),
-       [no], [NO])
-
-OG_ARG_WITH([gnome],
-       AS_HELP_STRING([--with-gnome],
-               [Support GNOME (version 1.x) on the X Window System.
-               (EXPERIMENTAL)]),
-       [no], [NO])
-
 OG_ARG_WITH([wmcommand],
        AS_HELP_STRING([--with-wmcommand],
                [Compile with realized leader window which will
@@ -558,6 +548,27 @@ OG_ARG_WITH([ncurses],
                [Use the ncurses library for tty support.]),
        [auto], [Autodetect])
 
+OG_ARG_WITH([curses],
+       AS_HELP_STRING([--with-curses],
+               [Use the curses library for tty support.]),
+       [auto], [Autodetect])
+
+OG_ARG_WITH([terminfo],
+       AS_HELP_STRING([--with-terminfo],
+               [Use the terminfo library for tty support.]),
+       [auto], [Autodetect])
+
+OG_ARG_WITH([termlib],
+       AS_HELP_STRING([--with-termlib],
+               [Use the termlib library for tty support.]),
+       [auto], [Autodetect])
+
+OG_ARG_WITH([termcap],
+       AS_HELP_STRING([--with-termcap],
+               [Use the termcap library for tty support.]),
+       [auto], [Autodetect])
+
+
 OG_ARG_WITH([gpm],
        AS_HELP_STRING([--with-gpm],
                [Compile in GPM mouse support for ttys.]),
@@ -610,7 +621,6 @@ OG_MULTIARG_WITH([sound], [dnl
        [auto], [Autodetect all sound support (except Pulse)], [dnl
        OG_MULTIARG_ITEM([alsa], [ALSA], [kernel-based linux sound standard])
        OG_MULTIARG_ITEM([ao], [ao], [generic audio output layer])
-       OG_MULTIARG_ITEM([arts], [aRts], [discontinued realtime synthesizer])
        OG_MULTIARG_ITEM([esd], [ESD], [Enlightenment Sound Daemon])
        OG_MULTIARG_ITEM([jack], [Jack], [a low-latency audio server])
        OG_MULTIARG_ITEM([nas], [NAS], [Network Audio System])
@@ -644,13 +654,13 @@ OG_OPTION_GROUP(Cryptography options)
 
 OG_ARG_WITH([openssl],
        AS_HELP_STRING([--with-openssl],
-               [Compile in experimental support for 
+               [Compile in experimental support for
                OpenSSL libcrypto and libssl.]),
        [yes], [YES])
 
 OG_ARG_WITH([gnutls],
        AS_HELP_STRING([--with-gnutls],
-               [Compile in experimental support for 
+               [Compile in experimental support for
                GnuTLS transport security.]),
        [no], [NO])
 
@@ -743,22 +753,16 @@ OG_ARG_WITH([wnn6],
 dnl dnl Other Options
 dnl dnl =============
 dnl OG_OPTION_GROUP(Other options)
-dnl 
-dnl OG_ARG_WITH([tooltalk],
-dnl    AS_HELP_STRING([--with-tooltalk],
-dnl            [Support the ToolTalk IPC protocol.]),
-dnl    [no], [NO], [], [with_tooltalk=$withval], [with_tooltalk=no])
-
+dnl
 
 ## -------------------------------------------------------------------------
 ## Check for users who regularly forget about running autoconf
 ## -------------------------------------------------------------------------
-if test -f $0.ac -a $0.ac -nt $0; then
-       AC_MSG_ERROR([What are you doing? RUN autoreconf NOW!!!])
-fi
+AS_IF([test -f "$0.ac" -a "$0.ac" -nt "$0"],
+   AC_MSG_ERROR([What are you doing? RUN autoreconf NOW!!!]))
 
 #
-# Turn off core generation. We are already verifying the program fails, no need 
+# Turn off core generation. We are already verifying the program fails, no need
 # poluting the workspace. Of course if you are a SXEmacs developer you may want
 # to comemnt this on occasion :-)
 ulimit -c 0
@@ -800,6 +804,7 @@ dnl -------------------------------------------------------------------------
 SXE_CHECK_COMMAND_LINE
 
 AM_INIT_AUTOMAKE([foreign -Wall])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 SXE_CHECK_BUILDCHAIN
 AC_SUBST(EGREP)
 
@@ -823,22 +828,16 @@ AC_CHECK_PROG([have_git], [git], [yes], [no])
 AC_MSG_CHECKING([for SXEmacs version])
 AC_MSG_RESULT([SXEmacs SXEM4CS_VERSION])
 dnl Must do the following first to determine verbosity for AC_DEFINE
-if test -n "[]SXEM4CS_BETA_P[]"; then
-       beta=yes
-else
-       beta=no
-fi
+AS_IF([test -n "[]SXEM4CS_BETA_P[]"],beta=yes,beta=no)
 : "${extra_verbose=$beta}"
 
 AC_MSG_CHECKING([for SXEmacs patchlevel])
 CURDIR=$(pwd)
 cd "$sxe_srcdir"
-if test "$have_git" = "yes"; then
-       sxemacs_git_version="$(git describe)"
-fi
-if test -z "$sxemacs_git_version" ; then
-       sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]"
-fi
+AS_IF([test "$have_git" = "yes"], 
+           [sxemacs_git_version=`git describe | head -1`])
+AS_IF([test -z "$sxemacs_git_version"],
+       sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]")
 AC_MSG_RESULT([$sxemacs_git_version])
 version="$sxemacs_git_version"
 cd "$CURDIR"
@@ -878,6 +877,8 @@ AS_MESSAGE([Let's look for the entire C build chain])
 SXE_CHECK_CC
 SXE_CHECK_CFLAGS
 
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
 ## check machine chars
 AS_MESSAGE([Let's have a detailed glance at your machine])
 SXE_PROC_CPUID
@@ -995,8 +996,11 @@ if test "$with_dynamic" = "yes"; then
        decosf* )
                ld_call_shared="-call_shared"
                ;;
-       darwin )
+       darwin* )
                AC_DEFINE([DLSYM_NEEDS_UNDERSCORE], [1], [Description here!])
+               if test "x$have_ld_no_pie" != "x"; then
+                       SXE_PREPEND_LINKER_FLAG([-no_pie], [ld_switch_site])
+               fi
                ;;
        esac
 else dnl "$with_dynamic" = "no"
@@ -1012,6 +1016,12 @@ else dnl "$with_dynamic" = "no"
        decosf* )
                ld_call_shared="-non_shared"
                ;;
+       darwin* )
+               AC_DEFINE([DLSYM_NEEDS_UNDERSCORE], [1], [Description here!])
+               if test "x$have_ld_no_pie" != "x"; then
+                       SXE_PREPEND_LINKER_FLAG([-no_pie], [ld_switch_site])
+               fi
+               ;;
        esac
 fi
 
@@ -1035,13 +1045,6 @@ dnl --------------------------------------------------
 dnl Determine the compiler, set up for feature testing
 dnl --------------------------------------------------
 
-dnl Sun Development environment support
-test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
-SXE_CHECK_FEATURE_DEPENDENCY([workshop], [tooltalk])
-if test "$with_workshop" = "yes"; then
-       AC_DEFINE([SUNPRO], [1], [Description here!])
-fi
-
 if test "$with_clash_detection" != "no"; then
        AC_DEFINE([CLASH_DETECTION], [1], [Description here!])
        SXE_ADD_CRUFT_OBJS([filelock.o])
@@ -1051,20 +1054,20 @@ fi
 dnl what exactly do we determine here? and where is it used?
 dnl dnl Determine GCC version.
 dnl if test "$GCC" = "yes"; then
-dnl    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+dnl    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 dnl int main ()
 dnl {
 dnl #if __GNUC__ >= 3
-dnl    return 11;
+dnl    return 11;
 dnl #else
-dnl    return 0;
+dnl    return 0;
 dnl #endif
 dnl }]])], [:], [dnl
 dnl case "$?" in
 dnl 11)
-dnl    echo "You appear to be using GCC version 3 or above."
-dnl    __GCC3=yes
-dnl    ;;
+dnl    echo "You appear to be using GCC version 3 or above."
+dnl    __GCC3=yes
+dnl    ;;
 dnl esac], [__GCC3=no])
 dnl fi
 
@@ -1119,10 +1122,10 @@ fi
 
 dnl dnl For debugging...
 dnl SXE_PRINT_VAR([libs_machine libs_system libs_termcap libs_standard
-dnl    objects_machine objects_system c_switch_machine c_switch_system
-dnl    ld_switch_machine ld_switch_system unexec ld_switch_shared
-dnl    ld lib_gcc ld_text_start_addr start_files ordinary_link
-dnl    have_terminfo mail_use_flock mail_use_lockf]) && echo ""
+dnl    objects_machine objects_system c_switch_machine c_switch_system
+dnl    ld_switch_machine ld_switch_system unexec ld_switch_shared
+dnl    ld lib_gcc ld_text_start_addr start_files ordinary_link
+dnl    have_terminfo mail_use_flock mail_use_lockf]) && echo ""
 
 dnl bitch at build attempt on win32 machines
 case "$opsys" in mingw* | cygwin*)
@@ -1138,7 +1141,7 @@ SXE_DO_CC_HACKS
 SXE_CHECK_SIMD_EXTENSIONS
 
 ## some linker flags that might come in handy
-SXE_CHECK_LINKER_FLAGS
+SXE_CHECK_LDFLAGS
 
 ## suffices to be defined late, for instance here
 SXE_CHECK_PARSER_LEXER
@@ -1151,7 +1154,7 @@ if test "$with_pdump" != "yes"; then
        ## enough.  Please report it, though.
        ## #### Should make this Solaris-friendly.
        ## Link with -z nocombreloc for now.
-       SXE_CHECK_LD_NOCOMBRELOC
+       SXE_CHECK_LD_ZFLAG([nocombreloc])
        if test "$sxe_cv_ld__z_nocombreloc" = "yes"; then
                SXE_PREPEND_LINKER_FLAG([-z nocombreloc], [ld_switch_site])
        fi
@@ -1259,9 +1262,8 @@ SXE_CHECK_FILE_LOCK
 
 case "$opsys" in decosf*)
        AC_CHECK_LIB([pthreads], [cma_open])
-       if test "$ac_cv_lib_pthreads_cma_open" = "yes"; then
-               c_switch_site="$c_switch_site -threads"
-       fi
+       AS_IF([test "$ac_cv_lib_pthreads_cma_open" = "yes"],
+               c_switch_site="$c_switch_site -threads")
        ;;
 esac
 
@@ -1274,7 +1276,7 @@ AC_MSG_CHECKING(whether the -xildoff compiler flag is required)
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then AC_MSG_RESULT(no);
-    else AC_MSG_RESULT(yes); SXE_APPEND(-xildoff, ld_switch_site)
+    else AC_MSG_RESULT(yes); SXE_APPEND_UNDUP(-xildoff, ld_switch_site)
   fi
   else AC_MSG_RESULT(no)
 fi
@@ -1285,7 +1287,7 @@ if test "$opsys" = "sol2"; then
     AC_MSG_CHECKING(for "-z ignore" linker flag)
     case "`ld -h 2>&1`" in
       *-z\ ignore\|record* ) AC_MSG_RESULT(yes)
-        SXE_PREPEND(-z ignore, ld_switch_site) ;;
+       SXE_PREPEND_UNDUP(-z ignore, ld_switch_site) ;;
       *) AC_MSG_RESULT(no) ;;
     esac
   fi
@@ -1602,30 +1604,25 @@ AC_CHECK_FUNC(readdir64_r, [AC_DEFINE([HAVE_LARGEFILE], [1], [Description here!]
 dnl Check for nlist.h
 AC_CHECK_HEADER([nlist.h], [AC_DEFINE([NLIST_STRUCT], [1], [Description here!])], [])
 
-dnl firstly check for pthread support so that we can use the 
+dnl firstly check for pthread support so that we can use the
 dnl asynchronous playing routines
 
-dnl special pthread handling 
+dnl special pthread handling
 dnl AIX uses pthreads instead of pthread, and HP/UX uses cma
 dnl FreeBSD uses -pthread
 AC_CHECK_LIB(pthread, pthread_create)
-if test $ac_cv_lib_pthread_pthread_create = yes; then
-  have_threads=yes
-  have_pthreads_opt=yes
-  case "`$CC -pthreads 2>&1`" in
-      *unrecognized\ option*) have_pthreads_opt=no ;;
-  esac
-  if test "$have_pthreads_opt" = "yes"; then
-       SXE_PREPEND(-pthreads, c_switch_site)
-  fi
-  have_pthread_opt=yes
-  case "`$CC -pthread 2>&1`" in
-     *unrecognized\ option*) have_pthread_opt=no ;;
-  esac
-  if test "$have_pthread_opt" = "yes"; then
-       SXE_PREPEND(-pthread, c_switch_site)
-  fi
-  SXE_PREPEND(-lpthread, MM_LIBS)
+if test "${ac_cv_lib_pthread_pthread_create}" = "yes"; then
+       have_threads=yes
+
+       SXE_CHECK_COMPILER_FLAGS([-pthreads])
+       SXE_CHECK_COMPILER_FLAGS([-pthread])
+       if test "${sxe_cv_c_flags__pthreads}" = "yes"; then
+               SXE_PREPEND_UNDUP([-pthreads], [c_switch_site])
+       fi
+       if test "${sxe_cv_c_flags__pthread}" = "yes"; then
+               SXE_PREPEND_UNDUP([-pthread], [c_switch_site])
+       fi
+       SXE_PREPEND([-lpthread], [MM_LIBS])
 fi
 
 dnl test for AIX pthreads
@@ -1635,7 +1632,7 @@ if test $ac_cv_lib_pthreads_pthread_create = yes; then
   SXE_PREPEND(-lpthreads, MM_LIBS)
 fi
 
-dnl test for HPUX cma threads. 
+dnl test for HPUX cma threads.
 AC_CHECK_LIB(cma, pthread_create)
 if test $ac_cv_lib_cma_pthread_create = yes; then
   have_threads=yes
@@ -1656,9 +1653,9 @@ AC_CACHE_VAL(ac_cv_ldflag_pthread,
 ])
 if eval "test \"`echo $ac_cv_ldflag_pthread`\" = yes"; then
        AC_MSG_RESULT(yes)
-        have_threads=yes
-        SXE_PREPEND("-pthread", ld_switch_site)
-        SXE_PREPEND("-D_THREAD_SAFE", c_switch_site)
+       have_threads=yes
+       SXE_PREPEND_UNDUP("-pthread", ld_switch_site)
+       SXE_PREPEND_UNDUP("-D_THREAD_SAFE", c_switch_site)
 else
        AC_MSG_RESULT(no)
 fi])
@@ -1688,7 +1685,12 @@ dnl Check for POSIX functions.
 dnl ----------------------------------------------------------------
 
 SXE_CHECK_BASIC_FUNS
-AC_CHECK_FUNCS([alarm cbrt closedir dup2 eaccess endpwent floor fmod fpathconf frexp fsync ftime ftruncate getaddrinfo getcwd gethostbyname gethostname getnameinfo getpagesize getrlimit gettimeofday getwd isascii link logb lrand48 matherr memchr memmove memset mkdir mktime munmap perror poll pow putenv random re_comp readlink regcomp rename res_init rint rmdir select setitimer setlocale setpgid setsid sigblock sighold sigprocmask snprintf socket sqrt stpcpy strcasecmp strchr strdup strerror strlwr strrchr strspn strtol strupr symlink tzset ulimit umask uname usleep utime vlimit vsnprintf waitpid wcscmp wcslen])
+AC_CHECK_FUNCS([alarm cbrt closedir dup2 eaccess endpwent floor fmod fpathconf frexp fsync ftime ftruncate getaddrinfo getcwd gethostbyname gethostname getnameinfo getpagesize getrlimit gettimeofday getwd isascii isatty link logb lrand48 matherr memchr memmove memset mkdir mktime munmap perror poll pow putenv random re_comp readlink regcomp rename res_init rint rmdir select setitimer setlocale setpgid setsid sigblock sighold sigprocmask snprintf socket sqrt stpcpy strncpy strncat strcasecmp strchr strdup strerror strlwr strrchr strspn strtol strupr symlink ttyname tzset ulimit umask uname usleep utime vlimit vsnprintf waitpid wcscmp wcslen])
+
+AS_IF([test "$have_isatty" = "yes"],
+       AC_DEFINE([HAVE_ISATTY], [1], [isatty is available]))
+AS_IF([test "$have_ttyname" = "yes"],
+      &