install libav(codec|format).pc/libpostproc.pc for pkg-config (original patch from...
authorAurelien Jacobs <aurel@gnuage.org>
Thu, 19 May 2005 00:17:50 +0000 (00:17 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Thu, 19 May 2005 00:17:50 +0000 (00:17 +0000)
Originally committed as revision 4276 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavcodec/Makefile
libavcodec/libpostproc/Makefile
libavformat/Makefile

index eb198066e16bde89f436f7e935dc4f2c88174ae7..1831a5dbf87384512e8077fbf4ac88b99604ebfe 100755 (executable)
--- a/configure
+++ b/configure
@@ -1618,3 +1618,108 @@ else
 fi
 
 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
+
+
+# build pkg-config files libavcodec.pc, libavformat.pc and libpostproc.pc 
+
+lavc_build=`grep '#define LIBAVCODEC_BUILD' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9]//g'`
+lavf_build=`grep '#define LIBAVFORMAT_BUILD' "$source_path/libavformat/avformat.h" | sed 's/[^0-9]//g'`
+
+requires=
+test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
+test "$vorbis" = "yes" && requires="$requires vorbis"
+test "$theora" = "yes" && requires="$requires theora"
+
+# libavcodec.pc
+cat <<EOF >libavcodec.pc
+prefix=$prefix
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+
+Name: libavcodec
+Description: FFmpeg codec library
+Version: $version-$lavc_build
+Requires: $requires
+Conflicts:
+Libs: -L\${libdir} -lavcodec $extralibs
+Cflags: -I\${includedir} -I\${includedir}/ffmpeg
+EOF
+
+cat <<EOF >libavcodec-uninstalled.pc
+prefix=
+exec_prefix=
+libdir=\${pcfiledir}/libavcodec
+includedir=\${pcfiledir}/libavcodec
+
+Name: libavcodec
+Description: FFmpeg codec library
+Version: $version-$lavc_build
+Requires: $requires
+Conflicts:
+Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
+Cflags: -I\${includedir}
+EOF
+
+# libavformat.pc
+cat <<EOF >libavformat.pc
+prefix=$prefix
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+
+Name: libavformat
+Description: FFmpeg container format library
+Version: $version-$lavf_build
+Requires: $requires libavcodec = $version-$lavc_build
+Conflicts:
+Libs: -L\${libdir} -lavformat $extralibs
+Cflags: -I\${includedir} -I\${includedir}/ffmpeg
+EOF
+
+cat <<EOF >libavformat-uninstalled.pc
+prefix=
+exec_prefix=
+libdir=\${pcfiledir}/libavformat
+includedir=\${pcfiledir}/libavformat
+
+Name: libavformat
+Description: FFmpeg container format library
+Version: $version-$lavf_build
+Requires: $requires libavcodec = $version-$lavc_build
+Conflicts:
+Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
+Cflags: -I\${includedir}
+EOF
+
+
+# libpostproc.pc
+cat <<EOF >libpostproc.pc
+prefix=$prefix
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+
+Name: libpostproc
+Description: FFmpeg post processing library
+Version: $version
+Requires: 
+Conflicts:
+Libs: -L\${libdir} -lpostproc
+Cflags: -I\${includedir} -I\${includedir}/postproc
+EOF
+
+cat <<EOF >libpostproc-uninstalled.pc
+prefix=
+exec_prefix=
+libdir=\${pcfiledir}/libavcodec/libpostproc
+includedir=\${pcfiledir}/libavcodec/libpostproc
+
+Name: libpostproc
+Description: FFmpeg post processing library
+Version: $version
+Requires: 
+Conflicts:
+Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
+Cflags: -I\${includedir}
+EOF
index ee36c0381f35ab1393210d4a60b7e024218bbddd..951eb0c6c4bbba0e0e8571a7fed22afdfbe4a0c3 100644 (file)
@@ -478,6 +478,8 @@ install-headers:
                       $(SRC_PATH)/libavcodec/common.h \
                       $(SRC_PATH)/libavcodec/rational.h \
                 "$(prefix)/include/ffmpeg"
+       install -d $(libdir)/pkgconfig
+       install -m 644 ../libavcodec.pc $(libdir)/pkgconfig
 
 #
 # include dependency files if they exist
index 958be44a76c25fbb7af3e1085d6ed04f5449749b..60d01df9a451259f3dd01d16e16156332a45b82d 100644 (file)
@@ -59,6 +59,8 @@ else
        install $(INSTALLSTRIP) -m 755 $(SPPLIB) $(libdir)/$(SPPLIB).$(SPPVERSION)
        ln -sf $(SPPLIB).$(SPPVERSION) $(libdir)/$(SPPLIB)
        ln -sf $(SPPLIB).$(SPPVERSION) $(libdir)/$(SPPLIB).$(SPPMAJOR)
+       install -d $(libdir)/pkgconfig
+       install -m 644 ../../libpostproc.pc $(libdir)/pkgconfig
        ldconfig || true
 endif
 endif
index a8bb6118753e12cd93edf4c87be9a29cc075f2ac..3b1b1437d4ee2e6eed9d81c1a3bc44f76556c43a 100644 (file)
@@ -126,6 +126,8 @@ install-headers:
                 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
                 $(SRC_PATH)/libavformat/rtspcodes.h \
                 "$(prefix)/include/ffmpeg"
+       install -d $(libdir)/pkgconfig
+       install -m 644 ../libavformat.pc $(libdir)/pkgconfig
 
 %.o: %.c
        $(CC) $(CFLAGS) -c -o $@ $<