diff mbox

PATCH RFA: Add Go support to config-ml.in

Message ID mcrsjyxclv2.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Nov. 19, 2010, 4:35 p.m. UTC
This patch adds Go support to config-ml.in.  I will also send this patch
back to the automake maintainers, though probably not until after the
autoconf and libtool patches are accepted.

Bootstrapped on x86_64-unknown-linux-gnu.

OK for mainline?

Ian


2010-11-19  Ian Lance Taylor  <iant@google.com>

	* config-ml.in: Add Go support: treat GOC and GOCFLAGS like other
	compiler/flag environment variables.

Comments

Ralf Wildenhues Nov. 19, 2010, 8:02 p.m. UTC | #1
* Ian Lance Taylor wrote on Fri, Nov 19, 2010 at 05:35:29PM CET:
> This patch adds Go support to config-ml.in.  I will also send this patch
> back to the automake maintainers, though probably not until after the
> autoconf and libtool patches are accepted.
> 
> Bootstrapped on x86_64-unknown-linux-gnu.
> 
> OK for mainline?

OK thanks, but please add 2008 and 2010 to the copyright years.
I will sync this in Automake for you once you've committed to GCC trunk,
I don't want the scripts to diverge.

Thanks,
Ralf

> 2010-11-19  Ian Lance Taylor  <iant@google.com>
> 
> 	* config-ml.in: Add Go support: treat GOC and GOCFLAGS like other
> 	compiler/flag environment variables.
Ian Lance Taylor Nov. 19, 2010, 8:26 p.m. UTC | #2
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

> * Ian Lance Taylor wrote on Fri, Nov 19, 2010 at 05:35:29PM CET:
>> This patch adds Go support to config-ml.in.  I will also send this patch
>> back to the automake maintainers, though probably not until after the
>> autoconf and libtool patches are accepted.
>> 
>> Bootstrapped on x86_64-unknown-linux-gnu.
>> 
>> OK for mainline?
>
> OK thanks, but please add 2008 and 2010 to the copyright years.
> I will sync this in Automake for you once you've committed to GCC trunk,
> I don't want the scripts to diverge.

Thanks for review and for the automake merge.  Committed to mainline as
revision 166956.

Ian
diff mbox

Patch

Index: config-ml.in
===================================================================
--- config-ml.in	(revision 166919)
+++ config-ml.in	(working copy)
@@ -517,6 +517,7 @@  multi-do:
 				prefix="$(prefix)" \
 				exec_prefix="$(exec_prefix)" \
 				GCJFLAGS="$(GCJFLAGS) $${flags}" \
+				GOCFLAGS="$(GOCFLAGS) $${flags}" \
 				CXXFLAGS="$(CXXFLAGS) $${flags}" \
 				LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
 				LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -750,7 +751,7 @@  if [ -n "${multidirs}" ] && [ -z "${ml_n
         break
       fi
     done
-    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"'
+    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
 
     if [ "${with_target_subdir}" = "." ]; then
 	CC_=$CC' '
@@ -758,6 +759,7 @@  if [ -n "${multidirs}" ] && [ -z "${ml_n
 	F77_=$F77' '
 	GCJ_=$GCJ' '
 	GFORTRAN_=$GFORTRAN' '
+	GOC_=$GOC' '
     else
 	# Create a regular expression that matches any string as long
 	# as ML_POPDIR.
@@ -822,6 +824,18 @@  if [ -n "${multidirs}" ] && [ -z "${ml_n
 	  esac
 	done
 
+	GOC_=
+	for arg in ${GOC}; do
+	  case $arg in
+	  -[BIL]"${ML_POPDIR}"/*)
+	    GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+	  "${ML_POPDIR}"/*)
+	    GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+	  *)
+	    GOC_="${GOC_}${arg} " ;;
+	  esac
+	done
+
 	if test "x${LD_LIBRARY_PATH+set}" = xset; then
 	  LD_LIBRARY_PATH_=
 	  for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do