summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-17 12:08:40 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-17 12:08:40 +0200
commitaa9d9413884702f23ec96cf42455052c27cf8b90 (patch)
treed21e262c738656fb947eb4ed9e9aaf69c57a5ba6
parent2aa9ef5e2030e3c4200a3ca198f0728c3ee384cf (diff)
Random build fixes
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac283
-rw-r--r--configure.in239
-rw-r--r--docs/doxygen/Makefile.am2
-rw-r--r--inc/Makefile.am1
-rw-r--r--inc/libpict/Makefile.am3
-rw-r--r--inc/libpict/PictImage.h (renamed from src/lib/PictImage.h)0
-rw-r--r--inc/libpict/libpict.h (renamed from src/lib/libpict.h.in)9
-rw-r--r--libpict-zip.in22
-rw-r--r--libpict.pc.in (renamed from libpict-0.1.pc.in)6
-rw-r--r--libpict.spec.in2
-rw-r--r--src/conv/raw/Makefile.am12
-rw-r--r--src/conv/raw/pict2raw.cpp12
-rw-r--r--src/conv/raw/pict2raw.rc.in8
-rw-r--r--src/conv/svg/Makefile.am12
-rw-r--r--src/conv/svg/pict2svg.cpp12
-rw-r--r--src/conv/svg/pict2svg.rc.in8
-rw-r--r--src/lib/Makefile.am47
-rw-r--r--src/lib/PictHeader.cpp6
-rw-r--r--src/lib/PictImage.cpp6
-rw-r--r--src/lib/PictSVGGenerator.cpp2
-rw-r--r--src/lib/PictSVGGenerator.h2
-rw-r--r--src/lib/libpict.rc.in8
-rw-r--r--src/lib/libpict_utils.h15
24 files changed, 385 insertions, 338 deletions
diff --git a/Makefile.am b/Makefile.am
index 4b48d33..9b42668 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
pkgconfdir = $(libdir)/pkgconfig
-pkgconf_DATA = libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.pc
+pkgconf_DATA = libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.pc
SUBDIRS = src build docs
@@ -10,13 +10,13 @@ EXTRA_DIST = \
NEWS \
README \
autogen.sh \
- libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.pc.in \
+ libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.pc.in \
libpict-zip.in \
libpict.spec \
libpict.spec.in
distclean-local:
- rm -rf *.cache *~
+ rm -rf *.cache *~ *.pc
rpm: dist
rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..522606b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,283 @@
+# Process this file with autoconf to create configure.
+
+AC_PREREQ([2.65])
+
+# ====================
+# Version informations
+# ====================
+m4_define([libpict_version_major],[0])
+m4_define([libpict_version_minor],[0])
+m4_define([libpict_version_micro],[0])
+m4_define([libpict_version],[libpict_version_major.libpict_version_minor.libpict_version_micro])
+
+# =============
+# Automake init
+# =============
+AC_INIT([libpict],[libpict_version])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([1.11 foreign dist-xz dist-bzip2])
+AM_SILENT_RULES([yes])
+AC_LANG([C++])
+
+# ===========================
+# Find required base packages
+# ===========================
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+LT_INIT([win32-dll disable-static pic-only])
+AC_CANONICAL_HOST
+
+PKG_PROG_PKG_CONFIG([0.20])
+
+AC_PROG_EGREP
+AC_PROG_SED
+
+dnl ===================================================================
+dnl Check for gperf
+dnl ===================================================================
+AC_ARG_VAR(GPERF, [Setting this variable will override the gperf detection])
+AC_PATH_PROG(GPERF, gperf)
+if test -z "$GPERF"; then
+ AC_MSG_ERROR([gperf not found but needed. Install it.])
+fi
+AC_MSG_CHECKING([gperf version])
+if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
+ AC_MSG_RESULT([OK])
+else
+ AC_MSG_ERROR([too old, you need at least 3.0.0])
+fi
+AC_SUBST(GPERF)
+
+# ====================
+# Find additional apps
+# ====================
+PKG_CHECK_MODULES([WPD],[
+ libwpd-0.9
+ libwpd-stream-0.9
+])
+
+PKG_CHECK_MODULES([WPG],[
+ libwpg-0.2
+])
+
+PKG_CHECK_MODULES([LIBXML],[
+ libxml-2.0
+])
+
+# =================================
+# Libtool/Version Makefile settings
+# =================================
+AC_SUBST(PICT_MAJOR_VERSION, [libpict_version_major])
+AC_SUBST(PICT_MINOR_VERSION, [libpict_version_minor])
+AC_SUBST(PICT_MICRO_VERSION, [libpict_version_micro])
+AC_SUBST(PICT_VERSION, [libpict_version])
+# AC_SUBST(LT_RELEASE, [libpict_version_major.libpict_version_minor])
+LT_CURRENT=`expr 100 '*' libpict_version_major + libpict_version_minor`
+# For 1.0.0 comment the first line and uncomment the second
+LT_AGE=0
+# LT_AGE=libpict_version_minor
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION, [libpict_version_micro])
+AC_SUBST(LT_AGE)
+
+# ==========================
+# Platform check for windows
+# ==========================
+AC_MSG_CHECKING([for native Win32])
+AS_CASE([$host],
+ [*-*-mingw*], [
+ native_win32=yes
+ LIBPICT_WIN32_RESOURCE=libpict-win32res.lo
+ PICT2RAW_WIN32_RESOURCE=pict2raw-win32res.lo
+ PICT2SVG_WIN32_RESOURCE=pict2svg-win32res.lo
+ ], [
+ native_win32=no
+ LIBPICT_WIN32_RESOURCE=
+ PICT2RAW_WIN32_RESOURCE=
+ PICT2SVG_WIN32_RESOURCE=
+ ]
+)
+AC_MSG_RESULT([$native_win32])
+AM_CONDITIONAL(OS_WIN32, [test "x$native_win32" = "xyes"])
+AC_SUBST(LIBPICT_WIN32_RESOURCE)
+AC_SUBST(PICT2RAW_WIN32_RESOURCE)
+AC_SUBST(PICT2SVG_WIN32_RESOURCE)
+
+AC_MSG_CHECKING([for Win32 platform in general])
+AS_CASE([$host],
+ [*-*-mingw*|*-*-cygwin*], [platform_win32=yes],
+ [platform_win32=no]
+)
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"])
+
+# ================
+# Check for cflags
+# ================
+AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--disable-werror], [Treat all warnings as errors, useful for development])],
+ [enable_werror="$enableval"],
+ [enable_werror=yes]
+)
+AS_IF([test x"$enable_werror" != "xno"], [
+ CFLAGS="$CFLAGS -Werror"
+ CXXFLAGS="$CXXFLAGS -Werror"
+])
+AC_ARG_ENABLE([weffc],
+ [AS_HELP_STRING([--disable-weffc], [ Disable -Weffc++ warnings, usefull when using an old version of gcc or of boost])],
+ [enable_weffc="$enableval"],
+ [enable_weffc=yes]
+)
+AC_ARG_ENABLE([wparanoic],
+ [AS_HELP_STRING([--enable-wparanoic], [Enable a lot of warnings...])],
+ [enable_wparanoic="$enableval"],
+ [enable_wparanoic=no]
+)
+# Courtesy of Glib: Ensure MSVC-compatible struct packing convention
+# is used when compiling for Win32 with gcc.
+AS_IF([test "x$native_win32" = "xyes"], [
+ AC_CHECK_TOOL(WINDRES, windres)
+ AS_IF([test x"$GCC" = xyes], [
+ AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
+ AS_IF([test -z "$ac_cv_prog_CC"], [
+ our_gcc="$CC"
+ ], [
+ our_gcc="$ac_cv_prog_CC"
+ ])
+ AS_IF([$our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null], [
+ msnative_struct="-mms-bitfields"
+ CFLAGS="$CFLAGS $msnative_struct"
+ CXXFLAGS="$CXXFLAGS $msnative_struct"
+ AC_MSG_RESULT([${msnative_struct}])
+ ], [
+ AC_MSG_RESULT([no way])
+ AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
+ ])
+ ])
+ CFLAGS="$CFLAGS -Wall -Wextra -pedantic"
+ CXXFLAGS="$CXXFLAGS -Wall -Wextra -pedantic -Wshadow -Wunused-variable"
+ AS_IF([test x"$enable_weffc" != "xno"], [
+ CXXFLAGS="$CXXFLAGS -Weffc++"
+ ])
+ AS_IF([test x"$enable_wparanoic" != "xno"], [
+ CXXFLAGS="$CXXFLAGS -Wcast-align -Wcast-qual -Wchar-subscripts"
+ CXXFLAGS="$CXXFLAGS -Wcomment -Wconversion -Wdisabled-optimization"
+ CXXFLAGS="$CXXFLAGS -Wfloat-equal -Wformat -Wformat=2"
+ CXXFLAGS="$CXXFLAGS -Wformat-nonliteral -Wformat-security"
+ CXXFLAGS="$CXXFLAGS -Wformat-y2k -Wimport -Winit-self -Winvalid-pch"
+ CXXFLAGS="$CXXFLAGS -Wmissing-braces -Wmissing-field-initializers"
+ CXXFLAGS="$CXXFLAGS -Wmissing-format-attribute -Wmissing-include-dirs"
+ CXXFLAGS="$CXXFLAGS -Wmissing-noreturn -Wpacked -Wparentheses"
+ CXXFLAGS="$CXXFLAGS -Wpointer-arith -Wredundant-decls -Wreturn-type"
+ CXXFLAGS="$CXXFLAGS -Wsequence-point -Wsign-compare -Wstrict-aliasing"
+ CXXFLAGS="$CXXFLAGS -Wstrict-aliasing=2 -Wswitch -Wswitch-default"
+ CXXFLAGS="$CXXFLAGS -Wswitch-enum -Wtrigraphs -Wunknown-pragmas -Wunused"
+ CXXFLAGS="$CXXFLAGS -Wunused-function -Wunused-label -Wunused-parameter"
+ CXXFLAGS="$CXXFLAGS -Wunused-value -Wvariadic-macros"
+ CXXFLAGS="$CXXFLAGS -Wvolatile-register-var -Wwrite-strings"
+ ])
+], [
+ AS_IF([test x"$GCC" = xyes], [
+ # Be tough with warnings and produce less careless code
+ CFLAGS="$CFLAGS -Wall -Wextra -pedantic"
+ CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wshadow -pedantic"
+ ])
+])
+LIBPICT_CXXFLAGS="${WPD_CFLAGS} ${WPG_CFLAGS}"
+LIBPICT_LIBS="${WPD_LIBS} ${WPG_LIBS}"
+AC_SUBST(LIBPICT_CXXFLAGS)
+AC_SUBST(LIBPICT_LIBS)
+
+# ============
+# Debug switch
+# ============
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug], [Turn on debugging])],
+ [enable_debug="$enableval"],
+ [enable_debug=no]
+)
+AS_IF([test "x$enable_debug" = "xyes"], [
+ DEBUG_CXXFLAGS="-DDEBUG -g"
+ CXXFLAGS="$CXXFLAGS -O0"
+ CFLAGS="$CFLAGS -O0"
+], [
+ DEBUG_CXXFLAGS="-DNDEBUG"
+])
+AC_SUBST(DEBUG_CXXFLAGS)
+
+# ============
+# Static tools
+# ============
+AC_ARG_ENABLE([static-tools],
+ [AS_HELP_STRING([--enable-static-tools], [Link tools (binaries) statically])],
+ [enable_static_tools="$enableval"],
+ [enable_static_tools=no]
+)
+AS_IF([test "x$enable_static_tools" = "xyes"], [
+ enable_static="yes"
+], [
+ AC_DISABLE_STATIC
+])
+AM_CONDITIONAL(STATIC_TOOLS, [test "x$enable_static_tools" = "xyes"])
+
+# =============
+# Documentation
+# =============
+AC_ARG_WITH(docs,
+ [AS_HELP_STRING([--without-docs], [Do not build documentation])],
+ [with_docs="$withval"],
+ [AS_IF([test "x$native_win32" = "xyes"], [with_docs=no], [with_docs=yes])]
+)
+AS_IF([test "x$with_docs" != "xno"], [
+ AC_PATH_PROG(DOXYGEN, [doxygen])
+ AS_IF([test -z "$DOXYGEN"], [
+ AC_MSG_WARN([*** Could not find doxygen in your PATH.])
+ AC_MSG_WARN([*** The documentation will not be built.])
+ build_docs=no
+ ], [build_docs=yes])
+], [build_docs=no])
+AM_CONDITIONAL([WITH_LIBPICT_DOCS], [test "x$build_docs" != "xno"])
+
+# =====================
+# Prepare all .in files
+# =====================
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+src/conv/Makefile
+src/conv/raw/Makefile
+src/conv/raw/pict2raw.rc
+src/conv/svg/Makefile
+src/conv/svg/pict2svg.rc
+src/lib/Makefile
+src/lib/libpict.rc
+inc/Makefile
+inc/libpict/Makefile
+build/Makefile
+build/win32/Makefile
+docs/Makefile
+docs/doxygen/Makefile
+libpict-$PICT_MAJOR_VERSION.$PICT_MINOR_VERSION.pc:libpict.pc.in
+libpict.spec
+libpict-zip
+])
+AC_OUTPUT
+
+# ==============================================
+# Display final informations about configuration
+# ==============================================
+AC_MSG_NOTICE([
+==============================================================================
+Build configuration:
+ debug: ${enable_debug}
+ docs: ${build_docs}
+ static-tools: ${enable_static_tools}
+ werror: ${enable_werror}
+==============================================================================
+])
diff --git a/configure.in b/configure.in
deleted file mode 100644
index b5ae7d6..0000000
--- a/configure.in
+++ /dev/null
@@ -1,239 +0,0 @@
-AC_INIT(src/lib/PictImage.cpp)
-AC_PREREQ([2.59c])
-
-AC_CONFIG_HEADER(config.h)
-
-Pict_MAJOR_VERSION=0
-Pict_MINOR_VERSION=1
-Pict_MICRO_VERSION=0
-
-LIBWPD_REQUIRED_VERSION="0.9.0"
-LIBWPG_REQUIRED_VERSION="0.2.0"
-
-Pict_VERSION="$Pict_MAJOR_VERSION.$Pict_MINOR_VERSION.$Pict_MICRO_VERSION"
-
-AC_SUBST(Pict_MAJOR_VERSION)
-AC_SUBST(Pict_MINOR_VERSION)
-AC_SUBST(Pict_MICRO_VERSION)
-AC_SUBST(Pict_VERSION)
-
-dnl # libtool versioning
-dnl LT_RELEASE=$Pict_MAJOR_VERSION.$Pict_MINOR_VERSION
-dnl AC_SUBST(LT_RELEASE)
-
-LT_CURRENT=`expr 100 '*' $Pict_MAJOR_VERSION + $Pict_MINOR_VERSION`
-LT_REVISION=$Pict_MICRO_VERSION
-# For 1.0.0 comment the first line and uncomment the second
-LT_AGE=0
-# LT_AGE=$Pict_MINOR_VERSION
-AC_SUBST(LT_CURRENT)
-AC_SUBST(LT_REVISION)
-AC_SUBST(LT_AGE)
-
-# initialize automake
-#
-AM_INIT_AUTOMAKE(libpict, $Pict_VERSION)
-
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_CXX
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-
-AC_LIBTOOL_WIN32_DLL
-AC_ARG_ENABLE([static-tools],[ --enable-static-tools Link tools statically],[
- case "${enableval}" in
- yes) enable_static_tools="yes" ;;
- no) enable_static_tools="no" ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --static-tools) ;;
- esac
-],[
- enable_static_tools="no"
-])
-
-AM_CONDITIONAL(STATIC_TOOLS, test x$enable_static_tools = xyes)
-
-if test x$enable_static_tools = xno; then
- AC_DISABLE_STATIC
-fi
-
-if test x$enable_static_tools = xyes; then
- enable_static="yes"
-fi
-
-AC_PROG_LIBTOOL
-
-AC_SUBST(Pict_OBJDIR, [$objdir])
-
-AM_PROG_LIBTOOL
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
-dnl ***********************************************************************************
-
-PKG_CHECK_MODULES(LIBPict,[
-libwpd-0.9 >= $LIBWPD_REQUIRED_VERSION
-libwpd-stream-0.9 >= $LIBWPD_REQUIRED_VERSION
-libwpg-0.2 >= $LIBWPG_REQUIRED_VERSION
-])
-
-AC_HEADER_STDC
-
-AC_MSG_CHECKING([for native Win32])
-case "$host" in
- *-*-mingw*)
- native_win32=yes
- LIBPict_WIN32_RESOURCE=libpict-win32res.lo
- Pict2RAW_WIN32_RESOURCE=pict2raw-win32res.lo
- Pict2SVG_WIN32_RESOURCE=pict2svg-win32res.lo
- ;;
- *)
- native_win32=no
- LIBPict_WIN32_RESOURCE=
- Pict2RAW_WIN32_RESOURCE=
- Pict2SVG_WIN32_RESOURCE=
- ;;
-esac
-AC_MSG_RESULT([$native_win32])
-AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
-AC_SUBST(LIBPict_WIN32_RESOURCE)
-AC_SUBST(Pict2RAW_WIN32_RESOURCE)
-AC_SUBST(Pict2SVG_WIN32_RESOURCE)
-
-test_dummy_bitmaps=false
-AC_ARG_WITH(dummy_bitmaps,
- [ --with-dummy-bitmaps Output dummy bitmaps of 1x1 pixels instead of the real bitmaps (speeds up the validation test)],
- if test "x$withval" = xyes; then
- test_dummy_bitmaps=true
- fi
-)
-if test "x$test_dummy_bitmaps" = "xtrue"; then
- AC_DEFINE([OUTPUT_DUMMY_BITMAPS], [1], [Whether to output dummy bitmaps instead of the real ones])
-fi
-
-
-test_docs=true
-if test "$native_win32" = yes; then
- test_docs=false
-fi
-AC_ARG_WITH(docs,
- [ --without-docs Do not build documentation],
- if test "x$withval" = xno; then
- test_docs=false
- fi
- if test "x$withval" = xyes; then
- test_docs=true
- fi
-)
-
-if test "x$test_docs" = xtrue; then
- AC_PATH_PROG(DOXYGEN, doxygen)
- if test -z "$DOXYGEN"; then
- AC_MSG_WARN([*** Could not find doxygen in your PATH.])
- AC_MSG_WARN([*** The documentation will not be built.])
- test_docs=false
- fi
-fi
-
-AM_CONDITIONAL(WITH_LIBPict_DOCS, $test_docs )
-
-AC_MSG_CHECKING([for Win32 platform in general])
-case "$host" in
- *-*-mingw*|*-*-cygwin*)
- platform_win32=yes
- ;;
- *)
- platform_win32=no
- ;;
-esac
-AC_MSG_RESULT($platform_win32)
-AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
-
-AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging],[
- case "${enableval}" in
- yes) debug=true ;
- DEBUG_CXXFLAGS="-DDEBUG -g" ;;
- no) debug=false ;
- DEBUG_CXXFLAGS="-DNDEBUG" ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
- esac
-],[ debug=false
- DEBUG_CXXFLAGS="-DNDEBUG"
-])
-
-# AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
-
-# Courtesy of Glib: Ensure MSVC-compatible struct packing convention
-# is used when compiling for Win32 with gcc.
-# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
-# gcc2 uses "-fnative-struct".
-if test x"$native_win32" = xyes; then
- AC_CHECK_TOOL(WINDRES, windres)
- if test x"$GCC" = xyes; then
- msnative_struct=''
- AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
- if test -z "$ac_cv_prog_CC"; then
- our_gcc="$CC"
- else
- our_gcc="$ac_cv_prog_CC"
- fi
- case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
- 2.)
- if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
- msnative_struct='-fnative-struct'
- fi
- ;;
- *)
- if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
- msnative_struct='-mms-bitfields'
- fi
- ;;
- esac
- if test x"$msnative_struct" = x ; then
- AC_MSG_RESULT([no way])
- AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
- else
- CFLAGS="$CFLAGS $msnative_struct"
- CXXFLAGS="$CXXFLAGS $msnative_struct"
- AC_MSG_RESULT([${msnative_struct}])
- fi
- fi
- CFLAGS="$CFLAGS -Wall -pedantic"
- CXXFLAGS="$CXXFLAGS -Wall -pedantic"
-else
- if test x"$GCC" = xyes; then
- # Be tough with warnings and produce less careless code
- CFLAGS="$CFLAGS -Wall -Werror -pedantic"
- CXXFLAGS="$CXXFLAGS -Wall -Werror -pedantic"
- fi
-fi
-
-LIBPict_CXXFLAGS="$LIBPict_CFLAGS"
-
-AC_SUBST(LIBPict_CXXFLAGS)
-AC_SUBST(DEBUG_CXXFLAGS)
-
-AC_OUTPUT([
-Makefile
-src/Makefile
-src/conv/Makefile
-src/conv/raw/Makefile
-src/conv/raw/pict2raw.rc
-src/conv/svg/Makefile
-src/conv/svg/pict2svg.rc
-src/lib/Makefile
-src/lib/libpict.h
-src/lib/libpict.rc
-build/Makefile
-build/win32/Makefile
-docs/Makefile
-docs/doxygen/Makefile
-libpict-0.1.pc
-libpict.spec
-libpict-zip
-])
-
-case "$debug" in
- "true" )
- AC_MSG_RESULT([Configured with debugging symbols.]) ;;
-esac
diff --git a/docs/doxygen/Makefile.am b/docs/doxygen/Makefile.am
index 0e16943..cfe7e4d 100644
--- a/docs/doxygen/Makefile.am
+++ b/docs/doxygen/Makefile.am
@@ -2,7 +2,7 @@ EXTRA_DIST = doxygen.cfg \
footer.html.in \
header.html.in
-if WITH_LIBPict_DOCS
+if WITH_LIBPICT_DOCS
install-data-am:
mkdir -p $(DESTDIR)$(docdir)/html
diff --git a/inc/Makefile.am b/inc/Makefile.am
new file mode 100644
index 0000000..dc6efa0
--- /dev/null
+++ b/inc/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = libpict
diff --git a/inc/libpict/Makefile.am b/inc/libpict/Makefile.am
new file mode 100644
index 0000000..687d62d
--- /dev/null
+++ b/inc/libpict/Makefile.am
@@ -0,0 +1,3 @@
+EXTRA_DIST = \
+ libpict.h \
+ PictImage.h
diff --git a/src/lib/PictImage.h b/inc/libpict/PictImage.h
index 9e10e5e..9e10e5e 100644
--- a/src/lib/PictImage.h
+++ b/inc/libpict/PictImage.h
diff --git a/src/lib/libpict.h.in b/inc/libpict/libpict.h
index ee886fd..927b983 100644
--- a/src/lib/libpict.h.in
+++ b/inc/libpict/libpict.h
@@ -24,13 +24,8 @@
* Corel Corporation or Corel Corporation Limited."
*/
-#ifndef __LIBPict_H__
-#define __LIBPict_H__
-
-#define LIBPict_VERSION_MAJOR @Pict_MAJOR_VERSION@
-#define LIBPict_VERSION_MINOR @Pict_MINOR_VERSION@
-#define LIBPict_VERSION_REVISION @Pict_MICRO_VERSION@
-#define LIBPict_VERSION_STRING "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@"
+#ifndef __LIBPICT_H__
+#define __LIBPICT_H__
#include "PictImage.h"
diff --git a/libpict-zip.in b/libpict-zip.in
index 7d31641..9720c29 100644
--- a/libpict-zip.in
+++ b/libpict-zip.in
@@ -2,37 +2,37 @@
# Build runtime and developer zipfiles for libpict on Win32.
-ZIP=libpict-@Pict_VERSION@-MinGW.zip
-DEVZIP=libpict-devel-@Pict_VERSION@-MinGW.zip
-TOOLSZIP=libpict-tools-@Pict_VERSION@.zip
+ZIP=libpict-@PICT_VERSION@-MinGW.zip
+DEVZIP=libpict-devel-@PICT_VERSION@-MinGW.zip
+TOOLSZIP=libpict-tools-@PICT_VERSION@.zip
cd $DESTDIR@prefix@
DLLDIR=lib
-[ -f bin/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll ] && \
+[ -f bin/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.dll ] && \
DLLDIR=bin
@STRIP@ --strip-all \
-$DLLDIR/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll \
+$DLLDIR/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.dll \
bin/pict2raw.exe \
bin/pict2svg.exe
upx -qqq --best \
-$DLLDIR/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll \
+$DLLDIR/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.dll \
bin/pict2raw.exe \
bin/pict2svg.exe
rm -f $ZIP
zip -q -r $ZIP -@ <<EOF
-$DLLDIR/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll
+$DLLDIR/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.dll
EOF
rm -f $DEVZIP
zip -q -r $DEVZIP -@ <<EOF
-include/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@
-lib/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll.a
-lib/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.a
-lib/pkgconfig/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.pc
+include/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@
+lib/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.dll.a
+lib/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.a
+lib/pkgconfig/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.pc
EOF
rm -f $TOOLSZIP
diff --git a/libpict-0.1.pc.in b/libpict.pc.in
index a14344a..fc26c6d 100644
--- a/libpict-0.1.pc.in
+++ b/libpict.pc.in
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@
+Name: libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@
Description: Library for importing and converting Corel WordPerfect(tm) Graphics images
Version: @VERSION@
Requires: libwpd-0.9 libwpd-stream-0.9 libwpg-0.2
-Libs: -L${libdir} -lpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@
-Cflags: -I${includedir}/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@
+Libs: -L${libdir} -lpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@
+Cflags: -I${includedir}/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@
diff --git a/libpict.spec.in b/libpict.spec.in
index b9c7e5f..292fa99 100644
--- a/libpict.spec.in
+++ b/libpict.spec.in
@@ -80,7 +80,7 @@ umask 022
%defattr(644,root,root,755)
%{_libdir}/libpict*.so
%{_libdir}/pkgconfig/libpict*.pc
-%{_includedir}/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@/libpict
+%{_includedir}/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@/libpict
%if %{!?_without_docs:1}%{?_without_docs:0}
%files docs
diff --git a/src/conv/raw/Makefile.am b/src/conv/raw/Makefile.am
index c775269..e95927f 100644
--- a/src/conv/raw/Makefile.am
+++ b/src/conv/raw/Makefile.am
@@ -1,14 +1,14 @@
bin_PROGRAMS = pict2raw
-AM_CXXFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib $(LIBPict_CXXFLAGS) $(DEBUG_CXXFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/inc $(LIBPICT_CXXFLAGS) $(DEBUG_CXXFLAGS)
-pict2raw_DEPENDENCIES = @Pict2RAW_WIN32_RESOURCE@
+pict2raw_DEPENDENCIES = @PICT2RAW_WIN32_RESOURCE@
if STATIC_TOOLS
-pict2raw_LDADD = ../../lib/@Pict_OBJDIR@/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.a $(LIBPict_LIBS) @Pict2RAW_WIN32_RESOURCE@
+pict2raw_LDADD = ../../lib/@Pict_OBJDIR@/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.a $(LIBPICT_LIBS) @PICT2RAW_WIN32_RESOURCE@
pict2raw_LDFLAGS = -all-static
else
-pict2raw_LDADD = ../../lib/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.la $(LIBPict_LIBS) @Pict2RAW_WIN32_RESOURCE@
+pict2raw_LDADD = ../../lib/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.la $(LIBPICT_LIBS) @PICT2RAW_WIN32_RESOURCE@
endif
pict2raw_SOURCES = \
@@ -16,9 +16,9 @@ pict2raw_SOURCES = \
if OS_WIN32
-@Pict2RAW_WIN32_RESOURCE@ : pict2raw.rc $(pict2raw_OBJECTS)
+@PICT2RAW_WIN32_RESOURCE@ : pict2raw.rc $(pict2raw_OBJECTS)
chmod +x $(top_srcdir)/build/win32/*compile-resource
- WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource pict2raw.rc @Pict2RAW_WIN32_RESOURCE@
+ WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource pict2raw.rc @PICT2RAW_WIN32_RESOURCE@
endif
EXTRA_DIST = \
diff --git a/src/conv/raw/pict2raw.cpp b/src/conv/raw/pict2raw.cpp
index 15c9d49..7c1a72b 100644
--- a/src/conv/raw/pict2raw.cpp
+++ b/src/conv/raw/pict2raw.cpp
@@ -28,9 +28,17 @@
#include <stdio.h>
#include <string.h>
-#include "libpict.h"
#include <libwpd-stream/libwpd-stream.h>
#include <libwpd/libwpd.h>
+#include <libpict/libpict.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
class RawPainter : public libwpg::WPGPaintInterface
{
@@ -228,7 +236,7 @@ int printUsage()
int printVersion()
{
- printf("pict2raw %s\n", LIBPict_VERSION_STRING);
+ printf("pict2raw %s\n", VERSION);
return 0;
}
diff --git a/src/conv/raw/pict2raw.rc.in b/src/conv/raw/pict2raw.rc.in
index 9b71033..ab898fc 100644
--- a/src/conv/raw/pict2raw.rc.in
+++ b/src/conv/raw/pict2raw.rc.in
@@ -1,8 +1,8 @@
#include <winver.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,BUILDNUMBER
- PRODUCTVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,0
+ FILEVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,BUILDNUMBER
+ PRODUCTVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,0
FILEFLAGSMASK 0
FILEFLAGS 0
FILEOS VOS__WINDOWS32
@@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "The libpict developer community"
VALUE "FileDescription", "pict2raw"
- VALUE "FileVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@.BUILDNUMBER"
+ VALUE "FileVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@.BUILDNUMBER"
VALUE "InternalName", "pict2raw"
VALUE "LegalCopyright", "Copyright (C) 2004 Marc Oude Kotte, other contributers"
VALUE "OriginalFilename", "pict2raw.exe"
VALUE "ProductName", "libpict"
- VALUE "ProductVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@"
+ VALUE "ProductVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@"
END
END
BLOCK "VarFileInfo"
diff --git a/src/conv/svg/Makefile.am b/src/conv/svg/Makefile.am
index 9f02a45..ecc38b5 100644
--- a/src/conv/svg/Makefile.am
+++ b/src/conv/svg/Makefile.am
@@ -1,14 +1,14 @@
bin_PROGRAMS = pict2svg
-AM_CXXFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib $(LIBPict_CXXFLAGS) $(DEBUG_CXXFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/inc $(LIBPICT_CXXFLAGS) $(DEBUG_CXXFLAGS)
-pict2svg_DEPENDENCIES = @Pict2SVG_WIN32_RESOURCE@
+pict2svg_DEPENDENCIES = @PICT2SVG_WIN32_RESOURCE@
if STATIC_TOOLS
-pict2svg_LDADD = ../../lib/@Pict_OBJDIR@/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.a $(LIBPict_LIBS) @Pict2SVG_WIN32_RESOURCE@
+pict2svg_LDADD = ../../lib/@Pict_OBJDIR@/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.a $(LIBPICT_LIBS) @PICT2SVG_WIN32_RESOURCE@
pict2svg_LDFLAGS = -all-static
else
-pict2svg_LDADD = ../../lib/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.la $(LIBPict_LIBS) @Pict2SVG_WIN32_RESOURCE@
+pict2svg_LDADD = ../../lib/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.la $(LIBPICT_LIBS) @PICT2SVG_WIN32_RESOURCE@
endif
pict2svg_SOURCES = \
@@ -16,9 +16,9 @@ pict2svg_SOURCES = \
if OS_WIN32
-@Pict2SVG_WIN32_RESOURCE@ : pict2svg.rc $(pict2svg_OBJECTS)
+@PICT2SVG_WIN32_RESOURCE@ : pict2svg.rc $(pict2svg_OBJECTS)
chmod +x $(top_srcdir)/build/win32/*compile-resource
- WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource pict2svg.rc @Pict2SVG_WIN32_RESOURCE@
+ WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource pict2svg.rc @PICT2SVG_WIN32_RESOURCE@
endif
EXTRA_DIST = \
diff --git a/src/conv/svg/pict2svg.cpp b/src/conv/svg/pict2svg.cpp
index e82b354..14038a0 100644
--- a/src/conv/svg/pict2svg.cpp
+++ b/src/conv/svg/pict2svg.cpp
@@ -27,9 +27,17 @@
#include <sstream>
#include <stdio.h>
#include <string.h>
-#include "libpict.h"
#include <libwpd-stream/libwpd-stream.h>
#include <libwpd/libwpd.h>
+#include <libpict/libpict.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
namespace
{
@@ -46,7 +54,7 @@ int printUsage()
int printVersion()
{
- printf("pict2svg %s\n", LIBPict_VERSION_STRING);
+ printf("pict2svg %s\n", VERSION);
return 0;
}
diff --git a/src/conv/svg/pict2svg.rc.in b/src/conv/svg/pict2svg.rc.in
index 9ad8dd8..8173c62 100644
--- a/src/conv/svg/pict2svg.rc.in
+++ b/src/conv/svg/pict2svg.rc.in
@@ -1,8 +1,8 @@
#include <winver.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,BUILDNUMBER
- PRODUCTVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,0
+ FILEVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,BUILDNUMBER
+ PRODUCTVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,0
FILEFLAGSMASK 0
FILEFLAGS 0
FILEOS VOS__WINDOWS32
@@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "The libpict developer community"
VALUE "FileDescription", "pict2svg"
- VALUE "FileVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@.BUILDNUMBER"
+ VALUE "FileVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@.BUILDNUMBER"
VALUE "InternalName", "pict2svg"
VALUE "LegalCopyright", "Copyright (C) 2004 Marc Oude Kotte, other contributers"
VALUE "OriginalFilename", "pict2svg.exe"
VALUE "ProductName", "libpict"
- VALUE "ProductVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@"
+ VALUE "ProductVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@"
END
END
BLOCK "VarFileInfo"
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index bd4a158..ad6d047 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -1,35 +1,21 @@
if PLATFORM_WIN32
-no_undefined = -no-undefined
version_info = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -avoid-version
else
-no_undefined =
version_info = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
endif
-if OS_WIN32
-install-libtool-import-lib:
- $(INSTALL) @Pict_OBJDIR@/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll.a $(DESTDIR)$(libdir)
-
-uninstall-libtool-import-lib:
- -rm $(DESTDIR)$(libdir)/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.dll.a
-
-else
-install-libtool-import-lib:
-uninstall-libtool-import-lib:
-endif
+lib_LTLIBRARIES = libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.la
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_includedir = $(includedir)/libpict-@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@/libpict
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_include_HEADERS = \
+ $(top_srcdir)/inc/libpict/libpict.h \
+ $(top_srcdir)/inc/libpict/PictImage.h
-lib_LTLIBRARIES = libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.la
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_includedir = $(includedir)/libpict-@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@/libpict
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_include_HEADERS = \
- libpict.h \
- PictImage.h
-
-AM_CXXFLAGS = $(LIBPict_CXXFLAGS) $(DEBUG_CXXFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/inc $(LIBPICT_CXXFLAGS) $(DEBUG_CXXFLAGS)
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_LIBADD = $(LIBPict_LIBS) @LIBPict_WIN32_RESOURCE@
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_DEPENDENCIES = @LIBPict_WIN32_RESOURCE@
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic $(no_undefined)
-libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_SOURCES = \
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_la_LIBADD = $(LIBPICT_LIBS) @LIBPICT_WIN32_RESOURCE@
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_la_DEPENDENCIES = @LIBPICT_WIN32_RESOURCE@
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined
+libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_la_SOURCES = \
PictImage.cpp \
PictColor.cpp \
PictHeader.cpp \
@@ -50,21 +36,14 @@ libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_SOURCES = \
if OS_WIN32
-@LIBPict_WIN32_RESOURCE@ : libpict.rc $(libpict_@Pict_MAJOR_VERSION@_@Pict_MINOR_VERSION@_la_OBJECTS)
+@LIBPICT_WIN32_RESOURCE@ : libpict.rc $(libpict_@PICT_MAJOR_VERSION@_@PICT_MINOR_VERSION@_la_OBJECTS)
chmod +x $(top_srcdir)/build/win32/*compile-resource
- WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource libpict.rc @LIBPict_WIN32_RESOURCE@
+ WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource libpict.rc @LIBPICT_WIN32_RESOURCE@
endif
-
-install-data-local: install-libtool-import-lib
-
-uninstall-local: uninstall-libtool-import-lib
-
EXTRA_DIST = \
- libpict.h.in \
- libpict.rc.in \
- makefile.mk
+ libpict.rc.in
# These may be in the builddir too
BUILD_EXTRA_DIST = \
diff --git a/src/lib/PictHeader.cpp b/src/lib/PictHeader.cpp
index 46905e1..c9338a6 100644
--- a/src/lib/PictHeader.cpp
+++ b/src/lib/PictHeader.cpp
@@ -28,7 +28,7 @@ unsigned char readU8(WPXInputStream *input)
unsigned char const *p = input->read(sizeof(unsigned char), numBytesRead);
if (numBytesRead != sizeof(unsigned char))
- ;
+ throw libpict::EndOfStreamException();
return *(unsigned char const *)(p);
}
@@ -38,7 +38,7 @@ unsigned short readU16(WPXInputStream *input)
unsigned short const *p = (unsigned short const *)input->read(sizeof(unsigned short), numBytesRead);
if (numBytesRead != sizeof(unsigned short))
- ;
+ throw libpict::EndOfStreamException();
return (unsigned short)((((unsigned char const *)(p))[1] << 0) | (((unsigned char const *)(p))[0] << 8));
}
@@ -47,7 +47,7 @@ unsigned readU32(WPXInputStream *input)
unsigned long numBytesRead;
unsigned const *p = (unsigned const *)input->read(sizeof(unsigned), numBytesRead);
if (numBytesRead != sizeof(unsigned))
- ;
+ throw libpict::EndOfStreamException();
return (unsigned)((((unsigned char const *)(p))[3] << 0) | (((unsigned char const *)(p))[2] << 8) |
(((unsigned char const *)(p))[1] << 16) | (((unsigned char const *)(p))[0] << 24));
}
diff --git a/src/lib/PictImage.cpp b/src/lib/PictImage.cpp
index e2bee15..ad78e13 100644
--- a/src/lib/PictImage.cpp
+++ b/src/lib/PictImage.cpp
@@ -17,15 +17,15 @@
* Boston, MA 02111-1301 USA
*/
-#include "PictImage.h"
+#include <sstream>
+#include <libwpg/libwpg.h>
+#include <libpict/libpict.h>
#include "PictHeader.h"
#include "PictXParser.h"
#include "Pict1Parser.h"
#include "Pict2Parser.h"
#include "libpict_utils.h"
#include "PictSVGGenerator.h"
-#include <libwpg/libwpg.h>
-#include <sstream>
/**
Analyzes the content of an input stream to see if it can be parsed
diff --git a/src/lib/PictSVGGenerator.cpp b/src/lib/PictSVGGenerator.cpp
index b44c604..7325c14 100644
--- a/src/lib/PictSVGGenerator.cpp
+++ b/src/lib/PictSVGGenerator.cpp
@@ -54,7 +54,7 @@ void libpict::PictSVGGenerator::startGraphics(const WPXPropertyList &propList)
m_outputSink << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"";
m_outputSink << " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n";
- m_outputSink << "<!-- Created with pict2svg/libpict " << LIBPict_VERSION_STRING << " -->\n";
+ m_outputSink << "<!-- Created with pict2svg/libpict -->\n";
m_outputSink << "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" ";
m_outputSink << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" ";
diff --git a/src/lib/PictSVGGenerator.h b/src/lib/PictSVGGenerator.h
index 9541f66..e6caab5 100644
--- a/src/lib/PictSVGGenerator.h
+++ b/src/lib/PictSVGGenerator.h
@@ -31,7 +31,7 @@
#include <iostream>
#include <libwpd/libwpd.h>
#include <libwpg/libwpg.h>
-#include "libpict.h"
+#include <libpict/libpict.h>
namespace libpict
{
diff --git a/src/lib/libpict.rc.in b/src/lib/libpict.rc.in
index 5fbd713..93c9cf3 100644
--- a/src/lib/libpict.rc.in
+++ b/src/lib/libpict.rc.in
@@ -1,8 +1,8 @@
#include <winver.h>
VS_VERSION_INFO VERSIONINFO
- FILEVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,BUILDNUMBER
- PRODUCTVERSION @Pict_MAJOR_VERSION@,@Pict_MINOR_VERSION@,@Pict_MICRO_VERSION@,0
+ FILEVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,BUILDNUMBER
+ PRODUCTVERSION @PICT_MAJOR_VERSION@,@PICT_MINOR_VERSION@,@PICT_MICRO_VERSION@,0
FILEFLAGSMASK 0
FILEFLAGS 0
FILEOS VOS__WINDOWS32
@@ -15,12 +15,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "The libpict developer community"
VALUE "FileDescription", "libpict"
- VALUE "FileVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@.BUILDNUMBER"
+ VALUE "FileVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@.BUILDNUMBER"
VALUE "InternalName", "libpict-0.1"
VALUE "LegalCopyright", "Copyright (C) 2004 Marc Oude Kotte, other contributers"
VALUE "OriginalFilename", "libpict-0.1.dll"
VALUE "ProductName", "libpict"
- VALUE "ProductVersion", "@Pict_MAJOR_VERSION@.@Pict_MINOR_VERSION@.@Pict_MICRO_VERSION@"
+ VALUE "ProductVersion", "@PICT_MAJOR_VERSION@.@PICT_MINOR_VERSION@.@PICT_MICRO_VERSION@"
END
END
BLOCK "VarFileInfo"
diff --git a/src/lib/libpict_utils.h b/src/lib/libpict_utils.h
index 3f9ee7f..87087f6 100644
--- a/src/lib/libpict_utils.h
+++ b/src/lib/libpict_utils.h
@@ -23,8 +23,8 @@
* Corel Corporation or Corel Corporation Limited."
*/
-#ifndef __LIBPict_UTILS_H__
-#define __LIBPict_UTILS_H__
+#ifndef __LIBPICT_UTILS_H__
+#define __LIBPICT_UTILS_H__
#include <stdio.h>
@@ -47,4 +47,13 @@
#define Pict_DEBUG(M)
#endif
-#endif // __LIBPict_UTILS_H__
+namespace libpict
+{
+
+class EndOfStreamException
+{
+};
+
+} // namespace libpict
+
+#endif // __LIBPICT_UTILS_H__