for review: autoconfigure as

Tyson Dowd trd at cs.mu.OZ.AU
Mon Dec 21 18:57:46 AEDT 1998


Hi,

Anyone can review this.

===================================================================


Estimated hours taken: 1

Move the patch for making the GNU assembler into the configuration script.

README.Linux-Alpha:
configure.in:
scripts/mgnuc.in:
	Autodetect whether "as" does full pre-processing or not.
	Set AS accordingly in mgnuc


Index: README.Linux-Alpha
===================================================================
RCS file: /home/mercury1/repository/mercury/README.Linux-Alpha,v
retrieving revision 1.1
diff -u -r1.1 README.Linux-Alpha
--- README.Linux-Alpha	1998/04/08 13:55:44	1.1
+++ README.Linux-Alpha	1998/12/21 07:43:29
@@ -1,22 +1,3 @@
-For Linux/Alpha you need to apply the patch below.
-Just type `patch scripts/mgnuc < README.Linux-Alpha'.
-This patch is needed to make the Boehm collector work
-with the GNU assembler on Alphas.
 
-Index: mgnuc.in
-===================================================================
-RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
-retrieving revision 1.48
-diff -u -u -r1.48 mgnuc.in
---- mgnuc.in	1998/03/11 05:58:58	1.48
-+++ mgnuc.in	1998/04/01 18:34:19
-@@ -60,7 +60,8 @@
- CC=${MERCURY_C_COMPILER="@CC@"}
- CFLAGS_FOR_REGS="@CFLAGS_FOR_REGS@"
- CFLAGS_FOR_GOTOS="@CFLAGS_FOR_GOTOS@"
--AS=as
-+# AS=as
-+AS="gcc -c -x assembler-with-cpp"
- 
- case "$CC" in
-     *gcc*)
+Linux/Alpha needs no special treatment at present.
+
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.145
diff -u -r1.145 configure.in
--- configure.in	1998/12/16 20:15:51	1.145
+++ configure.in	1998/12/21 06:34:22
@@ -1628,6 +1628,37 @@
 	AC_DEFINE(MR_CANNOT_GROK_ASM_TYPE_DIRECTIVE)
 fi
 #-----------------------------------------------------------------------------#
+AC_PATH_PROG(AS,as)
+AC_MSG_CHECKING(whether the assembler does full preprocessing)
+
+AC_CACHE_VAL(mercury_cv_asm_does_full_preprocessing, [
+if test "$AS" != ""; then
+	# check that it really works
+	cat > conftest.s << EOF
+
+# define foo(x) \
+	/* foo */
+
+	foo(x)
+EOF
+	if 
+		echo $AS conftest.s >&AC_FD_CC 2>&1 &&
+		$AS conftest.s </dev/null >&AC_FD_CC 2>&1 
+	then
+		mercury_cv_asm_does_full_preprocessing="yes"
+	else
+		AS="gcc -c -x assembler-with-cpp"
+		mercury_cv_asm_does_full_preprocessing="no"
+		AC_MSG_RESULT(no)	
+	fi
+	rm -f conftest*
+else
+	AS="gcc -c -x assembler-with-cpp"
+fi
+])
+AC_MSG_RESULT($mercury_cv_asm_does_full_preprocessing)	
+AC_DEFINE(AS)
+#-----------------------------------------------------------------------------#
 AC_MSG_CHECKING(whether structure assignment conflicts with global registers)
 AC_CACHE_VAL(mercury_cv_cannot_use_structure_assignment,
 AC_TRY_RUN([
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.57
diff -u -r1.57 mgnuc.in
--- mgnuc.in	1998/10/30 05:12:14	1.57
+++ mgnuc.in	1998/12/21 06:02:27
@@ -63,7 +63,7 @@
 CC=${MERCURY_C_COMPILER="@CC@"}
 CFLAGS_FOR_REGS="@CFLAGS_FOR_REGS@"
 CFLAGS_FOR_GOTOS="@CFLAGS_FOR_GOTOS@"
-AS=as
+AS="@AS@"
 
 case "$CC" in
     *gcc*)


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list