summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am2
-rw-r--r--configure.in235
-rw-r--r--src/Makefile.am4
-rw-r--r--src/conv/Makefile.am5
5 files changed, 109 insertions, 138 deletions
diff --git a/.gitignore b/.gitignore
index 560653d..3b59fc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@ libtool
libvisio.spec
libvisio-zip
ltmain.sh
+m4
missing
mkinstalldirs
stamp-h1
diff --git a/Makefile.am b/Makefile.am
index 1956bb2..4bffc9b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+ACLOCAL_AMFLAGS = -I m4
+
pkgconfdir = $(libdir)/pkgconfig
pkgconf_DATA = libvisio-@VSD_MAJOR_VERSION@.@VSD_MINOR_VERSION@.pc
diff --git a/configure.in b/configure.in
index c66e6ed..af657a6 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
AC_INIT(src/lib/VisioDocument.cpp)
-AC_PREREQ([2.59c])
+AC_PREREQ([2.65])
AM_CONFIG_HEADER(config.h)
@@ -30,9 +30,12 @@ AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
+AC_CONFIG_MACRO_DIR([m4])
+
# initialize automake
#
-AM_INIT_AUTOMAKE(libvisio, $VSD_VERSION)
+AM_INIT_AUTOMAKE(libvisio, $VSD_VERSION foreign dist-bzip2)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_PROG_CC
AC_PROG_CPP
@@ -42,171 +45,146 @@ 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_ARG_ENABLE([static-tools],
+ [AS_HELP_STRING([--enable-static-tools], [Link tools (binaries) statically])]
+)
+AS_IF([test "x$enable_static_tools" = "xyes"], [
+ enable_static="yes"
+], [
AC_DISABLE_STATIC
-fi
+])
+AM_CONDITIONAL(STATIC_TOOLS, [test "x$enable_static_tools" = "xyes"])
-if test x$enable_static_tools = xyes; then
- enable_static="yes"
-fi
+AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--enable-werror], [Treat all warnings as errors, usefull for development])]
+)
+AS_IF([test x"$enable_werror" = "xyes"], [
+ CFLAGS="$CFLAGS -Werror"
+ CXXFLAGS="$CXXFLAGS -Werror"
+])
AC_PROG_LIBTOOL
AC_SUBST(VSD_OBJDIR, [$objdir])
AM_PROG_LIBTOOL
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+AC_PATH_PROG(PKG_CONFIG, [pkg-config], [no])
dnl ***********************************************************************************
PKG_CHECK_MODULES(LIBVISIO,[
-libwpd-0.9 >= $LIBWPD_REQUIRED_VERSION
-libwpd-stream-0.9 >= $LIBWPD_REQUIRED_VERSION
-libwpg-0.2 >= $LIBWPG_REQUIRED_VERSION
+ 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
- LIBVISIO_WIN32_RESOURCE=libvisio-win32res.lo
- VSD2RAW_WIN32_RESOURCE=vsd2raw-win32res.lo
- VSD2XHTML_WIN32_RESOURCE=vsd2xhtml-win32res.lo
- ;;
- *)
- native_win32=no
- LIBVISIO_WIN32_RESOURCE=
- VSD2RAW_WIN32_RESOURCE=
- VSD2XHTML_WIN32_RESOURCE=
- ;;
+ *-*-mingw*)
+ native_win32=yes
+ LIBVISIO_WIN32_RESOURCE=libvisio-win32res.lo
+ VSD2RAW_WIN32_RESOURCE=vsd2raw-win32res.lo
+ VSD2XHTML_WIN32_RESOURCE=vsd2xhtml-win32res.lo
+ ;;
+ *)
+ native_win32=no
+ LIBVISIO_WIN32_RESOURCE=
+ VSD2RAW_WIN32_RESOURCE=
+ VSD2XHTML_WIN32_RESOURCE=
+ ;;
esac
AC_MSG_RESULT([$native_win32])
-AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
+AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
AC_SUBST(LIBVISIO_WIN32_RESOURCE)
AC_SUBST(VSD2RAW_WIN32_RESOURCE)
AC_SUBST(VSD2XHTML_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
+ [AS_HELP_STRING([--with-dummy-bitmaps],
+ [Output dummy bitmaps of 1x1 pixels instead of the real bitmaps (speeds up the validation test)])]
)
-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
-
+AM_CONDITIONAL([OUTPUT_DUMMY_BITMAPS], [test "x$with_dummy_bitmaps" = "xyes"])
-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
+ [AS_HELP_STRING([--without-docs], [Do not build documentation])],
)
-
-if test "x$test_docs" = xtrue; then
- AC_PATH_PROG(DOXYGEN, doxygen)
- if test -z "$DOXYGEN"; then
+AS_IF([test "x$native_win32" = "xyes"], [with_docs=false])
+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.])
- test_docs=false
- fi
-fi
-
-AM_CONDITIONAL(WITH_LIBVISIO_DOCS, $test_docs )
+ enable_docs=false
+ ], [enable_docs=true])
+], [enable_docs=false])
+AM_CONDITIONAL([WITH_LIBVISIO_DOCS], [test "x$enable_docs" != "xfalse"])
AC_MSG_CHECKING([for Win32 platform in general])
case "$host" in
- *-*-mingw*|*-*-cygwin*)
- platform_win32=yes
- ;;
- *)
- platform_win32=no
- ;;
+ *-*-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
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"])
+
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug], [Turn on debugging])]
+)
+AS_IF([test "x$enable_debug" = "xyes"], [
+ DEBUG_CXXFLAGS="-DDEBUG -g"
+], [
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
+AS_IF([test "x$native_win32" = "xyes"], [
+ AC_CHECK_TOOL(WINDRES, windres)
+ AS_IF([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"
+ ])
+ case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
+ 2.)
+ AS_IF([$our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null], [
+ msnative_struct='-fnative-struct'
+ ])
+ ;;
+ *)
+ AS_IF([$our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null], [
+ msnative_struct='-mms-bitfields'
+ ])
+ ;;
+ esac
+ AS_IF([test -z "$msnative_struct"], [
+ AC_MSG_RESULT([no way])
+ AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
+ ], [
+ CFLAGS="$CFLAGS $msnative_struct"
+ CXXFLAGS="$CXXFLAGS $msnative_struct"
+ AC_MSG_RESULT([${msnative_struct}])
+ ])
+ ])
+ CFLAGS="$CFLAGS -Wall -pedantic"
+ CXXFLAGS="$CXXFLAGS -Wall -pedantic"
+], [
+ AS_IF([test x"$GCC" = xyes], [
+ # Be tough with warnings and produce less careless code
+ CFLAGS="$CFLAGS -Wall -pedantic"
+ CXXFLAGS="$CXXFLAGS -Wall -pedantic"
+ ])
+])
LIBVISIO_CXXFLAGS="$LIBVISIO_CFLAGS"
@@ -232,7 +210,6 @@ libvisio.spec
libvisio-zip
])
-case "$debug" in
- "true" )
- AC_MSG_RESULT([Configured with debugging symbols.]) ;;
-esac
+AS_IF([test "x$enable_debug" = "xyes"], [
+ AC_MSG_RESULT([Configured with debugging symbols.])
+])
diff --git a/src/Makefile.am b/src/Makefile.am
index 43a4b31..d56ced2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,2 @@
-AUTOMAKE_OPTIONS = gnu 1.4
-
-pkgconfigdir = $(libdir)/pkgconfig
-
SUBDIRS = lib conv
diff --git a/src/conv/Makefile.am b/src/conv/Makefile.am
index c872294..2295b76 100644
--- a/src/conv/Makefile.am
+++ b/src/conv/Makefile.am
@@ -1,6 +1 @@
-AUTOMAKE_OPTIONS = gnu 1.4
-
-pkgconfigdir = $(libdir)/pkgconfig
-
SUBDIRS = raw svg
-