From 21e195f65792caa2323ece7831f84318633de7c4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 12 Oct 2019 21:11:56 -0700 Subject: [PATCH] espeak: Compile with uClibc++ Several Makefile cleanups. Added PKG_BUILD_PARALLEL for faster compilation. Several size optimizations applied. Signed-off-by: Rosen Penev --- sound/espeak/Makefile | 37 ++++++++++-------- ..._GCC_narrowing_conversion_errors.patch.swp | Bin 0 -> 1024 bytes sound/espeak/patches/010-uclibcxx.patch | 21 ++++++++++ 3 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 sound/espeak/patches/.101-Fix_GCC_narrowing_conversion_errors.patch.swp create mode 100644 sound/espeak/patches/010-uclibcxx.patch diff --git a/sound/espeak/Makefile b/sound/espeak/Makefile index ee4aa6662..a5c2fc621 100644 --- a/sound/espeak/Makefile +++ b/sound/espeak/Makefile @@ -12,20 +12,22 @@ PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip PKG_SOURCE_URL:=@SF/espeak PKG_HASH:=bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659 - -PKG_LICENSE:=GPL-3.0 -PKG_LICENSE_FILES:=License.txt -PKG_MAINTAINER:=Nicolas Thill - PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source -PKG_INSTALL:=1 +PKG_MAINTAINER:= +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=License.txt + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk include $(INCLUDE_DIR)/package.mk define Package/espeak SECTION:=sound CATEGORY:=Sound - DEPENDS:=+libpthread +libstdcpp +portaudio + DEPENDS:=$(CXX_DEPENDS) +portaudio TITLE:=Speech synthesizer URL:=http://espeak.sourceforge.net/ endef @@ -35,23 +37,26 @@ define Package/espeak/description other languages. endef -MAKE_FLAGS+= \ - AUDIO="portaudio" \ - DATADIR="/usr/share/espeak" \ - CXXFLAGS="$(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - -MAKE_PATH:=./src - # Use system header for portaudio define Build/Prepare $(call Build/Prepare/Default) rm $(PKG_BUILD_DIR)/src/portaudio.h endef +MAKE_FLAGS+= \ + AUDIO="portaudio" \ + DATADIR="/usr/share/espeak" \ + CXXFLAGS="$(TARGET_CXXFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + +MAKE_PATH:=./src + +TARGET_CXXFLAGS += -std=c++14 -ffunction-sections -fdata-sections -flto +TARGET_LDFLAGS += $(FPIC) $(if $(CONFIG_USE_GLIBC),-lm) -Wl,--gc-sections,--as-needed + define Package/espeak/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libespeak.so.* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/share diff --git a/sound/espeak/patches/.101-Fix_GCC_narrowing_conversion_errors.patch.swp b/sound/espeak/patches/.101-Fix_GCC_narrowing_conversion_errors.patch.swp new file mode 100644 index 0000000000000000000000000000000000000000..0f1c9a13c4b55e0fbf881cb4db90ecb2b85d9ff4 GIT binary patch literal 1024 zcmeH@OAdlS42I_r9>5DgL02vfiZL#HK-`Wa6qpb?WXkLK64|if26WYY|DUG$z8)zu z+nsxG_hL4mjS!WhTn{t2u%6D*ExtdT_w^OU&*MT%2q;X2FkOWdJ8s%615+dQwt);W zWvEqBsvH^Ew3GsJjj9}JlN2NLJ>LoSATL26Nm*-pO}R`Ab!b@|k~lKU?!UkI#~Q2# IRs)lP9|N~FG5`Po literal 0 HcmV?d00001 diff --git a/sound/espeak/patches/010-uclibcxx.patch b/sound/espeak/patches/010-uclibcxx.patch new file mode 100644 index 000000000..f4d2f9a3a --- /dev/null +++ b/sound/espeak/patches/010-uclibcxx.patch @@ -0,0 +1,21 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -83,15 +83,15 @@ libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp + + SRCS1=$(speak_SOURCES) + OBJS1=$(patsubst %.cpp,%.o,$(SRCS1)) +-LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS) ++LIBS1=$(LIB_AUDIO) -lpthread $(EXTRA_LIBS) + + SRCS2=$(libespeak_SOURCES) + OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2)) +-LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread ++LIBS2=$(LIB_AUDIO) -lpthread + + SRCS3 = espeak.cpp + OBJS3=$(patsubst %.cpp,%.o,$(SRCS3)) +-LIBS3=-lstdc++ -L . -lespeak ++LIBS3=-L . -lespeak + + CXXFLAGS=-O2 +