Commit 75a64b96 authored by Diego Elio Pettenò's avatar Diego Elio Pettenò Committed by Jean-Baptiste Kempf

build: remove non-autotools based build system.

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 8836a9ee
autom4te.cache
config.status
include config.mak
.SUFFIXES: .so
AR=ar
LD=ld
RANLIB=ranlib
VPATH+= $(SRC_PATH_BARE)/src
CFLAGS += $(USEDEBUG) -Wall -funsigned-char
CFLAGS += -I$(CURDIR) -I$(SRC_PATH)/src
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
L=libdvdread
DVDREAD_L=libdvdread
DVDREAD_LIB = $(DVDREAD_L).a
DVDREAD_SHLIB = $(DVDREAD_L).so
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/dvd_udf.h \
src/dvdread/nav_types.h \
src/dvdread/bitreader.h
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 bitreader.c
CFLAGS += -I$(SRC_PATH)/src
LIB = $(L).a
SHLIB = $(L).so
.OBJDIR= obj
DEPFLAG = -M
OBJS = $(patsubst %.c,%.o, $(SRCS))
DVDREAD_OBJS = $(patsubst %.c,%.o, $(DVDREAD_SRCS))
SHOBJS = $(patsubst %.c,%.so, $(SRCS))
DVDREAD_SHOBJS = $(patsubst %.c,%.so, $(DVDREAD_SRCS))
DEPS= ${OBJS:%.o=%.d}
DVDREAD_DEPS= ${DVDREAD_OBJS:%.o=%.d}
BUILDDEPS = Makefile config.mak
ifeq ($(BUILD_SHARED),yes)
all: $(SHLIB) $(DVDREAD_SHLIB) dvdread-config pkgconfig
install: $(SHLIB) $(DVDREAD_SHLIB) install-shared install-dvdread-config install-pkgconfig
endif
ifeq ($(BUILD_STATIC),yes)
all: $(LIB) $(DVDREAD_LIB) dvdread-config pkgconfig
install: $(LIB) $(DVDREAD_LIB) install-static install-dvdread-config install-pkgconfig
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 $(SRC_PATH)/version.sh $(SRC_PATH) "$(SHLIB_VERSION)"
$(SRCS) $(DVDREAD_SRCS): version.h
# General targets
${DVDREAD_LIB}: version.h $(DVDREAD_OBJS) $(BUILDDEPS)
cd $(.OBJDIR) && $(AR) rc $@ $(DVDREAD_OBJS)
cd $(.OBJDIR) && $(RANLIB) $@
${DVDREAD_SHLIB}: version.h $(DVDREAD_SHOBJS) $(BUILDDEPS)
cd $(.OBJDIR) && $(CC) $(SHLDFLAGS) $(LDFLAGS) -ldl -Wl,-soname=$(DVDREAD_SHLIB).$(SHLIB_MAJOR) -o $@ $(DVDREAD_SHOBJS)
.c.so: $(BUILDDEPS)
cd $(.OBJDIR) && $(CC) -fPIC -DPIC -MD $(CFLAGS) -c -o $@ $<
.c.o: $(BUILDDEPS)
cd $(.OBJDIR) && $(CC) -MD $(CFLAGS) -c -o $@ $<
# Install targets
install-headers:
install -d $(DESTDIR)$(dvdread_incdir)
install -m 644 $(DVDREAD_HEADERS) $(DESTDIR)$(dvdread_incdir)
install-shared: $(SHLIB)
install -d $(DESTDIR)$(shlibdir)
install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(SHLIB) \
$(DESTDIR)$(shlibdir)/$(SHLIB).$(SHLIB_VERSION)
cd $(DESTDIR)$(shlibdir) && \
ln -sf $(SHLIB).$(SHLIB_VERSION) $(SHLIB).$(SHLIB_MAJOR)
cd $(DESTDIR)$(shlibdir) && \
ln -sf $(SHLIB).$(SHLIB_MAJOR) $(SHLIB)
install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(DVDREAD_SHLIB) \
$(DESTDIR)$(shlibdir)/$(DVDREAD_SHLIB).$(SHLIB_VERSION)
cd $(DESTDIR)$(shlibdir) && \
ln -sf $(DVDREAD_SHLIB).$(SHLIB_VERSION) $(DVDREAD_SHLIB).$(SHLIB_MAJOR)
cd $(DESTDIR)$(shlibdir) && \
ln -sf $(DVDREAD_SHLIB).$(SHLIB_MAJOR) $(DVDREAD_SHLIB)
install-static: $(LIB)
install -d $(DESTDIR)$(libdir)
install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(LIB) $(DESTDIR)$(libdir)/$(LIB)
install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(DVDREAD_LIB) $(DESTDIR)$(libdir)/$(DVDREAD_LIB)
# Clean targets
clean:
rm -rf *~ $(.OBJDIR)/* version.h
distclean: clean
find . -name "*~" | xargs rm -rf
rm -rf config.mak $(.OBJDIR)
dvdread-config: $(.OBJDIR)/dvdread-config
$(.OBJDIR)/dvdread-config: $(BUILDDEPS)
@echo '#!/bin/sh' > $(.OBJDIR)/dvdread-config
@echo 'prefix='$(PREFIX) >> $(.OBJDIR)/dvdread-config
@echo 'libdir='$(shlibdir) >> $(.OBJDIR)/dvdread-config
@echo 'version='$(SHLIB_VERSION) >> $(.OBJDIR)/dvdread-config
@echo >> $(.OBJDIR)/dvdread-config
cat $(SRC_PATH_BARE)/misc/dvdread-config.sh >> $(.OBJDIR)/dvdread-config
chmod 0755 $(.OBJDIR)/dvdread-config
install-dvdread-config: dvdread-config
install -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 $(.OBJDIR)/dvdread-config $(DESTDIR)$(PREFIX)/bin/dvdread-config
pcedit = sed \
-e 's,@prefix@,$(PREFIX),' \
-e 's,@exec_prefix@,$(PREFIX),' \
-e 's,@libdir@,$(shlibdir),' \
-e 's,@includedir@,$(PREFIX)/include,' \
-e 's,@VERSION@,$(SHLIB_VERSION),'
pkgconfig: $(.OBJDIR)/dvdread.pc
$(.OBJDIR)/dvdread.pc: misc/dvdread.pc.in $(BUILDDEPS)
$(pcedit) $< > $@
install-pkgconfig: $(.OBJDIR)/dvdread.pc
install -d $(DESTDIR)$(libdir)/pkgconfig
install -m 0644 $(.OBJDIR)/dvdread.pc $(DESTDIR)$(libdir)/pkgconfig
vpath %.so ${.OBJDIR}
vpath %.o ${.OBJDIR}
vpath ${LIB} ${.OBJDIR}
# include dependency files if they exist
$(addprefix ${.OBJDIR}/, ${DEPS}): ;
-include $(addprefix ${.OBJDIR}/, ${DEPS})
#!/bin/sh
dvdread_sh_version=4.2.0
dvdread_sh_major=`echo $dvdread_sh_version | awk -F. '{print $1}'`
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]"
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/libdvdread]"
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 compile with debug symbols [default=yes]"
echo " --disable-debug compile without debug symbols [default=no]"
echo "Advanced options (experts only):"
echo " --cc=CC use C compiler CC [$cc]"
echo " --make=MAKE use specified make [$make]"
echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS"
echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"
echo "Developer options:"
echo " --disable-strip disable stripping of executables and shared libraries"
echo " --disable-opts disable compiler optimizations"
exit 1
}
SHARED=yes
STATIC=yes
PREFIX=/usr/local/
INSTALLSTRIP=-s
USEDEBUG=-g
optimizations="-O3"
for opt do
optval=`echo $opt | cut -d '=' -f 2-`
case "$opt" in
--enable-shared) SHARED=yes
;;
--disable-shared) SHARED=no
;;
--enable-static) STATIC=yes
;;
--disable-static) STATIC=no
;;
--prefix=*) PREFIX="$optval"
;;
--libdir=*) libdir="$optval"
;;
--shlibdir=*) shlibdir="$optval"
;;
--incdir=*) incdir="$optval"
;;
--cc=*) cc="$optval"
;;
--make=*) make="$optval"
;;
--extra-cflags=*) cflags="$cflags $optval"
;;
--extra-ldflags=*) ldflags="$ldflags $optval"
;;
--disable-strip) INSTALLSTRIP=
;;
--disable-opts) optimizations=""
;;
--disable-debug) USEDEBUG=""
;;
--enable-debug) USEDEBUG="-g"
;;
--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/dvdread
targetos=`uname -s`
case $targetos in
Darwin)
SHLDFLAGS="-dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress"
;;
*)
SHLDFLAGS="-shared"
;;
esac
echo -n "Checking if we're big-endian... "
bigendian=no
TMPD=`mktemp -d`
TMPC=$TMPD/endian.c
TMPO=$TMPD/endian.o
cat > $TMPC <<EOF
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
$cc $optimizations $cflags -c -o $TMPO $TMPC
od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && bigendian=yes
rm -rf $TMPD
echo "$bigendian"
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=$dvdread_sh_version
SHLIB_MAJOR=$dvdread_sh_major
CC=$cc
MAKE=$make
CFLAGS=$optimizations $cflags
LDFLAGS=$ldflags
SHLDFLAGS=$SHLDFLAGS
INSTALLSTRIP=$INSTALLSTRIP
USEDEBUG=$USEDEBUG
SRC_PATH="$source_path"
SRC_PATH_BARE=$source_path
EOF
cat > config.h << EOF
/* Automatically generated by configure, do not edit */
#include "version.h"
EOF
test "$bigendian" = "yes" && echo "#define WORDS_BIGENDIAN" >> config.h || echo "#undef WORDS_BIGENDIAN" >> config.h
# build tree in object directory if source path is different from current one
if test "$source_path_used" != "no"; then
FILES="\
Makefile \
misc \
"
for f in $FILES ; do
ln -sf "$source_path/$f" $f
done
fi
[ -d obj ] || mkdir -p obj
echo
echo "Done, type 'make install' to build and install"
#!/bin/sh
##
## A simple compare directory content utility.
##
topdir="`pwd`"
distdir="@PACKAGE_NAME@-@PACKAGE_VERSION@"
log="$topdir/dist-log"
logerror="$topdir/dist-errors"
getdir() {
if test -r .relignore; then
filelist=`ls | grep -Fxvf .relignore`
else
filelist=`ls`
fi
for file in $filelist; do
if test -d $file -a $file != "CVS" -a $file != $distdir; then
(cd $file && getdir) || (cd ..)
else
if test ! -d $file -a \
$file != $log -a \
$file != $logerror -a \
$file != "$distdir.tar.gz"; then
orifile=`pwd`/$file
distfile=$topdir/$distdir${orifile##*$topdir}
echo -e "check:\t$orifile\nand\t$distfile" >> $log
if test ! -e $distfile; then
missingfile=${orifile##$topdir}
echo "${missingfile#/} is missing in tarball" >> $logerror
fi
fi
fi
done
}
main() {
rm -f $log $logerror
make config.status && make dist && mv $distdir.tar.gz $distdir.tmp.tar.gz && \
cp config.status config.tmp.status && make clean && make distclean && \
mv $distdir.tmp.tar.gz $distdir.tar.gz && mv config.tmp.status config.status && \
tar -xzf $distdir.tar.gz
echo "Check is running, be patient..."
getdir
rm -rf $distdir
rm -f $distdir.tar.gz
./config.status --recheck
./config.status
echo " * Log is ${log##*/}"
echo " * Error log is ${logerror##*/}"
}
main
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