diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-09-02 16:01:04 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-04 01:34:20 -0700 |
commit | 85e78ab11f39ce1b52b980d6e1c46c68789d2fe4 (patch) | |
tree | 2e705d5139b360089dfa09dc4db15045e36dab9f /configure | |
parent | f998978e2a08b55fbe9a6701bacc5f67d3c63a87 (diff) | |
download | spike-85e78ab11f39ce1b52b980d6e1c46c68789d2fe4.zip spike-85e78ab11f39ce1b52b980d6e1c46c68789d2fe4.tar.gz spike-85e78ab11f39ce1b52b980d6e1c46c68789d2fe4.tar.bz2 |
Fix OSX build
Closes #326
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 76 |
1 files changed, 75 insertions, 1 deletions
@@ -2204,6 +2204,46 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the linker or gives an error. +# (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_LINK_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + + + #------------------------------------------------------------------------- # Checks for programs #------------------------------------------------------------------------- @@ -4366,7 +4406,41 @@ CFLAGS="-Wall -Wno-unused -g -O2" CXXFLAGS="-Wall -Wno-unused -g -O2 -std=c++11" -LDFLAGS="-Wl,--export-dynamic" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--export-dynamic" >&5 +$as_echo_n "checking whether the linker accepts -Wl,--export-dynamic... " >&6; } +if ${ax_cv_check_ldflags___Wl___export_dynamic+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ax_cv_check_ldflags___Wl___export_dynamic=yes +else + ax_cv_check_ldflags___Wl___export_dynamic=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___export_dynamic" >&5 +$as_echo "$ax_cv_check_ldflags___Wl___export_dynamic" >&6; } +if test "x$ax_cv_check_ldflags___Wl___export_dynamic" = xyes; then : + LDFLAGS="-Wl,--export-dynamic" +else + : +fi #------------------------------------------------------------------------- |