mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 07:17:37 +02:00
WIP
This commit is contained in:
parent
cfc064fd51
commit
ff49fd6796
2 changed files with 16 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -56,7 +56,7 @@ libcyclone.so.1: runtime.c runtime.h
|
||||||
gcc -shared -Wl,-soname,libcyclone.so.1 -o libcyclone.so.1.0.1 runtime.o
|
gcc -shared -Wl,-soname,libcyclone.so.1 -o libcyclone.so.1.0.1 runtime.o
|
||||||
libcyclone.a: runtime.c runtime.h dispatch.c
|
libcyclone.a: runtime.c runtime.h dispatch.c
|
||||||
$(CC) -g -c dispatch.c -o dispatch.o
|
$(CC) -g -c dispatch.c -o dispatch.o
|
||||||
$(CC) -g -c -DCYC_INSTALL_DIR=\"$(PREFIX)\" -DCYC_INSTALL_SLD=\"/share/cyclone\" runtime.c -o runtime.o
|
$(CC) -g -c -DCYC_INSTALL_DIR=\"$(PREFIX)\" -DCYC_INSTALL_LIB=\"$(LIBDIR)\" -DCYC_INSTALL_INC=\"$(INCDIR)\" -DCYC_INSTALL_SLD=\"$(DATADIR)\" runtime.c -o runtime.o
|
||||||
$(AR) rcs libcyclone.a runtime.o dispatch.o
|
$(AR) rcs libcyclone.a runtime.o dispatch.o
|
||||||
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
|
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
|
||||||
# Note compiler will have to link to this, eg:
|
# Note compiler will have to link to this, eg:
|
||||||
|
|
19
runtime.c
19
runtime.c
|
@ -943,12 +943,23 @@ string_type Cyc_substring(object str, object start, object end) {
|
||||||
* This is configured via the makefile during a build.
|
* This is configured via the makefile during a build.
|
||||||
*/
|
*/
|
||||||
string_type Cyc_installation_dir(object type) {
|
string_type Cyc_installation_dir(object type) {
|
||||||
// TODO: need to handle 'inc 'lib 'sld and return appropriate dir.
|
|
||||||
// EG: if 'sld, return (CYC_INSTALL_DIR "/" CYC_SLD_DIR)
|
|
||||||
// need to use directives from makefile
|
|
||||||
if (Cyc_is_symbol(type) == boolean_t &&
|
if (Cyc_is_symbol(type) == boolean_t &&
|
||||||
strncmp(((symbol)type)->pname, "sld", 5) == 0) {
|
strncmp(((symbol)type)->pname, "sld", 5) == 0) {
|
||||||
make_string(str, CYC_INSTALL_SLD); // TODO: prepend INSTALL_DIR + "/"
|
char buf[1024];
|
||||||
|
snprintf(buf, sizeof(buf), "%s", CYC_INSTALL_SLD);
|
||||||
|
make_string(str, buf);
|
||||||
|
return str;
|
||||||
|
} else if (Cyc_is_symbol(type) == boolean_t &&
|
||||||
|
strncmp(((symbol)type)->pname, "lib", 5) == 0) {
|
||||||
|
char buf[1024];
|
||||||
|
snprintf(buf, sizeof(buf), "%s", CYC_INSTALL_LIB);
|
||||||
|
make_string(str, buf);
|
||||||
|
return str;
|
||||||
|
} else if (Cyc_is_symbol(type) == boolean_t &&
|
||||||
|
strncmp(((symbol)type)->pname, "inc", 5) == 0) {
|
||||||
|
char buf[1024];
|
||||||
|
snprintf(buf, sizeof(buf), "%s", CYC_INSTALL_INC);
|
||||||
|
make_string(str, buf);
|
||||||
return str;
|
return str;
|
||||||
} else {
|
} else {
|
||||||
make_string(str, CYC_INSTALL_DIR);
|
make_string(str, CYC_INSTALL_DIR);
|
||||||
|
|
Loading…
Add table
Reference in a new issue