Skip to content

Commit

Permalink
fix bug of dir preset. fix lack of libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
yutopp committed Feb 25, 2017
1 parent cb54a19 commit 9b9c919
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions corelib/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CFLAGS += -shared -fPIC

CORE_LIB_SRC_DIR = $(dir src)
.SUBDIRS: src/core
%.o: %.rill $(RILLC_BIN)
%.o: %.rill build_rillc
$(RILLC_BIN) -c $< --no-corelib --no-stdlib --system-lib $(CORE_LIB_SRC_DIR) -o $@

clean:
Expand All @@ -55,12 +55,12 @@ CORE_LIB_SRC_DIR = $(dir src)
clean:
rm -f *~ *.o *.out

.DEFAULT: lib/$(LIBNAME).a lib/$(LIBNAME).so
.DEFAULT: build_corelib

########################################################################
#

build_corelib: lib/$(LIBNAME).a
build_corelib: lib/$(LIBNAME).a lib/$(LIBNAME).so

lib/$(LIBNAME).a: $(CORE_SRC_TARGET_OBJS)
prepare-directory(lib)
Expand Down
2 changes: 1 addition & 1 deletion rillc/src/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let make_build_options co =
[COS.OsLinkDir Config.default_core_lib_dir;
COS.OsLinkLib Config.default_core_lib_name]
in
let std_lib_opts = if co.no_corelib then
let std_lib_opts = if co.no_stdlib then
[]
else
if Config.use_local_dev_lib then
Expand Down
2 changes: 2 additions & 0 deletions rillc/src/ctfe_engine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ let find_dyn_lib_from_path search_dirs filename =
try
let search search_dir =
let path = Filename.concat search_dir filename in
Debug.printf "Search dyn lib: %s" path;
if Sys.file_exists path then
Some path
else
Expand All @@ -87,6 +88,7 @@ let load_dyn_lib search_dirs lib_name =
| Some path -> path
| None -> shared_lib_name
in
Debug.printf "Load dyn lib: %s" shared_lib_path;
Dl.dlopen ~filename:shared_lib_path ~flags:[Dl.RTLD_LAZY]

let prepare_dyn_libs engine =
Expand Down
8 changes: 5 additions & 3 deletions stdlib/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ CFLAGS += -shared -fPIC
#

CORE_LIB_SRC_DIR = $(dir ../corelib/src)
CORE_LIB_LIB_DIR = $(dir ../corelib/lib)
STD_LIB_SRC_DIR = $(dir src)
.SUBDIRS: src/std
%.o: %.rill $(RILLC_BIN)
%.o: %.rill build_rillc build_corelib
$(RILLC_BIN) -c $< --no-stdlib --system-lib $(CORE_LIB_SRC_DIR) \
-L $(CORE_LIB_LIB_DIR) \
--system-lib $(STD_LIB_SRC_DIR) -o $@

clean:
Expand All @@ -57,12 +59,12 @@ STD_LIB_SRC_DIR = $(dir src)
clean:
rm -f *~ *.o *.out

.DEFAULT: lib/$(LIBNAME).a lib/$(LIBNAME).so
.DEFAULT: build_stdlib

########################################################################
#

build_stdlib: lib/$(LIBNAME).a
build_stdlib: lib/$(LIBNAME).a lib/$(LIBNAME).so

lib/$(LIBNAME).a: $(STD_SRC_TARGET_OBJS)
prepare-directory(lib)
Expand Down

0 comments on commit 9b9c919

Please sign in to comment.