Made bbs menus machine endian indepentant

This commit is contained in:
Michiel Broek
2003-02-12 20:56:57 +00:00
parent 8def403243
commit e4c4477ad3
11 changed files with 55 additions and 105 deletions

View File

@@ -3,13 +3,9 @@
include ../Makefile.global
SRCS = endian.c
HDRS = endian.h
OBJS = endian.o
OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \
txtfiles-en.tar templates-en.tar \
OTHER = Makefile header.txt footer.txt \
menus-en.tar txtfiles-en.tar templates-en.tar \
menus-es.tar txtfiles-es.tar templates-es.tar \
menus-en.tar \
templates-de.tar \
templates-nl.tar
@@ -18,13 +14,10 @@ OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \
.c.o:
${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<
all: endian
all:
endian: ${OBJS} ${LIBS}
${CC} -o endian ${OBJS} ${LIBS}
strip endian
install: all
install:
@if [ ! -f ${ETCDIR}/header.txt ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 header.txt ${ETCDIR} ; \
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 header.txt ${ETCDIR}" ; \
@@ -34,8 +27,8 @@ install: all
echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 footer.txt ${ETCDIR}" ; \
fi
@if [ ! -f ${PREFIX}/english/menus/main.mnu ]; then \
tar xfC menus-`./endian`.tar ${PREFIX}/english/menus ; \
echo "tar xfC menus-`./endian`.tar ${PREFIX}/english/menus" ; \
tar xfC menus-en.tar ${PREFIX}/english/menus ; \
echo "tar xfC menus-en.tar ${PREFIX}/english/menus" ; \
echo "Installed default English menus" ; \
fi
@if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \
@@ -69,7 +62,7 @@ install: all
fi
clean:
rm -f endian *.o *.h~ *.c~ core filelist Makefile.bak
rm -f *.h~ *.c~ core filelist Makefile.bak
filelist: Makefile
BASE=`pwd`; \
@@ -100,5 +93,4 @@ depend:
# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
# Dependencies generated by make depend
endian.o: endian.h
# End of generated dependencies

View File

@@ -1,64 +0,0 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Check little/big-endian for install of the menus.
*
*****************************************************************************
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
* 1971 BV IJmuiden
* the Netherlands
*
* This file is part of MBSE BBS.
*
* This BBS is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* MB BBS is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MB BBS; see the file COPYING. If not, write to the Free
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*****************************************************************************/
#include <stdio.h>
#include <ctype.h>
#include "endian.h"
int main(void)
{
/*
* First test BYTE_ORDER
*/
#ifdef BYTE_ORDER
if (BYTE_ORDER == 1234) {
printf("le");
} else if (BYTE_ORDER == 4321) {
printf("be");
} else {
/*
* If it failed do a simple CPU test
*/
#endif
#ifdef __i386__
printf("le");
#else
printf("be");
#endif
#ifdef BYTE_ORDER
}
#endif
return 0;
}

View File

@@ -1,4 +0,0 @@
/* $Id$ */
int main(void);

Binary file not shown.

Binary file not shown.

Binary file not shown.