aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libraries/LumbrJack.c (renamed from libraries/LumbrJack.c)0
-rw-r--r--src/libraries/LumbrJack.h (renamed from libraries/LumbrJack.h)0
-rw-r--r--src/libraries/Runnr.c (renamed from libraries/Runnr.c)0
-rw-r--r--src/libraries/Runnr.h (renamed from libraries/Runnr.h)0
-rw-r--r--src/libraries/SledjHamr.c23
-rw-r--r--src/libraries/SledjHamr.h14
-rwxr-xr-xsrc/libraries/build.lua33
7 files changed, 70 insertions, 0 deletions
diff --git a/libraries/LumbrJack.c b/src/libraries/LumbrJack.c
index 084d916..084d916 100644
--- a/libraries/LumbrJack.c
+++ b/src/libraries/LumbrJack.c
diff --git a/libraries/LumbrJack.h b/src/libraries/LumbrJack.h
index 4a3290c..4a3290c 100644
--- a/libraries/LumbrJack.h
+++ b/src/libraries/LumbrJack.h
diff --git a/libraries/Runnr.c b/src/libraries/Runnr.c
index a24e7f5..a24e7f5 100644
--- a/libraries/Runnr.c
+++ b/src/libraries/Runnr.c
diff --git a/libraries/Runnr.h b/src/libraries/Runnr.h
index dc720ff..dc720ff 100644
--- a/libraries/Runnr.h
+++ b/src/libraries/Runnr.h
diff --git a/src/libraries/SledjHamr.c b/src/libraries/SledjHamr.c
new file mode 100644
index 0000000..aa68774
--- /dev/null
+++ b/src/libraries/SledjHamr.c
@@ -0,0 +1,23 @@
1#include "SledjHamr.h"
2
3void HamrTime(void *elm_main, char *domain)
4{
5 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
6 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
7 elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR);
8 elm_app_compile_locale_set(PACKAGE_LOCALE_DIR);
9 // Do this after the above calls, but before changing the working directory, or screwing with argv[0].
10 // It tries to set up the package paths depending on where the executable is, so things are relocatable.
11 // First argument is the elm_main() function that Elementary starts us from.
12 // Second argument should be a lower case string used as the "domain", which is different from the log domain.
13 // It's used lower case as part of the data directory path.
14 // So, if prefix is /usr/local, then the system data dir is /usr/local/share,
15 // and this apps data dir is /usr/local/share/"domain".
16 // It's used upper case as part of environment variables to override directory paths at run time.
17 // So "DOMAIN"_PREFIX, "DOMAIN"_BIN_DIR, "DOMAIN"_LIB_DIR, "DOMAIN"_DATA_DIR, and "DOMAIN"_LOCALE_DIR
18 // Third argument is the name of a file it can check for to make sure it found the correct path.
19 // This file is looked for in the data dir.
20 elm_app_info_set(elm_main, domain, "checkme.txt");
21 // Once this is all setup, the code can do -
22 // elm_app_prefix_dir_get(); // or bin, lib, data, locale.
23}
diff --git a/src/libraries/SledjHamr.h b/src/libraries/SledjHamr.h
new file mode 100644
index 0000000..893d90e
--- /dev/null
+++ b/src/libraries/SledjHamr.h
@@ -0,0 +1,14 @@
1
2#define EFL_API_OVERRIDE 1
3/* Enable access to unstable EFL API that are still in beta */
4#define EFL_BETA_API_SUPPORT 1
5/* Enable access to unstable EFL EO API. */
6#define EFL_EO_API_SUPPORT 1
7
8#include <stdio.h>
9#include <ctype.h>
10
11#include <Elementary.h>
12
13
14void HamrTime(void *elm_main, char *domain);
diff --git a/src/libraries/build.lua b/src/libraries/build.lua
new file mode 100755
index 0000000..6566e66
--- /dev/null
+++ b/src/libraries/build.lua
@@ -0,0 +1,33 @@
1#!/usr/bin/env lua
2
3local dir = ...
4
5if 'nil' == type(dir) then
6 local build, err = loadfile('../../build.lua')
7 if build then
8 setfenv(build, getfenv(2))
9 build(2)
10 else
11 print("ERROR - " .. err)
12 end
13 dir = workingDir
14end
15
16LDFLAGS = '-L ' .. dir .. ' ' .. LDFLAGS
17
18removeFiles(dir, {'LumbrJack.o', lib_d .. '/libLumbrJack.so', 'Runnr.o', lib_d .. '/libRunnr.so', 'SledjHamr.o', lib_d .. '/libSledjHamr.so'})
19
20runCommand('C libraries', dir, 'gcc ' .. CFLAGS .. ' -fPIC -c LumbrJack.c')
21runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libLumbrJack.so -o ' .. lib_d .. '/libLumbrJack.so LumbrJack.o')
22
23runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -fPIC -c Runnr.c')
24runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libRunnr.so -o ' .. lib_d .. '/libRunnr.so Runnr.o')
25
26-- For Elm apps, these are all centrally controlled in libSledjHamr.
27CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"'
28CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"'
29CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"'
30CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"'
31
32runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -fPIC -c SledjHamr.c')
33runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libSledjHamr.so -o ' .. lib_d .. '/libSledjHamr.so SledjHamr.o')