Skip to content
configure 392 KiB
Newer Older
Reid Spencer's avatar
Reid Spencer committed
float f; finite(f);
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_cxx_try_compile "$LINENO"; then :
Reid Spencer's avatar
Reid Spencer committed
  ac_cv_func_finite_in_ieeefp_h=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_func_finite_in_ieeefp_h=no
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_finite_in_ieeefp_h" >&5
$as_echo "$ac_cv_func_finite_in_ieeefp_h" >&6; }
Reid Spencer's avatar
Reid Spencer committed

if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_FINITE_IN_IEEEFP_H 1" >>confdefs.h
if test "$llvm_cv_platform_type" = "Unix" ; then
Torok Edwin's avatar
Torok Edwin committed
  for ac_header in $ac_header_list
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 :
Reid Spencer's avatar
Reid Spencer committed
  cat >>confdefs.h <<_ACEOF
Torok Edwin's avatar
Torok Edwin committed
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
Reid Spencer's avatar
Reid Spencer committed
_ACEOF
Reid Spencer's avatar
Reid Spencer committed
fi
Reid Spencer's avatar
Reid Spencer committed
done
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed

for ac_func in getpagesize
do :
  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
if test "x$ac_cv_func_getpagesize" = x""yes; then :
Reid Spencer's avatar
Reid Spencer committed
  cat >>confdefs.h <<_ACEOF
Torok Edwin's avatar
Torok Edwin committed
#define HAVE_GETPAGESIZE 1
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
$as_echo_n "checking for working mmap... " >&6; }
if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
Torok Edwin's avatar
Torok Edwin committed
  if test "$cross_compiling" = yes; then :
Reid Spencer's avatar
Reid Spencer committed
  ac_cv_func_mmap_fixed_mapped=no
else
Torok Edwin's avatar
Torok Edwin committed
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed
/* end confdefs.h.  */
$ac_includes_default
/* malloc might have been renamed as rpl_malloc. */
#undef malloc

/* Thanks to Mike Haertel and Jim Avera for this test.
   Here is a matrix of mmap possibilities:
	mmap private not fixed
	mmap private fixed at somewhere currently unmapped
	mmap private fixed at somewhere already mapped
	mmap shared not fixed
	mmap shared fixed at somewhere currently unmapped
	mmap shared fixed at somewhere already mapped
   For private mappings, we should verify that changes cannot be read()
   back from the file, nor mmap's back from the file at a different
   address.  (There have been systems where private was not correctly
   implemented like the infamous i386 svr4.0, and systems where the
   VM page cache was not coherent with the file system buffer cache
   like early versions of FreeBSD and possibly contemporary NetBSD.)
   For shared mappings, we should conversely verify that changes get
   propagated back to all the places they're supposed to be.

   Grep wants private fixed already mapped.
   The main things grep needs to know about mmap are:
   * does it exist and is it safe to write into the mmap'd area
   * how to use it (BSD variants)  */

#include <fcntl.h>
#include <sys/mman.h>

Torok Edwin's avatar
Torok Edwin committed
#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
Reid Spencer's avatar
Reid Spencer committed
char *malloc ();
#endif

/* This mess was copied from the GNU getpagesize.h.  */
Torok Edwin's avatar
Torok Edwin committed
#ifndef HAVE_GETPAGESIZE
Reid Spencer's avatar
Reid Spencer committed
# ifdef _SC_PAGESIZE
#  define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
Torok Edwin's avatar
Torok Edwin committed
#  ifdef HAVE_SYS_PARAM_H
Reid Spencer's avatar
Reid Spencer committed
#   include <sys/param.h>
#   ifdef EXEC_PAGESIZE
#    define getpagesize() EXEC_PAGESIZE
#   else /* no EXEC_PAGESIZE */
#    ifdef NBPG
#     define getpagesize() NBPG * CLSIZE
#     ifndef CLSIZE
#      define CLSIZE 1
#     endif /* no CLSIZE */
#    else /* no NBPG */
#     ifdef NBPC
#      define getpagesize() NBPC
#     else /* no NBPC */
#      ifdef PAGESIZE
#       define getpagesize() PAGESIZE
#      endif /* PAGESIZE */
#     endif /* no NBPC */
#    endif /* no NBPG */
#   endif /* no EXEC_PAGESIZE */
#  else /* no HAVE_SYS_PARAM_H */
#   define getpagesize() 8192	/* punt totally */
#  endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */

#endif /* no HAVE_GETPAGESIZE */

int
main ()
{
  char *data, *data2, *data3;
Torok Edwin's avatar
Torok Edwin committed
  const char *cdata2;
Reid Spencer's avatar
Reid Spencer committed
  int i, pagesize;
Torok Edwin's avatar
Torok Edwin committed
  int fd, fd2;
Reid Spencer's avatar
Reid Spencer committed

  pagesize = getpagesize ();

  /* First, make a file with some known garbage in it. */
  data = (char *) malloc (pagesize);
  if (!data)
Reid Spencer's avatar
Reid Spencer committed
  for (i = 0; i < pagesize; ++i)
    *(data + i) = rand ();
  umask (0);
  fd = creat ("conftest.mmap", 0600);
  if (fd < 0)
Torok Edwin's avatar
Torok Edwin committed
    return 2;
Reid Spencer's avatar
Reid Spencer committed
  if (write (fd, data, pagesize) != pagesize)
Torok Edwin's avatar
Torok Edwin committed
    return 3;
Reid Spencer's avatar
Reid Spencer committed
  close (fd);

Torok Edwin's avatar
Torok Edwin committed
  /* Next, check that the tail of a page is zero-filled.  File must have
     non-zero length, otherwise we risk SIGBUS for entire page.  */
  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
  if (fd2 < 0)
    return 4;
  cdata2 = "";
  if (write (fd2, cdata2, 1) != 1)
    return 5;
  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
  if (data2 == MAP_FAILED)
    return 6;
  for (i = 0; i < pagesize; ++i)
    if (*(data2 + i))
      return 7;
  close (fd2);
  if (munmap (data2, pagesize))
    return 8;

Reid Spencer's avatar
Reid Spencer committed
  /* Next, try to mmap the file at a fixed address which already has
     something else allocated at it.  If we can, also make sure that
     we see the same garbage.  */
  fd = open ("conftest.mmap", O_RDWR);
  if (fd < 0)
Torok Edwin's avatar
Torok Edwin committed
    return 9;
Reid Spencer's avatar
Reid Spencer committed
  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
Torok Edwin's avatar
Torok Edwin committed
    return 10;
Reid Spencer's avatar
Reid Spencer committed
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data2 + i))
Torok Edwin's avatar
Torok Edwin committed
      return 11;
Reid Spencer's avatar
Reid Spencer committed

  /* Finally, make sure that changes to the mapped area do not
     percolate back to the file as seen by read().  (This is a bug on
     some variants of i386 svr4.0.)  */
  for (i = 0; i < pagesize; ++i)
    *(data2 + i) = *(data2 + i) + 1;
  data3 = (char *) malloc (pagesize);
  if (!data3)
Torok Edwin's avatar
Torok Edwin committed
    return 12;
Reid Spencer's avatar
Reid Spencer committed
  if (read (fd, data3, pagesize) != pagesize)
Torok Edwin's avatar
Torok Edwin committed
    return 13;
Reid Spencer's avatar
Reid Spencer committed
  for (i = 0; i < pagesize; ++i)
    if (*(data + i) != *(data3 + i))
Torok Edwin's avatar
Torok Edwin committed
      return 14;
Reid Spencer's avatar
Reid Spencer committed
  close (fd);
Reid Spencer's avatar
Reid Spencer committed
}
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_run "$LINENO"; then :
Reid Spencer's avatar
Reid Spencer committed
  ac_cv_func_mmap_fixed_mapped=yes
else
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_func_mmap_fixed_mapped=no
Reid Spencer's avatar
Reid Spencer committed
fi
Torok Edwin's avatar
Torok Edwin committed
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed
fi
Reid Spencer's avatar
Reid Spencer committed
fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
Reid Spencer's avatar
Reid Spencer committed
if test $ac_cv_func_mmap_fixed_mapped = yes; then

Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_MMAP 1" >>confdefs.h
Reid Spencer's avatar
Reid Spencer committed

fi
Torok Edwin's avatar
Torok Edwin committed
rm -f conftest.mmap conftest.txt
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap of files" >&5
$as_echo_n "checking for mmap of files... " >&6; }
if test "${ac_cv_func_mmap_file+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
   ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

Torok Edwin's avatar
Torok Edwin committed
  if test "$cross_compiling" = yes; then :
Reid Spencer's avatar
Reid Spencer committed
  ac_cv_func_mmap_file=no
else
Torok Edwin's avatar
Torok Edwin committed
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed
/* end confdefs.h.  */

Reid Spencer's avatar
Reid Spencer committed
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>

int
main ()
{

  int fd;
  fd = creat ("foo",0777);
  fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
  unlink ("foo");
  return (fd != (int) MAP_FAILED);
  ;
  return 0;
}
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_run "$LINENO"; then :
Reid Spencer's avatar
Reid Spencer committed
  ac_cv_func_mmap_file=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_func_mmap_file=no
Torok Edwin's avatar
Torok Edwin committed
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed
  ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5
$as_echo "$ac_cv_func_mmap_file" >&6; }
Reid Spencer's avatar
Reid Spencer committed
if test "$ac_cv_func_mmap_file" = yes; then

Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_MMAP_FILE /**/" >>confdefs.h
Reid Spencer's avatar
Reid Spencer committed
   MMAP_FILE=yes

Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if /dev/zero is needed for mmap" >&5
$as_echo_n "checking if /dev/zero is needed for mmap... " >&6; }
if test "${ac_cv_need_dev_zero_for_mmap+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
  if test "$llvm_cv_os_type" = "Interix" ; then
Reid Spencer's avatar
Reid Spencer committed
   ac_cv_need_dev_zero_for_mmap=yes
 else
   ac_cv_need_dev_zero_for_mmap=no
 fi

fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_need_dev_zero_for_mmap" >&5
$as_echo "$ac_cv_need_dev_zero_for_mmap" >&6; }
Reid Spencer's avatar
Reid Spencer committed
if test "$ac_cv_need_dev_zero_for_mmap" = yes; then

Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define NEED_DEV_ZERO_FOR_MMAP 1" >>confdefs.h
Reid Spencer's avatar
Reid Spencer committed

fi
  if test "$ac_cv_func_mmap_fixed_mapped" = "no"
  then
Torok Edwin's avatar
Torok Edwin committed
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mmap() of a fixed address required but not supported" >&5
$as_echo "$as_me: WARNING: mmap() of a fixed address required but not supported" >&2;}
  fi
  if test "$ac_cv_func_mmap_file" = "no"
  then
Torok Edwin's avatar
Torok Edwin committed
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mmap() of files required but not found" >&5
$as_echo "$as_me: WARNING: mmap() of files required but not found" >&2;}
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC atomic builtins" >&5
$as_echo_n "checking for GCC atomic builtins... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
        volatile unsigned long val = 1;
        __sync_synchronize();
        __sync_val_compare_and_swap(&val, 1, 0);
        __sync_add_and_fetch(&val, 1);
        __sync_sub_and_fetch(&val, 1);
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define LLVM_MULTITHREADED 1" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define LLVM_MULTITHREADED 0" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LLVM will be built thread-unsafe because atomic builtins are missing" >&5
$as_echo "$as_me: WARNING: LLVM will be built thread-unsafe because atomic builtins are missing" >&2;}
fi
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext conftest.$ac_ext
Nick Lewycky's avatar
Nick Lewycky committed
if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 32-bit userspace on 64-bit system" >&5
$as_echo_n "checking for 32-bit userspace on 64-bit system... " >&6; }
if test "${llvm_cv_linux_mixed+set}" = set; then :
  $as_echo_n "(cached) " >&6
Nick Lewycky's avatar
Nick Lewycky committed
else
   ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

Torok Edwin's avatar
Torok Edwin committed
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Nick Lewycky's avatar
Nick Lewycky committed
/* end confdefs.h.  */
#ifndef __x86_64__
       error: Not x86-64 even if uname says so!
      #endif

int
main ()
{

  ;
  return 0;
}
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_compile "$LINENO"; then :
Nick Lewycky's avatar
Nick Lewycky committed
  llvm_cv_linux_mixed=no
else
Torok Edwin's avatar
Torok Edwin committed
  llvm_cv_linux_mixed=yes
Nick Lewycky's avatar
Nick Lewycky committed
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $llvm_cv_linux_mixed" >&5
$as_echo "$llvm_cv_linux_mixed" >&6; }
Nick Lewycky's avatar
Nick Lewycky committed

  if test "$llvm_cv_linux_mixed" = "yes"; then
    llvm_cv_target_arch="x86"
    ARCH="x86"
  fi
fi

for ac_func in __dso_handle
Torok Edwin's avatar
Torok Edwin committed
do :
  ac_fn_c_check_func "$LINENO" "__dso_handle" "ac_cv_func___dso_handle"
if test "x$ac_cv_func___dso_handle" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
Torok Edwin's avatar
Torok Edwin committed
#define HAVE___DSO_HANDLE 1
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether llvm-gcc is sane" >&5
$as_echo_n "checking whether llvm-gcc is sane... " >&6; }
if test "${llvm_cv_llvmgcc_sanity+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
  llvm_cv_llvmgcc_sanity="no"
Reid Spencer's avatar
Reid Spencer committed
if test -x "$LLVMGCC" ; then
Reid Spencer's avatar
Reid Spencer committed
  cp /dev/null conftest.c
Reid Spencer's avatar
Reid Spencer committed
  "$LLVMGCC" -emit-llvm -S -o - conftest.c | \
      grep 'target datalayout =' > /dev/null 2>&1
Reid Spencer's avatar
Reid Spencer committed
  if test $? -eq 0 ; then
    llvm_cv_llvmgcc_sanity="yes"
  fi
  rm conftest.c
fi
fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $llvm_cv_llvmgcc_sanity" >&5
$as_echo "$llvm_cv_llvmgcc_sanity" >&6; }
Reid Spencer's avatar
Reid Spencer committed
if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking llvm-gcc component support" >&5
$as_echo_n "checking llvm-gcc component support... " >&6; }
Reid Spencer's avatar
Reid Spencer committed
  llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1`
Reid Spencer's avatar
Reid Spencer committed
  LLVMCC1=$llvmcc1path

Reid Spencer's avatar
Reid Spencer committed
  llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus`
Reid Spencer's avatar
Reid Spencer committed
  LLVMCC1PLUS=$llvmcc1pluspath
Reid Spencer's avatar
Reid Spencer committed
  llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'`
  LLVMGCCDIR=$llvmgccdir

  llvmgcclibexec=`echo "$llvmcc1path" | sed 's,/cc1,,'`
  LLVMGCCLIBEXEC=$llvmgcclibexec

  llvmgccversion=`"$LLVMGCC" -dumpversion 2>&1 | sed 's/^\([0-9.]*\).*/\1/'`
  llvmgccmajvers=`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`
  LLVMGCC_VERSION=$llvmgccversion

  LLVMGCC_MAJVERS=$llvmgccmajvers

  llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
# Translate the various configuration directories and other basic
Reid Spencer's avatar
Reid Spencer committed
# information into substitutions that will end up in Makefile.config.in
# that these configured values can be used by the makefiles
if test "${prefix}" = "NONE" ; then
eval LLVM_PREFIX="${prefix}";
eval LLVM_BINDIR="${prefix}/bin";
eval LLVM_LIBDIR="${prefix}/lib";
eval LLVM_DATADIR="${prefix}/share/llvm";
eval LLVM_DOCSDIR="${prefix}/docs/llvm";
eval LLVM_ETCDIR="${prefix}/etc/llvm";
eval LLVM_INCLUDEDIR="${prefix}/include";
eval LLVM_INFODIR="${prefix}/info";
eval LLVM_MANDIR="${prefix}/man";
LLVM_CONFIGTIME=`date`











Reid Spencer's avatar
Reid Spencer committed
# Place the various directores into the config.h file as #defines so that we
# can know about the installation paths within LLVM.

cat >>confdefs.h <<_ACEOF
#define LLVM_PREFIX "$LLVM_PREFIX"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_BINDIR "$LLVM_BINDIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_LIBDIR "$LLVM_LIBDIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_DATADIR "$LLVM_DATADIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
Gordon Henriksen's avatar
Gordon Henriksen committed
#define LLVM_DOCSDIR "$LLVM_DOCSDIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_INCLUDEDIR "$LLVM_INCLUDEDIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_INFODIR "$LLVM_INFODIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_MANDIR "$LLVM_MANDIR"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_CONFIGTIME "$LLVM_CONFIGTIME"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define LLVM_HOSTTRIPLE "$host"
_ACEOF


Gordon Henriksen's avatar
Gordon Henriksen committed
# Determine which bindings to build.
if test "$BINDINGS_TO_BUILD" = auto ; then
  BINDINGS_TO_BUILD=""
  if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then
    BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD"
  fi
fi
BINDINGS_TO_BUILD=$BINDINGS_TO_BUILD


# This isn't really configurey, but it avoids having to repeat the list in
# other files.
ALL_BINDINGS=ocaml


Gordon Henriksen's avatar
Gordon Henriksen committed
# Do any work necessary to ensure that bindings have what they need.
binding_prereqs_failed=0
for a_binding in $BINDINGS_TO_BUILD ; do
  case "$a_binding" in
  ocaml)
    if test "x$OCAMLC" = x ; then
Torok Edwin's avatar
Torok Edwin committed
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&5
$as_echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&2;}
Gordon Henriksen's avatar
Gordon Henriksen committed
      binding_prereqs_failed=1
    fi
    if test "x$OCAMLDEP" = x ; then
Torok Edwin's avatar
Torok Edwin committed
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&5
$as_echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&2;}
Gordon Henriksen's avatar
Gordon Henriksen committed
      binding_prereqs_failed=1
    fi
    if test "x$OCAMLOPT" = x ; then
Torok Edwin's avatar
Torok Edwin committed
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&5
$as_echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&2;}
Gordon Henriksen's avatar
Gordon Henriksen committed
          fi
    if test "x$with_ocaml_libdir" != xauto ; then
      OCAML_LIBDIR=$with_ocaml_libdir

    else
      ocaml_stdlib="`"$OCAMLC" -where`"
      if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~"
      then
        # ocaml stdlib is beneath our prefix; use stdlib
        OCAML_LIBDIR=$ocaml_stdlib

      else
        # ocaml stdlib is outside our prefix; use libdir/ocaml
        OCAML_LIBDIR=$LLVM_LIBDIR/ocaml

      fi
    fi
    ;;
  esac
done
if test "$binding_prereqs_failed" = 1 ; then
Torok Edwin's avatar
Torok Edwin committed
  as_fn_error "Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." "$LINENO" 5
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler -fvisibility-inlines-hidden option" >&5
$as_echo_n "checking for compiler -fvisibility-inlines-hidden option... " >&6; }
if test "${llvm_cv_cxx_visibility_inlines_hidden+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
   ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

  oldcxxflags="$CXXFLAGS"
  CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
Torok Edwin's avatar
Torok Edwin committed
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_cxx_try_compile "$LINENO"; then :
  llvm_cv_cxx_visibility_inlines_hidden=yes
else
Torok Edwin's avatar
Torok Edwin committed
  llvm_cv_cxx_visibility_inlines_hidden=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  CXXFLAGS="$oldcxxflags"
  ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $llvm_cv_cxx_visibility_inlines_hidden" >&5
$as_echo "$llvm_cv_cxx_visibility_inlines_hidden" >&6; }
if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then
  ENABLE_VISIBILITY_INLINES_HIDDEN=1

else
  ENABLE_VISIBILITY_INLINES_HIDDEN=0

fi

Gordon Henriksen's avatar
Gordon Henriksen committed

Nick Lewycky's avatar
Nick Lewycky committed
if test "$llvm_cv_link_use_r" = "yes" ; then
  RPATH="-Wl,-R"
else
  RPATH="-Wl,-rpath"
fi


if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then
  RDYNAMIC="-Wl,-export-dynamic"
else
  RDYNAMIC=""
fi
Reid Spencer's avatar
Reid Spencer committed

ac_config_headers="$ac_config_headers include/llvm/Config/config.h"
Reid Spencer's avatar
Reid Spencer committed

ac_config_files="$ac_config_files include/llvm/Config/Targets.def"

ac_config_files="$ac_config_files include/llvm/Config/AsmPrinters.def"

ac_config_files="$ac_config_files include/llvm/Config/AsmParsers.def"

Daniel Dunbar's avatar
Daniel Dunbar committed
ac_config_files="$ac_config_files include/llvm/Config/Disassemblers.def"

ac_config_headers="$ac_config_headers include/llvm/System/DataTypes.h"
ac_config_files="$ac_config_files Makefile.config"
ac_config_files="$ac_config_files llvm.spec"


ac_config_files="$ac_config_files docs/doxygen.cfg"
ac_config_files="$ac_config_files tools/llvmc/plugins/Base/Base.td"


ac_config_files="$ac_config_files tools/llvm-config/llvm-config.in"
ac_config_commands="$ac_config_commands setup"
ac_config_commands="$ac_config_commands Makefile"
ac_config_commands="$ac_config_commands Makefile.common"
ac_config_commands="$ac_config_commands examples/Makefile"
ac_config_commands="$ac_config_commands lib/Makefile"
ac_config_commands="$ac_config_commands runtime/Makefile"


ac_config_commands="$ac_config_commands test/Makefile"
ac_config_commands="$ac_config_commands test/Makefile.tests"
Bill Wendling's avatar
Bill Wendling committed
ac_config_commands="$ac_config_commands unittests/Makefile"


ac_config_commands="$ac_config_commands tools/Makefile"
ac_config_commands="$ac_config_commands utils/Makefile"
ac_config_commands="$ac_config_commands projects/Makefile"
Gordon Henriksen's avatar
Gordon Henriksen committed
ac_config_commands="$ac_config_commands bindings/Makefile"


ac_config_commands="$ac_config_commands bindings/ocaml/Makefile.ocaml"


Reid Spencer's avatar
Reid Spencer committed

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
Torok Edwin's avatar
Torok Edwin committed
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
Torok Edwin's avatar
Torok Edwin committed
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
Torok Edwin's avatar
Torok Edwin committed
      # `set' does not quote correctly, so add quotes: double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \.
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     :end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  if test -w "$cache_file"; then
    test "x$cache_file" != "x/dev/null" &&
Torok Edwin's avatar
Torok Edwin committed
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
Torok Edwin's avatar
Torok Edwin committed
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

DEFS=-DHAVE_CONFIG_H

ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
Torok Edwin's avatar
Torok Edwin committed
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
  #    will be set to the directory where LIBOBJS objects are built.
Torok Edwin's avatar
Torok Edwin committed
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then
Torok Edwin's avatar
Torok Edwin committed
  as_fn_error "conditional \"INSTALL_LTDL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then
Torok Edwin's avatar
Torok Edwin committed
  as_fn_error "conditional \"CONVENIENCE_LTDL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Torok Edwin's avatar
Torok Edwin committed
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false
Torok Edwin's avatar
Torok Edwin committed
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
Torok Edwin's avatar
Torok Edwin committed
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
Torok Edwin's avatar
Torok Edwin committed
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
Torok Edwin's avatar
Torok Edwin committed
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
Torok Edwin's avatar
Torok Edwin committed
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
Torok Edwin's avatar
Torok Edwin committed
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
Torok Edwin's avatar
Torok Edwin committed
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
Torok Edwin's avatar
Torok Edwin committed
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
Torok Edwin's avatar
Torok Edwin committed
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
Torok Edwin's avatar
Torok Edwin committed
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
Torok Edwin's avatar
Torok Edwin committed
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH