|
From: <chr...@us...> - 2012-02-23 21:05:46
|
Revision: 3565
http://dlvhex.svn.sourceforge.net/dlvhex/?rev=3565&view=rev
Author: chrisr86
Date: 2012-02-23 21:05:40 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
fix ABI version function
Modified Paths:
--------------
dlvhex-dlplugin/branches/release2x/configure.ac
dlvhex-dlplugin/branches/release2x/include/RacerInterface.h
dlvhex-dlplugin/branches/release2x/src/Makefile.am
dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp
Added Paths:
-----------
dlvhex-dlplugin/branches/release2x/m4/dlvhex.m4
Modified: dlvhex-dlplugin/branches/release2x/configure.ac
===================================================================
--- dlvhex-dlplugin/branches/release2x/configure.ac 2012-02-23 21:05:31 UTC (rev 3564)
+++ dlvhex-dlplugin/branches/release2x/configure.ac 2012-02-23 21:05:40 UTC (rev 3565)
@@ -1,16 +1,14 @@
-AC_PREREQ([2.61])
-AC_INIT([dlvhex-dlplugin],[1.7.1],[tk...@kr...])
+AC_PREREQ([2.68])
+AC_INIT([dlvhex-dlplugin],[2.0.0],[tk...@kr...])
AC_CONFIG_SRCDIR([src/RacerInterface.cpp])
-AC_CONFIG_HEADER([src/config.h])
+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([DLPLUGIN],[$PACKAGE_VERSION])
+DLVHEX_DEFINE_VERSION([DLVHEX_ABI],[7.0.0])
-AC_DEFINE_UNQUOTED([DLPLUGIN_MAJOR], [$MAJOR], [Major version number of the dl-plugin])
-AC_DEFINE_UNQUOTED([DLPLUGIN_MINOR], [$MINOR], [Minor version number of the dl-plugin])
-AC_DEFINE_UNQUOTED([DLPLUGIN_MICRO], [$MICRO], [Micro version number of the dl-plugin])
-
#
# the user didn't supply a path for Racer
#
@@ -33,6 +31,8 @@
AM_INIT_AUTOMAKE
+AC_CANONICAL_HOST
+
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
@@ -50,11 +50,22 @@
AC_HEADER_STDC
AC_HEADER_TIME
+# Checks for programs.
+AC_PROG_CXX
+AC_LANG([C++])
+
+# Checks for header files.
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS([sys/param.h])
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
# Checks for libtool library functions.
+_LT_SET_OPTION([LT_INIT],[dlopen])
+AC_DIAGNOSE([obsolete],[AC_LIBTOOL_DLOPEN: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
AC_LIBTOOL_WIN32_DLL # enable win32 dll-building support
AC_LIBTOOL_DLOPEN # we build a module library
AC_DISABLE_STATIC # we don't need a static library
@@ -79,7 +90,7 @@
# we want dlvhex
-PKG_CHECK_MODULES([DLVHEX], [dlvhex >= 1.7])
+DLVHEX_REQUIRE([2.0.0])
# cppunit is optional -> give warning in ACTION-IF-NOT-FOUND
PKG_CHECK_MODULES([CPPUNIT], [cppunit >= 1.12.0], [have_cppunit=true], [have_cppunit=false])
@@ -117,8 +128,8 @@
AC_ARG_ENABLE(userinstall,
[ --enable-userinstall Install plugin into home directory],
- [dlvhexlibdir=$HOME/`pkg-config dlvhex --variable=userplugindir`],
- [dlvhexlibdir=`pkg-config dlvhex --variable=sysplugindir`]
+ [dlvhexlibdir=$HOME/$DLVHEX_USERPLUGINDIR],
+ [dlvhexlibdir=$DLVHEX_SYSPLUGINDIR]
)
AC_SUBST([dlvhexlibdir])
Modified: dlvhex-dlplugin/branches/release2x/include/RacerInterface.h
===================================================================
--- dlvhex-dlplugin/branches/release2x/include/RacerInterface.h 2012-02-23 21:05:31 UTC (rev 3564)
+++ dlvhex-dlplugin/branches/release2x/include/RacerInterface.h 2012-02-23 21:05:40 UTC (rev 3565)
@@ -185,10 +185,11 @@
* instantiates the RacerInterface singleton. Used as import function
* when loading the plugin as shared library.
*/
-extern "C" DLVHEX_NAMESPACE PluginInterface*
-PLUGINIMPORTFUNCTION();
+//extern "C" DLVHEX_NAMESPACE PluginInterface*
+//PLUGINIMPORTFUNCTION();
+extern "C"
+void * PLUGINIMPORTFUNCTION();
-
#endif /* _RACERINTERFACE_H */
Added: dlvhex-dlplugin/branches/release2x/m4/dlvhex.m4
===================================================================
--- dlvhex-dlplugin/branches/release2x/m4/dlvhex.m4 (rev 0)
+++ dlvhex-dlplugin/branches/release2x/m4/dlvhex.m4 2012-02-23 21:05:40 UTC (rev 3565)
@@ -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-dlplugin/branches/release2x/src/Makefile.am
===================================================================
--- dlvhex-dlplugin/branches/release2x/src/Makefile.am 2012-02-23 21:05:31 UTC (rev 3564)
+++ dlvhex-dlplugin/branches/release2x/src/Makefile.am 2012-02-23 21:05:40 UTC (rev 3565)
@@ -1,5 +1,5 @@
-dlvhexlib_LTLIBRARIES = libdlvhexracer.la
-libdlvhexracer_la_SOURCES = \
+dlvhexlib_LTLIBRARIES = libdlvhexplugin_racer.la
+libdlvhexplugin_racer_la_SOURCES = \
Answer.cpp \
AtomSeparator.cpp \
Cache.cpp \
@@ -49,11 +49,11 @@
$(RAPTOR_CFLAGS) \
$(DLVHEX_CFLAGS)
-# -avoid-version: only create libdlvhexracer.so
+# -avoid-version: only create libdlvhexplugin_racer.so
# -module: library will be dlopened
# -no-undefined: windows dlls don't allow undefined external symbols
#libdlvhexracer_la_LDFLAGS = -avoid-version -module -no-undefined $(RAPTOR_LIBS)
-libdlvhexracer_la_LDFLAGS = -avoid-version -module $(RAPTOR_LIBS)
+libdlvhexplugin_racer_la_LDFLAGS = -avoid-version -module $(RAPTOR_LIBS)
#
# adapt path and dependency libraries as needed
@@ -61,11 +61,11 @@
RAPTOR_PATH = $(HOME)/local/lib
RAPTOR_STATIC_LIBS = -lxml2 -lxslt -lcurl $(RAPTOR_PATH)/libraptor.a
-libdlvhexracer-static.la: $(libdlvhexracer_la_OBJECTS)
- $(CXXLINK) -avoid-version -module -rpath $(dlvhexlibdir) $(libdlvhexracer_la_OBJECTS) $(RAPTOR_STATIC_LIBS)
+libdlvhexplugin_racer-static.la: $(libdlvhexplugin_racer_la_OBJECTS)
+ $(CXXLINK) -avoid-version -module -rpath $(dlvhexlibdir) $(libdlvhexplugin_racer_la_OBJECTS) $(RAPTOR_STATIC_LIBS)
-install-static: libdlvhexracer-static.la
- $(LIBTOOL) --mode=install $(INSTALL) -s libdlvhexracer-static.la $(DESTDIR)$(dlvhexlibdir)/libdlvhexracer-static.la
+install-static: libdlvhexplugin_racer-static.la
+ $(LIBTOOL) --mode=install $(INSTALL) -s libdlvhexplugin_racer-static.la $(DESTDIR)$(dlvhexlibdir)/libdlvhexplugin_racer-static.la
uninstall-static:
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(dlvhexlibdir)/libdlvhexracer-static.la
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(dlvhexlibdir)/libdlvhexplugin_racer-static.la
Modified: dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp
===================================================================
--- dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp 2012-02-23 21:05:31 UTC (rev 3564)
+++ dlvhex-dlplugin/branches/release2x/src/RacerInterface.cpp 2012-02-23 21:05:40 UTC (rev 3565)
@@ -446,14 +446,23 @@
} // namespace dl
} // namespace dlvhex
+//
+// let it be loaded by dlvhex!
+//
-extern "C" DLVHEX_NAMESPACE PluginInterface*
-PLUGINIMPORTFUNCTION()
+IMPLEMENT_PLUGINABIVERSIONFUNCTION
+
+//extern "C" DLVHEX_NAMESPACE PluginInterface*
+//PLUGINIMPORTFUNCTION()
+//{
+// return dlvhex::dl::racer::RacerInterface::instance();
+//}
+extern "C"
+void * PLUGINIMPORTFUNCTION()
{
- return dlvhex::dl::racer::RacerInterface::instance();
+ return reinterpret_cast<void*>(dlvhex::dl::racer::RacerInterface::instance());
}
-
// Local Variables:
// mode: C++
// End:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|