From 51e59f6845c03ee5579bb815b6011bf70424ec06 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Wed, 31 Mar 2010 20:47:26 +0000
Subject: [PATCH] mods to make symbols visible from the db api, not totally
 working yet

---
 src/common/slurm_protocol_defs.c                           | 7 +++++++
 src/common/slurm_xlator.h                                  | 3 +++
 src/db_api/Makefile.am                                     | 3 ++-
 src/db_api/Makefile.in                                     | 5 ++---
 src/db_api/extra_get_functions.c                           | 5 +++++
 .../slurmdbd/accounting_storage_slurmdbd.c                 | 6 ++++++
 6 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c
index 8b3e3ffa1bd..c2b4f1be311 100644
--- a/src/common/slurm_protocol_defs.c
+++ b/src/common/slurm_protocol_defs.c
@@ -63,6 +63,13 @@
 #include "src/plugins/select/bluegene/wrap_rm_api.h"
 #endif
 
+/*
+** Define slurm-specific aliases for use by plugins, see slurm_xlator.h
+** for details.
+ */
+strong_alias(conn_type_string,	slurm_conn_type_string);
+
+
 static void _free_all_job_info (job_info_msg_t *msg);
 
 static void _free_all_node_info (node_info_msg_t *msg);
diff --git a/src/common/slurm_xlator.h b/src/common/slurm_xlator.h
index 32ad06e6bf2..4899c156dee 100644
--- a/src/common/slurm_xlator.h
+++ b/src/common/slurm_xlator.h
@@ -290,6 +290,9 @@
 #define	xstrdup			slurm_xstrdup
 #define	xbasename		slurm_xbasename
 
+/* slurm_protocol_defs.[ch] functions */
+#define conn_type_string	slurm_conn_type_string
+
 #endif /* USE_ALIAS */
 
 /* Include the function definitions after redefining their names. */
diff --git a/src/db_api/Makefile.am b/src/db_api/Makefile.am
index 86926fb221b..c889f15e03c 100644
--- a/src/db_api/Makefile.am
+++ b/src/db_api/Makefile.am
@@ -62,7 +62,8 @@ libslurmdb_la_SOURCES =	\
 	user_functions.c \
 	user_report_functions.c \
 	wckey_functions.c
-libslurmdb_la_LIBADD = $(top_builddir)/src/api/libslurmhelper.la
+
+libslurmdb_la_LIBADD = $(top_builddir)/src/common/libcommon.la
 libslurmdb_la_LDFLAGS        = \
         $(LIB_LDFLAGS) \
         -version-info $(current):$(rev):$(age) \
diff --git a/src/db_api/Makefile.in b/src/db_api/Makefile.in
index 6c89bb4b5dc..b7b1c1bb948 100644
--- a/src/db_api/Makefile.in
+++ b/src/db_api/Makefile.in
@@ -104,8 +104,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(libdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libslurmdb_la_DEPENDENCIES =  \
-	$(top_builddir)/src/api/libslurmhelper.la
+libslurmdb_la_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la
 am_libslurmdb_la_OBJECTS = account_functions.lo archive_functions.lo \
 	assoc_functions.lo cluster_functions.lo \
 	cluster_report_functions.lo coord_functions.lo \
@@ -377,7 +376,7 @@ libslurmdb_la_SOURCES = \
 	user_report_functions.c \
 	wckey_functions.c
 
-libslurmdb_la_LIBADD = $(top_builddir)/src/api/libslurmhelper.la
+libslurmdb_la_LIBADD = $(top_builddir)/src/common/libcommon.la
 libslurmdb_la_LDFLAGS = \
         $(LIB_LDFLAGS) \
         -version-info $(current):$(rev):$(age) \
diff --git a/src/db_api/extra_get_functions.c b/src/db_api/extra_get_functions.c
index bd256d97314..42e78ceac55 100644
--- a/src/db_api/extra_get_functions.c
+++ b/src/db_api/extra_get_functions.c
@@ -49,6 +49,11 @@
 
 #include "src/common/slurm_accounting_storage.h"
 
+extern void defines()
+{
+	verbose("");
+}
+
 /*
  * get info from the storage
  * RET: List of config_key_pairs_t *
diff --git a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
index a71b30658ee..711b8117a04 100644
--- a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
+++ b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
@@ -61,6 +61,12 @@
 #include "src/common/xstring.h"
 #include "src/slurmctld/slurmctld.h"
 
+/* These are defined here so when we link with something other than
+ * the slurmctld we will have these symbols defined.  They will get
+ * overwritten when linking with the slurmctld.
+ */
+slurm_ctl_conf_t slurmctld_conf;
+
 /*
  * These variables are required by the generic plugin interface.  If they
  * are not found in the plugin, the plugin loader will ignore it.
-- 
GitLab