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: ...@@ -304,6 +304,12 @@ libdvdcss-install:
libdvdcss-uninstall: libdvdcss-uninstall:
-cd extras/libdvdcss && $(MAKE) uninstall -cd extras/libdvdcss && $(MAKE) uninstall
libdvdread-install:
-cd extras/libdvdread && $(MAKE) install
libdvdread-uninstall:
-cd extras/libdvdread && $(MAKE) uninstall
po-install: po-install:
-cd po && $(MAKE) install -cd po && $(MAKE) install
......
...@@ -72,10 +72,7 @@ LIB_BEOS = @LIB_BEOS@ ...@@ -72,10 +72,7 @@ LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@ LIB_DARWIN = @LIB_DARWIN@
LIB_DIRECTX = @LIB_DIRECTX@ LIB_DIRECTX = @LIB_DIRECTX@
LIB_DVD = @LIB_DVD@ LIB_DVD = @LIB_DVD@
LIB_DVD_PLUGIN = @LIB_DVD_PLUGIN@
LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
LIB_DVDREAD = @LIB_DVDREAD@ LIB_DVDREAD = @LIB_DVDREAD@
LIB_DVDREAD_PLUGIN = @LIB_DVDREAD_PLUGIN@
LIB_ESD = @LIB_ESD@ LIB_ESD = @LIB_ESD@
LIB_FILTER_DISTORT = @LIB_FILTER_DISTORT@ LIB_FILTER_DISTORT = @LIB_FILTER_DISTORT@
LIB_GGI = @LIB_GGI@ LIB_GGI = @LIB_GGI@
...@@ -88,6 +85,7 @@ LIB_IMDCT3DN = @LIB_IMDCT3DN@ ...@@ -88,6 +85,7 @@ LIB_IMDCT3DN = @LIB_IMDCT3DN@
LIB_IMDCTSSE = @LIB_IMDCTSSE@ LIB_IMDCTSSE = @LIB_IMDCTSSE@
LIB_KDE = @LIB_KDE@ LIB_KDE = @LIB_KDE@
LIB_LIBDVDCSS = @LIB_LIBDVDCSS@ LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
LIB_LIBDVDREAD = @LIB_LIBDVDREAD@
LIB_MACOSX = @LIB_MACOSX@ LIB_MACOSX = @LIB_MACOSX@
LIB_MAD = @LIB_MAD@ LIB_MAD = @LIB_MAD@
LIB_MOTIONALTIVEC = @LIB_MOTIONALTIVEC@ LIB_MOTIONALTIVEC = @LIB_MOTIONALTIVEC@
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -759,90 +759,118 @@ AC_ARG_WITH(dvdcss, ...@@ -759,90 +759,118 @@ AC_ARG_WITH(dvdcss,
[ case "x${withval}" in [ case "x${withval}" in
xlocal-static|xyes) xlocal-static|xyes)
# local libdvdcss, statically linked # local libdvdcss, statically linked
BUILTINS="${BUILTINS} dvd"
if test x${CAN_BUILD_LIBDVDCSS} = x1 if test x${CAN_BUILD_LIBDVDCSS} = x1
then then
NEED_LIBDVDCSS=1 NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1 STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss" CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_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 fi
;; ;;
xlocal-shared) xlocal-shared)
# local libdvdcss, dynamically linked # local libdvdcss, dynamically linked
PLUGINS="${PLUGINS} dvd"
if test x${CAN_BUILD_LIBDVDCSS} = x1 if test x${CAN_BUILD_LIBDVDCSS} = x1
then then
NEED_LIBDVDCSS=1 NEED_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss" CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} -Llib -ldvdcss" LIB_DVD="${LIB_DVD} -L../../lib -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"
fi fi
;; ;;
xno) xno)
# don't use libdvdcss at all, build a DVD module that can dlopen() it # don't use libdvdcss at all, build a DVD module that can dlopen() it
DUMMY_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd" BUILTINS="${BUILTINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c" SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA" CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\"" CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
LIB_DVD="${LIB_DVD} -ldl" 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 # existing libdvdcss
BUILTINS="${BUILTINS} dvd" PLUGINS="${PLUGINS} dvd"
if test "x$withval" != "xyes" if test "x$withval" != "xyes"
then then
LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib" LIB_DVD="${LIB_DVD} -L"$withval"/lib"
LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L"$withval"/lib"
CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include" CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
fi fi
LIB_DVD="${LIB_DVD} -ldvdcss" 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 ], esac ],
# user didn't decide, we choose to use local libdvdcss and link statically # 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 libdvdcss is in the archive, or to use the dummy replacement otherwise.
[ if test x${CAN_BUILD_LIBDVDCSS} = x1 [ if test x${CAN_BUILD_LIBDVDCSS} = x1
then then
BUILTINS="${BUILTINS} dvd"
NEED_LIBDVDCSS=1 NEED_LIBDVDCSS=1
STATIC_LIBDVDCSS=1 STATIC_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd"
CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss" CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_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 else
# XXX: no check for libdl is done, don't try this at home ! # XXX: no check for libdl is done, don't try this at home !
DUMMY_LIBDVDCSS=1
BUILTINS="${BUILTINS} dvd" BUILTINS="${BUILTINS} dvd"
DUMMY_LIBDVDCSS=1
SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c" SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA" CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
LIB_DVD="${LIB_DVD} -ldl" 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 ]) fi ])
dnl dnl
dnl DVDREAD module: check for libdvdread plugin dnl DVDREAD module: check for libdvdread plugin
dnl dnl
AC_ARG_ENABLE(dvdread, if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
[ --enable-dvdread Enable dvdread support (default disabled)], if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
[ if test x$enableval = xyes 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 then
BUILTINS="${BUILTINS} dvdread" BUILTINS="${BUILTINS} dvdread"
CFLAGS_DVDREAD="${CFLAGS_DVD} ${CFLAGS_DVDREAD} -I../../extras/libdvdread" 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 ]) fi ])
dnl dnl
...@@ -1431,9 +1459,7 @@ AC_SUBST(LIB_BEOS) ...@@ -1431,9 +1459,7 @@ AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN) AC_SUBST(LIB_DARWIN)
AC_SUBST(LIB_DIRECTX) AC_SUBST(LIB_DIRECTX)
AC_SUBST(LIB_DVD) AC_SUBST(LIB_DVD)
AC_SUBST(LIB_DVD_PLUGIN)
AC_SUBST(LIB_DVDREAD) AC_SUBST(LIB_DVDREAD)
AC_SUBST(LIB_DVDREAD_PLUGIN)
AC_SUBST(LIB_ESD) AC_SUBST(LIB_ESD)
AC_SUBST(LIB_FILTER_DISTORT) AC_SUBST(LIB_FILTER_DISTORT)
AC_SUBST(LIB_GGI) AC_SUBST(LIB_GGI)
...@@ -1446,6 +1472,7 @@ AC_SUBST(LIB_IMDCT3DN) ...@@ -1446,6 +1472,7 @@ AC_SUBST(LIB_IMDCT3DN)
AC_SUBST(LIB_IMDCTSSE) AC_SUBST(LIB_IMDCTSSE)
AC_SUBST(LIB_KDE) AC_SUBST(LIB_KDE)
AC_SUBST(LIB_LIBDVDCSS) AC_SUBST(LIB_LIBDVDCSS)
AC_SUBST(LIB_LIBDVDREAD)
AC_SUBST(LIB_MACOSX) AC_SUBST(LIB_MACOSX)
AC_SUBST(LIB_MAD) AC_SUBST(LIB_MAD)
AC_SUBST(LIB_MOTIONALTIVEC) AC_SUBST(LIB_MOTIONALTIVEC)
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
# (c)2001 VideoLAN # (c)2001 VideoLAN
############################################################################### ###############################################################################
LIBDVDREAD_VERSION := 0.9.2 LIBDVDREAD_VERSION := 0.9.2-videolan
CFLAGS_LIBDVDREAD := -I. -DHAVE_CONFIG_H
LIB_LIBDVDREAD := -ldl
BASE_A := libdvdread.a BASE_A := libdvdread.a
BASE_SO := libdvdread.so BASE_SO := libdvdread.so
...@@ -19,7 +17,7 @@ endif ...@@ -19,7 +17,7 @@ endif
# #
# C headers directories # C headers directories
# #
CFLAGS := -I../../include -I../../extras $(CFLAGS) CFLAGS := -I../../include $(CFLAGS_DVDREAD) $(CFLAGS)
# #
# Objects # Objects
...@@ -36,13 +34,26 @@ C_DEP := $(ALL_OBJ:%.o=.dep/%.d) ...@@ -36,13 +34,26 @@ C_DEP := $(ALL_OBJ:%.o=.dep/%.d)
# #
# Virtual targets # Virtual targets
# #
all: ../../lib/$(BASE_A) all: ../../lib/$(BASE_A) ../../lib/$(FULL_SO)
clean: clean:
rm -f $(ALL_OBJ) rm -f $(ALL_OBJ)
rm -f *.o rm -f *.o
rm -rf .dep 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: FORCE:
$(ALL_OBJ): %.o: ../../Makefile.dep Makefile $(ALL_OBJ): %.o: ../../Makefile.dep Makefile
...@@ -52,10 +63,10 @@ $(C_DEP): %.d: FORCE ...@@ -52,10 +63,10 @@ $(C_DEP): %.d: FORCE
$(OBJ_C): %.o: .dep/%.d $(OBJ_C): %.o: .dep/%.d
$(OBJ_C): %.o: %.c $(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) ../../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/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_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