allow tmakatos (a binary) emitter to be statically compiled
It is trivial to implement static compilation of the rest of the 3rd party emitters.
This commit is contained in:
parent
35cfc3b90a
commit
431f2ab50a
14
Makefile.in
14
Makefile.in
@ -92,7 +92,6 @@ SOURCE=\
|
|||||||
thin-provisioning/restore_emitter.cc \
|
thin-provisioning/restore_emitter.cc \
|
||||||
thin-provisioning/rmap_visitor.cc \
|
thin-provisioning/rmap_visitor.cc \
|
||||||
thin-provisioning/superblock.cc \
|
thin-provisioning/superblock.cc \
|
||||||
thin-provisioning/shared_library_emitter.cc \
|
|
||||||
thin-provisioning/thin_check.cc \
|
thin-provisioning/thin_check.cc \
|
||||||
thin-provisioning/thin_delta.cc \
|
thin-provisioning/thin_delta.cc \
|
||||||
thin-provisioning/thin_dump.cc \
|
thin-provisioning/thin_dump.cc \
|
||||||
@ -119,10 +118,23 @@ ifeq ("@DEVTOOLS@", "yes")
|
|||||||
SOURCE+=$(DEVTOOLS_SOURCE)
|
SOURCE+=$(DEVTOOLS_SOURCE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ("@STATIC@", "yes")
|
||||||
|
SOURCE += thin-provisioning/static_library_emitter.cc
|
||||||
|
else
|
||||||
|
SOURCE += thin-provisioning/shared_library_emitter.cc
|
||||||
|
endif
|
||||||
|
|
||||||
CC:=@CC@
|
CC:=@CC@
|
||||||
CXX:=@CXX@
|
CXX:=@CXX@
|
||||||
STRIP:=@STRIP@
|
STRIP:=@STRIP@
|
||||||
OBJECTS:=$(subst .cc,.o,$(SOURCE))
|
OBJECTS:=$(subst .cc,.o,$(SOURCE))
|
||||||
|
|
||||||
|
# FIXME OBJECTS += $(PLUGIN_LIBS) doesn't work, probably because it's empty at
|
||||||
|
# the time of use?
|
||||||
|
ifeq ("@STATIC@", "yes")
|
||||||
|
OBJECTS += contrib/*.a
|
||||||
|
endif
|
||||||
|
|
||||||
TOP_DIR:=@top_srcdir@
|
TOP_DIR:=@top_srcdir@
|
||||||
TOP_BUILDDIR:=@top_builddir@
|
TOP_BUILDDIR:=@top_builddir@
|
||||||
CFLAGS+=-g -Wall -O3 -fPIC
|
CFLAGS+=-g -Wall -O3 -fPIC
|
||||||
|
22
thin-provisioning/static_library_emitter.cc
Normal file
22
thin-provisioning/static_library_emitter.cc
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "thin-provisioning/shared_library_emitter.h"
|
||||||
|
#include <stdexcept>
|
||||||
|
#include "contrib/tmakatos_emitter.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace thin_provisioning;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
|
emitter::ptr
|
||||||
|
thin_provisioning::create_custom_emitter(string const &shared_lib, ostream &out)
|
||||||
|
{
|
||||||
|
if (shared_lib != "tmakatos_emitter.so")
|
||||||
|
throw runtime_error(shared_lib + ": no such emitter");
|
||||||
|
|
||||||
|
cout << "XXX creating tmakatos_emitter" << endl;
|
||||||
|
cout << flush;
|
||||||
|
|
||||||
|
return emitter::ptr(new tmakatos_emitter::binary_emitter(out));
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------
|
Loading…
x
Reference in New Issue
Block a user