about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--aclocal.m414
-rwxr-xr-xconfigure31
-rw-r--r--configure.in14
4 files changed, 46 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 625d579dd6..76a04fed01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-16  Roland McGrath  <roland@hack.frob.com>
+
+	* aclocal.m4 (LIBC_PRECONFIGURE): New macro.
+	* configure.in: Use it for both main tree and add-ons.
+	* configure: Regenerated.
+
 2012-03-16  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* time/offtime.c (__offtime): Use time_t on days, rem, y and yg.
diff --git a/aclocal.m4 b/aclocal.m4
index 02ff9bc359..fb546e46c1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -127,3 +127,17 @@ AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
 		       1>&AS_MESSAGE_LOG_FD])],
       [$2], [$3])
 rm -f conftest*])
+
+dnl Find and source sysdeps/*/preconfigure.
+dnl LIBC_PRECONFIGURE([$srcdir], [for])
+AC_DEFUN([LIBC_PRECONFIGURE], [dnl
+if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null`
+then
+  AC_MSG_CHECKING($2 preconfigure fragments)
+  for frag in $frags; do
+    name=`echo "$frag" | sed 's@/[[^/]]*[$]@@;s@^.*/@@'`
+    echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
+    . "$frag"
+  done
+  AC_MSG_RESULT()
+fi])
diff --git a/configure b/configure
index 94b15bbe8f..3eb7cf14f1 100755
--- a/configure
+++ b/configure
@@ -3819,6 +3819,19 @@ if test "${with_cpu+set}" = set; then :
 fi
 
 
+if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null`
+then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5
+$as_echo_n "checking for sysdeps preconfigure fragments... " >&6; }
+  for frag in $frags; do
+    name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
+    echo $ECHO_N "$name $ECHO_C" >&6
+    . "$frag"
+  done
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+$as_echo "" >&6; }
+fi
+
 # An add-on can set this when it wants to disable the sanity check below.
 libc_config_ok=no
 
@@ -3936,17 +3949,17 @@ $d-srcdir = $subdir_srcdir"
     fi
     if test -n "$libc_add_on"; then
       if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
-      then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking add-on $libc_add_on for preconfigure fragments" >&5
+then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking add-on $libc_add_on for preconfigure fragments" >&5
 $as_echo_n "checking add-on $libc_add_on for preconfigure fragments... " >&6; }
-	for frag in $frags; do
-	  name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
-	  echo $ECHO_N "$name $ECHO_C" >&6
-	  . "$frag"
-	done
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+  for frag in $frags; do
+    name=`echo "$frag" | sed 's@/[^/]*$@@;s@^.*/@@'`
+    echo $ECHO_N "$name $ECHO_C" >&6
+    . "$frag"
+  done
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
 $as_echo "" >&6; }
-      fi
+fi
       use_add_ons="$use_add_ons $libc_add_on"
       add_ons_pfx="$add_ons_pfx $libc_add_on/"
       test -z "$libc_add_on_canonical" ||
diff --git a/configure.in b/configure.in
index 119d5be944..ee5e856306 100644
--- a/configure.in
+++ b/configure.in
@@ -317,6 +317,9 @@ AC_ARG_WITH([cpu],
   esac
 ])
 
+dnl Let sysdeps/*/preconfigure act here, like they can in add-ons.
+LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
+
 # An add-on can set this when it wants to disable the sanity check below.
 libc_config_ok=no
 
@@ -436,16 +439,7 @@ relative path required for add-on using \$libc_add_on_config_subdirs) ;;
       }
     fi
     if test -n "$libc_add_on"; then
-      if frags=`ls -d $libc_add_on_srcdir/sysdeps/*/preconfigure 2> /dev/null`
-      then
-	AC_MSG_CHECKING(add-on $libc_add_on for preconfigure fragments)
-	for frag in $frags; do
-	  name=`echo "$frag" | sed 's@/[[^/]]*$@@;s@^.*/@@'`
-	  echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
-	  . "$frag"
-	done
-	AC_MSG_RESULT()
-      fi
+      LIBC_PRECONFIGURE([$libc_add_on_srcdir], [add-on $libc_add_on for])
       use_add_ons="$use_add_ons $libc_add_on"
       add_ons_pfx="$add_ons_pfx $libc_add_on/"
       test -z "$libc_add_on_canonical" ||