summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in239
1 files changed, 239 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..4772320
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,239 @@
+AC_INIT(src/lib/PictImage.cpp)
+AC_PREREQ([2.59c])
+
+AM_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