[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:43:39 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=cd8882b

The following commit has been merged in the master branch:
commit cd8882ba840bdf2223214573dc794641946d13b5
Author: Robin Mills <robin at clanmills.com>
Date:   Sat Mar 30 03:32:26 2013 +0000

    BuildEnvironment: MinGW support (in response to http://dev.exiv2.org/boards/3/topics/1477)
---
 config/config.mk.in |  75 ++++++++++++++-------------
 config/configure.ac |  12 +++--
 src/CMakeLists.txt  |  68 ++++++++++++------------
 src/version.cpp     | 146 ++++++++++++++++++++++++++++------------------------
 4 files changed, 161 insertions(+), 140 deletions(-)

diff --git a/config/config.mk.in b/config/config.mk.in
index a19b785..ca4ce66 100644
--- a/config/config.mk.in
+++ b/config/config.mk.in
@@ -58,7 +58,7 @@ GXX = @GXX@
 # Common compiler flags (warnings, symbols [-ggdb], optimization [-O2], etc)
 CXXFLAGS = @CXXFLAGS@
 ifeq ($(GXX),yes)
-	CXXFLAGS += -Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W
+    CXXFLAGS += -Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W
 endif
 
 # Command to run only the preprocessor
@@ -67,7 +67,7 @@ CXXCPP = @CXXCPP@
 # Preprocessor flags
 CPPFLAGS = -I. @CPPFLAGS@ -DEXV_LOCALEDIR=\"$(localedir)\"
 ifeq ($(COMMERCIAL_VERSION),yes)
-	CPPFLAGS += -DEXV_COMMERCIAL_VERSION=1
+    CPPFLAGS += -DEXV_COMMERCIAL_VERSION=1
 endif
 
 # Linker flags and libraries
@@ -84,7 +84,7 @@ GCC = @GCC@
 
 CFLAGS = @CFLAGS@
 ifeq ($(GCC),yes)
-	CFLAGS += -Wall
+    CFLAGS += -Wall
 endif
 
 # **********************************************************************
@@ -92,17 +92,17 @@ endif
 ENABLE_XMP = @ENABLE_XMP@
 
 ifdef ENABLE_XMP
-        XMPSDK_LIBRARY = xmpsdk
-        XMPSDK_DIR = $(top_srcdir)/xmpsdk
-        XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include
-        XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
-        XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
+    XMPSDK_LIBRARY = xmpsdk
+    XMPSDK_DIR = $(top_srcdir)/xmpsdk
+    XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include
+    XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
+    XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
 else
-        # Enable additional warnings. XMP Toolkit doesn't compile
-        # with these.
-        ifeq ($(GXX),yes)
-                CXXFLAGS += -Wundef -pedantic
-        endif
+    # Enable additional warnings. XMP Toolkit doesn't compile
+    # with these.
+    ifeq ($(GXX),yes)
+        CXXFLAGS += -Wundef -pedantic
+    endif
 endif
 
 # Expat library needed to compile the XMP Toolkit
@@ -122,29 +122,29 @@ HAVE_TIMEGM = @HAVE_TIMEGM@
 DEP_TRACKING = @DEP_TRACKING@
 
 ifdef DEP_TRACKING
-        # Directory for dependency files
-	DEPDIR = .deps
-
-        # Command to run the compiler or preprocessor to produce 
-        # dependencies. If you're not using gcc, you may need to change
-        # this to something suitable for your compiler or simply unset
-        # the variable. See the link above for suggestions.
-	MAKEDEPEND = $(CXX) -MM $(CPPFLAGS) -o $*.d $<
-
-        # Dependency files post-process commands
-        POSTDEPEND = if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi; \
-	        if test -e $*.d; then cp $*.d $(DEPDIR)/$*.d; \
-	        sed -e 's/^\#.*//' -e 's/^[^:]*: *//' -e 's/ *\$$//' \
+    # Directory for dependency files
+    DEPDIR = .deps
+
+    # Command to run the compiler or preprocessor to produce 
+    # dependencies. If you're not using gcc, you may need to change
+    # this to something suitable for your compiler or simply unset
+    # the variable. See the link above for suggestions.
+    MAKEDEPEND = $(CXX) -MM $(CPPFLAGS) -o $*.d $<
+
+    # Dependency files post-process commands
+    POSTDEPEND = if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi; \
+                 if test -e $*.d; then cp $*.d $(DEPDIR)/$*.d; \
+                   sed -e 's/^\#.*//' -e 's/^[^:]*: *//' -e 's/ *\$$//' \
                     -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(DEPDIR)/$*.d; \
-                $(RM) $*.d; fi
-
-        # Compiler flags to generate dependency files at the same time 
-        # as object files (for gcc)
-        ifeq ($(GXX),yes)
-		CXXFLAGS += -MMD
-		CFLAGS += -MMD
-		MAKEDEPEND =
-        endif
+                   $(RM) $*.d; fi
+
+    # Compiler flags to generate dependency files at the same time 
+    # as object files (for gcc)
+    ifeq ($(GXX),yes)
+        CXXFLAGS += -MMD
+        CFLAGS += -MMD
+        MAKEDEPEND =
+    endif
 endif
 
 # **********************************************************************
@@ -153,7 +153,7 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
 COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
 # LINK.cc does not need $(LIBS), libtool's dark magic takes care of that
 # when linking a binary with a libtool library.
-LINK.cc = $(CXX) $(LDFLAGS) -ldl
+LINK.cc = $(CXX) $(LDFLAGS)
 
 # **********************************************************************
 # Installation programs
@@ -183,3 +183,6 @@ incdir = @includedir@/exiv2
 libdir = @libdir@
 mandir = @mandir@
 man1dir = $(mandir)/man1
+
+# That's all Folks!
+##
diff --git a/config/configure.ac b/config/configure.ac
index ef4ee3c..d930b48 100644
--- a/config/configure.ac
+++ b/config/configure.ac
@@ -103,7 +103,7 @@ AC_MSG_CHECKING([whether to enable symbol visibility support])
 visibility=yes
 # visibility support in cygwin/ming generates 1000's of warning, set off by default
 case "$host_os" in
-	*mingw* | *cygwin*) visibility=no  ;;
+    *mingw* | *cygwin*) visibility=no  ;;
 esac
 AC_ARG_ENABLE(visibility,
     [  --disable-visibility    do not use symbol visibility support ],
@@ -117,7 +117,7 @@ if test "$VISIBILITY_SUPPORT" = "yes"; then
     else
         # GNU g++
         AX_CXX_CHECK_FLAG(-fvisibility-inlines-hidden,[],[],[VISIBILITY_SUPPORT=yes],[VISIBILITY_SUPPORT=no])
-    	if test "$VISIBILITY_SUPPORT" = "yes"; then
+        if test "$VISIBILITY_SUPPORT" = "yes"; then
            CXXFLAGS="${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden"
         fi
     fi
@@ -207,11 +207,13 @@ AC_SUBST(EXV_LIB_STATIC)
 #
 # This must happen after all other configure checks, because
 # the "-no-undefined" flag is only for libtool and must not be
-# passed to GCC by accident.  Add link psapi (for version.cpp)
+# passed to GCC by accident.
+# version.cpp requires link to psapi/Windows and dl/Unix builds
 case "$host_os" in
 *mingw* | *cygwin*)
-    LDFLAGS="$LDFLAGS -no-undefined -lpsapi"
-    ;;
+    LDFLAGS="$LDFLAGS -no-undefined -lpsapi" ;;
+*)
+    LDFLAGS="$LDFLAGS -ldl" ;;
 esac
 
 # ---------------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1b9282c..4ad7612 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,7 +7,7 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
 if ( NOT MSVC )
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 endif()
 
 # Private headers which are only needed for the library itself
@@ -184,17 +184,21 @@ msvc_runtime_configure(${EXIV2_ENABLE_SHARED})
 ADD_LIBRARY( exiv2lib ${STATIC_FLAG} ${LIBEXIV2_SRC} ${LIBEXIV2_HDR} )
 
 SET_TARGET_PROPERTIES( exiv2lib PROPERTIES
-	VERSION       ${GENERIC_LIB_VERSION}
-	SOVERSION     ${GENERIC_LIB_SOVERSION}
-	DEFINE_SYMBOL EXV_BUILDING_LIB
-	OUTPUT_NAME   exiv2
+    VERSION       ${GENERIC_LIB_VERSION}
+    SOVERSION     ${GENERIC_LIB_SOVERSION}
+    DEFINE_SYMBOL EXV_BUILDING_LIB
+    OUTPUT_NAME   exiv2
 )
 
 if ( MSVC ) 
     source_group("Header Files" FILES ${LIBEXIV2_HDR} )
     TARGET_LINK_LIBRARIES( exiv2lib ${EXPAT_LIBRARIES} )
 else()
-    TARGET_LINK_LIBRARIES( exiv2lib dl ${EXPAT_LIBRARIES} )
+    if ( NOT MINGW )
+        TARGET_LINK_LIBRARIES( exiv2lib dl ${EXPAT_LIBRARIES} )
+    else()
+        TARGET_LINK_LIBRARIES( exiv2lib    ${EXPAT_LIBRARIES} )
+    endif()
 endif()
 
 if( EXIV2_ENABLE_LIBXMP )
@@ -204,17 +208,17 @@ if( EXIV2_ENABLE_LIBXMP )
 ENDIF()
 
 IF( EXIV2_ENABLE_PNG )
-	IF( ZLIB_FOUND )
-		IF( MSVC )
-			if ( EXIV2_ENABLE_SHARED )		
-				TARGET_LINK_LIBRARIES( exiv2lib optimized ${ZLIB_LIBRARIES} debug ${ZLIB_LIBRARIES}d )
-			else()
-				TARGET_LINK_LIBRARIES( exiv2lib optimized zlibstatic.lib debug zlibstaticd.lib )
-			endif()
-		ELSE()
-			TARGET_LINK_LIBRARIES( exiv2lib ${ZLIB_LIBRARIES} )
-		ENDIF()
-	ENDIF()
+    IF( ZLIB_FOUND )
+        IF( MSVC )
+            if ( EXIV2_ENABLE_SHARED )      
+                TARGET_LINK_LIBRARIES( exiv2lib optimized ${ZLIB_LIBRARIES} debug ${ZLIB_LIBRARIES}d )
+            else()
+                TARGET_LINK_LIBRARIES( exiv2lib optimized zlibstatic.lib debug zlibstaticd.lib )
+            endif()
+        ELSE()
+            TARGET_LINK_LIBRARIES( exiv2lib ${ZLIB_LIBRARIES} )
+        ENDIF()
+    ENDIF()
 ENDIF()
 
 IF( EXIV2_ENABLE_NLS )
@@ -225,27 +229,27 @@ IF( ICONV_FOUND )
     TARGET_LINK_LIBRARIES( exiv2lib ${ICONV_LIBRARIES} )
 ENDIF( ICONV_FOUND )
 
-IF (CYGWIN)
+IF (CYGWIN OR MINGW)
     TARGET_LINK_LIBRARIES( exiv2lib psapi )
-ENDIF(CYGWIN)
+ENDIF(CYGWIN OR MINGW)
 
 
 ##
 # copy header files (TODO: rewrite for NMake)
 IF (MSVC )
-	if (OUT_OF_SOURCE) 
-	    ADD_CUSTOM_COMMAND(
-	      TARGET exiv2lib
-	      PRE_BUILD
-	      COMMAND set S=$(SolutionDir)..\src
set I=$(SolutionDir)include
set E=%I%\exiv2
if NOT exist %I% mkdir %I%
if NOT exist %E% mkdir %E%
copy /y %S%\*.h %E%
copy /y %S%\*.hpp %E%
-	    )
-	else()
-	    ADD_CUSTOM_COMMAND(
-	      TARGET exiv2lib
-	      PRE_BUILD
-	      COMMAND set S=$(SolutionDir)src
set I=$(SolutionDir)include
set E=%I%\exiv2
if NOT exist %I% mkdir %I%
if NOT exist %E% mkdir %E%
copy /y %S%\*.h %E%
copy /y %S%\*.hpp %E%
-	    )
-	endif()
+    if (OUT_OF_SOURCE) 
+        ADD_CUSTOM_COMMAND(
+          TARGET exiv2lib
+          PRE_BUILD
+          COMMAND set S=$(SolutionDir)..\src
set I=$(SolutionDir)include
set E=%I%\exiv2
if NOT exist %I% mkdir %I%
if NOT exist %E% mkdir %E%
copy /y %S%\*.h %E%
copy /y %S%\*.hpp %E%
+        )
+    else()
+        ADD_CUSTOM_COMMAND(
+          TARGET exiv2lib
+          PRE_BUILD
+          COMMAND set S=$(SolutionDir)src
set I=$(SolutionDir)include
set E=%I%\exiv2
if NOT exist %I% mkdir %I%
if NOT exist %E% mkdir %E%
copy /y %S%\*.h %E%
copy /y %S%\*.hpp %E%
+        )
+    endif()
 ENDIF()
 
 ##
diff --git a/src/version.cpp b/src/version.cpp
index 361d8df..6bc6aef 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -37,7 +37,13 @@ EXIV2_RCSID("@(#) $Id$")
 # include "exv_conf.h"
 #endif
 
-#if defined(__CYGWIN__)
+#if defined(__MINGW32__) || defined(__MINGW64__)
+# ifndef  __MINGW__
+#  define __MINGW__
+# endif
+#endif
+
+#if defined(__CYGWIN__) || defined(__MINGW__)
 #include <windows.h>
 #endif
 
@@ -100,7 +106,7 @@ typedef string_v::iterator  string_i;
 # include <psapi.h>
 
 // tell MSVC to link psapi.
-#ifdef	_MSC_VER
+#ifdef  _MSC_VER
 #pragma comment( lib, "psapi" )
 #endif
 
@@ -114,8 +120,8 @@ typedef string_v::iterator  string_i;
 # include <dlfcn.h>
   struct something
   {
-	void*  pointers[3];
-	struct something* ptr;
+    void*  pointers[3];
+    struct something* ptr;
   };
   struct lmap
   {
@@ -124,43 +130,47 @@ typedef string_v::iterator  string_i;
     void*    not_needed1;    /* Pointer to the dynamic section of the shared object */
     struct lmap *next, *prev;/* chain of loaded objects */
   };
+#elif defined(__MINGW32__) || defined(__MINGW64__)
+#ifndef __MINGW__
+#define __MINGW__
+#endif
 #endif
 
 EXIV2API void dumpLibraryInfo(std::ostream& os)
 {
-	  string_v libs; // libs[0] == executable
+      string_v libs; // libs[0] == executable
 
-	  int      bits = 8*sizeof(void*);
+      int      bits = 8*sizeof(void*);
 #if   defined(_DEBUG) || defined(DEBUG)
-	  int debug=1;
+      int debug=1;
 #else
-	  int debug=0;
+      int debug=0;
 #endif
 
 #if   defined(EXV_HAVE_DLL)
-	  int dll=1;
+      int dll=1;
 #else
-	  int dll=0;
+      int dll=0;
 #endif
 
       const char* compiler =
 #if   defined(_MSC_VER)
-	  "MSVC"    ;
+      "MSVC"    ;
 
 #ifndef __VERSION__
-	  char version[20];
-	  sprintf(version,"%d.%02d",(_MSC_VER-600)/100,_MSC_VER%100);
+      char version[20];
+      sprintf(version,"%d.%02d",(_MSC_VER-600)/100,_MSC_VER%100);
 #define __VERSION__ version
 #endif
 
 #elif defined(__clang__)
-	  "Clang"   ;
+      "Clang"   ;
 #elif defined(__GNUG__)
-	  "G++"     ;
+      "G++"     ;
 #elif defined(__GNUC__)
-	  "GCC"     ;
+      "GCC"     ;
 #else
-	  "unknown" ;
+      "unknown" ;
 #endif
 
 #ifndef __VERSION__
@@ -171,43 +181,45 @@ EXIV2API void dumpLibraryInfo(std::ostream& os)
 #endif
 #endif
 
-	  const char* platform =
+      const char* platform =
 #if defined(__CYGWIN__)
-	  "cygwin";
+      "cygwin";
 #elif defined(_MSC_VER)
-	  "windows";
+      "windows";
 #elif defined(__APPLE__)
-	  "apple";
+      "apple";
+#elif defined(__MINGW__)
+      "mingw";
 #elif defined(__linux__)
-	  "linux";
+      "linux";
 #else
-	  "unknown";
-#endif
-
-#if defined(WIN32) || defined(__CYGWIN__)
-	// enumerate loaded libraries and determine path to executable
-	HMODULE handles[200];
-	DWORD   cbNeeded;
-	if ( EnumProcessModules(GetCurrentProcess(),handles,lengthof(handles),&cbNeeded)) {
-		char szFilename[_MAX_PATH];
-		for ( DWORD h = 0 ; h < cbNeeded/sizeof(handles[0]) ; h++ ) {
-			GetModuleFileNameA(handles[h],szFilename,lengthof(szFilename)) ;
-			libs.push_back(szFilename);
-		}
-	}
+      "unknown";
+#endif
+
+#if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW__)
+    // enumerate loaded libraries and determine path to executable
+    HMODULE handles[200];
+    DWORD   cbNeeded;
+    if ( EnumProcessModules(GetCurrentProcess(),handles,lengthof(handles),&cbNeeded)) {
+        char szFilename[_MAX_PATH];
+        for ( DWORD h = 0 ; h < cbNeeded/sizeof(handles[0]) ; h++ ) {
+            GetModuleFileNameA(handles[h],szFilename,lengthof(szFilename)) ;
+            libs.push_back(szFilename);
+        }
+    }
 #elif defined(__APPLE__)
-	// man 3 dyld
-	uint32_t count = _dyld_image_count();
-	for (uint32_t image = 0 ; image < count ; image++ ) {
-		const char* image_path = _dyld_get_image_name(image);
-		libs.push_back(image_path);
-	}
+    // man 3 dyld
+    uint32_t count = _dyld_image_count();
+    for (uint32_t image = 0 ; image < count ; image++ ) {
+        const char* image_path = _dyld_get_image_name(image);
+        libs.push_back(image_path);
+    }
 #elif defined(__linux__)
-	// http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux
-	char proc[100];
-	char path[500];
-	sprintf(proc,"/proc/%d/exe", getpid());
-	int l = readlink (proc, path,sizeof(path)-1);
+    // http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux
+    char proc[100];
+    char path[500];
+    sprintf(proc,"/proc/%d/exe", getpid());
+    int l = readlink (proc, path,sizeof(path)-1);
     if (l>0) {
         path[l]=0;
         libs.push_back(path);
@@ -215,33 +227,33 @@ EXIV2API void dumpLibraryInfo(std::ostream& os)
         libs.push_back("unknown");
     }
 
-	// http://syprog.blogspot.com/2011/12/listing-loaded-shared-objects-in-linux.html
-	struct lmap* pl;
-	void* ph = dlopen(NULL, RTLD_NOW);
-	struct something* p = (struct something*)ph;
-	p  = p->ptr;
-	pl = (struct lmap*)p->ptr;
+    // http://syprog.blogspot.com/2011/12/listing-loaded-shared-objects-in-linux.html
+    struct lmap* pl;
+    void* ph = dlopen(NULL, RTLD_NOW);
+    struct something* p = (struct something*)ph;
+    p  = p->ptr;
+    pl = (struct lmap*)p->ptr;
 
-	while ( pl )
-	{
-		libs.push_back(pl->path);
-		pl = pl->next;
-	}
+    while ( pl )
+    {
+        libs.push_back(pl->path);
+        pl = pl->next;
+    }
 #endif
 
     os << "exiv2="    << Exiv2::versionString() << endl;
-	os << "platform=" << platform               << endl;
+    os << "platform=" << platform               << endl;
     os << "compiler=" << compiler               << endl;
     os << "bits="     << bits                   << endl;
     os << "dll="      << dll                    << endl;
     os << "debug="    << debug                  << endl;
     os << "version="  << __VERSION__            << endl;
-	os << "date="     << __DATE__               << endl;
-	os << "time="     << __TIME__               << endl;
-
-	if ( libs.begin() != libs.end() ) {
-		os << "executable=" << *libs.begin() << endl;
-		for ( string_i lib = libs.begin()+1 ; lib != libs.end() ; lib++ )
-			os << "library=" << *lib << endl;
-	}
+    os << "date="     << __DATE__               << endl;
+    os << "time="     << __TIME__               << endl;
+
+    if ( libs.begin() != libs.end() ) {
+        os << "executable=" << *libs.begin() << endl;
+        for ( string_i lib = libs.begin()+1 ; lib != libs.end() ; lib++ )
+            os << "library=" << *lib << endl;
+    }
 }

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list