From 29a47eaada471cff66ae87952146daeed6531b72 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 1 Feb 2021 07:59:11 -0500 Subject: [PATCH] update packer scripts to build debian buster, update feature server ami to latest freeswitch 0 v1.10.5+open source modules --- packer/jambonz-feature-server/README.md | 2 +- .../files/Makefile.am.extra | 1019 ++++++++ .../files/Makefile.am.grpc.patch | 175 -- .../files/Makefile.am.patch | 24 - .../files/configure.ac.extra | 2201 +++++++++++++++++ .../files/configure.ac.grpc.patch | 33 - .../files/configure.ac.patch | 40 - .../files/modules.conf.in.extra | 180 ++ .../files/modules.conf.in.grpc.patch | 10 - .../files/modules.conf.in.patch | 139 -- .../files/modules.conf.patch | 118 - ...ml.grpc => modules.conf.vanilla.xml.extra} | 2 + .../files/modules.conf.vanilla.xml.grpc.patch | 12 - .../files/modules.conf.vanilla.xml.lws | 147 -- .../files/modules.conf.vanilla.xml.patch | 105 - .../files/rtpengine.service | 42 - .../files/switch_rtp.c.patch | 40 + .../files/vanilla_modules.conf.xml.patch | 105 - .../scripts/install_freeswitch.sh | 106 +- packer/jambonz-feature-server/template.json | 10 +- .../scripts/install_postgresql.sh | 4 +- packer/jambonz-monitoring/template.json | 6 +- packer/jambonz-sbc-sip-rtp/template.json | 10 +- packer/jambonz-sbc-sip/template.json | 2 +- 24 files changed, 3521 insertions(+), 1011 deletions(-) create mode 100644 packer/jambonz-feature-server/files/Makefile.am.extra delete mode 100644 packer/jambonz-feature-server/files/Makefile.am.grpc.patch delete mode 100644 packer/jambonz-feature-server/files/Makefile.am.patch create mode 100644 packer/jambonz-feature-server/files/configure.ac.extra delete mode 100644 packer/jambonz-feature-server/files/configure.ac.grpc.patch delete mode 100644 packer/jambonz-feature-server/files/configure.ac.patch create mode 100644 packer/jambonz-feature-server/files/modules.conf.in.extra delete mode 100644 packer/jambonz-feature-server/files/modules.conf.in.grpc.patch delete mode 100644 packer/jambonz-feature-server/files/modules.conf.in.patch delete mode 100644 packer/jambonz-feature-server/files/modules.conf.patch rename packer/jambonz-feature-server/files/{modules.conf.vanilla.xml.grpc => modules.conf.vanilla.xml.extra} (98%) delete mode 100644 packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc.patch delete mode 100644 packer/jambonz-feature-server/files/modules.conf.vanilla.xml.lws delete mode 100644 packer/jambonz-feature-server/files/modules.conf.vanilla.xml.patch delete mode 100644 packer/jambonz-feature-server/files/rtpengine.service create mode 100644 packer/jambonz-feature-server/files/switch_rtp.c.patch delete mode 100644 packer/jambonz-feature-server/files/vanilla_modules.conf.xml.patch diff --git a/packer/jambonz-feature-server/README.md b/packer/jambonz-feature-server/README.md index 93a882a..406bfe2 100644 --- a/packer/jambonz-feature-server/README.md +++ b/packer/jambonz-feature-server/README.md @@ -17,7 +17,7 @@ There are many variables that can be specified on the `packer build` command lin The region to create the AMI in ``` -"ami_description": "EC2 AMI jambonz mini" +"ami_description": "jambonz feature server" ``` AMI description. diff --git a/packer/jambonz-feature-server/files/Makefile.am.extra b/packer/jambonz-feature-server/files/Makefile.am.extra new file mode 100644 index 0000000..61b4d02 --- /dev/null +++ b/packer/jambonz-feature-server/files/Makefile.am.extra @@ -0,0 +1,1019 @@ +EXTRA_DIST = +SUBDIRS = . src build tests/unit +AUTOMAKE_OPTIONS = foreign subdir-objects +NAME = freeswitch + +if SYSTEM_APR +AM_LIBAPR_CFLAGS := $(shell apr-1-config --cflags) +AM_LIBAPR_CPPFLAGS := $(shell apr-1-config --cppflags --includes) +AM_LIBAPR_LDFLAGS := $(shell apr-1-config --ldflags) +AM_LIBAPR_LIBS := $(shell apr-1-config \--libs) +AM_LIBAPR_LINKLIBTOOL := $(shell apr-1-config \--link-libtool) +else +AM_LIBAPR_CFLAGS := $(shell ./libs/apr/apr-1-config --cflags) +AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes) +AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags) +AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs)) +endif +if SYSTEM_APRUTIL +AM_LIBAPU_CPPFLAGS := $(shell apu-1-config --includes) +AM_LIBAPU_LDFLAGS := $(shell apu-1-config --ldflags) +AM_LIBAPU_LIBS := $(shell apu-1-config \--libs) +AM_LIBAPU_LINKLIBTOOL := $(shell apu-1-config \--link-libtool) +else +AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes) +AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags) +AM_LIBAPU_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr-util/apu-1-config \--libs)) +endif + + +AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) +AM_CPPFLAGS = +AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx +AM_CPPFLAGS += $(SWITCH_AM_CXXFLAGS) +AM_LDFLAGS = $(SWITCH_AM_LDFLAGS) $(AM_LIBAPR_LDFLAGS) $(AM_LIBAPU_LDFLAGS) + +DEFAULT_SOUNDS=en-us-callie-8000 +MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" + +.INTERMEDIATE: -ldl -liconv -lpthread + +.DEFAULT: $(switch_builddir)/modules.conf src/mod/modules.inc + @target=`echo $@ | sed -e 's|^.*-||'`; \ + target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \ + sound_perfix=`echo $@ | sed -e 's|-.*||'`; \ + moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\ + full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \ + test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \ + base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\ + sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\ + soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \ + echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \ + args="$@"; if test -z "$$args" || test "$${args#-l*}" = "$$args"; then \ + if test "$$target_prefix" = "sounds"; then \ + if test "$$target" = "install"; then \ + $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/;\ + else \ + $(GETSOUNDS) $$soundfile ; \ + fi; \ + else \ + if test "$$target" = "install"; then \ + $(MAKE) $(AM_MAKEFLAGS) core_install && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ; \ + else \ + if test "$$target" = "clean"; then \ + cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\ + else \ + $(MAKE) $(AM_MAKEFLAGS) core && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\ + fi; \ + fi; \ + fi; fi + +sounds: sounds-en-us-callie-8000 +sounds-install: sounds-en-us-callie-8000-install +sounds-allison: sounds-en-us-allison-8000 +sounds-allison-install: sounds-en-us-allison-8000-install +sounds-ru: sounds-ru-RU-elena-8000 +sounds-ru-install: sounds-ru-RU-elena-8000-install +sounds-fr: sounds-fr-ca-june-8000 +sounds-fr-install: sounds-fr-ca-june-8000-install +moh: sounds-music-8000 +moh-install: sounds-music-8000-install + +hd-sounds: sounds sounds-en-us-callie-16000 +hd-sounds-install: sounds-install sounds-en-us-callie-16000-install +hd-sounds-allison: sounds-allison sounds-en-us-allison-16000 +hd-sounds-allison-install: sounds-allison-install sounds-en-us-allison-16000-install +hd-sounds-ru: sounds-ru sounds-ru-RU-elena-16000 +hd-sounds-ru-install: sounds-ru-install sounds-ru-RU-elena-16000-install +hd-sounds-fr: sounds-fr-ca-june-16000 +hd-sounds-fr-install: sounds-fr-ca-june-16000-install +hd-moh: moh sounds-music-16000 +hd-moh-install: moh-install sounds-music-16000-install + +uhd-sounds: hd-sounds sounds-en-us-callie-32000 +uhd-sounds-install: hd-sounds-install sounds-en-us-callie-32000-install +uhd-sounds-allison: hd-sounds-allison sounds-en-us-allison-32000 +uhd-sounds-allison-install: hd-sounds-allison-install sounds-en-us-allison-32000-install +uhd-sounds-ru: hd-sounds-ru sounds-ru-RU-elena-32000 +uhd-sounds-ru-install: hd-sounds-ru-install sounds-ru-RU-elena-32000-install +uhd-sounds-fr: sounds-fr-ca-june-32000 +uhd-sounds-fr-install: sounds-fr-ca-june-32000-install +uhd-moh: hd-moh sounds-music-32000 +uhd-moh-install: hd-moh-install sounds-music-32000-install + +cd-sounds: uhd-sounds sounds-en-us-callie-48000 +cd-sounds-install: uhd-sounds-install sounds-en-us-callie-48000-install +cd-sounds-allison: uhd-sounds-allison sounds-en-us-allison-48000 +cd-sounds-allison-install: uhd-sounds-allison-install sounds-en-us-allison-48000-install +cd-sounds-ru: uhd-sounds-ru sounds-ru-RU-elena-48000 +cd-sounds-ru-install: uhd-sounds-ru-install sounds-ru-RU-elena-48000-install +cd-sounds-fr: sounds-fr-ca-june-48000 +cd-sounds-fr-install: sounds-fr-ca-june-48000-install +cd-moh: uhd-moh sounds-music-48000 +cd-moh-install: uhd-moh-install sounds-music-48000-install + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +all-recursive: libfreeswitch.la +clean-recusive: clean_core +install-recursive: install-libLTLIBRARIES install-binPROGRAMS + +CORE_CFLAGS = $(AM_LIBAPR_CFLAGS) $(AM_LIBAPR_CPPFLAGS) +CORE_CFLAGS += $(AM_LIBAPU_CPPFLAGS) +CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include +if ENABLE_LIBYUV +CORE_CFLAGS += -I$(switch_srcdir)/libs/libyuv/include +CORE_CFLAGS += -DSWITCH_HAVE_YUV +endif +CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include +CORE_CFLAGS += $(SPANDSP_CFLAGS) +if ENABLE_LIBVPX +CORE_CFLAGS += -DSWITCH_HAVE_VPX +endif + +APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS) +CORE_LIBS= + +if ENABLE_LIBVPX +CORE_LIBS += libs/libvpx/libvpx.a +endif +if SYSTEM_APRUTIL +CORE_LIBS += $(AM_LIBAPU_LINKLIBTOOL) +else +CORE_LIBS += libs/apr-util/libaprutil-1.la +endif +if SYSTEM_APR +CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL) +else +CORE_LIBS += libs/apr/libapr-1.la +endif + +if ENABLE_SRTP +CORE_CFLAGS += -DENABLE_SRTP +CORE_LIBS += libs/srtp/libsrtp.la +endif + +MOD_LINK = $(switch_srcdir)/libfreeswitch.la +CLEANFILES = src/include/switch_version.h src/include/switch_swigable_cpp.h +BUILT_SOURCES = src/mod/modules.inc src/include/switch_version.h src/include/switch_swigable_cpp.h + +if HAVE_ODBC +CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS) +endif + +if HAVE_PNG +CORE_CFLAGS += -DSWITCH_HAVE_PNG $(LIBPNG_CFLAGS) +endif + +if HAVE_FREETYPE +CORE_CFLAGS += -DSWITCH_HAVE_FREETYPE $(LIBFREETYPE_CFLAGS) +endif + +if HAVE_GUMBO +CORE_CFLAGS += -DSWITCH_HAVE_GUMBO $(LIBGUMBO_CFLAGS) +endif + +if HAVE_FVAD +CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS) +endif + +# DH: LWS +if HAVE_LWS +CORE_CFLAGS += -DSWITCH_HAVE_LWS $(LWS_CFLAGS) +LWS_LIBS += -lwebsockets +endif + +# DH: GRPC +if HAVE_GRPC +CORE_CFLAGS += -DSWITCH_HAVE_GRPC $(GRPC_CFLAGS) +GRPC_LIBS += -lgrpc++_reflection -lprotobuf +endif + +## +## libfreeswitch +## +noinst_LTLIBRARIES = +if ENABLE_LIBYUV +noinst_LTLIBRARIES += libfreeswitch_libyuv.la +endif + +if ENABLE_LIBYUV +libfreeswitch_libyuv_la_SOURCES = \ +libs/libyuv/source/compare.cc \ +libs/libyuv/source/compare_common.cc \ +libs/libyuv/source/compare_gcc.cc \ +libs/libyuv/source/compare_mmi.cc \ +libs/libyuv/source/compare_msa.cc \ +libs/libyuv/source/compare_neon64.cc \ +libs/libyuv/source/compare_neon.cc \ +libs/libyuv/source/compare_win.cc \ +libs/libyuv/source/convert_argb.cc \ +libs/libyuv/source/convert.cc \ +libs/libyuv/source/convert_from_argb.cc \ +libs/libyuv/source/convert_from.cc \ +libs/libyuv/source/convert_jpeg.cc \ +libs/libyuv/source/convert_to_argb.cc \ +libs/libyuv/source/convert_to_i420.cc \ +libs/libyuv/source/cpu_id.cc \ +libs/libyuv/source/mjpeg_decoder.cc \ +libs/libyuv/source/mjpeg_validate.cc \ +libs/libyuv/source/planar_functions.cc \ +libs/libyuv/source/rotate_any.cc \ +libs/libyuv/source/rotate_argb.cc \ +libs/libyuv/source/rotate.cc \ +libs/libyuv/source/rotate_common.cc \ +libs/libyuv/source/rotate_gcc.cc \ +libs/libyuv/source/rotate_mmi.cc \ +libs/libyuv/source/rotate_msa.cc \ +libs/libyuv/source/rotate_neon64.cc \ +libs/libyuv/source/rotate_neon.cc \ +libs/libyuv/source/rotate_win.cc \ +libs/libyuv/source/row_any.cc \ +libs/libyuv/source/row_common.cc \ +libs/libyuv/source/row_gcc.cc \ +libs/libyuv/source/row_mmi.cc \ +libs/libyuv/source/row_msa.cc \ +libs/libyuv/source/row_neon64.cc \ +libs/libyuv/source/row_neon.cc \ +libs/libyuv/source/row_win.cc \ +libs/libyuv/source/scale_any.cc \ +libs/libyuv/source/scale_argb.cc \ +libs/libyuv/source/scale.cc \ +libs/libyuv/source/scale_common.cc \ +libs/libyuv/source/scale_gcc.cc \ +libs/libyuv/source/scale_mmi.cc \ +libs/libyuv/source/scale_msa.cc \ +libs/libyuv/source/scale_neon64.cc \ +libs/libyuv/source/scale_neon.cc \ +libs/libyuv/source/scale_win.cc \ +libs/libyuv/source/video_common.cc + + +libfreeswitch_libyuv_la_CPPFLAGS = -O2 -fomit-frame-pointer -Ilibs/libyuv/include +CORE_LIBS+=libfreeswitch_libyuv.la +endif + +if HAVE_GRPC +GOOGLEAPIS_GENS_PATH = libs/googleapis/gens +GOOGLEAPIS_LOGGING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/logging -name '*.pb.cc') +GOOGLEAPIS_API_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/api -name '*.pb.cc') +GOOGLEAPIS_RPC_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/rpc -name '*.pb.cc') +GOOGLEAPIS_SPEECH_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/cloud/speech -name '*.pb.cc') +GOOGLEAPIS_LONGRUNNING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/longrunning -name '*.pb.cc') +GOOGLEAPIS_CCS = $(GOOGLEAPIS_API_CCS) $(GOOGLEAPIS_RPC_CCS) $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) + +nodist_libfreeswitch_libgoogleapis_la_SOURCES = \ +libs/googleapis/gens/google/api/monitoring.grpc.pb.cc \ +libs/googleapis/gens/google/api/annotations.grpc.pb.cc \ +libs/googleapis/gens/google/api/http.pb.cc \ +libs/googleapis/gens/google/api/quota.pb.cc \ +libs/googleapis/gens/google/api/quota.grpc.pb.cc \ +libs/googleapis/gens/google/api/backend.grpc.pb.cc \ +libs/googleapis/gens/google/api/service.grpc.pb.cc \ +libs/googleapis/gens/google/api/monitored_resource.pb.cc \ +libs/googleapis/gens/google/api/consumer.pb.cc \ +libs/googleapis/gens/google/api/annotations.pb.cc \ +libs/googleapis/gens/google/api/metric.pb.cc \ +libs/googleapis/gens/google/api/logging.pb.cc \ +libs/googleapis/gens/google/api/auth.grpc.pb.cc \ +libs/googleapis/gens/google/api/distribution.grpc.pb.cc \ +libs/googleapis/gens/google/api/label.grpc.pb.cc \ +libs/googleapis/gens/google/api/launch_stage.grpc.pb.cc \ +libs/googleapis/gens/google/api/launch_stage.pb.cc \ +libs/googleapis/gens/google/api/httpbody.grpc.pb.cc \ +libs/googleapis/gens/google/api/config_change.grpc.pb.cc \ +libs/googleapis/gens/google/api/logging.grpc.pb.cc \ +libs/googleapis/gens/google/api/context.pb.cc \ +libs/googleapis/gens/google/api/system_parameter.pb.cc \ +libs/googleapis/gens/google/api/distribution.pb.cc \ +libs/googleapis/gens/google/api/control.pb.cc \ +libs/googleapis/gens/google/api/consumer.grpc.pb.cc \ +libs/googleapis/gens/google/api/label.pb.cc \ +libs/googleapis/gens/google/api/documentation.pb.cc \ +libs/googleapis/gens/google/api/log.pb.cc \ +libs/googleapis/gens/google/api/usage.grpc.pb.cc \ +libs/googleapis/gens/google/api/backend.pb.cc \ +libs/googleapis/gens/google/api/control.grpc.pb.cc \ +libs/googleapis/gens/google/api/log.grpc.pb.cc \ +libs/googleapis/gens/google/api/source_info.grpc.pb.cc \ +libs/googleapis/gens/google/api/billing.pb.cc \ +libs/googleapis/gens/google/api/auth.pb.cc \ +libs/googleapis/gens/google/api/resource.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/check_error.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/check_error.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/distribution.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/distribution.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/operation.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.pb.cc \ +libs/googleapis/gens/google/api/servicecontrol/v1/operation.pb.cc \ +libs/googleapis/gens/google/api/metric.grpc.pb.cc \ +libs/googleapis/gens/google/api/monitored_resource.grpc.pb.cc \ +libs/googleapis/gens/google/api/http.grpc.pb.cc \ +libs/googleapis/gens/google/api/httpbody.pb.cc \ +libs/googleapis/gens/google/api/endpoint.pb.cc \ +libs/googleapis/gens/google/api/documentation.grpc.pb.cc \ +libs/googleapis/gens/google/api/system_parameter.grpc.pb.cc \ +libs/googleapis/gens/google/api/endpoint.grpc.pb.cc \ +libs/googleapis/gens/google/api/service.pb.cc \ +libs/googleapis/gens/google/api/source_info.pb.cc \ +libs/googleapis/gens/google/api/servicemanagement/v1/resources.grpc.pb.cc \ +libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.pb.cc \ +libs/googleapis/gens/google/api/servicemanagement/v1/resources.pb.cc \ +libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.grpc.pb.cc \ +libs/googleapis/gens/google/api/billing.grpc.pb.cc \ +libs/googleapis/gens/google/api/usage.pb.cc \ +libs/googleapis/gens/google/api/config_change.pb.cc \ +libs/googleapis/gens/google/api/context.grpc.pb.cc \ +libs/googleapis/gens/google/api/monitoring.pb.cc \ +libs/googleapis/gens/google/api/field_behavior.pb.cc \ +libs/googleapis/gens/google/api/client.pb.cc \ +libs/googleapis/gens/google/rpc/error_details.grpc.pb.cc \ +libs/googleapis/gens/google/rpc/code.pb.cc \ +libs/googleapis/gens/google/rpc/status.pb.cc \ +libs/googleapis/gens/google/rpc/status.grpc.pb.cc \ +libs/googleapis/gens/google/rpc/error_details.pb.cc \ +libs/googleapis/gens/google/rpc/code.grpc.pb.cc \ +libs/googleapis/gens/google/longrunning/operations.grpc.pb.cc \ +libs/googleapis/gens/google/longrunning/operations.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1p1beta1/cloud_speech.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.pb.cc \ +libs/googleapis/gens/google/cloud/speech/v1p1beta1/resource.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.pb.cc \ +libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc \ +libs/googleapis/gens/google/logging/type/http_request.grpc.pb.cc \ +libs/googleapis/gens/google/logging/type/log_severity.grpc.pb.cc \ +libs/googleapis/gens/google/logging/type/log_severity.pb.cc \ +libs/googleapis/gens/google/logging/type/http_request.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging_metrics.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging.grpc.pb.cc \ +libs/googleapis/gens/google/logging/v2/log_entry.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging_config.grpc.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging_config.pb.cc \ +libs/googleapis/gens/google/logging/v2/log_entry.grpc.pb.cc \ +libs/googleapis/gens/google/logging/v2/logging_metrics.grpc.pb.cc \ +libs/googleapis/gens/google/type/date.grpc.pb.cc \ +libs/googleapis/gens/google/type/timeofday.pb.cc \ +libs/googleapis/gens/google/type/latlng.grpc.pb.cc \ +libs/googleapis/gens/google/type/money.pb.cc \ +libs/googleapis/gens/google/type/date.pb.cc \ +libs/googleapis/gens/google/type/postal_address.grpc.pb.cc \ +libs/googleapis/gens/google/type/dayofweek.grpc.pb.cc \ +libs/googleapis/gens/google/type/dayofweek.pb.cc \ +libs/googleapis/gens/google/type/timeofday.grpc.pb.cc \ +libs/googleapis/gens/google/type/color.pb.cc \ +libs/googleapis/gens/google/type/postal_address.pb.cc \ +libs/googleapis/gens/google/type/latlng.pb.cc \ +libs/googleapis/gens/google/type/color.grpc.pb.cc \ +libs/googleapis/gens/google/type/money.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/gcs.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/validation_result.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.grpc.pb.cc \ +libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.pb.cc + +libfreeswitch_libgoogleapis_la_CPPFLAGS = -I/usr/local/include -I$(GOOGLEAPIS_GENS_PATH) -std=c++11 -pthread + +CORE_LIBS+=libfreeswitch_libgoogleapis.la +noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la +endif + +lib_LTLIBRARIES = libfreeswitch.la +libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) +libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(GRPC_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS) +libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) + +if HAVE_PNG +libfreeswitch_la_LIBADD += $(LIBPNG_LIBS) +endif + +if HAVE_ODBC +libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) +endif + +if ENABLE_ZRTP +CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes +CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib +CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include +ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib +ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp +ZRTP_LIBS = -lbn -lzrtp +libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS) +libfreeswitch_la_LIBADD += $(ZRTP_LIBS) +CORE_LIBS += libs/libzrtp/libzrtp.a +LIBS += libs/libzrtp/third_party/bnlib/libbn.a +endif + +library_includetestdir = $(includedir)/test +library_includetest_HEADERS = \ + src/include/test/switch_fct.h \ + src/include/test/switch_test.h + +library_includedir = $(includedir) +library_include_HEADERS = \ + src/include/switch_am_config.h \ + src/include/switch.h \ + src/include/switch_apr.h \ + src/include/switch_buffer.h \ + src/include/switch_caller.h \ + src/include/switch_channel.h \ + src/include/switch_console.h \ + src/include/switch_core_event_hook.h \ + src/include/switch_scheduler.h \ + src/include/switch_core.h \ + src/include/switch_core_media.h \ + src/include/switch_core_video.h \ + src/include/switch_core_db.h \ + src/include/switch_mprintf.h \ + src/include/switch_config.h \ + src/include/switch_event.h \ + src/include/switch_frame.h \ + src/include/switch_ivr.h \ + src/include/switch_dso.h \ + src/include/switch_loadable_module.h \ + src/include/switch_module_interfaces.h \ + src/include/switch_platform.h \ + src/include/switch_resample.h \ + src/include/switch_regex.h \ + src/include/switch_types.h \ + src/include/switch_utils.h \ + src/include/switch_rtp.h \ + src/include/switch_jitterbuffer.h \ + src/include/switch_estimators.h \ + src/include/switch_rtcp_frame.h \ + src/include/switch_stun.h \ + src/include/switch_nat.h \ + src/include/switch_log.h \ + src/include/switch_xml.h \ + src/include/switch_xml_config.h \ + src/include/switch_cpp.h \ + src/include/switch_curl.h \ + src/include/switch_cJSON.h \ + src/include/switch_cJSON_Utils.h \ + src/include/switch_json.h \ + src/include/switch_utf8.h \ + src/include/switch_msrp.h \ + src/include/switch_vpx.h \ + src/include/switch_vad.h \ + libs/libteletone/src/libteletone_detect.h \ + libs/libteletone/src/libteletone_generate.h \ + libs/libteletone/src/libteletone.h \ + src/include/switch_limit.h \ + src/include/switch_odbc.h \ + src/include/switch_hashtable.h \ + src/include/switch_image.h + +nodist_libfreeswitch_la_SOURCES = \ + src/include/switch_frame.h \ + src/include/switch_swigable_cpp.h \ + src/include/switch_version.h + +libfreeswitch_la_SOURCES = \ + src/switch_apr.c \ + src/switch_buffer.c \ + src/switch_caller.c \ + src/switch_channel.c \ + src/switch_console.c \ + src/switch_mprintf.c \ + src/switch_core_media_bug.c \ + src/switch_core_timer.c \ + src/switch_core_asr.c \ + src/switch_core_event_hook.c \ + src/switch_core_speech.c \ + src/switch_core_memory.c \ + src/switch_core_codec.c \ + src/switch_core_file.c \ + src/switch_core_cert.c \ + src/switch_core_hash.c \ + src/switch_core_sqldb.c \ + src/switch_core_session.c \ + src/switch_core_directory.c \ + src/switch_core_state_machine.c \ + src/switch_core_io.c \ + src/switch_core_rwlock.c \ + src/switch_core_port_allocator.c \ + src/switch_core.c \ + src/switch_version.c \ + src/switch_core_media.c \ + src/switch_core_video.c \ + src/switch_sdp.c \ + src/switch_scheduler.c \ + src/switch_core_db.c \ + src/switch_dso.c \ + src/switch_loadable_module.c \ + src/switch_utils.c \ + src/switch_event.c \ + src/switch_resample.c \ + src/switch_regex.c \ + src/switch_rtp.c \ + src/switch_jitterbuffer.c \ + src/switch_estimators.c \ + src/switch_ivr_bridge.c \ + src/switch_ivr_originate.c \ + src/switch_ivr_async.c \ + src/switch_ivr_play_say.c \ + src/switch_ivr_say.c \ + src/switch_ivr_menu.c \ + src/switch_ivr.c \ + src/switch_stun.c \ + src/switch_nat.c \ + src/switch_log.c \ + src/switch_xml.c \ + src/switch_xml_config.c \ + src/switch_config.c \ + src/switch_time.c \ + src/switch_odbc.c \ + src/switch_limit.c \ + src/g711.c \ + src/switch_pcm.c \ + src/switch_speex.c \ + src/switch_profile.c \ + src/cJSON.c \ + src/cJSON_Utils.c \ + src/switch_json.c \ + src/switch_curl.c \ + src/switch_hashtable.c\ + src/switch_utf8.c \ + src/switch_msrp.c \ + src/switch_vad.c \ + src/switch_vpx.c \ + libs/libteletone/src/libteletone_detect.c \ + libs/libteletone/src/libteletone_generate.c \ + libs/miniupnpc/miniwget.c \ + libs/miniupnpc/minixml.c \ + libs/miniupnpc/igd_desc_parse.c \ + libs/miniupnpc/minisoap.c \ + libs/miniupnpc/miniupnpc.c \ + libs/miniupnpc/upnpreplyparse.c \ + libs/miniupnpc/upnpcommands.c \ + libs/miniupnpc/minissdpc.c \ + libs/miniupnpc/upnperrors.c \ + libs/libnatpmp/natpmp.c \ + libs/libnatpmp/getgateway.c + +if ENABLE_CPP +libfreeswitch_la_SOURCES += src/switch_cpp.cpp +endif + +$(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf + +src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h + cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h +# $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \ +# -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \ +# -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \ +# -DSWITCH_DECLARE_NONSTD\(x\)=x 2>/dev/null | grep -v "^#" > src/include/switch_swigable_cpp.h + +## +## Applications +## +bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode fs_tts + +## +## fs_cli () +## +fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \ + libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c +fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS) +fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS) + +if DISABLE_CC +fs_cli_CFLAGS += -DDISABLE_CC +endif + +## +## fs_encode () +## +fs_encode_SOURCES = src/fs_encode.c +fs_encode_CFLAGS = $(AM_CFLAGS) +fs_encode_LDFLAGS = $(AM_LDFLAGS) +fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) + +if HAVE_ODBC +fs_encode_LDADD += $(ODBC_LIB_FLAGS) +endif + +## +## fs_tts () +## +fs_tts_SOURCES = src/fs_tts.c +fs_tts_CFLAGS = $(AM_CFLAGS) +fs_tts_LDFLAGS = $(AM_LDFLAGS) +fs_tts_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) + +## +## tone2wav () +## +tone2wav_SOURCES = src/tone2wav.c +tone2wav_CFLAGS = $(AM_CFLAGS) +tone2wav_LDFLAGS = $(AM_LDFLAGS) +tone2wav_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) + +if HAVE_ODBC +tone2wav_LDADD += $(ODBC_LIB_FLAGS) +endif + + +## +## fs_ivrd () +## +fs_ivrd_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \ + libs/esl/src/esl_threadmutex.c libs/esl/ivrd.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c +fs_ivrd_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include +fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm + +## +## freeswitch () +## +nodist_freeswitch_SOURCES = src/include/switch_version.h +freeswitch_SOURCES = src/switch.c +freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS) +freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir) +freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la + +if HAVE_ODBC +freeswitch_LDADD += $(ODBC_LIB_FLAGS) +endif + + +## +## Scripts +## +bin_SCRIPTS = scripts/gentls_cert scripts/fsxs + +scripts/fsxs: scripts/fsxs.in + @echo creating fsxs + @sed -e "s,@MODULES_DIR\@,@modulesdir@," \ + -e "s,@LIB_DIR\@,@libdir@," \ + -e "s,@BIN_DIR\@,@bindir@," \ + -e "s,@INC_DIR\@,@includedir@," \ + -e "s,@CFG_DIR\@,@confdir@," \ + -e "s,@DB_DIR\@,@dbdir@," \ + -e "s,@PREFIX\@,@prefix@," \ + -e "s,@CC\@,$(CC)," \ + -e "s,@LD\@,$(CC)," \ + -e "s,@INSTALL\@,$(INSTALL)," \ + -e "s,@MKINSTALLDIRS\@,$(mkdir_p)," \ + \ + -e "s|@CFLAGS\@|$(CFLAGS) `./libs/apr/apr-1-config --cflags --cppflags`|" \ + -e "s|@INCLUDES\@|-I$(prefix)/include|" \ + -e "s|@SOLINK\@|$(SOLINK)|" \ + -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \ + -e "s|@LIBS\@||" \ + $(top_srcdir)/scripts/fsxs.in > scripts/fsxs + +## +## misc +## + +pkgconfigdir = @pkgconfigdir@ +pkgconfig_DATA = build/freeswitch.pc + +$(switch_builddir)/modules.conf: + if test -f $@; then touch $@; else cp $(switch_srcdir)/build/modules.conf.in $@ ;fi + +src/mod/modules.inc: $(switch_builddir)/modules.conf + @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc + @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_TEST_MODULES=$(OUR_TEST_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_CHECK_MODULES=$(OUR_CHECK_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc + +$(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la src/mod/modules.inc + @set fnord $$MAKEFLAGS; amf=$$2; \ + (cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + test -z "$$fail" + +$(switch_builddir)/build/print_git_revision: $(switch_srcdir)/build/print_git_revision.c + $(CC_FOR_BUILD) -o $@ $< + +src/switch_version.lo: src/include/switch_version.h + +src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_builddir)/build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS) + @cat $< > $@; \ + if [ -d $(switch_srcdir)/.git ] && [ -n "$$(which git)" ]; then \ + xver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision)"; \ + xhver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision -h)"; \ + sed \ + -e "/#define *SWITCH_VERSION_REVISION[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \ + -e "/#define *SWITCH_VERSION_REVISION_HUMAN[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xhver\"/;}" \ + $< > $@; \ + fi; + +## +## Dependency targets +## +libs/libedit/src/.libs/libedit.a: + cd libs/libedit && $(MAKE) + +libs/libzrtp/libzrtp.a: + cd libs/libzrtp && $(MAKE) + +libs/libvpx/Makefile: libs/libvpx/.update + cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 + +libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update + @cd libs/libvpx && $(MAKE) + +libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update + @cd libs/apr && ./config.status + @$(TOUCH_TARGET) + +libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update + @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr && $(MAKE) $(MFLAGS) && touch libapr-1.la; fi + +libs/apr-util/libaprutil-1.la: libs/apr/libapr-1.la libs/apr-util libs/apr-util/.update + @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr-util && $(MAKE) $(MFLAGS) && touch libaprutil-1.la; fi + +SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \ + libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \ + libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \ + libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \ + libs/srtp/crypto/math/datatypes.c libs/srtp/crypto/math/stat.c \ + libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \ + libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \ + libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c libs/srtp/crypto/replay/ut_sim.c + +libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC) + touch $(switch_srcdir)/src/include/switch.h + @cd libs/srtp && $(MAKE) + @$(TOUCH_TARGET) + +## +## helper targets +## +yaml-files: + @echo `mkdir $(DESTDIR)$(confdir)/yaml 2>/dev/null` + $(INSTALL) -m 644 $(switch_srcdir)/conf/default/yaml/*.yaml $(DESTDIR)$(confdir)/yaml + +vm-sync: + test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir) + test -d $(DESTDIR)$(confdir)/lang || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang + test -d $(DESTDIR)$(confdir)/lang/en || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en + test -d $(DESTDIR)$(confdir)/lang/en/demo || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/demo + test -d $(DESTDIR)$(confdir)/lang/en/vm || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/vm + $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/vm/* $(DESTDIR)$(confdir)/lang/en/vm + $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/demo/* $(DESTDIR)$(confdir)/lang/en/demo + +config-%: + test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir) + for conffile in `cd $(switch_srcdir)/conf/$* && find . -name \*.xml && find . -name \*.conf && find . -name \*.tpl && find . -name \*.ttml && find . -name mime.types` ; do \ + dir=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|/[^/]*$$||'`; \ + filename=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|^.*/||'`; \ + test -d $(DESTDIR)$(confdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(confdir)$$dir ; \ + test -f $(DESTDIR)$(confdir)$$dir/$$filename || \ + test -f $(DESTDIR)$(confdir)$$dir/$$filename.noload || \ + $(INSTALL) -m 644 $(switch_srcdir)/conf/$*/$$dir/$$filename $(DESTDIR)$(confdir)$$dir; \ + done + +samples-conf: config-vanilla + +samples-htdocs: + test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir) + for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \ + dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \ + filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \ + test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \ + test -f $(DESTDIR)$(htdocsdir)$$dir/$$filename || $(INSTALL) -m 644 $(switch_srcdir)/htdocs/$$dir/$$filename $(DESTDIR)$(htdocsdir)$$dir 2>/dev/null; \ + done + + +fonts_DATA = fonts/FreeMono.ttf fonts/FreeMonoOblique.ttf fonts/FreeSansBoldOblique.ttf fonts/FreeSerifBold.ttf fonts/OFL.txt fonts/FreeMonoBold.ttf fonts/FreeSans.ttf fonts/FreeSansOblique.ttf fonts/FreeSerifBoldItalic.ttf fonts/README.fonts fonts/FreeMonoBoldOblique.ttf fonts/FreeSansBold.ttf fonts/FreeSerif.ttf fonts/FreeSerifItalic.ttf + +images_DATA = images/default-avatar.png images/default-mute.png + +samples: samples-conf samples-htdocs + +install-exec-local: + $(mkinstalldirs) $(DESTDIR)$(modulesdir) + +install-data-local: + @echo Installing $(NAME) + @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir) $(imagesdir) $(fontsdir); do \ + $(mkinstalldirs) $(DESTDIR)$$x ; \ + done + test -d $(DESTDIR)$(confdir) || $(MAKE) samples-conf + test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs + +is-scm: + @if [ ! -d .git ] ; then \ + echo ; echo ; \ + echo "*****************************************************************************************************" ; \ + echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \ + echo " git clone https://github.com/signalwire/freeswitch.git " ; \ + echo "*****************************************************************************************************" ; \ + echo ; echo ; \ + exit 1; \ + fi + +update: is-scm + @if test -d .git ; then \ + echo "Pulling updates..." ; \ + git pull ; \ + else \ + echo "This source directory is not a git tree." ; \ + fi + +.nodepends: + touch .nodepends + +nodepends: .nodepends + +yesdepends: + rm .nodepends + +iksemel-dep: + make -C src/mod/endpoints/mod_dingaling deps + +core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS) + $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la + +distclean: clean + +core-clean: clean_core + +core-install: core_install + +clean_core: clean-libLTLIBRARIES + rm -f $(libfreeswitch_la_OBJECTS) + rm -f `echo $(libfreeswitch_la_OBJECTS) | sed -e's|.lo|.o|g'` + +install_core: install-libLTLIBRARIES + +core_install: install_core + +everything: install + +up: is-scm clean + $(MAKE) update + $(MAKE) -j core + $(MAKE) -j modules + $(MAKE) install + +sync: is-scm + $(MAKE) update + $(MAKE) install + +speedy-sync: is-scm + $(MAKE) update + $(MAKE) -j install + +version: + git log -1 | head -3 + +reinstall: modwipe uninstall install + +pristine: + git clean -fdx + git reset --hard + +update-clean: clean python-reconf + cd libs/esl && $(MAKE) clean + cd libs/srtp && $(MAKE) clean + +swigall: + @echo reswigging all + sh $(switch_srcdir)/build/swigall.sh + +sndfile-reconf: + cd libs/libsndfile && autoreconf + cd libs/libsndfile && ./config.status --recheck + cd libs/libsndfile && ./config.status + +python-reconf: + rm -f src/mod/languages/mod_python/Makefile + ./config.status + +reconf: + rm config.cache + sh ./config.status --recheck + sh ./config.status + +srtp-reconf: + cd libs/srtp && $(MAKE) clean + cd libs/srtp && sh ./config.status --recheck + cd libs/srtp && sh ./config.status + + +iks-reconf: + cd libs/iksemel && $(MAKE) clean + cd libs/iksemel && autoreconf -fi + cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS) + $(MAKE) mod_dingaling-clean + +cluecon: + @clear + @echo Thank you for updating. This is going to take a while so relax. + @echo Now would be a good time to register for ClueCon! + @cat $(switch_srcdir)/cluecon2.tmpl + @echo + @echo http://www.cluecon.com + @sleep 5 + +sure: is-scm pristine update + git pull + sh bootstrap.sh + sh configure $(CONFIGURE_ARGS) + make $(MAKE_ARGS) + make reinstall + +current: cluecon update-clean is-scm + $(MAKE) update + $(MAKE) all + $(MAKE) reinstall + +installall: current + +speedy-current: update-clean is-scm + $(MAKE) update + $(MAKE) speedy-sure + $(MAKE) reinstall + +wayclean: clean + +modules: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) + +install_mod: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) install + +mod_install: install_mod + +uninstall_mod: $(switch_builddir)/modules.conf src/mod/modules.inc + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) uninstall + +mod_uninstall: uninstall_mod + +modclean: $(switch_builddir)/modules.conf src/mod/modules.inc + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) clean + +modwipe: + rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib + +print_tests: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc + @cd tests/unit && $(MAKE) $(AM_MAKEFLAGS) print_tests + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) print_tests + +dox: + cd docs && doxygen $(PWD)/docs/Doxygen.conf + +eclean: clean + rm -f `find . -type f -name \*~` + rm -f `find . -type f -name \.*~` + rm -f `find . -type f -name \#\*` + rm -f `find . -type f -name \.\#\*` + rm -f `find . -type f -name core\*` + rm -f *.tar *.tgz *.gz + +megaclean: eclean modclean + rm -f `find ./libs -name \*.o` + rm -f `find ./libs -name \*.la` + +libclean: + @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done + +support: + @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cp support-d/.emacs ~ + @cp support-d/.screenrc ~ + @cp support-d/.bashrc ~ + @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed + diff --git a/packer/jambonz-feature-server/files/Makefile.am.grpc.patch b/packer/jambonz-feature-server/files/Makefile.am.grpc.patch deleted file mode 100644 index da5e116..0000000 --- a/packer/jambonz-feature-server/files/Makefile.am.grpc.patch +++ /dev/null @@ -1,175 +0,0 @@ ---- Makefile.am 2019-10-31 16:15:52.546094477 +0000 -+++ Makefile.am.new 2019-10-31 16:19:06.355020970 +0000 -@@ -188,6 +188,12 @@ - LWS_LIBS += -lwebsockets - endif - -+# DH: GRPC -+if HAVE_GRPC -+CORE_CFLAGS += -DSWITCH_HAVE_GRPC $(GRPC_CFLAGS) -+GRPC_LIBS += -lgrpc++_reflection -lprotobuf -+endif -+ - ## - ## libfreeswitch - ## -@@ -255,10 +261,158 @@ - CORE_LIBS+=libfreeswitch_libyuv.la - endif - -+if HAVE_GRPC -+GOOGLEAPIS_GENS_PATH = libs/googleapis/gens -+GOOGLEAPIS_LOGGING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/logging -name '*.pb.cc') -+GOOGLEAPIS_API_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/api -name '*.pb.cc') -+GOOGLEAPIS_RPC_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/rpc -name '*.pb.cc') -+GOOGLEAPIS_SPEECH_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/cloud/speech -name '*.pb.cc') -+GOOGLEAPIS_LONGRUNNING_CCS = $(shell find $(GOOGLEAPIS_GENS_PATH)/google/longrunning -name '*.pb.cc') -+GOOGLEAPIS_CCS = $(GOOGLEAPIS_API_CCS) $(GOOGLEAPIS_RPC_CCS) $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) -+ -+nodist_libfreeswitch_libgoogleapis_la_SOURCES = \ -+libs/googleapis/gens/google/api/monitoring.grpc.pb.cc \ -+libs/googleapis/gens/google/api/annotations.grpc.pb.cc \ -+libs/googleapis/gens/google/api/http.pb.cc \ -+libs/googleapis/gens/google/api/quota.pb.cc \ -+libs/googleapis/gens/google/api/quota.grpc.pb.cc \ -+libs/googleapis/gens/google/api/backend.grpc.pb.cc \ -+libs/googleapis/gens/google/api/service.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitored_resource.pb.cc \ -+libs/googleapis/gens/google/api/consumer.pb.cc \ -+libs/googleapis/gens/google/api/annotations.pb.cc \ -+libs/googleapis/gens/google/api/metric.pb.cc \ -+libs/googleapis/gens/google/api/logging.pb.cc \ -+libs/googleapis/gens/google/api/auth.grpc.pb.cc \ -+libs/googleapis/gens/google/api/distribution.grpc.pb.cc \ -+libs/googleapis/gens/google/api/label.grpc.pb.cc \ -+libs/googleapis/gens/google/api/launch_stage.grpc.pb.cc \ -+libs/googleapis/gens/google/api/launch_stage.pb.cc \ -+libs/googleapis/gens/google/api/httpbody.grpc.pb.cc \ -+libs/googleapis/gens/google/api/config_change.grpc.pb.cc \ -+libs/googleapis/gens/google/api/logging.grpc.pb.cc \ -+libs/googleapis/gens/google/api/context.pb.cc \ -+libs/googleapis/gens/google/api/system_parameter.pb.cc \ -+libs/googleapis/gens/google/api/distribution.pb.cc \ -+libs/googleapis/gens/google/api/control.pb.cc \ -+libs/googleapis/gens/google/api/consumer.grpc.pb.cc \ -+libs/googleapis/gens/google/api/label.pb.cc \ -+libs/googleapis/gens/google/api/documentation.pb.cc \ -+libs/googleapis/gens/google/api/log.pb.cc \ -+libs/googleapis/gens/google/api/usage.grpc.pb.cc \ -+libs/googleapis/gens/google/api/backend.pb.cc \ -+libs/googleapis/gens/google/api/control.grpc.pb.cc \ -+libs/googleapis/gens/google/api/log.grpc.pb.cc \ -+libs/googleapis/gens/google/api/source_info.grpc.pb.cc \ -+libs/googleapis/gens/google/api/billing.pb.cc \ -+libs/googleapis/gens/google/api/auth.pb.cc \ -+libs/googleapis/gens/google/api/resource.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/check_error.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/check_error.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/distribution.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/distribution.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/service_controller.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/metric_value.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/log_entry.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/operation.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/quota_controller.pb.cc \ -+libs/googleapis/gens/google/api/servicecontrol/v1/operation.pb.cc \ -+libs/googleapis/gens/google/api/metric.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitored_resource.grpc.pb.cc \ -+libs/googleapis/gens/google/api/http.grpc.pb.cc \ -+libs/googleapis/gens/google/api/httpbody.pb.cc \ -+libs/googleapis/gens/google/api/endpoint.pb.cc \ -+libs/googleapis/gens/google/api/documentation.grpc.pb.cc \ -+libs/googleapis/gens/google/api/system_parameter.grpc.pb.cc \ -+libs/googleapis/gens/google/api/endpoint.grpc.pb.cc \ -+libs/googleapis/gens/google/api/service.pb.cc \ -+libs/googleapis/gens/google/api/source_info.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/resources.grpc.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/resources.pb.cc \ -+libs/googleapis/gens/google/api/servicemanagement/v1/servicemanager.grpc.pb.cc \ -+libs/googleapis/gens/google/api/billing.grpc.pb.cc \ -+libs/googleapis/gens/google/api/usage.pb.cc \ -+libs/googleapis/gens/google/api/config_change.pb.cc \ -+libs/googleapis/gens/google/api/context.grpc.pb.cc \ -+libs/googleapis/gens/google/api/monitoring.pb.cc \ -+libs/googleapis/gens/google/api/field_behavior.pb.cc \ -+libs/googleapis/gens/google/api/client.pb.cc \ -+libs/googleapis/gens/google/rpc/error_details.grpc.pb.cc \ -+libs/googleapis/gens/google/rpc/code.pb.cc \ -+libs/googleapis/gens/google/rpc/status.pb.cc \ -+libs/googleapis/gens/google/rpc/status.grpc.pb.cc \ -+libs/googleapis/gens/google/rpc/error_details.pb.cc \ -+libs/googleapis/gens/google/rpc/code.grpc.pb.cc \ -+libs/googleapis/gens/google/longrunning/operations.grpc.pb.cc \ -+libs/googleapis/gens/google/longrunning/operations.pb.cc \ -+libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.pb.cc \ -+libs/googleapis/gens/google/cloud/speech/v1/cloud_speech.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.pb.cc \ -+libs/googleapis/gens/google/cloud/texttospeech/v1/cloud_tts.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/http_request.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/log_severity.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/type/log_severity.pb.cc \ -+libs/googleapis/gens/google/logging/type/http_request.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_metrics.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/log_entry.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_config.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_config.pb.cc \ -+libs/googleapis/gens/google/logging/v2/log_entry.grpc.pb.cc \ -+libs/googleapis/gens/google/logging/v2/logging_metrics.grpc.pb.cc \ -+libs/googleapis/gens/google/type/date.grpc.pb.cc \ -+libs/googleapis/gens/google/type/timeofday.pb.cc \ -+libs/googleapis/gens/google/type/latlng.grpc.pb.cc \ -+libs/googleapis/gens/google/type/money.pb.cc \ -+libs/googleapis/gens/google/type/date.pb.cc \ -+libs/googleapis/gens/google/type/postal_address.grpc.pb.cc \ -+libs/googleapis/gens/google/type/dayofweek.grpc.pb.cc \ -+libs/googleapis/gens/google/type/dayofweek.pb.cc \ -+libs/googleapis/gens/google/type/timeofday.grpc.pb.cc \ -+libs/googleapis/gens/google/type/color.pb.cc \ -+libs/googleapis/gens/google/type/postal_address.pb.cc \ -+libs/googleapis/gens/google/type/latlng.pb.cc \ -+libs/googleapis/gens/google/type/color.grpc.pb.cc \ -+libs/googleapis/gens/google/type/money.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/gcs.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/validation_result.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/agent.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/audio_config.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/context.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/document.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/entity_type.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/intent.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/knowledge_base.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session_entity_type.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/session.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.grpc.pb.cc \ -+libs/googleapis/gens/google/cloud/dialogflow/v2beta1/webhook.pb.cc -+ -+libfreeswitch_libgoogleapis_la_CPPFLAGS = -I/usr/local/include -I$(GOOGLEAPIS_GENS_PATH) -std=c++11 -pthread -+ -+CORE_LIBS+=libfreeswitch_libgoogleapis.la -+noinst_LTLIBRARIES += libfreeswitch_libgoogleapis.la -+endif -+ - lib_LTLIBRARIES = libfreeswitch.la - libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) - libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined --libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) -+libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(GRPC_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) - libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) - - if HAVE_PNG diff --git a/packer/jambonz-feature-server/files/Makefile.am.patch b/packer/jambonz-feature-server/files/Makefile.am.patch deleted file mode 100644 index 3d9a565..0000000 --- a/packer/jambonz-feature-server/files/Makefile.am.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Makefile.am 2019-09-30 19:01:33.268018459 +0000 -+++ Makefile.am.new 2019-09-30 23:04:33.949177848 +0000 -@@ -182,6 +182,12 @@ - CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS) - endif - -+# DH: LWS -+if HAVE_LWS -+CORE_CFLAGS += -DSWITCH_HAVE_LWS $(LWS_CFLAGS) -+LWS_LIBS += -lwebsockets -+endif -+ - ## - ## libfreeswitch - ## -@@ -252,7 +258,7 @@ - lib_LTLIBRARIES = libfreeswitch.la - libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS) - libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined --libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) -+libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(LWS_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) - libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) - - if HAVE_PNG diff --git a/packer/jambonz-feature-server/files/configure.ac.extra b/packer/jambonz-feature-server/files/configure.ac.extra new file mode 100644 index 0000000..a7d3bc7 --- /dev/null +++ b/packer/jambonz-feature-server/files/configure.ac.extra @@ -0,0 +1,2201 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +# Must change all of the below together +# For a release, set revision for that tagged release as well and uncomment +AC_INIT([freeswitch], [1.10.5-release], bugs@freeswitch.org) +AC_SUBST(SWITCH_VERSION_MAJOR, [1]) +AC_SUBST(SWITCH_VERSION_MINOR, [10]) +AC_SUBST(SWITCH_VERSION_MICRO, [5-release]) +AC_SUBST(SWITCH_VERSION_REVISION, []) +AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) + +AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) + +AC_CONFIG_AUX_DIR(build/config) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AC_CONFIG_SRCDIR([src/switch.c]) +AC_CONFIG_HEADER([src/include/switch_private.h]) +AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h]) +AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h]) + +AC_CANONICAL_HOST + +# Absolute source/build directory +switch_srcdir=`(cd $srcdir && pwd)` +switch_builddir=`pwd` +AC_SUBST(switch_srcdir) +AC_SUBST(switch_builddir) + +# +# --enable-64 has been moved up higher prior to AC_PROG_CC so that we can tuck in the -m64 flag +# so devs on with Solaris wanting to build 64bit can not bother with adding any additional +# flags on the ./configure line. User friendly. +# + +# Enable 64 bit build +AC_ARG_ENABLE(64, +[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"]) + +if test "${enable_64}" = "yes"; then + case "$host" in + *-solaris2*) + # All three have to have -m64 for AC_PROG_CC to pick the right libtool + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64" + CXXFLAGS="$CXXFLAGS -m64" + ;; + *) + ;; + esac +fi + +# use mtmalloc on Solaris SPARC if available +AS_CASE([$host], [sparc-*-solaris2*], [AC_CHECK_LIB(mtmalloc, malloc)]) + +# Whether to follow FHS +AC_ARG_ENABLE([fhs],[AS_HELP_STRING([--disable-fhs], + [Do Not follow the FHS when placing files and directories (default only when not specifying prefix])],[enable_fhs="$enableval"],[enable_fhs="yes"]) + +AC_PREFIX_DEFAULT(/usr/local/freeswitch) +# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script + +if test "x$prefix" = "xNONE" ; then + enable_fhs=no + prefix='/usr/local/freeswitch' +fi + +if test "x${exec_prefix}" = "xNONE" ; then + exec_prefix="$prefix" +fi + +default_scriptdir="$prefix/scripts" +default_grammardir="$prefix/grammar" +default_soundsdir="$prefix/sounds" +default_htdocsdir="$prefix/htdocs" +default_modulesdir="$prefix/mod" +default_dbdir="$prefix/db" +default_storagedir="$prefix/storage" +default_cachedir="$prefix/cache" +default_recordingsdir="$prefix/recordings" +rundir="$prefix/run" +logdir="${prefix}/log" +confdir="$prefix/conf" +default_certsdir="$prefix/certs" +default_fontsdir="$prefix/fonts" +default_imagesdir="$prefix/images" + +if test "${enable_fhs}" = "yes"; then + eval full_datadir="${datadir}/freeswitch" + eval datadir=$full_datadir + eval full_localstatedir="${localstatedir}" + eval localstatedir=$full_localstatedir + eval libdir=$libdir + default_cachedir="${localstatedir}/cache/freeswitch" + rundir="${localstatedir}/run/freeswitch" + logdir="${localstatedir}/log/freeswitch" + localstatedir="${localstatedir}/lib/freeswitch" + default_scriptdir="${datadir}/scripts" + default_grammardir="${datadir}/grammar" + default_soundsdir="${datadir}/sounds" + default_htdocsdir="${datadir}/htdocs" + default_fontsdir="${datadir}/fonts" + default_modulesdir="${libdir}/freeswitch/mod" + default_dbdir="${localstatedir}/db" + default_storagedir="${localstatedir}/storage" + default_recordingsdir="${localstatedir}/recordings" + default_imagesdir="${localstatedir}/images" + eval confdir="${sysconfdir}/freeswitch" + eval default_certsdir="${confdir}/tls" +else + if test "$datadir" = "\${datarootdir}" ; then + datadir="${prefix}" + fi + if test "$localstatedir" = "\${prefix}/var" ; then + localstatedir="${prefix}" + fi +fi + +if test "$includedir" = "\${prefix}/include" ; then + includedir="${prefix}/include/freeswitch" +fi + +default_pkgconfigdir="$libdir/pkgconfig" +default_runtimedir="$rundir" +default_logfiledir="$logdir" + +AC_SUBST(libdir) + +# Where to install the modules +AC_ARG_WITH([modinstdir], + [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modulesdir="$withval"], [modulesdir="${default_modulesdir}"]) +eval modulesdir="${modulesdir}" +AC_SUBST(modulesdir) +AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modulesdir}",[where to install the modules to]) + +# Where to put pidfile +AC_ARG_WITH([rundir], + [AS_HELP_STRING([--with-rundir=DIR], [Put pidfile into this location (default: $prefix/run)])], [runtimedir="$withval"], [runtimedir="${default_runtimedir}"]) +AC_SUBST(runtimedir) +AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to]) + +AC_ARG_WITH([logfiledir], + [AS_HELP_STRING([--with-logfiledir=DIR], [Put logfiles into this location (default: $localstatedir/log)])], [logfiledir="$withval"], [logfiledir="${default_logfiledir}"]) +AC_SUBST(logfiledir) +AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files]) + +AC_ARG_WITH([dbdir], + [AS_HELP_STRING([--with-dbdir=DIR], [Put database files into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="${default_dbdir}"]) +AC_SUBST(dbdir) +AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files]) + +AC_ARG_WITH([htdocsdir], + [AS_HELP_STRING([--with-htdocsdir=DIR], [Put html files into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="${default_htdocsdir}"]) +AC_SUBST(htdocsdir) +AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files]) + +AC_ARG_WITH([fontsdir], + [AS_HELP_STRING([--with-fontsdir=DIR], [Put font files into this location (default: $prefix/fonts)])], [fontsdir="$withval"], [fontsdir="${default_fontsdir}"]) +AC_SUBST(fontsdir) +AC_DEFINE_UNQUOTED([SWITCH_FONTS_DIR],"${fontsdir}",[where to put font files]) + +AC_ARG_WITH([soundsdir], + [AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="${default_soundsdir}"]) +AC_SUBST(soundsdir) +AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files]) + +AC_ARG_WITH([grammardir], + [AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="${default_grammardir}"]) +AC_SUBST(grammardir) +AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files]) + +AC_ARG_WITH([certsdir], + [AS_HELP_STRING([--with-certsdir=DIR], [Put certs files into this location (default: $prefix/certs)])], [certsdir="$withval"], [certsdir="${default_certsdir}"]) +AC_SUBST(certsdir) +AC_DEFINE_UNQUOTED([SWITCH_CERTS_DIR],"${certsdir}",[where to put certs files]) + +AC_ARG_WITH([scriptdir], + [AS_HELP_STRING([--with-scriptdir=DIR], [Put script files into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="${default_scriptdir}"]) +AC_SUBST(scriptdir) +AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files]) + +AC_ARG_WITH([recordingsdir], + [AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings files into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="${default_recordingsdir}"]) +AC_SUBST(recordingsdir) +AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files]) + +AC_ARG_WITH([imagesdir], + [AS_HELP_STRING([--with-imagesdir=DIR], [Put images files into this location (default: $prefix/images)])], [imagesdir="$withval"], [imagesdir="${default_imagesdir}"]) +AC_SUBST(imagesdir) +AC_DEFINE_UNQUOTED([SWITCH_IMAGES_DIR],"${imagesdir}",[where to put image files]) + +AC_ARG_WITH([storagedir], + [AS_HELP_STRING([--with-storagedir=DIR], [Put storage files into this location (default: $prefix/storage)])], [storagedir="$withval"], [storagedir="${default_storagedir}"]) +AC_SUBST(storagedir) +AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files]) + +AC_ARG_WITH([cachedir], + [AS_HELP_STRING([--with-cachedir=DIR], [Put cache files into this location (default: $prefix/cache)])], [cachedir="$withval"], [cachedir="${default_cachedir}"]) +AC_SUBST(cachedir) +AC_DEFINE_UNQUOTED([SWITCH_CACHE_DIR],"${cachedir}",[where to put cache files]) + +AC_SUBST(confdir) +AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files]) + +AC_SUBST(datadir) +AC_DEFINE_UNQUOTED([SWITCH_DATA_DIR],"${datadir}",[directory for data files]) + +AC_SUBST(localstatedir) +AC_DEFINE_UNQUOTED([SWITCH_LOCALSTATE_DIR],"${localstatedir}",[directory for local state files]) +AC_SUBST(bindir) +AC_SUBST(includedir) + +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])], + [case "${withval}" in + yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;; + *) pkgconfigdir="${withval}" ;; + esac + ], + [pkgconfigdir="${default_pkgconfigdir}"] +) +AC_SUBST([pkgconfigdir]) + +#Set default language +AC_LANG_C +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX + +#check if the g++ compiler works +AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_sys_cxx_works], [ + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { }])], [ac_cv_sys_cxx_works=yes], + [ac_cv_sys_cxx_works=no]) + AC_LANG_POP([C++]) + ]) +[ if [ "x$ac_cv_sys_cxx_works" = "xno" ]; then ] + AC_MSG_FAILURE([The C++ compiler does not work. Please (re)install the C++ compiler]) +[ fi ] + +AC_PROG_AWK +AC_PROG_MAKE_SET +AC_PROG_INSTALL + +#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html) +m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) +m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) +m4_defun([_LT_AC_LANG_RC_CONFIG], [:]) +AM_PROG_CC_C_O +AC_PROG_LIBTOOL + +#Check for compiler vendor +AX_COMPILER_VENDOR + +# Set CC_FOR_BUILD +if test "x${cross_compiling}" = "xyes"; then + CC_FOR_BUILD=${CC_FOR_BUILD-gcc} + case "$host" in + arm*-linux-gnueabi*|arm*-*-linux-gnueabi*) + # spandsp modem + ac_cv_file__dev_ptmx=yes + # libjs + export ac_cv_va_copy=yes + # srtp + export ac_cv_file__dev_urandom=yes + # rpl_malloc + export ac_cv_func_realloc_0_nonnull=yes + export ac_cv_func_malloc_0_nonnull=yes + # apr + export ac_cv_func_setpgrp_void=yes + export ac_cv_file__dev_zero=yes + export apr_cv_tcp_nodelay_with_cork=yes + export ac_cv_file_dbd_apr_dbd_mysql_c=no + export ac_cv_sizeof_ssize_t=4 + export apr_cv_mutex_recursive=yes + export ac_cv_func_pthread_rwlock_init=yes + export apr_cv_type_rwlock_t=yes + export apr_cv_process_shared_works=yes + export apr_cv_mutex_robust_shared=yes + ;; + esac +else + CC_FOR_BUILD='$(CC)' +fi +AC_SUBST(CC_FOR_BUILD) + +if test -n "$lt_sysroot" ; then + APR_ADDTO(CFLAGS, --sysroot=$lt_sysroot) + APR_ADDTO(CXXFLAGS, --sysroot=$lt_sysroot) + APR_ADDTO(CPPFLAGS, --sysroot=$lt_sysroot) + APR_ADDTO(LDFLAGS, --sysroot=$lt_sysroot) + PKG_CONFIG_SYSROOT_DIR=$lt_sysroot +fi + +# Optimize +AC_ARG_ENABLE(optimization, +[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"]) + +if test "${enable_optimizer}" = "yes" ; then + AC_DEFINE([OPTIMZER],[],[Enable Optimization.]) + AX_CC_MAXOPT +fi + +# set defaults for use on all platforms +SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src" +SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src" +SWITCH_AM_CPPFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src" +SWITCH_AM_LDFLAGS="-lm" + +#set SOLINK variable based on compiler and host +if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then + SOLINK="-Bdynamic -dy -G" +elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then + case "$host" in + *darwin*) + SOLINK="-dynamic -force-flat-namespace" + ;; + *) + SOLINK="-shared -Xlinker -x" + ;; + + esac +elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then + case "$host" in +# older Xcode test for darwin, Xcode 4/5 use clang above + *darwin*) + SOLINK="-dynamic -bundle -force-flat-namespace" + ;; + *-solaris2*) + SOLINK="-shared -Xlinker" + ;; + *) + SOLINK="-shared -Xlinker -x" + ;; + esac +elif test "x${ax_cv_c_compiler_vendor}" = "xintel" ; then + case "$host" in + *) + SOLINK="-shared -Xlinker -x" + ;; + esac +else + AC_ERROR([Please update configure.in with SOLINK values for your compiler]) +fi + +## +# detect libtool major version, +# set libtool library extension based on this +# to work around some brokeness when using 'la' with libtool-1.5 +# +AC_MSG_CHECKING([libtool major version]) +libtool="${switch_builddir}/libtool" +LIBTOOL_MAJOR_VERSION="`$libtool --version 2>/dev/null| sed -e 's/([[^)]]*)//g;s/^[[^0-9]]*//;s/[[- ]].*//g;q'| awk 'BEGIN { FS = "." } { print $1 }' `" +if test -z "$LIBTOOL_MAJOR_VERSION" ; then + LIBTOOL_MAJOR_VERSION="`sed -n -e '/^VERSION/{s/^.*=\"\{0,1\}\([[0-9]]\{1,\}\)\..*/\1/;p;}' ${switch_srcdir}/build/config/ltmain.sh`" +fi +if test -z "$LIBTOOL_MAJOR_VERSION" ; then + AC_MSG_ERROR([Failed to detect your libtool version, please open a bug report on https://freeswitch.org/jira]) +fi +AC_MSG_RESULT([${LIBTOOL_MAJOR_VERSION}]) + +LIBTOOL_LIB_EXTEN=so + +if test "${LIBTOOL_MAJOR_VERSION}" = "2" ; then + LIBTOOL_LIB_EXTEN="la" +fi +AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}]) + +if test "$ax_cv_c_compiler_vendor" = "gnu"; then + saved_CFLAGS="$CFLAGS" + AC_CACHE_CHECK([whether compiler supports -Wno-unused-result], + [ac_cv_gcc_supports_w_no_unused_result], [ + CFLAGS="$CFLAGS -Wno-unused-result -Wno-error=unused-result" + AC_TRY_COMPILE([],[return 0;], + [ac_cv_gcc_supports_w_no_unused_result=yes], + [ac_cv_gcc_supports_w_no_unused_result=no])]) + CFLAGS="$saved_CFLAGS" + AC_MSG_RESULT($ac_cv_gcc_supports_w_no_unused_result) + + saved_CFLAGS="$CFLAGS" + AC_CACHE_CHECK([whether compiler supports -Wno-misleading-indentation], + [ac_cv_gcc_supports_w_no_misleading_indentation], [ + CFLAGS="$CFLAGS -Wno-misleading-indentation -Wno-error=misleading-indentation" + AC_TRY_COMPILE([],[return 0;], + [ac_cv_gcc_supports_w_no_misleading_indentation=yes], + [ac_cv_gcc_supports_w_no_misleading_indentation=no])]) + CFLAGS="$saved_CFLAGS" + AC_MSG_RESULT($ac_cv_gcc_supports_w_no_misleading_indentation) +fi + +# tweak compiler specific flags +if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then + APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC) + APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC) + APR_ADDTO(SWITCH_AM_CFLAGS, -erroff=E_END_OF_LOOP_CODE_NOT_REACHED) + APR_ADDTO(SWITCH_AM_CFLAGS, -errtags=yes) + APR_ADDTO(SWITCH_AM_CFLAGS, -D__FUNCTION__=__func__ ) + APR_ADDTO(SWITCH_AM_CFLAGS, -mt) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -errtags=yes) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC) + APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions") + APR_ADDTO(SWITCH_AM_CXXFLAGS, -D__FUNCTION__=__func__) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -mt) + + APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib) + if test "${enable_64}" = "yes"; then + APR_ADDTO(SWITCH_AM_CFLAGS, -m64) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -m64) + APR_ADDTO(SWITCH_AM_LDFLAGS, -m64) + LIBS="$LIBS -m64" + fi +elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then + APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC -ffast-math) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC -ffast-math) + APR_ADDTO(SWITCH_AM_CFLAGS, -Werror) +elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then + APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC -ffast-math) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC -ffast-math) + AC_SUBST([AM_MOD_AVMD_CXXFLAGS], [-std=gnu99]) # FS-8809, needed for MAP_POPULATE + if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then + APR_ADDTO(SWITCH_AM_CFLAGS, -Werror) + APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result) + fi + if test "$ac_cv_gcc_supports_w_no_misleading_indentation" = yes; then + APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-misleading-indentation) + fi + if test "${enable_64}" = "yes"; then + case "$host" in + *darwin*) + osxvrm=`sw_vers -productVersion` # Get version.release.modlevel + osxrel=`echo $osxvrm | cut -d. -f2` # Get release only + if test "$osxrel" -ge 4; then # 10.4 and up are x64 + APR_ADDTO(CFLAGS, -arch x86_64) + APR_ADDTO(LDFLAGS, -arch x86_64) + APR_ADDTO(CXXFLAGS, -arch x86_64) + fi + ;; + *-solaris2*) + APR_ADDTO(CFLAGS, -m64) + APR_ADDTO(LDFLAGS, -m64) + APR_ADDTO(CXXFLAGS, -m64) + ;; + *) + LIBS="$LIBS -m64" + ;; + esac + fi +fi + +case "${ax_cv_c_compiler_vendor}" in +sun) + VISIBILITY_FLAG=-xldscope=hidden +;; +*) + VISIBILITY_FLAG=-fvisibility=hidden +;; +esac +AC_SUBST(VISIBILITY_FLAG) + +# +# gcc visibility cflag checks +# +AC_ARG_ENABLE([visibility], + [AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])], + [enable_visibility="${enableval}"], + [enable_visibility="detect"] +) +HAVE_VISIBILITY="no" + +if test "x${enable_visibility}" != "xno" ; then + + case "${ax_cv_c_compiler_vendor}" in + gnu) + save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} -fvisibility=hidden" + AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [int foo __attribute__ ((visibility("default")));], + [;] + )], + + [AC_MSG_RESULT([yes]) + APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1]) + APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1]) + HAVE_VISIBILITY="yes"], + + [AC_MSG_RESULT([no])] + ) + CFLAGS="${save_CFLAGS}" + ;; + + sun) + # save_CFLAGS="${CFLAGS}" + # CFLAGS="${CFLAGS} -xldscope=hidden" + # AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden]) + # AC_COMPILE_IFELSE( + # [AC_LANG_PROGRAM( + # [int foo __attribute__ ((visibility("default")));], + # [;] + # )], + # + # [AC_MSG_RESULT([yes]) + # APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1]) + # APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1]) + # HAVE_VISIBILITY="yes"], + # + # [AC_MSG_RESULT([no])] + # ) + # CFLAGS="${save_CFLAGS}" + ;; + + *) + if test "x${enable_visibility}" = "xyes" ; then + AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported]) + else + AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported]) + fi + ;; + esac + + # + # visibility explicitly requested but not supported by this compiler => error + # + if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then + AC_MSG_ERROR([API visibility not supported by this compiler]) + fi +fi + +# Enable debugging (default: on) +# (rename option if the default is changed) +AC_ARG_ENABLE(debug, +[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"]) + +if test "${enable_debug}" = "yes"; then + AC_DEFINE([DEBUG],[],[Enable extra debugging.]) + saved_CFLAGS="$CFLAGS" + CFLAGS= + AX_CFLAGS_WARN_ALL_ANSI + SWITCH_ANSI_CFLAGS=$CFLAGS + CFLAGS="$saved_CFLAGS" + + if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then + if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then + APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result) + fi + APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb) + export DEBUG_CFLAGS="-g -ggdb" + fi + +fi + +AC_ARG_ENABLE(libyuv, +[AC_HELP_STRING([--disable-libyuv],[build without libyuv])],[enable_libyuv="$enableval"],[enable_libyuv="yes"]) + +AM_CONDITIONAL([ENABLE_LIBYUV],[test "${enable_libyuv}" = "yes"]) + +AC_ARG_ENABLE(libvpx, +[AC_HELP_STRING([--disable-libvpx],[build without libvpx])],[enable_libvpx="$enableval"],[enable_libvpx="yes"]) + +AM_CONDITIONAL([ENABLE_LIBVPX],[test "${enable_libvpx}" = "yes"]) + +AC_ARG_ENABLE(cpp, +[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"]) + +AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"]) + +AM_CONDITIONAL([DISABLE_CC],[test "${disable_cc}" = "yes"]) + +AC_ARG_ENABLE([system-xmlrpc-c], + [AS_HELP_STRING([--enable-system-xmlrpc-c], + [use system lib for xmlrpc-c])],, + [enable_xmlrpcc="no"]) + +if test "${enable_xmlrpcc}" = "yes" ; then +SYS_XMLRPC_CFLAGS=`xmlrpc-c-config --cflags` +SYS_XMLRPC_LDFLAGS=`xmlrpc-c-config --libs` +fi +AC_SUBST(SYS_XMLRPC_CFLAGS) +AC_SUBST(SYS_XMLRPC_LDFLAGS) +AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"]) + +for luaversion in luajit lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua; do + PKG_CHECK_MODULES([LUA],[${luaversion}],[have_lua=yes],[have_lua=no]) + if test ${have_lua} = yes; then + break + fi +done +if test x"${LUA_LIBS}" = x"" ; then + LUA_LIBS="-llua" +fi + +AC_ARG_ENABLE(srtp, +[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"]) + +AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"]) + +have_openal=no +AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"]) +AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"]) + +AC_ARG_ENABLE(zrtp, + [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) +if test "x$enable_zrtp" = "xyes" ; then + LIBS="-lpthread $LIBS" + APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP) +fi + +PA_LIBS= + +PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) +if test "x$have_jack" = "xyes" ; then +PA_LIBS+=$JACK_LIBS +fi + +AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) +if test "x$have_alsa" = "xyes" ; then +PA_LIBS+=-lasound +fi + +AC_SUBST(PA_LIBS) + +AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"]) + +AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) + +AC_ARG_ENABLE(core-odbc-support, + [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"]) +if ! test "$enable_core_odbc_support" = "no"; then + AX_LIB_ODBC + if test "$ac_cv_found_odbc" = "yes" ; then + enable_core_odbc_support="yes" + elif test "$enable_core_odbc_support" = "yes"; then + AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent]) + else + enable_core_odbc_support="no" + fi +fi + +CHECK_LIBUUID +SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS" +SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS" + +AC_ARG_ENABLE(core-pgsql-pkgconfig, + [AS_HELP_STRING([--disable-core-pgsql-pkgconfig], [Use pg_config to get PGQSL build options])],[enable_core_pgsql_pkgconfig="$enableval"],[enable_core_pgsql_pkgconfig="yes"]) + +path_remove () { + echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//' +} +path_push_unique () { + x="$(eval echo \$$1)" + x="$(path_remove "$x" "$2")" + if test -z "$x"; then + eval export $1="$2" + else + eval export $1="$2:$x" + fi +} + +AC_PATH_PROG([PG_CONFIG], [pg_config], [no]) +AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) + +case $host in + *-darwin*) + path_push_unique PKG_CONFIG_PATH /usr/local/opt/libpq/lib/pkgconfig + ;; +esac + +if test "$PKG_CONFIG" = "no" \ + || test x"$enable_core_pgsql_pkgconfig" = x"no" \ + || ! pkg-config libpq; then + if test "$PG_CONFIG" != "no"; then + AC_MSG_CHECKING([for PostgreSQL libraries via pg_config]) + POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" + POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`" + POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq" + POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'` + POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'` + POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'` + POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'` + fi +else + + AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config]) + POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`" + POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`" + POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`" + POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`" + POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`" + POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`" + POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`" + test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0 +fi +AC_MSG_RESULT([$POSTGRESQL_LIBDIR]) +AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against]) +AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against]) +AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against]) +AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against]) +have_libpq=no +AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"]) +AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"]) +AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS]) +AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS]) +AC_SUBST([POSTGRESQL_LIBDIR], [$POSTGRESQL_LIBDIR]) + + +PKG_CHECK_MODULES([MARIADB], [libmariadb >= 3.0.9],[ + AM_CONDITIONAL([HAVE_MARIADB],[true])],[ + PKG_CHECK_MODULES([MARIADB], [mariadb >= 3.0.9],[ + AM_CONDITIONAL([HAVE_MARIADB],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MARIADB],[false]) + ]) +]) + +PKG_CHECK_MODULES([SPANDSP], [spandsp >= 3.0],[ + AM_CONDITIONAL([HAVE_SPANDSP],[true])],[ + AC_MSG_ERROR([no usable spandsp; please install spandsp3 devel package or equivalent]) +]) + +PKG_CHECK_MODULES([SOFIA_SIP], [sofia-sip-ua >= 1.12.12],[ + AM_CONDITIONAL([HAVE_SOFIA_SIP],[true])],[ + AC_MSG_ERROR([no usable sofia-sip; please install sofia-sip-ua devel package or equivalent]) +]) + +AC_ARG_ENABLE(deprecated-core-db-events, + [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"]) + +if test x"$enable_deprecated_core_db_events" = x"yes" ; then + AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events]) +fi + +ESL_LDFLAGS= +PLATFORM_CORE_LDFLAGS= +PLATFORM_CORE_LIBS= + +# tweak platform specific flags +case "$host" in + *darwin*) + # Common Apple Darwin settings + APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX) + APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC) + APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include) + APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib) + if test "x$enable_core_odbc_support" != "xno"; then + APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation]) + fi + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl]) + # Get OSX and clang version + osxvrm=`sw_vers -productVersion` # Get version.release.modlevel + osxrel=`echo $osxvrm | cut -d. -f2` # Get release only + clangvers="`clang -v 2>&1 >/dev/null | grep version | sed -e 's/.*version \([[0-9]]*\).*$/\1/'`" + if test "$clangvers" -ge 6; then # Xcode 6 drops std lib search, add it to clang + APR_ADDTO(LDFLAGS, -L/usr/local/lib) + APR_ADDTO(CPPFLAGS, -I/usr/local/include) + fi + if test "$clangvers" -ge 4; then # Xcode 4 / 10.7 and up + APR_ADDTO(CFLAGS, -Wno-deprecated-declarations) + fi + if test "$osxrel" -ge 6; then # 10.6 and up + APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp) + APR_ADDTO(LDFLAGS, -pipe -bind_at_load) + APR_ADDTO(CXXFLAGS, -pipe) + fi + ;; + *-solaris2*) + if test "${enable_64}" = "yes"; then + APR_ADDTO(CPPFLAGS, [-I/opt/64/include]) + APR_ADDTO(LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib]) + APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/64/include]) + APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib]) + else + APR_ADDTO(CPPFLAGS, [-I/opt/include]) + APR_ADDTO(LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib]) + APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/include]) + APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib]) + fi + APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__) + APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid) + APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket) + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid]) + ;; + *dragonfly*) + APR_ADDTO(CPPFLAGS, -I/usr/local/include) + APR_ADDTO(LDFLAGS, -L/usr/local/lib) + APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include) + ;; + *openbsd*) + APR_ADDTO(CPPFLAGS, -I/usr/local/include) + APR_ADDTO(LDFLAGS, -L/usr/local/lib -ltermcap) + APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include) + ;; + *netbsd*) + APR_ADDTO(CPPFLAGS, -I/usr/pkg/include) + APR_ADDTO(LDFLAGS, [-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib]) + APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/pkg/include) + ;; + *bsd*) + APR_ADDTO(CPPFLAGS, -I/usr/local/include) + APR_ADDTO(LDFLAGS, -L/usr/local/lib) + APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include) + APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt]) + ;; + *linux*) + APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt]) + ;; +esac + +APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99) + +# check for usable system MD5 library +AS_CASE([$host], + [*-solaris2*], [AC_CHECK_LIB(md5, MD5Init)], + [*-freebsd*], [AC_CHECK_LIB(md, MD5Init)], + [*-openbsd*|*-netbsd*], [AC_CHECK_FUNCS([MD5Init])]) + +AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent])) +if test "x$have_libz" = "xyes" ; then +APR_ADDTO([PLATFORM_CORE_LIBS], [-lz]) +fi + +PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[ + AM_CONDITIONAL([HAVE_MPG123],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])]) + +PKG_CHECK_MODULES([AMR], [opencore-amrnb >= 0.1.0],[ + AM_CONDITIONAL([HAVE_AMR],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMR],[false])]) + +PKG_CHECK_MODULES([AMRWB], [opencore-amrwb >= 0.1.0 vo-amrwbenc >= 0.1.0],[ + AM_CONDITIONAL([HAVE_AMRWB],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMRWB],[false])]) + +AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no) +AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"]) +AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no) +AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"]) + +save_LIBS="$LIBS" +LIBS= +AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent])) + +AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no) +if test "x$have_libjbig" = "xyes" ; then +SPANDSP_LA_JBIG="-ljbig $LIBS" +AC_SUBST(SPANDSP_LA_JBIG) +fi +LIBS="$save_LIBS" + +AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no) +if test "x$have_liblzma" = "xyes" ; then +SPANDSP_LA_LZMA="-llzma" +AC_SUBST(SPANDSP_LA_LZMA) +fi + +AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no) +if test "x$have_libresolv" = "xyes" ; then +APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv) +fi + +AC_SUBST(SWITCH_AM_CFLAGS) +AC_SUBST(SWITCH_ANSI_CFLAGS) +AC_SUBST(SWITCH_AM_CXXFLAGS) +AC_SUBST(SWITCH_AM_CPPFLAGS) +AC_SUBST(SWITCH_AM_LDFLAGS) +AC_SUBST(ESL_LDFLAGS) +AC_SUBST(PLATFORM_CORE_LDFLAGS) +AC_SUBST(PLATFORM_CORE_LIBS) +AC_SUBST(SOLINK) +AC_SUBST(LIBTOOL_LIB_EXTEN) + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h]) + +# Solaris 11 privilege management +AS_CASE([$host], + [*-*-solaris2.11], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([SOLARIS_PRIVILEGES],[1],[Solaris 11 privilege management])])] +) + + +if test x"$ac_cv_header_wchar_h" = xyes; then + HAVE_WCHAR_H_DEFINE=1 +else + HAVE_WCHAR_H_DEFINE=0 +fi +AC_SUBST(HAVE_WCHAR_H_DEFINE) + +# Needed by Abyss on Solaris: + +if test x"$ac_cv_header_sys_filio_h" = xyes; then + HAVE_SYS_FILIO_H_DEFINE=1 +else + HAVE_SYS_FILIO_H_DEFINE=0 +fi +AC_SUBST(HAVE_SYS_FILIO_H_DEFINE) + +# Needed by Abyss on Solaris: + +if test x"$ac_cv_header_sys_ioctl_h" = xyes; then + HAVE_SYS_IOCTL_H_DEFINE=1 +else + HAVE_SYS_IOCTL_H_DEFINE=0 +fi +AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE) + +if test x"$ac_cv_header_sys_select_h" = xyes; then + HAVE_SYS_SELECT_H_DEFINE=1 +else + HAVE_SYS_SELECT_H_DEFINE=0 +fi +AC_SUBST(HAVE_SYS_SELECT_H_DEFINE) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM + +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_TYPE_SIGNAL +AC_FUNC_STRFTIME +AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll]) +AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups getrusage]) +AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp]) + +# Check availability and return type of strerror_r +# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" +AC_FUNC_STRERROR_R +CPPFLAGS="$save_CPPFLAGS" + +AX_HAVE_CPU_SET + +AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])]) +AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])]) +AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])]) +AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])]) + +AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) + +AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])]) +AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])]) + +AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ +#include +#include ]) + +AC_CHECK_MEMBERS([struct tm.tm_zone],,,[ +#include +#include ]) + +AC_CHECK_DECL([RLIMIT_MEMLOCK], + [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],, + [#ifdef HAVE_SYS_RESOURCE_H + #include + #endif]) + +AC_CHECK_DECL([SCHED_RR], + [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],, + [#ifdef HAVE_SCHED_H + #include + #endif]) + +AC_CHECK_DECL([SCHED_FIFO], + [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],, + [#ifdef HAVE_SCHED_H + #include + #endif]) + +# +# use mlockall only on linux (for now; if available) +# +if test "x${ac_cv_func_mlockall}" = "xyes"; then + AC_MSG_CHECKING([whether to use mlockall]) + case "$host" in + *-linux-*) + AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support]) + AC_MSG_RESULT([yes]) + USE_MLOCKALL=yes + ;; + *-freebsd*) + APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC) + AC_MSG_RESULT([no, broken for non-root users]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + + # + # setrlimit prerequisites + # + if test "x${USE_MLOCKALL}" = "xyes" -a \ + "x${ac_cv_func_setrlimit}" = "xyes" -a \ + "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes" + then + AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users]) + fi +fi + +# +# sched_setcheduler + round-robin scheduler prerequisites +# +if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \ + "x${ac_cv_have_decl_SCHED_RR}" = "xyes" +then + AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler]) +fi +# +# xmlrpc-c checks +# + +AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull) + +HAVE_LIBWWW_SSL_DEFINE=0 +AC_SUBST(HAVE_LIBWWW_SSL_DEFINE) + +DIRECTORY_SEPARATOR="/" +AC_SUBST(DIRECTORY_SEPARATOR) + +va_list_is_array=no +AC_MSG_CHECKING(whether va_list is an array) +AC_TRY_COMPILE([ +#include +], [va_list list1, list2; list1 = list2;], , +va_list_is_array=yes) +AC_MSG_RESULT($va_list_is_array) +if test x"$va_list_is_array" = xyes; then + VA_LIST_IS_ARRAY_DEFINE=1 +else + VA_LIST_IS_ARRAY_DEFINE=0 +fi +AC_SUBST(VA_LIST_IS_ARRAY_DEFINE) + + +AC_MSG_CHECKING(whether compiler has __attribute__) +AC_TRY_COMPILE(, [int x __attribute__((__unused__));], +compiler_has_attribute=yes, +compiler_has_attribute=no) +AC_MSG_RESULT($compiler_has_attribute) +if test x"$compiler_has_attribute" = xyes; then + ATTR_UNUSED="__attribute__((__unused__))" +else + ATTR_UNUSED= +fi +AC_SUBST(ATTR_UNUSED) + + +saved_CFLAGS="$CFLAGS" +AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [ +CFLAGS="$CFLAGS -Wdeclaration-after-statement" +AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no]) +]) +AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement) +if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then + APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement) +fi +CFLAGS="$saved_CFLAGS" + +if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then + saved_CFLAGS="$CFLAGS" + # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off + AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [ + CFLAGS="$CFLAGS -Wno-extended-offsetof" + AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no]) + ]) + AC_MSG_RESULT($ac_cv_clang_extended_offsetof) + if test x"$ac_cv_clang_extended_offsetof" = xyes; then + APR_ADDTO(CFLAGS, -Wno-extended-offsetof) + fi + CFLAGS="$saved_CFLAGS" +fi + +# Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready +# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_h323 mod_khomp +# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed +# +#saved_CFLAGS="$CFLAGS" +#AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [ +#CFLAGS="$CFLAGS -Wunused-but-set-variable" +#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no]) +#]) +#AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable) +#if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then +# APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable) +#fi +#CFLAGS="$saved_CFLAGS" + +AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian])) + +# Checks for integer size +AC_CHECK_SIZEOF(char, 1) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(long long, 8) +AC_TYPE_SIZE_T +AC_CHECK_TYPE(ssize_t, int) + +# Checks for pointer size +AC_CHECK_SIZEOF(void*, 4) + +if test "x$ac_cv_sizeof_voidp" != "x"; then + voidp_size=$ac_cv_sizeof_voidp +else + AC_ERROR([Cannot determine size of void*]) +fi + +if test "$ac_cv_sizeof_short" = "2"; then + short_value=short +fi +if test "$ac_cv_sizeof_int" = "4"; then + int_value=int +fi + +if test "$ac_cv_sizeof_int" = "8"; then + int64_t_fmt='#define SWITCH_INT64_T_FMT "d"' + uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"' + int64_value="int" + long_value=int +elif test "$ac_cv_sizeof_long" = "8"; then + int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"' + uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"' + int64_value="long" + long_value=long + case "$host" in + *pc-solaris2*) + ;; + sparc-*-solaris2*) + ;; + *-solaris2*|*apple-darwin*|*-openbsd*) + if test "$ac_cv_sizeof_long_long" = "8"; then + int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"' + uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"' + int64_value="long long" + long_value="long long" + fi + ;; + esac +elif test "$ac_cv_sizeof_long_long" = "8"; then + int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"' + uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"' + int64_value="long long" + long_value="long long" +elif test "$ac_cv_sizeof_longlong" = "8"; then + int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"' + uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"' + int64_value="__int64" + long_value="__int64" +else + AC_ERROR([could not detect a 64-bit integer type]) +fi + +if test "$ac_cv_type_size_t" = "yes"; then + size_t_value="size_t" +else + size_t_value="switch_int32_t" +fi + +if test "$ac_cv_type_ssize_t" = "yes"; then + ssize_t_value="ssize_t" +else + ssize_t_value="switch_int32_t" +fi + +APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) + +if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"' +elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"' +else + ssize_t_fmt='#error Can not determine the proper size for ssize_t' +fi + +APR_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) + +if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then + size_t_fmt='#define SWITCH_SIZE_T_FMT "d"' +elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then + size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"' +else + size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"' +fi + +# Basically, we have tried to figure out the correct format strings +# for SWITCH types which vary between platforms, but we don't always get +# it right. If you find that we don't get it right for your platform, +# you can override our decision below. +# NOTE: borrowed much of this logic from apr. +case $host in + s390*linux*) + # uniquely, the 31-bit Linux/s390 uses "unsigned long int" + # for size_t rather than "unsigned int": + size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"' + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"' + ;; + *-os2*) + size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"' + ;; + *-openbsd*) + size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"' + ;; + *aix4*|*aix5*) + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"' + size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"' + ;; + *beos*) + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"' + size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"' + ;; + *apple-darwin*) + ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"' + size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"' + ;; +esac + +AC_SUBST(voidp_size) +AC_SUBST(short_value) +AC_SUBST(int_value) +AC_SUBST(long_value) +AC_SUBST(int64_value) +AC_SUBST(size_t_value) +AC_SUBST(ssize_t_value) +AC_SUBST(int64_t_fmt) +AC_SUBST(uint64_t_fmt) +AC_SUBST(ssize_t_fmt) +AC_SUBST(size_t_fmt) + +case $host in + *-openbsd*) + # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does + AC_PATH_PROGS(ZCAT, gzip) + ;; + *) + AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat) + ;; +esac + +AC_PATH_PROGS(BZIP, bzip2) +AC_PATH_PROGS(XZ, xz) +AC_PATH_PROGS(TAR, gtar tar) +AC_PATH_PROGS(WGET, wget) +AC_PATH_PROGS(CURL, curl) +GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh" +AC_SUBST(GETLIB) +GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh" +AC_SUBST(GETG729) +GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh" +AC_SUBST(GETSOUNDS) + +case $host in + *-darwin*) + path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig + path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/ + path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/ + path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/ + path_push_unique PKG_CONFIG_PATH /usr/local/opt/ffmpeg/lib/pkgconfig/ + ;; +esac + +if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then + AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.]) +fi + +# temporary workaround for Debian libldns-dev package bug +if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then + path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config +fi + +module_enabled() { + grep -v -e "\#" -e "^\$" modules.conf | sed 's/|.*//' | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null +} + +AC_ARG_WITH(png, + [AS_HELP_STRING([--without-png], + [disable support for libpng])], + [with_png="$withval"], + [with_png="yes"]) +if test "$with_png" = "yes"; then + PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + PKG_CHECK_MODULES([LIBPNG], [libpng16 >= 1.6.16],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[ + AM_CONDITIONAL([HAVE_PNG],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])]) +else + AM_CONDITIONAL([HAVE_PNG],[false]) +fi + +AC_ARG_WITH(freetype, + [AS_HELP_STRING([--without-freetype], + [disable support for freetype])], + [with_freetype="$withval"], + [with_freetype="yes"]) +if test "$with_freetype" = "yes"; then + PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[ + AM_CONDITIONAL([HAVE_FREETYPE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])]) +else + AM_CONDITIONAL([HAVE_FREETYPE],[false]) +fi + +PKG_CHECK_MODULES([GUMBO], [gumbo >= 0.10.1],[ + AM_CONDITIONAL([HAVE_GUMBO],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GUMBO],[false])]) + +PKG_CHECK_MODULES([FVAD], [libfvad >= 1.0],[ + AM_CONDITIONAL([HAVE_FVAD],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FVAD],[false])]) + +PKG_CHECK_MODULES([TPL], [libtpl >= 1.5],[ + AC_DEFINE([HAVE_LIBTPL],[1],[Define to 1 if you have libtpl])],[ + AC_MSG_RESULT([no])]) + +PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20]) +PKG_CHECK_MODULES([CURL], [libcurl >= 7.19]) +PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8]) +PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1]) +PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[ + AM_CONDITIONAL([HAVE_YAML],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])]) +PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[ + AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])]) +PKG_CHECK_MODULES([LDNS], [libldns-fs >= 1.6.6],[ + AM_CONDITIONAL([HAVE_LDNS],[true])],[ +PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[ + AM_CONDITIONAL([HAVE_LDNS],[true])],[ + AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns]) + AS_IF([test -z "$LDNS_LIBS"],[ + if module_enabled mod_enum; then + AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false]) + fi],[ + AM_CONDITIONAL([HAVE_LDNS],[true])])])]) +PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[ + AM_CONDITIONAL([HAVE_SNDFILE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])]) + +PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[ + AM_CONDITIONAL([HAVE_MPG123],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])]) + +PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[ + AM_CONDITIONAL([HAVE_SHOUT],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])]) + +mp3lame=false +AC_CHECK_LIB([mp3lame], [lame_init],[ + AC_CHECK_HEADER([lame/lame.h],[ + mp3lame=true + AC_SUBST([MP3LAME_LIBS], [-lmp3lame]) + AC_SUBST([MP3LAME_CFLAGS], [$CPPFLAGS])])]) +AM_CONDITIONAL([HAVE_MP3LAME],[$mp3lame]) + +PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 53.35.0],[ + AM_CONDITIONAL([HAVE_AVCODEC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVCODEC],[false])]) + +PKG_CHECK_MODULES([X264], [x264 >= 0.142.2431],[ + AM_CONDITIONAL([HAVE_X264],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_X264],[false])]) + +PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1],[ + AM_CONDITIONAL([HAVE_AVFORMAT],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVFORMAT],[false])]) + +PKG_CHECK_MODULES([AVUTIL], [libavutil >= 54.3.0],[ + AM_CONDITIONAL([HAVE_AVUTIL],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVUTIL],[false])]) + +PKG_CHECK_MODULES([AVRESAMPLE], [libavresample >= 2.1.0],[ + AM_CONDITIONAL([HAVE_AVRESAMPLE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AVRESAMPLE],[false])]) + +PKG_CHECK_MODULES([SWRESAMPLE], [libswresample >= 2.1.0],[ + AM_CONDITIONAL([HAVE_SWRESAMPLE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWRESAMPLE],[false])]) + +PKG_CHECK_MODULES([SWSCALE], [libswscale >= 3.0.0],[ + AM_CONDITIONAL([HAVE_SWSCALE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SWSCALE],[false])]) + +PKG_CHECK_MODULES([VLC], [libvlc >= 2.1.0],[ + AM_CONDITIONAL([HAVE_VLC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_VLC],[false])]) + +PKG_CHECK_MODULES([OPENCV], [opencv >= 2.4.5],[ + AM_CONDITIONAL([HAVE_OPENCV],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPENCV],[false])]) + +PKG_CHECK_MODULES([OPUSFILE_DECODE], [opusfile >= 0.5],[ + AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_DECODE],[false])]) +PKG_CHECK_MODULES([OPUSFILE_ENCODE], [libopusenc >= 0.1],[ + AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUSFILE_ENCODE],[false])]) + + +PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[ + AM_CONDITIONAL([HAVE_MAGICK],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])]) + +PKG_CHECK_MODULES([MAGICK7], [ImageMagick >= 7.0.0],[ + AM_CONDITIONAL([HAVE_MAGICK7],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK7],[false])]) + +PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[ + AM_CONDITIONAL([HAVE_SILK],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])]) + +PKG_CHECK_MODULES([BROADVOICE], [broadvoice >= 0.1.0],[ + AM_CONDITIONAL([HAVE_BROADVOICE],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROADVOICE],[false])]) + +PKG_CHECK_MODULES([ILBC], [ilbc2 >= 0.0.1],[ + AM_CONDITIONAL([HAVE_ILBC],[true])],[ + PKG_CHECK_MODULES([ILBC], [ilbc >= 0.0.1],[ + AM_CONDITIONAL([HAVE_ILBC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_ILBC],[false])])]) + +PKG_CHECK_MODULES([G7221], [g722_1 >= 0.2.0],[ + AM_CONDITIONAL([HAVE_G7221],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_G7221],[false])]) + +codec2="true" +PKG_CHECK_MODULES([CODEC2], [codec2 >= 0.5],[],[ + AC_CHECK_LIB([codec2], [codec2_create],[ + AC_CHECK_HEADERS([codec2/codec2.h],[ + CODEC2_LIBS="-lcodec2" + CODEC2_CFLAGS="" + ], [ + codec2="false" + if module_enabled mod_codec2; then + AC_MSG_ERROR([You must install libcodec2-dev to build mod_codec2]) + else + AC_MSG_RESULT([no]) + fi + ]) + ]) +]) + +AM_CONDITIONAL([HAVE_CODEC2],[$codec2]) + + +PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[ + AM_CONDITIONAL([HAVE_OPUS],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUS],[false])]) + +PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.0],[ + AM_CONDITIONAL([HAVE_SOUNDTOUCH],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SOUNDTOUCH],[false])]) + +flite="true" +PKG_CHECK_MODULES([FLITE], [flite >= 2],[],[ + AC_CHECK_LIB([flite], [flite_init],[ + AC_CHECK_HEADERS([flite/flite.h],[ + FLITE_LIBS="-lflite -lflite_cmu_grapheme_lang -lflite_cmu_grapheme_lex -lflite_cmu_indic_lang -lflite_cmu_indic_lex -lflite_cmulex -lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal16 -lflite_cmu_us_kal -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish" + FLITE_CFLAGS="" + ], [ + flite="false" + if module_enabled mod_flite; then + AC_MSG_ERROR([You must install libflite-dev to build mod_flite]) + else + AC_MSG_RESULT([no]) + fi + ]) + ]) +]) + +AM_CONDITIONAL([HAVE_FLITE],[$flite]) + +PKG_CHECK_MODULES([MONGOC], [libmongoc-1.0 >= 1.0.8],[ + AM_CONDITIONAL([HAVE_MONGOC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MONGOC],[false])]) + +PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[ + AM_CONDITIONAL([HAVE_MEMCACHED],[true]) + MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread" + save_LIBS="${LIBS}" + save_CPPFLAGS="${CPPFLAGS}" + LIBS="${MEMCACHED_LIBS}" + CPPFLAGS="${MEMCACHED_CFLAGS}" + AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute]) + AC_CHECK_TYPES([memcached_instance_st*],,, [[#include ]]) + LIBS="${save_LIBS}" + CPPFLAGS="${save_CPPFLAGS}" +],[ + AC_MSG_RESULT([no]) + AM_CONDITIONAL([HAVE_MEMCACHED],[false]) +]) + +PKG_CHECK_MODULES([V8FS_STATIC], [v8-6.1_static >= 6.1.298],[ + AM_CONDITIONAL([HAVE_V8FS],[true])],[ + PKG_CHECK_MODULES([V8FS_STATIC], [v8fs_static >= 6.1.298],[ + AM_CONDITIONAL([HAVE_V8FS],[true])],[ + PKG_CHECK_MODULES([V8FS_STATIC], [v8 >= 6.1.298],[ + AM_CONDITIONAL([HAVE_V8FS],[true])],[ + if module_enabled mod_v8; then + AC_MSG_ERROR([You need to either install libv8-6.1-dev (>= 6.1.298), libv8fs-dev (>= 6.1.298) or disable mod_v8 in modules.conf]) + else + AC_MSG_RESULT([no]) + AM_CONDITIONAL([HAVE_V8FS],[false]) + fi + ]) + ]) +]) + +PKG_CHECK_MODULES([KS], [libks >= 1.1.0],[ + AM_CONDITIONAL([HAVE_KS],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_KS],[false])]) + +PKG_CHECK_MODULES([SIGNALWIRE_CLIENT], [signalwire_client >= 1.0.0],[ + AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SIGNALWIRE_CLIENT],[false])]) + +PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[ + AM_CONDITIONAL([HAVE_AMQP],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMQP],[false])]) + +PKG_CHECK_MODULES([H2O], [libh2o-evloop >= 0.11.0],[ + AM_CONDITIONAL([HAVE_H2O],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_H2O],[false])]) + +PKG_CHECK_MODULES([BROTLIENC], [libbrotlienc >= 0.1.0],[ + AM_CONDITIONAL([HAVE_BROTLIENC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIENC],[false])]) + +PKG_CHECK_MODULES([BROTLIDEC], [libbrotlidec >= 0.1.0],[ + AM_CONDITIONAL([HAVE_BROTLIDEC],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_BROTLIDEC],[false])]) + +PKG_CHECK_MODULES([TAP], [tap >= 0.1.0],[ + AM_CONDITIONAL([HAVE_TAP],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_TAP],[false])]) + +PKG_CHECK_MODULES([SMPP34], [libsmpp34 >= 1.10],[ + AM_CONDITIONAL([HAVE_SMPP34],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SMPP34],[false])]) + +PKG_CHECK_MODULES([HIREDIS], [hiredis >= 0.10.0],[ + AM_CONDITIONAL([HAVE_HIREDIS],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_HIREDIS],[false])]) + +AC_ARG_ENABLE(core-libedit-support, + [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])]) + +AS_IF([test "x$enable_core_libedit_support" != "xno"],[ + PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[ + AC_MSG_RESULT([no]) + AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit]) + AC_CHECK_LIB([edit], [el_cursor], [ac_cv_has_el_cursor=yes]) + AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS]) + AS_IF([test "x$LIBEDIT_LIBS" = "x"], [ + AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support]) + ])])]) + +dnl DH: Added for including libwebsockets +AC_ARG_WITH(lws, + [AS_HELP_STRING([--with-lws], + [enable support for libwebsockets])], + [with_lws="$withval"], + [with_lws="no"]) +if test "$with_lws" = "yes"; then + PKG_CHECK_MODULES([LWS], [libwebsockets], [ + AM_CONDITIONAL([HAVE_LWS],[true])], [ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LWS],[false])]) +else + AM_CONDITIONAL([HAVE_LWS],[false]) +fi + +dnl DH: Added for including google protobuf libs +AC_ARG_WITH(extra, + [AS_HELP_STRING([--with-extra], + [enable support for extra modules which require google rpc (libgrpc++ and libgrpc)])], + [with_extra="$withval"], + [with_extra="no"]) +if test "$with_extra" = "yes"; then + PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ + AM_CONDITIONAL([HAVE_GRPC],[true])], [ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GRPC],[false])]) +else + AM_CONDITIONAL([HAVE_GRPC],[false]) +fi + +dnl --------------------------------------------------------------------------- +dnl - OpenLDAP SDK +dnl --------------------------------------------------------------------------- + +AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes) +dnl Check for other libraries we need to link with to get the main routines. +test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) } +test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) } +test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes], , -llber -lkrb -ldes) } +test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) } + +if test "$with_ldap" = "yes"; then + if test "$with_ldap_des" = "yes" ; then + OPENLDAP_LIBS="${OPENLDAP_LIBS} -ldes" + fi + if test "$with_ldap_krb" = "yes" ; then + OPENLDAP_LIBS="${OPENLDAP_LIBS} -lkrb" + fi + if test "$with_ldap_lber" = "yes" ; then + OPENLDAP_LIBS="${OPENLDAP_LIBS} -llber" + fi + OPENLDAP_LIBS="${OPENLDAP_LIBS} -lldap" +fi + +AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" = "xyes"]) + +AC_SUBST(OPENLDAP_LIBS) + +AS_IF([test "x$enable_core_libedit_support" != "xno"], [ + # If making changes here, don't forget to run autoheader and + # update libs/esl/src/include/esl_config_auto.h.in manually. + AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available]) +if test x$ac_cv_has_el_cursor = xyes; then + AC_DEFINE([HAVE_EL_CURSOR], [1], [Define to 1 if you have libedit el_cursor support]) +fi + save_LIBS="${LIBS}" + save_CPPFLAGS="${CPPFLAGS}" + LIBS="${LIBEDIT_LIBS}" + CPPFLAGS="${LIBEDIT_CFLAGS}" + AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include ]]) + AC_CHECK_FUNCS([el_wset]) + LIBS="${save_LIBS}" + CPPFLAGS="${save_CPPFLAGS}" +]) + +SAC_OPENSSL + +if test x$HAVE_OPENSSL = x1; then + openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL"; + APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL) + AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])) + AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associaed developement headers required])) + AC_CHECK_LIB(ssl, DTLSv1_2_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLSv1_2_method, 1, [DTLS version 1.2 is available])) +else + AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required]) +fi + +AX_CHECK_JAVA + +AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"]) +AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"]) + +# +# perl checks +# + +AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no]) + +# -a "x$ac_cv_have_EXTERN_h" != "xno" + +if test "x$ac_cv_have_perl" != "xno"; then + PERL=perl + PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`" + PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE" + PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`" + PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL" + PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`" + PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`" + + save_CFLAGS="$CFLAGS" + CFLAGS="$PERL_CFLAGS" + AC_CHECK_HEADER([EXTERN.h], [ac_cv_have_EXTERN_h=yes], [ac_cv_have_EXTERN_h=no], [[#include +# include ]]) + CFLAGS="$save_CFLAGS" + + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$PERL_LDFLAGS" + AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no) + LDFLAGS="$save_LDFLAGS" + + AC_SUBST(PERL_SITEDIR) + AC_SUBST(PERL_LIBDIR) + AC_SUBST(PERL_LIBS) + AC_SUBST(PERL_CFLAGS) + AC_SUBST(PERL_LDFLAGS) + AC_SUBST(PERL_INC) +fi + +AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno" -a "x$ac_cv_use_libperl" != "xno"]) + +# +# php checks +# + +AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no]) +AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no]) +AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"]) + +if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then + PHP=php + PHP_CONFIG=php-config + PHP_LDFLAGS="`$PHP_CONFIG --ldflags`" + PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre2-8|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto|argon2|sodium)//g'`" + PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`" + PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`" + PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`" + PHP_CFLAGS="`$PHP_CONFIG --includes`" + AC_SUBST(PHP_LDFLAGS) + AC_SUBST(PHP_LIBS) + AC_SUBST(PHP_EXT_DIR) + AC_SUBST(PHP_INC_DIR) + AC_SUBST(PHP_INI_DIR) + AC_SUBST(PHP_CFLAGS) +fi + +# +# Python checks for mod_python +# +AC_ARG_WITH( + [python], + [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])], + [with_python="$withval"], + [with_python="try"] +) + +if test "$with_python" != "no" +then + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + + if test "$with_python" != "yes" -a "$with_python" != "try" ; then + AC_MSG_CHECKING([for python]) + if test ! -x "$with_python" ; then + AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python]) + fi + AC_MSG_RESULT([$with_python]) + AC_SUBST([PYTHON], ["$with_python"]) + else + AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"]) + fi + + if test "$PYTHON" != "no" ; then + AC_MSG_CHECKING([python version]) + PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`" + + if test -z "$PYTHON_VER" ; then + AC_MSG_ERROR([Unable to detect python version]) + fi + AC_MSG_RESULT([$PYTHON_VER]) + + AC_MSG_CHECKING([for python distutils]) + python_result="`$PYTHON -c 'import distutils;' 2>&1`" + if test -z "$python_result" ; then + python_has_distutils="yes" + else + python_has_distutils="no" + fi + AC_MSG_RESULT([$python_has_distutils]) + + if test "$python_has_distutils" != "no" ; then + AC_MSG_CHECKING([location of site-packages]) + + PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`" + + if test -z "$PYTHON_SITE_DIR" ; then + AC_MSG_ERROR([Unable to detect python site-packages path]) + elif test ! -d "$PYTHON_SITE_DIR" ; then + AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!]) + fi + AC_MSG_RESULT([$PYTHON_SITE_DIR]) + AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR]) + + # + # python distutils found, get settings from python directly + # + PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`" + PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print(\" \".join(libs));'`" + PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`" + PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`" + + # handle python being installed into /usr/local + AC_MSG_CHECKING([python libdir]) + if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then + PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS" + LIBS="-L$PYTHON_LIBDIR $LIBS" + fi + AC_MSG_RESULT([$PYTHON_LIBDIR]) + + # check libpython + AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"]) + + if test "$has_libpython" = "no" ; then + AS_IF([test "$with_python" = "try"], + [AC_MSG_WARN([$PYTHON_LIB is unusable])], + [AC_MSG_ERROR([$PYTHON_LIB is unusable])] + ) + fi + + # check whether system libpython is usable and has threads support + CFLAGS="$PYTHON_CFLAGS" + LIBS="$PYTHON_LDFLAGS" + AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"]) + + if test "$python_has_threads" = "no"; then + AS_IF([test "$with_python" = "try"], + [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])], + [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])] + ) + else + AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf]) + AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS]) + AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS]) + fi + else + AS_IF([test "$with_python" = "try"], + [AC_MSG_WARN([Could not find or use python distutils module: $python_result])], + [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])] + ) + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + unset python_has_threads + unset python_has_distutils + unset python_result + else + AS_IF([test "$with_python" = "try"], + [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])], + [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])] + ) + fi +else + AC_MSG_WARN([python support disabled, building mod_python will fail!]) +fi + +# +# SNMP checks for mod_snmp +# +AC_PATH_PROG([NET_SNMP_CONFIG], [net-snmp-config], [no]) +if test "$NET_SNMP_CONFIG" != "no"; then + AC_MSG_CHECKING([for Net-SNMP libraries via net-snmp-config]) + SNMP_LIBS="`$NET_SNMP_CONFIG --base-agent-libs`" +else + # net-snmp-config not in path, fallback to sensible defaults + SNMP_LIBS="-lnetsnmpmibs -lnetsnmpagent -lnetsnmp" +fi + +# fix linking error on Solaris patched Net-SNMP +AS_CASE([$host], [*-solaris2*], [AC_CHECK_LIB([dladm], [dladm_open], [SNMP_LIBS="$SNMP_LIBS -ldladm"])]) +AC_SUBST(SNMP_LIBS) + +CHECK_ERLANG + +# Enable clang address sanitizer bit build +AC_ARG_ENABLE(address_sanitizer, + [AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])], + [enable_address_sanitizer="$enable_address_sanitizer"], + [enable_address_sanitizer="no"]) + +if test "${enable_address_sanitizer}" = "yes"; then + APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong) + APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong) + APR_ADDTO(LDFLAGS, -fsanitize=address) +fi + +AC_ARG_ENABLE(, + [AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])], + [enable_pool_sanitizer="$enable_pool_sanitizer"], + [enable_pool_sanitizer="no"]) + +if test "${enable_pool_sanitizer}" = "yes"; then + APR_ADDTO(CFLAGS, -DDESTROY_POOLS) + ac_configure_args="$ac_configure_args --enable-pool-debug=yes" +fi + +# we never use this, and hard setting it will make cross compile work better +ac_cv_file_dbd_apr_dbd_mysql_c=no + +AC_CONFIG_FILES([Makefile + build/Makefile + tests/unit/Makefile + src/Makefile + src/mod/Makefile + src/mod/applications/mod_audio_fork/Makefile + src/mod/applications/mod_aws_lex/Makefile + src/mod/applications/mod_aws_transcribe/Makefile + src/mod/applications/mod_google_tts/Makefile + src/mod/applications/mod_google_transcribe/Makefile + src/mod/applications/mod_dialogflow/Makefile + src/mod/applications/mod_abstraction/Makefile + src/mod/applications/mod_avmd/Makefile + src/mod/applications/mod_bert/Makefile + src/mod/applications/mod_blacklist/Makefile + src/mod/applications/mod_callcenter/Makefile + src/mod/applications/mod_cidlookup/Makefile + src/mod/applications/mod_cluechoo/Makefile + src/mod/applications/mod_commands/Makefile + src/mod/applications/mod_conference/Makefile + src/mod/applications/mod_curl/Makefile + src/mod/applications/mod_cv/Makefile + src/mod/applications/mod_db/Makefile + src/mod/applications/mod_directory/Makefile + src/mod/applications/mod_distributor/Makefile + src/mod/applications/mod_dptools/Makefile + src/mod/applications/mod_easyroute/Makefile + src/mod/applications/mod_enum/Makefile + src/mod/applications/mod_esf/Makefile + src/mod/applications/mod_esl/Makefile + src/mod/applications/mod_expr/Makefile + src/mod/applications/mod_fifo/Makefile + src/mod/applications/mod_fsk/Makefile + src/mod/applications/mod_fsv/Makefile + src/mod/applications/mod_hash/Makefile + src/mod/applications/mod_hiredis/Makefile + src/mod/applications/mod_httapi/Makefile + src/mod/applications/mod_http_cache/Makefile + src/mod/applications/mod_ladspa/Makefile + src/mod/applications/mod_lcr/Makefile + src/mod/applications/mod_limit/Makefile + src/mod/applications/mod_memcache/Makefile + src/mod/applications/mod_mongo/Makefile + src/mod/applications/mod_mp4/Makefile + src/mod/applications/mod_mp4v2/Makefile + src/mod/applications/mod_nibblebill/Makefile + src/mod/applications/mod_oreka/Makefile + src/mod/applications/mod_osp/Makefile + src/mod/applications/mod_prefix/Makefile + src/mod/applications/mod_rad_auth/Makefile + src/mod/applications/mod_random/Makefile + src/mod/applications/mod_redis/Makefile + src/mod/applications/mod_rss/Makefile + src/mod/applications/mod_skel/Makefile + src/mod/applications/mod_signalwire/Makefile + src/mod/applications/mod_sms/Makefile + src/mod/applications/mod_sms_flowroute/Makefile + src/mod/applications/mod_snapshot/Makefile + src/mod/applications/mod_snom/Makefile + src/mod/applications/mod_sonar/Makefile + src/mod/applications/mod_soundtouch/Makefile + src/mod/applications/mod_spandsp/Makefile + src/mod/applications/mod_spy/Makefile + src/mod/applications/mod_stress/Makefile + src/mod/applications/mod_test/Makefile + src/mod/applications/mod_translate/Makefile + src/mod/applications/mod_valet_parking/Makefile + src/mod/applications/mod_vmd/Makefile + src/mod/applications/mod_voicemail/Makefile + src/mod/applications/mod_voicemail_ivr/Makefile + src/mod/asr_tts/mod_cepstral/Makefile + src/mod/asr_tts/mod_flite/Makefile + src/mod/asr_tts/mod_pocketsphinx/Makefile + src/mod/asr_tts/mod_tts_commandline/Makefile + src/mod/asr_tts/mod_unimrcp/Makefile + src/mod/codecs/mod_amr/Makefile + src/mod/codecs/mod_amrwb/Makefile + src/mod/codecs/mod_b64/Makefile + src/mod/codecs/mod_bv/Makefile + src/mod/codecs/mod_clearmode/Makefile + src/mod/codecs/mod_codec2/Makefile + src/mod/codecs/mod_com_g729/Makefile + src/mod/codecs/mod_dahdi_codec/Makefile + src/mod/codecs/mod_g723_1/Makefile + src/mod/codecs/mod_g729/Makefile + src/mod/codecs/mod_h26x/Makefile + src/mod/codecs/mod_ilbc/Makefile + src/mod/codecs/mod_isac/Makefile + src/mod/codecs/mod_mp4v/Makefile + src/mod/codecs/mod_opus/Makefile + src/mod/codecs/mod_openh264/Makefile + src/mod/codecs/mod_sangoma_codec/Makefile + src/mod/codecs/mod_silk/Makefile + src/mod/codecs/mod_siren/Makefile + src/mod/codecs/mod_skel_codec/Makefile + src/mod/codecs/mod_theora/Makefile + src/mod/databases/mod_mariadb/Makefile + src/mod/databases/mod_pgsql/Makefile + src/mod/dialplans/mod_dialplan_asterisk/Makefile + src/mod/dialplans/mod_dialplan_directory/Makefile + src/mod/dialplans/mod_dialplan_xml/Makefile + src/mod/directories/mod_ldap/Makefile + src/mod/endpoints/mod_alsa/Makefile + src/mod/endpoints/mod_dingaling/Makefile + src/mod/endpoints/mod_gsmopen/Makefile + src/mod/endpoints/mod_h323/Makefile + src/mod/endpoints/mod_khomp/Makefile + src/mod/endpoints/mod_loopback/Makefile + src/mod/endpoints/mod_opal/Makefile + src/mod/endpoints/mod_portaudio/Makefile + src/mod/endpoints/mod_reference/Makefile + src/mod/endpoints/mod_rtmp/Makefile + src/mod/endpoints/mod_skinny/Makefile + src/mod/endpoints/mod_sofia/Makefile + src/mod/endpoints/mod_unicall/Makefile + src/mod/endpoints/mod_rtc/Makefile + src/mod/endpoints/mod_verto/Makefile + src/mod/event_handlers/mod_amqp/Makefile + src/mod/event_handlers/mod_cdr_csv/Makefile + src/mod/event_handlers/mod_cdr_mongodb/Makefile + src/mod/event_handlers/mod_cdr_pg_csv/Makefile + src/mod/event_handlers/mod_cdr_sqlite/Makefile + src/mod/event_handlers/mod_erlang_event/Makefile + src/mod/event_handlers/mod_event_multicast/Makefile + src/mod/event_handlers/mod_event_socket/Makefile + src/mod/event_handlers/mod_event_test/Makefile + src/mod/event_handlers/mod_fail2ban/Makefile + src/mod/event_handlers/mod_format_cdr/Makefile + src/mod/event_handlers/mod_json_cdr/Makefile + src/mod/event_handlers/mod_kazoo/Makefile + src/mod/event_handlers/mod_radius_cdr/Makefile + src/mod/event_handlers/mod_odbc_cdr/Makefile + src/mod/event_handlers/mod_rayo/Makefile + src/mod/event_handlers/mod_smpp/Makefile + src/mod/event_handlers/mod_snmp/Makefile + src/mod/event_handlers/mod_event_zmq/Makefile + src/mod/formats/mod_imagick/Makefile + src/mod/formats/mod_local_stream/Makefile + src/mod/formats/mod_native_file/Makefile + src/mod/formats/mod_opusfile/Makefile + src/mod/formats/mod_png/Makefile + src/mod/formats/mod_shell_stream/Makefile + src/mod/formats/mod_shout/Makefile + src/mod/formats/mod_sndfile/Makefile + src/mod/formats/mod_ssml/Makefile + src/mod/formats/mod_tone_stream/Makefile + src/mod/formats/mod_vlc/Makefile + src/mod/formats/mod_portaudio_stream/Makefile + src/mod/languages/mod_java/Makefile + src/mod/languages/mod_lua/Makefile + src/mod/languages/mod_managed/Makefile + src/mod/languages/mod_perl/Makefile + src/mod/languages/mod_python/Makefile + src/mod/languages/mod_v8/Makefile + src/mod/languages/mod_yaml/Makefile + src/mod/languages/mod_basic/Makefile + src/mod/loggers/mod_console/Makefile + src/mod/loggers/mod_graylog2/Makefile + src/mod/loggers/mod_logfile/Makefile + src/mod/loggers/mod_syslog/Makefile + src/mod/loggers/mod_raven/Makefile + src/mod/say/mod_say_de/Makefile + src/mod/say/mod_say_en/Makefile + src/mod/say/mod_say_es/Makefile + src/mod/say/mod_say_es_ar/Makefile + src/mod/say/mod_say_fa/Makefile + src/mod/say/mod_say_fr/Makefile + src/mod/say/mod_say_he/Makefile + src/mod/say/mod_say_hr/Makefile + src/mod/say/mod_say_hu/Makefile + src/mod/say/mod_say_it/Makefile + src/mod/say/mod_say_ja/Makefile + src/mod/say/mod_say_nl/Makefile + src/mod/say/mod_say_pl/Makefile + src/mod/say/mod_say_pt/Makefile + src/mod/say/mod_say_ru/Makefile + src/mod/say/mod_say_sv/Makefile + src/mod/say/mod_say_th/Makefile + src/mod/say/mod_say_zh/Makefile + src/mod/timers/mod_posix_timer/Makefile + src/mod/timers/mod_timerfd/Makefile + src/mod/xml_int/mod_xml_cdr/Makefile + src/mod/xml_int/mod_xml_curl/Makefile + src/mod/xml_int/mod_xml_ldap/Makefile + src/mod/xml_int/mod_xml_radius/Makefile + src/mod/xml_int/mod_xml_rpc/Makefile + src/mod/xml_int/mod_xml_scgi/Makefile + src/mod/applications/mod_av/Makefile + src/mod/applications/mod_video_filter/Makefile + src/include/switch_am_config.h + build/getsounds.sh + build/getlib.sh + build/getg729.sh + build/freeswitch.pc + build/standalone_module/freeswitch.pc + build/modmake.rules + libs/esl/Makefile + libs/esl/perl/Makefile + libs/esl/php/Makefile + libs/xmlrpc-c/include/xmlrpc-c/config.h + libs/xmlrpc-c/xmlrpc_config.h + libs/xmlrpc-c/config.mk + libs/xmlrpc-c/srcdir.mk + libs/xmlrpc-c/stamp-h + scripts/gentls_cert]) + +AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux]) +AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin]) +AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD]) +AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64]) + +AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ]) +AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ]) + +#some vars to sub into the Makefile.am's +#LIBS+=> core.log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat core.log;fi;if test "$$error" = "yes";then exit 1;fi +LIBTOOL='$(SHELL) $(switch_builddir)/libtool' +TOUCH_TARGET='if test -f "$@";then touch "$@";fi;' +CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' +CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed "s/|.*//" | sed -e "s|^.*/||" | sort | uniq )' +OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )' +OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' +OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' +OUR_UNINSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )' +OUR_TEST_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-print_tests ; done )"; echo $$mods )' +OUR_CHECK_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-check ; done )"; echo $$mods )' +OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )' +OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' +OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' +OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )' + +#AM_MAKEFLAGS='"OUR_MODULES=$(OUR_MODS)" "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" `test -n "$(VERBOSE)" || echo -s`' +#AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`' +AC_SUBST(LIBTOOL) +AC_SUBST(TOUCH_TARGET) +AC_SUBST(CONF_DISABLED_MODULES) +AC_SUBST(CONF_MODULES) + +AC_SUBST(OUR_MODS) +AC_SUBST(OUR_CLEAN_MODS) +AC_SUBST(OUR_TEST_MODS) +AC_SUBST(OUR_CHECK_MODS) +AC_SUBST(OUR_INSTALL_MODS) +AC_SUBST(OUR_UNINSTALL_MODS) +AC_SUBST(OUR_DISABLED_MODS) +AC_SUBST(OUR_DISABLED_CLEAN_MODS) +AC_SUBST(OUR_DISABLED_INSTALL_MODS) +AC_SUBST(OUR_DISABLED_UNINSTALL_MODS) +AC_SUBST(AM_MAKEFLAGS) + +ac_configure_args="$ac_configure_args --with-modinstdir=${modulesdir} CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' " + +# --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \ +# --localstatedir='$localstatedir' --datadir='$datadir'" + +# Run configure in all the subdirs +AC_CONFIG_SUBDIRS([libs/srtp]) +if test "$use_system_apr" != "yes"; then + AC_CONFIG_SUBDIRS([libs/apr]) +fi +if test "$use_system_aprutil" != "yes"; then + AC_CONFIG_SUBDIRS([libs/apr-util]) +fi +AC_CONFIG_SUBDIRS([libs/iksemel]) +AC_CONFIG_SUBDIRS([libs/libdingaling]) +AC_CONFIG_SUBDIRS([libs/freetdm]) +AC_CONFIG_SUBDIRS([libs/unimrcp]) +if test "x${enable_zrtp}" = "xyes"; then + AC_CONFIG_SUBDIRS([libs/libzrtp]) +fi + +case $host in + *-openbsd*|*-netbsd*) + # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid + AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool]) + ;; +esac + + +AC_OUTPUT + +## +## Configuration summary +## + +echo +echo "-------------------------- FreeSWITCH configuration --------------------------" +echo "" +echo " Locations:" +echo "" +echo " prefix: ${prefix}" +echo " exec_prefix: ${exec_prefix}" +echo " bindir: ${bindir}" +echo " confdir: ${confdir}" +echo " libdir: ${libdir}" +echo " datadir: ${datadir}" +echo " localstatedir: ${localstatedir}" +echo " includedir: ${includedir}" +echo "" +echo " certsdir: ${certsdir}" +echo " dbdir: ${dbdir}" +echo " grammardir: ${grammardir}" +echo " htdocsdir: ${htdocsdir}" +echo " fontsdir: ${fontsdir}" +echo " logfiledir: ${logfiledir}" +echo " modulesdir: ${modulesdir}" +echo " pkgconfigdir: ${pkgconfigdir}" +echo " recordingsdir: ${recordingsdir}" +echo " imagesdir: ${imagesdir}" +echo " runtimedir: ${runtimedir}" +echo " scriptdir: ${scriptdir}" +echo " soundsdir: ${soundsdir}" +echo " storagedir: ${storagedir}" +echo " cachedir: ${cachedir}" +echo "" +echo "------------------------------------------------------------------------------" diff --git a/packer/jambonz-feature-server/files/configure.ac.grpc.patch b/packer/jambonz-feature-server/files/configure.ac.grpc.patch deleted file mode 100644 index f030a1b..0000000 --- a/packer/jambonz-feature-server/files/configure.ac.grpc.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- configure.ac 2019-10-22 22:47:40.566582350 +0000 -+++ configure.ac.new 2019-10-23 14:56:29.469206772 +0000 -@@ -1563,6 +1563,20 @@ - AM_CONDITIONAL([HAVE_LWS],[false]) - fi - -++dnl DH: Added for including google protobuf libs -++AC_ARG_WITH(grpc, -+ [AS_HELP_STRING([--with-grpc], -+ [enable support for google rpc (libgrpc++ and libgrpc)])], -+ [with_grpc="$withval"], -+ [with_grpc="no"]) -+if test "$with_grpc" = "yes"; then -+ PKG_CHECK_MODULES([GRPC], [grpc++ grpc], [ -+ AM_CONDITIONAL([HAVE_GRPC],[true])], [ -+ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GRPC],[false])]) -+else -+ AM_CONDITIONAL([HAVE_GRPC],[false]) -+fi -+ - dnl --------------------------------------------------------------------------- - dnl - OpenLDAP SDK - dnl --------------------------------------------------------------------------- -@@ -1858,6 +1872,9 @@ - src/Makefile - src/mod/Makefile - src/mod/applications/mod_audio_fork/Makefile -+ src/mod/applications/mod_google_tts/Makefile -+ src/mod/applications/mod_google_transcribe/Makefile -+ src/mod/applications/mod_dialogflow/Makefile - src/mod/applications/mod_abstraction/Makefile - src/mod/applications/mod_avmd/Makefile - src/mod/applications/mod_bert/Makefile diff --git a/packer/jambonz-feature-server/files/configure.ac.patch b/packer/jambonz-feature-server/files/configure.ac.patch deleted file mode 100644 index f1baabc..0000000 --- a/packer/jambonz-feature-server/files/configure.ac.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- configure.ac 2019-09-30 19:01:33.308021065 +0000 -+++ configure.ac.new 2019-09-30 23:00:53.730843843 +0000 -@@ -13,7 +13,7 @@ - AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) - - AC_CONFIG_AUX_DIR(build/config) --AM_INIT_AUTOMAKE -+AM_INIT_AUTOMAKE([subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - AC_CONFIG_SRCDIR([src/switch.c]) - AC_CONFIG_HEADER([src/include/switch_private.h]) -@@ -1549,6 +1549,20 @@ - AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support]) - ])])]) - -+dnl DH: Added for including libwebsockets -+AC_ARG_WITH(lws, -+ [AS_HELP_STRING([--with-lws], -+ [enable support for libwebsockets])], -+ [with_lws="$withval"], -+ [with_lws="no"]) -+if test "$with_lws" = "yes"; then -+ PKG_CHECK_MODULES([LWS], [libwebsockets], [ -+ AM_CONDITIONAL([HAVE_LWS],[true])], [ -+ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LWS],[false])]) -+else -+ AM_CONDITIONAL([HAVE_LWS],[false]) -+fi -+ - dnl --------------------------------------------------------------------------- - dnl - OpenLDAP SDK - dnl --------------------------------------------------------------------------- -@@ -1843,6 +1857,7 @@ - tests/unit/Makefile - src/Makefile - src/mod/Makefile -+ src/mod/applications/mod_audio_fork/Makefile - src/mod/applications/mod_abstraction/Makefile - src/mod/applications/mod_avmd/Makefile - src/mod/applications/mod_bert/Makefile diff --git a/packer/jambonz-feature-server/files/modules.conf.in.extra b/packer/jambonz-feature-server/files/modules.conf.in.extra new file mode 100644 index 0000000..a07c5eb --- /dev/null +++ b/packer/jambonz-feature-server/files/modules.conf.in.extra @@ -0,0 +1,180 @@ +applications/mod_audio_fork +applications/mod_aws_lex +applications/mod_aws_transcribe +applications/mod_google_tts +applications/mod_google_transcribe +applications/mod_dialogflow +#applications/mod_abstraction +#applications/mod_av +#applications/mod_avmd +#applications/mod_bert +#applications/mod_blacklist +#applications/mod_callcenter +#applications/mod_cidlookup +#applications/mod_cluechoo +applications/mod_commands +applications/mod_conference +#applications/mod_curl +#applications/mod_cv +#applications/mod_db +#applications/mod_directory +#applications/mod_distributor +applications/mod_dptools +#applications/mod_easyroute +#applications/mod_enum +#applications/mod_esf +#applications/mod_esl +#applications/mod_expr +#applications/mod_fifo +#applications/mod_fsk +#applications/mod_fsv +#applications/mod_hash +#applications/mod_hiredis +applications/mod_httapi +#applications/mod_http_cache +#applications/mod_ladspa +#applications/mod_lcr +#applications/mod_memcache +#applications/mod_mongo +#applications/mod_mp4 +#applications/mod_mp4v2 +#applications/mod_nibblebill +#applications/mod_oreka +#applications/mod_osp +#applications/mod_prefix +#applications/mod_rad_auth +#applications/mod_redis +#applications/mod_rss +#applications/mod_signalwire +#applications/mod_sms +#applications/mod_sms_flowroute +#applications/mod_snapshot +#applications/mod_snom +#applications/mod_sonar +#applications/mod_soundtouch +applications/mod_spandsp +#applications/mod_spy +#applications/mod_stress +#applications/mod_translate +#applications/mod_valet_parking +#applications/mod_video_filter +#applications/mod_vmd +#applications/mod_voicemail +#applications/mod_voicemail_ivr +#asr_tts/mod_cepstral +#asr_tts/mod_flite +#asr_tts/mod_pocketsphinx +#asr_tts/mod_tts_commandline +#asr_tts/mod_unimrcp +codecs/mod_amr +#codecs/mod_amrwb +#codecs/mod_b64 +#codecs/mod_bv +#codecs/mod_clearmode +#codecs/mod_codec2 +#codecs/mod_com_g729 +#codecs/mod_dahdi_codec +codecs/mod_g723_1 +codecs/mod_g729 +codecs/mod_h26x +#codecs/mod_ilbc +#codecs/mod_isac +#codecs/mod_mp4v +codecs/mod_opus +#codecs/mod_sangoma_codec +#codecs/mod_silk +#codecs/mod_siren +#codecs/mod_theora +#databases/mod_mariadb +#databases/mod_pgsql +#dialplans/mod_dialplan_asterisk +#dialplans/mod_dialplan_directory +dialplans/mod_dialplan_xml +#directories/mod_ldap +#endpoints/mod_alsa +#endpoints/mod_dingaling +#endpoints/mod_gsmopen +#endpoints/mod_h323 +#endpoints/mod_khomp +#endpoints/mod_loopback +#endpoints/mod_opal +#endpoints/mod_portaudio +endpoints/mod_rtc +#endpoints/mod_rtmp +#endpoints/mod_skinny +endpoints/mod_sofia +#endpoints/mod_verto +#event_handlers/mod_amqp +event_handlers/mod_cdr_csv +#event_handlers/mod_cdr_mongodb +#event_handlers/mod_cdr_pg_csv +#event_handlers/mod_cdr_sqlite +#event_handlers/mod_erlang_event +#event_handlers/mod_event_multicast +event_handlers/mod_event_socket +#event_handlers/mod_fail2ban +#event_handlers/mod_format_cdr +#event_handlers/mod_json_cdr +#event_handlers/mod_radius_cdr +#event_handlers/mod_odbc_cdr +#event_handlers/mod_kazoo +#event_handlers/mod_rayo +#event_handlers/mod_smpp +#event_handlers/mod_snmp +#event_handlers/mod_event_zmq +#formats/mod_imagick +formats/mod_local_stream +formats/mod_native_file +#formats/mod_png +#formats/mod_portaudio_stream +#formats/mod_shell_stream +formats/mod_shout +formats/mod_sndfile +#formats/mod_ssml +formats/mod_tone_stream +#formats/mod_vlc +formats/mod_opusfile +#languages/mod_basic +#languages/mod_java +#languages/mod_lua +#languages/mod_managed +#languages/mod_perl +#languages/mod_python +#languages/mod_v8 +#languages/mod_yaml +loggers/mod_console +#loggers/mod_graylog2 +loggers/mod_logfile +loggers/mod_syslog +#loggers/mod_raven +#say/mod_say_de +say/mod_say_en +#say/mod_say_es +#say/mod_say_es_ar +#say/mod_say_fa +#say/mod_say_fr +#say/mod_say_he +#say/mod_say_hr +#say/mod_say_hu +#say/mod_say_it +#say/mod_say_ja +#say/mod_say_nl +#say/mod_say_pl +#say/mod_say_pt +#say/mod_say_ru +#say/mod_say_sv +#say/mod_say_th +#say/mod_say_zh +#timers/mod_posix_timer +#timers/mod_timerfd +xml_int/mod_xml_cdr +#xml_int/mod_xml_curl +#xml_int/mod_xml_ldap +#xml_int/mod_xml_radius +#xml_int/mod_xml_rpc +#xml_int/mod_xml_scgi + +#../../libs/freetdm/mod_freetdm + +## Experimental Modules (don't cry if they're broken) +#../../contrib/mod/xml_int/mod_xml_odbc diff --git a/packer/jambonz-feature-server/files/modules.conf.in.grpc.patch b/packer/jambonz-feature-server/files/modules.conf.in.grpc.patch deleted file mode 100644 index 4d43e27..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.in.grpc.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- modules.conf.in 2019-10-23 15:09:23.114079884 +0000 -+++ modules.conf.in.new 2019-10-23 15:10:08.330364591 +0000 -@@ -1,4 +1,7 @@ - applications/mod_audio_fork -+applications/mod_google_tts -+applications/mod_google_transcribe -+applications/mod_dialogflow - #applications/mod_abstraction - applications/mod_av - #applications/mod_avmd diff --git a/packer/jambonz-feature-server/files/modules.conf.in.patch b/packer/jambonz-feature-server/files/modules.conf.in.patch deleted file mode 100644 index a470b5c..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.in.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- modules.conf.in 2019-09-25 08:55:34.000000000 -0400 -+++ modules.conf.in.new 2020-01-02 10:36:07.000000000 -0500 -@@ -1,5 +1,6 @@ -+applications/mod_audio_fork - #applications/mod_abstraction --applications/mod_av -+#applications/mod_av - #applications/mod_avmd - #applications/mod_bert - #applications/mod_blacklist -@@ -10,19 +11,19 @@ - applications/mod_conference - #applications/mod_curl - #applications/mod_cv --applications/mod_db -+#applications/mod_db - #applications/mod_directory - #applications/mod_distributor - applications/mod_dptools - #applications/mod_easyroute --applications/mod_enum --applications/mod_esf -+#applications/mod_enum -+#applications/mod_esf - #applications/mod_esl --applications/mod_expr --applications/mod_fifo -+#applications/mod_expr -+#applications/mod_fifo - #applications/mod_fsk --applications/mod_fsv --applications/mod_hash -+#applications/mod_fsv -+#applications/mod_hash - #applications/mod_hiredis - applications/mod_httapi - #applications/mod_http_cache -@@ -39,8 +40,8 @@ - #applications/mod_rad_auth - #applications/mod_redis - #applications/mod_rss --applications/mod_signalwire --applications/mod_sms -+#applications/mod_signalwire -+#applications/mod_sms - #applications/mod_sms_flowroute - #applications/mod_snapshot - #applications/mod_snom -@@ -50,10 +51,10 @@ - #applications/mod_spy - #applications/mod_stress - #applications/mod_translate --applications/mod_valet_parking -+#applications/mod_valet_parking - #applications/mod_video_filter - #applications/mod_vmd --applications/mod_voicemail -+#applications/mod_voicemail - #applications/mod_voicemail_ivr - #asr_tts/mod_cepstral - #asr_tts/mod_flite -@@ -62,7 +63,7 @@ - #asr_tts/mod_unimrcp - codecs/mod_amr - #codecs/mod_amrwb --codecs/mod_b64 -+#codecs/mod_b64 - #codecs/mod_bv - #codecs/mod_clearmode - #codecs/mod_codec2 -@@ -80,8 +81,8 @@ - #codecs/mod_siren - #codecs/mod_theora - #databases/mod_mariadb --databases/mod_pgsql --dialplans/mod_dialplan_asterisk -+#databases/mod_pgsql -+#dialplans/mod_dialplan_asterisk - #dialplans/mod_dialplan_directory - dialplans/mod_dialplan_xml - #directories/mod_ldap -@@ -90,19 +91,19 @@ - #endpoints/mod_gsmopen - #endpoints/mod_h323 - #endpoints/mod_khomp --endpoints/mod_loopback -+#endpoints/mod_loopback - #endpoints/mod_opal - #endpoints/mod_portaudio - endpoints/mod_rtc - #endpoints/mod_rtmp --endpoints/mod_skinny -+#endpoints/mod_skinny - endpoints/mod_sofia --endpoints/mod_verto -+#endpoints/mod_verto - #event_handlers/mod_amqp - event_handlers/mod_cdr_csv - #event_handlers/mod_cdr_mongodb - #event_handlers/mod_cdr_pg_csv --event_handlers/mod_cdr_sqlite -+#event_handlers/mod_cdr_sqlite - #event_handlers/mod_erlang_event - #event_handlers/mod_event_multicast - event_handlers/mod_event_socket -@@ -119,18 +120,18 @@ - #formats/mod_imagick - formats/mod_local_stream - formats/mod_native_file --formats/mod_png -+#formats/mod_png - #formats/mod_portaudio_stream - #formats/mod_shell_stream --#formats/mod_shout -+formats/mod_shout - formats/mod_sndfile - #formats/mod_ssml - formats/mod_tone_stream - #formats/mod_vlc --#formats/mod_opusfile -+formats/mod_opusfile - #languages/mod_basic - #languages/mod_java --languages/mod_lua -+#languages/mod_lua - #languages/mod_managed - #languages/mod_perl - #languages/mod_python -@@ -165,8 +166,8 @@ - #xml_int/mod_xml_curl - #xml_int/mod_xml_ldap - #xml_int/mod_xml_radius --xml_int/mod_xml_rpc --xml_int/mod_xml_scgi -+#xml_int/mod_xml_rpc -+#xml_int/mod_xml_scgi - - #../../libs/freetdm/mod_freetdm - diff --git a/packer/jambonz-feature-server/files/modules.conf.patch b/packer/jambonz-feature-server/files/modules.conf.patch deleted file mode 100644 index cc29321..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.patch +++ /dev/null @@ -1,118 +0,0 @@ ---- modules.conf 2017-04-25 18:44:46.772490196 +0000 -+++ modules.conf.new 2017-04-25 18:47:05.967886830 +0000 -@@ -10,19 +10,19 @@ - applications/mod_conference - #applications/mod_curl - #applications/mod_cv --applications/mod_db -+#applications/mod_db - #applications/mod_directory - #applications/mod_distributor - applications/mod_dptools - #applications/mod_easyroute --applications/mod_enum --applications/mod_esf -+#applications/mod_enum -+#applications/mod_esf - #applications/mod_esl - applications/mod_expr --applications/mod_fifo -+#applications/mod_fifo - #applications/mod_fsk --applications/mod_fsv --applications/mod_hash -+#applications/mod_fsv -+#applications/mod_hash - #applications/mod_hiredis - applications/mod_httapi - #applications/mod_http_cache -@@ -39,19 +39,19 @@ - #applications/mod_rad_auth - #applications/mod_redis - #applications/mod_rss --applications/mod_sms -+#applications/mod_sms - #applications/mod_sms_flowroute - #applications/mod_snapshot - #applications/mod_snom - #applications/mod_sonar - #applications/mod_soundtouch --applications/mod_spandsp -+#applications/mod_spandsp - #applications/mod_spy - #applications/mod_stress - #applications/mod_translate --applications/mod_valet_parking -+#applications/mod_valet_parking - #applications/mod_vmd --applications/mod_voicemail -+#applications/mod_voicemail - #applications/mod_voicemail_ivr - #asr_tts/mod_cepstral - #asr_tts/mod_flite -@@ -67,7 +67,7 @@ - #codecs/mod_com_g729 - #codecs/mod_dahdi_codec - codecs/mod_g723_1 --codecs/mod_g729 -+#codecs/mod_g729 - codecs/mod_h26x - #codecs/mod_ilbc - #codecs/mod_isac -@@ -77,7 +77,7 @@ - #codecs/mod_silk - #codecs/mod_siren - #codecs/mod_theora --dialplans/mod_dialplan_asterisk -+#dialplans/mod_dialplan_asterisk - #dialplans/mod_dialplan_directory - dialplans/mod_dialplan_xml - #directories/mod_ldap -@@ -89,17 +89,17 @@ - endpoints/mod_loopback - #endpoints/mod_opal - #endpoints/mod_portaudio --endpoints/mod_rtc -+#endpoints/mod_rtc - #endpoints/mod_rtmp --endpoints/mod_skinny -+#endpoints/mod_skinny - #endpoints/mod_skypopen - endpoints/mod_sofia --endpoints/mod_verto -+#endpoints/mod_verto - #event_handlers/mod_amqp --event_handlers/mod_cdr_csv -+#event_handlers/mod_cdr_csv - #event_handlers/mod_cdr_mongodb - #event_handlers/mod_cdr_pg_csv --event_handlers/mod_cdr_sqlite -+#event_handlers/mod_cdr_sqlite - #event_handlers/mod_erlang_event - #event_handlers/mod_event_multicast - event_handlers/mod_event_socket -@@ -125,7 +125,7 @@ - #formats/mod_vlc - #languages/mod_basic - #languages/mod_java --languages/mod_lua -+#languages/mod_lua - #languages/mod_managed - #languages/mod_perl - #languages/mod_python -@@ -155,12 +155,12 @@ - #say/mod_say_zh - #timers/mod_posix_timer - #timers/mod_timerfd --xml_int/mod_xml_cdr -+#xml_int/mod_xml_cdr - #xml_int/mod_xml_curl - #xml_int/mod_xml_ldap - #xml_int/mod_xml_radius --xml_int/mod_xml_rpc --xml_int/mod_xml_scgi -+#xml_int/mod_xml_rpc -+#xml_int/mod_xml_scgi - - #../../libs/freetdm/mod_freetdm - diff --git a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc b/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.extra similarity index 98% rename from packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc rename to packer/jambonz-feature-server/files/modules.conf.vanilla.xml.extra index beee2ad..3eee100 100644 --- a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc +++ b/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.extra @@ -1,6 +1,8 @@ + + diff --git a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc.patch b/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc.patch deleted file mode 100644 index 3d5cf68..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.grpc.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- modules.conf.xml 2019-05-15 21:08:29.049449029 +0000 -+++ modules.conf.xml.new 2019-05-15 22:05:00.303623468 +0000 -@@ -7,6 +7,9 @@ - - - -+ -+ -+ - - - diff --git a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.lws b/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.lws deleted file mode 100644 index 835d72c..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.lws +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.patch b/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.patch deleted file mode 100644 index 57aca31..0000000 --- a/packer/jambonz-feature-server/files/modules.conf.vanilla.xml.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- modules.conf.xml 2019-09-30 19:01:33.304020805 +0000 -+++ modules.conf.xml.new 2019-09-30 23:11:23.371830901 +0000 -@@ -1,5 +1,6 @@ - - -+ - - - -@@ -10,7 +11,7 @@ - - - -- -+ - - - -@@ -39,7 +40,7 @@ - - - -- -+ - - - -@@ -47,28 +48,28 @@ - - - -- -+ - - -- -+ - - - -- -+ - -- -- -- -+ -+ -+ - -- -+ - - - - -- -- -+ -+ - -- -+ - - - -@@ -87,7 +88,7 @@ - - - -- -+ - - - -@@ -96,17 +97,17 @@ - - - -- -+ - - - - - -- -+ - - - -- -+ - - - -@@ -123,7 +124,7 @@ - - - -- -+ - - - diff --git a/packer/jambonz-feature-server/files/rtpengine.service b/packer/jambonz-feature-server/files/rtpengine.service deleted file mode 100644 index 9579f5d..0000000 --- a/packer/jambonz-feature-server/files/rtpengine.service +++ /dev/null @@ -1,42 +0,0 @@ - -[Unit] -Description=rtpengine -After=syslog.target network.target local-fs.target - -[Service] -; service -Type=forking -ExecStartPre=/bin/sh -c 'systemctl set-environment LOCAL_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4`' -ExecStartPre=/bin/sh -c 'systemctl set-environment PUBLIC_IP=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4`' -ExecStart=/usr/local/bin/rtpengine --interface ${LOCAL_IP}!${PUBLIC_IP} \ ---listen-ng=22222 \ ---listen-udp=12222 \ ---listen-cli=127.0.0.1:9900 \ ---pidfile /var/run/rtpengine.pid \ ---port-min 40000 \ ---port-max 60000 \ ---recording-dir /tmp \ ---recording-method pcap \ ---recording-format eth \ ---log-level 5 \ ---delete-delay 0 -PIDFile=/var/run/rtpengine.pid -TimeoutSec=15s -Restart=always -; exec -User=root -Group=daemon -LimitCORE=infinity -LimitNOFILE=100000 -LimitNPROC=60000 -;LimitSTACK=240 -LimitRTPRIO=infinity -LimitRTTIME=7000000 -IOSchedulingClass=realtime -IOSchedulingPriority=2 -CPUSchedulingPolicy=rr -CPUSchedulingPriority=89 -UMask=0007 - -[Install] -WantedBy=multi-user.target diff --git a/packer/jambonz-feature-server/files/switch_rtp.c.patch b/packer/jambonz-feature-server/files/switch_rtp.c.patch new file mode 100644 index 0000000..ee9debf --- /dev/null +++ b/packer/jambonz-feature-server/files/switch_rtp.c.patch @@ -0,0 +1,40 @@ +--- switch_rtp.c 2021-01-12 02:11:42.334172596 +0000 ++++ switch_rtp.c.new 2021-01-12 02:12:42.695207260 +0000 +@@ -5639,8 +5639,8 @@ + static switch_size_t do_flush(switch_rtp_t *rtp_session, int force, switch_size_t bytes_in) + { + int was_blocking = 0; +- switch_size_t bytes; +- uint32_t flushed = 0; ++ //switch_size_t bytes; ++ //uint32_t flushed = 0; + switch_size_t bytes_out = 0; + + if (!switch_rtp_ready(rtp_session)) { +@@ -5700,7 +5700,7 @@ + #endif + handle_rfc2833(rtp_session, bytes_in, &do_cng); + } +- ++/* + do { + if (switch_rtp_ready(rtp_session)) { + bytes = sizeof(rtp_msg_t); +@@ -5713,7 +5713,7 @@ + rtp_session->last_media = switch_micro_time_now(); + } + +- /* Make sure to handle RFC2833 packets, even if we're flushing the packets */ ++ //Make sure to handle RFC2833 packets, even if we're flushing the packets + if (bytes > rtp_header_len && rtp_session->recv_msg.header.version == 2 && rtp_session->recv_msg.header.pt == rtp_session->recv_te) { + rtp_session->last_rtp_hdr = rtp_session->recv_msg.header; + handle_rfc2833(rtp_session, bytes, &do_cng); +@@ -5732,7 +5732,7 @@ + break; + } + } while (bytes > 0); +- ++*/ + #ifdef DEBUG_2833 + if (flushed) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "*** do_flush: total flushed packets: %ld ***\n",(long)flushed); diff --git a/packer/jambonz-feature-server/files/vanilla_modules.conf.xml.patch b/packer/jambonz-feature-server/files/vanilla_modules.conf.xml.patch deleted file mode 100644 index 57aca31..0000000 --- a/packer/jambonz-feature-server/files/vanilla_modules.conf.xml.patch +++ /dev/null @@ -1,105 +0,0 @@ ---- modules.conf.xml 2019-09-30 19:01:33.304020805 +0000 -+++ modules.conf.xml.new 2019-09-30 23:11:23.371830901 +0000 -@@ -1,5 +1,6 @@ - - -+ - - - -@@ -10,7 +11,7 @@ - - - -- -+ - - - -@@ -39,7 +40,7 @@ - - - -- -+ - - - -@@ -47,28 +48,28 @@ - - - -- -+ - - -- -+ - - - -- -+ - -- -- -- -+ -+ -+ - -- -+ - - - - -- -- -+ -+ - -- -+ - - - -@@ -87,7 +88,7 @@ - - - -- -+ - - - -@@ -96,17 +97,17 @@ - - - -- -+ - - - - - -- -+ - - - -- -+ - - - -@@ -123,7 +124,7 @@ - - - -- -+ - - - diff --git a/packer/jambonz-feature-server/scripts/install_freeswitch.sh b/packer/jambonz-feature-server/scripts/install_freeswitch.sh index b860144..4d56d9d 100644 --- a/packer/jambonz-feature-server/scripts/install_freeswitch.sh +++ b/packer/jambonz-feature-server/scripts/install_freeswitch.sh @@ -1,16 +1,33 @@ #!/bin/bash -VERSION=v1.10.1 +VERSION=v1.10.5 GRPC_VERSION=v1.24.2 +GOOGLE_API_VERSION=v1p1beta1-speech +AWS_SDK_VERSION=1.8.129 echo "freeswitch version to install is ${VERSION}" +echo "GRPC version to install is ${GRPC_VERSION}" +echo "GOOGLE_API_VERSION version to install is ${GOOGLE_API_VERSION}" +echo "AWS_SDK_VERSION version to install is ${AWS_SDK_VERSION}" git config --global pull.rebase true cd /usr/local/src -git clone https://github.com/davehorton/freeswitch.git -b ${VERSION} +git clone https://github.com/signalwire/freeswitch.git -b ${VERSION} git clone https://github.com/warmcat/libwebsockets.git -b v3.2.0 git clone https://github.com/davehorton/drachtio-freeswitch-modules.git -b master +git clone https://github.com/grpc/grpc -b ${GRPC_VERSION} + +cd freeswitch/libs + +git clone https://github.com/freeswitch/spandsp.git -b master +git clone https://github.com/freeswitch/sofia-sip.git -b master git clone https://github.com/dpirch/libfvad.git +git clone https://github.com/aws/aws-sdk-cpp.git -b ${AWS_SDK_VERSION} +git clone https://github.com/davehorton/googleapis -b ${GOOGLE_API_VERSION} +git clone https://github.com/awslabs/aws-c-common.git + sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_audio_fork /usr/local/src/freeswitch/src/mod/applications/mod_audio_fork +sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_aws_transcribe +sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_aws_lex /usr/local/src/freeswitch/src/mod/applications/mod_aws_lex sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_transcribe /usr/local/src/freeswitch/src/mod/applications/mod_google_transcribe sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_google_tts /usr/local/src/freeswitch/src/mod/applications/mod_google_tts sudo cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_dialogflow /usr/local/src/freeswitch/src/mod/applications/mod_dialogflow @@ -26,55 +43,58 @@ sudo mkdir -p build && cd build && sudo cmake .. -DCMAKE_BUILD_TYPE=RelWithDebIn cd /usr/local/src/libfvad sudo autoreconf -i && sudo ./configure && sudo make -j 4 && sudo make install -# patch freeswitch -# basic patches -echo "patching freeswitch for lws and mod_audio_fork" -cd /usr/local/src/freeswitch -sudo cp /tmp/configure.ac.patch . -sudo cp /tmp/Makefile.am.patch . -sudo cp /tmp/modules.conf.in.patch ./build -sudo cp /tmp/modules.conf.vanilla.xml.patch ./conf/vanilla/autoload_configs -sudo cp /tmp/mod_opusfile.c.patch ./src/mod/formats/mod_opusfile -sudo patch < configure.ac.patch -sudo patch < Makefile.am.patch -cd build && sudo patch < modules.conf.in.patch -cd ../conf/vanilla/autoload_configs && patch < modules.conf.vanilla.xml.patch -cd /usr/local/src/freeswitch/src/mod/formats/mod_opusfile && sudo patch < mod_opusfile.c.patch -cd /usr/local/src/freeswitch -#grpc patches -echo "patching freeswitch for GRPC" -sudo cp /tmp/configure.ac.grpc.patch . -sudo cp /tmp/Makefile.am.grpc.patch . -sudo cp /tmp/modules.conf.in.grpc.patch ./build -sudo patch < configure.ac.grpc.patch -sudo patch < Makefile.am.grpc.patch -cd build && sudo patch < modules.conf.in.grpc.patch -cd .. -sudo cp /tmp/modules.conf.vanilla.xml.grpc ./conf/vanilla/autoload_configs/modules.conf.xml - -# checkout and build grpc -echo "building GRPC" -cd /usr/local/src -git clone https://github.com/grpc/grpc -b ${GRPC_VERSION} -cd grpc -git submodule update --init --recursive -cd third_party/protobuf && ./autogen.sh && ./configure && sudo make install -cd /usr/local/src/grpc -export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH && make -j 4 && sudo make install +# build spandsp +cd /usr/local/src/freeswitch/libs/spandsp +./bootstrap.sh && ./configure && make -j 4 && sudo make install -# checkout and build googleapis -echo "building googleapis" -cd /usr/local/src/freeswitch/libs -git clone https://github.com/davehorton/googleapis -b dialogflow-v2-support -cd googleapis +# build sofia +cd /usr/local/src/freeswitch/libs/sofia-sip +./bootstrap.sh && ./configure && make -j 4 && sudo make install + +# build aws-c-common +cd /usr/local/src/freeswitch/libs/aws-c-common +mkdir -p build && cd build +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" +make -j 4 && sudo make install + +# build aws-sdk-cpp +cd /usr/local/src/freeswitch/libs/aws-sdk-cpp +mkdir -p build && cd build +cmake .. -DBUILD_ONLY="lexv2-runtime;transcribestreaming" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-Wno-unused-parameter" +make -j 4 && sudo make install + +# build grpc +cd /usr/local/src/grpc git submodule update --init --recursive +cd /usr/local/src/grpc/third_party/protobuf +./autogen.sh +./configure +sudo make -j 4 install +cd /usr/local/src/grpc +export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH +make -j 4 +sudo make install + +# build googleapis +cd /usr/local/src/freeswitch/libs/googleapis LANGUAGE=cpp make -j 4 +# copy Makefiles into place +cp /tmp/configure.ac.extra /usr/local/src/freeswitch/configure.ac +cp /tmp/Makefile.am.extra /usr/local/src/freeswitch/Makefile.am +cp /tmp/modules.conf.in.extra /usr/local/src/freeswitch/build/modules.conf.in +cp /tmp/modules.conf.vanilla.xml.extra /usr/local/src/freeswitch/conf/vanilla/autoload_configs/modules.conf.xml +cp /tmp/switch_rtp.c.patch /usr/local/src/freeswitch/src + +# patch freeswitch +cd /usr/local/src/freeswitch/src +patch < switch_rtp.c.patch + # build freeswitch echo "building freeswitch" cd /usr/local/src/freeswitch sudo ./bootstrap.sh -j -sudo ./configure --with-lws=yes --with-grpc=yes +sudo ./configure --with-lws=yes --with-extra=yes sudo make -j 4 sudo make install sudo make cd-sounds-install cd-moh-install diff --git a/packer/jambonz-feature-server/template.json b/packer/jambonz-feature-server/template.json index a78477d..9058d84 100644 --- a/packer/jambonz-feature-server/template.json +++ b/packer/jambonz-feature-server/template.json @@ -4,7 +4,7 @@ "ssh_username": "admin", "ami_description": "jambonz feature server", "instance_type": "t2.xlarge", - "drachtio_version": "develop", + "drachtio_version": "main", "jambonz_version": "master", "install_telegraf": "yes", "install_datadog": "no" @@ -15,10 +15,10 @@ "source_ami_filter": { "filters": { "virtualization-type": "hvm", - "name": "debian-stretch-hvm-x86_64-gp2-*", + "name": "debian-10-amd64-*", "root-device-type": "ebs" }, - "owners": ["379101102735"], + "owners": ["136693071363"], "most_recent": true }, "instance_type": "{{user `instance_type`}}", @@ -27,7 +27,7 @@ "ami_description": "{{user `ami_description`}}", "launch_block_device_mappings": [ { - "device_name": "xvda", + "device_name": "/dev/xvda", "volume_size": 40, "volume_type": "gp2", "delete_on_termination": true @@ -51,7 +51,7 @@ "inline": [ "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done", "sudo apt-get update", - "sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\", + "sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", "curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\", "iptables-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\", "libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\", diff --git a/packer/jambonz-monitoring/scripts/install_postgresql.sh b/packer/jambonz-monitoring/scripts/install_postgresql.sh index 11275fa..9f39e33 100644 --- a/packer/jambonz-monitoring/scripts/install_postgresql.sh +++ b/packer/jambonz-monitoring/scripts/install_postgresql.sh @@ -5,10 +5,8 @@ if [ "$1" == "yes" ]; then DB_USER=$2 DB_PASS=$3 -wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O- | sudo apt-key add - -sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/postgresql.list' sudo apt-get update -sudo apt-get install -y postgresql-12 +sudo apt-get install -y postgresql sudo systemctl daemon-reload sudo systemctl enable postgresql sudo systemctl restart postgresql diff --git a/packer/jambonz-monitoring/template.json b/packer/jambonz-monitoring/template.json index 92a6fee..5708dbf 100644 --- a/packer/jambonz-monitoring/template.json +++ b/packer/jambonz-monitoring/template.json @@ -18,10 +18,10 @@ "source_ami_filter": { "filters": { "virtualization-type": "hvm", - "name": "debian-stretch-hvm-x86_64-gp2-*", + "name": "debian-10-amd64-*", "root-device-type": "ebs" }, - "owners": ["379101102735"], + "owners": ["136693071363"], "most_recent": true }, "instance_type": "{{user `instance_type`}}", @@ -30,7 +30,7 @@ "ami_description": "{{user `ami_description`}}", "launch_block_device_mappings": [ { - "device_name": "xvda", + "device_name": "/dev/xvda", "volume_size": 40, "volume_type": "gp2", "delete_on_termination": true diff --git a/packer/jambonz-sbc-sip-rtp/template.json b/packer/jambonz-sbc-sip-rtp/template.json index b76a78c..2cf22f8 100644 --- a/packer/jambonz-sbc-sip-rtp/template.json +++ b/packer/jambonz-sbc-sip-rtp/template.json @@ -3,7 +3,7 @@ "region": "us-east-1", "ssh_username": "admin", "ami_description": "jambonz SBC SIP+RTP", - "drachtio_version": "develop", + "drachtio_version": "main", "jambonz_version": "master", "install_datadog": "no", "install_telegraf": "yes", @@ -19,10 +19,10 @@ "source_ami_filter": { "filters": { "virtualization-type": "hvm", - "name": "debian-stretch-hvm-x86_64-gp2-*", + "name": "debian-10-amd64-*", "root-device-type": "ebs" }, - "owners": ["379101102735"], + "owners": ["136693071363"], "most_recent": true }, "instance_type": "{{user `instance_type`}}", @@ -31,7 +31,7 @@ "ami_description": "{{user `ami_description`}}", "launch_block_device_mappings": [ { - "device_name": "xvda", + "device_name": "/dev/xvda", "volume_size": 40, "volume_type": "gp2", "delete_on_termination": true @@ -55,7 +55,7 @@ "inline": [ "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done", "sudo apt-get update", - "sudo apt-get -y install lsof python lsof gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\", + "sudo apt-get -y install lsof python lsof gcc g++ make cmake build-essential git autoconf automake default-mysql-client redis-tools \\", "curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\", "iptables-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\", "libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\", diff --git a/packer/jambonz-sbc-sip/template.json b/packer/jambonz-sbc-sip/template.json index a087e6b..53f0361 100644 --- a/packer/jambonz-sbc-sip/template.json +++ b/packer/jambonz-sbc-sip/template.json @@ -4,7 +4,7 @@ "ssh_username": "admin", "ami_description": "jambonz SBC SIP", "instance_type": "t2.medium", - "drachtio_version": "develop", + "drachtio_version": "main", "jambonz_version": "master", "install_datadog": "no", "install_telegraf": "yes"