1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.

This does the previous commit with CMake.

AC_EGREP_CPP uses AC_REQUIRE so the outermost if-commands must
be changed to AS_IF to ensure that things wont break some day.
See 5a5bd7f871.
This commit is contained in:
Lasse Collin 2024-03-15 17:15:50 +02:00
parent c273123ed0
commit 49324b711f

View file

@ -709,13 +709,13 @@ fi
# --with-pic and --without-pic though. As long as neither --with-pic nor # --with-pic and --without-pic though. As long as neither --with-pic nor
# --without-pic is used then we can use #ifdef PIC to detect if the file is # --without-pic is used then we can use #ifdef PIC to detect if the file is
# being built for a shared library. # being built for a shared library.
if test "x$enable_symbol_versions" = xno ; then AS_IF([test "x$enable_symbol_versions" = xno], [
enable_symbol_versions=no enable_symbol_versions=no
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
elif test "x$enable_shared" = xno ; then ], [test "x$enable_shared" = xno], [
enable_symbol_versions=no enable_symbol_versions=no
AC_MSG_RESULT([no (not building a shared library)]) AC_MSG_RESULT([no (not building a shared library)])
else ], [
# "yes" means that symbol version are to be used but we need to # "yes" means that symbol version are to be used but we need to
# autodetect which variant to use. # autodetect which variant to use.
if test "x$enable_symbol_versions" = xyes ; then if test "x$enable_symbol_versions" = xyes ; then
@ -730,7 +730,15 @@ else
enable_symbol_versions=generic enable_symbol_versions=generic
;; ;;
*-linux*) *-linux*)
enable_symbol_versions=linux # NVIDIA HPC Compiler doesn't support symbol
# versioning but the linker script can still
# be used.
AC_EGREP_CPP([use_generic_symbol_versioning],
[#ifdef __NVCOMPILER
use_generic_symbol_versioning
#endif],
[enable_symbol_versions=generic],
[enable_symbol_versions=linux])
;; ;;
*) *)
enable_symbol_versions=generic enable_symbol_versions=generic
@ -774,7 +782,7 @@ else
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions']) AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
fi fi
AC_MSG_RESULT([yes ($enable_symbol_versions)]) AC_MSG_RESULT([yes ($enable_symbol_versions)])
fi ])
AM_CONDITIONAL([COND_SYMVERS_LINUX], AM_CONDITIONAL([COND_SYMVERS_LINUX],
[test "x$enable_symbol_versions" = xlinux]) [test "x$enable_symbol_versions" = xlinux])