Mercurial > mxe-octave
changeset 5833:d0e01250d146
libbiosig: Changes for compilation with gcc 11.
* src/libbiosig.mk: Use C++14 standard.
* src/libbiosig-1-gcc11.patch: New patch.
* dist-files.mk: Add file to list.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 10 Aug 2021 18:51:59 +0200 |
parents | e43ee30c4fee |
children | 0988117f1a6e |
files | dist-files.mk src/libbiosig-1-gcc11.patch src/libbiosig.mk |
diffstat | 3 files changed, 84 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/dist-files.mk Tue Aug 10 12:33:10 2021 -0400 +++ b/dist-files.mk Tue Aug 10 18:51:59 2021 +0200 @@ -227,6 +227,7 @@ libass-test.c \ libass.mk \ libb64.mk \ + libbiosig-1-gcc11.patch \ libbiosig.mk \ libcdio.mk \ libcroco.mk \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/libbiosig-1-gcc11.patch Tue Aug 10 18:51:59 2021 +0200 @@ -0,0 +1,72 @@ +Change Makefile so that the values of environment variables are respected. + +--- ./biosig4c++/Makefile.in.orig 2021-08-10 18:35:30.301801739 +0200 ++++ ./biosig4c++/Makefile.in 2021-08-10 18:37:18.338795660 +0200 +@@ -101,6 +101,9 @@ includedir = @includedir@ + bindir = @bindir@ + mandir = @mandir@ + ++CC ?= @CC@ ++CXX ?= @CXX@ ++ + CFLAGS += -I$(includedir) + CXXFLAGS += $(CFLAGS) + +@@ -108,7 +111,8 @@ CXXFLAGS += $(CFLAGS) + ifeq (,$(TARGET)) + CC ?= gcc + CXX ?= g++ +- AR := ar rcs ++ ARFLAGS ?= rcs ++ AR ?= ar + PKGCONF := pkg-config + SHAREDLIB = -shared + DLEXT = so +@@ -116,14 +120,16 @@ else ifeq (intel,$(TARGET)) + CC := icc + CXX := icc + LD := xild +- AR := xiar crs ++ ARFLAGS ?= crs ++ AR := xiar + else + PREFIX := $(subst /bin/,/,$(dir $(shell which $(TARGET)-gcc))) +- CC := $(TARGET)-gcc +- CXX := $(TARGET)-g++ ++ CC ?= $(TARGET)-gcc ++ CXX ?= $(TARGET)-g++ + LD := $(TARGET)-ld +- AR := $(TARGET)-ar rcs +- PKGCONF := $(TARGET)-pkg-config ++ AR ?= $(TARGET)-ar ++ ARFLAGS ?= rcs ++ PKGCONF ?= $(TARGET)-pkg-config + ifneq (,$(findstring mingw,$(TARGET))) + ## add gnulib's getlogin + SOURCES += win32/getlogin.c win32/getline.c win32/getdelim.c +@@ -136,6 +142,8 @@ else + endif + endif + ++AR := $(AR) $(ARFLAGS) ++ + SONAMEVERSION ?= 3 + + ### TODO: DLEXT does not work correctly on MXE/MINGW + + +`typeof` is a GNU extension. Use `decltype` which is part of C++11. +--- ./biosig4c++/t230/sopen_hl7aecg.cpp.orig 2021-08-02 18:59:57.000000000 +0200 ++++ ./biosig4c++/t230/sopen_hl7aecg.cpp 2021-08-10 17:41:35.500597677 +0200 +@@ -791,8 +791,8 @@ EXTERN_C int sopen_HL7aECG_read(HDRTYPE* + + if ((N+3) > N_Event) { + N_Event = max(16,2*(N+2)); +- hdr->EVENT.TYP = (typeof(hdr->EVENT.TYP)) realloc(hdr->EVENT.TYP,N_Event*sizeof(*hdr->EVENT.TYP)); +- hdr->EVENT.POS = (typeof(hdr->EVENT.POS)) realloc(hdr->EVENT.POS,N_Event*sizeof(*hdr->EVENT.POS)); ++ hdr->EVENT.TYP = (decltype(hdr->EVENT.TYP)) realloc(hdr->EVENT.TYP,N_Event*sizeof(*hdr->EVENT.TYP)); ++ hdr->EVENT.POS = (decltype(hdr->EVENT.POS)) realloc(hdr->EVENT.POS,N_Event*sizeof(*hdr->EVENT.POS)); + } + + TiXmlHandle Boundary = Annotation.FirstChild("support").FirstChild("supportingROI").FirstChild("component").FirstChild("boundary").FirstChild("value"); +
--- a/src/libbiosig.mk Tue Aug 10 12:33:10 2021 -0400 +++ b/src/libbiosig.mk Tue Aug 10 18:51:59 2021 +0200 @@ -24,10 +24,17 @@ ac_cv_func_realloc_0_nonnull=yes else $(PKG)_MAKE_FLAGS := \ - LDLIBS='-liconv -lm -ltinyxml' \ + LDLIBS='-liconv -lm -ltinyxml' +endif + +$(PKG)_MAKE_FLAGS += \ + CC='$(MXE_CC)' \ + CXX='$(MXE_CXX) -std=c++14' \ + RANLIB='$(MXE_RANLIB)' \ + AR='$(MXE_AR)' \ + ARFLAGS=rcs \ LDFLAGS=$(MXE_LDFLAGS) \ CFLAGS=$(MXE_CFLAGS) -endif define $(PKG)_BUILD @@ -35,13 +42,7 @@ $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \ $($(PKG)_AUTOCONF_CROSS_FLAGS) \ --prefix=$(HOST_PREFIX) \ - CC='$(MXE_CC)' \ - CXX='$(MXE_CXX)' \ - RANLIB='$(MXE_RANLIB)' \ - AR='$(MXE_AR)' \ - ARFLAGS=rcs \ - LDFLAGS=$(MXE_LDFLAGS) \ - CFLAGS=$(MXE_CFLAGS) \ + $($(PKG)_MAKE_FLAGS) \ LIBTOOL=$(LIBTOOL) \ PKG_CONFIG='$(MXE_PKG_CONFIG)' \ PKG_CONFIG_PATH='$(HOST_LIBDIR)/pkgconfig' @@ -49,7 +50,7 @@ # make sure NDEBUG is defined $(SED) -i '/NDEBUG/ s|#||g' '$(1)'/biosig4c++/Makefile - $($(PKG)_MAKE_FLAGS) $(MAKE) -C '$(1)' lib tools + $($(PKG)_MAKE_FLAGS) $(MAKE) -C '$(1)/biosig4c++' lib tools $($(PKG)_MAKE_FLAGS) $(MAKE) -C '$(1)/biosig4c++' install DESTDIR='$(3)' # FIXME: These files should be installed by the Makefile rule.