*** empty log message ***
This commit is contained in:
parent
02f9587e06
commit
2f89a2be7d
|
@ -665,6 +665,120 @@ EOF
|
|||
fi
|
||||
|
||||
|
||||
# If we cannot run a trivial program, we must be cross compiling.
|
||||
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
ac_cv_c_cross=yes
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 678 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
eval $ac_link
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_c_cross=no
|
||||
else
|
||||
ac_cv_c_cross=yes
|
||||
fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
cross_compiling=$ac_cv_c_cross
|
||||
echo "$ac_t""$ac_cv_c_cross" 1>&6
|
||||
|
||||
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_cv_c_bigendian=unknown
|
||||
# See if sys/param.h defines the BYTE_ORDER macro.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 701 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
|
||||
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
||||
bogus endian macros
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_compile; then
|
||||
rm -rf conftest*
|
||||
# It does; now see whether it defined to BIG_ENDIAN or not.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 717 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
|
||||
#if BYTE_ORDER != BIG_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_compile; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_bigendian=yes
|
||||
else
|
||||
rm -rf conftest*
|
||||
ac_cv_c_bigendian=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
if test $ac_cv_c_bigendian = unknown; then
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 746 "configure"
|
||||
#include "confdefs.h"
|
||||
main () {
|
||||
/* Are we little or big endian? From Harbison&Steele. */
|
||||
union
|
||||
{
|
||||
long l;
|
||||
char c[sizeof (long)];
|
||||
} u;
|
||||
u.l = 1;
|
||||
exit (u.c[sizeof (long) - 1] == 1);
|
||||
}
|
||||
EOF
|
||||
eval $ac_link
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_c_bigendian=no
|
||||
else
|
||||
ac_cv_c_bigendian=yes
|
||||
fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
fi
|
||||
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define WORDS_BIGENDIAN 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
if $ac_cv_c_bigendian = no ; then
|
||||
ENDIAN=little
|
||||
else
|
||||
ENDIAN=big
|
||||
fi
|
||||
|
||||
case "$host" in
|
||||
|
||||
## CX/UX
|
||||
|
@ -812,7 +926,6 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
echo machine dir is $srcdir/$dir
|
||||
/bin/rm -f $srcdir/scsh/machine
|
||||
ln -s $srcdir/$dir $srcdir/scsh/machine
|
||||
|
||||
|
@ -823,7 +936,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lm $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 826 "configure"
|
||||
#line 940 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -862,7 +975,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lgen $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 865 "configure"
|
||||
#line 979 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -901,7 +1014,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lnsl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 904 "configure"
|
||||
#line 1018 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -940,7 +1053,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lsocket $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 943 "configure"
|
||||
#line 1057 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -979,7 +1092,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lelf $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 982 "configure"
|
||||
#line 1096 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -1018,7 +1131,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lld $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1021 "configure"
|
||||
#line 1135 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -1057,7 +1170,7 @@ else
|
|||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1060 "configure"
|
||||
#line 1174 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
|
@ -1095,7 +1208,7 @@ if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1098 "configure"
|
||||
#line 1212 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
@ -1142,7 +1255,7 @@ else
|
|||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1145 "configure"
|
||||
#line 1259 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
|
@ -1156,7 +1269,7 @@ else
|
|||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1159 "configure"
|
||||
#line 1273 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
|
@ -1189,7 +1302,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1192 "configure"
|
||||
#line 1306 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
|
@ -1224,7 +1337,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1227 "configure"
|
||||
#line 1341 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
|
@ -1275,7 +1388,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1278 "configure"
|
||||
#line 1392 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
|
@ -1397,7 +1510,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1400 "configure"
|
||||
#line 1514 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <nlist.h>
|
||||
int main() { return 0; }
|
||||
|
@ -1432,7 +1545,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1435 "configure"
|
||||
#line 1549 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
int main() { return 0; }
|
||||
|
@ -1467,7 +1580,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1470 "configure"
|
||||
#line 1584 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <time.h>
|
||||
int main() { return 0; }
|
||||
|
@ -1501,7 +1614,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1504 "configure"
|
||||
#line 1618 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <time.h>
|
||||
int main() { return 0; }
|
||||
|
@ -1536,7 +1649,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1539 "configure"
|
||||
#line 1653 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
@ -1573,6 +1686,7 @@ CFLAGS1=${CFLAGS}
|
|||
|
||||
|
||||
|
||||
|
||||
trap '' 1 2 15
|
||||
cat > confcache <<\EOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
|
@ -1660,7 +1774,7 @@ done
|
|||
ac_given_srcdir=$srcdir
|
||||
ac_given_INSTALL="$INSTALL"
|
||||
|
||||
trap 'rm -fr `echo "Makefile scsh/regexp/Makefile sysdep.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
trap 'rm -fr `echo "Makefile scsh/regexp/Makefile scsh/network.scm sysdep.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
|
||||
# Protect against being on the right side of a sed subst in config.status.
|
||||
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
|
||||
|
@ -1687,13 +1801,14 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g
|
|||
s%@CPP@%$CPP%g
|
||||
s%@AIX_P@%$AIX_P%g
|
||||
s%@CFLAGS1@%$CFLAGS1%g
|
||||
s%@ENDIAN@%$ENDIAN%g
|
||||
s%@LDFLAGS_AIX@%$LDFLAGS_AIX%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
CONFIG_FILES=\${CONFIG_FILES-"Makefile scsh/regexp/Makefile"}
|
||||
CONFIG_FILES=\${CONFIG_FILES-"Makefile scsh/regexp/Makefile scsh/network.scm"}
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
|
|
10
configure.in
10
configure.in
|
@ -193,6 +193,13 @@ AC_ISC_POSIX
|
|||
AC_PROG_INSTALL
|
||||
AC_C_CONST
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
if [ $ac_cv_c_bigendian = no ] ; then
|
||||
ENDIAN=little
|
||||
else
|
||||
ENDIAN=big
|
||||
fi
|
||||
|
||||
case "$host" in
|
||||
|
||||
## CX/UX
|
||||
|
@ -315,7 +322,8 @@ CFLAGS1=${CFLAGS}
|
|||
AC_SUBST(AIX_P)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CFLAGS1)
|
||||
AC_SUBST(ENDIAN)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(LDFLAGS_AIX)
|
||||
|
||||
AC_OUTPUT(Makefile scsh/regexp/Makefile)
|
||||
AC_OUTPUT(Makefile scsh/regexp/Makefile scsh/network.scm)
|
||||
|
|
|
@ -935,6 +935,43 @@
|
|||
(C char**) ; alias list
|
||||
integer) ; protocol number
|
||||
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
;;; Endian Conversion routines
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
;; Big Endian - Motorola, Sparc, HPPA, etc
|
||||
(define (net-to-host-32-big num32)
|
||||
(and (<= 0 num32 #xffffffff)
|
||||
num32))
|
||||
|
||||
(define (net-to-host-16-big num16)
|
||||
(and (<= 0 num16 #xffffffff)
|
||||
num16))
|
||||
|
||||
;; Little Endian - Intel, Vax, Alpha
|
||||
(define (net-to-host-32-little num32)
|
||||
(and (<= 0 num32 #xffffffff)
|
||||
(let* ((num24 (arithmetic-shift num32 -8))
|
||||
(num16 (arithmetic-shift num24 -8))
|
||||
(num08 (arithmetic-shift num16 -8))
|
||||
(byte0 (bitwise-and #b11111111 num08))
|
||||
(byte1 (bitwise-and #b11111111 num16))
|
||||
(byte2 (bitwise-and #b11111111 num24))
|
||||
(byte3 (bitwise-and #b11111111 num32)))
|
||||
(+ (arithmetic-shift byte3 24)
|
||||
|
||||
(define (net-to-host-16-little num16)
|
||||
(and (<= 0 num16 #xffffffff)
|
||||
(let* ((num08 (arithmetic-shift num16 -8))
|
||||
(byte0 (bitwise-and #b11111111 num08))
|
||||
(byte1 (bitwise-and #b11111111 num16))
|
||||
(+ (arithmetic-shift byte1 8)
|
||||
byte0))))
|
||||
|
||||
(define net-to-host-32 net-to-host-32-@ENDIAN@)
|
||||
(define net-to-host-16 net-to-host-16-@ENDIAN@)
|
||||
(define host-to-net-32 host-to-net-32-@ENDIAN@)
|
||||
(define host-to-net-16 host-to-net-16-@ENDIAN@)
|
||||
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
;;; Lowlevel junk
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
|
|
|
@ -644,6 +644,11 @@
|
|||
protocol-info:name
|
||||
protocol-info:aliases
|
||||
protocol-info:number
|
||||
|
||||
net-to-host-32
|
||||
net-to-host-16
|
||||
host-to-net-32
|
||||
host-to-net-16
|
||||
))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue