Add libjwt to third-party

The current STIR/SHAKEN implementation is not currently usable due
to encryption issues. Rather than trying to futz with OpenSSL and
the the current code, we can take advantage of the existing
capabilities of libjwt but we first need to add it to the
third-party infrastructure already in place for jansson and
pjproject.

A few tweaks were also made to the third-party infrastructure as
a whole.  The jansson "dest" install directory was renamed "dist"
to better match convention, and the third-party Makefile was updated
to clean all product directories not just the ones currently in
use.

Resolves: #349
(cherry picked from commit d7a6116681)
This commit is contained in:
George Joseph 2023-09-21 11:12:31 -06:00 committed by Asterisk Development Team
parent 893483f915
commit cfc6832062
19 changed files with 10083 additions and 11751 deletions

View File

@ -28,6 +28,7 @@ URIPARSER=@PBX_URIPARSER@
KQUEUE=@PBX_KQUEUE@
LDAP=@PBX_LDAP@
LIBEDIT=@PBX_LIBEDIT@
LIBJWT=@PBX_LIBJWT@
LIBXML2=@PBX_LIBXML2@
LIBXSLT=@PBX_LIBXSLT@
XMLSTARLET=@PBX_XMLSTARLET@

17940
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -463,6 +463,15 @@ if test "${with_pjproject}" = "no" || test "${with_pjproject}" = "n" ; then
PJPROJECT_BUNDLED=no
fi
LIBJWT_BUNDLED=no
AC_ARG_WITH([libjwt-bundled],
[AS_HELP_STRING([--with-libjwt-bundled],
[Use bundled libjwt library])],
[case "${withval}" in
y|ye|yes) LIBJWT_BUNDLED=yes ;;
*) LIBJWT_BUNDLED=no ;;
esac])
#
# OpenSSL stuff has to be done here because we want to pass
# any resulting CFLAGS and LDFLAGS to the bundled pjproject
@ -553,6 +562,7 @@ AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap])
AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit])
AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit])
AST_EXT_LIB_SETUP([LIBJWT], [LIBJWT], [libjwt])
AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
@ -736,6 +746,14 @@ else
PBX_JANSSON=1
fi
source ./third-party/versions.mak
# Find required JWT support if bundled is not enabled.
if test "$LIBJWT_BUNDLED" = "no" ; then
AST_PKG_CONFIG_CHECK([LIBJWT], [libjwt >= $LIBJWT_VERSION])
else
PBX_LIBJWT=1
fi
# See if clock_gettime is in librt
AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], [])

View File

@ -19,14 +19,19 @@
of a mutex to its initializer. */
#undef CAN_COMPARE_MUTEX_TO_INIT_VALUE
/* Define to 1 if the `closedir' function returns void instead of int. */
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
/* Some configure tests will unexpectedly fail if configure is run by a
non-root user. These may be able to be tested at runtime. */
#undef CONFIGURE_RAN_AS_ROOT
/* Define to 1 if using 'alloca.c'. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if anonymous semaphores work. */
@ -38,10 +43,11 @@
/* Define to 1 if you have the `acosl' function. */
#undef HAVE_ACOSL
/* Define to 1 if you have 'alloca', as a function or macro. */
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if <alloca.h> works. */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <arpa/inet.h> header file. */
@ -426,6 +432,12 @@
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
/* Define if your system has the LIBJWT libraries. */
#undef HAVE_LIBJWT
/* Define if your system has LIBJWT_BUNDLED */
#undef HAVE_LIBJWT_BUNDLED
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
@ -496,12 +508,12 @@
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <minix/config.h> header file. */
#undef HAVE_MINIX_CONFIG_H
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
@ -1241,9 +1253,6 @@
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define to 1 if you have the <winsock2.h> header file. */
#undef HAVE_WINSOCK2_H
@ -1398,9 +1407,7 @@
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
@ -1413,93 +1420,32 @@
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable general extensions on macOS. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable X/Open compliant socket functions that do not require linking
with -lxnet on HP-UX 11.11. */
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
# undef _HPUX_ALT_XOPEN_SOCKET_API
#endif
/* Identify the host operating system as Minix.
This macro does not affect the system headers' behavior.
A future release of Autoconf may stop defining this macro. */
#ifndef _MINIX
# undef _MINIX
#endif
/* Enable general extensions on NetBSD.
Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# undef _NETBSD_SOURCE
#endif
/* Enable OpenBSD compatibility extensions on NetBSD.
Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# undef _OPENBSD_SOURCE
#endif
/* Define to 1 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_SOURCE
# undef _POSIX_SOURCE
#endif
/* Define to 2 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_1_SOURCE
# undef _POSIX_1_SOURCE
#endif
/* Enable POSIX-compatible threading on Solaris. */
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
# undef __STDC_WANT_IEC_60559_BFP_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# undef __STDC_WANT_IEC_60559_DFP_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
#endif
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
#endif
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
#ifndef __STDC_WANT_LIB_EXT2__
# undef __STDC_WANT_LIB_EXT2__
#endif
/* Enable extensions specified by ISO/IEC 24747:2009. */
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
# undef __STDC_WANT_MATH_SPEC_FUNCS__
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable X/Open extensions. Define to 500 only if necessary
to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define to 1 if running on Darwin. */
#undef _DARWIN_UNLIMITED_SELECT
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@ -1517,6 +1463,16 @@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
@ -1538,7 +1494,7 @@
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define as a signed integer type capable of holding a process identifier. */
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */

View File

@ -186,6 +186,11 @@ JANSSON_BUNDLED=@JANSSON_BUNDLED@
JANSSON_INCLUDE=@JANSSON_INCLUDE@
JANSSON_LIB=@JANSSON_LIB@
LIBJWT_BUNDLED=@LIBJWT_BUNDLED@
LIBJWT_INCLUDE=@LIBJWT_INCLUDE@
LIBJWT_LIB=@LIBJWT_LIB@
LIBJWT_CONFIGURE_OPTS=@LIBJWT_CONFIGURE_OPTS@
URIPARSER_INCLUDE=@URIPARSER_INCLUDE@
URIPARSER_LIB=@URIPARSER_LIB@

View File

@ -4,13 +4,19 @@
#define MENUSELECT_AUTOCONFIG_H
/* Define to 1 if using 'alloca.c'. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have 'alloca', as a function or macro. */
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if <alloca.h> works. */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the `asprintf' function. */
@ -31,6 +37,9 @@
/* Define if your system has the LIBXML2 libraries. */
#undef HAVE_LIBXML2
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the ncurses library. */
#undef HAVE_NCURSES
@ -43,9 +52,6 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@ -111,9 +117,7 @@
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to `unsigned int' if <sys/types.h> does not define. */

3432
menuselect/configure vendored

File diff suppressed because it is too large Load Diff

29
third-party/Makefile vendored
View File

@ -2,6 +2,8 @@
-include ../makeopts
include Makefile.rules
TP_ALL_SUBDIRS := jansson pjproject libjwt
TP_SUBDIRS :=
# Sub directories that contain special install/uninstall targets must be explicitly listed
# to prevent accidentally running the package's default install target.
@ -17,18 +19,31 @@ TP_SUBDIRS += jansson
TP_INSTALL_SUBDIRS += jansson
endif
.PHONY: all dist-clean distclean install clean moduleinfo makeopts uninstall $(TP_SUBDIRS)
ifneq ($(TP_SUBDIRS),)
ifeq ($(LIBJWT_BUNDLED),yes)
TP_SUBDIRS += libjwt
TP_INSTALL_SUBDIRS += libjwt
libjwt: jansson
export JANSSON_CFLAGS=$(JANSSON_INCLUDE)
export JANSSON_LIBS=$(JANSSON_LIB)
endif
override MAKECMDGOALS?=all
MAKECMDGOALS:=$(subst dist-clean,distclean,$(MAKECMDGOALS))
all distclean dist-clean install uninstall clean : $(TP_SUBDIRS)
install uninstall: $(TP_INSTALL_SUBDIRS)
.PHONY: all dist-clean distclean install clean moduleinfo makeopts uninstall $(TP_ALL_SUBDIRS)
$(TP_SUBDIRS):
ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
distclean dist-clean clean : $(TP_ALL_SUBDIRS)
TP_RUN_SUBDIRS := $(TP_ALL_SUBDIRS)
else
all install uninstall : $(TP_SUBDIRS)
install uninstall: $(TP_INSTALL_SUBDIRS)
TP_RUN_SUBDIRS := $(TP_SUBDIRS)
endif
ifneq ($(TP_RUN_SUBDIRS),)
$(TP_RUN_SUBDIRS):
+$(CMD_PREFIX) $(SUBMAKE) -C $@ $(MAKECMDGOALS)
endif

View File

@ -7,4 +7,5 @@ AC_DEFUN([THIRD_PARTY_CONFIGURE],
[
JANSSON_CONFIGURE()
PJPROJECT_CONFIGURE()
LIBJWT_CONFIGURE()
])

View File

@ -1,4 +1,4 @@
source/
dest/
dist/
**.bz2
.rebuild_needed

View File

@ -39,7 +39,7 @@ ifeq ($(SPECIAL_TARGETS),)
$(warning ASTTOPDIR/menuselect hasn't been run yet. Can't find debug options.)
endif
all: dest/include/jansson.h
all: dist/usr/lib/libjansson.a
else
all:
endif
@ -57,10 +57,10 @@ endif
ECHO_PREFIX := $(ECHO_PREFIX) echo '[jansson] '
SHELL_ECHO_PREFIX := echo '[jansson] '
dest/include/jansson.h: source/config.status
dist/usr/lib/libjansson.a: source/config.status
$(ECHO_PREFIX) Building bundled jansson.
$(CMD_PREFIX) (cd source; make $(REALLY_QUIET))
$(CMD_PREFIX) (cd source; make install DESTDIR= $(REALLY_QUIET))
$(CMD_PREFIX) (cd source; make install DESTDIR=$(JANSSON_DIR)/dist $(REALLY_QUIET))
.DELETE_ON_ERROR:
@ -87,7 +87,7 @@ source/.unpacked: $(DOWNLOAD_DIR)/$(TARBALL_FILE)
source/config.status: source/.unpacked Makefile.rules .rebuild_needed
$(ECHO_PREFIX) Configuring
$(CMD_PREFIX) (cd source ; ./configure $(QUIET_CONFIGURE) $(JANSSON_CONFIG_OPTS) --disable-shared \
--enable-static --prefix=$(JANSSON_DIR)/dest --libdir=$(JANSSON_DIR)/dest/lib CFLAGS="$(OPTIMIZE_CFLAGS)")
--enable-static --prefix=/usr --libdir=/usr/lib CFLAGS="$(OPTIMIZE_CFLAGS) -fPIC")
configure: source/config.status
@ -96,8 +96,9 @@ uninstall:
clean:
$(ECHO_PREFIX) Cleaning
+-$(CMD_PREFIX) rm -rf dist
+-$(CMD_PREFIX) test -d source && $(SUBMAKE) -C source clean $(REALLY_QUIET) || :
distclean:
$(ECHO_PREFIX) Distcleaning
-$(CMD_PREFIX) rm -rf source jansson-*.tar.bz2 .rebuild_needed
-$(CMD_PREFIX) rm -rf dist source jansson-*.tar.bz2 .rebuild_needed

View File

@ -69,9 +69,9 @@ AC_DEFUN([_JANSSON_CONFIGURE],
AC_MSG_CHECKING(for bundled jansson)
JANSSON_INCLUDE=-I${JANSSON_DIR}/dest/include
JANSSON_INCLUDE=-I${JANSSON_DIR}/dist/usr/include
JANSSON_CFLAGS="$JANSSON_INCLUDE"
JANSSON_LIB="-L${JANSSON_DIR}/dest/lib -ljansson"
JANSSON_LIB="-L${JANSSON_DIR}/dist/usr/lib -ljansson"
PBX_JANSSON=1
# We haven't run install yet

4
third-party/libjwt/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
source/
dist/
**.gz
.rebuild_needed

124
third-party/libjwt/Makefile vendored Normal file
View File

@ -0,0 +1,124 @@
.PHONY: all install clean distclean configure
.NOTPARALLEL:
include ../versions.mak
export LIBJWT_DIR := $(shell pwd -P)
JANSSON_DIR := $(shell realpath $(LIBJWT_DIR)/../jansson)
SPECIAL_TARGETS :=
ifneq ($(findstring configure,$(MAKECMDGOALS)),)
# Run from $(ASTTOPDIR)/configure
SPECIAL_TARGETS += configure
endif
ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
# clean or distclean
SPECIAL_TARGETS += clean
endif
ifeq ($(findstring uninstall,$(MAKECMDGOALS)),uninstall)
SPECIAL_TARGETS += uninstall
endif
ifneq ($(wildcard ../../makeopts),)
include ../../makeopts
endif
ifeq ($(SPECIAL_TARGETS),)
# Run locally or from $(ASTTOPDIR)/Makefile. All include files should be present
ifeq ($(wildcard ../../makeopts),)
$(error ASTTOPDIR/configure hasn't been run)
endif
ifeq ($(LIBJWT_BUNDLED),yes)
ifneq ($(wildcard ../../menuselect.makeopts),)
include ../../menuselect.makeopts
else
$(warning ASTTOPDIR/menuselect hasn't been run yet. Can't find debug options.)
endif
all: dist/usr/lib/libjwt.a
else
all:
endif
endif
include ../../Makefile.rules
include ../Makefile.rules
include Makefile.rules
OPTIMIZE_CFLAGS = -g3
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
OPTIMIZE_CFLAGS += $(OPTIMIZE)
endif
ECHO_PREFIX := $(ECHO_PREFIX) echo '[libjwt] '
SHELL_ECHO_PREFIX := echo '[libjwt] '
dist/usr/lib/libjwt.a: source/config.status
$(ECHO_PREFIX) Building bundled libjwt.
$(CMD_PREFIX) (cd source; make $(REALLY_QUIET))
$(CMD_PREFIX) (cd source; make install DESTDIR=$(LIBJWT_DIR)/dist $(REALLY_QUIET))
ifeq ($(JANSSON_BUNDLED),yes)
# Modules that need to use json manipulation functions will do
# so through the ast_json wrappers which cause the main asterisk
# executable to link to either the system implementation of jansson
# or the bundled jansson. libjwt also needs to call jansson functions
# directly and if we're not using the bundled version of jansson,
# this works fine bcause the dynamic linker can get the symbols
# directly from the system-installed version of jansson when the
# module using libjwt loads. If we're using bundled jansson however,
# those symbols exist only in the main asterisk executable and a
# library can't resolve against them. The result is that a module
# making jwt_ calls will fail to load at runtime with unresolved
# json_ symbols. To address this, we create a combined library
# containing both bundled libjwt and bundled jansson so a module
# will have all symbols resolved correctly.
$(CMD_PREFIX) mv dist/usr/lib/libjwt.a dist/usr/lib/libjwt_orig.a
$(CMD_PREFIX) cd dist/usr/lib ; $(AR) -rcsT libjwt.a libjwt_orig.a \
$(JANSSON_DIR)/dist/usr/lib/libjansson.a
endif
.DELETE_ON_ERROR:
$(DOWNLOAD_DIR)/$(TARBALL_FILE): ../versions.mak
$(CMD_PREFIX) ($(TARBALL_EXISTS) && $(TARBALL_VERIFY) && touch $@) || (rm -rf $@ ;\
$(TARBALL_DOWNLOAD)) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
source/.unpacked: $(DOWNLOAD_DIR)/$(TARBALL_FILE)
$(CMD_PREFIX) $(TARBALL_VERIFY) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
$(ECHO_PREFIX) Unpacking $<
-@rm -rf source libjwt-*/ >/dev/null 2>&1
$(CMD_PREFIX) $(TAR) -xf $<
@mv libjwt-$(LIBJWT_VERSION) source
$(ECHO_PREFIX) Applying patches "$(realpath patches)" "$(realpath .)/source"
$(CMD_PREFIX) ../apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"
-@touch source/.unpacked
.rebuild_needed: $(wildcard ../../.lastclean)
$(ECHO_PREFIX) Rebuilding
$(CMD_PREFIX) $(MAKE) clean $(REALLY_QUIET)
source/config.status: source/.unpacked Makefile.rules .rebuild_needed
$(ECHO_PREFIX) Configuring
$(CMD_PREFIX) (cd source ; ./configure $(QUIET_CONFIGURE) $(LIBJWT_CONFIG_OPTS) --disable-shared \
--enable-static --prefix=/usr --libdir=/usr/lib CFLAGS="$(OPTIMIZE_CFLAGS) -fPIC")
configure: source/config.status
install:
uninstall:
clean:
$(ECHO_PREFIX) Cleaning
+-$(CMD_PREFIX) rm -rf dist
+-$(CMD_PREFIX) test -d source && $(SUBMAKE) -C source clean $(REALLY_QUIET) || :
distclean:
$(ECHO_PREFIX) Distcleaning
-$(CMD_PREFIX) rm -rf dist source libjwt-*.tar.gz .rebuild_needed

9
third-party/libjwt/Makefile.rules vendored Normal file
View File

@ -0,0 +1,9 @@
PACKAGE_URL ?= https://raw.githubusercontent.com/asterisk/third-party/master/libjwt/$(LIBJWT_VERSION)
TARBALL_FILE = libjwt-$(LIBJWT_VERSION).tar.gz
# LIBJWT_CONFIGURE_OPTS could come from the command line or could be
# set/modified by configure.m4 if the build or host tuples aren't the same
# as the current build environment (cross-compile).
LIBJWT_CONFIG_OPTS = --disable-doxygen-doc --disable-doxygen-dot --without-examples $(LIBJWT_CONFIGURE_OPTS)

95
third-party/libjwt/configure.m4 vendored Normal file
View File

@ -0,0 +1,95 @@
#
# If this file is changed, be sure to run ASTTOPDIR/bootstrap.sh
# before committing.
#
AC_DEFUN([_LIBJWT_CONFIGURE],
[
if test "${ac_mandatory_list#*LIBJWT*}" != "$ac_mandatory_list" ; then
AC_MSG_ERROR(--with-libjwt and --with-libjwt-bundled can't both be specified)
fi
ac_mandatory_list="$ac_mandatory_list LIBJWT"
LIBJWT_DIR="${ac_pwd}/third-party/libjwt"
AC_MSG_CHECKING(for embedded libjwt (may have to download))
AC_MSG_RESULT(configuring)
if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
AC_MSG_ERROR(A download utility (wget, curl, or fetch) is required to download bundled libjwt)
fi
if test "${GZIP}" = ":" ; then
AC_MSG_ERROR(gzip is required to extract the libjwt tar file)
fi
if test "${TAR}" = ":" ; then
AC_MSG_ERROR(tar is required to extract the libjwt tar file)
fi
if test "${PATCH}" = ":" ; then
AC_MSG_ERROR(patch is required to configure bundled libjwt)
fi
if test "${SED}" = ":" ; then
AC_MSG_ERROR(sed is required to configure bundled libjwt)
fi
if test "${NM}" = ":" ; then
AC_MSG_ERROR(nm is required to build bundled libjwt)
fi
if test "${MD5}" = ":" ; then
AC_MSG_ERROR(md5sum is required to build bundled libjwt)
fi
if test "${CAT}" = ":" ; then
AC_MSG_ERROR(cat is required to build bundled libjwt)
fi
if test "${CUT}" = ":" ; then
AC_MSG_ERROR(cut is required to build bundled libjwt)
fi
if test "${GREP}" = ":" ; then
AC_MSG_ERROR(grep is required to build bundled libjwt)
fi
AC_ARG_VAR([LIBJWT_CONFIGURE_OPTS],[Additional configure options to pass to bundled libjwt])
this_host=$(./config.sub $(./config.guess))
if test "$build" != "$this_host" ; then
LIBJWT_CONFIGURE_OPTS+=" --build=$build_alias"
fi
if test "$host" != "$this_host" ; then
LIBJWT_CONFIGURE_OPTS+=" --host=$host_alias"
fi
export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
export NOISY_BUILD
export JANSSON_CFLAGS
export JANSSON_LIBS="${JANSSON_LIB}"
${GNU_MAKE} --quiet --no-print-directory -C ${LIBJWT_DIR} \
LIBJWT_CONFIGURE_OPTS="$LIBJWT_CONFIGURE_OPTS" \
EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \
configure
if test $? -ne 0 ; then
AC_MSG_RESULT(failed)
AC_MSG_NOTICE(Unable to configure ${LIBJWT_DIR})
AC_MSG_ERROR(Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details.)
fi
AC_MSG_CHECKING(for bundled libjwt)
LIBJWT_INCLUDE=-I${LIBJWT_DIR}/dist/usr/include
LIBJWT_CFLAGS="$LIBJWT_INCLUDE"
LIBJWT_LIB="-L${LIBJWT_DIR}/dist/usr/lib -ljwt"
PBX_LIBJWT=1
# We haven't run install yet
AC_SUBST([LIBJWT_BUNDLED])
AC_SUBST([PBX_LIBJWT])
AC_SUBST([LIBJWT_LIB])
AC_SUBST([LIBJWT_INCLUDE])
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_LIBJWT_BUNDLED], 1, [Define if your system has LIBJWT_BUNDLED])
])
AC_DEFUN([LIBJWT_CONFIGURE],
[
if test "$LIBJWT_BUNDLED" = "yes" ; then
_LIBJWT_CONFIGURE()
fi
])

View File

@ -0,0 +1 @@
f417ef3fe6ee14c0befd86e6836dc4c9 libjwt-1.15.3.tar.gz

4
third-party/libjwt/patches/README vendored Normal file
View File

@ -0,0 +1,4 @@
Patches should be added here once merged to the upstream libjwt project at
https://github.com/benmcollins/libjwt. Patch filenames should be generated by
running 'git format-patch ...' from the libjwt repository, then
copying the required patches to this folder.

View File

@ -1,2 +1,6 @@
JANSSON_VERSION = 2.14
PJPROJECT_VERSION = 2.13.1
# This file is also 'sourced' by the
# configure script so it must follow 'shell'
# syntax as well as 'make' syntax.
JANSSON_VERSION=2.14
PJPROJECT_VERSION=2.13.1
LIBJWT_VERSION=1.15.3