[Asterisk-code-review] build: Fix issues building pjproject (asterisk[19])

Joshua Colp asteriskteam at digium.com
Mon Jan 17 08:54:38 CST 2022


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17881 )

Change subject: build: Fix issues building pjproject
......................................................................

build: Fix issues building pjproject

The change to allow easier hacking on bundled pjproject created
a few issues:

* The new Makefile was trying to run the bundled make even if
  PJPROJECT_BUNDLED=no.  third-party/Makefile now checks for
  PJPROJECT_BUNDLED and JANSSON_BUNDLED and skips them if they
  are "no".

* When building with bundled, config_site.h was being copied
  only if a full make or a "make main" was done.  A "make res"
  would fail all the pjsip modules because they couldn't find
  config_site.h.  The Makefile now copies config_site.h and
  asterisk_malloc_debug.h into the pjproject source tree
  when it's "configure" is performed.  This is how it used
  to be before the big change.

ASTERISK-29858

Change-Id: I9427264fa3cb8b3f59a95e5f9693eac236a6f76d
---
M third-party/Makefile
M third-party/pjproject/Makefile
2 files changed, 18 insertions(+), 3 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/third-party/Makefile b/third-party/Makefile
index e87e26f..532bf53 100644
--- a/third-party/Makefile
+++ b/third-party/Makefile
@@ -1,13 +1,26 @@
 
+-include ../makeopts
 include Makefile.rules
 
-TP_SUBDIRS := pjproject jansson
+TP_SUBDIRS :=
 # Sub directories that contain special install/uninstall targets must be explicitly listed
 # to prevent accidentally running the package's default install target.
-TP_INSTALL_SUBDIRS := pjproject jansson
+TP_INSTALL_SUBDIRS :=
+
+ifeq ($(PJPROJECT_BUNDLED),yes)
+TP_SUBDIRS += pjproject
+TP_INSTALL_SUBDIRS += pjproject
+endif
+
+ifeq ($(JANSSON_BUNDLED),yes)
+TP_SUBDIRS += jansson
+TP_INSTALL_SUBDIRS += jansson
+endif
 
 .PHONY: all dist-clean distclean install clean moduleinfo makeopts uninstall $(TP_SUBDIRS)
 
+ifneq ($(TP_SUBDIRS),)
+
 override MAKECMDGOALS?=all
 
 MAKECMDGOALS:=$(subst dist-clean,distclean,$(MAKECMDGOALS))
@@ -17,3 +30,5 @@
 
 $(TP_SUBDIRS):
 	+$(CMD_PREFIX) $(SUBMAKE) -C $@ $(MAKECMDGOALS)
+
+endif
\ No newline at end of file
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 612c116..28cb5db 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -126,7 +126,7 @@
 	$(ECHO_PREFIX) Rebuilding
 	$(CMD_PREFIX) $(MAKE) clean $(REALLY_QUIET)
 
-source/build.mak: Makefile.rules source/user.mak $(if $(PJPROJECT_BUNDLED_OOT),,.rebuild_needed)
+source/build.mak: Makefile.rules source/user.mak $(if $(PJPROJECT_BUNDLED_OOT),,.rebuild_needed) $(subst patches,source/pjlib/include/pj,$(wildcard patches/*.h))
 	$(ECHO_PREFIX) Configuring with $(PJPROJECT_CONFIG_OPTS) 
 	$(CMD_PREFIX) (cd source ; ./aconfigure $(QUIET_CONFIGURE) $(PJPROJECT_CONFIG_OPTS))
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17881
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I9427264fa3cb8b3f59a95e5f9693eac236a6f76d
Gerrit-Change-Number: 17881
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220117/f94b74a4/attachment.html>


More information about the asterisk-code-review mailing list