diff --git a/configure.in.in b/configure.in.in new file mode 100644 index 00000000000..bc452b5b55d --- /dev/null +++ b/configure.in.in @@ -0,0 +1,114 @@ +#MIN_CONFIG(3.1) + +AM_INIT_AUTOMAKE(koffice, "1.2.95") + +CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS" + +AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h paths.h) +KDE_CHECK_KIMGIO +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +KDE_INIT_DOXYGEN([The KOffice API Reference], [Version $VERSION]) + + +# Check for ImageMagick... + +KDE_FIND_PATH(Magick-config, MAGICK_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [ + AC_MSG_WARN([Could not find ImageMagick anywhere, check http://www.imagemagick.org/ for ImageMagick >= 5.5.2.]) +]) + +if test -n "$MAGICK_CONFIG"; then + vers=`$MAGICK_CONFIG --version 2>/dev/null | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + if test -n "$vers" && test "$vers" -ge 5005002 + then + LIBMAGICK_LIBS="`$MAGICK_CONFIG --libs`" + LIBMAGICK_LDFLAGS="`$MAGICK_CONFIG --ldflags`" + LIBMAGICK_RPATH= + for args in $LIBMAGICK_LIBS; do + case $args in + -L*) + LIBMAGICK_RPATH="$LIBMAGICK_RPATH $args" + ;; + esac + done + LIBMAGICK_RPATH=`echo $LIBMAGICK_RPATH | $SED -e "s/-L/-R/g"` + LIBMAGICK_CPPFLAGS="`$MAGICK_CONFIG --cppflags`" + AC_DEFINE(HAVE_MAGICK,1, [ImageMagick is available]) + else + AC_MSG_WARN([You need at least ImageMagick 5.5.2]) + fi +fi + +if test ! "$USE_RPATH" = "yes"; then + LIBMAGICK_RPATH= +fi + +AC_SUBST(LIBMAGICK_LIBS) +AC_SUBST(LIBMAGICK_LDFLAGS) +AC_SUBST(LIBMAGICK_CPPFLAGS) +AC_SUBST(LIBMAGICK_RPATH) + +# End of ImageMagick check + +########################################################################## +# This last check is copied from kdenonbeta/gsf/configure.in.in +########################################################################## +# KOFFICE_PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +# defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +# also defines GSTUFF_PKG_ERRORS on error +# Note: This is specially tweaked for karbon's fontconfig check. Please fix +# it before using it for other tests :-) +AC_DEFUN(KOFFICE_PKG_CHECK_MODULES, [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + echo "***" + echo "*** Due to that we can't perform the check for fontconfig..." # added for karbon (Werner) + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) +# else # removed for karbon (Werner) +# ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) diff --git a/lib/kofficecore/kofficeversion.h b/lib/kofficecore/kofficeversion.h new file mode 100644 index 00000000000..af4a9d39122 --- /dev/null +++ b/lib/kofficecore/kofficeversion.h @@ -0,0 +1,79 @@ +/* This file is part of the KOffice libraries + Copyright (c) 2003 KOffice Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +// $Id$ + +#ifndef _KOFFICE_VERSION_H_ +#define _KOFFICE_VERSION_H_ + +#define KOFFICE_VERSION_STRING "1.2.95" +#define KOFFICE_VERSION_MAJOR 1 +#define KOFFICE_VERSION_MINOR 2 +#define KOFFICE_VERSION_RELEASE 95 +#define KOFFICE_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c)) + +#define KOFFICE_VERSION \ + KOFFICE_MAKE_VERSION(KOFFICE_VERSION_MAJOR,KOFFICE_VERSION_MINOR,KOFFICE_VERSION_RELEASE) + +#define KOFFICE_IS_VERSION(a,b,c) ( KOFFICE_VERSION >= KOFFICE_MAKE_VERSION(a,b,c) ) + +/** + * Namespace for general KOFFICE functions. + */ +namespace KOffice +{ + /** + * Returns the encoded number of KOffice's version, see the KOFFICE_VERSION macro. + * In contrary to that macro this function returns the number of the actually + * installed KOffice version, not the number of the KOffice version that was + * installed when the program was compiled. + * @return the version number, encoded in a single uint + * @since 1.3 + */ + unsigned int version(); + /** + * Returns the major number of KOffice's version, e.g. + * 1 for KOffice 1.2.3. + * @return the major version number + * @since 1.3 + */ + unsigned int versionMajor(); + /** + * Returns the minor number of KOffice's version, e.g. + * 2 for KOffice 1.2.3. + * @return the minor version number + * @since 1.3 + */ + unsigned int versionMinor(); + /** + * Returns the release of KOffice's version, e.g. + * 3 for KOffice 1.2.3. + * @return the release number + * @since 1.3 + */ + unsigned int versionRelease(); + /** + * Returns the KOffice version as string, e.g. "1.2.3". + * @return the KOffice version. You can keep the string forever + * @since 1.3 + */ + const char *versionString(); +} + +#endif // _KOFFICE_VERSION_H_