Skip to content

Commit

Permalink
Patch htslib 1.10 to fix build with autoconf 2.70+
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Apr 28, 2021
1 parent 813d422 commit 34d1b63
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libtiledbvcf/cmake/Modules/FindHTSlib_EP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ if (NOT HTSLIB_FOUND)
$(MAKE)
INSTALL_COMMAND
$(MAKE) install
PATCH_COMMAND
patch -N -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/htslib-1.10-config.patch
BUILD_IN_SOURCE TRUE
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
Expand All @@ -114,4 +116,4 @@ endif()
if (EP_HTSLIB_BUILT AND TARGET HTSlib::HTSlib)
include(TileDBCommon)
install_target_libs(HTSlib::HTSlib)
endif()
endif()
31 changes: 31 additions & 0 deletions libtiledbvcf/cmake/patches/htslib-1.10-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 6821fc8ed88706e9282b561e74dfa45dac4d74c8 Mon Sep 17 00:00:00 2001
From: John Marshall <jmarshall@hey.com>
Date: Fri, 1 Jan 2021 10:37:22 +0000
Subject: [PATCH] Don't set $host_alias as that confuses autoconf 2.70

Autoconf 2.70 is more careful about cross compilation, so with this
version using AC_FUNC_MMAP implies AC_CANONICAL_HOST and hence computes
$build/build_alias/host/host_alias/etc. Setting $host_alias ourselves
interferes with that. Hat tip Matthias Klose (via debbug#978835).

As autoconf 2.70 implicitly uses AC_CANONICAL_HOST, it requires (and its
autoreconf --install installs) config.guess and config.sub. Ignore those,
and ignore install-sh as well for good measure.
---
diff --git a/configure.ac b/configure.ac
index 9bd1642d7..f473c97e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,9 +137,9 @@ AC_ARG_ENABLE([s3],
[support Amazon AWS S3 URLs])],
[], [enable_s3=check])

-test -n "$host_alias" || host_alias=unknown-`uname -s`
-AC_MSG_CHECKING([shared library type for $host_alias])
-case $host_alias in
+basic_host=${host_alias:-unknown-`uname -s`}
+AC_MSG_CHECKING([shared library type for $basic_host])
+case $basic_host in
*-cygwin* | *-CYGWIN*)
host_result="Cygwin DLL"
PLATFORM=CYGWIN

0 comments on commit 34d1b63

Please sign in to comment.