Skip to content

Commit

Permalink
Use $cc_basename in configure for detection
Browse files Browse the repository at this point in the history
libtool's initialisation provide $cc_basename which allows better
handling when CC is a path rather than just the name of the C compiler.
  • Loading branch information
dra27 committed Oct 5, 2021
1 parent f4d6410 commit f1be534
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ Working version
- #10659: Fix freshening substitutions on imported modules
(Leo White and Stephen Dolan, review by Matthew Ryan)

- #10679: Fix detection of CC as gcc in configure (allow for triplet-prefixed
GCC).
(David Allsopp, review by Gabriel Scherer)
- #10677, #10679: Fix detection of CC as gcc in configure (allow for
triplet-prefixed GCC) and fix all C compiler detection when CC is a path
rather than a basename.
(David Allsopp, report by Fabian @copy, review by Gabriel Scherer)

OCaml 4.13 maintenance branch
-----------------------------
Expand Down
12 changes: 6 additions & 6 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ AS_CASE([$flexdir,$supports_shared_libraries,$flexlink,$host],
[,*,,*-w64-mingw32|,*,,*-pc-windows],
[AC_MSG_ERROR([flexlink is required for native Win32])])

AS_CASE([$CC,$host],
AS_CASE([$cc_basename,$host],
[*,*-*-darwin*],
[mkexe="$mkexe -Wl,-no_compact_unwind";
AC_DEFINE([HAS_ARCH_CODE32], [1])],
Expand Down Expand Up @@ -963,7 +963,7 @@ AS_IF([test x"$enable_shared" != "xno"],
[[*-*-linux*|*-*-freebsd[3-9]*|*-*-freebsd[1-9][0-9]*\
|*-*-openbsd*|*-*-netbsd*|*-*-dragonfly*|*-*-gnu*|*-*-haiku*]],
[sharedlib_cflags="-fPIC"
AS_CASE([$CC,$host],
AS_CASE([$cc_basename,$host],
[*gcc*,powerpc-*-linux*],
[mksharedlib="$CC -shared -mbss-plt \$(LDFLAGS)"],
[mksharedlib="$CC -shared \$(LDFLAGS)"])
Expand Down Expand Up @@ -1012,7 +1012,7 @@ AS_IF([test x"$supports_shared_libraries" = 'xtrue'],
[riscv*-*-linux*], [natdynlink=true])])

# Try to work around the Skylake/Kaby Lake processor bug.
AS_CASE(["$CC,$host"],
AS_CASE(["$cc_basename,$host"],
[*gcc*,x86_64-*|*gcc*,i686-*],
[OCAML_CC_HAS_FNO_TREE_VRP
AS_IF([$cc_has_fno_tree_vrp],
Expand Down Expand Up @@ -1132,7 +1132,7 @@ AC_DEFINE_UNQUOTED([OCAML_OS_TYPE], ["$ostype"])

AC_CHECK_TOOL([DIRECT_LD],[ld])
AS_IF([test -z "$PARTIALLD"],
[AS_CASE(["$arch,$CC,$system,$model"],
[AS_CASE(["$arch,$cc_basename,$system,$model"],
[amd64,*gcc*,macosx,*], [PACKLD_FLAGS=' -arch x86_64'],
[power,*gcc*,elf,ppc], [PACKLD_FLAGS=' -m elf32ppclinux'],
[power,*gcc*,elf,ppc64], [PACKLD_FLAGS=' -m elf64ppc'],
Expand All @@ -1142,7 +1142,7 @@ AS_IF([test -z "$PARTIALLD"],
# output filename. Don't assume that all C compilers understand GNU -ofoo
# form, so ensure that the definition includes a space at the end (which is
# achieved using the $(EMPTY) expansion trick).
AS_IF([test x"$CC" = "xcl"],
AS_IF([test x"$cc_basename" = "xcl"],
# For the Microsoft C compiler there must be no space at the end of the
# string.
[PACKLD="link -lib -nologo $machine -out:"],
Expand Down Expand Up @@ -1806,7 +1806,7 @@ AS_IF([$native_compiler],
## Frame pointers

AS_IF([test x"$enable_frame_pointers" = "xyes"],
[AS_CASE(["$host,$CC"],
[AS_CASE(["$host,$cc_basename"],
[x86_64-*-linux*,gcc*|x86_64-*-linux*,clang*],
[common_cflags="$common_cflags -g -fno-omit-frame-pointer"
frame_pointers=true
Expand Down

0 comments on commit f1be534

Please sign in to comment.