From cece986586705821cc60b570714c3769bb4a0419 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sun, 30 Jan 2005 13:30:53 +0000 Subject: - Fix build on sparc64: rework endianness autodetection PR: ports/76828 Submitted by: Johan van Selst --- lang/moscow_ml/Makefile | 8 +------- .../files/patch-config::auto_aux::endian.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 lang/moscow_ml/files/patch-config::auto_aux::endian.c (limited to 'lang/moscow_ml') diff --git a/lang/moscow_ml/Makefile b/lang/moscow_ml/Makefile index 0db0aa23fe95..26cc9a07ec60 100644 --- a/lang/moscow_ml/Makefile +++ b/lang/moscow_ml/Makefile @@ -27,12 +27,6 @@ USE_PERL5= yes USE_REINPLACE= yes MAKE_ENV= LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" -.include - -.if ${ARCH} == "sparc64" -BROKEN= "Configure fails on sparc64" -.endif - post-patch: ${FIND} ${WRKSRC} -name Makefile | ${XARGS} \ ${REINPLACE_CMD} -e "s,-O2,${CFLAGS} -I${LOCALBASE}/include," @@ -51,4 +45,4 @@ post-install: if [ -f $${file} ]; then \ $(LN) -sf $${file} $(PREFIX)/bin; fi; done -.include +.include diff --git a/lang/moscow_ml/files/patch-config::auto_aux::endian.c b/lang/moscow_ml/files/patch-config::auto_aux::endian.c new file mode 100644 index 000000000000..6242749ff309 --- /dev/null +++ b/lang/moscow_ml/files/patch-config::auto_aux::endian.c @@ -0,0 +1,22 @@ +--- config/auto-aux/endian.c.orig Fri Jan 21 11:07:13 2000 ++++ config/auto-aux/endian.c Sat Jan 29 21:40:20 2005 +@@ -1,3 +1,5 @@ ++#include ++ + main() + { + long n[2]; +@@ -6,9 +8,11 @@ + n[0] = 0x41424344; + n[1] = 0; + p = (char *) n; +- if (strcmp(p, "ABCD") == 0) ++#if BYTE_ORDER == BIG_ENDIAN + exit(0); +- if (strcmp(p, "DCBA") == 0) ++#elif BYTE_ORDER == LITTLE_ENDIAN + exit(1); ++#else + exit(2); ++#endif + } -- cgit v1.2.3