Skip to content

Commit d2ec8c9

Browse files
committed
First cut at getting dyncall configuration and build integrated, and linking it into a stub dynops library.
1 parent 131dd2e commit d2ec8c9

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

Configure.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@
108108
}
109109

110110
my $make = fill_template_text('@make@', %config);
111+
112+
if ($make eq 'nmake') {
113+
system_or_die('cd 3rdparty\dyncall-0.6 && Configure.bat' .
114+
($config{'parrot::archname'} =~ /x64/ ? ' /target-x64' : ''));
115+
$config{'dyncall_build'} = 'cd 3rdparty\dyncall-0.6 && nmake Nmakefile';
116+
}
117+
else {
118+
system_or_die('cd 3rdparty/dyncall-0.6 && sh configure');
119+
$config{'dyncall_build'} = "cd 3rdparty/dyncall-0.6 && $make";
120+
}
121+
111122
fill_template_file('tools/build/Makefile.in', 'Makefile', %config);
112123

113124
{

src/ops/nqp_dyncall.ops

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BEGIN_OPS_PREAMBLE
2+
3+
/* Parroty includes. */
4+
#include "parrot/parrot.h"
5+
#include "parrot/extend.h"
6+
#include "parrot/dynext.h"
7+
#include "../6model/sixmodelobject.h"
8+
9+
END_OPS_PREAMBLE
10+
11+
inline op nqp_XXX() :base_core {
12+
}

tools/build/Makefile.in

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ LDFLAGS = @ldflags@ @ld_debug@
2121
LD_LOAD_FLAGS = @ld_load_flags@
2222
LIBPARROT = @inst_libparrot_ldflags@
2323
O = @o@
24+
A = @a@
2425
LOAD_EXT = @load_ext@
2526
PERL = @perl@
2627
CP = @cp@
@@ -447,6 +448,13 @@ LIBTOMMATH_SOURCE = 3rdparty/libtommath/bncore.c \
447448
BIGINT_OPS = nqp_bigint_ops
448449
BIGINT_OPS_SOURCE = nqp_bigint.ops
449450

451+
DYNCALL_BIN = 3rdparty/dyncall-0.6/dyncall/libdyncall_s$(A) \
452+
3rdparty/dyncall-0.6/dyncallback/libdyncallback_s$(A) \
453+
3rdparty/dyncall-0.6/dynload/libdynload_s$(A)
454+
455+
DYNCALL_OPS = nqp_dyncall_ops
456+
DYNCALL_OPS_SOURCE = nqp_dyncall.ops
457+
450458
CLEANUPS = \
451459
*.manifest \
452460
*.pdb \
@@ -658,7 +666,7 @@ $(NCI_PBC): $(NQP_EXE)
658666
./$(NQP_EXE) --target=pir --output=src/gen/CallBuilder.pir $(NCI_SOURCE)
659667
$(PARROT) -o $(NCI_PBC) src/gen/CallBuilder.pir
660668

661-
$(DYNEXT_TARGET): $(DYNPMC) $(DYNOPS) $(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT)
669+
$(DYNEXT_TARGET): $(DYNPMC) $(DYNOPS) $(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT) $(OPS_DIR)/$(DYNCALL_OPS)$(LOAD_EXT)
662670
$(CP) $(DYNPMC) $(DYNEXT_DIR)
663671
$(CP) $(DYNOPS) $(DYNEXT_DIR)
664672
$(CP) $(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT) $(DYNEXT_DIR)
@@ -940,6 +948,14 @@ $(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT): $(OPS_DIR)/$(BIGINT_OPS_SOURCE) $(LIBTOMMAT
940948
cd src/6model/reprs && $(CC) -c @cc_o_out@P6bigint$(O) -I../../../$(PMC_DIR) -I../../../3rdparty/libtommath $(CINCLUDES) $(CFLAGS) P6bigint.c
941949
cd $(OPS_DIR) && $(LD) @ld_out@$(BIGINT_OPS)$(LOAD_EXT) $(BIGINT_OPS)$(O) ../../3rdparty/libtommath/*$(O) ../6model/reprs/P6bigint$(O) $(LINKARGS)
942950

951+
$(DYNCALL_BIN):
952+
@dyncall_build@
953+
954+
$(OPS_DIR)/$(DYNCALL_OPS)$(LOAD_EXT): $(OPS_DIR)/$(DYNCALL_OPS_SOURCE) $(DYNCALL_BIN)
955+
cd $(OPS_DIR) && $(OPS2C) C --dynamic $(DYNCALL_OPS_SOURCE)
956+
cd $(OPS_DIR) && $(CC) -c @cc_o_out@$(DYNCALL_OPS)$(O) $(CINCLUDES) -I../../3rdparty/dyncall-0.6 $(CFLAGS) $(DYNCALL_OPS).c
957+
cd $(OPS_DIR) && $(LD) @ld_out@$(DYNCALL_OPS)$(LOAD_EXT) $(DYNCALL_OPS)$(O) ../../3rdparty/dyncall-0.6/dyncall/libdyncall_s$(A) ../../3rdparty/dyncall-0.6/dyncallback/libdyncallback_s$(A) ../../3rdparty/dyncall-0.6/dynload/libdynload_s$(A) $(LINKARGS)
958+
943959
bootstrap-files: $(STAGE2_PBCS) src/stage2/$(CORE_SETTING_NQP)
944960
$(PERL) tools/build/gen-bootstrap.pl src/Regex.pir >src/stage0/Regex-s0.pir
945961
$(PERL) tools/build/gen-bootstrap.pl src/stage2/$(HLL_COMBINED_PIR) >src/stage0/HLL-s0.pir

0 commit comments

Comments
 (0)