diff --git a/src/Makefile b/src/Makefile index 47ce6c89..a2ae7f03 100644 --- a/src/Makefile +++ b/src/Makefile @@ -134,7 +134,7 @@ ifeq ($(strip $(MAKECMDGOALS)),) else # ...or the target is _not_ one in the list of targets below. NOINCLUDE = uninstall uninstall-lib check doc ctags mostlyclean clean \ - install-header uninstall-header distclean maintainer-clean + install-header uninstall-header distclean maintainer-clean exv_conf.h ifneq ($(MAKECMDGOALS), $(filter $(MAKECMDGOALS), $(NOINCLUDE))) -include $(DEP) endif @@ -175,8 +175,11 @@ $(sort $(BINOBJ) $(EXIV2OBJ) $(MCOBJ) mn.o): %.o: %.cpp types.hpp: exv_conf.h actions.cpp exiv2.cpp image.cpp utils.cpp: exv_conf.h +#exv_conf.h: $(top_srcdir)/config/config.h +# cp -f $(top_srcdir)/config/config.h exv_conf.h + exv_conf.h: $(top_srcdir)/config/config.h - cp -f $(top_srcdir)/config/config.h exv_conf.h + sed 's/#define \([A-Z]\)/#define EXV_\1/; s/#undef \([A-Z]\)/#undef EXV_\1/' < $< > $@ mn.cpp: ./mn.sh ./mn.sh diff --git a/src/actions.cpp b/src/actions.cpp index 7763c543..7f34076f 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -44,7 +44,7 @@ EXIV2_RCSID("@(#) $Id$"); #include "exif.hpp" #include "canonmn.hpp" #include "iptc.hpp" -#ifndef HAVE_TIMEGM +#ifndef EXV_HAVE_TIMEGM # include "timegm.h" #endif @@ -61,7 +61,7 @@ EXIV2_RCSID("@(#) $Id$"); #include #include // for stat() #include // for stat() -#ifdef HAVE_UNISTD_H +#ifdef EXV_HAVE_UNISTD_H # include // for stat() #endif @@ -723,7 +723,7 @@ namespace Action { return 1; } std::string newPath - = Util::dirname(path) + SEPERATOR_STR + basename + Util::suffix(path); + = Util::dirname(path) + EXV_SEPERATOR_STR + basename + Util::suffix(path); if ( Util::dirname(newPath) == Util::dirname(path) && Util::basename(newPath) == Util::basename(path)) { if (Params::instance().verbose_) { @@ -880,7 +880,7 @@ namespace Action { if (Params::instance().target_ & ~Params::ctThumb) { std::string directory = Params::instance().directory_; if (directory.empty()) directory = Util::dirname(path_); - std::string exvPath = directory + SEPERATOR_STR + std::string exvPath = directory + EXV_SEPERATOR_STR + Util::basename(path_, true) + ".exv"; if (!Params::instance().force_ && Util::fileExists(exvPath)) { std::cout << Params::instance().progname() @@ -927,7 +927,7 @@ namespace Action { std::string directory = Params::instance().directory_; if (directory.empty()) directory = Util::dirname(path_); - std::string thumb = directory + SEPERATOR_STR + std::string thumb = directory + EXV_SEPERATOR_STR + Util::basename(path_, true) + "-thumb"; std::string thumbExt = exifData.thumbnailExtension(); if (thumbExt.empty()) { @@ -983,7 +983,7 @@ namespace Action { || Params::instance().target_ & Params::ctComment) { std::string directory = Params::instance().directory_; if (directory.empty()) directory = Util::dirname(path); - std::string exvPath = directory + SEPERATOR_STR + std::string exvPath = directory + EXV_SEPERATOR_STR + Util::basename(path, true) + ".exv"; rc = metacopy(exvPath, path, true); } @@ -1000,7 +1000,7 @@ namespace Action { { std::string directory = Params::instance().directory_; if (directory.empty()) directory = Util::dirname(path); - std::string thumbPath = directory + SEPERATOR_STR + std::string thumbPath = directory + EXV_SEPERATOR_STR + Util::basename(path, true) + "-thumb.jpg"; if (!Util::fileExists(thumbPath, true)) { std::cerr << thumbPath diff --git a/src/basicio.cpp b/src/basicio.cpp index 57bff612..078e9986 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -40,10 +40,10 @@ EXIV2_RCSID("@(#) $Id$"); #include #include // for stat() #include // for stat() -#ifdef HAVE_PROCESS_H +#ifdef EXV_HAVE_PROCESS_H # include #endif -#ifdef HAVE_UNISTD_H +#ifdef EXV_HAVE_UNISTD_H # include // for getpid, stat #endif diff --git a/src/exif.cpp b/src/exif.cpp index 04a01073..f2572997 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -55,7 +55,7 @@ EXIV2_RCSID("@(#) $Id$"); #include #include // for stat() #include // for stat() -#ifdef HAVE_UNISTD_H +#ifdef EXV_HAVE_UNISTD_H # include // for stat() #endif diff --git a/src/exiv2.cpp b/src/exiv2.cpp index d1629c44..00c15722 100644 --- a/src/exiv2.cpp +++ b/src/exiv2.cpp @@ -159,7 +159,7 @@ Params& Params::instance() void Params::version(std::ostream& os) const { - os << PACKAGE_STRING << ", " + os << EXV_PACKAGE_STRING << ", " << "Copyright (C) 2004, 2005 Andreas Huggel.\n\n" << "This is free software; see the source for copying conditions. " << "There is NO \nwarranty; not even for MERCHANTABILITY or FITNESS FOR " diff --git a/src/exv_msvc.h b/src/exv_msvc.h index e6a140ef..319bf0fa 100644 --- a/src/exv_msvc.h +++ b/src/exv_msvc.h @@ -14,28 +14,28 @@ #ifdef _MSC_VER /* Define to 1 if you have the header file. */ -#define HAVE_PROCESS_H 1 +#define EXV_HAVE_PROCESS_H 1 /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "ahuggel@gmx.net" +#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net" /* Define to the full name of this package. */ -#define PACKAGE_NAME "Exiv2" +#define EXV_PACKAGE_NAME "Exiv2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "Exiv2 0.6.2" +#define EXV_PACKAGE_STRING "Exiv2 0.6.2" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "exiv2" +#define EXV_PACKAGE_TARNAME "exiv2" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.6.2" +#define EXV_PACKAGE_VERSION "0.6.2" /* Define to `int' if does not define pid_t. */ #define pid_t int /* File path seperator */ -#define SEPERATOR_STR "\\" -#define SEPERATOR_CHR '\\' +#define EXV_SEPERATOR_STR "\\" +#define EXV_SEPERATOR_CHR '\\' #endif /* _MSC_VER */ diff --git a/src/getopt_win32.c b/src/getopt_win32.c index 838feec4..a08f2f21 100644 --- a/src/getopt_win32.c +++ b/src/getopt_win32.c @@ -37,7 +37,7 @@ #ifdef __GNUC__ #define alloca __builtin_alloca #else /* not __GNUC__ */ -#if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) +#if defined (EXV_HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) #include #else #ifndef _AIX diff --git a/src/image.cpp b/src/image.cpp index 87c2847f..fbc9af28 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -56,7 +56,7 @@ EXIV2_RCSID("@(#) $Id$"); #ifdef _MSC_VER # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif -#ifdef HAVE_UNISTD_H +#ifdef EXV_HAVE_UNISTD_H # include // stat #endif diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index ef0235bb..da9a0e3f 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -32,12 +32,10 @@ EXIV2_RCSID("@(#) $Id$"); // ***************************************************************************** // included header files -#ifdef HAVE_CONFIG_H -# include +#ifdef _MSC_VER +# include "exv_msvc.h" #else -# ifdef _MSC_VER -# include -# endif +# include "exv_conf.h" #endif #include "jpgimage.hpp" diff --git a/src/private.h b/src/private.h index d900f79c..afacb369 100644 --- a/src/private.h +++ b/src/private.h @@ -59,18 +59,18 @@ static char privatehid[] = "@(#)private.h 7.53"; /* ahu: deleted include sys/wait.h and WIFEXITED, WEXITSTATUS macros */ -#if HAVE_UNISTD_H - 0 +#if EXV_HAVE_UNISTD_H - 0 #include "unistd.h" /* for F_OK and R_OK */ -#endif /* HAVE_UNISTD_H - 0 */ +#endif /* EXV_HAVE_UNISTD_H - 0 */ -#if !(HAVE_UNISTD_H - 0) +#if !(EXV_HAVE_UNISTD_H - 0) #ifndef F_OK #define F_OK 0 #endif /* !defined F_OK */ #ifndef R_OK #define R_OK 4 #endif /* !defined R_OK */ -#endif /* !(HAVE_UNISTD_H - 0) */ +#endif /* !(EXV_HAVE_UNISTD_H - 0) */ /* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */ #define is_digit(c) ((unsigned)(c) - '0' <= 9) diff --git a/src/types.hpp b/src/types.hpp index bf8ec5cf..3ffe1187 100644 --- a/src/types.hpp +++ b/src/types.hpp @@ -45,7 +45,7 @@ #include #include #include -#ifdef HAVE_STDINT_H +#ifdef EXV_HAVE_STDINT_H # include #endif diff --git a/src/utils.cpp b/src/utils.cpp index a8af1a7f..741cdae5 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -45,7 +45,7 @@ EXIV2_RCSID("@(#) $Id$"); # include "getopt_win32.h" # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif -#ifdef HAVE_UNISTD_H +#ifdef EXV_HAVE_UNISTD_H # include // for getopt(), stat() #endif #include @@ -100,15 +100,15 @@ int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) if (path == "") return "."; // Strip trailing slashes std::string p = path; - while (p.length() > 1 && p[p.length()-1] == SEPERATOR_CHR) { + while (p.length() > 1 && p[p.length()-1] == EXV_SEPERATOR_CHR) { p = p.substr(0, p.length()-1); } - if (p == SEPERATOR_STR) return SEPERATOR_STR; - std::string::size_type idx = p.rfind(SEPERATOR_CHR); + if (p == EXV_SEPERATOR_STR) return EXV_SEPERATOR_STR; + std::string::size_type idx = p.rfind(EXV_SEPERATOR_CHR); if (idx == std::string::npos) return "."; - if (idx == 0) return SEPERATOR_STR; + if (idx == 0) return EXV_SEPERATOR_STR; p = p.substr(0, idx); - while (p.length() > 1 && p[p.length()-1] == SEPERATOR_CHR) { + while (p.length() > 1 && p[p.length()-1] == EXV_SEPERATOR_CHR) { p = p.substr(0, p.length()-1); } return p; @@ -119,11 +119,11 @@ int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) if (path == "") return "."; // Strip trailing slashes std::string p = path; - while (p.length() > 1 && p[p.length()-1] == SEPERATOR_CHR) { + while (p.length() > 1 && p[p.length()-1] == EXV_SEPERATOR_CHR) { p = p.substr(0, p.length()-1); } - if (p == SEPERATOR_STR) return p; - std::string::size_type idx = p.rfind(SEPERATOR_CHR); + if (p == EXV_SEPERATOR_STR) return p; + std::string::size_type idx = p.rfind(EXV_SEPERATOR_CHR); if (idx != std::string::npos) p = p.substr(idx+1); if (delsuffix) p = p.substr(0, p.length() - suffix(p).length()); return p;