Summary: fix to cosmetics, add AM_PROG_AR conditionally
[sxemacs] / configure.ac
index 9b2fd54..2a483f0 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
@@ -67,7 +68,7 @@ AC_COPYRIGHT(
 ###    config.status is removed.
 ])
 
-AC_REVISION([SXEM4CS_ARCH_VERSION])
+AC_REVISION([SXEM4CS_GIT_VERSION])
 
 
 dnl Build Options
@@ -744,11 +745,6 @@ 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])
-
 
 ## -------------------------------------------------------------------------
 ## Check for users who regularly forget about running autoconf
@@ -819,7 +815,7 @@ SXE_EXPLORE_BUILD_ENVIRONMENT
 dnl ----------------------------------------
 dnl Find out which version of SXEmacs this is
 dnl ----------------------------------------
-AC_CHECK_PROG([have_tla], [tla], [yes], [no])
+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
@@ -833,25 +829,16 @@ fi
 AC_MSG_CHECKING([for SXEmacs patchlevel])
 CURDIR=$(pwd)
 cd "$sxe_srcdir"
-if test "$have_tla" = "yes"; then
-       sxemacs_arch_version="$(tla logs -f 2>/dev/null|tail -n1)"
-fi
-if test -z "$sxemacs_arch_version" ; then
-       sxemacs_arch_version="[]SXEM4CS_ARCH_VERSION[]"
+if test "$have_git" = "yes"; then
+       sxemacs_git_version="$(git describe)"
 fi
-AC_MSG_RESULT([$sxemacs_arch_version])
-version="$sxemacs_arch_version"
-AC_MSG_CHECKING([for last main branch SXEmacs patchlevel sync])
-if test "$have_tla" = "yes"; then
-       sxemacs_main_version="$(tla log-versions 2>/dev/null|grep -- '--main--' 2>/dev/null|tail -n1)"
-       sxemacs_main_arch_version="$(tla logs -f $sxemacs_main_version 2>/dev/null|tail -n1)"
-fi
-if test -z "$sxemacs_main_arch_version" ; then
-       sxemacs_main_arch_version="[]SXEM4CS_MAIN_ARCH_VERSION[]"
+if test -z "$sxemacs_git_version" ; then
+       sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]"
 fi
+AC_MSG_RESULT([$sxemacs_git_version])
+version="$sxemacs_git_version"
 cd "$CURDIR"
-AC_MSG_RESULT([$sxemacs_main_arch_version])
-main_version="$sxemacs_arch_version"
+main_version="$sxemacs_git_version"
 AC_DEFINE_UNQUOTED([EMACS_MAJOR_VERSION], [SXEM4CS_MAJOR_VERSION], [Description here!])
 AC_DEFINE_UNQUOTED([EMACS_MINOR_VERSION], [SXEM4CS_MINOR_VERSION], [Description here!])
 old_version=[]SXEM4CS_VERSION[]
@@ -869,8 +856,7 @@ if test -n "[]SXEM4CS_BETA_VERSION[]"; then
 fi
 AC_DEFINE_UNQUOTED([SXEMACS_CODENAME], ["[]SXEM4CS_CODENAME[]"], [Description here!])
 AC_DEFINE_UNQUOTED([EMACS_VERSION], ["$version"], [Description here!])
-AC_DEFINE_UNQUOTED([SXEMACS_MAIN_ARCH_VERSION], ["$sxemacs_main_arch_version"], [Description here!])
-AC_DEFINE_UNQUOTED([SXEMACS_ARCH_VERSION], ["$sxemacs_arch_version"],
+AC_DEFINE_UNQUOTED([SXEMACS_GIT_VERSION], ["$sxemacs_git_version"],
        [Description here!])
 
 PROGNAME=sxemacs
@@ -888,6 +874,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
@@ -1005,8 +993,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"
@@ -1022,6 +1013,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
 
@@ -1045,13 +1042,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])
@@ -1284,7 +1274,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
@@ -1295,7 +1285,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
@@ -1619,23 +1609,18 @@ 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
@@ -1667,8 +1652,8 @@ 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)
+        SXE_PREPEND_UNDUP("-pthread", ld_switch_site)
+        SXE_PREPEND_UNDUP("-D_THREAD_SAFE", c_switch_site)
 else
        AC_MSG_RESULT(no)
 fi])
@@ -1813,12 +1798,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])
 
@@ -2263,7 +2253,7 @@ if test "${GNOME_CONFIG}" != "no"; then
       GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui`
       AC_DEFINE([HAVE_GNOME], [1], [Description here!])
       SXE_APPEND(${GNOME_LIBS}, libs_gtk)
-      SXE_APPEND(${GNOME_CFLAGS}, c_switch_gtk)
+      SXE_APPEND_UNDUP(${GNOME_CFLAGS}, c_switch_gtk)
 fi
 
 if test "$with_gtk" != "no";then
@@ -2302,7 +2292,7 @@ if test "${GTK_CONFIG}" != "no"; then
       if test "$GCC" = "yes"; then
        GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow"
       fi
-      SXE_APPEND(${GTK_CFLAGS}, c_switch_gtk)
+      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))
@@ -2470,7 +2460,7 @@ if test "$with_x11" = "yes"; then
        fi
        
        if test "$got_motif" != "yes"; then
-               dnl Try to find Motif/CDE/Tooltalk dirs
+               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" \
@@ -2490,7 +2480,7 @@ if test "$with_x11" = "yes"; then
                                        ;;
                                *)
                                        x_includes="$inc_dir $x_includes"
-                                       SXE_PREPEND(["-I${inc_dir}"], [X_CFLAGS])
+                                       SXE_PREPEND_UNDUP(["-I${inc_dir}"], [X_CFLAGS])
                                        ;;
                                esac
                                break; dnl only need ONE Motif implementation!
@@ -2515,7 +2505,7 @@ if test "$with_x11" = "yes"; then
                                ;;
                        *)
                                x_includes="$x_includes $inc_dir"
-                               SXE_APPEND(["-I${inc_dir}"], [X_CFLAGS])
+                               SXE_APPEND_UNDUP(["-I${inc_dir}"], [X_CFLAGS])
                                ;;
                        esac
                        break; dnl Only need ONE X11 implementation !
@@ -2710,7 +2700,7 @@ if test "$with_x11" != "yes"; then
   dnl if test "$with_tty" = "no" ; then
   dnl   AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
   dnl fi
-  for feature in tooltalk cde offix wmcommand xim xmu nas_sound
+  for feature in offix wmcommand xim xmu nas_sound
   do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
        AC_MSG_WARN([--with-$feature ignored:  Not valid without X support])
@@ -2767,7 +2757,7 @@ 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_SPACE([libs_xauth], [$GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS])
+  SXE_CONSECUTIVE_UNDUP([libs_xauth], [$GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS])
 fi
 SXE_RESTORE_LIBS
 AC_SUBST(libs_xauth)
@@ -2827,55 +2817,6 @@ else
        with_widgets=no
 fi
 
-dnl Autodetect tooltalk
-if test "$with_tooltalk" != "no" ; then
-  dnl autodetect the location of tt_c.h
-  dnl tt_c.h might be in Tt or desktop include directories
-  for dir in "" "Tt/" "desktop/" ; do
-    AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_file="${dir}tt_c.h"; break)
-  done
-  if test -z "$tt_c_h_file"; then
-    if test "$with_tooltalk" = "yes"; then
-      SXE_USAGE_ERROR("Unable to find required tooltalk header files.")
-    fi
-    with_tooltalk=no
-  fi
-fi
-if test "$with_tooltalk" != "no" ; then
-  for extra_libs in "" "-lI18N -lce" "-lcxx"; do
-    AC_CHECK_LIB(tt, tt_message_create,
-      tt_libs="-ltt $extra_libs"; break, [:],$extra_libs)
-  done
-  if test -z "$tt_libs"; then
-    if test "$with_tooltalk" = "yes"; then
-      SXE_USAGE_ERROR("Unable to find required tooltalk libraries.")
-    fi
-    with_tooltalk=no
-  fi
-fi
-if test "$with_tooltalk" = "yes"; then
-  AC_DEFINE([TOOLTALK], [1], [Description here!])
-  AC_DEFINE_UNQUOTED([TT_C_H_FILE], ["$tt_c_h_file"], [Description here!])
-  SXE_PREPEND($tt_libs, libs_x)
-fi
-
-dnl Autodetect CDE
-AC_CHECK_HEADER(Dt/Dt.h, , with_cde=no)
-AC_CHECK_LIB(DtSvc, DtDndDragStart, [:], with_cde=no)
-if test "$with_dragndrop" = "no" ; then
-  if test "$with_cde" = "yes" ; then
-    AC_MSG_WARN([--with-cde forced to `no'; no generic Drag'n'Drop support])
-  fi
-  with_cde=no
-fi
-if test "$with_cde" = "yes" ; then
-  AC_DEFINE([HAVE_CDE], [1], [Description here!])
-  SXE_PREPEND(-lDtSvc, libs_x)
-  SXE_APPEND(CDE, dragndrop_proto)
-  with_tooltalk=yes # CDE requires Tooltalk
-  need_motif=yes    # CDE requires Motif
-fi
-
 dnl Always compile OffiX unless --without-offix is given, no
 dnl X11 support is compiled in, no standard Xmu is available,
 dnl or dragndrop support is disabled
@@ -2894,12 +2835,6 @@ if test "$with_dragndrop" = "no" ; then
   fi
   with_offix=no
 fi
-if test "$with_cde" = "yes" ; then
-  if test "$with_offix" = "yes" ; then
-    AC_MSG_WARN([--with-offix forced to `no'; CDE already found])
-  fi
-  with_offix=no
-fi
 if test "$with_offix" = "yes"; then
   AC_DEFINE([HAVE_OFFIX_DND], [1], [Description here!])
   SXE_APPEND(offix.o, dnd_objs)
@@ -3147,8 +3082,8 @@ if test "$with_image_png" = "yes"; then
        SXE_MSG_CHECKING([for sufficient PNG support])
        SXE_MSG_RESULT([${sxe_cv_feat_png}])
        if test "$sxe_cv_feat_png" = "yes"; then
-               SXE_PREPEND([$PNG_CPPFLAGS], [MM_CPPFLAGS])
-               SXE_PREPEND([$PNG_LDFLAGS], [MM_LDFLAGS])
+               SXE_PREPEND_UNDUP([$PNG_CPPFLAGS], [MM_CPPFLAGS])
+               SXE_PREPEND_UNDUP([$PNG_LDFLAGS], [MM_LDFLAGS])
                SXE_PREPEND([$PNG_LIBS], [MM_LIBS])
        fi
 fi
@@ -3190,7 +3125,7 @@ if test "$with_media_sndfile" != "no"; then
                SNDFILE_CPPFLAGS=`$PKG_CONFIG --cflags sndfile`
                SNDFILE_VERSION=`$PKG_CONFIG --modversion sndfile`
                SXE_PREPEND([$SNDFILE_LIBS], [MM_LIBS])
-               SXE_PREPEND([$SNDFILE_CPPFLAGS], [MM_CPPFLAGS])
+               SXE_PREPEND_UNDUP([$SNDFILE_CPPFLAGS], [MM_CPPFLAGS])
                SXE_ADD_MM_OBJS([media-sndfile.o])
                AC_DEFINE([HAVE_SNDFILE], [1],
                        [Whether we appear to have support for the sndfile library!])
@@ -3213,7 +3148,7 @@ if test "$with_media_ffmpeg" != "no"; then
                FFMPEG_LIBS=`$PKG_CONFIG --libs libavformat`
                FFMPEG_CPPFLAGS=`$PKG_CONFIG --cflags libavformat`
                SXE_PREPEND($FFMPEG_LIBS, MM_LIBS)
-               SXE_PREPEND($FFMPEG_CPPFLAGS, MM_CPPFLAGS)
+               SXE_PREPEND_UNDUP($FFMPEG_CPPFLAGS, MM_CPPFLAGS)
                SXE_ADD_MM_OBJS([media-ffmpeg.o])
                AC_DEFINE([HAVE_FFMPEG], [1], [Description here!])
        else
@@ -3231,8 +3166,8 @@ if test "$with_media_sox" != "no"; then
        if test "$sxe_cv_feat_sox" = "yes"; then
                AC_MSG_RESULT([yes])
                SXE_ADD_MM_OBJS([media-sox.o])
-               SXE_PREPEND([$sox_cppflags], [MM_CPPFLAGS])
-               SXE_PREPEND([$sox_ldflags], [MM_LDFLAGS])
+               SXE_PREPEND_UNDUP([$sox_cppflags], [MM_CPPFLAGS])
+               SXE_PREPEND_UNDUP([$sox_ldflags], [MM_LDFLAGS])
                SXE_PREPEND([$sox_libs], [MM_LIBS])
                AC_DEFINE([HAVE_SOX], [1], [Description here!])
        else
@@ -3364,7 +3299,7 @@ if test "$with_sound_arts" != "no"; then
                ARTS_CPPFLAGS=`$ARTSC_CONFIG --cflags`
                SXE_ADD_MM_OBJS([sound-arts.o])
                SXE_PREPEND([$ARTS_LIBS], [MM_LIBS])
-               SXE_PREPEND([$ARTS_CPPFLAGS], [MM_CPPFLAGS])
+               SXE_PREPEND_UNDUP([$ARTS_CPPFLAGS], [MM_CPPFLAGS])
                AC_DEFINE([HAVE_ARTS_SOUND], [1], [Description here!])
                AC_DEFINE_UNQUOTED([ARTS_VERSION], [$ARTS_VERSION],
                        [Version number of the underlying arts library])
@@ -3667,23 +3602,25 @@ dnl Compute SUBST-itutable variables
 dnl --------------------------------
 
 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM)
-dnl Use SXE_SPACE instead of plain assignment statements to remove extraneous blanks
+dnl Use SXE_CONSECUTIVE_UNDUP instead of plain assignment statements to remove extraneous blanks
 if test "$with_module_support" = "yes"; then
        ld_libs_module=
 else
-       SXE_SPACE(ld_libs_module, $ldap_libs $postgresql_libs)
-fi
-
-SXE_SPACE(CFLAGS, $CFLAGS)
-SXE_SPACE(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system)
-SXE_SPACE(c_switch_window_system, $c_switch_x_site $c_switch_gtk $X_CFLAGS)
-SXE_SPACE(c_switch_all, $c_switch_general $c_switch_window_system)
-SXE_SPACE(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run)
-SXE_SPACE(ld_switch_window_system, $ld_switch_x_site)
-SXE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system)
-SXE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard)
-SXE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS)
-SXE_SPACE(ld_libs_all, $OPENSSL_LIBS $DB_LIBS $ENT_LIBS $MM_LIBS $ld_libs_window_system $ld_libs_general $ld_libs_module)
+       SXE_CONSECUTIVE_UNDUP(ld_libs_module, $ldap_libs $postgresql_libs)
+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_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)
+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_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
 if test "$with_module_support" = "no"; then
@@ -3714,15 +3651,6 @@ AC_SUBST(MAKE_SUBDIR)
 AC_SUBST(MAKE_AM_SUBDIR)
 AC_SUBST(SUBDIR_MAKEFILES)
 
-if test "$extra_verbose" = "yes"; then
-  echo ""
-  SXE_PRINT_VAR(
-   c_switch_general  c_switch_window_system  c_switch_all
-  ld_switch_general ld_switch_window_system ld_switch_all
-    ld_libs_general   ld_libs_window_system   ld_libs_all)
-  echo ""
-fi
-
 dnl ----------------------------------------------
 dnl Create some auxiliary files for developers.
 dnl ----------------------------------------------
@@ -3807,7 +3735,7 @@ dnl Yo, Stephen Bourne!  I want to marry you!
 PREFIX=$prefix
 while true; do
   case "$PREFIX" in
-    *\$* ) eval "PREFIX=$PREFIX" ;;
+    *\$* ) eval "PREFIX=\"${PREFIX}\"" ;;
     *) break ;;
   esac
 done
@@ -3818,7 +3746,7 @@ AC_SUBST(EXEC_PREFIX_USER_DEFINED)
 EXEC_PREFIX=$exec_prefix
 while true; do
   case "$EXEC_PREFIX" in
-    *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;;
+    *\$* ) eval "EXEC_PREFIX=\"${EXEC_PREFIX}\"" ;;
     *) break ;;
   esac
 done
@@ -3829,7 +3757,7 @@ AC_SUBST(INFODIR_USER_DEFINED)
 INFODIR=$infodir
 while true; do
   case "$INFODIR" in
-    *\$* ) eval "INFODIR=$INFODIR" ;;
+    *\$* ) eval "INFODIR=\"${INFODIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3840,7 +3768,7 @@ AC_SUBST(INFOPATH_USER_DEFINED)
 INFOPATH=$with_infopath
 while true; do
   case "$INFOPATH" in
-    *\$* ) eval "INFOPATH=$INFOPATH" ;;
+    *\$* ) eval "INFOPATH=\"${INFOPATH}\"" ;;
     *) break ;;
   esac
 done
@@ -3855,7 +3783,7 @@ AC_SUBST(MODULE_PATH_USER_DEFINED)
 MODULE_PATH=$with_module_path
 while true; do
   case "$MODULE_PATH" in
-    *\$* ) eval "MODULE_PATH=$MODULE_PATH" ;;
+    *\$* ) eval "MODULE_PATH=\"${MODULE_PATH}\"" ;;
     *) break ;;
   esac
 done
@@ -3867,9 +3795,11 @@ 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_prefix}/site-packages:${with_package_prefix}/xemacs-packages:${with_package_prefix}/mule-packages:${with_package_prefix}/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_prefix}/site-packages:${with_package_prefix}/xemacs-packages:${with_package_prefix}/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
 
@@ -3878,7 +3808,7 @@ AC_SUBST(PACKAGE_PATH_USER_DEFINED)
 PACKAGE_PATH=$with_package_path
 while true; do
   case "$PACKAGE_PATH" in
-    *\$* ) eval "PACKAGE_PATH=$PACKAGE_PATH" ;;
+    *\$* ) eval "PACKAGE_PATH=\"${PACKAGE_PATH}\"" ;;
     *) break ;;
   esac
 done
@@ -3889,7 +3819,7 @@ AC_SUBST(LISPDIR_USER_DEFINED)
 LISPDIR=$with_lispdir
 while true; do
   case "$LISPDIR" in
-    *\$* ) eval "LISPDIR=$LISPDIR" ;;
+    *\$* ) eval "LISPDIR=\"${LISPDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3900,7 +3830,7 @@ AC_SUBST(MODULEDIR_USER_DEFINED)
 MODULEDIR=$with_moduledir
 while true; do
   case "$MODULEDIR" in
-    *\$* ) eval "MODULEDIR=$MODULEDIR" ;;
+    *\$* ) eval "MODULEDIR=\"${MODULEDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3911,7 +3841,7 @@ AC_SUBST([SITELISPDIR_USER_DEFINED])
 SITELISPDIR=$sitelispdir
 while true; do
   case "$SITELISPDIR" in
-    *\$* ) eval "SITELISPDIR=$SITELISPDIR" ;;
+    *\$* ) eval "SITELISPDIR=\"${SITELISPDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3922,7 +3852,7 @@ AC_SUBST(SITEMODULEDIR_USER_DEFINED)
 SITEMODULEDIR=$with_sitemoduledir
 while true; do
   case "$SITEMODULEDIR" in
-    *\$* ) eval "SITEMODULEDIR=$SITEMODULEDIR" ;;
+    *\$* ) eval "SITEMODULEDIR=\"${SITEMODULEDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3933,7 +3863,7 @@ AC_SUBST(ETCDIR_USER_DEFINED)
 ETCDIR=$with_etcdir
 while true; do
   case "$ETCDIR" in
-    *\$* ) eval "ETCDIR=$ETCDIR" ;;
+    *\$* ) eval "ETCDIR=\"${ETCDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3944,7 +3874,7 @@ AC_SUBST(ARCHLIBDIR_USER_DEFINED)
 ARCHLIBDIR=$with_archlibdir
 while true; do
   case "$ARCHLIBDIR" in
-    *\$* ) eval "ARCHLIBDIR=$ARCHLIBDIR" ;;
+    *\$* ) eval "ARCHLIBDIR=\"${ARCHLIBDIR}\"" ;;
     *) break ;;
   esac
 done
@@ -3955,7 +3885,7 @@ AC_SUBST(DOCDIR_USER_DEFINED)
 DOCDIR=$with_docdir
 while true; do
   case "$DOCDIR" in
-    *\$* ) eval "DOCDIR=$DOCDIR" ;;
+    *\$* ) eval "DOCDIR=\"${DOCDIR}\"" ;;
     *) break ;;
   esac
 done