mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 11:11:05 +00:00
BuildSystem: Check for alternate openssl packages
OpenSSL is one of those packages that often have alternatives with later versions. For instance, CentOS/EL 7 has an openssl package at version 1.0.2 but there's an openssl11 package from the epel repository that has 1.1.1. This gets installed to /usr/include/openssl11 and /usr/lib64/openssl11. Unfortunately, the existing --with-ssl and --with-crypto ./configure options expect to point to a source tree and don't work in this situation. Also unfortunately, the checks in ./configure don't use pkg-config. In order to make this work with the existing situation, you'd have to run... ./configure --with-ssl=/usr/lib64/openssl11 \ --with-crypto=/usr/lib64/openssl11 \ CFLAGS=-I/usr/include/openssl11 BUT... those options don't get passed down to bundled pjproject so when you run make, you have to include the CFLAGS again which is a big pain. Oh... To make matters worse, although you can specify PJPROJECT_CONFIGURE_OPTS on the ./configure command line, they don't get saved so if you do a make clean, which will force a re-configure of bundled pjproject, those options don't get used. So... * In configure.ac... Since pkg-config is installed by install_prereq anyway, we now use it to check for the system openssl >= 1.1.0. If that works, great. If not, we check for the openssl11 package. If that works, great. If not, we fall back to just checking for any openssl. If pkg-config isn't installed for some reason, or --with-ssl=<dir> or --with-crypto=<dir> were specified on the ./configure command line, we fall back to the existing logic that uses AST_EXT_LIB_CHECK(). * The whole OpenSSL check process has been moved up before THIRD_PARTY_CONFIGURE(), which does the initial pjproject bundled configure, is run. This way the results of the above checks, which may result in new include or library directories, is included. * Although not strictly needed for openssl, We now save the value of PJPROJECT_CONFIGURE_OPTS in the makeopts file so it can be used again if a re-configure is triggered. ASTERISK-29693 Change-Id: I341ab7603e6b156aa15a66f43675ac5029d5fbde
This commit is contained in:
6
third-party/pjproject/Makefile
vendored
6
third-party/pjproject/Makefile
vendored
@@ -88,8 +88,8 @@ else
|
||||
endif
|
||||
|
||||
export PJ_CFLAGS := $(filter-out -O% -g%,$(PJ_CFLAGS))
|
||||
export CFLAGS += $(CF)
|
||||
export LDFLAGS += $(CC_LDFLAGS)
|
||||
export CFLAGS += $(CF) $(OPENSSL_INCLUDE)
|
||||
export LDFLAGS += $(CC_LDFLAGS) $(OPENSSL_LIB)
|
||||
|
||||
ECHO_PREFIX := $(ECHO_PREFIX) echo '[pjproject] '
|
||||
SHELL_ECHO_PREFIX := echo '[pjproject] '
|
||||
@@ -129,7 +129,7 @@ source/pjlib/include/pj/%.h: patches/%.h
|
||||
$(CMD_PREFIX) $(MAKE) clean $(REALLY_QUIET)
|
||||
|
||||
source/build.mak: Makefile.rules source/version.mak source/user.mak $(addprefix source/pjlib/include/pj/,$(notdir $(wildcard patches/*.h))) .rebuild_needed
|
||||
$(ECHO_PREFIX) Configuring with $(PJPROJECT_CONFIG_OPTS)
|
||||
$(ECHO_PREFIX) Configuring with $(PJPROJECT_CONFIG_OPTS)
|
||||
$(CMD_PREFIX) (cd source ; ./aconfigure $(QUIET_CONFIGURE) $(PJPROJECT_CONFIG_OPTS))
|
||||
|
||||
build.mak: source/build.mak
|
||||
|
1
third-party/pjproject/configure.m4
vendored
1
third-party/pjproject/configure.m4
vendored
@@ -117,6 +117,7 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
|
||||
AC_SUBST([PBX_PJPROJECT])
|
||||
AC_SUBST([PJPROJECT_LIB])
|
||||
AC_SUBST([PJPROJECT_INCLUDE])
|
||||
AC_SUBST([PJPROJECT_CONFIGURE_OPTS])
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
fi
|
||||
|
Reference in New Issue
Block a user