Skip to content

Commit

Permalink
Update poco.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Oct 15, 2024
1 parent f6e3325 commit 1708efd
Showing 1 changed file with 62 additions and 68 deletions.
130 changes: 62 additions & 68 deletions external/updates/poco.mk
Original file line number Diff line number Diff line change
@@ -1,115 +1,109 @@
################################################################################
#
# poco
# Simple Poco Build (Net + Foundation Only) with Logging
#
################################################################################

POCO_VERSION = 1.13.2
POCO_SITE = $(call github,pocoproject,poco,poco-$(POCO_VERSION)-release)
POCO_LICENSE = BSL-1.0
POCO_LICENSE_FILES = LICENSE
POCO_CPE_ID_VENDOR = pocoproject
POCO_INSTALL_STAGING = YES

# Dependencies: Include only the necessary ones for Net and Foundation
POCO_DEPENDENCIES = \
pcre2 \
zlib \
openssl \
$(if $(BR2_PACKAGE_POCO_CRYPTO),openssl) \
$(if $(BR2_PACKAGE_POCO_DATA_MYSQL),mariadb) \
$(if $(BR2_PACKAGE_POCO_DATA_SQLITE),sqlite) \
$(if $(BR2_PACKAGE_POCO_DATA_PGSQL),postgresql) \
$(if $(BR2_PACKAGE_POCO_NETSSL_OPENSSL),openssl) \
$(if $(BR2_PACKAGE_POCO_XML),expat)
pcre2 \
zlib \
openssl

# Verbose echo statements to indicate the start of the build process
# Log file for verbose output
POCO_BUILD_LOG = poco_build.log

# Verbose echo statements to track progress
define POCO_VERBOSE_MSG
@echo "***************************************************************************"
@echo "* Building Poco version $(POCO_VERSION)"
@echo "* Including components: Net"
@echo "* Excluding components: $(POCO_OMIT)"
@echo "* Using configuration options: $(POCO_CONF_OPTS)"
@echo "***************************************************************************"
@echo "***************************************************************************"
@echo "* Building Poco version $(POCO_VERSION)"
@echo "* Including components: Foundation, Net"
@echo "* Using configuration options: $(POCO_CONF_OPTS)"
@echo "***************************************************************************"
endef

# Only include Foundation and Net, exclude everything else
POCO_OMIT = \
Data/ODBC \
PageCompiler \
$(if $(BR2_PACKAGE_POCO_ACTIVERECORD),,ActiveRecord) \
$(if $(BR2_PACKAGE_POCO_CPP_PARSER),,CppParser) \
$(if $(BR2_PACKAGE_POCO_DATA),,Data) \
$(if $(BR2_PACKAGE_POCO_DATA_MYSQL),,Data/MySQL) \
$(if $(BR2_PACKAGE_POCO_DATA_SQLITE),,Data/SQLite) \
$(if $(BR2_PACKAGE_POCO_DATA_PGSQL),,Data/PostgreSQL) \
$(if $(BR2_PACKAGE_POCO_JSON),,JSON) \
$(if $(BR2_PACKAGE_POCO_JWT),,JWT) \
$(if $(BR2_PACKAGE_POCO_MONGODB),,MongoDB) \
$(if $(BR2_PACKAGE_POCO_PDF),,PDF) \
$(if $(BR2_PACKAGE_POCO_PROMETHEUS),,Prometheus) \
$(if $(BR2_PACKAGE_POCO_REDIS),,Redis) \
$(if $(BR2_PACKAGE_POCO_UTIL),,Util) \
$(if $(BR2_PACKAGE_POCO_XML),,XML) \
$(if $(BR2_PACKAGE_POCO_ZIP),,Zip)
PageCompiler \
Data \
Data/ODBC \
Data/MySQL \
Data/SQLite \
Data/PostgreSQL \
JSON \
JWT \
MongoDB \
PDF \
Prometheus \
Redis \
Util \
XML \
Zip

# Always include Net component and echo that it's included
POCO_CONF_OPTS += -DENABLE_NET=ON
$(info [INFO] Poco Net component included)
# Always include Foundation and Net components
POCO_CONF_OPTS += -DENABLE_NET=ON -DENABLE_FOUNDATION=ON
$(info [INFO] Poco Foundation and Net components included)

# Disable certain features based on toolchain (e.g., no fpenvironment for uClibc)
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
POCO_CONF_OPTS += --no-fpenvironment --no-wstring
endif

# architectures missing some FE_* in their fenv.h
ifeq ($(BR2_sh4a)$(BR2_nios2),y)
POCO_CONF_OPTS += --no-fpenvironment
endif

# disable fpenvironment for soft floating point configuration
# Disable fpenvironment for soft floating point configuration
ifeq ($(BR2_SOFT_FLOAT),y)
POCO_CONF_OPTS += --no-fpenvironment
endif

# Set shared library target by default
POCO_MAKE_TARGET = shared_release

# Ensure we link against atomic if necessary
POCO_LDFLAGS=$(TARGET_LDFLAGS)
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
POCO_LDFLAGS += -latomic
endif

# Configure Poco with verbose output and log to file
define POCO_CONFIGURE_CMDS
$(POCO_VERBOSE_MSG)
(cd $(@D); $(TARGET_MAKE_ENV) ./configure \
--config=Linux \
--prefix=/usr \
--ldflags="$(POCO_LDFLAGS)" \
--omit="$(POCO_OMIT)" \
$(POCO_CONF_OPTS) \
--unbundled \
--no-tests \
--no-samples)
$(POCO_VERBOSE_MSG)
(cd $(@D); $(TARGET_MAKE_ENV) ./configure \
--config=Linux \
--prefix=/usr \
--ldflags="$(POCO_LDFLAGS)" \
--omit="$(POCO_OMIT)" \
$(POCO_CONF_OPTS) \
--unbundled \
--no-tests \
--no-samples \
V=1) >> $(POCO_BUILD_LOG) 2>&1
endef

# Use $(MAKE1) to avoid failures on heavily parallel machines (e.g. -j25)
# Use $(MAKE1) to avoid failures with highly parallel builds, and log the build process to file
define POCO_BUILD_CMDS
@echo "[INFO] Building Poco with target $(POCO_MAKE_TARGET)"
$(TARGET_MAKE_ENV) $(MAKE1) POCO_TARGET_OSARCH=$(ARCH) CROSS_COMPILE=$(TARGET_CROSS) \
POCO_MYSQL_INCLUDE=$(STAGING_DIR)/usr/include/mysql \
POCO_MYSQL_LIB=$(STAGING_DIR)/usr/lib/mysql \
POCO_PGSQL_INCLUDE=$(STAGING_DIR)/usr/include/postgresql \
POCO_PGSQL_LIB=$(STAGING_DIR)/usr/lib/postgresql \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) -C $(@D)
@echo "[INFO] Building Poco with target $(POCO_MAKE_TARGET)"
$(TARGET_MAKE_ENV) $(MAKE1) V=1 POCO_TARGET_OSARCH=$(ARCH) CROSS_COMPILE=$(TARGET_CROSS) \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) -C $(@D) >> $(POCO_BUILD_LOG) 2>&1
endef

# Install into staging directory, and log the installation process to file
define POCO_INSTALL_STAGING_CMDS
@echo "[INFO] Installing Poco into the staging directory"
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) POCO_TARGET_OSARCH=$(ARCH) \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D)
@echo "[INFO] Installing Poco into the staging directory"
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) POCO_TARGET_OSARCH=$(ARCH) \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D) >> $(POCO_BUILD_LOG) 2>&1
endef

# Install into target directory, and log the installation process to file
define POCO_INSTALL_TARGET_CMDS
@echo "[INFO] Installing Poco into the target directory"
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) POCO_TARGET_OSARCH=$(ARCH) \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D)
@echo "[INFO] Installing Poco into the target directory"
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) POCO_TARGET_OSARCH=$(ARCH) \
DEFAULT_TARGET=$(POCO_MAKE_TARGET) install -C $(@D) >> $(POCO_BUILD_LOG) 2>&1
endef

# Evaluate the package
$(eval $(generic-package))

0 comments on commit 1708efd

Please sign in to comment.