1#!/bin/sh 2 3. ffbuild/config.sh 4 5if test "$shared" = "yes"; then 6 shared=true 7else 8 shared=false 9fi 10 11shortname=$1 12name=lib${shortname} 13fullname=${name}${build_suffix} 14comment=$2 15libs=$(eval echo \$extralibs_${shortname}) 16deps=$(eval echo \$${shortname}_deps) 17 18for dep in $deps; do 19 depname=lib${dep} 20 fulldepname=${depname}${build_suffix} 21 . ${depname}/${depname}.version 22 depversion=$(eval echo \$${depname}_VERSION) 23 requires="$requires ${fulldepname} >= ${depversion}, " 24done 25requires=${requires%, } 26 27version=$(grep ${name}_VERSION= $name/${name}.version | cut -d= -f2) 28 29cat <<EOF > $name/$fullname.pc 30prefix=$prefix 31exec_prefix=\${prefix} 32libdir=$libdir 33includedir=$incdir 34 35Name: $fullname 36Description: $comment 37Version: $version 38Requires: $($shared || echo $requires) 39Requires.private: $($shared && echo $requires) 40Conflicts: 41Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs) 42Libs.private: $($shared && echo $libs) 43Cflags: -I\${includedir} 44EOF 45 46mkdir -p doc/examples/pc-uninstalled 47includedir=${source_path} 48[ "$includedir" = . ] && includedir="\${pcfiledir}/../../.." 49 cat <<EOF > doc/examples/pc-uninstalled/${name}-uninstalled.pc 50prefix= 51exec_prefix= 52libdir=\${pcfiledir}/../../../$name 53includedir=${source_path} 54 55Name: $fullname 56Description: $comment 57Version: $version 58Requires: $requires 59Conflicts: 60Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${fullname#lib} $($shared || echo $libs) 61Cflags: -I\${includedir} 62EOF 63