GCC configure.in cleanup 4/n

Nathanael Nerode neroden@twcny.rr.com
Sat Mar 1 04:38:00 GMT 2003


Makes the thing more readable and eliminates some test -a calls.

	* configure.in: Simplify tests for in-tree gas and ld.
	* configure: Regenerate.

--- configure.in.old	2003-02-28 23:00:44.000000000 -0500
+++ configure.in	2003-02-28 23:37:05.000000000 -0500
@@ -1392,6 +1392,7 @@
 
 # Figure out what assembler we will be using.
 AC_MSG_CHECKING(what assembler to use)
+in_tree_gas=no
 gcc_cv_as=
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
@@ -1404,8 +1405,10 @@
 elif test -x as$host_exeext; then
 	# Build using assembler in the current directory.
 	gcc_cv_as=./as$host_exeext
-elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
+elif test -f $gcc_cv_as_gas_srcdir/configure.in \
+     && test -f ../gas/Makefile; then
 	# Single tree build which includes gas.
+	in_tree_gas=yes
 	for f in $gcc_cv_as_bfd_srcdir/configure $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
 	do
 changequote(,)dnl
@@ -1481,14 +1484,18 @@
 		fi
 	done
 fi
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
-  AC_MSG_RESULT("newly built gas")
-else
-  AC_MSG_RESULT($gcc_cv_as)
-fi
+case $in_tree_gas in
+  yes)
+    AC_MSG_RESULT("newly built gas")
+    ;;
+  no)
+    AC_MSG_RESULT($gcc_cv_as)
+    ;;
+esac
 
 # Figure out what linker we will be using.
 AC_MSG_CHECKING(what linker to use)
+in_tree_ld=no
 gcc_cv_ld=
 gcc_cv_gld_major_version=
 gcc_cv_gld_minor_version=
@@ -1501,8 +1508,10 @@
 elif test -x ld$host_exeext; then
 	# Build using linker in the current directory.
 	gcc_cv_ld=./ld$host_exeext
-elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
+elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
+     && -f ../ld/Makefile; then
 	# Single tree build which includes ld.
+	in_tree_ld=yes
 	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 changequote(,)dnl
@@ -1577,11 +1586,14 @@
 		fi
 	done
 fi
-if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
-  AC_MSG_RESULT("newly built ld")
-else
-  AC_MSG_RESULT($gcc_cv_ld)
-fi
+case $in_tree_ld in
+  yes)
+    AC_MSG_RESULT("newly built ld")
+    ;;
+  no)
+    AC_MSG_RESULT($gcc_cv_ld)
+    ;;
+esac
 
 # Figure out what nm we will be using.
 AC_MSG_CHECKING(what nm to use)
@@ -1608,7 +1620,7 @@
 # Figure out what assembler alignment features are present.
 AC_MSG_CHECKING(assembler alignment features)
 gcc_cv_as_alignment_features=none
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes; then
 	# Gas version 2.6 and later support for .balign and .p2align.
 	# bytes to skip when using .p2align.
 	if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -1643,7 +1655,7 @@
 
 AC_MSG_CHECKING(assembler subsection support)
 gcc_cv_as_subsections=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
     gcc_cv_as_subsections="working .subsection -1"
   fi
@@ -1681,7 +1693,7 @@
 
 AC_MSG_CHECKING(assembler weak support)
 gcc_cv_as_weak=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
     gcc_cv_as_weak="yes"
   fi
@@ -1700,7 +1712,7 @@
 
 AC_MSG_CHECKING(assembler hidden support)
 gcc_cv_as_hidden=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2	\
 	  -a "$gcc_cv_gas_minor_version" -eq 12	\
 	  -a "$gcc_cv_gas_patch_version" -ge 1	\
@@ -1775,7 +1787,7 @@
 
 AC_MSG_CHECKING(assembler leb128 support)
 gcc_cv_as_leb128=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
     gcc_cv_as_leb128="yes"
   fi
@@ -1819,7 +1831,7 @@
 
 AC_MSG_CHECKING(assembler eh_frame optimization)
 gcc_cv_as_eh_frame=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
     gcc_cv_as_eh_frame="yes"
   fi
@@ -1897,7 +1909,7 @@
 
 AC_MSG_CHECKING(assembler section merging support)
 gcc_cv_as_shf_merge=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
     gcc_cv_as_shf_merge=yes
   fi
@@ -2033,8 +2045,7 @@
 esac
 if test -z "$tls_first_major"; then
   :
-elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
-then
+elif test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \
 	  -a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \
 	  -o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then
@@ -2060,9 +2071,7 @@
     AC_CACHE_CHECK([assembler supports explicit relocations],
 	gcc_cv_as_explicit_relocs, [
 	gcc_cv_as_explicit_relocs=unknown
-	if test x$gcc_cv_gas_major_version != x \
-		-a x$gcc_cv_gas_minor_version != x
-	then
+	if test $in_tree_gas = yes ; then
 	   if test "$gcc_cv_gas_major_version" -eq 2 \
 	           -a "$gcc_cv_gas_minor_version" -ge 12 \
 	           -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -2219,7 +2228,7 @@
 changequote([,])dnl
     AC_MSG_CHECKING(assembler instructions)
     gcc_cv_as_instructions=
-    if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+    if test $in_tree_gas = yes ; then 
       if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
 	gcc_cv_as_instructions="filds fists"
       fi
@@ -2242,8 +2251,7 @@
 
     AC_MSG_CHECKING(assembler GOTOFF in data directives)
     gcc_cv_as_gotoff_in_data=no
-    if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
-    then
+    if test $in_tree_gas = yes ; then
       if test "$gcc_cv_gas_major_version" -eq 2 \
 	 -a "$gcc_cv_gas_minor_version" -ge 11 \
 	 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -2285,8 +2293,7 @@
     insn="nop 0"
     ;;
   esac
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
-then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 \
 	-a "$gcc_cv_gas_minor_version" -ge 11 \
 	-o "$gcc_cv_gas_major_version" -gt 2 \
@@ -2325,8 +2332,7 @@
 
 AC_MSG_CHECKING(assembler --gdwarf2 support)
 gcc_cv_as_gdwarf2_flag=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
-then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 \
 	-a "$gcc_cv_gas_minor_version" -ge 11 \
 	-o "$gcc_cv_gas_major_version" -gt 2 \
@@ -2351,8 +2357,7 @@
 
 AC_MSG_CHECKING(assembler --gstabs support)
 gcc_cv_as_gstabs_flag=no
-if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
-then
+if test $in_tree_gas = yes ; then
   if test "$gcc_cv_gas_major_version" -eq 2 \
 	-a "$gcc_cv_gas_minor_version" -ge 11 \
 	-o "$gcc_cv_gas_major_version" -gt 2 \
@@ -2376,7 +2381,7 @@
 
 AC_MSG_CHECKING(linker read-only and read-write section mixing)
 gcc_cv_ld_ro_rw_mix=unknown
-if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
+if test $in_tree_ld = yes ; then
   if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
     gcc_cv_ld_ro_rw_mix=read-write
   fi
@@ -2414,7 +2419,7 @@
 
 AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
 gcc_cv_ld_eh_frame_hdr=no
-if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
+if test $in_tree_ld = yes ; then
   if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
     gcc_cv_ld_eh_frame_hdr=yes
   fi
v



More information about the Gcc-patches mailing list