llvm.org GIT mirror llvm / ee0f32d
configure: Add detection of the linker version string. - Review appreciated, as long as you understand that I understand that this is a horrible hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110883 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
4 changed file(s) with 53 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
10401040 AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
10411041 AC_PATH_PROGS(GAS, [gas as])
10421042
1043 dnl Get the version of the linker in use.
1044 AC_LINK_GET_VERSION
1045
10431046 dnl Determine whether the linker supports the -R option.
10441047 AC_LINK_USE_R
10451048
0 #
1 # Get the linker version string.
2 #
3 # This macro is specific to LLVM.
4 #
5 AC_DEFUN([AC_LINK_GET_VERSION],
6 [AC_CACHE_CHECK([for linker version],[llvm_cv_link_version],
7 [
8 version_string="$(ld -v 2>&1 | head -1)"
9
10 # Check for ld64.
11 if (echo "$version_string" | grep -q "ld64"); then
12 llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#")
13 else
14 llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#")
15 fi
16 ])
17 AC_DEFINE_UNQUOTED([HOST_LINK_VERSION],"$llvm_cv_link_version",
18 [Linker version detected at compile time.])
19 ])
20
21 #
122 # Determine if the system can handle the -R option being passed to the linker.
223 #
87288728 done
87298729
87308730
8731 { echo "$as_me:$LINENO: checking for linker version" >&5
8732 echo $ECHO_N "checking for linker version... $ECHO_C" >&6; }
8733 if test "${llvm_cv_link_version+set}" = set; then
8734 echo $ECHO_N "(cached) $ECHO_C" >&6
8735 else
8736
8737 version_string="$(ld -v 2>&1 | head -1)"
8738
8739 # Check for ld64.
8740 if (echo "$version_string" | grep -q "ld64"); then
8741 llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#")
8742 else
8743 llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#")
8744 fi
8745
8746 fi
8747 { echo "$as_me:$LINENO: result: $llvm_cv_link_version" >&5
8748 echo "${ECHO_T}$llvm_cv_link_version" >&6; }
8749
8750 cat >>confdefs.h <<_ACEOF
8751 #define HOST_LINK_VERSION "$llvm_cv_link_version"
8752 _ACEOF
8753
8754
8755
87318756 { echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5
87328757 echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6; }
87338758 if test "${llvm_cv_link_use_r+set}" = set; then
1139411419 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1139511420 lt_status=$lt_dlunknown
1139611421 cat > conftest.$ac_ext <
11397 #line 11398 "configure"
11422 #line 11423 "configure"
1139811423 #include "confdefs.h"
1139911424
1140011425 #if HAVE_DLFCN_H
466466 /* Define to 1 if you have the `__dso_handle' function. */
467467 #undef HAVE___DSO_HANDLE
468468
469 /* Linker version detected at compile time. */
470 #undef HOST_LINK_VERSION
471
469472 /* Installation directory for binary executables */
470473 #undef LLVM_BINDIR
471474