Commit 76a448ed authored by Måns Rullgård's avatar Måns Rullgård

Install headers in $prefix/include/$libname

Install each library's headers in $prefix/include/$libname.
The installed headers use #include "lib*/*.h"; applications
are expected to do the same.

Specify only $prefix/include in .pc files.

Originally committed as revision 12194 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bd58e7f7
...@@ -79,10 +79,12 @@ install-lib-static: $(LIBNAME) ...@@ -79,10 +79,12 @@ install-lib-static: $(LIBNAME)
install -m 644 $(LIBNAME) "$(LIBDIR)" install -m 644 $(LIBNAME) "$(LIBDIR)"
$(LIB_INSTALL_EXTRA_CMD) $(LIB_INSTALL_EXTRA_CMD)
INCINSTDIR = $(INCDIR)/lib$(NAME)
install-headers: install-headers:
install -d "$(INCDIR)" install -d "$(INCINSTDIR)"
install -d "$(LIBDIR)/pkgconfig" install -d "$(LIBDIR)/pkgconfig"
install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(INCDIR)" install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(INCINSTDIR)"
install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(LIBDIR)/pkgconfig" install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
uninstall: uninstall-libs uninstall-headers uninstall: uninstall-libs uninstall-headers
...@@ -95,7 +97,7 @@ uninstall-libs: ...@@ -95,7 +97,7 @@ uninstall-libs:
-rm -f "$(LIBDIR)/$(LIBNAME)" -rm -f "$(LIBDIR)/$(LIBNAME)"
uninstall-headers:: uninstall-headers::
rm -f $(addprefix "$(INCDIR)/",$(HEADERS)) rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc" rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
tests: $(TESTS) tests: $(TESTS)
......
...@@ -882,7 +882,7 @@ logfile="config.err" ...@@ -882,7 +882,7 @@ logfile="config.err"
PREFIX="/usr/local" PREFIX="/usr/local"
libdir='$(PREFIX)/lib' libdir='$(PREFIX)/lib'
shlibdir="$libdir" shlibdir="$libdir"
incdir='$(PREFIX)/include/ffmpeg' incdir='$(PREFIX)/include'
mandir='$(PREFIX)/share/man' mandir='$(PREFIX)/share/man'
bindir='$(PREFIX)/bin' bindir='$(PREFIX)/bin'
...@@ -2130,7 +2130,6 @@ comment=$2 ...@@ -2130,7 +2130,6 @@ comment=$2
version=$3 version=$3
libs=$4 libs=$4
requires=$5 requires=$5
include=$6
cat <<EOF >$name.pc cat <<EOF >$name.pc
prefix=$PREFIX prefix=$PREFIX
exec_prefix=\${prefix} exec_prefix=\${prefix}
...@@ -2143,7 +2142,7 @@ Version: $version ...@@ -2143,7 +2142,7 @@ Version: $version
Requires: $requires Requires: $requires
Conflicts: Conflicts:
Libs: -L\${libdir} $libs Libs: -L\${libdir} $libs
Cflags: -I\${includedir}/$include Cflags: -I\${includedir}
EOF EOF
} }
...@@ -2158,7 +2157,7 @@ cat <<EOF >$name-uninstalled.pc ...@@ -2158,7 +2157,7 @@ cat <<EOF >$name-uninstalled.pc
prefix= prefix=
exec_prefix= exec_prefix=
libdir=\${pcfiledir}/$name libdir=\${pcfiledir}/$name
includedir=\${pcfiledir}/$name includedir=\${pcfiledir}
Name: $name Name: $name
Description: $comment Description: $comment
...@@ -2170,27 +2169,27 @@ Cflags: -I\${includedir} ...@@ -2170,27 +2169,27 @@ Cflags: -I\${includedir}
EOF EOF
} }
pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil "" ffmpeg pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil ""
pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version" pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version"
pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version" ffmpeg pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version"
pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version" pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version"
pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version" ffmpeg pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version"
pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version" pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version"
pkgconfig_generate libavdevice "FFmpeg device handling library" "$lavd_version" "-lavdevice $extralibs" "$pkg_requires libavformat = $lavf_version" ffmpeg pkgconfig_generate libavdevice "FFmpeg device handling library" "$lavd_version" "-lavdevice $extralibs" "$pkg_requires libavformat = $lavf_version"
pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$lavd_version" "$extralibs" "$pkg_requires libavformat = $lavf_version" pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$lavd_version" "$extralibs" "$pkg_requires libavformat = $lavf_version"
if enabled pp; then if enabled pp; then
pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc "" postproc pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc ""
pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$pp_version" pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$pp_version"
fi fi
if enabled swscaler; then if enabled swscaler; then
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" -lswscale "libavutil = $lavu_version" ffmpeg pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" -lswscale "libavutil = $lavu_version"
pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "libavutil = $lavu_version" pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "libavutil = $lavu_version"
else else
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version" ffmpeg pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version"
pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version" pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version"
apply libswscale.pc sed s/^Libs:.*$/Libs:/ apply libswscale.pc sed s/^Libs:.*$/Libs:/
apply libswscale-uninstalled.pc sed s/^Libs:.*$/Libs:/ apply libswscale-uninstalled.pc sed s/^Libs:.*$/Libs:/
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*/ */
#include "avutil.h" #include "libavutil/avutil.h"
#include <sys/types.h> /* size_t */ #include <sys/types.h> /* size_t */
#define LIBAVCODEC_VERSION_TRIPLET 51,50,1 #define LIBAVCODEC_VERSION_TRIPLET 51,50,1
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* AVOptions * AVOptions
*/ */
#include "rational.h" #include "libavutil/rational.h"
enum AVOptionType{ enum AVOptionType{
FF_OPT_TYPE_FLAGS, FF_OPT_TYPE_FLAGS,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <time.h> #include <time.h>
#include <stdio.h> /* FILE */ #include <stdio.h> /* FILE */
#include "avcodec.h" #include "libavcodec/avcodec.h"
#include "avio.h" #include "avio.h"
......
include ../config.mak include ../config.mak
# Overload incdir, postproc include files go in a different directory.
INCDIR=$(prefix)/include/postproc
EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS) EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
NAME=postproc NAME=postproc
...@@ -15,6 +12,3 @@ HEADERS = postprocess.h ...@@ -15,6 +12,3 @@ HEADERS = postprocess.h
OBJS = postprocess.o OBJS = postprocess.o
include ../common.mak include ../common.mak
uninstall-headers::
-rmdir "$(prefix)/include/postproc"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* external api for the pp stuff * external api for the pp stuff
*/ */
#include "avutil.h" #include "libavutil/avutil.h"
#define LIBPOSTPROC_VERSION_TRIPLET 51,1,0 #define LIBPOSTPROC_VERSION_TRIPLET 51,1,0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment