diff --git a/configure.in b/configure.in index 03e9536..5251327 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,20 @@ -# init +# $Id$ +AC_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) +AC_DEFUN([AX_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ax_define_dir="\"[$]$2\"" + eval ax_define_dir="\"$ax_define_dir\"" + AC_SUBST($1, "$ax_define_dir") + AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) + AC_INIT([README]) SRC_DIR=src TST_DIR=test @@ -7,10 +23,10 @@ DOC_DIR=doc m4_define(x_packagename, libxml-cxx) m4_define(x_major, 1) m4_define(x_minor, 0) - PACKAGENAME=x_packagename MAJOR=x_major MINOR=x_minor +BUILDDATE=$(date "+%d.%m.%Y/%H.%M") LEAST="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" for path in . .. ../..; do @@ -23,22 +39,20 @@ done AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org]) # files to create -AC_CONFIG_FILES(makefile src/version.cxx +AC_CONFIG_FILES([makefile ${PACKAGENAME}.spec src/version.cxx src/makefile test/makefile doc/examples/makefile - doc/doxyfile doc/makefile - src/libxml-cxx.pc debian/changelog - libxml-cxx.spec) + doc/doxyfile doc/makefile + src/${PACKAGENAME}.pc debian/changelog]) +# copy M4 to shell AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(LEAST) - -README=README -AC_SUBST_FILE(README) +AC_SUBST(BUILDDATE) # libtool versioning LIB_MAJOR=m4_eval(x_major+x_minor) -LIB_MINOR=$LEAST +LIB_MINOR=${LEAST} LIB_LEAST=x_minor LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}" AC_SUBST(LIB_VERSION) @@ -46,12 +60,18 @@ AC_SUBST(LIB_VERSION) # home AC_SUBST(HOME) +# datadir for languages +AX_DEFINE_DIR([DATADIR], [datadir]) +#AC_SUBST(DATADIR) + # macros README=README AC_SUBST_FILE(README) CHANGE_LOG=ChangeLog AC_SUBST_FILE(CHANGE_LOG) +AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'" + # Get rid of that stupid -O2 -g opions! CXXFLAGS="${CXXFLAGS:-}" @@ -67,6 +87,7 @@ AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_CHECK_PROG(have_doxygen, doxygen, yes, no) AC_CHECK_PROG(have_dot, dot, yes, no) +PKG_PROG_PKG_CONFIG AC_ARG_ENABLE(pedantic, [AS_HELP_STRING([--enable-pedantic], @@ -83,6 +104,15 @@ AC_ARG_ENABLE(dot, test "$enableval" = "yes" && HAVE_DOT="YES" || HAVE_DOT="NO"; AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"]) +MINGW32=no +MAC=no +case $host_os in + *mingw32*) MINGW32=yes;; + *darwin* | *rhapsody* | *macosx*) MAC=yes;; +esac +AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes") +AM_CONDITIONAL(MAC, test "$MAC" = "yes") + # export macros SRCDIR=${srcdir} AC_SUBST(SRCDIR) @@ -95,8 +125,6 @@ AC_SUBST(PACKAGENAME) AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CPPFLAGS) AC_SUBST(LIBS) -AC_SUBST(QMAKE) -AC_SUBST(QMAKE_OPTIONS) # create output AC_OUTPUT @@ -118,10 +146,3 @@ AC_MSG_NOTICE([Pedantic compile mode enabled! - all warnings for GNU g++ are enabled - all warnings result in an error - doxygen warnings are treated as error too]); fi -if test "$build_win" == "yes"; then -AC_MSG_NOTICE([Will cross-compile for windows - Requires: - - mingw32, mingw32-binutils, mingw32-runtime - - i586-mingw32msvc-g++, i586-mingw32msvc-ar, - i586-mingw32msvc-windres, i586-mingw32msvc-strip - - Boost for MinGW in ~/.wine/drive_c/Programme/Boost-1.34.1]); fi diff --git a/doc/makefile.am b/doc/makefile.am index 356eef5..d37d5b3 100644 --- a/doc/makefile.am +++ b/doc/makefile.am @@ -6,13 +6,11 @@ ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 SUBDIRS = examples +ALL_SRC = ${top_srcdir}/src/*.[ch]xx +# ${top_srcdir}/src/*.doc -develdir = ${pkgdatadir}/doc -devel_DATA = html/index.html - -ALL_SRC = ${top_srcdir}/*/*.[ch]xx ${top_srcdir}/*/*/*.[ch]xx - -DIRS = html latex +DIRS = html +#latex all: ${DIRS} @@ -22,7 +20,7 @@ all: ${DIRS} deps = ${top_srcdir}/COPYING ${top_srcdir}/README \ ${top_srcdir}/INSTALL ${top_srcdir}/NEWS ${top_srcdir}/ChangeLog -${devel_DATA}: ${ALL_SRC} doxyfile ${deps} +html: ${ALL_SRC} doxyfile ${deps} doxygen doxyfile if PEDANTIC test \! -s doxygen.errors @@ -34,17 +32,17 @@ CLEANFILES = doxygen.errors @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.pdf DISTCLEANFILES = @PACKAGENAME@.doxytag MAINTAINERCLEANFILES = makefile.in - distclean-local: - rm -r html latex -dist-hook: ${devel_DATA} - cp -r html ${distdir}/ +dist-hook: html +# cp -r html latex ${distdir}/ install-data-hook: - chmod -R u+w $(DESTDIR)${develdir} - cp -r html/* $(DESTDIR)${develdir}/ + test -d $(DESTDIR)${docdir} || mkdir -p $(DESTDIR)${docdir} + chmod -R u+w $(DESTDIR)${docdir} + cp -r html $(DESTDIR)${docdir}/ uninstall-hook: - -chmod -R u+w $(DESTDIR)${develdir} - -rm -rf $(DESTDIR)${develdir}/* + -chmod -R u+w $(DESTDIR)${docdir} + -rm -rf $(DESTDIR)${docdir}/* diff --git a/libxml-cxx.spec.in b/libxml-cxx.spec.in index dc2a05e..e130930 100644 --- a/libxml-cxx.spec.in +++ b/libxml-cxx.spec.in @@ -18,7 +18,7 @@ This package contains only the shared libraries required at runtime. %prep %setup -q ./configure --prefix=/usr \ - --datadir=/usr/share/doc/packages \ + --docdir=/usr/share/doc/packages/@PACKAGENAME@ \ --libdir=/usr/lib %build @@ -61,7 +61,8 @@ This Package contains all files required for developement. /usr/include/ /usr/share/pkgconfig %doc -/usr/share/doc/packages/@PACKAGENAME@/doc +/usr/share/doc/packages/@PACKAGENAME@/html +/usr/share/doc/packages/@PACKAGENAME@/@PACKAGENAME@.spec %changelog * Wed Apr 21 2010 Marc Wäckerlin - cxx-1 diff --git a/makefile.am b/makefile.am index 837c4d2..ec009fa 100644 --- a/makefile.am +++ b/makefile.am @@ -17,15 +17,14 @@ nobase_include_HEADERS = EXTRA_DIST = bootstrap.sh debian -DISTCLEANFILES = debian/changelog libxml-cxx.spec +DISTCLEANFILES = debian/changelog deb: dist tar xzvf @PACKAGE@-@VERSION@.tar.gz cd @PACKAGE@-@VERSION@ && dpkg-buildpackage - rm -rf @PACKAGE@-@VERSION@ + rm -rf @PACKAGE@-@VERSION@ -infosdir = ${pkgdatadir} -infos_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog # @PACKAGENAME@.spec +doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog @PACKAGENAME@.spec RPMS = /usr/src/packages/RPMS/i586/@PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@-1.i586.rpm \ /usr/src/packages/RPMS/i586/@PACKAGENAME@-devel-@MAJOR@.@MINOR@.@LEAST@-1.i586.rpm \ @@ -48,7 +47,18 @@ rpm: dist deps = ${top_srcdir}/COPYING ${top_srcdir}/README ${top_srcdir}/INSTALL ${top_srcdir}/NEWS ${top_srcdir}/ChangeLog -maintainer-clean-local: +clean-local: + - rm doxygen.err lib@PACKAGENAME@.doxytag + - rm @PACKAGENAME@-dev_@MAJOR@.@MINOR@.@LEAST@-*.deb \ + @PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-*.changes \ + @PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-1.tar.gz \ + @PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-1.dsc \ + @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz \ + @PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-*.deb + +distclean-local: + - rm -r ${top_builddir}/@DOC_DIR@/html/* ${top_builddir}/@DOC_DIR@/latex/* + - rm makefile makefile.in doxygen.err libmrw.doxytag - find . -name '*~' | xargs rm - rm -r autom4te.cache - rm aclocal.m4 config.guess config.sub configure \