Skip to content
configure 392 KiB
Newer Older
Nick Lewycky's avatar
Nick Lewycky committed

Torok Edwin's avatar
Torok Edwin committed
if test "$GXX" != "yes" && test "$IXX" != "yes"
then
  as_fn_error "g++|icc required but not found" "$LINENO" 5
Nick Lewycky's avatar
Nick Lewycky committed
fi
Torok Edwin's avatar
Torok Edwin committed

if test "$GCC" = "yes"
then
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#if !defined(__GNUC__) || __GNUC__ < 3
#error Unsupported GCC version
#endif

Nick Lewycky's avatar
Nick Lewycky committed
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_compile "$LINENO"; then :
Nick Lewycky's avatar
Nick Lewycky committed

Torok Edwin's avatar
Torok Edwin committed
else
  as_fn_error "gcc 3.x required, but you have a lower version" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
Nick Lewycky's avatar
Nick Lewycky committed
fi

Torok Edwin's avatar
Torok Edwin committed
if test -z "$llvm_cv_gnu_make_command"
then
  as_fn_error "GNU Make required but not found" "$LINENO" 5
Nick Lewycky's avatar
Nick Lewycky committed
fi
Nick Lewycky's avatar
Nick Lewycky committed

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

Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking optional compiler flags" >&5
$as_echo_n "checking optional compiler flags... " >&6; }
NO_VARIADIC_MACROS=`$CXX -Wno-variadic-macros -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-variadic-macros`
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
NO_MISSING_FIELD_INITIALIZERS=`$CXX -Wno-missing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers`
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&5
$as_echo "$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&6; }
Torok Edwin's avatar
Torok Edwin committed

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
$as_echo_n "checking for sin in -lm... " >&6; }
if test "${ac_cv_lib_m_sin+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lm  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
Torok Edwin's avatar
Torok Edwin committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char sin ();
Torok Edwin's avatar
Torok Edwin committed
return sin ();
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_m_sin=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_lib_m_sin=no
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
$as_echo "$ac_cv_lib_m_sin" >&6; }
if test "x$ac_cv_lib_m_sin" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
  LIBS="-lm $LIBS"
Torok Edwin's avatar
Torok Edwin committed
if test "$llvm_cv_os_type" = "MingW" ; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -limagehlp" >&5
$as_echo_n "checking for main in -limagehlp... " >&6; }
if test "${ac_cv_lib_imagehlp_main+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_check_lib_save_LIBS=$LIBS
LIBS="-limagehlp  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed
return main ();
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_imagehlp_main=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_lib_imagehlp_main=no
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_imagehlp_main" >&5
$as_echo "$ac_cv_lib_imagehlp_main" >&6; }
if test "x$ac_cv_lib_imagehlp_main" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBIMAGEHLP 1
Torok Edwin's avatar
Torok Edwin committed
  LIBS="-limagehlp $LIBS"

Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5
$as_echo_n "checking for main in -lpsapi... " >&6; }
if test "${ac_cv_lib_psapi_main+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpsapi  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed
return main ();
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_psapi_main=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_lib_psapi_main=no
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_psapi_main" >&5
$as_echo "$ac_cv_lib_psapi_main" >&6; }
if test "x$ac_cv_lib_psapi_main" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPSAPI 1
Torok Edwin's avatar
Torok Edwin committed
  LIBS="-lpsapi $LIBS"

fi

Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
$as_echo_n "checking for library containing dlopen... " >&6; }
if test "${ac_cv_search_dlopen+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed
/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
Torok Edwin's avatar
Torok Edwin committed
return dlopen ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' dl; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_dlopen=$ac_res
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_dlopen+set}" = set; then :
  break
fi
done
if test "${ac_cv_search_dlopen+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_dlopen=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
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_search_dlopen" >&5
$as_echo "$ac_cv_search_dlopen" >&6; }
ac_res=$ac_cv_search_dlopen
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dlopen() not found - disabling plugin support" >&5
$as_echo "$as_me: WARNING: dlopen() not found - disabling plugin support" >&2;}
fi
Torok Edwin's avatar
Torok Edwin committed
if test "$llvm_cv_enable_libffi" = "yes" ; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ffi_call" >&5
$as_echo_n "checking for library containing ffi_call... " >&6; }
if test "${ac_cv_search_ffi_call+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
Torok Edwin's avatar
Torok Edwin committed
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char ffi_call ();
Torok Edwin's avatar
Torok Edwin committed
return ffi_call ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' ffi; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_ffi_call=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_ffi_call+set}" = set; then :
  break
Torok Edwin's avatar
Torok Edwin committed
done
if test "${ac_cv_search_ffi_call+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_ffi_call=no
Reid Spencer's avatar
Reid Spencer committed
fi
Torok Edwin's avatar
Torok Edwin committed
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ffi_call" >&5
$as_echo "$ac_cv_search_ffi_call" >&6; }
ac_res=$ac_cv_search_ffi_call
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Reid Spencer's avatar
Reid Spencer committed

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

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libffi not found - disabling external calls from interpreter" >&5
$as_echo "$as_me: WARNING: libffi not found - disabling external calls from interpreter" >&2;}
fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mallinfo" >&5
$as_echo_n "checking for library containing mallinfo... " >&6; }
if test "${ac_cv_search_mallinfo+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char mallinfo ();
Torok Edwin's avatar
Torok Edwin committed
return mallinfo ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' malloc; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_mallinfo=$ac_res
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_mallinfo+set}" = set; then :
  break
Torok Edwin's avatar
Torok Edwin committed
done
if test "${ac_cv_search_mallinfo+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_mallinfo=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mallinfo" >&5
$as_echo "$ac_cv_search_mallinfo" >&6; }
ac_res=$ac_cv_search_mallinfo
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_MALLINFO 1" >>confdefs.h
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed

if test "$ENABLE_THREADS" -eq 1 ; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; }
if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then :
  $as_echo_n "(cached) " >&6
Torok Edwin's avatar
Torok Edwin committed
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pthread_mutex_init ();
Torok Edwin's avatar
Torok Edwin committed
return pthread_mutex_init ();
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_pthread_pthread_mutex_init=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_lib_pthread_pthread_mutex_init=no
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Brian Gaeke's avatar
Brian Gaeke committed
fi
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
if test "x$ac_cv_lib_pthread_pthread_mutex_init" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPTHREAD 1
Torok Edwin's avatar
Torok Edwin committed
  LIBS="-lpthread $LIBS"

fi
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_lock" >&5
$as_echo_n "checking for library containing pthread_mutex_lock... " >&6; }
if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then :
  $as_echo_n "(cached) " >&6
Reid Spencer's avatar
Reid Spencer committed
else
Torok Edwin's avatar
Torok Edwin committed
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Torok Edwin's avatar
Torok Edwin committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pthread_mutex_lock ();
Torok Edwin's avatar
Torok Edwin committed
return pthread_mutex_lock ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' pthread; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_pthread_mutex_lock=$ac_res
Reid Spencer's avatar
Reid Spencer committed
fi
Torok Edwin's avatar
Torok Edwin committed
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then :
  break
Reid Spencer's avatar
Reid Spencer committed
fi
Torok Edwin's avatar
Torok Edwin committed
done
if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then :
Reid Spencer's avatar
Reid Spencer committed

else
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_search_pthread_mutex_lock=no
Torok Edwin's avatar
Torok Edwin committed
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_lock" >&5
$as_echo "$ac_cv_search_pthread_mutex_lock" >&6; }
ac_res=$ac_cv_search_pthread_mutex_lock
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_PTHREAD_MUTEX_LOCK 1" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_rwlock_init" >&5
$as_echo_n "checking for library containing pthread_rwlock_init... " >&6; }
if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char pthread_rwlock_init ();
Torok Edwin's avatar
Torok Edwin committed
return pthread_rwlock_init ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' pthread; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_pthread_rwlock_init=$ac_res
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext
  if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then :
  break
Torok Edwin's avatar
Torok Edwin committed
if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_pthread_rwlock_init=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_rwlock_init" >&5
$as_echo "$ac_cv_search_pthread_rwlock_init" >&6; }
ac_res=$ac_cv_search_pthread_rwlock_init
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
$as_echo "#define HAVE_PTHREAD_RWLOCK_INIT 1" >>confdefs.h
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_getspecific" >&5
$as_echo_n "checking for library containing pthread_getspecific... " >&6; }
if test "${ac_cv_search_pthread_getspecific+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Reid Spencer's avatar
Reid Spencer committed
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
Reid Spencer's avatar
Reid Spencer committed
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char pthread_getspecific ();
Reid Spencer's avatar
Reid Spencer committed
int
main ()
{
Torok Edwin's avatar
Torok Edwin committed
return pthread_getspecific ();
Reid Spencer's avatar
Reid Spencer committed
  ;
  return 0;
}
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' pthread; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_pthread_getspecific=$ac_res
Reid Spencer's avatar
Reid Spencer committed
fi
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext
  if test "${ac_cv_search_pthread_getspecific+set}" = set; then :
  break
Reid Spencer's avatar
Reid Spencer committed
fi
done
Torok Edwin's avatar
Torok Edwin committed
if test "${ac_cv_search_pthread_getspecific+set}" = set; then :
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_pthread_getspecific=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_getspecific" >&5
$as_echo "$ac_cv_search_pthread_getspecific" >&6; }
ac_res=$ac_cv_search_pthread_getspecific
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Reid Spencer's avatar
Reid Spencer committed

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

Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
fi
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-udis86 was given.
if test "${with_udis86+set}" = set; then :
  withval=$with_udis86;
      USE_UDIS86=1
Torok Edwin's avatar
Torok Edwin committed
      case "$withval" in
        /usr/lib|yes) ;;
        *) LDFLAGS="$LDFLAGS -L${withval}" ;;
      esac
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ud_init in -ludis86" >&5
$as_echo_n "checking for ud_init in -ludis86... " >&6; }
if test "${ac_cv_lib_udis86_ud_init+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ludis86  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char ud_init ();
Torok Edwin's avatar
Torok Edwin committed
return ud_init ();
Torok Edwin's avatar
Torok Edwin committed
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_udis86_ud_init=yes
Torok Edwin's avatar
Torok Edwin committed
  ac_cv_lib_udis86_ud_init=no
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udis86_ud_init" >&5
$as_echo "$ac_cv_lib_udis86_ud_init" >&6; }
if test "x$ac_cv_lib_udis86_ud_init" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
Torok Edwin's avatar
Torok Edwin committed
#define HAVE_LIBUDIS86 1
Torok Edwin's avatar
Torok Edwin committed
  LIBS="-ludis86 $LIBS"

else

        echo "Error! You need to have libudis86 around."
        exit -1

Torok Edwin's avatar
Torok Edwin committed
else
  USE_UDIS86=0
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed

cat >>confdefs.h <<_ACEOF
#define USE_UDIS86 $USE_UDIS86
Brian Gaeke's avatar
Brian Gaeke committed
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
# Check whether --with-oprofile was given.
if test "${with_oprofile+set}" = set; then :
  withval=$with_oprofile;
      USE_OPROFILE=1

      case "$withval" in
        /usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;;
        no) llvm_cv_oppath=
            USE_OPROFILE=0
 ;;
        *) llvm_cv_oppath="${withval}/lib/oprofile"
           CPPFLAGS="-I${withval}/include";;
      esac
      if test -n "$llvm_cv_oppath" ; then
        LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}"
                                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bfd_init" >&5
$as_echo_n "checking for library containing bfd_init... " >&6; }
if test "${ac_cv_search_bfd_init+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
Reid Spencer's avatar
Reid Spencer committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
Reid Spencer's avatar
Reid Spencer committed
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char bfd_init ();
Brian Gaeke's avatar
Brian Gaeke committed
int
main ()
{
Torok Edwin's avatar
Torok Edwin committed
return bfd_init ();
Brian Gaeke's avatar
Brian Gaeke committed
  ;
  return 0;
}
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' bfd; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_bfd_init=$ac_res
Brian Gaeke's avatar
Brian Gaeke committed
fi
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext
  if test "${ac_cv_search_bfd_init+set}" = set; then :
  break
Reid Spencer's avatar
Reid Spencer committed
fi
done
Torok Edwin's avatar
Torok Edwin committed
if test "${ac_cv_search_bfd_init+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_bfd_init=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bfd_init" >&5
$as_echo "$ac_cv_search_bfd_init" >&6; }
ac_res=$ac_cv_search_bfd_init
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing op_open_agent" >&5
$as_echo_n "checking for library containing op_open_agent... " >&6; }
if test "${ac_cv_search_op_open_agent+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char op_open_agent ();
Torok Edwin's avatar
Torok Edwin committed
return op_open_agent ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' opagent; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_op_open_agent=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_op_open_agent+set}" = set; then :
  break
fi
done
if test "${ac_cv_search_op_open_agent+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_op_open_agent=no
Torok Edwin's avatar
Torok Edwin committed
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_op_open_agent" >&5
$as_echo "$ac_cv_search_op_open_agent" >&6; }
ac_res=$ac_cv_search_op_open_agent
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

else

          echo "Error! You need to have libopagent around."
          exit -1
Torok Edwin's avatar
Torok Edwin committed

        ac_fn_c_check_header_mongrel "$LINENO" "opagent.h" "ac_cv_header_opagent_h" "$ac_includes_default"
if test "x$ac_cv_header_opagent_h" = x""yes; then :

else

          echo "Error! You need to have opagent.h around."
          exit -1
Torok Edwin's avatar
Torok Edwin committed
      fi
Reid Spencer's avatar
Reid Spencer committed

Torok Edwin's avatar
Torok Edwin committed
else
Torok Edwin's avatar
Torok Edwin committed
      USE_OPROFILE=0
Torok Edwin's avatar
Torok Edwin committed

fi


cat >>confdefs.h <<_ACEOF
#define USE_OPROFILE $USE_OPROFILE
Torok Edwin's avatar
Torok Edwin committed
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
#include <$ac_hdr>

int
main ()
{
if ((DIR *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$as_ac_Header=yes"
else
  eval "$as_ac_Header=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$as_ac_Header
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval as_val=\$$as_ac_Header
   if test "x$as_val" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
_ACEOF

ac_header_dirent=$ac_hdr; break
fi

done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
$as_echo_n "checking for library containing opendir... " >&6; }
if test "${ac_cv_search_opendir+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
Reid Spencer's avatar
Reid Spencer committed

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
Reid Spencer's avatar
Reid Spencer committed
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char opendir ();
Reid Spencer's avatar
Reid Spencer committed
int
main ()
{
Torok Edwin's avatar
Torok Edwin committed
return opendir ();
Reid Spencer's avatar
Reid Spencer committed
  ;
  return 0;
}
_ACEOF
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' dir; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_opendir=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
Torok Edwin's avatar
Torok Edwin committed
    conftest$ac_exeext
  if test "${ac_cv_search_opendir+set}" = set; then :
  break
Torok Edwin's avatar
Torok Edwin committed
if test "${ac_cv_search_opendir+set}" = set; then :
Torok Edwin's avatar
Torok Edwin committed
else
  ac_cv_search_opendir=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
$as_echo "$ac_cv_search_opendir" >&6; }
ac_res=$ac_cv_search_opendir
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
fi
Torok Edwin's avatar
Torok Edwin committed
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
$as_echo_n "checking for library containing opendir... " >&6; }
if test "${ac_cv_search_opendir+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
Torok Edwin's avatar
Torok Edwin committed
char opendir ();
Torok Edwin's avatar
Torok Edwin committed
return opendir ();
Torok Edwin's avatar
Torok Edwin committed
for ac_lib in '' x; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_opendir=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if test "${ac_cv_search_opendir+set}" = set; then :
  break
fi
done
if test "${ac_cv_search_opendir+set}" = set; then :

Torok Edwin's avatar
Torok Edwin committed
  ac_cv_search_opendir=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
$as_echo "$ac_cv_search_opendir" >&6; }
ac_res=$ac_cv_search_opendir
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
Torok Edwin's avatar
Torok Edwin committed
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS vs. MAP_ANON" >&5
$as_echo_n "checking for MAP_ANONYMOUS vs. MAP_ANON... " >&6; }
if test "${ac_cv_header_mmap_anon+set}" = set; then :
  $as_echo_n "(cached) " >&6
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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
int
main ()
{
mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_header_mmap_anon=yes
else
  ac_cv_header_mmap_anon=no
Torok Edwin's avatar
Torok Edwin committed
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