set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-fno-semantic-interposition")
endif()
if(NOT APPLE)
+ if(NOT ZLIB_COMPAT)
+ add_definitions(-DHAVE_SYMVER)
+ endif()
set_target_properties(zlib PROPERTIES LINK_FLAGS
"-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib${SUFFIX}.map\"")
elseif(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}" OR NOT WITH_RPATH)
esac
fi
+# Symbol versioning
+case "$uname" in
+ CYGWIN* | Cygwin* | cygwin* | MINGW* | mingw* | MSYS* | msys* | Darwin* | darwin*)
+ echo "Checking for Symbol versioning... No."
+ ;;
+ *)
+ if test $shared -eq 1; then
+ echo "Checking for Symbol versioning... Yes."
+ CFLAGS="${CFLAGS} -DHAVE_SYMVER"
+ SFLAGS="${SFLAGS} -DHAVE_SYMVER"
+ else
+ echo "Checking for Symbol versioning... No."
+ fi
+ ;;
+esac
+
# Simplify some later conditionals
case "$uname" in
Linux* | linux*)
;;
esac
+echo "Uname: $uname"
echo "ARCH: ${ARCH}"
echo "Using arch directory: ${ARCHDIR}"
echo "Architecture-specific static object files:${ARCH_STATIC_OBJS}"
# define Z_INTERNAL
#endif
+/* Symbol versioning helpers, allowing multiple versions of a function to exist.
+ * Functions using this must also be added to zlib-ng.map for each version.
+ * Double @@ means this is the default for newly compiled applications to link against.
+ * Single @ means this is kept for backwards compatibility.
+ * This is only used for Zlib-ng native API, and only on platforms supporting this.
+ */
+#if defined(HAVE_SYMVER)
+# define ZSYMVER(func,alias,ver) __asm__(".symver " func ", " alias "@ZLIB_NG_" ver);
+# define ZSYMVER_DEF(func,alias,ver) __asm__(".symver " func ", " alias "@@ZLIB_NG_" ver);
+#else
+# define ZSYMVER(func,alias,ver)
+# define ZSYMVER_DEF(func,alias,ver)
+#endif
+
#ifndef __cplusplus
# define Z_REGISTER register
#else