configure.in language check cleanup applied

Tim Josling tej@melbpc.org.au
Wed Jun 19 14:06:00 GMT 2002


Cleaned up as per feedback.  Applied.


2002-06-20  Tim Josling  <tej@melbpc.org.au>

        * configure.in: Clean up code to check for misspecified languages
        in enable-languages.
        * configure: Rebuild.
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.605
diff -c -r1.605 configure.in
*** configure.in	15 Jun 2002 17:31:27 -0000	1.605
--- configure.in	19 Jun 2002 20:22:52 -0000
***************
*** 2181,2187 ****
  		enable_languages=all
  	fi
  else
! 	if test x"${enable_languages}" = x;
  	then
  		AC_MSG_ERROR([--enable-languages needs at least one language argument])
  	fi
--- 2181,2188 ----
  		enable_languages=all
  	fi
  else
! 	if test x"${enable_languages}" = x \
!         || test x"${enable_languages}" = xyes;
  	then
  		AC_MSG_ERROR([--enable-languages needs at least one language argument])
  	fi
***************
*** 2221,2227 ****
     esac
  done
  
! remaining_languages=${enable_languages}
  subdirs=
  for lang in ${srcdir}/*/config-lang.in ..
  do
--- 2222,2229 ----
     esac
  done
  
! expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's:  *: :g' -e 's:  *: :g' -e 's:^ ::' -e 's: $::'`
! found_languages=
  subdirs=
  for lang in ${srcdir}/*/config-lang.in ..
  do
***************
*** 2246,2253 ****
  	  *,all,*) add_this_lang=yes ;;
  	  *) add_this_lang=no ;;
  	  esac
  	  if test x"${add_this_lang}" = xyes; then
-                 remaining_languages=`echo $remaining_languages | sed -e s/${lang_alias}//g`
  		case $lang in
  		    ${srcdir}/ada/config-lang.in)
  			if test x$have_gnat = xyes ; then
--- 2248,2255 ----
  	  *,all,*) add_this_lang=yes ;;
  	  *) add_this_lang=no ;;
  	  esac
+           found_languages="${found_languages} ${lang_alias}"
  	  if test x"${add_this_lang}" = xyes; then
  		case $lang in
  		    ${srcdir}/ada/config-lang.in)
  			if test x$have_gnat = xyes ; then
***************
*** 2264,2275 ****
  	esac
  done
  
! remaining_languages_check=`echo $remaining_languages | sed -e 's/,//g' -e 's/^c$//'g`
! if test "xxx$remaining_languages_check" != "xxx" -a "xxx$remaining_languages_check" != "xxxall" ; then
!     remaining_languages_clean=`echo $remaining_languages | sed -e 's/^c,//' -e 's/,c,/,/' -e 's/,c$//'  -e 's/^c$//' -e 's/,,*/,/g' -e 's/^,//g' -e 's/,$//g' `
!     echo "Language alias(es) not found: $remaining_languages_clean" 
!     echo "Refer to the configure instructions in the doc directory"
!     exit 1
  fi
  
  # Make gthr-default.h if we have a thread file.
--- 2266,2298 ----
  	esac
  done
  
! missing_languages=
! for expected_language in ${expected_languages} ..
! do 
!     if test "${expected_language}" != ..; then
!         missing_language="${expected_language}"
!         if test "${expected_language}" = "c" \
!            || test "${expected_language}" = "all"; then
!                 missing_language=
!         fi
!         for found_language in ${found_languages} ..
!         do 
!             if test "${found_language}" != ..; then
!                 if test "${expected_language}" = "${found_language}"; then
!                     missing_language=
!                 fi
!             fi
!         done
!         if test "x${missing_language}" != x; then
!            missing_languages="${missing_languages} ${missing_language}"
!         fi
!     fi
! done
! 
! if test "x$missing_languages" != x; then
!   AC_MSG_ERROR([
! The following requested languages were not found:${missing_languages}
! The following languages were available: c${found_languages}])
  fi
  
  # Make gthr-default.h if we have a thread file.


More information about the Gcc-patches mailing list