Summary: fix to cosmetics, add AM_PROG_AR conditionally
[sxemacs] / configure.ac
index 1ecc2aa..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
@@ -873,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
@@ -1606,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_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
@@ -1800,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])
 
@@ -3732,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
@@ -3743,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
@@ -3754,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
@@ -3765,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
@@ -3780,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
@@ -3792,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
 
@@ -3803,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
@@ -3814,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
@@ -3825,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
@@ -3836,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
@@ -3847,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
@@ -3858,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
@@ -3869,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
@@ -3880,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