summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-02-12 18:34:03 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-02-17 21:17:47 +0100
commitc93bd1b81b7c7b108911db49b011da8ff5f43057 (patch)
treed779b1ff69b66eb96641d3b4c9d3cfcb72dfdccf /src/static_libs
parentc8f32bd770574efebc200fc707a92fe1e0ba3718 (diff)
Introduction of buildtools!
buildtool is a little static library for the abstraction of buildtool depedend path generation.
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/buildsystem/buildsystem.h24
-rw-r--r--src/static_libs/buildsystem/buildsystem_autotools.c50
2 files changed, 74 insertions, 0 deletions
diff --git a/src/static_libs/buildsystem/buildsystem.h b/src/static_libs/buildsystem/buildsystem.h
new file mode 100644
index 0000000..5312fa8
--- /dev/null
+++ b/src/static_libs/buildsystem/buildsystem.h
@@ -0,0 +1,24 @@
1/*
2 * A little helper library for abstracting the path finding which depends on autotools (or later on other buildsystems)
3 *
4 * Author: Marcel Hollerbach
5 */
6#include <stdio.h>
7#include <Eina.h>
8
9/*
10 * Fills the provided buffer with the path to the binary of a given subsystem
11 */
12Eina_Bool bs_binary_get(char *path, size_t maxlen, const char *subsystem, const char *bin_name);
13
14/*
15 * Fills the provided buffer with the path to the data file/dir of a given subsystem
16 */
17Eina_Bool bs_data_path_get(char *path, size_t maxlen, const char *subsystem, const char *file);
18
19/*
20 * Fills the provided buffer with the path to the .so file for modules of a given subsystem
21 */
22Eina_Bool bs_mod_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name);
23
24Eina_Bool bs_mod_dir_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name);
diff --git a/src/static_libs/buildsystem/buildsystem_autotools.c b/src/static_libs/buildsystem/buildsystem_autotools.c
new file mode 100644
index 0000000..83d8c1f
--- /dev/null
+++ b/src/static_libs/buildsystem/buildsystem_autotools.c
@@ -0,0 +1,50 @@
1#ifdef _WIN32
2# define BIN_EXT ".exe"
3#else
4# define BIN_EXT ""
5#endif
6
7#include "config.h"
8
9#include <stdio.h>
10#include <Eina.h>
11
12Eina_Bool
13bs_mod_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name)
14{
15 if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
16
17 snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/modules/%s/%s/.libs/module"SHARED_LIB_SUFFIX, subsystem, mod_name);
18
19 return EINA_TRUE;
20}
21
22Eina_Bool
23bs_mod_dir_get(char *path, size_t maxlen, const char *subsystem, const char *mod_name)
24{
25 if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
26
27 snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/modules/%s/%s/.libs", subsystem, mod_name);
28
29 return EINA_TRUE;
30}
31
32Eina_Bool
33bs_binary_get(char *path, size_t maxlen, const char *subsystem, const char *bin_name)
34{
35 if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
36
37 snprintf(path, maxlen, PACKAGE_BUILD_DIR"/src/bin/%s/%s"BIN_EXT, subsystem, bin_name);
38
39 return EINA_TRUE;
40}
41
42Eina_Bool
43bs_data_path_get(char *path, size_t maxlen, const char *subsystem, const char *file)
44{
45 if (!getenv("EFL_RUN_IN_TREE")) return EINA_FALSE;
46
47 snprintf(path, maxlen, PACKAGE_SRC_DIR"/data/%s/%s", subsystem, file);
48
49 return EINA_TRUE;
50}