From 34b245dab89caf875337e52b074710cfefb989e5 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 26 Jul 2002 21:12:19 +0000 Subject: [PATCH] The right menus are installed on little/big endian machines --- ChangeLog | 3 +++ TODO | 3 --- examples/Makefile | 16 ++++++---------- examples/endian.c | 26 +++++++++++++++----------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index ccdb357e..9c59a9c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,9 @@ v0.35.03 06-Jul-2002 The bbsdoor.sh and rundoor.sh scripts are now only installed if they were not installed before. + examples: + With the aid of a little utility (endian) the right menus are + now installed on little or big endian machines. v0.35.02 22-Jun-2002 - 06-Jul-2002 diff --git a/TODO b/TODO index 21f609da..498f75ad 100644 --- a/TODO +++ b/TODO @@ -142,6 +142,3 @@ mbsetup: Fileecho groups <=> Newfile reports Fileecho groups <=> BBS Areas -install: - U: On RedHat 7.3 the big-endian menus are installed. - diff --git a/examples/Makefile b/examples/Makefile index 1d8bf9ab..a2a89555 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -29,21 +29,17 @@ install: all echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 footer.txt ${ETCDIR}" ; \ fi @if [ ! -f ${PREFIX}/english/menus/main.mnu ]; then \ - if [ "${HOSTTYPE}" = "i386" ] || [ "${MACHTYPE}" = "i386" ]; then \ - tar xfC menus-le.tar ${PREFIX}/english/menus ; \ - echo "Installing default english menus for a Little-Endian (i386) system" ; \ - else \ - tar xfC menus-be.tar ${PREFIX}/english/menus ; \ - echo "Installing default english menus for a Big-Endian (Alpha/Sparc etc.) system" ; \ - fi \ + tar xfC menus-`./endian`.tar ${PREFIX}/english/menus ; \ + echo "tar xfC menus-`./endian`.tar ${PREFIX}/english/menus" ; \ + echo "Installed default english menus" ; \ fi @if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \ tar xfC txtfiles.tar ${PREFIX}/english/txtfiles ; \ - echo "Installing default english txtfiles" ; \ + echo "Installed default english txtfiles" ; \ fi @if [ ! -f ${PREFIX}/english/macro/html.tic ]; then \ tar xfC templates.tar ${PREFIX}/english/macro ; \ - echo "Installing default english macro files" ; \ + echo "Installed default english macro files" ; \ fi clean: @@ -52,7 +48,7 @@ clean: filelist: Makefile BASE=`pwd`; \ BASE=`basename $${BASE}`; \ - (for f in ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist + (for f in ${SRCS} ${HDRS} ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist depend: @rm -f Makefile.bak; \ diff --git a/examples/endian.c b/examples/endian.c index 8841b754..a7708384 100644 --- a/examples/endian.c +++ b/examples/endian.c @@ -36,20 +36,24 @@ int main(void) { + /* + * First test BYTE_ORDER + */ + if (BYTE_ORDER == 1234) { + printf("le"); + } else if (BYTE_ORDER == 4321) { + printf("be"); + } else { + /* + * If it failed do a simple CPU test + */ #ifdef __i386__ -printf("le"); + printf("le"); #else -printf("be"); + printf("be"); #endif + } -#ifdef __BIG_ENDIAN -printf("__BIG_ENDIAN %d\n", __BIG_ENDIAN); -#endif -#ifdef BIG_ENDIAN -printf("BIG_ENDIAN %d\n", BIG_ENDIAN); -#endif -printf("BYTE_ORDER %d\n", BYTE_ORDER); - -return 0; + return 0; }