summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-12-20 14:27:19 +0100
committerDiego Biurrun <diego@biurrun.de>2016-12-22 12:30:54 +0100
commit92db5083077a8b0f8e1050507671b456fd155125 (patch)
tree142d95a9446bfeca63688f4751c8272615e5af8c /configure
parentedb434873238876790f6a17bb65490cc29a1d176 (diff)
build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can be parallelized and ensures that pkgconfig files are updated when library versions change. Bug-Id: 449
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure67
1 files changed, 22 insertions, 45 deletions
diff --git a/configure b/configure
index 2671b5a02b..8e402383d8 100755
--- a/configure
+++ b/configure
@@ -5402,52 +5402,29 @@ lib_version(){
eval printf "\"lib${1} >= \$LIB$(toupper ${1})_VERSION, \""
}
-pkgconfig_generate(){
- name=$1
- shortname=${name#lib}
- comment=$2
- version=$3
- libs=$4
- requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
- requires=${requires%, }
- enabled ${name#lib} || return 0
- mkdir -p $name
- cat <<EOF > $name/$name.pc
+cat > avbuild/config.sh <<EOF
+# Automatically generated by configure - do not modify!
+shared=$shared
prefix=$prefix
-exec_prefix=\${prefix}
libdir=$libdir
includedir=$incdir
-
-Name: $name
-Description: $comment
-Version: $version
-Requires: $(enabled shared || echo $requires)
-Requires.private: $(enabled shared && echo $requires)
-Conflicts:
-Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
-Libs.private: $(enabled shared && echo $libs)
-Cflags: -I\${includedir}
+source_path=${source_path}
+LIBPREF=${LIBPREF}
+LIBSUF=${LIBSUF}
+
+requires_avutil="$(map 'lib_version $v' $(echo $avutil_deps))"
+requires_avcodec="$(map 'lib_version $v' $(echo $avcodec_deps))"
+requires_avformat="$(map 'lib_version $v' $(echo $avformat_deps))"
+requires_avdevice="$(map 'lib_version $v' $(echo $avdevice_deps))"
+requires_avfilter="$(map 'lib_version $v' $(echo $avfilter_deps))"
+requires_avresample="$(map 'lib_version $v' $(echo $avresample_deps))"
+requires_swscale="$(map 'lib_version $v' $(echo $swscale_deps))"
+
+extralibs_avutil="$LIBRT $LIBM"
+extralibs_avcodec="$extralibs"
+extralibs_avformat="$extralibs"
+extralibs_avdevice="$extralibs"
+extralibs_avfilter="$extralibs"
+extralibs_avresample="$LIBM"
+extralibs_swscale="$LIBM"
EOF
- cat <<EOF > $name/$name-uninstalled.pc
-prefix=
-exec_prefix=
-libdir=\${pcfiledir}
-includedir=${source_path}
-
-Name: $name
-Description: $comment
-Version: $version
-Requires: $requires
-Conflicts:
-Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
-Cflags: -I\${includedir}
-EOF
-}
-
-pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
-pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs"
-pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
-pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
-pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
-pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"