When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
51 lines
1.3 KiB
Bash
Executable file
51 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
PPATH="$1"
|
|
## Make sure we were called from Makefile
|
|
|
|
if [ "x$ASTERISKVERSIONNUM" = "x" ]; then
|
|
echo " ** Do not call this script directly"
|
|
exit
|
|
fi
|
|
|
|
## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags)
|
|
|
|
if [ ! -d "$PPATH" ]; then
|
|
exit
|
|
fi
|
|
|
|
#Solaris (and some others) don't have sed -r. perl -p is equivalent
|
|
if [ `echo "xxx" | sed -r 's/x/y/g' 2>/dev/null | ${GREP} -c "yyy"` != 0 ]; then
|
|
EXTREGEX="sed -r -e"
|
|
else
|
|
EXTREGEX="perl -pe"
|
|
fi
|
|
|
|
## Clean out CFLAGS for the spec file.
|
|
|
|
LOCAL_CFLAGS=`echo $CFLAGS | ${EXTREGEX} 's/\s*-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
|
|
${EXTREGEX} 's/-I(include|\.\.\/include) //g' | \
|
|
${EXTREGEX} 's/-DINSTALL_PREFIX=\S* //g' | \
|
|
${EXTREGEX} 's/-DASTERISK_VERSION=\S* //g' | \
|
|
${EXTREGEX} 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g'`
|
|
|
|
|
|
cat <<EOF > "$PPATH/asterisk.pc"
|
|
install_prefix=$INSTALL_PREFIX
|
|
version_number=$ASTERISKVERSIONNUM
|
|
etcdir=$ASTETCDIR
|
|
libdir=$ASTLIBDIR
|
|
varlibdir=$ASTVARLIBDIR
|
|
varrundir=$ASTVARRUNDIR
|
|
spooldir=$ASTSPOOLDIR
|
|
logdir=$ASTLOGDIR
|
|
confpath=$ASTCONFPATH
|
|
moddir=$ASTMODDIR
|
|
agidir=$AGI_DIR
|
|
|
|
Name: asterisk
|
|
Description: Open Source PBX and telephony toolkit
|
|
Version: $ASTERISKVERSION
|
|
Libs: $LIBS
|
|
Cflags: $LOCAL_CFLAGS
|
|
EOF
|