From 67aef6117a2eccec0f5b8dcef7cfd3fd6f930185 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sun, 7 Jun 2015 16:29:06 +0000 Subject: [PATCH] Only compile video source code if it is enabled. --- config/config.mk.in | 4 ++++ config/configure.ac | 16 +++++++++------- src/Makefile | 14 ++++++++------ src/asfvideo.cpp | 8 ++------ src/matroskavideo.cpp | 7 +------ src/quicktimevideo.cpp | 7 +------ src/riffvideo.cpp | 7 +------ src/utilsvideo.cpp | 2 +- 8 files changed, 27 insertions(+), 38 deletions(-) diff --git a/config/config.mk.in b/config/config.mk.in index 21c9762f..119008fb 100644 --- a/config/config.mk.in +++ b/config/config.mk.in @@ -120,6 +120,10 @@ EXPAT_LDFLAGS = @EXPAT_LDFLAGS@ EXPAT_CPPFLAGS = @EXPAT_CPPFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ +# ********************************************************************** +# Video support +ENABLE_VIDEO = @ENABLE_VIDEO@ + # ********************************************************************** # Libraries, include files, functions HAVE_LIBZ = @HAVE_LIBZ@ diff --git a/config/configure.ac b/config/configure.ac index 82f8d5d4..ce304702 100644 --- a/config/configure.ac +++ b/config/configure.ac @@ -153,13 +153,15 @@ AC_MSG_RESULT($USE_XMP_TOOLKIT) AC_MSG_CHECKING([whether to compile with video support]) AC_ARG_ENABLE(video, - [ --enable-video compile with the ENABLE_VIDEO set ], - ENABLE_VIDEO=$enableval, ENABLE_VIDEO=no) -AC_MSG_RESULT($ENABLE_VIDEO) -AC_SUBST(ENABLE_VIDEO) -if test "$enable_video" = "yes"; then + [ --enable-video compile with video support ], + USE_VIDEO=$enableval, USE_VIDEO=no) +AC_MSG_RESULT($USE_VIDEO) +ENABLE_VIDEO= +if test "$USE_VIDEO" = "yes"; then + ENABLE_VIDEO=1 AC_DEFINE(ENABLE_VIDEO) fi +AC_SUBST(ENABLE_VIDEO,$ENABLE_VIDEO) AC_MSG_CHECKING([whether to compile with webready support]) AC_ARG_ENABLE(webready, @@ -380,8 +382,8 @@ yes) echo "-- XMP metadata support........... YES" ;; echo "" ;; esac -case "$ENABLE_VIDEO" in -yes) echo "-- Video support.................. YES" ;; +case "x$ENABLE_VIDEO" in +x1) echo "-- Video support.................. YES" ;; *) echo "-- Video support.................. NO" esac diff --git a/src/Makefile b/src/Makefile index 9f872d45..559cc47f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -66,8 +66,7 @@ CCHDR = exiv2.hpp \ version.hpp # Add library C++ source files to this list -CCSRC = asfvideo.cpp \ - basicio.cpp \ +CCSRC = basicio.cpp \ bmpimage.cpp \ canonmn.cpp \ casiomn.cpp \ @@ -88,7 +87,6 @@ CCSRC = asfvideo.cpp \ jp2image.cpp \ jpgimage.cpp \ makernote.cpp \ - matroskavideo.cpp \ metadatum.cpp \ minoltamn.cpp \ mrwimage.cpp \ @@ -105,9 +103,7 @@ endif CCSRC += preview.cpp \ properties.cpp \ psdimage.cpp \ - quicktimevideo.cpp \ rafimage.cpp \ - riffvideo.cpp \ rw2image.cpp \ samsungmn.cpp \ ssh.cpp \ @@ -119,11 +115,17 @@ CCSRC += preview.cpp \ tiffimage.cpp \ tiffvisitor.cpp \ types.cpp \ - utilsvideo.cpp \ value.cpp \ version.cpp \ xmp.cpp \ xmpsidecar.cpp +ifdef ENABLE_VIDEO +CCSRC += asfvideo.cpp \ + matroskavideo.cpp \ + quicktimevideo.cpp \ + riffvideo.cpp \ + utilsvideo.cpp +endif # Add library C source files to this list ifndef HAVE_TIMEGM diff --git a/src/asfvideo.cpp b/src/asfvideo.cpp index fd403ce9..22f11fd9 100644 --- a/src/asfvideo.cpp +++ b/src/asfvideo.cpp @@ -32,12 +32,8 @@ EXIV2_RCSID("@(#) $Id$") // ***************************************************************************** // included header files #include "config.h" -#ifndef EXV_ENABLE_VIDEO -namespace Exiv2 { -extern int asfvideo_extern; -int asfvideo_extern = 1; -} -#else + +#ifdef EXV_ENABLE_VIDEO #include "asfvideo.hpp" #include "futils.hpp" #include "basicio.hpp" diff --git a/src/matroskavideo.cpp b/src/matroskavideo.cpp index 0a444bbf..c41d7336 100644 --- a/src/matroskavideo.cpp +++ b/src/matroskavideo.cpp @@ -33,12 +33,7 @@ EXIV2_RCSID("@(#) $Id$") // included header files #include "config.h" -#ifndef EXV_ENABLE_VIDEO -namespace Exiv2 { -extern int matroskavideo_extern; -int matroskavideo_extern=1; -} -#else +#ifdef EXV_ENABLE_VIDEO #include "matroskavideo.hpp" #include "futils.hpp" #include "basicio.hpp" diff --git a/src/quicktimevideo.cpp b/src/quicktimevideo.cpp index f93dbceb..7c69e009 100644 --- a/src/quicktimevideo.cpp +++ b/src/quicktimevideo.cpp @@ -33,12 +33,7 @@ EXIV2_RCSID("@(#) $Id$") // included header files #include "config.h" -#ifndef EXV_ENABLE_VIDEO -namespace Exiv2 { -extern int quicktimevideo_extern ; -int quicktimevideo_extern = 1; -} -#else +#ifdef EXV_ENABLE_VIDEO #include "quicktimevideo.hpp" #include "futils.hpp" #include "basicio.hpp" diff --git a/src/riffvideo.cpp b/src/riffvideo.cpp index 3be26e3c..89f12b1d 100644 --- a/src/riffvideo.cpp +++ b/src/riffvideo.cpp @@ -33,12 +33,7 @@ EXIV2_RCSID("@(#) $Id$") // included header files #include "config.h" -#ifndef EXV_ENABLE_VIDEO -namespace Exiv2 { -extern int riffvideo_extern ; -int riffvideo_extern = 1; -} -#else +#ifdef EXV_ENABLE_VIDEO #include "riffvideo.hpp" #include "futils.hpp" #include "basicio.hpp" diff --git a/src/utilsvideo.cpp b/src/utilsvideo.cpp index 5a775789..ff3e604c 100644 --- a/src/utilsvideo.cpp +++ b/src/utilsvideo.cpp @@ -28,7 +28,7 @@ */ // ***************************************************************************** #include "rcsid_int.hpp" -EXIV2_RCSID("@(#) $Id: utilsvideo.cpp 3777 2015-05-02 11:55:40Z ahuggel $") +EXIV2_RCSID("@(#) $Id$") #ifdef EXV_ENABLE_VIDEO #include "utilsvideo.hpp"