Whitespace cleanup in src/database
[sxemacs] / configure.ac
index 7162c93..f25ae84 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 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])
 
@@ -381,6 +382,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 +401,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 +452,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 +487,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
@@ -644,13 +637,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,7 +736,7 @@ OG_ARG_WITH([wnn6],
 dnl dnl Other Options
 dnl dnl =============
 dnl OG_OPTION_GROUP(Other options)
-dnl 
+dnl
 
 ## -------------------------------------------------------------------------
 ## Check for users who regularly forget about running autoconf
@@ -753,7 +746,7 @@ if test -f $0.ac -a $0.ac -nt $0; then
 fi
 
 #
-# 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
@@ -829,7 +822,7 @@ AC_MSG_CHECKING([for SXEmacs patchlevel])
 CURDIR=$(pwd)
 cd "$sxe_srcdir"
 if test "$have_git" = "yes"; then
-       sxemacs_git_version="$(git describe)"
+       sxemacs_git_version="$(git describe | head -1)"
 fi
 if test -z "$sxemacs_git_version" ; then
        sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]"
@@ -873,6 +866,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
@@ -1048,20 +1043,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
 
@@ -1116,10 +1111,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*)
@@ -1135,7 +1130,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
@@ -1148,7 +1143,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
@@ -1282,7 +1277,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_UNDUP(-z ignore, ld_switch_site) ;;
+       SXE_PREPEND_UNDUP(-z ignore, ld_switch_site) ;;
       *) AC_MSG_RESULT(no) ;;
     esac
   fi
@@ -1599,30 +1594,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_UNDUP(-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_UNDUP(-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
@@ -1632,7 +1622,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
@@ -1653,9 +1643,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_UNDUP("-pthread", ld_switch_site)
-        SXE_PREPEND_UNDUP("-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])
@@ -1774,11 +1764,11 @@ if test "$with_module_support $have_module_support" = "yes"; then
        SXE_APPEND([modules], [MAKE_AM_SUBDIR])
        SXE_APPEND([modules], [SRC_SUBDIR_DEPS])
 dnl else
-dnl    MOD_CC="$SXEMACS_CC"
-dnl    MODCFLAGS="\$(SXE_CFLAGS) -I../../src -I\$(sxe_srcdir)/../../src"
-dnl    INSTALLPATH=""
-dnl    MOD_INSTALL_PROGRAM="true"
-dnl    OBJECT_TO_BUILD="\$(MODNAME).o"
+dnl    MOD_CC="$SXEMACS_CC"
+dnl    MODCFLAGS="\$(SXE_CFLAGS) -I../../src -I\$(sxe_srcdir)/../../src"
+dnl    INSTALLPATH=""
+dnl    MOD_INSTALL_PROGRAM="true"
+dnl    OBJECT_TO_BUILD="\$(MODNAME).o"
 fi
 
 if test "$opsys" != "darwin"; then
@@ -1800,12 +1790,17 @@ if test "$opsys" != "darwin"; then
        have_ase_perm="yes"
        have_ase_resclass="yes"
 fi
-
-if test "$with_modules_cl" = "yes" -a "$have_bison" = "yes"; then
-       have_modules_cl="yes"
-fi
-if test "$with_static_modules_cl" = "yes" -a "$have_bison" = "yes"; then
-       have_static_modules_cl="yes"
+if test "$have_bison" = "yes"; then
+       if test "$with_modules_cl" = "yes" ; then
+               have_modules_cl="yes"
+       fi
+       if test "$with_static_modules_cl" = "yes"; then
+               have_static_modules_cl="yes"
+       fi
+else
+       if test "$with_modules_cl" = "yes" -o "$with_static_modules_cl" = "yes"; then
+               AC_MSG_WARN([Sorry no bison means no cl module for you.])
+       fi
 fi
 SXE_EMOD_STATMOD([cl])
 
@@ -2055,8 +2050,8 @@ return sin(0.0);
 return sin(0.0);
 ]])], [AC_MSG_RESULT([yes])], [
        AC_MSG_RESULT([no])
-        AC_MSG_WARN([No way to use math functions found. Reverting option append.])
-        LIBS=$save_LIBS])])
+       AC_MSG_WARN([No way to use math functions found. Reverting option append.])
+       LIBS=$save_LIBS])])
 
 
 
@@ -2102,12 +2097,12 @@ AC_DEFINE([WITH_NUMBER_TYPES], [1], [Description here!])
 SXE_SUBST_ENT_OBJS
 
 dnl experimental code support
-if test "$with_experimental_features_compre" = "yes"; then
+if test "$with_compre" != "no"; then
        AC_MSG_CHECKING([if compre prerequisites are met])
        AC_MSG_RESULT([yes])
        AC_DEFINE([EF_USE_COMPRE], [1],
                [Whether to provide compiled regular expression!])
-       have_experimental_features_compre=yes
+       have_compre=yes
 fi
 if test "$with_experimental_features_pom" = "yes"; then
        AC_MSG_CHECKING([if pom prerequisites are met])
@@ -2197,7 +2192,7 @@ SXE_CHECK_SUFFICIENCY([multicast], [multicast])
 
 dnl Decnet
 if test "$with_dnet" = "yes"; then
-  AC_CHECK_LIB(dnet, main, 
+  AC_CHECK_LIB(dnet, main,
     [AC_DEFINE([HAVE_LIBDNET], [1], [Description here!])],
     [SXE_DIE("DECnet requested but can't find libdnet")])
 fi
@@ -2221,131 +2216,6 @@ dnl ----------------------
 
 AS_MESSAGE([checking for specified window system])
 
-dnl Autodetection of Gdk libraries and includes
-dnl -------------------------------------------
-dnl On some systems (FreeBSD springs to mind), they use
-dnl versions on the utility routines, so instead of gtk-config
-dnl you must use gtk12-config, etc, etc.
-
-GNOME_CONFIG=no
-GTK_CONFIG=no
-
-if test "$with_gnome" != "no"; then
-   AC_MSG_CHECKING(for GNOME configuration script)
-   for possible in gnome-config
-   do
-      possible_version=`${possible} --version 2> /dev/null`
-      if test "x${possible_version}" != "x"; then
-              GNOME_CONFIG="${possible}"
-              with_gnome=yes
-              with_gtk=yes
-              break
-      fi
-   done
-   AC_MSG_RESULT([${GNOME_CONFIG}])
-fi
-
-if test "${GNOME_CONFIG}" != "no"; then
-      GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui`
-      GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui`
-      AC_DEFINE([HAVE_GNOME], [1], [Description here!])
-      SXE_APPEND(${GNOME_LIBS}, libs_gtk)
-      SXE_APPEND_UNDUP(${GNOME_CFLAGS}, c_switch_gtk)
-fi
-
-if test "$with_gtk" != "no";then
-   AC_MSG_CHECKING(for GTK configuration script)
-   for possible in gtk12-config gtk14-config gtk-config
-   do
-      possible_version=`${possible} --version 2> /dev/null`
-      if test "x${possible_version}" != "x"; then
-              GTK_CONFIG="${possible}"
-             case "${possible_version}" in
-               1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;;
-               1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;;
-               1.2.*)
-                       with_gtk=yes
-                       break
-                       ;;
-               *)     AC_MSG_WARN([Found unsupported version of GTK: $possible_version]);;
-             esac
-      fi
-   done
-   AC_MSG_RESULT([${GTK_CONFIG}])
-fi
-
-if test "${GTK_CONFIG}" != "no"; then
-      AC_MSG_CHECKING(gtk version)
-      GTK_VERSION=`${GTK_CONFIG} --version`
-      AC_MSG_RESULT(${GTK_VERSION})
-
-      AC_MSG_CHECKING(gtk libs)
-      GTK_LIBS=`${GTK_CONFIG} --libs`
-      SXE_APPEND(${GTK_LIBS}, libs_gtk)
-      AC_MSG_RESULT(${GTK_LIBS})
-
-      AC_MSG_CHECKING(gtk cflags)
-      GTK_CFLAGS=`${GTK_CONFIG} --cflags`
-      if test "$GCC" = "yes"; then
-       GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow"
-      fi
-      SXE_APPEND_UNDUP(${GTK_CFLAGS}, c_switch_gtk)
-      AC_MSG_RESULT(${GTK_CFLAGS})
-
-      AC_CHECK_LIB(gdk_imlib, main, SXE_PREPEND(-lgdk_imlib, libs_gtk))
-      AC_CHECK_LIB(Imlib, Imlib_init, SXE_APPEND(-lImlib, libs_gtk))
-      AC_CHECK_FUNCS(gdk_imlib_init)
-
-      AC_DEFINE([HAVE_XPM], [1], [Description here!])
-      AC_DEFINE([HAVE_GTK], [1], [Description here!])
-      AC_SUBST(GTK_CONFIG)
-
-      window_system=gtk
-      with_gtk=yes
-      if test "$with_x11" != "no"; then
-       AC_MSG_WARN([Configuring Gtk, this means:
-*** --with-athena  will have no effect
-*** --with-scrollbars  has been turned into a boolean option
-*** --with-menubars  has been turned into a boolean option
-*** --with-dialogs  has been turned into a boolean option
-*** --with-widgets  has been turned into a boolean option.])
-       with_x11=no
-      fi
-
-      test "${with_scrollbars}" != "no" && with_scrollbars=gtk
-      test "${with_toolbars}" != "no" && with_toolbars=gtk
-      test "${with_menubars}" != "no" && with_menubars=gtk
-      test "${with_dialogs}" != "no" && with_dialogs=gtk
-      test "${with_widgets}" != "no" && with_widgets=gtk
-
-      SXE_ADD_SXEUIGTK_OBJS(console-gtk.o device-gtk.o event-gtk.o frame-gtk.o)
-      SXE_ADD_SXEUIGTK_OBJS(objects-gtk.o redisplay-gtk.o glyphs-gtk.o)
-      SXE_ADD_SXEUIGTK_OBJS(select-gtk.o gccache-gtk.o)
-      SXE_ADD_SXEUIGTK_OBJS(gtk-xemacs.o ui-gtk.o)
-
-      dnl Check for libglade support (it rocks)
-      OLD_CFLAGS="${CFLAGS}"
-      OLD_CPPFLAGS="${CPPFLAGS}"
-      OLD_LDFLAGS="${LDFLAGS}"
-      CFLAGS="${GTK_CFLAGS} ${CFLAGS}"
-      CPPFLAGS="${GTK_CFLAGS} ${CFLAGS}"
-      LDFLAGS="${LDFLAGS} ${GTK_LIBS}"
-      AC_CHECK_HEADERS(glade/glade.h glade.h)
-      AC_CHECK_LIB(xml, main, SXE_PREPEND(-lxml, libs_gtk))
-      AC_CHECK_LIB(glade, main, SXE_PREPEND(-lglade, libs_gtk))
-      AC_CHECK_LIB(glade-gnome, main, SXE_PREPEND(-lglade-gnome, libs_gtk))
-      AC_EGREP_HEADER([char \*txtdomain;], [glade/glade-xml.h],
-                      [AC_MSG_RESULT(yes)
-                       AC_DEFINE([LIBGLADE_XML_TXTDOMAIN], [1], [Description here!])],
-                      [AC_MSG_RESULT(no)])
-      CFLAGS="${OLD_CFLAGS}"
-      CPPFLAGS="${OLD_CPPFLAGS}"
-      LDFLAGS="${OLD_LDFLAGS}"
-fi
-
-dnl We may eventually prefer gtk/gdk over vanilla X11...
-dnl Are we mad? We need stuff from the X11 even _with_ gtk!!!
-
 if test "$with_x" != "no"; then
        if test "$with_x11" != "no"; then
                dnl User-specified --x-includes or --x-libraries implies --with-x11.
@@ -2358,7 +2228,7 @@ if test "$with_x" != "no"; then
        dnl -------------------------------------------
        dnl AC_PATH_XTRA thinks it can find our X headers and includes, but
        dnl it often gets it wrong, so we only use it as a last resort.
-       
+
        dnl $OPENWINHOME implies --x-includes and --x-libraries
        dnl Not (yet) handled by autoconf2
        if test "$x_includes $x_libraries" = "NONE NONE" \
@@ -2398,7 +2268,7 @@ if test "$with_x" != "no"; then
                        "/usr/X11R6/lib" "/usr/lib/X11R6" \
                        "/usr/local/lib" "/usr/local/lib/X11" \
                        "/usr/lib" "/usr/lib/X11"; do
-                       if test -r "$dir/libX11.a"; then
+                       if test -r "$dir/libX11.a"; then
                                x_libraries="$dir"
                                break
                        fi
@@ -2406,9 +2276,6 @@ if test "$with_x" != "no"; then
        fi
 
        AC_PATH_XTRA
-       ## Autoconf claims to find X library and include dirs for us.
-       ## dnl encapsulate that, such that Xaw and motif is not used when gtk is
-       ## in effect
        if test "$with_x11" != "no"; then
                if test "$no_x" = "yes"; then
                        with_x11=no
@@ -2455,15 +2322,15 @@ if test "$with_x11" = "yes"; then
        if test "$ac_cv_header_Xm_Xm_h" = "yes"; then
                AC_CHECK_LIB([Xm], [XmStringFree], [got_motif=yes])
        fi
-       
+
        if test "$got_motif" != "yes"; then
                dnl Try to find Motif dirs
                dnl These take precedence over other X libs/includes, so PRE-pend
                for lib_dir in \
                        "/usr/dt/lib" "/usr/lib/Motif2.1" \
                        "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
-                       inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
-                       if test -d "$lib_dir" -a -d "$inc_dir"; then
+                       inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
+                       if test -d "$lib_dir" -a -d "$inc_dir"; then
                                case "$x_libraries" in
                                *"$lib_dir"* )
                                        ;;
@@ -2517,9 +2384,9 @@ if test "$with_x11" = "yes"; then
                fi
                ;;
        esac
-       
+
        LDFLAGS="$LDFLAGS $X_LIBS"
-       
+
        if test "$extra_verbose" = "yes"; then
                echo
                echo "X11 compilation variables:"
@@ -2556,7 +2423,7 @@ dnl   if mkdir conftestdir; then
 dnl     cd conftestdir
 dnl     cat > Imakefile <<'EOF'
 dnl xetest:
-dnl    @echo ${PROTO_DEFINES} ${STD_DEFINES}
+dnl    @echo ${PROTO_DEFINES} ${STD_DEFINES}
 dnl EOF
 dnl     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
 dnl       # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
@@ -2568,18 +2435,18 @@ dnl     for word in $xmkmf_defines; do
 dnl       case "$word" in
 dnl       -D__STDC__*) ;;
 dnl       -D* )
-dnl    sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
-dnl    case "$word" in
-dnl      -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
-dnl      *     ) val=1 ;;
-dnl    esac
+dnl    sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
+dnl    case "$word" in
+dnl      -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
+dnl      *     ) val=1 ;;
+dnl    esac
 dnl dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
-dnl    if grep "^#define $sym " confdefs.h >/dev/null; then :; else
-dnl      if test "$val" = "1"
-dnl        then AC_DEFINE_UNQUOTED([$sym], [], [Description here!])
-dnl        else AC_DEFINE_UNQUOTED([$sym], [$val], [Description here!])
-dnl      fi
-dnl    fi  ;;
+dnl    if grep "^#define $sym " confdefs.h >/dev/null; then :; else
+dnl      if test "$val" = "1"
+dnl        then AC_DEFINE_UNQUOTED([$sym], [], [Description here!])
+dnl        else AC_DEFINE_UNQUOTED([$sym], [$val], [Description here!])
+dnl      fi
+dnl    fi  ;;
 dnl       esac
 dnl     done
 dnl   fi
@@ -2599,7 +2466,7 @@ dnl   fi
 
        dnl -lXt and -lX11 are required
        dnl Some broken systems require the magic "-b i486-linuxaout" flag
-       
+
        dnl Other broken systems will not pass these tests unless the pre and
        dnl extra libs are passed on...
        LIBS="$LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
@@ -2620,7 +2487,7 @@ dnl   fi
        dnl Require -lXt
        AC_CHECK_LIB([Xt], [XtOpenDisplay], [SXE_PREPEND([-lXt], [libs_x])], [
                AC_MSG_ERROR([Unable to find X11 libraries. Try using --x-libraries=<path> if you know the path, or --with-x=no to disable X11 support.])])
-       
+
        AC_MSG_CHECKING([the version of X11 being used])
        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <X11/Intrinsic.h>
@@ -2628,15 +2495,15 @@ int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }]])],
                [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
        AC_MSG_RESULT(R${x11_release})
        AC_DEFINE_UNQUOTED([X11_RELEASE], [${x11_release}], [Description here!])
-       
+
        AC_CHECK_FUNCS([XConvertCase])
        AC_CHECK_LIB([Xt], [XtRegisterDrawable])
        if test "$ac_cv_lib_Xt_XtRegisterDrawable" = "yes"; then
                AC_DEFINE([HAVE_XTREGISTERDRAWABLE], [1], [Description])
        fi
-       
+
        AC_CHECK_HEADERS(X11/Xlocale.h)
-       
+
        dnl XFree86 has a non-standard prototype for this X11R6 function
        AC_CHECK_FUNCS(XRegisterIMInstantiateCallback)
        AC_MSG_CHECKING(for standard XRegisterIMInstantiateCallback prototype)
@@ -2662,7 +2529,7 @@ extern Bool XRegisterIMInstantiateCallback(
                SXE_PREPEND([-lXmu], [libs_x])
                AC_DEFINE([HAVE_XMU], [1], [Description here!])
        fi
-       
+
        dnl Autodetect -lXbsd
        dnl #### Someone, please add a better function than main
        AC_CHECK_LIB([Xbsd], [main], SXE_PREPEND([-lXbsd], [libs_x]))
@@ -2720,11 +2587,6 @@ bitmapdir=
 
 case "$window_system" in
   x11  ) HAVE_X_WINDOWS=yes; echo "  Using X11." ;;
-  gtk  )
-       HAVE_X_WINDOWS=no
-       test "$with_gnome" = "yes" && echo "  Using GNOME."
-       test "$with_gnome" = "no" && echo "  Using GTK."
-       ;;
   none ) HAVE_X_WINDOWS=no ; echo "  Using no window system." ;;
 esac
 
@@ -2754,27 +2616,11 @@ AC_CHECK_HEADER([X11/Xauth.h], [:], [with_xauth=no])
 AC_CHECK_LIB([Xau], [XauGetAuthByAddr], [:], [with_xauth=no])
 if test "$with_xauth" = "yes"; then
   AC_DEFINE([HAVE_XAUTH], [1], [Description here!])
-  SXE_CONSECUTIVE_UNDUP([libs_xauth], [$GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS])
+  SXE_CONSECUTIVE_UNDUP([libs_xauth], [$X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS])
 fi
 SXE_RESTORE_LIBS
 AC_SUBST(libs_xauth)
 
-dnl ----------------------
-dnl GTK-Specific Graphics libraries
-dnl ----------------------
-
-if test "$with_gtk" = "yes"; then
-       dnl Autodetect XFACE
-       have_image_xface=yes
-       AC_CHECK_HEADER([compface.h], [], [have_image_xface=no])
-       AC_CHECK_LIB([compface], [UnGenFace], [:], [have_image_xface=no])
-       if test "$have_image_xface" = "yes"; then
-               AC_DEFINE([HAVE_XFACE], [1], [Description here!])
-               SXE_PREPEND(-lcompface, libs_gtk)
-       fi
-fi
-
-
 dnl ----------------------
 dnl X-Specific Graphics libraries
 dnl ----------------------
@@ -2804,8 +2650,6 @@ dnl ----------------------
 if test "$with_x11" = "yes" -a "$with_x" != "no"; then
        SXE_CHECK_XTOOLKITS
        SXE_CHECK_XT_DEPENDENCIES
-elif test "$with_gtk" = "yes" -o "$with_gnome" = "yes"; then
-       SXE_CHECK_GTK_DEPENDENCIES
 else
        with_menubars=no
        with_scrollbars=no
@@ -2837,9 +2681,6 @@ if test "$with_offix" = "yes"; then
   SXE_APPEND(offix.o, dnd_objs)
   SXE_APPEND(OffiX, dragndrop_proto)
 fi
-if test "$with_gtk" = "yes"; then
-   SXE_APPEND(GTK, dragndrop_proto)
-fi
 
 
 ## TTY Options
@@ -2903,8 +2744,8 @@ if test "$with_tty" != "no"  ; then
            AC_CHECK_HEADER(term.h,    curses_h_file=term.h)
       fi
       if test -n "$curses_h_file"
-        then AC_MSG_WARN([Your system has the bogus ncurses include bug.])
-        else c_switch_site="$save_c_switch_site"
+       then AC_MSG_WARN([Your system has the bogus ncurses include bug.])
+       else c_switch_site="$save_c_switch_site"
       fi
     fi
   fi
@@ -2919,14 +2760,14 @@ if test "$with_tty" != "no"  ; then
     done
 
     for lib in curses terminfo termlib termcap; do
-          have_lib_eval=`eval echo \\$have_$lib`
-          if test "$have_lib_eval" = "yes"; then
-               AC_CHECK_LIB($lib, tparm, 
+         have_lib_eval=`eval echo \\$have_$lib`
+         if test "$have_lib_eval" = "yes"; then
+               AC_CHECK_LIB($lib, tparm,
                          SXE_ADD_SXEUITTY_OBJS(terminfo.o),
                          SXE_ADD_SXEUITTY_OBJS(tparam.o))
-               SXE_PREPEND(-l${lib}, LIBS)
-                break
-          fi
+               SXE_PREPEND(-l${lib}, LIBS)
+               break
+         fi
     done
   fi
   if test -n "$curses_h_file"; then
@@ -3107,7 +2948,7 @@ if test "$with_media_internal" != "no"; then
        have_media_internal=yes
 fi
 
-## Since almost any of the below tests uses pkgconfig we make a 
+## Since almost any of the below tests uses pkgconfig we make a
 ## once-for-all-times check now
 SXE_SEARCH_CONFIG_PROG([pkg-config])
 
@@ -3251,7 +3092,8 @@ if test "$with_sound_esd" != "no"; then
                AC_MSG_RESULT([yes])
                need_internal_media=yes
                SXE_ADD_MM_OBJS([sound-esd.o])
-               SXE_PREPEND([`$ESD_CONFIG --libs`], MM_LIBS)
+               ESD_LIBS=$("${ESD_CONFIG}" --libs)
+               SXE_PREPEND(["${ESD_LIBS}"], [MM_LIBS])
                AC_DEFINE([HAVE_ESD_SOUND], [1], [Description here!])
        else
                AC_MSG_RESULT([no])
@@ -3314,7 +3156,7 @@ if test "$with_sound_jack" != "no"; then
        AC_MSG_CHECKING([for sufficient Jack support])
        if test "$have_sound_jack" = "yes"; then
                AC_MSG_RESULT([yes])
-               dnl okay, we have Jack on the system, but we have no working 
+               dnl okay, we have Jack on the system, but we have no working
                dnl interface to it :(
                JACK_LIBS=`$PKG_CONFIG --libs jack`
                JACK_VERSION=`$PKG_CONFIG --modversion jack`
@@ -3607,8 +3449,8 @@ else
 fi
 
 SXE_UNDUP(CFLAGS, $CFLAGS)
-SXE_UNDUP(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system)
-SXE_UNDUP(c_switch_window_system, $c_switch_x_site $c_switch_gtk $X_CFLAGS)
+SXE_UNDUP(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system $CFLAGS $CPPFLAGS)
+SXE_UNDUP(c_switch_window_system, $c_switch_x_site $X_CFLAGS)
 SXE_UNDUP(c_switch_all, $c_switch_general $c_switch_window_system)
 SXE_UNDUP(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run)
 SXE_UNDUP(ld_switch_window_system, $ld_switch_x_site)
@@ -3616,7 +3458,7 @@ SXE_UNDUP(ld_switch_all, $ld_switch_general $ld_switch_window_system)
 dnl Since some systems need libs to be restated later, we can't just dedup, we can only safely dedup
 dnl consecutive occurrences
 SXE_CONSECUTIVE_UNDUP(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard)
-SXE_CONSECUTIVE_UNDUP(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS)
+SXE_CONSECUTIVE_UNDUP(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $X_PRE_LIBS)
 SXE_CONSECUTIVE_UNDUP(ld_libs_all, $OPENSSL_LIBS $DB_LIBS $ENT_LIBS $MM_LIBS $ld_libs_window_system $ld_libs_general $ld_libs_module)
 
 dnl For no-module builds, make the src dir last
@@ -3635,7 +3477,7 @@ test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
   case "$dir" in */* ) dnl Implement mkdir -p
     ( for d in `echo $dir | sed 's:/: :g'` ; do
-        test -d "$d" || mkdir "$d"; cd "$d"
+       test -d "$d" || mkdir "$d"; cd "$d"
       done ) ;;
    * ) test -d "$dir" || mkdir "$dir" ;;
   esac
@@ -3670,7 +3512,7 @@ fi
 
 ### whether to build with profile.o
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main(int c, char *v[]) 
+int main(int c, char *v[])
 {
 #ifdef HAVE_SETITIMER
        return 1;
@@ -3683,7 +3525,7 @@ AM_CONDITIONAL([HAVE_SETITIMER], [test "$have_setitimer" = "1"])
 
 ## whether to build with sheap.o
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main(int c, char *v[]) 
+int main(int c, char *v[])
 {
 #if defined(HEAP_IN_DATA) && !defined(PDUMP)
        return 1;
@@ -3792,10 +3634,10 @@ fi
 
 if test -z "$with_package_path" && test -n "$with_package_prefix" ; then
   if test "$with_mule" = "yes" ; then
-    with_package_path="~/.sxemacs/site-packages:~/.sxemacs/xemacs-packages:~/.sxemacs/mule-packages:~/.sxemacs/sxemacs-packages"
+    with_package_path="~/.sxemacs/site-packages:~/.sxemacs/sxemacs-packages:~/.sxemacs/xemacs-packages:~/.sxemacs/mule-packages"
     with_package_path="${with_package_path}:${with_package_prefix}/site-packages:${with_package_prefix}/sxemacs-packages:${with_package_prefix}/xemacs-packages:${with_package_prefix}/mule-packages"
   else
-    with_package_path="~/.sxemacs/site-packages:~/.sxemacs/xemacs-packages:~/.sxemacs/sxemacs-packages"
+    with_package_path="~/.sxemacs/site-packages:~/.sxemacs/sxemacs-packages:~/.sxemacs/xemacs-packages"
     with_package_path="${with_package_path}:${with_package_prefix}/site-packages:${with_package_prefix}/sxemacs-packages:${with_package_prefix}/xemacs-packages"
   fi
 fi
@@ -3921,11 +3763,11 @@ case `$MAKE --version 2>/dev/null` in
    ;;
    *)
        echo ===================================
-        echo $MAKE does not seem to be GNU Make
-        echo If you find makefile errors please try using GNU Make as some 
-        echo autoconf constructs may not be proper for your make variant
+       echo $MAKE does not seem to be GNU Make
+       echo If you find makefile errors please try using GNU Make as some
+       echo autoconf constructs may not be proper for your make variant
        echo ===================================
-   ;; 
+   ;;
 esac
 AC_SUBST(RECURSIVE_MAKE_ARGS)
 AC_SUBST(AM_MAKEFLAGS)
@@ -4214,7 +4056,7 @@ SXE_CANONICALISE_PATH([ABS_ETCDIR])
 AC_SUBST([ABS_PROGNAME])
 AC_SUBST([ABS_ETCDIR])
 
-AC_CONFIG_FILES([src/sxe-paths.h]) 
+AC_CONFIG_FILES([src/sxe-paths.h])
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([lib-src/Makefile])
 AC_CONFIG_FILES([src/Makefile])
@@ -4222,7 +4064,6 @@ AC_CONFIG_FILES([src/ui/Makefile])
 AC_CONFIG_FILES([src/ui/TTY/Makefile])
 AC_CONFIG_FILES([src/ui/lwlib/Makefile])
 AC_CONFIG_FILES([src/ui/X11/Makefile])
-AC_CONFIG_FILES([src/ui/Gtk/Makefile])
 AC_CONFIG_FILES([src/events/Makefile])
 AC_CONFIG_FILES([src/ent/Makefile])
 AC_CONFIG_FILES([src/media/Makefile])