[RFC,v2,20/27] Add ./configure checks for I8C and I8X

Message ID 1465814311-31470-21-git-send-email-gbenson@redhat.com
State New, archived
Headers

Commit Message

Gary Benson June 13, 2016, 10:38 a.m. UTC
  This commit adds configure checks for I8C (the Infinity note
compiler) and I8X (the Infinity note testing framework).

This patch differs from the previous version
<https://sourceware.org/ml/libc-alpha/2015-10/msg00702.html>
in the following ways:

 * The versions of I8C and I8X are checked.

 * There is now a --with-infinity option.  If specified, configure
   will fail if I8C and I8X are not present or too old.  If
   --without-infinity is specified then no checks will be performed.
   If neither is specified then --with-infinity will be assumed if
   I8C is found on the build system.

 * Minimum versions of I8C and I8X are listed in manual/install.texi
   and INSTALL.
---
 INSTALL             |   10 ++
 config.make.in      |    3 +
 configure           |  254 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 configure.ac        |   42 +++++++++
 manual/install.texi |   11 ++
 5 files changed, 319 insertions(+), 1 deletions(-)
  

Patch

diff --git a/INSTALL b/INSTALL
index c70ea9f..363bb24 100644
--- a/INSTALL
+++ b/INSTALL
@@ -407,6 +407,16 @@  build the GNU C Library:
      GNU 'sed' 3.02.  If you like to run the test suite, you should
      definitely upgrade 'sed'.
 
+   * I8C and I8X 0.0.3 or newer
+
+     I8C is used to compile Infinity notes, and I8X is used to test
+     them.  Whether they are required is controlled by the
+     '--with-infinity' and '--without-infinity' configuration options.
+     If '--with-infinity' is specified then both I8C and I8X are
+     required to build the GNU C Library.  If neither '--with-infinity'
+     nor '--without-infinity' are specified then '--with-infinity' will
+     be assumed if I8C is present on the build system.
+
 If you change any of the 'configure.ac' files you will also need
 
    * GNU 'autoconf' 2.69 (exactly)
diff --git a/config.make.in b/config.make.in
index 05ed6ec..cb08ba0 100644
--- a/config.make.in
+++ b/config.make.in
@@ -90,6 +90,7 @@  use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
 enable-lock-elision = @enable_lock_elision@
+build-infinity = @build_infinity@
 
 # Build tools.
 CC = @CC@
@@ -108,6 +109,8 @@  AUTOCONF = @AUTOCONF@
 OBJDUMP = @OBJDUMP@
 OBJCOPY = @OBJCOPY@
 READELF = @READELF@
+I8C = @I8C@
+I8X = @I8X@
 
 # Installation tools.
 INSTALL = @INSTALL@
diff --git a/configure b/configure
index 06ea87e..6fc0a0c 100755
--- a/configure
+++ b/configure
@@ -652,6 +652,9 @@  LN_S
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
+build_infinity
+I8X
+I8C
 sysdeps_add_ons
 sysnames
 submachine
@@ -748,6 +751,7 @@  with_gd_lib
 with_fp
 with_binutils
 with_selinux
+with_infinity
 with_headers
 with_default_link
 enable_sanity_checks
@@ -1454,6 +1458,7 @@  Optional Packages:
   --with-fp               if using floating-point hardware [default=yes]
   --with-binutils=PATH    specify location of binutils (as and ld)
   --with-selinux          if building with SELinux support
+  --with-infinity         if building with Infinity support
   --with-headers=PATH     location of system headers to use (for example
                           /usr/src/linux/include) [default=compiler default]
   --with-default-link     do not use explicit linker scripts
@@ -3303,6 +3308,14 @@  else
 fi
 
 
+# Check whether --with-infinity was given.
+if test "${with_infinity+set}" = set; then :
+  withval=$with_infinity; with_infinity=$withval
+else
+  with_infinity=auto
+fi
+
+
 
 # Check whether --with-headers was given.
 if test "${with_headers+set}" = set; then :
@@ -3864,7 +3877,7 @@  if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then
 *** The GNU C library is currently unavailable for this platform.
 *** If you are interested in seeing glibc on this platform visit
 *** the \"How to submit a new port\" in the wiki:
-***   https://sourceware.org/glibc/wiki/HomePage#Development
+***   https://sourceware.org/glibc/wiki/#Development
 *** and join the community!" "$LINENO" 5
     ;;
   esac
@@ -4204,6 +4217,116 @@  $as_echo "$as_me: WARNING: add-on $add_on contributed no useful sysdeps director
 done
 
 
+# Infinity detection
+if test x$with_infinity = xno ; then
+  build_infinity=no;
+else
+  for ac_prog in i8c
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_I8C+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$I8C"; then
+  ac_cv_prog_I8C="$I8C" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_I8C="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+I8C=$ac_cv_prog_I8C
+if test -n "$I8C"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $I8C" >&5
+$as_echo "$I8C" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$I8C" && break
+done
+test -n "$I8C" || I8C="no"
+
+  if test x$I8C = xno ; then
+    if test x$with_infinity = xyes ; then
+      as_fn_error $? "Infinity explicitly required, but i8c not found" "$LINENO" 5
+    else
+      build_infinity=no
+    fi
+  fi
+  if test x$build_infinity != xno ; then
+    for ac_prog in i8x
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_I8X+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$I8X"; then
+  ac_cv_prog_I8X="$I8X" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_I8X="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+I8X=$ac_cv_prog_I8X
+if test -n "$I8X"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $I8X" >&5
+$as_echo "$I8X" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$I8X" && break
+done
+test -n "$I8X" || I8X="no"
+
+    if test x$I8X = xno ; then
+      if test x$with_infinity = xyes ; then
+        as_fn_error $? "Infinity explicitly required, but i8x not found" "$LINENO" 5
+      else
+        build_infinity=no
+      fi
+    else
+      build_infinity=yes
+    fi
+  fi
+fi
+
 
 ### Locate tools.
 
@@ -5013,6 +5136,135 @@  else
   AUTOCONF=no
 fi
 
+if test x$build_infinity = xyes ; then
+  for ac_prog in $I8C
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_I8C+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$I8C"; then
+  ac_cv_prog_I8C="$I8C" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_I8C="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+I8C=$ac_cv_prog_I8C
+if test -n "$I8C"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $I8C" >&5
+$as_echo "$I8C" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$I8C" && break
+done
+
+if test -z "$I8C"; then
+  ac_verc_fail=yes
+else
+  # Found it, now check the version.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $I8C" >&5
+$as_echo_n "checking version of $I8C... " >&6; }
+  ac_prog_version=`$I8C --version 2>&1 | sed -n 's/^.*.*I8C.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+  case $ac_prog_version in
+    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+    0.0.[3-9]* | 0.0.[1-9][0-9]* | 0.[1-9]* | [1-9].*)
+       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
+$as_echo "$ac_prog_version" >&6; }
+fi
+if test $ac_verc_fail = yes; then
+  critic_missing="$critic_missing i8c"
+fi
+
+  for ac_prog in $I8X
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_I8X+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$I8X"; then
+  ac_cv_prog_I8X="$I8X" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_I8X="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+I8X=$ac_cv_prog_I8X
+if test -n "$I8X"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $I8X" >&5
+$as_echo "$I8X" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$I8X" && break
+done
+
+if test -z "$I8X"; then
+  ac_verc_fail=yes
+else
+  # Found it, now check the version.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $I8X" >&5
+$as_echo_n "checking version of $I8X... " >&6; }
+  ac_prog_version=`$I8X --version 2>&1 | sed -n 's/^.*.*I8X.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+  case $ac_prog_version in
+    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+    0.0.[3-9]* | 0.0.[1-9][0-9]* | 0.[1-9]* | [1-9].*)
+       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
+$as_echo "$ac_prog_version" >&6; }
+fi
+if test $ac_verc_fail = yes; then
+  critic_missing="$critic_missing i8x"
+fi
+
+fi
+
 test -n "$critic_missing" && as_fn_error $? "
 *** These critical programs are missing or too old:$critic_missing
 *** Check the INSTALL file for required versions." "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index 3c766b7..c750775 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,6 +143,11 @@  AC_ARG_WITH([selinux],
 			   [if building with SELinux support]),
 	    [with_selinux=$withval],
 	    [with_selinux=auto])
+AC_ARG_WITH([infinity],
+	    AC_HELP_STRING([--with-infinity],
+			   [if building with Infinity support]),
+	    [with_infinity=$withval],
+	    [with_infinity=auto])
 
 AC_ARG_WITH([headers],
 	    AC_HELP_STRING([--with-headers=PATH],
@@ -926,6 +931,32 @@  for add_on in $add_ons; do
 done
 AC_SUBST(sysdeps_add_ons)
 
+# Infinity detection
+if test x$with_infinity = xno ; then
+  build_infinity=no;
+else
+  AC_CHECK_PROGS(I8C, i8c, no)
+  if test x$I8C = xno ; then
+    if test x$with_infinity = xyes ; then
+      AC_MSG_ERROR([Infinity explicitly required, but i8c not found])
+    else
+      build_infinity=no
+    fi
+  fi
+  if test x$build_infinity != xno ; then
+    AC_CHECK_PROGS(I8X, i8x, no)
+    if test x$I8X = xno ; then
+      if test x$with_infinity = xyes ; then
+        AC_MSG_ERROR([Infinity explicitly required, but i8x not found])
+      else
+        build_infinity=no
+      fi
+    else
+      build_infinity=yes
+    fi
+  fi
+fi
+AC_SUBST(build_infinity)
 
 ### Locate tools.
 
@@ -1004,6 +1035,17 @@  else
   AUTOCONF=no
 fi
 
+if test x$build_infinity = xyes ; then
+  AC_CHECK_PROG_VER(I8C, $I8C, --version,
+    [.*I8C.* \([0-9]*\.[0-9.]*\)],
+    [0.0.[3-9]* | 0.0.[1-9][0-9]* | 0.[1-9]* | [1-9].*],
+    critic_missing="$critic_missing i8c")
+  AC_CHECK_PROG_VER(I8X, $I8X, --version,
+    [.*I8X.* \([0-9]*\.[0-9.]*\)],
+    [0.0.[3-9]* | 0.0.[1-9][0-9]* | 0.[1-9]* | [1-9].*],
+    critic_missing="$critic_missing i8x")
+fi
+
 test -n "$critic_missing" && AC_MSG_ERROR([
 *** These critical programs are missing or too old:$critic_missing
 *** Check the INSTALL file for required versions.])
diff --git a/manual/install.texi b/manual/install.texi
index de9d270..63d8444 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -454,6 +454,17 @@  generate @code{msgs.h} for the test suite.  This script works correctly
 only with GNU @code{sed} 3.02.  If you like to run the test suite, you
 should definitely upgrade @code{sed}.
 
+@item
+I8C and I8X 0.0.3 or newer
+
+I8C is used to compile Infinity notes, and I8X is used to test them.
+Whether they are required is controlled by the @samp{--with-infinity}
+and @samp{--without-infinity} configuration options.  If
+@samp{--with-infinity} is specified then both I8C and I8X are required
+to build @theglibc{}.  If neither @samp{--with-infinity} nor
+@samp{--without-infinity} are specified then @samp{--with-infinity}
+will be assumed if I8C is present on the build system.
+
 @end itemize
 
 @noindent