Browse Source

espeak: Compile with uClibc++

Several Makefile cleanups.

Added PKG_BUILD_PARALLEL for faster compilation.

Several size optimizations applied.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 5 years ago
parent
commit
21e195f657
3 changed files with 37 additions and 11 deletions
  1. +16
    -11
      sound/espeak/Makefile
  2. BIN
      sound/espeak/patches/.101-Fix_GCC_narrowing_conversion_errors.patch.swp
  3. +21
    -0
      sound/espeak/patches/010-uclibcxx.patch

+ 16
- 11
sound/espeak/Makefile View File

@ -12,20 +12,22 @@ PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
PKG_SOURCE_URL:=@SF/espeak
PKG_HASH:=bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source
PKG_LICENSE:=GPL-3.0
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=License.txt
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source
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
# 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_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS)" \
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
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


BIN
sound/espeak/patches/.101-Fix_GCC_narrowing_conversion_errors.patch.swp View File


+ 21
- 0
sound/espeak/patches/010-uclibcxx.patch View File

@ -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

Loading…
Cancel
Save