summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-13 11:19:40 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-13 11:19:40 +0100
commit02a8661864a46f83287cf07320635743191b2b92 (patch)
treef2c58baa0af0289a0e9e93c54459de3a23eb6682
parent99db593250aa02e957135966f501c8a49d33513f (diff)
Rework build, move libconf to lib folder.
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac18
-rw-r--r--src/bin/Makefile.mk5
-rw-r--r--src/bin/conf.c2
-rw-r--r--src/bin/rules.c2
-rw-r--r--src/include/Conf.h (renamed from src/bin/libconf.h)0
-rw-r--r--src/lib/Makefile.mk10
-rw-r--r--src/lib/conf.c (renamed from src/bin/libconf.c)8
8 files changed, 33 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am
index 383318b..7ec174e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,8 +53,9 @@ debian/stamp*
53EXTRA_DIST = 53EXTRA_DIST =
54 54
55bin_PROGRAMS = 55bin_PROGRAMS =
56BIN_CPPFLAGS = -I$(top_srcdir) 56EXTRA_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/include/
57 57
58include src/lib/Makefile.mk
58include src/bin/Makefile.mk 59include src/bin/Makefile.mk
59 60
60.PHONY: doc 61.PHONY: doc
diff --git a/configure.ac b/configure.ac
index 7c59dc7..aaec67f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ m4_define([v_min], [0])
3m4_define([v_mic], [1]) 3m4_define([v_mic], [1])
4m4_define([v_ver], [v_maj.v_min.v_mic]) 4m4_define([v_ver], [v_maj.v_min.v_mic])
5 5
6AC_INIT([smman], [v_ver], [guillaume.friloux@aspfrance.com]) 6AC_INIT([smman], [v_ver], [kuri@efl.so])
7 7
8AC_PREREQ(2.01) 8AC_PREREQ(2.01)
9AC_CONFIG_SRCDIR([configure.ac]) 9AC_CONFIG_SRCDIR([configure.ac])
@@ -46,8 +46,17 @@ Makefile
46doc/Makefile 46doc/Makefile
47]) 47])
48 48
49BIN_REQUIRES="eina ecore ecore-file libcurl" 49build_libs=
50PKG_CHECK_MODULES(BIN, [$BIN_REQUIRES], [build_smman=yes], [build_smman=no]) 50LIBS_REQUIRES="eina"
51PKG_CHECK_MODULES(LIBS, [$LIBS_REQUIRES], [build_libs=yes], [build_libs=no])
52
53build_smman=
54if test "x${build_libs}" = "xyes"; then
55 BIN_REQUIRES="eina ecore ecore-file libcurl"
56 PKG_CHECK_MODULES(BIN, [$BIN_REQUIRES], [build_smman=yes], [build_smman=no])
57else
58 build_smman=no
59fi
51 60
52AC_DEFINE(_LARGEFILE64_SOURCE, 1, "Needed for 64 bit on 32") 61AC_DEFINE(_LARGEFILE64_SOURCE, 1, "Needed for 64 bit on 32")
53AC_DEFINE(_LARGEFILE_SOURCE, 1, "Needed for 64 bit on 32") 62AC_DEFINE(_LARGEFILE_SOURCE, 1, "Needed for 64 bit on 32")
@@ -69,7 +78,8 @@ echo "------------------------------------------------------------------------"
69echo 78echo
70echo "Configuration Options Summary:" 79echo "Configuration Options Summary:"
71echo 80echo
72echo " deps.........: ${build_smman}" 81echo " libs.........: ${build_libs}"
82echo " smman........: ${build_smman}"
73echo " prefix.......: ${prefix}" 83echo " prefix.......: ${prefix}"
74echo " tests........: ${enable_tests} (Coverage: ${efl_enable_coverage})" 84echo " tests........: ${enable_tests} (Coverage: ${efl_enable_coverage})"
75echo 85echo
diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk
index 0246c79..3767425 100644
--- a/src/bin/Makefile.mk
+++ b/src/bin/Makefile.mk
@@ -7,12 +7,13 @@ src/bin/smman
7src_bin_smman_SOURCES = \ 7src_bin_smman_SOURCES = \
8src/bin/conf.c \ 8src/bin/conf.c \
9src/bin/utils.c \ 9src/bin/utils.c \
10src/bin/libconf.c \
11src/bin/logfiles.c \ 10src/bin/logfiles.c \
12src/bin/logmessages.c \ 11src/bin/logmessages.c \
13src/bin/main.c \ 12src/bin/main.c \
14src/bin/rules.c \ 13src/bin/rules.c \
15src/bin/send.c \ 14src/bin/send.c \
16src/bin/spy.c 15src/bin/spy.c
17src_bin_smman_CPPFLAGS = @BIN_CFLAGS@ 16src_bin_smman_CPPFLAGS = @BIN_CFLAGS@ $(EXTRA_CPPFLAGS)
18src_bin_smman_LDFLAGS = @BIN_LIBS@ 17src_bin_smman_LDFLAGS = @BIN_LIBS@
18src_bin_smman_LDADD = \
19src/lib/libconf.la
diff --git a/src/bin/conf.c b/src/bin/conf.c
index 8b65a1a..cae7e9a 100644
--- a/src/bin/conf.c
+++ b/src/bin/conf.c
@@ -17,7 +17,7 @@
17 */ 17 */
18 18
19#include "smman.h" 19#include "smman.h"
20#include "libconf.h" 20#include <Conf.h>
21 21
22/** 22/**
23 * @brief This function will init libconf and ask to load our configuration 23 * @brief This function will init libconf and ask to load our configuration
diff --git a/src/bin/rules.c b/src/bin/rules.c
index 34fc8b7..fe3c6f5 100644
--- a/src/bin/rules.c
+++ b/src/bin/rules.c
@@ -17,7 +17,7 @@
17 */ 17 */
18 18
19#include "smman.h" 19#include "smman.h"
20#include "libconf.h" 20#include <Conf.h>
21 21
22struct rule *rules_temp; /**< Pointer to a rule, used so rules_load_rule_loadspec() knowns which rule rules_load_rule() is processing */ 22struct rule *rules_temp; /**< Pointer to a rule, used so rules_load_rule_loadspec() knowns which rule rules_load_rule() is processing */
23 23
diff --git a/src/bin/libconf.h b/src/include/Conf.h
index d26a4a2..d26a4a2 100644
--- a/src/bin/libconf.h
+++ b/src/include/Conf.h
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk
new file mode 100644
index 0000000..a4e2945
--- /dev/null
+++ b/src/lib/Makefile.mk
@@ -0,0 +1,10 @@
1MAINTAINERCLEANFILES += src/lib/*.gc{no,da}
2
3noinst_LTLIBRARIES = \
4src/lib/libconf.la
5
6src_lib_libconf_la_SOURCES = \
7src/lib/conf.c \
8src/include/Conf.h
9src_lib_libconf_la_CFLAGS = $(LIBS_CFLAGS) $(EXTRA_CPPFLAGS)
10src_lib_libconf_la_LDFLAGS = $(LIBS_CFLAGS)
diff --git a/src/bin/libconf.c b/src/lib/conf.c
index 0be5eba..acca01e 100644
--- a/src/bin/libconf.c
+++ b/src/lib/conf.c
@@ -65,10 +65,9 @@
65 * @verbatim gcc -o main main.c `pkg-config --cflags libconf` `pkg-config --libs libconf` `pkg-config --cflags eina` @endverbatim 65 * @verbatim gcc -o main main.c `pkg-config --cflags libconf` `pkg-config --libs libconf` `pkg-config --cflags eina` @endverbatim
66 * @verbatim EINA_LOG_LEVEL=5 ./main /etc/docupack.conf@endverbatim 66 * @verbatim EINA_LOG_LEVEL=5 ./main /etc/docupack.conf@endverbatim
67 */ 67 */
68#include "libconf.h" 68#include <Conf.h>
69 69
70/** 70/**
71 * \fn int libconfig_init(char *file, struct libconfig *myconf)
72 * \brief Inits lib. 71 * \brief Inits lib.
73 * 72 *
74 * \param file full path to configuration file 73 * \param file full path to configuration file
@@ -80,7 +79,7 @@ int libconfig_init(char *file, struct libconfig *myconf)
80 strcpy(myconf->file, file); 79 strcpy(myconf->file, file);
81 myconf->lconfig = NULL; 80 myconf->lconfig = NULL;
82 81
83 ligconfig_einadom = eina_log_domain_register("Libconf", EINA_COLOR_ORANGE); 82 ligconfig_einadom = eina_log_domain_register("Libconf", EINA_COLOR_ORANGE);
84 83
85 EINA_LOG_DOM_DBG(ligconfig_einadom, "Using configuration file %s", myconf->file); 84 EINA_LOG_DOM_DBG(ligconfig_einadom, "Using configuration file %s", myconf->file);
86 85
@@ -89,7 +88,6 @@ int libconfig_init(char *file, struct libconfig *myconf)
89 88
90 89
91/** 90/**
92 * \fn int libconfig_load(struct libconfig *myconf)
93 * \brief Loads configuration file to store every variable into our Eina list 91 * \brief Loads configuration file to store every variable into our Eina list
94 * 92 *
95 * \param myconf Pointer to a libconfig structure 93 * \param myconf Pointer to a libconfig structure
@@ -178,7 +176,6 @@ int libconfig_load(struct libconfig *myconf)
178} 176}
179 177
180/** 178/**
181 * \fn int libconfig_list(struct libconfig *myconf, int (*callback_function)(char *variable, char *value))
182 * \brief Will send to a callback every entry of the Eina list 179 * \brief Will send to a callback every entry of the Eina list
183 * 180 *
184 * \param myconf Pointer to a libconfig structure 181 * \param myconf Pointer to a libconfig structure
@@ -197,7 +194,6 @@ int libconfig_list(struct libconfig *myconf, int (*callback_function)(char *vari
197} 194}
198 195
199/** 196/**
200 * \fn int libconfig_free(struct libconfig *myconf)
201 * \brief Will free our eina list 197 * \brief Will free our eina list
202 * 198 *
203 * \param myconf Pointer to a libconfig structure 199 * \param myconf Pointer to a libconfig structure