llvm.org GIT mirror llvm / 0021c31
Added check for target machine endian-ness and put the result into Makefile.config (ENDIAN variable is set to big or little). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11398 91177308-0d34-0410-b5e6-96231b3b80d8 John Criswell 15 years ago
3 changed file(s) with 211 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
99
1010 # Target hardware architecture
1111 ARCH=@ARCH@
12
13 # Endian-ness of the target
14 ENDIAN=@ENDIAN@
1215
1316 # Path to the C++ compiler to use. This is an optional setting, which defaults
1417 # to whatever your gmake defaults to.
243243 dnl Check for various C features
244244 AC_C_PRINTF_A
245245
246 dnl Check for the endianness of the target
247 AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
248
246249 dnl Check for C++ extensions
247250 AC_CXX_HAVE_HASH_MAP
248251 AC_CXX_HAVE_HASH_SET
464464 #endif"
465465
466466 ac_unique_file=""Makefile.config.in""
467 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 subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS ETAGSFLAGS PYTHON QMTEST ALLOCA MMAP_FILE ENABLE_OPTIMIZED SPEC_ROOT USE_SPEC SPEC95_ROOT USE_SPEC95 UPB DISABLE_LLC_DIFFS JIT LLVMCC1 LLVMCC1PLUS BCR PAPIDIR SHLIBEXT LIBOBJS LTLIBOBJS'
467 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 subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS ETAGSFLAGS PYTHON QMTEST ENDIAN ALLOCA MMAP_FILE ENABLE_OPTIMIZED SPEC_ROOT USE_SPEC SPEC95_ROOT USE_SPEC95 UPB DISABLE_LLC_DIFFS JIT LLVMCC1 LLVMCC1PLUS BCR PAPIDIR SHLIBEXT LIBOBJS LTLIBOBJS'
468468 ac_subst_files=''
469469
470470 # Initialize some variables set by options.
1948019480 fi
1948119481
1948219482
19483 echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
19484 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
19485 if test "${ac_cv_c_bigendian+set}" = set; then
19486 echo $ECHO_N "(cached) $ECHO_C" >&6
19487 else
19488 # See if sys/param.h defines the BYTE_ORDER macro.
19489 cat >conftest.$ac_ext <<_ACEOF
19490 #line $LINENO "configure"
19491 /* confdefs.h. */
19492 _ACEOF
19493 cat confdefs.h >>conftest.$ac_ext
19494 cat >>conftest.$ac_ext <<_ACEOF
19495 /* end confdefs.h. */
19496 #include
19497 #include
19498
19499 int
19500 main ()
19501 {
19502 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
19503 bogus endian macros
19504 #endif
19505
19506 ;
19507 return 0;
19508 }
19509 _ACEOF
19510 rm -f conftest.$ac_objext
19511 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
19512 (eval $ac_compile) 2>&5
19513 ac_status=$?
19514 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19515 (exit $ac_status); } &&
19516 { ac_try='test -s conftest.$ac_objext'
19517 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19518 (eval $ac_try) 2>&5
19519 ac_status=$?
19520 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19521 (exit $ac_status); }; }; then
19522 # It does; now see whether it defined to BIG_ENDIAN or not.
19523 cat >conftest.$ac_ext <<_ACEOF
19524 #line $LINENO "configure"
19525 /* confdefs.h. */
19526 _ACEOF
19527 cat confdefs.h >>conftest.$ac_ext
19528 cat >>conftest.$ac_ext <<_ACEOF
19529 /* end confdefs.h. */
19530 #include
19531 #include
19532
19533 int
19534 main ()
19535 {
19536 #if BYTE_ORDER != BIG_ENDIAN
19537 not big endian
19538 #endif
19539
19540 ;
19541 return 0;
19542 }
19543 _ACEOF
19544 rm -f conftest.$ac_objext
19545 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
19546 (eval $ac_compile) 2>&5
19547 ac_status=$?
19548 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19549 (exit $ac_status); } &&
19550 { ac_try='test -s conftest.$ac_objext'
19551 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19552 (eval $ac_try) 2>&5
19553 ac_status=$?
19554 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19555 (exit $ac_status); }; }; then
19556 ac_cv_c_bigendian=yes
19557 else
19558 echo "$as_me: failed program was:" >&5
19559 sed 's/^/| /' conftest.$ac_ext >&5
19560
19561 ac_cv_c_bigendian=no
19562 fi
19563 rm -f conftest.$ac_objext conftest.$ac_ext
19564 else
19565 echo "$as_me: failed program was:" >&5
19566 sed 's/^/| /' conftest.$ac_ext >&5
19567
19568 # It does not; compile a test program.
19569 if test "$cross_compiling" = yes; then
19570 # try to guess the endianness by grepping values into an object file
19571 ac_cv_c_bigendian=unknown
19572 cat >conftest.$ac_ext <<_ACEOF
19573 #line $LINENO "configure"
19574 /* confdefs.h. */
19575 _ACEOF
19576 cat confdefs.h >>conftest.$ac_ext
19577 cat >>conftest.$ac_ext <<_ACEOF
19578 /* end confdefs.h. */
19579 short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
19580 short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
19581 void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
19582 short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
19583 short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
19584 void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
19585 int
19586 main ()
19587 {
19588 _ascii (); _ebcdic ();
19589 ;
19590 return 0;
19591 }
19592 _ACEOF
19593 rm -f conftest.$ac_objext
19594 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
19595 (eval $ac_compile) 2>&5
19596 ac_status=$?
19597 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19598 (exit $ac_status); } &&
19599 { ac_try='test -s conftest.$ac_objext'
19600 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19601 (eval $ac_try) 2>&5
19602 ac_status=$?
19603 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19604 (exit $ac_status); }; }; then
19605 if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
19606 ac_cv_c_bigendian=yes
19607 fi
19608 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
19609 if test "$ac_cv_c_bigendian" = unknown; then
19610 ac_cv_c_bigendian=no
19611 else
19612 # finding both strings is unlikely to happen, but who knows?
19613 ac_cv_c_bigendian=unknown
19614 fi
19615 fi
19616 else
19617 echo "$as_me: failed program was:" >&5
19618 sed 's/^/| /' conftest.$ac_ext >&5
19619
19620 fi
19621 rm -f conftest.$ac_objext conftest.$ac_ext
19622 else
19623 cat >conftest.$ac_ext <<_ACEOF
19624 #line $LINENO "configure"
19625 /* confdefs.h. */
19626 _ACEOF
19627 cat confdefs.h >>conftest.$ac_ext
19628 cat >>conftest.$ac_ext <<_ACEOF
19629 /* end confdefs.h. */
19630 int
19631 main ()
19632 {
19633 /* Are we little or big endian? From Harbison&Steele. */
19634 union
19635 {
19636 long l;
19637 char c[sizeof (long)];
19638 } u;
19639 u.l = 1;
19640 exit (u.c[sizeof (long) - 1] == 1);
19641 }
19642 _ACEOF
19643 rm -f conftest$ac_exeext
19644 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
19645 (eval $ac_link) 2>&5
19646 ac_status=$?
19647 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19648 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19649 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
19650 (eval $ac_try) 2>&5
19651 ac_status=$?
19652 echo "$as_me:$LINENO: \$? = $ac_status" >&5
19653 (exit $ac_status); }; }; then
19654 ac_cv_c_bigendian=no
19655 else
19656 echo "$as_me: program exited with status $ac_status" >&5
19657 echo "$as_me: failed program was:" >&5
19658 sed 's/^/| /' conftest.$ac_ext >&5
19659
19660 ( exit $ac_status )
19661 ac_cv_c_bigendian=yes
19662 fi
19663 rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19664 fi
19665 fi
19666 rm -f conftest.$ac_objext conftest.$ac_ext
19667 fi
19668 echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
19669 echo "${ECHO_T}$ac_cv_c_bigendian" >&6
19670 case $ac_cv_c_bigendian in
19671 yes)
19672 ENDIAN=big
19673 ;;
19674 no)
19675 ENDIAN=little
19676 ;;
19677 *)
19678 { { echo "$as_me:$LINENO: error: unknown endianness
19679 presetting ac_cv_c_bigendian=no (or yes) will help" >&5
19680 echo "$as_me: error: unknown endianness
19681 presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
19682 { (exit 1); exit 1; }; } ;;
19683 esac
19684
19685
1948319686 echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5
1948419687 echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6
1948519688 if test "${ac_cv_cxx_namespaces+set}" = set; then
2245922662 s,@ETAGSFLAGS@,$ETAGSFLAGS,;t t
2246022663 s,@PYTHON@,$PYTHON,;t t
2246122664 s,@QMTEST@,$QMTEST,;t t
22665 s,@ENDIAN@,$ENDIAN,;t t
2246222666 s,@ALLOCA@,$ALLOCA,;t t
2246322667 s,@MMAP_FILE@,$MMAP_FILE,;t t
2246422668 s,@ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t