Browse Source

xml: Statically build xml helper

Serj Kalichev 3 years ago
parent
commit
8bbfdb0f53
3 changed files with 16 additions and 1 deletions
  1. 1 1
      klish/kdb.h
  2. 1 0
      klish/kdb/Makefile.am
  3. 14 0
      klish/kdb/libxml2/libxml2_plugin.c

+ 1 - 1
klish/kdb.h

@@ -16,7 +16,7 @@
 // instead "%s". Consider db ID as an "internal native name". The "name"
 // field can differ from ID and it's just used within scheme to refer db.
 // Consider it as alias of ID.
-#define KDB_SONAME_FMT "libkdb_%s.so"
+#define KDB_SONAME_FMT "kdb_%s.so"
 
 // db's API version symbols
 #define KDB_MAJOR_FMT "kdb_%s_major"

+ 1 - 0
klish/kdb/Makefile.am

@@ -1,6 +1,7 @@
 lib_LTLIBRARIES += libklish-helper-xml.la
 libklish_helper_xml_la_SOURCES = \
 	klish/kdb/xml-common/load.c
+libklish_helper_xml_la_CFLAGS = $(AM_CFLAGS) -fPIC
 libklish_helper_xml_la_LDFLAGS = -static
 
 dbdir = ${pkglibdir}/db

+ 14 - 0
klish/kdb/libxml2/libxml2_plugin.c

@@ -6,3 +6,17 @@
 #include <faux/faux.h>
 #include <faux/str.h>
 #include <klish/kxml.h>
+#include <klish/kscheme.h>
+
+
+kscheme_t *kxml_load_scheme(const char *xml_path, faux_error_t *error);
+
+
+bool_t kdb_libxml2_init(void)
+{
+	kscheme_t *scheme = NULL;
+
+	scheme = kxml_load_scheme(NULL, NULL);
+scheme = scheme;
+	return BOOL_TRUE;
+}