Michael Niedermayer <[EMAIL PROTECTED]> writes:
> Hi
>
> On Tuesday 18 January 2005 15:09, Philipp Matthias Hahn wrote:
> > Hello!
> >
> > Please cc me on replies, because I'm no longer subscribed to
> > ffmpeg-devel.
> >
> > While trying to build an uncastrated Debian ffmpeg package I stubled
> > upon a problem when building ffmpeg outside the source tree:
> >
> > 1. The Makefile doesn't properly change to the libavcodex/libpostproc/
> > directory in the build tree, but changes to the directory in the source
> > tree. This is fixed by removing the '$(PATH)/' Prefix in
> > libavcode/Makefile.
> >
> > 2. Building the manual pages in a separate build tree also doesn't work,
> > since the doc/ directory isn't symlinked to the build tree. The
> > converted manual pages are also explicitely referenced in the source
> > tree, where they don't exist.
> >
> > 3. The quotation of "SRC_PATH='$source_path'" with single quotes is
> > wrong in a Makefile, since the single quotes are used verbatim and are
> > not shell meta characters.
>
> and removing them breaks compilation if there are spaces in the path
>
> [...]
> --
> Michael
This patch is a compromise. For in-tree builds SRC_PATH='$source_path' is
used, but for out-of-tree builds SRC_PATH=$source_path is used. This patch
has been tested by building ffmpeg on i386-linux both in tree with a space in
the pathname and an out-of-tree build on i386-linux with no space in the
pathname, I also tested this on sparc-linux in an out-of-tree build.
What doesn't work is an out-of-tree build with a space in the pathname. I
don't think this is something to worry about. Most of the patch is by Phillip,
I simply added the else and cleaned up DIRS and FILES so they fit in 80
characters.
--
Thanks,
Jim
http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim
Index: Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/Makefile,v
retrieving revision 1.76
diff -u -p -r1.76 Makefile
--- Makefile 22 Oct 2004 02:04:29 -0000 1.76
+++ Makefile 21 Jan 2005 04:18:54 -0000
@@ -14,18 +14,18 @@ CFLAGS+=-p
LDFLAGS+=-p
endif
-MANPAGE=$(SRC_PATH)/doc/ffmpeg.1
+MANPAGE=doc/ffmpeg.1
PROG=ffmpeg$(EXESUF)
PROGTEST=output_example$(EXESUF)
QTFASTSTART=qt-faststart$(EXESUF)
ifeq ($(CONFIG_FFSERVER),yes)
-MANPAGE+=$(SRC_PATH)/doc/ffserver.1
+MANPAGE+=doc/ffserver.1
PROG+=ffserver$(EXESUF)
endif
ifeq ($(CONFIG_FFPLAY),yes)
-MANPAGE+=$(SRC_PATH)/doc/ffplay.1
+MANPAGE+=doc/ffplay.1
PROG+=ffplay$(EXESUF)
FFPLAY_O=ffplay.o
endif
@@ -146,7 +148,7 @@ wininstaller: all install
# install man from source dir if available
install-man:
ifneq ($(CONFIG_WIN32),yes)
- if [ -f $(SRC_PATH)/doc/ffmpeg.1 ] ; then \
+ if [ -f doc/ffmpeg.1 ] ; then \
install -d "$(mandir)/man1" ; \
install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
fi
Index: configure
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
retrieving revision 1.158
diff -u -p -r1.158 configure
--- configure 5 Jan 2005 01:45:52 -0000 1.158
+++ configure 21 Jan 2005 04:18:54 -0000
@@ -1453,17 +1453,22 @@ fi
# build tree in object directory if source path is different from current one
if test "$source_path_used" = "yes" ; then
- DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l
libavcodec/i386 \
- libavcodec/ppc libavcodec/liba52 libavcodec/mlib
libavcodec/libpostproc tests vhook"
- FILES="Makefile libavformat/Makefile libavcodec/Makefile
libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
+ DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
+ libavcodec/i386 libavcodec/sparc libavcodec/mlib \
+ libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
+ FILES="Makefile libavformat/Makefile libavcodec/Makefile \
+ libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
+ doc/Makefile doc/texi2pod.pl"
for dir in $DIRS ; do
mkdir -p $dir
done
for f in $FILES ; do
ln -sf "$source_path/$f" $f
done
+ echo "SRC_PATH=$source_path" >> config.mak
+else
+ echo "SRC_PATH='$source_path'" >> config.mak
fi
-echo "SRC_PATH='$source_path'" >> config.mak
if test "$amr_wb" = "yes" ; then
echo "#define AMR_WB 1" >> $TMPH
Index: doc/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/doc/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- doc/Makefile 24 Aug 2003 11:16:29 -0000 1.6
+++ doc/Makefile 21 Jan 2005 04:18:54 -0000
@@ -1,3 +1,7 @@
+-include ../config.mak
+
+VPATH=$(SRC_PATH)/doc
+
all: ffmpeg-doc.html faq.html ffserver-doc.html ffplay-doc.html hooks.html \
ffmpeg.1 ffserver.1 ffplay.1
Index: libavcodec/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v
retrieving revision 1.165
diff -u -p -r1.165 Makefile
--- libavcodec/Makefile 11 Jan 2005 08:16:04 -0000 1.165
+++ libavcodec/Makefile 21 Jan 2005 04:18:54 -0000
@@ -216,7 +216,7 @@ $(LIB): $(OBJS) $(AMRLIBS)
$(SLIB): $(OBJS)
ifeq ($(CONFIG_PP),yes)
- $(MAKE) -C $(VPATH)/libpostproc
+ $(MAKE) -C libpostproc
endif
ifeq ($(CONFIG_WIN32),yes)
$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS)
$(EXTRALIBS) $(AMREXTRALIBS)
@@ -299,7 +299,7 @@ else
ldconfig || true
endif
ifeq ($(CONFIG_PP),yes)
- $(MAKE) -C $(VPATH)/libpostproc $@
+ $(MAKE) -C libpostproc $@
endif
else
install: