[DVDnav-discuss] r871 - in trunk/libdvdnav: Makefile configure2 version.sh
nicodvb
subversion at mplayerhq.hu
Sun Apr 15 23:58:42 CEST 2007
Author: nicodvb
Date: Sun Apr 15 23:58:42 2007
New Revision: 871
Added:
trunk/libdvdnav/Makefile (contents, props changed)
trunk/libdvdnav/configure2 (contents, props changed)
trunk/libdvdnav/version.sh (contents, props changed)
Log:
initial revision of new build system; patch by Andreas Oman (andreas olebyn nu)
Added: trunk/libdvdnav/Makefile
==============================================================================
--- (empty file)
+++ trunk/libdvdnav/Makefile Sun Apr 15 23:58:42 2007
@@ -0,0 +1,144 @@
+# libdvdnav Makefile
+
+include config.mak
+
+.SUFFIXES: .so
+
+MAKE=make
+CC=gcc
+AR=ar
+LD=ld
+RANLIB=ranlib
+
+VPATH+= src
+SRCS = dvdnav.c highlight.c navigation.c read_cache.c remap.c \
+ searching.c settings.c
+
+VPATH+= src/vm
+SRCS+= decoder.c vm.c vmcmd.c
+
+VPATH+= 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
+
+L=libdvdnav
+LIB = $(L).a
+SHLIB = $(L).so
+
+
+CFLAGS += -g -Wall -funsigned-char -O3
+CFLAGS += -I$(CURDIR) -I$(CURDIR)/src -I$(CURDIR)/src/vm \
+ -I$(CURDIR)/src/dvdread
+
+CFLAGS += -DDVDNAV_COMPILE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
+
+SHLDFLAGS += -shared
+
+LIBS_INSTALL = $(CURDIR)/../lib
+INCLUDES_INSTALL = $(CURDIR)/../include/libhts
+
+.OBJDIR= obj
+DEPFLAG = -M
+
+OBJS = $(patsubst %.c,%.o, $(SRCS))
+SHOBJS = $(patsubst %.c,%.so, $(SRCS))
+DEPS= ${OBJS:%.o=%.d}
+
+BUILDDEPS = Makefile config.mak
+
+ifeq ($(BUILD_SHARED),yes)
+all: $(SHLIB)
+install: $(SHLIB) install-shared
+endif
+
+ifeq ($(BUILD_STATIC),yes)
+all: $(LIB)
+install: $(LIB) install-static
+endif
+
+install: install-headers
+
+# Let version.sh create version.h
+
+SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
+ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
+version.h: $(SVN_ENTRIES)
+endif
+
+version.h:
+ sh ./version.sh
+
+
+# General targets
+
+$(.OBJDIR):
+ mkdir $(.OBJDIR)
+
+${LIB}: version.h $(.OBJDIR) $(OBJS) $(BUILDDEPS)
+ cd $(.OBJDIR) && $(AR) rc $@ $(OBJS)
+ cd $(.OBJDIR) && $(RANLIB) $@
+
+${SHLIB}: version.h $(.OBJDIR) $(SHOBJS) $(BUILDDEPS)
+ cd $(.OBJDIR) && $(CC) $(SHLDFLAGS) -o $@ $(SHOBJS)
+
+.c.so: $(BUILDDEPS)
+ cd $(.OBJDIR) && $(CC) -fPIC -DPIC -MD $(CFLAGS) -c -o $@ $(CURDIR)/$<
+
+.c.o: $(BUILDDEPS)
+ cd $(.OBJDIR) && $(CC) -MD $(CFLAGS) -c -o $@ $(CURDIR)/$<
+
+
+# Install targets
+
+install-headers:
+ install -d $(incdir)
+ install -m 644 $(HEADERS) $(incdir)
+
+install-shared: $(SHLIB)
+ install -d $(shlibdir)
+
+ install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(SHLIB) \
+ $(shlibdir)/$(SHLIB).$(SHLIB_VERSION)
+
+ cd $(shlibdir) && \
+ ln -sf $(SHLIB).$(SHLIB_VERSION) $(SHLIB).$(SHLIB_MAJOR)
+ cd $(shlibdir) && \
+ ln -sf $(SHLIB).$(SHLIB_MAJOR) $(SHLIB)
+
+install-static: $(LIB)
+ install -d $(libdir)
+
+ install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(LIB) $(libdir)/$(LIB)
+
+
+# Clean targets
+
+clean:
+ rm -rf *~ $(.OBJDIR) version.h
+
+
+distclean: clean
+ find . -name "*~" | xargs rm -rf
+ rm -rf config.mak
+
+
+vpath %.so ${.OBJDIR}
+vpath %.o ${.OBJDIR}
+vpath ${LIB} ${.OBJDIR}
+
+# include dependency files if they exist
+$(addprefix ${.OBJDIR}/, ${DEPS}): ;
+-include $(addprefix ${.OBJDIR}/, ${DEPS})
Added: trunk/libdvdnav/configure2
==============================================================================
--- (empty file)
+++ trunk/libdvdnav/configure2 Sun Apr 15 23:58:42 2007
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+dvdnav_sh_version=4.1.1
+dvdnav_sh_major=`echo $dvdnav_sh_version | awk -F. '{print $1}'`
+
+show_help(){
+ echo "Usage: configure [options]"
+ echo "Options: [defaults in brackets after descriptions]"
+ echo
+ echo "Standard options:"
+ echo " --help print this message"
+ echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
+ echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
+ echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
+ echo " --incdir=DIR install includes in DIR [PREFIX/include/dvdnav]"
+ echo " --enable-static build static libraries [default=yes]"
+ echo " --disable-static do not build static libraries [default=no]"
+ echo " --enable-shared build shared libraries [default=no]"
+ echo " --disable-shared do not build shared libraries [default=yes]"
+ echo " --enable-debug install with debugging symbols [default=no]"
+ exit 1
+}
+
+
+SHARED=yes
+STATIC=yes
+PREFIX=/usr/local/
+INSTALLSTRIP=-s
+
+for opt do
+ optval="${opt#*=}"
+ case "$opt" in
+ --enable-debug) INSTALLSTRIP=
+ ;;
+ --enable-shared) SHARED=yes
+ ;;
+ --enable-shared) SHARED=no
+ ;;
+ --enable-static) STATIC=yes
+ ;;
+ --enable-static) STATIC=no
+ ;;
+ --prefix=*) PREFIX="$optval"
+ ;;
+ --libdir=*) libdir="$optval"
+ ;;
+ --shlibdir=*) shlibdir="$optval"
+ ;;
+ --incdir=*) incdir="$optval"
+ ;;
+ --help) show_help
+ ;;
+ esac
+done
+
+PREFIX=`cd $PREFIX && pwd`
+
+test -z $libdir && libdir=$PREFIX/lib
+test -z $shlibdir && shlibdir=$PREFIX/lib
+test -z $incdir && incdir=$PREFIX/include/dvdnav
+
+cat > config.mak << EOF
+# Automatically generated by configure, do not edit
+PREFIX=$PREFIX
+libdir=$libdir
+shlibdir=$shlibdir
+incdir=$incdir
+BUILD_SHARED=$SHARED
+BUILD_STATIC=$STATIC
+SHLIB_VERSION=$dvdnav_sh_version
+SHLIB_MAJOR=$dvdnav_sh_major
+INSTALLSTRIP=$INSTALLSTRIP
+EOF
+
+cat > config.h << EOF
+/* Automatically generated by configure, do not edit */
+#include "version.h"
+EOF
+
+echo
+echo "Done, type 'make install' to build and install"
+
Added: trunk/libdvdnav/version.sh
==============================================================================
--- (empty file)
+++ trunk/libdvdnav/version.sh Sun Apr 15 23:58:42 2007
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+svn_revision=`cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
+test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries | \
+ cut -d '"' -f2 2> /dev/null`
+test $svn_revision || svn_revision=UNKNOWN
+
+NEW_REVISION="#define VERSION \"SVN-r$svn_revision\""
+OLD_REVISION=`cat version.h 2> /dev/null`
+
+# Update version.h only on revision changes to avoid spurious rebuilds
+if test "$NEW_REVISION" != "$OLD_REVISION"; then
+ echo "$NEW_REVISION" > version.h
+fi
More information about the DVDnav-discuss
mailing list