4 ## Make sure we were called from Makefile
6 if [ "x$ASTERISKVERSIONNUM" = "x" ]; then
7 echo " ** Do not call this script directly"
11 ## Create a pkgconfig spec file for 3rd party modules (pkg-config asterisk --cflags)
13 if [ ! -d "$PPATH" ]; then
17 #Solaris (and some others) don't have sed -r. perl -p is equivalent
18 if [ `echo "xxx" | sed -r 's/x/y/g' 2>/dev/null | ${GREP} -c "yyy"` != 0 ]; then
24 ## Clean out CFLAGS for the spec file.
25 LOCAL_CFLAGS=`echo $CFLAGS | ${EXTREGEX} 's/-pipe\s*//g' | ${EXTREGEX} 's/-[Wmp]\S*\s*//g' | \
26 ${EXTREGEX} 's/\s+-I(include|\.\.\/include)\s+/ /g' | \
27 ${EXTREGEX} 's/-DINSTALL_PREFIX=\S* //g' | \
28 ${EXTREGEX} 's/-DASTERISK_VERSION=\S* //g' | \
29 ${EXTREGEX} 's/-DAST(ETCDIR|LIBDIR|VARLIBDIR|VARRUNDIR|SPOOLDIR|LOGDIR|CONFPATH|MODDIR|AGIDIR)=\S* //g' | \
30 ${EXTREGEX} 's/^\s|\s$//g'`
32 cat <<EOF > "$PPATH/asterisk.pc"
33 install_prefix=$INSTALL_PREFIX
34 version_number=$ASTERISKVERSIONNUM
38 varlibdir=$ASTVARLIBDIR
39 varrundir=$ASTVARRUNDIR
47 Description: Open Source PBX and telephony toolkit
48 Version: $ASTERISKVERSION