|
[Sbcl-commits] CVS: sbcl/tools-for-build determine-endianness.c,NONE,1.1 Makefile,1.2,1.3
From: Christophe Rhodes <crhodes@us...> - 2002-11-25 13:24
|
Update of /cvsroot/sbcl/sbcl/tools-for-build
In directory sc8-pr-cvs1:/tmp/cvs-serv12575/tools-for-build
Modified Files:
Makefile
Added Files:
determine-endianness.c
Log Message:
0.7.9.67:
MIPSel build patch
... write a noddy C program to determine target endianness
(KLUDGE: assumes int is 32 bits)
... use it in make-config.sh if we are building a MIPS target
--- NEW FILE: determine-endianness.c ---
/*
* Test for the endianness of the target platform (needed for MIPS
* support, at the very least, as systems with either endianness exist
* in the wild).
*/
/*
* This software is part of the SBCL system. See the README file for
* more information.
*
* While most of SBCL is derived from the CMU CL system, many
* utilities for the build process (like this one) were written from
* scratch after the fork from CMU CL.
*
* This software is in the public domain and is provided with
* absolutely no warranty. See the COPYING and CREDITS files for
* more information.
*/
#include <stdio.h>
int main (int argc, char *argv[]) {
int foo = 0x20212223;
char *bar = (char *) &foo;
switch(*bar) {
case ' ':
/* Do nothing */
break;
case '#':
printf(" :little-endian");
break;
default:
/* FIXME: How do we do sane error processing in Unix? This
program will be called from a script, in a manner somewhat
like:
tools-for-build/determine-endianness >> $ltf
but what if we have a too-smart C compiler that actually
gets us down to this branch? I suppose that if we have a C
compiler that is that smart, we're doomed to miscompile the
runtime anyway, so we won't get here. Still, it might be
good to have "set -e" in the various scripts so that we can
exit with an error here and have it be caught by the build
tools. -- CSR, 2002-11-24
*/
exit(1);
}
exit(0);
}
Index: Makefile
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tools-for-build/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile 19 May 2001 01:03:02 -0000 1.2
+++ Makefile 25 Nov 2002 13:24:15 -0000 1.3
@@ -7,7 +7,7 @@
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.
-all: grovel_headers
+all: grovel_headers determine-endianness
clean:
- rm -f *.o grovel_headers
+ rm -f *.o grovel_headers determine-endianness
|
| Thread | Author | Date |
|---|---|---|
| [Sbcl-commits] CVS: sbcl/tools-for-build determine-endianness.c,NONE,1.1 Makefile,1.2,1.3 | Christophe Rhodes <crhodes@us...> |