File: mkpkgconfig

package info (click to toggle)
asterisk 1%3A11.13.1~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 43,308 kB
  • sloc: ansic: 550,310; sh: 12,057; cpp: 5,944; makefile: 3,079; perl: 3,076; yacc: 2,156; xml: 675; sql: 406; python: 381; tcl: 113; php: 62
file content (50 lines) | stat: -rwxr-xr-x 1,300 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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