Commit 8c0d4cd7 authored by Stéphane Borel's avatar Stéphane Borel

Configure and Makefile tweaking for dvdread module.

It is now activated with option --with-dvdread, that takes the same options
as --with-dvdcss.
If you link with libdvdread statically dvdread is compiled builtin ; if you
link dynamically, it is compiled as a plugin.
parent 4c681149
......@@ -304,6 +304,12 @@ libdvdcss-install:
libdvdcss-uninstall:
-cd extras/libdvdcss && $(MAKE) uninstall
libdvdread-install:
-cd extras/libdvdread && $(MAKE) install
libdvdread-uninstall:
-cd extras/libdvdread && $(MAKE) uninstall
po-install:
-cd po && $(MAKE) install
......
......@@ -72,10 +72,7 @@ LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@
LIB_DIRECTX = @LIB_DIRECTX@
LIB_DVD = @LIB_DVD@
LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
LIB_DVDREAD = @LIB_DVDREAD@
LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
LIB_ESD = @LIB_ESD@
LIB_FILTER_DISTORT = @LIB_FILTER_DISTORT@
LIB_GGI = @LIB_GGI@
......@@ -88,6 +85,7 @@ LIB_IMDCT3DN = @LIB_IMDCT3DN@
LIB_IMDCTSSE = @LIB_IMDCTSSE@
LIB_KDE = @LIB_KDE@
LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
LIB_LIBDVDREAD = @LIB_LIBDVDREAD@
LIB_MACOSX = @LIB_MACOSX@
LIB_MAD = @LIB_MAD@
LIB_MOTIONALTIVEC = @LIB_MOTIONALTIVEC@
......
This diff is collapsed.
......@@ -759,91 +759,119 @@ AC_ARG_WITH(dvdcss,
[ case "x${withval}" in
xlocal-static|xyes)
# local libdvdcss, statically linked
BUILTINS="${BUILTINS} dvd"
if test x${CAN_BUILD_LIBDVDCSS} = x1
then
NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
fi
;;
xlocal-shared)
# local libdvdcss, dynamically linked
PLUGINS="${PLUGINS} dvd"
if test x${CAN_BUILD_LIBDVDCSS} = x1
then
NEED_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
LIB_DVDREAD="${LIB_DVD} -Llib -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L../../lib -ldvdcss"
LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
fi
;;
xno)
# don't use libdvdcss at all, build a DVD module that can dlopen() it
DUMMY_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
;;
*)
# existing libdvdcss
BUILTINS="${BUILTINS} dvd"
PLUGINS="${PLUGINS} dvd"
if test "x$withval" != "xyes"
then
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L"$withval"/lib"
LIB_DVD="${LIB_DVD} -L"$withval"/lib"
CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
fi
LIB_DVD="${LIB_DVD} -ldvdcss"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
LIB_DVDREAD="${LIB_DVDREAD} -ldvdread -ldvdcss"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdread -ldvdcss"
esac ],
# user didn't decide, we choose to use local libdvdcss and link statically
# if libdvdcss is in the archive, or to use the dummy replacement otherwise.
[ if test x${CAN_BUILD_LIBDVDCSS} = x1
then
BUILTINS="${BUILTINS} dvd"
NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdread.a ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
else
# XXX: no check for libdl is done, don't try this at home !
DUMMY_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
LIB_DVD="${LIB_DVD} -ldl"
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
fi ])
dnl
dnl DVDREAD module: check for libdvdread plugin
dnl
AC_ARG_ENABLE(dvdread,
[ --enable-dvdread Enable dvdread support (default disabled)],
[ if test x$enableval = xyes
then
BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVD} ${CFLAGS_DVDREAD} -I../../extras/libdvdread"
fi ])
if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
AC_ARG_WITH(dvdread,
[ --with-dvdread[=name] way to use libdvdread,
same options as --with-dvdcss (default no)],
[ case "x${withval}" in
xlocal-static|xyes)
if test x${STATIC_LIBDVDREAD} = x1
then
BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
else
AC_MSG_ERROR([Can't link static dvdread with shared dvdcss])
fi
;;
xno)
;;
x)
if test x${STATIC_LIBDVDREAD} = x1
then
BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
else
PLUGINS="${PLUGINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread ${CFLAGS_DVD}"
LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
fi
;;
*)
if test "x$withval" != "xlocal-shared"
then
LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
else
LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
fi
if test x${STATIC_LIBDVDCSS} = x1
then
AC_MSG_ERROR([Can't link shared dvdread with static dvdcss])
else
PLUGINS="${PLUGINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
fi
esac
if test x${DUMMY_LIBDVDCSS} = x1
then
LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
else
LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
fi ])
dnl
dnl VCD module
......@@ -1431,9 +1459,7 @@ AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
AC_SUBST(LIB_DIRECTX)
AC_SUBST(LIB_DVD)
AC_SUBST(LIB_DVD_PLUGIN)
AC_SUBST(LIB_DVDREAD)
AC_SUBST(LIB_DVDREAD_PLUGIN)
AC_SUBST(LIB_ESD)
AC_SUBST(LIB_FILTER_DISTORT)
AC_SUBST(LIB_GGI)
......@@ -1446,6 +1472,7 @@ AC_SUBST(LIB_IMDCT3DN)
AC_SUBST(LIB_IMDCTSSE)
AC_SUBST(LIB_KDE)
AC_SUBST(LIB_LIBDVDCSS)
AC_SUBST(LIB_LIBDVDREAD)
AC_SUBST(LIB_MACOSX)
AC_SUBST(LIB_MAD)
AC_SUBST(LIB_MOTIONALTIVEC)
......
......@@ -3,9 +3,7 @@
# (c)2001 VideoLAN
###############################################################################
LIBDVDREAD_VERSION := 0.9.2
CFLAGS_LIBDVDREAD := -I. -DHAVE_CONFIG_H
LIB_LIBDVDREAD := -ldl
LIBDVDREAD_VERSION := 0.9.2-videolan
BASE_A := libdvdread.a
BASE_SO := libdvdread.so
......@@ -19,7 +17,7 @@ endif
#
# C headers directories
#
CFLAGS := -I../../include -I../../extras $(CFLAGS)
CFLAGS := -I../../include $(CFLAGS_DVDREAD) $(CFLAGS)
#
# Objects
......@@ -36,26 +34,39 @@ C_DEP := $(ALL_OBJ:%.o=.dep/%.d)
#
# Virtual targets
#
all: ../../lib/$(BASE_A)
all: ../../lib/$(BASE_A) ../../lib/$(FULL_SO)
clean:
rm -f $(ALL_OBJ)
rm -f *.o
rm -rf .dep
install:
mkdir -p $(DESTDIR)$(libdir)
-$(INSTALL) -m 644 ../../lib/$(BASE_A) $(DESTDIR)$(libdir)
-$(INSTALL) -m 644 ../../lib/$(FULL_SO) $(DESTDIR)$(libdir)
rm -f $(DESTDIR)$(libdir)/$(BASE_SO) && ln -s $(FULL_SO) $(DESTDIR)$(libdir)/$(BASE_SO)
rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO) && ln -s $(FULL_SO) $(DESTDIR)$(libdir)/$(MAJOR_SO)
uninstall:
rm -f $(DESTDIR)$(libdir)/$(BASE_A)
rm -f $(DESTDIR)$(libdir)/$(BASE_SO)
rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO)
rm -f $(DESTDIR)$(libdir)/$(FULL_SO)
FORCE:
$(ALL_OBJ): %.o: ../../Makefile.dep Makefile
$(C_DEP): %.d: FORCE
@$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@
@$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@
$(OBJ_C): %.o: .dep/%.d
$(OBJ_C): %.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_DVDREAD) $(CFLAGS_LIBDVDREAD) $(PCFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
../../lib/$(FULL_SO): $(OBJ_C) $(OBJ_LIBDVDREAD)
$(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_LIBDVDREAD)
$(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLDFLAGS) $(LIB_LIBDVDREAD)
rm -f ../../lib/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_SO)
......
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