[DVDnav-discuss] r879 - in trunk/libdvdnav: Makefile configure2
nicodvb
subversion at mplayerhq.hu
Tue Apr 17 23:56:53 CEST 2007
Author: nicodvb
Date: Tue Apr 17 23:56:53 2007
New Revision: 879
Modified:
trunk/libdvdnav/Makefile
trunk/libdvdnav/configure2
Log:
support for building the library in a different directory; patch by Diego Petteno
Modified: trunk/libdvdnav/Makefile
==============================================================================
--- trunk/libdvdnav/Makefile (original)
+++ trunk/libdvdnav/Makefile Tue Apr 17 23:56:53 2007
@@ -8,14 +8,14 @@ AR=ar
LD=ld
RANLIB=ranlib
-VPATH+= src
+VPATH+= $(SRC_PATH_BARE)/src
SRCS = dvdnav.c highlight.c navigation.c read_cache.c remap.c \
searching.c settings.c
-VPATH+= src/vm
+VPATH+= $(SRC_PATH_BARE)/src/vm
SRCS+= decoder.c vm.c vmcmd.c
-VPATH+= src/dvdread
+VPATH+= $(SRC_PATH_BARE)/src/dvdread
SRCS+= dvd_input.c dvd_reader.c dvd_udf.c ifo_print.c ifo_read.c \
md5.c nav_print.c nav_read.c
@@ -37,8 +37,8 @@ SHLIB = $(L).so
CFLAGS += -g -Wall -funsigned-char
-CFLAGS += -I$(CURDIR) -I$(CURDIR)/src -I$(CURDIR)/src/vm \
- -I$(CURDIR)/src/dvdread
+CFLAGS += -I$(CURDIR) -I$(SRC_PATH)/src -I$(SRC_PATH)/src/vm \
+ -I$(SRC_PATH)/src/dvdread
CFLAGS += -DDVDNAV_COMPILE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
@@ -77,7 +77,7 @@ version.h: $(SVN_ENTRIES)
endif
version.h:
- sh ./version.sh
+ sh $(SRC_PATH)/version.sh $(SRC_PATH)
# General targets
@@ -93,10 +93,10 @@ ${SHLIB}: version.h $(.OBJDIR) $(SHOBJS)
cd $(.OBJDIR) && $(CC) $(SHLDFLAGS) -o $@ $(SHOBJS)
.c.so: $(BUILDDEPS)
- cd $(.OBJDIR) && $(CC) -fPIC -DPIC -MD $(CFLAGS) -c -o $@ $(CURDIR)/$<
+ cd $(.OBJDIR) && $(CC) -fPIC -DPIC -MD $(CFLAGS) -c -o $@ $<
.c.o: $(BUILDDEPS)
- cd $(.OBJDIR) && $(CC) -MD $(CFLAGS) -c -o $@ $(CURDIR)/$<
+ cd $(.OBJDIR) && $(CC) -MD $(CFLAGS) -c -o $@ $<
# Install targets
Modified: trunk/libdvdnav/configure2
==============================================================================
--- trunk/libdvdnav/configure2 (original)
+++ trunk/libdvdnav/configure2 Tue Apr 17 23:56:53 2007
@@ -6,6 +6,18 @@ dvdnav_sh_major=`echo $dvdnav_sh_version
cc=gcc
make=make
+# find source path
+source_path="`dirname \"$0\"`"
+source_path_used="yes"
+if test -z "$source_path" -o "$source_path" = "." ; then
+ source_path="`pwd`"
+ source_path_used="no"
+else
+ source_path="`cd \"$source_path\" && pwd`"
+ echo "$source_path" | grep -q '[[:blank:]]' &&
+ die "Out of tree builds are impossible with whitespace in source path."
+fi
+
show_help(){
echo "Usage: configure [options]"
echo "Options: [defaults in brackets after descriptions]"
@@ -94,6 +106,10 @@ MAKE=$make
CFLAGS=$optimizations $cflags
LDFLAGS=$ldflags
INSTALLSTRIP=$INSTALLSTRIP
+
+SRC_PATH="$source_path"
+SRC_PATH_BARE=$source_path
+
EOF
cat > config.h << EOF
@@ -101,6 +117,16 @@ cat > config.h << EOF
#include "version.h"
EOF
+# build tree in object directory if source path is different from current one
+if test "$source_path_used" != "no"; then
+ FILES="\
+ Makefile \
+ "
+ for f in $FILES ; do
+ ln -sf "$source_path/$f" $f
+ done
+fi
+
echo
echo "Done, type 'make install' to build and install"
More information about the DVDnav-discuss
mailing list