build: Generate pkg-config files from Make and not from configure
[libav.git] / avbuild / pkgconfig_generate.sh
CommitLineData
92db5083
DB
1#!/bin/sh
2
3. avbuild/config.sh
4
5if test "$shared" = "yes"; then
6 shared=true
7else
8 shared=false
9fi
10
11shortname=$1
12name=lib${shortname}
13comment=$2
14libs=$(eval echo \$extralibs_${shortname})
15requires=$(eval echo \$requires_${shortname})
16requires=${requires%, }
17
18version=$(grep ${name}_VERSION= $name/${name}.version | cut -d= -f2)
19
20cat <<EOF > $name/$name.pc
21prefix=$prefix
22exec_prefix=\${prefix}
23libdir=$libdir
24includedir=$incdir
25
26Name: $name
27Description: $comment
28Version: $version
29Requires: $($shared || echo $requires)
30Requires.private: $($shared && echo $requires)
31Conflicts:
32Libs: -L\${libdir} -l${shortname} $($shared || echo $libs)
33Libs.private: $($shared && echo $libs)
34Cflags: -I\${includedir}
35EOF
36
37cat <<EOF > $name/$name-uninstalled.pc
38prefix=
39exec_prefix=
40libdir=\${pcfiledir}
41includedir=${source_path}
42
43Name: $name
44Description: $comment
45Version: $version
46Requires: $requires
47Conflicts:
48Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
49Cflags: -I\${includedir}
50EOF