changeset 4512:859c456e1257

s2tc: enable Windows build.
author John W. Eaton <jwe@octave.org>
date Wed, 18 Oct 2017 09:27:04 -0400
parents 0117b5797a5c
children 1fdd8063e38d
files dist-files.mk src/mingw-s2tc-1-fixes.patch src/s2tc.mk
diffstat 3 files changed, 48 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Mon Oct 16 18:04:56 2017 -0400
+++ b/dist-files.mk	Wed Oct 18 09:27:04 2017 -0400
@@ -324,6 +324,7 @@
   mingw-mesa-1-fixes.patch \
   mingw-openssl-3-libdeps.patch \
   mingw-portaudio-1-pkgconfig.patch \
+  mingw-s2tc-1-fixes.patch \
   mingw-texinfo-1-fixes.patch \
   mingw-utils-1-portability-fix.patch \
   mingw-w64-1-float-h.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-s2tc-1-fixes.patch	Wed Oct 18 09:27:04 2017 -0400
@@ -0,0 +1,30 @@
+diff -uNr a/configure.ac b/configure.ac
+--- a/configure.ac	2013-11-04 07:14:46.000000000 -0500
++++ b/configure.ac	2017-10-18 09:14:22.139804537 -0400
+@@ -11,7 +11,13 @@
+ 	fi
+ fi
+ 
+-AC_PROG_LIBTOOL
++ifdef([LT_INIT], [], [
++  errprint([error: you must have libtool 2.2.2 or a more recent version
++])
++  m4exit([1])])
++
++LT_PREREQ([2.2.2])
++LT_INIT([disable-static dlopen win32-dll])
+ 
+ AC_ARG_ENABLE(runtime-linking, AS_HELP_STRING([--disable-runtime-linking], [Do not load the library at runtime (faster startup, more dependencies)]), [enable_runtime_linking=$enableval], [enable_runtime_linking=yes])
+ AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools], [Do not build the s2tc_compress and s2_decompress tools]), [enable_tools=$enableval], [enable_tools=yes])
+diff -uNr a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-11-04 07:14:46.000000000 -0500
++++ b/Makefile.am	2017-10-18 09:15:08.413658528 -0400
+@@ -26,7 +26,7 @@
+ if ENABLE_LIB
+ lib_LTLIBRARIES = libtxc_dxtn.la
+ libtxc_dxtn_la_SOURCES = s2tc_algorithm.cpp s2tc_libtxc_dxtn.cpp s2tc_common.h s2tc_algorithm.h txc_dxtn.h s2tc_license.h
+-libtxc_dxtn_la_LDFLAGS = -versioninfo 0:0:0
++libtxc_dxtn_la_LDFLAGS = -versioninfo 0:0:0 -no-undefined
+ libtxc_dxtn_la_LIBADD = -lm
+ libtxc_dxtn_la_CFLAGS = -fvisibility=hidden -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement
+ library_includedir = $(includedir)
--- a/src/s2tc.mk	Mon Oct 16 18:04:56 2017 -0400
+++ b/src/s2tc.mk	Wed Oct 18 09:27:04 2017 -0400
@@ -10,19 +10,21 @@
 $(PKG)_URL      := https://github.com/divVerent/s2tc/archive/v$($(PKG)_VERSION).zip
 $(PKG)_DEPS     := 
 
-ifeq ($(MXE_WINDOWS_BUILD),yes)
-  define $(PKG)_BUILD
-  endef
-else
-  define $(PKG)_BUILD
-    cd '$(1)' && ./autogen.sh
-    mkdir '$(1)/.build'
-    cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
-        $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
-        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
-        --prefix='$(HOST_PREFIX)' \
-        && $(CONFIGURE_POST_HOOK)
+define $(PKG)_BUILD
+  cd '$(1)' && ./autogen.sh
+  mkdir '$(1)/.build'
+  cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
+      $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
+      $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+      $(ENABLE_SHARED_OR_STATIC) \
+      --prefix='$(HOST_PREFIX)' \
+      --disable-tools \
+      && $(CONFIGURE_POST_HOOK)
 
-    $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
-  endef
-endif
+  $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
+
+  ## Mesa attempts to dynamically load dxtn.dll on Windows systems.
+  if [ $(MXE_WINDOWS_BUILD) = yes ]; then \
+    mv '$(3)$(HOST_BINDIR)/libtxc_dxtn-0.dll' '$(3)$(HOST_BINDIR)/dxtn.dll'; \
+  fi
+endef