[DVDnav-discuss] r885 - in trunk/libdvdnav: Makefile configure2

nicodvb subversion at mplayerhq.hu
Fri Apr 20 00:33:42 CEST 2007


Author: nicodvb
Date: Fri Apr 20 00:33:42 2007
New Revision: 885

Modified:
   trunk/libdvdnav/Makefile
   trunk/libdvdnav/configure2

Log:
permit building dvdnav against an external dvdread; needs more work but it's better committing soon and giving otheRs the chance to work on it

Modified: trunk/libdvdnav/Makefile
==============================================================================
--- trunk/libdvdnav/Makefile	(original)
+++ trunk/libdvdnav/Makefile	Fri Apr 20 00:33:42 2007
@@ -15,21 +15,11 @@ SRCS = dvdnav.c highlight.c navigation.c
 VPATH+= $(SRC_PATH_BARE)/src/vm
 SRCS+= decoder.c vm.c vmcmd.c
 
-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
 
 
 HEADERS += src/dvd_types.h \
 	src/dvdnav.h \
-	src/dvdnav_events.h \
-	src/dvdread/dvd_reader.h \
-	src/dvdread/ifo_print.h \
-	src/dvdread/ifo_read.h \
-	src/dvdread/ifo_types.h \
-	src/dvdread/nav_print.h \
-	src/dvdread/nav_read.h \
-	src/dvdread/nav_types.h
+	src/dvdnav_events.h
 
 L=libdvdnav
 LIB = $(L).a
@@ -37,12 +27,27 @@ SHLIB = $(L).so
 
 
 CFLAGS += $(USEDEBUG) -Wall -funsigned-char
-CFLAGS += -I$(CURDIR) -I$(SRC_PATH)/src -I$(SRC_PATH)/src/vm \
-	 -I$(SRC_PATH)/src/dvdread
+CFLAGS += -I$(CURDIR) -I$(SRC_PATH)/src -I$(SRC_PATH)/src/vm
 
 CFLAGS += -DDVDNAV_COMPILE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
 CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
 
+ifeq ($(DVDREAD),internal)
+VPATH+= $(SRC_PATH_BARE)/src/dvdread
+HEADERS = src/dvdread/dvd_reader.h \
+	src/dvdread/ifo_print.h \
+	src/dvdread/ifo_read.h \
+	src/dvdread/ifo_types.h \
+	src/dvdread/nav_print.h \
+	src/dvdread/nav_read.h \
+	src/dvdread/nav_types.h
+SRCS+= dvd_input.c dvd_reader.c dvd_udf.c ifo_print.c ifo_read.c \
+	md5.c nav_print.c nav_read.c
+CFLAGS += -I$(SRC_PATH)/src/dvdread
+else
+CFLAGS += -I$(DVDREAD_DIR)
+endif
+
 SHLDFLAGS += -shared
 
 LIBS_INSTALL = $(CURDIR)/../lib

Modified: trunk/libdvdnav/configure2
==============================================================================
--- trunk/libdvdnav/configure2	(original)
+++ trunk/libdvdnav/configure2	Fri Apr 20 00:33:42 2007
@@ -34,6 +34,7 @@ show_help(){
   echo "  --disable-shared         do not build shared libraries [default=yes]"
   echo "  --enable-debug           compile with debug symbols [default=yes]"
   echo "  --disable-debug          compile without debug symbols [default=no]"
+  echo "  --with-dvdread=PATH      compile libdvdnav with an external libdvdread"
   echo "Advanced options (experts only):"
   echo "  --cc=CC                  use C compiler CC [$cc]"
   echo "  --make=MAKE              use specified make [$make]"
@@ -47,6 +48,8 @@ show_help(){
 
 SHARED=yes
 STATIC=yes
+DVDREAD=internal
+dvdread_dir=src/dvdread/
 PREFIX=/usr/local/
 INSTALLSTRIP=-s
 USEDEBUG=-g
@@ -63,6 +66,8 @@ for opt do
   ;;
   --disable-static) STATIC=no
   ;;
+  --with-dvdread=*) DVDREAD="$optval"
+  ;;
   --prefix=*) PREFIX="$optval"
   ;;
   --libdir=*) libdir="$optval"
@@ -98,6 +103,16 @@ test -z $libdir && libdir=$PREFIX/lib
 test -z $shlibdir && shlibdir=$PREFIX/lib
 test -z $incdir && incdir=$PREFIX/include/dvdnav
 
+if [ "$DVDREAD" != "internal" ] ; then
+  if [ -d "$DVDREAD" -a -f "$DVDREAD/dvd_reader.h" ] ; then
+    dvdread_dir="$DVDREAD"
+    DVDREAD=external
+  else
+    DVDREAD=internal
+  fi
+fi
+
+
 cat > config.mak << EOF 
 # Automatically generated by configure, do not edit
 PREFIX=$PREFIX
@@ -114,6 +129,8 @@ CFLAGS=$optimizations $cflags
 LDFLAGS=$ldflags
 INSTALLSTRIP=$INSTALLSTRIP
 USEDEBUG=$USEDEBUG
+DVDREAD=$DVDREAD
+DVDREAD_DIR=$dvdread_dir
 
 SRC_PATH="$source_path"
 SRC_PATH_BARE=$source_path



More information about the DVDnav-discuss mailing list