Skip to content

Commit 4e448f7

Browse files
authored
Merge pull request #1437 from housel/dylan-tool-fdmake-build
dylan-tool fdmake build
2 parents 920b94a + d5bf3c9 commit 4e448f7

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

Makefile.in

+10-4
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ BOOTSTRAP_3_ROOT = $(abs_builddir)/Bootstrap.3
190190

191191
BOOTSTRAP_3_LIBRARIES = \
192192
dylan-compiler dylan-environment parser-compiler dswank make-dylan-app
193+
BOOTSTRAP_3_STATICS = \
194+
dylan-tool
193195

194196
BOOTSTRAP_3_COMPILER = \
195197
$(BOOTSTRAP_2_ROOT)/bin/dylan-compiler \
@@ -204,6 +206,7 @@ BOOTSTRAP_3_ENV = \
204206

205207
bootstrap-stage-3: bootstrap-stage-3-dirs \
206208
bootstrap-stage-3-libraries \
209+
bootstrap-stage-3-statics \
207210
bootstrap-stage-3-runtime \
208211
bootstrap-stage-3-jamfiles
209212

@@ -215,6 +218,11 @@ bootstrap-stage-3-libraries:
215218
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
216219
$(BOOTSTRAP_3_LIBRARIES)
217220

221+
bootstrap-stage-3-statics:
222+
@echo Building Open Dylan unified executables...
223+
@$(BOOTSTRAP_3_ENV) $(FDMAKE) --compiler "$(BOOTSTRAP_3_COMPILER)" \
224+
--unify $(BOOTSTRAP_3_STATICS)
225+
218226
BOOTSTRAP_3_LLVM_RTGVARSyes = \
219227
OPEN_DYLAN_LLVM_RUNTIME_GENERATOR=$(BOOTSTRAP_3_ROOT)/bin/$(RTG)
220228
BOOTSTRAP_3_RTGVARS = $(BOOTSTRAP_3_LLVM_RTGVARS@SUPPORT_LLVM@)
@@ -328,10 +336,6 @@ version = @VERSION@
328336

329337
dist: 3-stage-bootstrap
330338
mkdir -p release/opendylan-$(version)/bin
331-
332-
DYLAN=$$(realpath release/opendylan-$(version)) \
333-
make -C sources/app/dylan-tool test && \
334-
make -C sources/app/dylan-tool install
335339
mkdir -p release/opendylan-$(version)/databases
336340
mkdir -p release/opendylan-$(version)/include/opendylan
337341
mkdir -p release/opendylan-$(version)/lib
@@ -343,6 +347,8 @@ dist: 3-stage-bootstrap
343347
find release/opendylan-$(version)/sources -depth -name '.*' -exec rm -rf {} \;
344348
rm -rf release/opendylan-$(version)/sources/bootstrap1-registry
345349
cp -R Bootstrap.3/bin release/opendylan-$(version)/
350+
cp -R Bootstrap.3/sbin/* release/opendylan-$(version)/bin
351+
ln -s dylan-tool release/opendylan-$(version)/bin/dylan
346352
cp -R Bootstrap.3/databases release/opendylan-$(version)/
347353
-cp -R Bootstrap.3/include/opendylan release/opendylan-$(version)/include
348354
cp -R Bootstrap.3/lib release/opendylan-$(version)/

build/fdmake.pl

+21-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
my $debugger;
2121
my $gdb;
2222
my $lldb;
23+
my $unify;
2324
my $compiler = 'dylan-compiler';
2425
&GetOptions('verbose' => \$verbose,
2526
'debugger' => \$debugger,
2627
'gdb' => \$gdb,
2728
'lldb' => \$lldb,
29+
'unify'=> \$unify,
2830
'compiler=s' => \$compiler);
2931

3032
# Names of libraries we already built successfully.
@@ -153,6 +155,9 @@ sub build_library {
153155
}
154156

155157
my $command = $compiler;
158+
if ($unify) {
159+
$command .= " -unify";
160+
}
156161
if ($debugger) {
157162
$command .= " -debugger";
158163
}
@@ -300,12 +305,25 @@ sub library_products {
300305
else {
301306
my $so = ($platform_name =~ /-darwin$/) ? 'dylib' : 'so';
302307
$executable = lc($executable);
303-
push(@products,
304-
File::Spec->catfile($user_root, 'lib', "lib${executable}.${so}"));
308+
if ($unify) {
309+
push(@products,
310+
File::Spec->catfile($user_root, 'lib', "lib${executable},unify.a"));
311+
}
312+
else {
313+
push(@products,
314+
File::Spec->catfile($user_root, 'lib', "lib${executable}.${so}"));
315+
}
305316

306317
if (!defined $header->{'target-type'}
307318
|| lc($header->{'target-type'}) eq 'executable') {
308-
push @products, File::Spec->catfile($user_root, 'bin', $executable);
319+
if ($unify) {
320+
push @products, File::Spec->catfile($user_root, 'sbin',
321+
$executable);
322+
}
323+
else {
324+
push @products, File::Spec->catfile($user_root, 'bin',
325+
$executable);
326+
}
309327
}
310328
}
311329

0 commit comments

Comments
 (0)