[m-rev.] diff: solaris (three patches)

Peter Wang novalazy at gmail.com
Tue May 28 13:05:32 AEST 2013


[PATCH 1/3] Fix test for mfiltercc on Solaris.

On Solaris, the 'which' utility does not return a non-zero exit status
to indicate that the program (in this case, "mfiltercc") was not found,
so we ended up treating its error message output as a path.

scripts/mgnuc.in:
	Don't use 'which'.  Simply try to run any copy of mfiltercc on
	the PATH, with empty input.
---
 scripts/mgnuc.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mgnuc.in b/scripts/mgnuc.in
index 77b01ce..affb55a 100644
--- a/scripts/mgnuc.in
+++ b/scripts/mgnuc.in
@@ -682,9 +682,9 @@ FILTERCC=""
 case $asm_labels,$do_filter_cc in true,true)
     # Check if mfiltercc is available as we may be bootstrapping with
     # an older compiler which did not have it.
-    if test -n "$MKTEMP" && mfiltercc=`which mfiltercc`
+    if test -n "$MKTEMP" && mfiltercc </dev/null 2>/dev/null
     then
-        FILTERCC=$mfiltercc
+        FILTERCC="mfiltercc"
     fi
     ;;
 esac
-- 
1.7.12.1


[PATCH 2/3] Pass AR, RANLIB down to libatomic_ops build system.

This allows AR and RANLIB to be overridden.

boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
	As above.
---
 boehm_gc/Makefile.direct     | 5 +++--
 boehm_gc/build_atomic_ops.sh | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/boehm_gc/Makefile.direct b/boehm_gc/Makefile.direct
index 97b1dc9..373bf84 100644
--- a/boehm_gc/Makefile.direct
+++ b/boehm_gc/Makefile.direct
@@ -231,10 +231,11 @@ all: gc.a gctest
 
 # if AO_INSTALL_DIR doesn't exist, we assume that it is pointing to
 # the default location, and we need to build
-# Mercury-specific: pass FULLARCH for cross-compilation
+# Mercury-specific: pass CC, AR, RANLIB, FULLARCH
 # Mercury-specific: clear DESTDIR
 $(AO_INSTALL_DIR):
-	CC="$(CC)" MAKE=$(MAKE) DESTDIR= $(srcdir)/build_atomic_ops.sh --host=$(FULLARCH)
+	CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" MAKE=$(MAKE) DESTDIR= \
+	   $(srcdir)/build_atomic_ops.sh --host=$(FULLARCH)
 
 LEAKFLAGS=$(CFLAGS) -DFIND_LEAK
 
diff --git a/boehm_gc/build_atomic_ops.sh b/boehm_gc/build_atomic_ops.sh
index faf19d0..a986205 100755
--- a/boehm_gc/build_atomic_ops.sh
+++ b/boehm_gc/build_atomic_ops.sh
@@ -3,4 +3,4 @@ P=`pwd`/libatomic_ops-install
 cd libatomic_ops
 # Mercury-specific: allow additional arguments.
 ./configure --prefix=$P "$@"
-$MAKE CC="$CC" install
+$MAKE CC="$CC" AR="$AR" RANLIB="$RANLIB" install
-- 
1.7.12.1


[PATCH 3/3] Avoid grep -q in configure.

The Solaris implementation of grep still doesn't support the -q option.

m4/mercury.m4:
	As above.
---
 m4/mercury.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/mercury.m4 b/m4/mercury.m4
index b8f22f9..dc9fa2e 100644
--- a/m4/mercury.m4
+++ b/m4/mercury.m4
@@ -301,7 +301,7 @@ for CANDIDATE_CSC0 in $CSC_COMPILERS; do
              # above check that it is actually the Microsoft C# compiler and if
              # it is not then try to use one of the other instead.
              #
-             $CANDIDATE_CSC 2>&1 | grep -q "^Microsoft"
+             $CANDIDATE_CSC 2>&1 | grep "^Microsoft" >/dev/null
              if test $? -ne 0
              then
                  AC_MSG_WARN([$CANDIDATE_CSC is not the Microsoft C sharp compiler])
@@ -650,7 +650,7 @@ AC_MSG_CHECKING([what the C compiler type really is])
 # MSVC uses different command line options to most other C compilers.
 # Try to determine whether CC is MSVC based on the usage message.
 #
-$CC 2>&1 | grep -q "^Microsoft"
+$CC 2>&1 | grep "^Microsoft" >/dev/null
 if test $? -eq 0
 then
     cc_out_opt="-Fe"
-- 
1.7.12.1




More information about the reviews mailing list