Changeset 10840


Ignore:
Timestamp:
2005-11-07T10:29:04+13:00 (18 years ago)
Author:
kjdon
Message:

added check for endianness: AC_C_BIGENDIAN, which defines WORDS_BIGENDIAN to configure. Then netorder.h checks for WORDS_BIGENDIAN, rather than LITTLE_ENDIAN, _LITTLE_ENDIAN, LITTLE_ENDIAN etc, as these get defined on all platforms. This meant that linux collections would not work on teh mac because doubles were getting the wrong endianness

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/packages/mg/config.h.in

    r3756 r10840  
    173173/* Define if you have the m library (-lm).  */
    174174#undef HAVE_LIBM
     175
     176/* Define if big endian */
     177#undef WORDS_BIGENDIAN
  • trunk/gsdl3/src/packages/mg/configure

    r10191 r10840  
    310310#endif"
    311311
    312 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT AWK YACC CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP U ANSI2KNR ALLOCA LIBOBJS JNIINC JNISUFFIX JNIFLAGS LIBOBJS LTLIBOBJS'
     312ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT AWK YACC CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP U ANSI2KNR ALLOCA LIBOBJS JNIINC JNISUFFIX JNIFLAGS LTLIBOBJS'
    313313ac_subst_files=''
    314314
     
    61156115_ACEOF
    61166116
    6117   LIBOBJS="$LIBOBJS regex.o"
     6117  case $LIBOBJS in
     6118    "regex.$ac_objext"   | \
     6119  *" regex.$ac_objext"   | \
     6120    "regex.$ac_objext "* | \
     6121  *" regex.$ac_objext "* ) ;;
     6122  *) LIBOBJS="$LIBOBJS regex.$ac_objext" ;;
     6123esac
     6124
    61186125fi
    61196126fi;
     
    62146221  :
    62156222else
    6216   LIBOBJS="$LIBOBJS rx.o"
    6217 fi
    6218 
    6219 fi
     6223  case $LIBOBJS in
     6224    "rx.$ac_objext"   | \
     6225  *" rx.$ac_objext"   | \
     6226    "rx.$ac_objext "* | \
     6227  *" rx.$ac_objext "* ) ;;
     6228  *) LIBOBJS="$LIBOBJS rx.$ac_objext" ;;
     6229esac
     6230
     6231fi
     6232
     6233fi
     6234
     6235
     6236# text for endianness
     6237echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
     6238echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
     6239if test "${ac_cv_c_bigendian+set}" = set; then
     6240  echo $ECHO_N "(cached) $ECHO_C" >&6
     6241else
     6242  # See if sys/param.h defines the BYTE_ORDER macro.
     6243cat >conftest.$ac_ext <<_ACEOF
     6244/* confdefs.h.  */
     6245_ACEOF
     6246cat confdefs.h >>conftest.$ac_ext
     6247cat >>conftest.$ac_ext <<_ACEOF
     6248/* end confdefs.h.  */
     6249#include <sys/types.h>
     6250#include <sys/param.h>
     6251
     6252int
     6253main ()
     6254{
     6255#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
     6256 bogus endian macros
     6257#endif
     6258
     6259  ;
     6260  return 0;
     6261}
     6262_ACEOF
     6263rm -f conftest.$ac_objext
     6264if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6265  (eval $ac_compile) 2>conftest.er1
     6266  ac_status=$?
     6267  grep -v '^ *+' conftest.er1 >conftest.err
     6268  rm -f conftest.er1
     6269  cat conftest.err >&5
     6270  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6271  (exit $ac_status); } &&
     6272     { ac_try='test -z "$ac_c_werror_flag"
     6273             || test ! -s conftest.err'
     6274  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6275  (eval $ac_try) 2>&5
     6276  ac_status=$?
     6277  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6278  (exit $ac_status); }; } &&
     6279     { ac_try='test -s conftest.$ac_objext'
     6280  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6281  (eval $ac_try) 2>&5
     6282  ac_status=$?
     6283  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6284  (exit $ac_status); }; }; then
     6285  # It does; now see whether it defined to BIG_ENDIAN or not.
     6286cat >conftest.$ac_ext <<_ACEOF
     6287/* confdefs.h.  */
     6288_ACEOF
     6289cat confdefs.h >>conftest.$ac_ext
     6290cat >>conftest.$ac_ext <<_ACEOF
     6291/* end confdefs.h.  */
     6292#include <sys/types.h>
     6293#include <sys/param.h>
     6294
     6295int
     6296main ()
     6297{
     6298#if BYTE_ORDER != BIG_ENDIAN
     6299 not big endian
     6300#endif
     6301
     6302  ;
     6303  return 0;
     6304}
     6305_ACEOF
     6306rm -f conftest.$ac_objext
     6307if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6308  (eval $ac_compile) 2>conftest.er1
     6309  ac_status=$?
     6310  grep -v '^ *+' conftest.er1 >conftest.err
     6311  rm -f conftest.er1
     6312  cat conftest.err >&5
     6313  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6314  (exit $ac_status); } &&
     6315     { ac_try='test -z "$ac_c_werror_flag"
     6316             || test ! -s conftest.err'
     6317  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6318  (eval $ac_try) 2>&5
     6319  ac_status=$?
     6320  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6321  (exit $ac_status); }; } &&
     6322     { ac_try='test -s conftest.$ac_objext'
     6323  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6324  (eval $ac_try) 2>&5
     6325  ac_status=$?
     6326  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6327  (exit $ac_status); }; }; then
     6328  ac_cv_c_bigendian=yes
     6329else
     6330  echo "$as_me: failed program was:" >&5
     6331sed 's/^/| /' conftest.$ac_ext >&5
     6332
     6333ac_cv_c_bigendian=no
     6334fi
     6335rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6336else
     6337  echo "$as_me: failed program was:" >&5
     6338sed 's/^/| /' conftest.$ac_ext >&5
     6339
     6340# It does not; compile a test program.
     6341if test "$cross_compiling" = yes; then
     6342  # try to guess the endianness by grepping values into an object file
     6343  ac_cv_c_bigendian=unknown
     6344  cat >conftest.$ac_ext <<_ACEOF
     6345/* confdefs.h.  */
     6346_ACEOF
     6347cat confdefs.h >>conftest.$ac_ext
     6348cat >>conftest.$ac_ext <<_ACEOF
     6349/* end confdefs.h.  */
     6350short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
     6351short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
     6352void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
     6353short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
     6354short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
     6355void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
     6356int
     6357main ()
     6358{
     6359 _ascii (); _ebcdic ();
     6360  ;
     6361  return 0;
     6362}
     6363_ACEOF
     6364rm -f conftest.$ac_objext
     6365if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6366  (eval $ac_compile) 2>conftest.er1
     6367  ac_status=$?
     6368  grep -v '^ *+' conftest.er1 >conftest.err
     6369  rm -f conftest.er1
     6370  cat conftest.err >&5
     6371  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6372  (exit $ac_status); } &&
     6373     { ac_try='test -z "$ac_c_werror_flag"
     6374             || test ! -s conftest.err'
     6375  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6376  (eval $ac_try) 2>&5
     6377  ac_status=$?
     6378  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6379  (exit $ac_status); }; } &&
     6380     { ac_try='test -s conftest.$ac_objext'
     6381  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6382  (eval $ac_try) 2>&5
     6383  ac_status=$?
     6384  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6385  (exit $ac_status); }; }; then
     6386  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
     6387  ac_cv_c_bigendian=yes
     6388fi
     6389if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
     6390  if test "$ac_cv_c_bigendian" = unknown; then
     6391    ac_cv_c_bigendian=no
     6392  else
     6393    # finding both strings is unlikely to happen, but who knows?
     6394    ac_cv_c_bigendian=unknown
     6395  fi
     6396fi
     6397else
     6398  echo "$as_me: failed program was:" >&5
     6399sed 's/^/| /' conftest.$ac_ext >&5
     6400
     6401fi
     6402rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6403else
     6404  cat >conftest.$ac_ext <<_ACEOF
     6405/* confdefs.h.  */
     6406_ACEOF
     6407cat confdefs.h >>conftest.$ac_ext
     6408cat >>conftest.$ac_ext <<_ACEOF
     6409/* end confdefs.h.  */
     6410int
     6411main ()
     6412{
     6413  /* Are we little or big endian?  From Harbison&Steele.  */
     6414  union
     6415  {
     6416    long l;
     6417    char c[sizeof (long)];
     6418  } u;
     6419  u.l = 1;
     6420  exit (u.c[sizeof (long) - 1] == 1);
     6421}
     6422_ACEOF
     6423rm -f conftest$ac_exeext
     6424if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6425  (eval $ac_link) 2>&5
     6426  ac_status=$?
     6427  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6428  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     6429  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6430  (eval $ac_try) 2>&5
     6431  ac_status=$?
     6432  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6433  (exit $ac_status); }; }; then
     6434  ac_cv_c_bigendian=no
     6435else
     6436  echo "$as_me: program exited with status $ac_status" >&5
     6437echo "$as_me: failed program was:" >&5
     6438sed 's/^/| /' conftest.$ac_ext >&5
     6439
     6440( exit $ac_status )
     6441ac_cv_c_bigendian=yes
     6442fi
     6443rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     6444fi
     6445fi
     6446rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6447fi
     6448echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
     6449echo "${ECHO_T}$ac_cv_c_bigendian" >&6
     6450case $ac_cv_c_bigendian in
     6451  yes)
     6452
     6453cat >>confdefs.h <<\_ACEOF
     6454#define WORDS_BIGENDIAN 1
     6455_ACEOF
     6456 ;;
     6457  no)
     6458     ;;
     6459  *)
     6460    { { echo "$as_me:$LINENO: error: unknown endianness
     6461presetting ac_cv_c_bigendian=no (or yes) will help" >&5
     6462echo "$as_me: error: unknown endianness
     6463presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
     6464   { (exit 1); exit 1; }; } ;;
     6465esac
    62206466
    62216467
     
    68977143s,@JNISUFFIX@,$JNISUFFIX,;t t
    68987144s,@JNIFLAGS@,$JNIFLAGS,;t t
    6899 s,@LIBOBJS@,$LIBOBJS,;t t
    69007145s,@LTLIBOBJS@,$LTLIBOBJS,;t t
    69017146CEOF
  • trunk/gsdl3/src/packages/mg/configure.in

    r10191 r10840  
    106106fp_WITH_REGEX
    107107
     108# text for endianness
     109AC_C_BIGENDIAN
     110
    108111# ---------------------------------------------------------------------------
    109112if test "$ac_cv_func_alloca" = 'no'; then
  • trunk/gsdl3/src/packages/mg/lib/netorder.h

    r3745 r10840  
    1111#endif
    1212
    13 #if defined (BIG_ENDIAN) || defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN)
    14 # ifndef _BIG_ENDIAN
    15 #  define _BIG_ENDIAN
    16 # endif
    17 #endif
    1813
    19 #if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
    20 # ifndef _LITTLE_ENDIAN
    21 #  define _LITTLE_ENDIAN
    22 # endif
    23 #endif
    24 
    25 #ifdef _LITTLE_ENDIAN
     14#ifndef WORDS_BIGENDIAN
    2615
    2716/* double */
     
    133122#define NTOHUS2(ns, hs)   ((hs) = ntohs((ns)))
    134123
    135 #else   /* _BIG_ENDIAN */
     124#else   /* WORDS_BIGENDIAN */
    136125
    137126/* double */
  • trunk/indexers/mg/config.h.in

    r3756 r10840  
    173173/* Define if you have the m library (-lm).  */
    174174#undef HAVE_LIBM
     175
     176/* Define if big endian */
     177#undef WORDS_BIGENDIAN
  • trunk/indexers/mg/configure

    r10191 r10840  
    310310#endif"
    311311
    312 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT AWK YACC CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP U ANSI2KNR ALLOCA LIBOBJS JNIINC JNISUFFIX JNIFLAGS LIBOBJS LTLIBOBJS'
     312ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT AWK YACC CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP U ANSI2KNR ALLOCA LIBOBJS JNIINC JNISUFFIX JNIFLAGS LTLIBOBJS'
    313313ac_subst_files=''
    314314
     
    61156115_ACEOF
    61166116
    6117   LIBOBJS="$LIBOBJS regex.o"
     6117  case $LIBOBJS in
     6118    "regex.$ac_objext"   | \
     6119  *" regex.$ac_objext"   | \
     6120    "regex.$ac_objext "* | \
     6121  *" regex.$ac_objext "* ) ;;
     6122  *) LIBOBJS="$LIBOBJS regex.$ac_objext" ;;
     6123esac
     6124
    61186125fi
    61196126fi;
     
    62146221  :
    62156222else
    6216   LIBOBJS="$LIBOBJS rx.o"
    6217 fi
    6218 
    6219 fi
     6223  case $LIBOBJS in
     6224    "rx.$ac_objext"   | \
     6225  *" rx.$ac_objext"   | \
     6226    "rx.$ac_objext "* | \
     6227  *" rx.$ac_objext "* ) ;;
     6228  *) LIBOBJS="$LIBOBJS rx.$ac_objext" ;;
     6229esac
     6230
     6231fi
     6232
     6233fi
     6234
     6235
     6236# text for endianness
     6237echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
     6238echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
     6239if test "${ac_cv_c_bigendian+set}" = set; then
     6240  echo $ECHO_N "(cached) $ECHO_C" >&6
     6241else
     6242  # See if sys/param.h defines the BYTE_ORDER macro.
     6243cat >conftest.$ac_ext <<_ACEOF
     6244/* confdefs.h.  */
     6245_ACEOF
     6246cat confdefs.h >>conftest.$ac_ext
     6247cat >>conftest.$ac_ext <<_ACEOF
     6248/* end confdefs.h.  */
     6249#include <sys/types.h>
     6250#include <sys/param.h>
     6251
     6252int
     6253main ()
     6254{
     6255#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
     6256 bogus endian macros
     6257#endif
     6258
     6259  ;
     6260  return 0;
     6261}
     6262_ACEOF
     6263rm -f conftest.$ac_objext
     6264if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6265  (eval $ac_compile) 2>conftest.er1
     6266  ac_status=$?
     6267  grep -v '^ *+' conftest.er1 >conftest.err
     6268  rm -f conftest.er1
     6269  cat conftest.err >&5
     6270  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6271  (exit $ac_status); } &&
     6272     { ac_try='test -z "$ac_c_werror_flag"
     6273             || test ! -s conftest.err'
     6274  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6275  (eval $ac_try) 2>&5
     6276  ac_status=$?
     6277  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6278  (exit $ac_status); }; } &&
     6279     { ac_try='test -s conftest.$ac_objext'
     6280  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6281  (eval $ac_try) 2>&5
     6282  ac_status=$?
     6283  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6284  (exit $ac_status); }; }; then
     6285  # It does; now see whether it defined to BIG_ENDIAN or not.
     6286cat >conftest.$ac_ext <<_ACEOF
     6287/* confdefs.h.  */
     6288_ACEOF
     6289cat confdefs.h >>conftest.$ac_ext
     6290cat >>conftest.$ac_ext <<_ACEOF
     6291/* end confdefs.h.  */
     6292#include <sys/types.h>
     6293#include <sys/param.h>
     6294
     6295int
     6296main ()
     6297{
     6298#if BYTE_ORDER != BIG_ENDIAN
     6299 not big endian
     6300#endif
     6301
     6302  ;
     6303  return 0;
     6304}
     6305_ACEOF
     6306rm -f conftest.$ac_objext
     6307if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6308  (eval $ac_compile) 2>conftest.er1
     6309  ac_status=$?
     6310  grep -v '^ *+' conftest.er1 >conftest.err
     6311  rm -f conftest.er1
     6312  cat conftest.err >&5
     6313  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6314  (exit $ac_status); } &&
     6315     { ac_try='test -z "$ac_c_werror_flag"
     6316             || test ! -s conftest.err'
     6317  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6318  (eval $ac_try) 2>&5
     6319  ac_status=$?
     6320  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6321  (exit $ac_status); }; } &&
     6322     { ac_try='test -s conftest.$ac_objext'
     6323  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6324  (eval $ac_try) 2>&5
     6325  ac_status=$?
     6326  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6327  (exit $ac_status); }; }; then
     6328  ac_cv_c_bigendian=yes
     6329else
     6330  echo "$as_me: failed program was:" >&5
     6331sed 's/^/| /' conftest.$ac_ext >&5
     6332
     6333ac_cv_c_bigendian=no
     6334fi
     6335rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6336else
     6337  echo "$as_me: failed program was:" >&5
     6338sed 's/^/| /' conftest.$ac_ext >&5
     6339
     6340# It does not; compile a test program.
     6341if test "$cross_compiling" = yes; then
     6342  # try to guess the endianness by grepping values into an object file
     6343  ac_cv_c_bigendian=unknown
     6344  cat >conftest.$ac_ext <<_ACEOF
     6345/* confdefs.h.  */
     6346_ACEOF
     6347cat confdefs.h >>conftest.$ac_ext
     6348cat >>conftest.$ac_ext <<_ACEOF
     6349/* end confdefs.h.  */
     6350short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
     6351short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
     6352void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
     6353short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
     6354short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
     6355void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
     6356int
     6357main ()
     6358{
     6359 _ascii (); _ebcdic ();
     6360  ;
     6361  return 0;
     6362}
     6363_ACEOF
     6364rm -f conftest.$ac_objext
     6365if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6366  (eval $ac_compile) 2>conftest.er1
     6367  ac_status=$?
     6368  grep -v '^ *+' conftest.er1 >conftest.err
     6369  rm -f conftest.er1
     6370  cat conftest.err >&5
     6371  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6372  (exit $ac_status); } &&
     6373     { ac_try='test -z "$ac_c_werror_flag"
     6374             || test ! -s conftest.err'
     6375  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6376  (eval $ac_try) 2>&5
     6377  ac_status=$?
     6378  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6379  (exit $ac_status); }; } &&
     6380     { ac_try='test -s conftest.$ac_objext'
     6381  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6382  (eval $ac_try) 2>&5
     6383  ac_status=$?
     6384  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6385  (exit $ac_status); }; }; then
     6386  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
     6387  ac_cv_c_bigendian=yes
     6388fi
     6389if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
     6390  if test "$ac_cv_c_bigendian" = unknown; then
     6391    ac_cv_c_bigendian=no
     6392  else
     6393    # finding both strings is unlikely to happen, but who knows?
     6394    ac_cv_c_bigendian=unknown
     6395  fi
     6396fi
     6397else
     6398  echo "$as_me: failed program was:" >&5
     6399sed 's/^/| /' conftest.$ac_ext >&5
     6400
     6401fi
     6402rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6403else
     6404  cat >conftest.$ac_ext <<_ACEOF
     6405/* confdefs.h.  */
     6406_ACEOF
     6407cat confdefs.h >>conftest.$ac_ext
     6408cat >>conftest.$ac_ext <<_ACEOF
     6409/* end confdefs.h.  */
     6410int
     6411main ()
     6412{
     6413  /* Are we little or big endian?  From Harbison&Steele.  */
     6414  union
     6415  {
     6416    long l;
     6417    char c[sizeof (long)];
     6418  } u;
     6419  u.l = 1;
     6420  exit (u.c[sizeof (long) - 1] == 1);
     6421}
     6422_ACEOF
     6423rm -f conftest$ac_exeext
     6424if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6425  (eval $ac_link) 2>&5
     6426  ac_status=$?
     6427  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6428  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     6429  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6430  (eval $ac_try) 2>&5
     6431  ac_status=$?
     6432  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6433  (exit $ac_status); }; }; then
     6434  ac_cv_c_bigendian=no
     6435else
     6436  echo "$as_me: program exited with status $ac_status" >&5
     6437echo "$as_me: failed program was:" >&5
     6438sed 's/^/| /' conftest.$ac_ext >&5
     6439
     6440( exit $ac_status )
     6441ac_cv_c_bigendian=yes
     6442fi
     6443rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     6444fi
     6445fi
     6446rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6447fi
     6448echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
     6449echo "${ECHO_T}$ac_cv_c_bigendian" >&6
     6450case $ac_cv_c_bigendian in
     6451  yes)
     6452
     6453cat >>confdefs.h <<\_ACEOF
     6454#define WORDS_BIGENDIAN 1
     6455_ACEOF
     6456 ;;
     6457  no)
     6458     ;;
     6459  *)
     6460    { { echo "$as_me:$LINENO: error: unknown endianness
     6461presetting ac_cv_c_bigendian=no (or yes) will help" >&5
     6462echo "$as_me: error: unknown endianness
     6463presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
     6464   { (exit 1); exit 1; }; } ;;
     6465esac
    62206466
    62216467
     
    68977143s,@JNISUFFIX@,$JNISUFFIX,;t t
    68987144s,@JNIFLAGS@,$JNIFLAGS,;t t
    6899 s,@LIBOBJS@,$LIBOBJS,;t t
    69007145s,@LTLIBOBJS@,$LTLIBOBJS,;t t
    69017146CEOF
  • trunk/indexers/mg/configure.in

    r10191 r10840  
    106106fp_WITH_REGEX
    107107
     108# text for endianness
     109AC_C_BIGENDIAN
     110
    108111# ---------------------------------------------------------------------------
    109112if test "$ac_cv_func_alloca" = 'no'; then
  • trunk/indexers/mg/lib/netorder.h

    r3745 r10840  
    1111#endif
    1212
    13 #if defined (BIG_ENDIAN) || defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN)
    14 # ifndef _BIG_ENDIAN
    15 #  define _BIG_ENDIAN
    16 # endif
    17 #endif
    1813
    19 #if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
    20 # ifndef _LITTLE_ENDIAN
    21 #  define _LITTLE_ENDIAN
    22 # endif
    23 #endif
    24 
    25 #ifdef _LITTLE_ENDIAN
     14#ifndef WORDS_BIGENDIAN
    2615
    2716/* double */
     
    133122#define NTOHUS2(ns, hs)   ((hs) = ntohs((ns)))
    134123
    135 #else   /* _BIG_ENDIAN */
     124#else   /* WORDS_BIGENDIAN */
    136125
    137126/* double */
Note: See TracChangeset for help on using the changeset viewer.