Skip to content
configure 392 KiB
Newer Older
Torok Edwin's avatar
Torok Edwin committed
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then :
  :
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
Torok Edwin's avatar
Torok Edwin committed
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      return 2;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
Torok Edwin's avatar
Torok Edwin committed
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define STDC_HEADERS 1" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
		  inttypes.h stdint.h unistd.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
eval as_val=\$$as_ac_Header
   if test "x$as_val" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
done
Torok Edwin's avatar
Torok Edwin committed
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if test "${ac_cv_c_bigendian+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_c_bigendian=unknown
    # See if we're dealing with a universal compiler.
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifndef __APPLE_CC__
	       not a universal capable compiler
	     #endif
	     typedef int dummy;

_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

	# Check for potential -arch flags.  It is not universal unless
	# there are at least two -arch flags with different values.
	ac_arch=
	ac_prev=
	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
	 if test -n "$ac_prev"; then
	   case $ac_word in
	     i?86 | x86_64 | ppc | ppc64)
	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
		 ac_arch=$ac_word
	       else
		 ac_cv_c_bigendian=universal
		 break
	       fi
	       ;;
	   esac
	   ac_prev=
	 elif test "x$ac_word" = "x-arch"; then
	   ac_prev=arch
	 fi
       done
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    if test $ac_cv_c_bigendian = unknown; then
      # See if sys/param.h defines the BYTE_ORDER macro.
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
	     #include <sys/param.h>
Torok Edwin's avatar
Torok Edwin committed
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
		     && LITTLE_ENDIAN)
	      bogus endian macros
	     #endif
Torok Edwin's avatar
Torok Edwin committed
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
		#include <sys/param.h>
Torok Edwin's avatar
Torok Edwin committed
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
		 not big endian
		#endif
Torok Edwin's avatar
Torok Edwin committed
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <limits.h>
Torok Edwin's avatar
Torok Edwin committed
int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
	      bogus endian macros
	     #endif
Torok Edwin's avatar
Torok Edwin committed
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to _BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <limits.h>
Torok Edwin's avatar
Torok Edwin committed
int
main ()
{
#ifndef _BIG_ENDIAN
		 not big endian
		#endif
Torok Edwin's avatar
Torok Edwin committed
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # Compile a test program.
      if test "$cross_compiling" = yes; then :
  # Try to guess by grepping values from an object file.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
short int ascii_mm[] =
		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
		short int ascii_ii[] =
		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
		int use_ascii (int i) {
		  return ascii_mm[i] + ascii_ii[i];
		}
		short int ebcdic_ii[] =
		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
		short int ebcdic_mm[] =
		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
		int use_ebcdic (int i) {
		  return ebcdic_mm[i] + ebcdic_ii[i];
		}
		extern int foo;
Torok Edwin's avatar
Torok Edwin committed
int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
	      ac_cv_c_bigendian=yes
	    fi
	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
	      if test "$ac_cv_c_bigendian" = unknown; then
		ac_cv_c_bigendian=no
	      else
		# finding both strings is unlikely to happen, but who knows?
		ac_cv_c_bigendian=unknown
	      fi
	    fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
Torok Edwin's avatar
Torok Edwin committed
	     /* Are we little or big endian?  From Harbison&Steele.  */
	     union
	     {
	       long int l;
	       char c[sizeof (long int)];
	     } u;
	     u.l = 1;
	     return u.c[sizeof (long int) - 1] == 1;
Torok Edwin's avatar
Torok Edwin committed
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_c_bigendian=no
else
  ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
Torok Edwin's avatar
Torok Edwin committed
    fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
 case $ac_cv_c_bigendian in #(
   yes)
     ENDIAN=big
;; #(
   no)
     ENDIAN=little
 ;; #(
   universal)
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
     ;; #(
   *)
     as_fn_error "unknown endianness
 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
 esac
Torok Edwin's avatar
Torok Edwin committed
if test "$cross_compiling" = yes; then
  LLVM_CROSS_COMPILING=1
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for executable suffix on build platform" >&5
$as_echo_n "checking for executable suffix on build platform... " >&6; }
if test "${ac_cv_build_exeext+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  ac_cv_build_exeext=.exe
else
  ac_build_prefix=${build_alias}-
Torok Edwin's avatar
Torok Edwin committed
  # Extract the first word of "${ac_build_prefix}gcc", so it can be a program name with args.
set dummy ${ac_build_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CC+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CC"; then
  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_BUILD_CC="${ac_build_prefix}gcc"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
fi
fi
BUILD_CC=$ac_cv_prog_BUILD_CC
if test -n "$BUILD_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5
$as_echo "$BUILD_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
  if test -z "$BUILD_CC"; then
     # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CC+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CC"; then
  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_BUILD_CC="gcc"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
fi
fi
BUILD_CC=$ac_cv_prog_BUILD_CC
if test -n "$BUILD_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5
$as_echo "$BUILD_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
     if test -z "$BUILD_CC"; then
       # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CC+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CC"; then
  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
Torok Edwin's avatar
Torok Edwin committed
  ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
       ac_prog_rejected=yes
       continue
     fi
    ac_cv_prog_BUILD_CC="cc"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
Torok Edwin's avatar
Torok Edwin committed
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_BUILD_CC
  shift
  if test $# != 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set BUILD_CC to just the basename; use the full file name.
    shift
    ac_cv_prog_BUILD_CC="$as_dir/$ac_word${1+' '}$@"
  fi
fi
fi
fi
BUILD_CC=$ac_cv_prog_BUILD_CC
if test -n "$BUILD_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5
$as_echo "$BUILD_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
     fi
  fi
  test -z "$BUILD_CC" && as_fn_error "no acceptable cc found in \$PATH" "$LINENO" 5
  ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
  rm -f conftest*
  echo 'int main () { return 0; }' > conftest.$ac_ext
  ac_cv_build_exeext=
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_build_link\""; } >&5
  (eval $ac_build_link) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    for file in conftest.*; do
      case $file in
      *.c | *.o | *.obj | *.dSYM) ;;
      *) ac_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
      esac
    done
  else
    as_fn_error "installation or configuration problem: compiler cannot create executables." "$LINENO" 5
  fi
  rm -f conftest*
  test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank
fi
fi
Torok Edwin's avatar
Torok Edwin committed
BUILD_EXEEXT=""
test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_build_exeext}" >&5
$as_echo "${ac_cv_build_exeext}" >&6; }
ac_build_exeext=$BUILD_EXEEXT
Torok Edwin's avatar
Torok Edwin committed
  ac_build_prefix=${build_alias}-
  # Extract the first word of "${ac_build_prefix}g++", so it can be a program name with args.
set dummy ${ac_build_prefix}g++; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CXX+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CXX"; then
  ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_BUILD_CXX="${ac_build_prefix}g++"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
fi
fi
BUILD_CXX=$ac_cv_prog_BUILD_CXX
if test -n "$BUILD_CXX"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5
$as_echo "$BUILD_CXX" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
  if test -z "$BUILD_CXX"; then
     # Extract the first word of "g++", so it can be a program name with args.
set dummy g++; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CXX+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CXX"; then
  ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_BUILD_CXX="g++"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
fi
fi
BUILD_CXX=$ac_cv_prog_BUILD_CXX
if test -n "$BUILD_CXX"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5
$as_echo "$BUILD_CXX" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
     if test -z "$BUILD_CXX"; then
       # Extract the first word of "c++", so it can be a program name with args.
set dummy c++; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_BUILD_CXX+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$BUILD_CXX"; then
  ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test.
else
  ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/c++"; then
       ac_prog_rejected=yes
       continue
     fi
    ac_cv_prog_BUILD_CXX="c++"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS
Torok Edwin's avatar
Torok Edwin committed
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_BUILD_CXX
  shift
  if test $# != 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set BUILD_CXX to just the basename; use the full file name.
    shift
    ac_cv_prog_BUILD_CXX="$as_dir/$ac_word${1+' '}$@"
  fi
fi
fi
fi
BUILD_CXX=$ac_cv_prog_BUILD_CXX
if test -n "$BUILD_CXX"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5
$as_echo "$BUILD_CXX" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
Torok Edwin's avatar
Torok Edwin committed
     fi
  fi
else
  LLVM_CROSS_COMPILING=0
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then
  cvsbuild="yes"
  optimize="no"
  CVSBUILD=CVSBUILD=1
Torok Edwin's avatar
Torok Edwin committed
else
  cvsbuild="no"
  optimize="yes"
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-optimized was given.
if test "${enable_optimized+set}" = set; then :
  enableval=$enable_optimized;
else
  enableval=$optimize
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "no" ; then
  ENABLE_OPTIMIZED=
Torok Edwin's avatar
Torok Edwin committed
else
  ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-profiling was given.
if test "${enable_profiling+set}" = set; then :
  enableval=$enable_profiling;
else
  enableval="no"
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "no" ; then
  ENABLE_PROFILING=
Torok Edwin's avatar
Torok Edwin committed
else
  ENABLE_PROFILING=ENABLE_PROFILING=1
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-assertions was given.
if test "${enable_assertions+set}" = set; then :
  enableval=$enable_assertions;
Torok Edwin's avatar
Torok Edwin committed
  enableval="yes"
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "yes" ; then
  DISABLE_ASSERTIONS=
Torok Edwin's avatar
Torok Edwin committed
else
  DISABLE_ASSERTIONS=DISABLE_ASSERTIONS=1
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-expensive-checks was given.
if test "${enable_expensive_checks+set}" = set; then :
  enableval=$enable_expensive_checks;
else
  enableval="no"
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "yes" ; then
  ENABLE_EXPENSIVE_CHECKS=ENABLE_EXPENSIVE_CHECKS=1
Torok Edwin's avatar
Torok Edwin committed
  EXPENSIVE_CHECKS=yes
Torok Edwin's avatar
Torok Edwin committed
else
  ENABLE_EXPENSIVE_CHECKS=
Torok Edwin's avatar
Torok Edwin committed
  EXPENSIVE_CHECKS=no
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-debug-runtime was given.
if test "${enable_debug_runtime+set}" = set; then :
  enableval=$enable_debug_runtime;
else
  enableval=no
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "no" ; then
  DEBUG_RUNTIME=
Torok Edwin's avatar
Torok Edwin committed
else
  DEBUG_RUNTIME=DEBUG_RUNTIME=1
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-debug-symbols was given.
if test "${enable_debug_symbols+set}" = set; then :
  enableval=$enable_debug_symbols;
else
  enableval=no
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "no" ; then
  DEBUG_SYMBOLS=
Torok Edwin's avatar
Torok Edwin committed
else
  DEBUG_SYMBOLS=DEBUG_SYMBOLS=1
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-jit was given.
if test "${enable_jit+set}" = set; then :
  enableval=$enable_jit;
else
  enableval=default
fi
Torok Edwin's avatar
Torok Edwin committed
if test ${enableval} = "no"
then
  JIT=
Torok Edwin's avatar
Torok Edwin committed
else
  case "$llvm_cv_target_arch" in
    x86)         TARGET_HAS_JIT=1
 ;;
    Sparc)       TARGET_HAS_JIT=0
 ;;
    PowerPC)     TARGET_HAS_JIT=1
 ;;
    x86_64)      TARGET_HAS_JIT=1
 ;;
    Alpha)       TARGET_HAS_JIT=1
 ;;
    ARM)         TARGET_HAS_JIT=1
 ;;
    Mips)        TARGET_HAS_JIT=0
 ;;
    PIC16)       TARGET_HAS_JIT=0
 ;;
    XCore)       TARGET_HAS_JIT=0
 ;;
    MSP430)      TARGET_HAS_JIT=0
 ;;
    SystemZ)     TARGET_HAS_JIT=0
 ;;
    Blackfin)    TARGET_HAS_JIT=0
 ;;
    *)           TARGET_HAS_JIT=0
 ;;
  esac
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-doxygen was given.
if test "${enable_doxygen+set}" = set; then :
  enableval=$enable_doxygen;
else
  enableval=default
fi
Torok Edwin's avatar
Torok Edwin committed
case "$enableval" in
  yes) ENABLE_DOXYGEN=1
 ;;
  no)  ENABLE_DOXYGEN=0
 ;;
  default) ENABLE_DOXYGEN=0
 ;;
  *) as_fn_error "Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" "$LINENO" 5 ;;
esac
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then :
  enableval=$enable_threads;
else
  enableval=default
fi
Torok Edwin's avatar
Torok Edwin committed
case "$enableval" in
  yes) ENABLE_THREADS=1
 ;;
  no)  ENABLE_THREADS=0
 ;;
  default) ENABLE_THREADS=1
 ;;
  *) as_fn_error "Invalid setting for --enable-threads. Use \"yes\" or \"no\"" "$LINENO" 5 ;;
esac
Torok Edwin's avatar
Torok Edwin committed
cat >>confdefs.h <<_ACEOF
#define ENABLE_THREADS $ENABLE_THREADS
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-pic was given.
if test "${enable_pic+set}" = set; then :
  enableval=$enable_pic;
else
  enableval=default
fi
Torok Edwin's avatar
Torok Edwin committed
case "$enableval" in
  yes) ENABLE_PIC=1
 ;;
  no)  ENABLE_PIC=0
 ;;
  default) ENABLE_PIC=1
 ;;
  *) as_fn_error "Invalid setting for --enable-pic. Use \"yes\" or \"no\"" "$LINENO" 5 ;;
esac
Torok Edwin's avatar
Torok Edwin committed
cat >>confdefs.h <<_ACEOF
#define ENABLE_PIC $ENABLE_PIC
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
TARGETS_TO_BUILD=""
# Check whether --enable-targets was given.
if test "${enable_targets+set}" = set; then :
  enableval=$enable_targets;
Torok Edwin's avatar
Torok Edwin committed
  enableval=all
Torok Edwin's avatar
Torok Edwin committed
if test "$enableval" = host-only ; then
  enableval=host
Torok Edwin's avatar
Torok Edwin committed
case "$enableval" in
  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend" ;;
  *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
      case "$a_target" in
        x86)      TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
        x86_64)   TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
        sparc)    TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
        powerpc)  TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
        alpha)    TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
        arm)      TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
        mips)     TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
        spu)      TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
        pic16)    TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
        xcore)    TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
        msp430)   TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
        systemz)  TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
        blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;;
        cbe)      TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
        msil)     TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
        cpp)      TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
        host) case "$llvm_cv_target_arch" in
            x86)         TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
            x86_64)      TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
            Sparc)       TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
            PowerPC)     TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
            Alpha)       TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
            ARM)         TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
            Mips)        TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
            CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
            PIC16)       TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
            XCore)       TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
            MSP430)      TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
            s390x)       TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
            Blackfin)    TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;;
            *)       as_fn_error "Can not set target to build" "$LINENO" 5 ;;
          esac ;;
        *) as_fn_error "Unrecognized target $a_target" "$LINENO" 5 ;;
      esac
  done
  ;;
Torok Edwin's avatar
Torok Edwin committed
TARGETS_TO_BUILD=$TARGETS_TO_BUILD
Torok Edwin's avatar
Torok Edwin committed
# Determine whether we are building LLVM support for the native architecture.
# If so, define LLVM_NATIVE_ARCH to that LLVM target.
for a_target in $TARGETS_TO_BUILD; do
  if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
    LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"

cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCHTARGET
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
# Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual
# target feature def files.
LLVM_ENUM_TARGETS=""
LLVM_ENUM_ASM_PRINTERS=""
LLVM_ENUM_ASM_PARSERS=""
LLVM_ENUM_DISASSEMBLERS=""
for target_to_build in $TARGETS_TO_BUILD; do
  LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS"
  if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then
    LLVM_ENUM_ASM_PRINTERS="LLVM_ASM_PRINTER($target_to_build) $LLVM_ENUM_ASM_PRINTERS";
  fi
  if test -f ${srcdir}/lib/Target/${target_to_build}/AsmParser/Makefile ; then
    LLVM_ENUM_ASM_PARSERS="LLVM_ASM_PARSER($target_to_build) $LLVM_ENUM_ASM_PARSERS";
  fi
  if test -f ${srcdir}/lib/Target/${target_to_build}/Disassembler/Makefile ; then
    LLVM_ENUM_DISASSEMBLERS="LLVM_DISASSEMBLER($target_to_build) $LLVM_ENUM_DISASSEMBLERS";
  fi
done

Torok Edwin's avatar
Torok Edwin committed
# Check whether --enable-cbe-printf-a was given.
if test "${enable_cbe_printf_a+set}" = set; then :
  enableval=$enable_cbe_printf_a;
else
  enableval=default
fi
Torok Edwin's avatar
Torok Edwin committed
case "$enableval" in
  yes) ENABLE_CBE_PRINTF_A=1
 ;;
  no)  ENABLE_CBE_PRINTF_A=0
 ;;
  default)  ENABLE_CBE_PRINTF_A=1
 ;;
  *) as_fn_error "Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" "$LINENO" 5 ;;
esac
Torok Edwin's avatar
Torok Edwin committed
cat >>confdefs.h <<_ACEOF
#define ENABLE_CBE_PRINTF_A $ENABLE_CBE_PRINTF_A
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-llvmgccdir was given.
if test "${with_llvmgccdir+set}" = set; then :
  withval=$with_llvmgccdir;
else
  withval=default
fi
Torok Edwin's avatar
Torok Edwin committed
case "$withval" in
  default) WITH_LLVMGCCDIR=default ;;
  /* | [A-Za-z]:[\\/]*)      WITH_LLVMGCCDIR=$withval ;;
  *) as_fn_error "Invalid path for --with-llvmgccdir. Provide full path" "$LINENO" 5 ;;
esac
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-llvmgcc was given.
if test "${with_llvmgcc+set}" = set; then :
  withval=$with_llvmgcc; LLVMGCC=$with_llvmgcc
      WITH_LLVMGCCDIR=""
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-llvmgxx was given.
if test "${with_llvmgxx+set}" = set; then :
  withval=$with_llvmgxx; LLVMGXX=$with_llvmgxx
    WITH_LLVMGCCDIR=""
fi
Torok Edwin's avatar
Torok Edwin committed
if test -n "$LLVMGCC"; then
   LLVMGCCCOMMAND="$LLVMGCC"
fi
Torok Edwin's avatar
Torok Edwin committed
if test -n "$LLVMGXX"; then
   LLVMGXXCOMMAND="$LLVMGXX"
fi
Torok Edwin's avatar
Torok Edwin committed
if test -n "$LLVMGCC" && test -z "$LLVMGXX"; then
   as_fn_error "Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used" "$LINENO" 5;
fi
Torok Edwin's avatar
Torok Edwin committed
if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then
   as_fn_error "Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used" "$LINENO" 5;
fi
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-optimize-option was given.
if test "${with_optimize_option+set}" = set; then :
  withval=$with_optimize_option;
else
  withval=default
fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking optimization flags" >&5
$as_echo_n "checking optimization flags... " >&6; }
case "$withval" in
  default)
    case "$llvm_cv_os_type" in
    MingW) optimize_option=-O3 ;;
    *)     optimize_option=-O2 ;;
    esac ;;
  *) optimize_option="$withval" ;;
Torok Edwin's avatar
Torok Edwin committed
OPTIMIZE_OPTION=$optimize_option
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $optimize_option" >&5
$as_echo "$optimize_option" >&6; }
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-extra-options was given.