Adding the REST Feature as a Library Called by an OEM Table
The CONNECT storage engine has been deprecated.
$ sudo ln -s /..path to../ha_connect.so /usr/lib64/libconnect.so$ makdir oem
$ cd oem
$ makedir Release
$ make -f oemrest.mak
$ sudo cp rest.so /usr/local/mysql/lib/plugin#LINUX
CPP = g++
LD = g++
OD = ./Release/
SD = /home/olivier/MariaDB/server/storage/connect/
CD =/usr/lib64
# flags to compile object files that can be used in a dynamic library
CFLAGS= -Wall -c -O3 -std=c++11 -fPIC -fno-rtti -I$(SD) -DXML_SUPPORT
# Replace -03 by -g for debug
LDFLAGS = -L$(CD) -lcpprest -lconnect
# Flags to create a dynamic library.
DYNLINKFLAGS = -shared
# on some platforms, use '-G' instead.
# REST library's archive file
OEMREST = rest.so
SRCS_CPP = $(SD)tabrest.cpp $(SD)restget.cpp
OBJS_CPP = $(OD)tabrest.o $(OD)restget.o
# top-level rule
all: $(OEMREST)
$(OEMREST): $(OBJS_CPP)
$(LD) $(OBJS_CPP) $(LDFLAGS) $(DYNLINKFLAGS) -o $@
#CPP Source files
$(OD)tabrest.o: $(SD)tabrest.cpp $(SD)mini-global.h $(SD)global.h $(SD)plgdbsem.h $(SD)xtable.h $(SD)filamtxt.h $(SD)plgxml.h $(SD)tabdos.h $(SD)tabfmt.h $(SD)tabjson.h $(SD)tabrest.h $(SD)tabxml.h
$(CPP) $(CFLAGS) -o $@ $(SD)$(*F).cpp
$(OD)restget.o: $(SD)restget.cpp $(SD)mini-global.h $(SD)global.h
$(CPP) $(CFLAGS) -o $@ $(SD)$(*F).cpp
# clean everything
clean:
$(RM) $(OBJS_CPP) $(OEMREST)Last updated
Was this helpful?

