telephony/libs/libpri/Makefile
Sergey V. Lobanov 3424e0027d libpri: fix build on macos
libpri can not be built on macos for OpenWrt Linux target due to:
1. Makefile uses `ar` and `ranlib` (without using make variables).
   MacOS system ar and ranlib are not compatible with the objects
   generated by OpenWrt GCC toolchain. This commit adds patch to
   add an ability to redefine `ar` and `ranlib` tools.
   Upstream issue: https://issues.asterisk.org/jira/browse/PRI-188
2. Makefile detects Darwin using `uname -s` and changes build logic
   but it is not need for cross-platfrom build. This commit
   redefines OSARCH=Linux in OpenWrt Makefile
3. After redefining OSARCH=Linux, libpri Makefile uses /sbin/ldconfig
   that does not exist on MacOS. This commit redefines LDCONFIG=ldconfig
   in OpenWrt Makefile to use ldconfig provided by OpenWrt.

Patch '001-fix-include-signal-h-warning.patch' was refreshed to pass
CI checks. The payload of this patch was not changed.

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
2022-01-30 14:40:24 +03:00

58 lines
1.5 KiB
Makefile

#
# Copyright (C) 2015 - 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libpri
PKG_VERSION:=1.6.0
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/libpri/releases
PKG_HASH:=7225ea7ec334a115f9dc08e71f55589c38cb4e00b13964cd2f08cc4e6123e3f6
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libpri
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libpri Primary Rate ISDN implementation
URL:=http://www.asterisk.org/
DEPENDS:=+dahdi-tools-libtonezone
endef
define Package/libpri/description
libpri is a C implementation of the Primary Rate ISDN specification. It was
based on the Bellcore specification SR-NWT-002343 for National ISDN. As of
May 12, 2001, it has been tested work with NI-2, Nortel DMS-100, and
Lucent 5E Custom protocols on switches from Nortel and Lucent.
endef
MAKE_FLAGS += \
OSARCH=Linux \
LDCONFIG=ldconfig
define Build/Configure
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpri*.a $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpri*.so* $(1)/usr/lib/
endef
define Package/libpri/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpri*.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libpri))