echo "Generating $DST/zlib.h"
-"$DLWRAP" --input /usr/include/zlib.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/z.syms" --license-file "$SRC/z.license" --soname Z_LIBRARY_SONAME --prefix gnutls_zlib --header-guard GNUTLS_LIB_DLWRAP_ZLIB_H_ --include "<zlib.h>"
+"$DLWRAP" --input /usr/include/zlib.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/z.syms" --license-file "$SRC/z.license" --soname Z_LIBRARY_SONAME_UNUSED --prefix gnutls_zlib --header-guard GNUTLS_LIB_DLWRAP_ZLIB_H_ --include "<zlib.h>"
echo "Generating $DST/zstd.h"
-"$DLWRAP" --input /usr/include/zstd.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/zstd.syms" --license-file "$SRC/zstd.license" --soname ZSTD_LIBRARY_SONAME --prefix gnutls_zstd --header-guard GNUTLS_LIB_DLWRAP_ZSTD_H_ --include "<zstd.h>"
+"$DLWRAP" --input /usr/include/zstd.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/zstd.syms" --license-file "$SRC/zstd.license" --soname ZSTD_LIBRARY_SONAME_UNUSED --prefix gnutls_zstd --header-guard GNUTLS_LIB_DLWRAP_ZSTD_H_ --include "<zstd.h>"
echo "Generating $DST/brotlienc.h"
-"$DLWRAP" --input /usr/include/brotli/encode.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/brotlienc.syms" --license-file "$SRC/brotli.license" --soname BROTLIENC_LIBRARY_SONAME --prefix gnutls_brotlienc --loader-basename brotlienc --header-guard GNUTLS_LIB_DLWRAP_BROTLIENC_H_ --include "<brotli/encode.h>"
+"$DLWRAP" --input /usr/include/brotli/encode.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/brotlienc.syms" --license-file "$SRC/brotli.license" --soname BROTLIENC_LIBRARY_SONAME_UNUSED --prefix gnutls_brotlienc --loader-basename brotlienc --header-guard GNUTLS_LIB_DLWRAP_BROTLIENC_H_ --include "<brotli/encode.h>"
echo "Generating $DST/brotlidec.h"
-"$DLWRAP" --input /usr/include/brotli/decode.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/brotlidec.syms" --license-file "$SRC/brotli.license" --soname BROTLIDEC_LIBRARY_SONAME --prefix gnutls_brotlidec --loader-basename brotlidec --header-guard GNUTLS_LIB_DLWRAP_BROTLIDEC_H_ --include "<brotli/decode.h>"
+"$DLWRAP" --input /usr/include/brotli/decode.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/brotlidec.syms" --license-file "$SRC/brotli.license" --soname BROTLIDEC_LIBRARY_SONAME_UNUSED --prefix gnutls_brotlidec --loader-basename brotlidec --header-guard GNUTLS_LIB_DLWRAP_BROTLIDEC_H_ --include "<brotli/decode.h>"
echo "Generating $DST/oqs.h"
-"$DLWRAP" --input /usr/include/oqs/oqs.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/oqs.syms" --license "SPDX-License-Identifier: MIT" --soname OQS_LIBRARY_SONAME --prefix gnutls_oqs --header-guard GNUTLS_LIB_DLWRAP_OQS_H_ --include "<oqs/oqs.h>"
+"$DLWRAP" --input /usr/include/oqs/oqs.h -o "$DST" --clang-resource-dir $(clang -print-resource-dir) --symbol-file "$SRC/oqs.syms" --license "SPDX-License-Identifier: MIT" --soname OQS_LIBRARY_SONAME_UNUSED --prefix gnutls_oqs --header-guard GNUTLS_LIB_DLWRAP_OQS_H_ --include "<oqs/oqs.h>"
+
+sed -i '/^#include <oqs\/oqs.h>/i\
+/* Local modification: remove this once liboqs 0.10.2 is released */\
+#include "config.h"\
+#if !HAVE_DECL_OQS_SHA3_SET_CALLBACKS\
+#include "liboqs/backport/sha3_ops.h"\
+#endif\
+' "$DST/oqs.h"
#include <errno.h>
#include <stdlib.h>
-/* If BROTLIDEC_LIBRARY_SONAME is defined, dlopen handle can be automatically
+/* If BROTLIDEC_LIBRARY_SONAME_UNUSED is defined, dlopen handle can be automatically
* set; otherwise, the caller needs to call
* gnutls_brotlidec_ensure_library with soname determined at run time.
*/
-#ifdef BROTLIDEC_LIBRARY_SONAME
+#ifdef BROTLIDEC_LIBRARY_SONAME_UNUSED
static void
ensure_library (void)
{
- if (gnutls_brotlidec_ensure_library (BROTLIDEC_LIBRARY_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0)
+ if (gnutls_brotlidec_ensure_library (BROTLIDEC_LIBRARY_SONAME_UNUSED, RTLD_LAZY | RTLD_LOCAL) < 0)
abort ();
}
#endif /* !GNUTLS_BROTLIDEC_ENABLE_PTHREAD */
-#else /* BROTLIDEC_LIBRARY_SONAME */
+#else /* BROTLIDEC_LIBRARY_SONAME_UNUSED */
#define ENSURE_LIBRARY do {} while (0)
-#endif /* !BROTLIDEC_LIBRARY_SONAME */
+#endif /* !BROTLIDEC_LIBRARY_SONAME_UNUSED */
static void *gnutls_brotlidec_dlhandle;
gnutls_brotlidec_unload_library (void)
{
if (gnutls_brotlidec_dlhandle)
- dlclose (gnutls_brotlidec_dlhandle);
+ {
+ dlclose (gnutls_brotlidec_dlhandle);
+ gnutls_brotlidec_dlhandle = NULL;
+ }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#undef FUNC
#pragma GCC diagnostic pop
-
-#undef RESET_SYMBOL
}
#else /* GNUTLS_BROTLIDEC_ENABLE_DLOPEN */
#include <errno.h>
#include <stdlib.h>
-/* If BROTLIENC_LIBRARY_SONAME is defined, dlopen handle can be automatically
+/* If BROTLIENC_LIBRARY_SONAME_UNUSED is defined, dlopen handle can be automatically
* set; otherwise, the caller needs to call
* gnutls_brotlienc_ensure_library with soname determined at run time.
*/
-#ifdef BROTLIENC_LIBRARY_SONAME
+#ifdef BROTLIENC_LIBRARY_SONAME_UNUSED
static void
ensure_library (void)
{
- if (gnutls_brotlienc_ensure_library (BROTLIENC_LIBRARY_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0)
+ if (gnutls_brotlienc_ensure_library (BROTLIENC_LIBRARY_SONAME_UNUSED, RTLD_LAZY | RTLD_LOCAL) < 0)
abort ();
}
#endif /* !GNUTLS_BROTLIENC_ENABLE_PTHREAD */
-#else /* BROTLIENC_LIBRARY_SONAME */
+#else /* BROTLIENC_LIBRARY_SONAME_UNUSED */
#define ENSURE_LIBRARY do {} while (0)
-#endif /* !BROTLIENC_LIBRARY_SONAME */
+#endif /* !BROTLIENC_LIBRARY_SONAME_UNUSED */
static void *gnutls_brotlienc_dlhandle;
gnutls_brotlienc_unload_library (void)
{
if (gnutls_brotlienc_dlhandle)
- dlclose (gnutls_brotlienc_dlhandle);
+ {
+ dlclose (gnutls_brotlienc_dlhandle);
+ gnutls_brotlienc_dlhandle = NULL;
+ }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#undef FUNC
#pragma GCC diagnostic pop
-
-#undef RESET_SYMBOL
}
#else /* GNUTLS_BROTLIENC_ENABLE_DLOPEN */
#include <errno.h>
#include <stdlib.h>
-/* If OQS_LIBRARY_SONAME is defined, dlopen handle can be automatically
+/* If OQS_LIBRARY_SONAME_UNUSED is defined, dlopen handle can be automatically
* set; otherwise, the caller needs to call
* gnutls_oqs_ensure_library with soname determined at run time.
*/
-#ifdef OQS_LIBRARY_SONAME
+#ifdef OQS_LIBRARY_SONAME_UNUSED
static void
ensure_library (void)
{
- if (gnutls_oqs_ensure_library (OQS_LIBRARY_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0)
+ if (gnutls_oqs_ensure_library (OQS_LIBRARY_SONAME_UNUSED, RTLD_LAZY | RTLD_LOCAL) < 0)
abort ();
}
#endif /* !GNUTLS_OQS_ENABLE_PTHREAD */
-#else /* OQS_LIBRARY_SONAME */
+#else /* OQS_LIBRARY_SONAME_UNUSED */
#define ENSURE_LIBRARY do {} while (0)
-#endif /* !OQS_LIBRARY_SONAME */
+#endif /* !OQS_LIBRARY_SONAME_UNUSED */
static void *gnutls_oqs_dlhandle;
gnutls_oqs_unload_library (void)
{
if (gnutls_oqs_dlhandle)
- dlclose (gnutls_oqs_dlhandle);
+ {
+ dlclose (gnutls_oqs_dlhandle);
+ gnutls_oqs_dlhandle = NULL;
+ }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#undef FUNC
#pragma GCC diagnostic pop
-
-#undef RESET_SYMBOL
}
#else /* GNUTLS_OQS_ENABLE_DLOPEN */
#include <errno.h>
#include <stdlib.h>
-/* If Z_LIBRARY_SONAME is defined, dlopen handle can be automatically
+/* If Z_LIBRARY_SONAME_UNUSED is defined, dlopen handle can be automatically
* set; otherwise, the caller needs to call
* gnutls_zlib_ensure_library with soname determined at run time.
*/
-#ifdef Z_LIBRARY_SONAME
+#ifdef Z_LIBRARY_SONAME_UNUSED
static void
ensure_library (void)
{
- if (gnutls_zlib_ensure_library (Z_LIBRARY_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0)
+ if (gnutls_zlib_ensure_library (Z_LIBRARY_SONAME_UNUSED, RTLD_LAZY | RTLD_LOCAL) < 0)
abort ();
}
#endif /* !GNUTLS_ZLIB_ENABLE_PTHREAD */
-#else /* Z_LIBRARY_SONAME */
+#else /* Z_LIBRARY_SONAME_UNUSED */
#define ENSURE_LIBRARY do {} while (0)
-#endif /* !Z_LIBRARY_SONAME */
+#endif /* !Z_LIBRARY_SONAME_UNUSED */
static void *gnutls_zlib_dlhandle;
gnutls_zlib_unload_library (void)
{
if (gnutls_zlib_dlhandle)
- dlclose (gnutls_zlib_dlhandle);
+ {
+ dlclose (gnutls_zlib_dlhandle);
+ gnutls_zlib_dlhandle = NULL;
+ }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#undef FUNC
#pragma GCC diagnostic pop
-
-#undef RESET_SYMBOL
}
#else /* GNUTLS_ZLIB_ENABLE_DLOPEN */
#include <errno.h>
#include <stdlib.h>
-/* If ZSTD_LIBRARY_SONAME is defined, dlopen handle can be automatically
+/* If ZSTD_LIBRARY_SONAME_UNUSED is defined, dlopen handle can be automatically
* set; otherwise, the caller needs to call
* gnutls_zstd_ensure_library with soname determined at run time.
*/
-#ifdef ZSTD_LIBRARY_SONAME
+#ifdef ZSTD_LIBRARY_SONAME_UNUSED
static void
ensure_library (void)
{
- if (gnutls_zstd_ensure_library (ZSTD_LIBRARY_SONAME, RTLD_LAZY | RTLD_LOCAL) < 0)
+ if (gnutls_zstd_ensure_library (ZSTD_LIBRARY_SONAME_UNUSED, RTLD_LAZY | RTLD_LOCAL) < 0)
abort ();
}
#endif /* !GNUTLS_ZSTD_ENABLE_PTHREAD */
-#else /* ZSTD_LIBRARY_SONAME */
+#else /* ZSTD_LIBRARY_SONAME_UNUSED */
#define ENSURE_LIBRARY do {} while (0)
-#endif /* !ZSTD_LIBRARY_SONAME */
+#endif /* !ZSTD_LIBRARY_SONAME_UNUSED */
static void *gnutls_zstd_dlhandle;
gnutls_zstd_unload_library (void)
{
if (gnutls_zstd_dlhandle)
- dlclose (gnutls_zstd_dlhandle);
+ {
+ dlclose (gnutls_zstd_dlhandle);
+ gnutls_zstd_dlhandle = NULL;
+ }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#undef FUNC
#pragma GCC diagnostic pop
-
-#undef RESET_SYMBOL
}
#else /* GNUTLS_ZSTD_ENABLE_DLOPEN */