|
From: <chr...@us...> - 2012-02-23 21:05:37
|
Revision: 3564
http://dlvhex.svn.sourceforge.net/dlvhex/?rev=3564&view=rev
Author: chrisr86
Date: 2012-02-23 21:05:31 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
fix ABI version function
Modified Paths:
--------------
dlvhex-mergingplugin/branches/release2x/configure.ac
dlvhex-mergingplugin/branches/release2x/src/Makefile.am
dlvhex-mergingplugin/branches/release2x/src/MergingPlugin.cpp
Added Paths:
-----------
dlvhex-mergingplugin/branches/release2x/m4/dlvhex.m4
Modified: dlvhex-mergingplugin/branches/release2x/configure.ac
===================================================================
--- dlvhex-mergingplugin/branches/release2x/configure.ac 2012-02-23 14:57:27 UTC (rev 3563)
+++ dlvhex-mergingplugin/branches/release2x/configure.ac 2012-02-23 21:05:31 UTC (rev 3564)
@@ -1,20 +1,15 @@
-AC_PREREQ(2.64)
-
-AC_INIT([dlvhex-mergingplugin],[1.1.0],[chr...@tu...])
-
+AC_PREREQ([2.64])
+AC_INIT([dlvhex-mergingplugin],[2.0.0],[chr...@tu...])
AC_CONFIG_SRCDIR([src/MergingPlugin.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/config.h])
-MAJOR=`echo $PACKAGE_VERSION | sed "s/^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/"`
-MINOR=`echo $PACKAGE_VERSION | sed "s/^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/"`
-MICRO=`echo $PACKAGE_VERSION | sed "s/^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/"`
+# for documentation of the versioning scheme see
+# https://sourceforge.net/apps/trac/dlvhex/wiki/LibraryVersions
+DLVHEX_DEFINE_VERSION([MERGINGPLUGIN],[$PACKAGE_VERSION])
+DLVHEX_DEFINE_VERSION([DLVHEX_ABI],[7.0.0])
-AC_DEFINE_UNQUOTED([MERGINGPLUGIN_MAJOR], [$MAJOR], [Major version number of the merging-plugin])
-AC_DEFINE_UNQUOTED([MERGINGPLUGIN_MINOR], [$MINOR], [Minor version number of the merging-plugin])
-AC_DEFINE_UNQUOTED([MERGINGPLUGIN_MICRO], [$MICRO], [Micro version number of the merging-plugin])
-
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
@@ -33,6 +28,10 @@
AC_PROG_LEX
AC_PROG_YACC
+# Checks for programs.
+AC_PROG_CXX
+AC_LANG([C++])
+
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS([sys/param.h])
@@ -41,8 +40,10 @@
AC_HEADER_STDBOOL
AC_C_CONST
-# we build a module library
+# Checks for library functions.
+AC_LIBTOOL_DLOPEN # we build a module library
AC_DISABLE_STATIC # we don't need a static library
+AC_PROG_LIBTOOL
LT_INIT
@@ -66,7 +67,7 @@
#
# of course we need dlvhex itself!
#
-PKG_CHECK_MODULES([DLVHEX], [dlvhex >= 1.7])
+DLVHEX_REQUIRE([2.0.0])
# we need the crypt library for MD5 computation
AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"])
@@ -116,8 +117,8 @@
AC_ARG_ENABLE(userinstall,
[ --enable-userinstall Install plugin into home directory],
- [plugindir=$HOME/`pkg-config dlvhex --variable=userplugindir`],
- [plugindir=`pkg-config dlvhex --variable=sysplugindir`]
+ [plugindir=$HOME/$DLVHEX_USERPLUGINDIR],
+ [plugindir=$DLVHEX_SYSPLUGINDIR]
)
AC_SUBST([plugindir])
Added: dlvhex-mergingplugin/branches/release2x/m4/dlvhex.m4
===================================================================
--- dlvhex-mergingplugin/branches/release2x/m4/dlvhex.m4 (rev 0)
+++ dlvhex-mergingplugin/branches/release2x/m4/dlvhex.m4 2012-02-23 21:05:31 UTC (rev 3564)
@@ -0,0 +1,83 @@
+# dlvhex.m4: Locate dlvhex path, headers, and libraries for autoconf-based projects.
+# Copyright (C) 2012 Peter Schueller <ps...@kr...>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Original sources can be found in SVN of the SourceForge project of dlvhex
+# http://sourceforge.net/projects/dlvhex/
+
+# DLVHEX_REQUIRE([VERSION])
+# -----------------------------------------------
+# Look for dlvhex. Version must be a literal of the form "X.Y.Z".
+# Provides and uses configure argument --with-dlvhex2=<directory>
+# uses pkg-config
+# defines DLVHEX_USERPLUGINDIR (substituted in ".in" files)
+# defines DLVHEX_SYSPLUGINDIR (substituted in ".in" files)
+# defines DLVHEX_BINDIR (substituted in ".in" files)
+# If dlvhex cannot be found, aborts with an error message.
+AC_DEFUN([DLVHEX_REQUIRE],dnl
+[AC_ARG_WITH([dlvhex2],[dnl
+AS_HELP_STRING([--with-dlvhex2=DIR],dnl
+[prefix of where you installed dlvhex2 >= $1])])
+if test "x$with_dlvhex2" != "x"; then
+ export PKG_CONFIG_PATH="${with_dlvhex2}lib/pkgconfig/"
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],dnl
+["$DISTCHECK_CONFIGURE_FLAGS --with-dlvhex2=${with_dlvhex2}"])dnl
+fi
+PKG_CHECK_MODULES([DLVHEX],[dlvhex2 >= $1])
+_PKG_CONFIG([DLVHEX_USERPLUGINDIR],[variable=userplugindir],[dlvhex2 >= $1])
+_PKG_CONFIG([DLVHEX_SYSPLUGINDIR],[variable=sysplugindir],[dlvhex2 >= $1])
+_PKG_CONFIG([DLVHEX_BINDIR],[variable=bindir],[dlvhex2 >= $1])
+DLVHEX_USERPLUGINDIR=$pkg_cv_DLVHEX_USERPLUGINDIR
+DLVHEX_SYSPLUGINDIR=$pkg_cv_DLVHEX_SYSPLUGINDIR
+DLVHEX_BINDIR=$pkg_cv_DLVHEX_BINDIR
+AC_SUBST(DLVHEX_USERPLUGINDIR)
+AC_SUBST(DLVHEX_SYSPLUGINDIR)
+AC_SUBST(DLVHEX_BINDIR)
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $DLVHEX_CFLAGS"
+AC_CHECK_HEADER([dlvhex2/OnlineModelBuilder.h],,dnl
+[AC_MSG_ERROR([Cannot find dlvhex2 headers!])])
+CPPFLAGS="$SAFE_CPPFLAGS"
+])
+
+# DLVHEX_DEFINE_VERSION([PREFIX],[VERSION])
+# -----------------------------------------------
+# VERSION must be a literal of the form "X.Y.Z".
+# defines <PREFIX>_VERSION, <PREFIX>_VERSION_MAJOR,
+# <PREFIX>_VERSION_MINOR, <PREFIX>_VERSION_MICRO
+# (these are substituted in .in files and in config.h)
+AC_DEFUN([DLVHEX_DEFINE_VERSION],dnl
+[pushdef([NAME],[$1])
+NAME[_VERSION]="$2"
+NAME[_VERSION_MAJOR]=`echo "$2" |sed "s,^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\),\1,"`
+NAME[_VERSION_MINOR]=`echo "$2" |sed "s,^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\),\2,"`
+NAME[_VERSION_MICRO]=`echo "$2" |sed "s,^\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\),\3,"`
+AC_SUBST(NAME[_VERSION])
+AC_SUBST(NAME[_VERSION_MAJOR])
+AC_SUBST(NAME[_VERSION_MINOR])
+AC_SUBST(NAME[_VERSION_MICRO])
+AC_DEFINE_UNQUOTED(NAME[_VERSION],[$]NAME[_VERSION],[Version number of ]NAME)
+AC_DEFINE_UNQUOTED(NAME[_VERSION_MAJOR],[$]NAME[_VERSION_MAJOR],[Major version number of ]NAME)
+AC_DEFINE_UNQUOTED(NAME[_VERSION_MINOR],[$]NAME[_VERSION_MINOR],[Minor version number of ]NAME)
+AC_DEFINE_UNQUOTED(NAME[_VERSION_MICRO],[$]NAME[_VERSION_MICRO],[Micro version number of ]NAME)
+popdef([NAME])
+])
Modified: dlvhex-mergingplugin/branches/release2x/src/Makefile.am
===================================================================
--- dlvhex-mergingplugin/branches/release2x/src/Makefile.am 2012-02-23 14:57:27 UTC (rev 3563)
+++ dlvhex-mergingplugin/branches/release2x/src/Makefile.am 2012-02-23 21:05:31 UTC (rev 3564)
@@ -1,15 +1,15 @@
#
# replace 'plugin' on the right side by your plugin's name
#
-plugin_LTLIBRARIES = libdlvhexmerging.la
+plugin_LTLIBRARIES = libdlvhexplugin_merging.la
#
# replace 'plugin' on the left side as above and
# add all sources of your plugin
#
-libdlvhexmerging_la_SOURCES = MergingPlugin.cpp HexExecution.cpp HexAnswerCache.cpp Operators.cpp OpUnion.cpp OpSetminus.cpp
+libdlvhexplugin_merging_la_SOURCES = MergingPlugin.cpp HexExecution.cpp HexAnswerCache.cpp Operators.cpp OpUnion.cpp OpSetminus.cpp
# DLVHexProcess.cpp DlvhexSolver.cpp OpDalal.cpp OpDBO.cpp OpMajoritySelection.cpp OpRelationMerging.cpp
-libdlvhexmerging_la_LIBADD = $(CRYPTLIB) $(top_builddir)/mpcompiler/src/libmpcompiler.la
+libdlvhexplugin_merging_la_LIBADD = $(CRYPTLIB) $(top_builddir)/mpcompiler/src/libmpcompiler.la
#
# extend compiler flags by CFLAGS of other needed libraries
@@ -21,14 +21,14 @@
$(BOOST_CPPFLAGS) \
$(CRYPTLIB_CFLAGS)
-libdlvhexmerging_la_LDFLAGS = -avoid-version -module
+libdlvhexplugin_merging_la_LDFLAGS = -avoid-version -module
-libdlvhexmerging-static.la: $(libdlvhexmerging_la_OBJECTS)
- $(CXXLINK) -avoid-version -module -rpath $(plugindir) $(libdlvhexmerging_la_OBJECTS)
+libdlvhexplugin_merging-static.la: $(libdlvhexplugin_merging_la_OBJECTS)
+ $(CXXLINK) -avoid-version -module -rpath $(plugindir) $(libdlvhexplugin_merging_la_OBJECTS)
-install-static: libdlvhexmerging-static.la
- $(LIBTOOL) --mode=install $(INSTALL) -s libdlvhexmerging-static.la $(DESTDIR)$(plugindir)/libdlvhexmerging-static.la
+install-static: libdlvhexplugin_merging-static.la
+ $(LIBTOOL) --mode=install $(INSTALL) -s libdlvhexplugin_merging-static.la $(DESTDIR)$(plugindir)/libdlvhexplugin_merging-static.la
uninstall-static:
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/libdlvhexmerging-static.la
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/libdlvhexplugin_merging-static.la
Modified: dlvhex-mergingplugin/branches/release2x/src/MergingPlugin.cpp
===================================================================
--- dlvhex-mergingplugin/branches/release2x/src/MergingPlugin.cpp 2012-02-23 14:57:27 UTC (rev 3563)
+++ dlvhex-mergingplugin/branches/release2x/src/MergingPlugin.cpp 2012-02-23 21:05:31 UTC (rev 3564)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
//
// this include is necessary
//
@@ -437,10 +441,12 @@
} // namespace merging
} // namespace dlvhex
-
//
-// and let it be loaded by dlvhex!
+// let it be loaded by dlvhex!
//
+
+IMPLEMENT_PLUGINABIVERSIONFUNCTION
+
extern "C"
void*
PLUGINIMPORTFUNCTION()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|