-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Statically link Wren; clean up source tree
- Instead of using a separate, upstream Wren, link the specific Wren we need directly into wren-vala. This way I can use, e.g., my fixes to wren-lang/wren issue 942 and wren-lang/wren issue 959 even before they are upstreamed (or even if they are never upstreamed). - Refactor list of Vala sources into rules.mk - Move config.h info to a C file. Previously, it was not available after compile time. Replace myconfig.vapi with new myconfig.c, and declarations in util.vala.
- Loading branch information
Showing
21 changed files
with
235 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
*.c | ||
*.h | ||
lib*.vapi | ||
|
||
# Hand-made files | ||
!wren-vala-merged.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,48 +7,120 @@ EXTRA_DIST = .gitignore | |
|
||
pkgconfig_DATA = | ||
lib_LTLIBRARIES = | ||
noinst_LTLIBRARIES = | ||
dist_vapi_DATA = | ||
include_HEADERS = | ||
dist_include_HEADERS = | ||
dist_noinst_HEADERS = | ||
BUILT_SOURCES = | ||
|
||
DISTCLEANFILES = | ||
MAINTAINERCLEANFILES = | ||
|
||
# === pkg-config === | ||
|
||
pkgconfig_DATA += \ | ||
libwren-vala-@[email protected] \ | ||
$(EOL) | ||
|
||
DISTCLEANFILES = $(pkgconfig_DATA) | ||
DISTCLEANFILES += $(pkgconfig_DATA) | ||
|
||
# === Library === | ||
# === Library, pass 1 === | ||
# The Vala files, as a convenience library. This is to get the ordering | ||
# right with respect to wrennull.c. | ||
|
||
lib_LTLIBRARIES += libwren-vala.la | ||
noinst_LTLIBRARIES += libinternal.la | ||
|
||
libwren_vala_la_SOURCES = \ | ||
basics.vapi \ | ||
marshal.vala \ | ||
myconfig.vapi \ | ||
trampoline.vala \ | ||
vm.vala \ | ||
wrennull.c \ | ||
$(EOL) | ||
wren_header = $(top_srcdir)/wren-pkg/wren/src/include/wren.h | ||
|
||
libwren_vala_la_LIBADD = \ | ||
$(top_builddir)/wren-pkg/libwren-@[email protected] \ | ||
libinternal_la_SOURCES = \ | ||
$(vala_all_sources) \ | ||
wren-vala-merged.h \ | ||
$(wren_header) \ | ||
$(EOL) | ||
|
||
libwren_vala_la_VALAFLAGS = \ | ||
--library libwren-vala-@[email protected] -H libwren-vala-@[email protected] \ | ||
# XXX not robust against Automake changes | ||
libinternal_stamp = $(srcdir)/libinternal_la_vala.stamp | ||
|
||
# Make libinternal get built first. That way $(generated_header) will exist | ||
# when it's time to build wrennull.c. | ||
BUILT_SOURCES += $(libinternal_stamp) | ||
|
||
generated_header = $(srcdir)/wren-vala-generated.h | ||
MAINTAINERCLEANFILES += $(generated_header) | ||
dist_noinst_HEADERS += $(generated_header) | ||
|
||
# valac makes wren-vala-generated.h. At compile time, | ||
# hand-made wren-vala-merged.h will pull in wren-vala-generated.h and wren.h. | ||
libinternal_la_VALAFLAGS = \ | ||
--library libinternal.so -H $(generated_header) \ | ||
--vapi libwren-vala.vapi \ | ||
$(AM_VALAFLAGS) \ | ||
$(EOL) | ||
|
||
# === vapi and header === | ||
libinternal_la_CFLAGS = \ | ||
-I$(top_srcdir)/wren-pkg/wren/src/include \ | ||
$(AM_CFLAGS) \ | ||
$(EOL) | ||
|
||
# === Library, pass 2 === | ||
# This is everything except the Vala files | ||
|
||
lib_LTLIBRARIES += libwren-vala-@[email protected] | ||
|
||
libwren_vala_@APIVER@_la_SOURCES = \ | ||
$(c_all_sources) \ | ||
$(EOL) | ||
|
||
libwren_vala_@APIVER@_la_CFLAGS = \ | ||
-I$(top_srcdir)/wren-pkg/wren/src/include \ | ||
$(AM_CFLAGS) \ | ||
$(EOL) | ||
|
||
libwren_vala_@APIVER@_la_LIBADD = \ | ||
libinternal.la \ | ||
$(top_builddir)/wren-pkg/libwren-@[email protected] \ | ||
$(EOL) | ||
|
||
# === Installed header === | ||
# The client of this library uses a single header with everything in one. | ||
# I make it by hand this way since I was having trouble getting Automake | ||
# to cooperate. | ||
|
||
header_for_installation = wren-vala-@[email protected] | ||
DISTCLEANFILES += $(header_for_installation) | ||
|
||
$(header_for_installation): $(generated_header) $(wren_header) Makefile.am | ||
$(AM_V_GEN) | ||
$(AM_V_at)echo "/* $@ generated at `date` */" > $@ | ||
$(AM_V_at)perl -ne '$$shouldprint = 1../#include.+\bwren.*\.h/; print if $$shouldprint && $$shouldprint !~ /E0/' $(generated_header) >> $@ | ||
$(AM_V_at)echo "/* inlining $(wren_header) */" >> $@ | ||
$(AM_V_at)cat $(wren_header) >> $@ | ||
$(AM_V_at)echo "/* end of inlined $(wren_header) */" >> $@ | ||
$(AM_V_at)perl -ne 'print if $$shouldprint; $$shouldprint ||= /#include.+\bwren.*\.h/' $(generated_header) >> $@ | ||
|
||
# Inline Wren's header into the wren-vala header after we run valac | ||
all-local: $(header_for_installation) | ||
|
||
install-data-local: $(header_for_installation) | ||
$(MKDIR_P) "$(DESTDIR)$(includedir)" | ||
$(INSTALL_DATA) "$(header_for_installation)" "$(DESTDIR)$(includedir)" | ||
|
||
# XXX not robust against automake changes | ||
uninstall-local: | ||
files="$(header_for_installation)" ; \ | ||
dir="$(DESTDIR)$(includedir)"; \ | ||
$(am__uninstall_files_from_dir) | ||
|
||
# === Installed vapi === | ||
|
||
# Before installing libwren-vala-@[email protected], tack basics.vapi onto the end | ||
# of it. The compiler only writes the declarations from vm.vala into the vapi | ||
# file, but the client needs basics.vapi as well. | ||
libwren-vala-@[email protected]: libwren-vala.vapi basics.vapi | ||
cat $^ > $@ | ||
# Also, change the cheader_filename in the vapi. | ||
vapis_to_merge = $(srcdir)/libwren-vala.vapi basics.vapi | ||
$(srcdir)/libwren-vala-@[email protected]: $(vapis_to_merge) Makefile.am $(libinternal_stamp) | ||
rm -f "$@" | ||
perl -pe 's/wren-vala-merged\.h/wren-vala-@[email protected]/g' $(vapis_to_merge) >> "$@" | ||
|
||
dist_vapi_DATA += libwren-vala-@[email protected] | ||
DISTCLEANFILES += libwren-vala-@[email protected] | ||
include_HEADERS += libwren-vala-@[email protected] | ||
dist_vapi_DATA += $(srcdir)/libwren-vala-@[email protected] | ||
MAINTAINERCLEANFILES += $(srcdir)/libwren-vala-@[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
// @configure_input@ | ||
|
||
// marshal.vala: Wren<->Vala marshalling | ||
// | ||
// By Christopher White <[email protected]> | ||
// Copyright (c) 2021 Christopher White. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
[CCode(cheader_filename="libwren-vala-@[email protected],@WREN_HEADER@")] | ||
[CCode(cheader_filename="wren-vala-merged.h")] | ||
namespace Wren { | ||
|
||
/** | ||
|
@@ -43,7 +41,7 @@ namespace Wren { | |
} | ||
private bool static_init_done = false; | ||
|
||
[CCode(cheader_filename="libwren-vala-@[email protected],@WREN_HEADER@")] | ||
[CCode(cheader_filename="wren-vala-merged.h")] | ||
namespace Marshal { | ||
|
||
public errordomain MarshalError { | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
// @configure_input@ | ||
|
||
// trampoline.vala: Functions for class bindings | ||
// Part of wren-vala | ||
// By Christopher White <[email protected]> | ||
// SPDX-License-Identifier: MIT | ||
|
||
[CCode(cheader_filename="libwren-vala-@[email protected],@WREN_HEADER@")] | ||
[CCode(cheader_filename="wren-vala-merged.h")] | ||
namespace Wren { | ||
|
||
/** | ||
|
@@ -15,7 +13,7 @@ namespace Wren { | |
* * has a tramp_ property returning an instance of this class; and | ||
* * implements {@link Wren.HasMethods} | ||
* */ | ||
[CCode(cheader_filename="libwren-vala-@[email protected],@WREN_HEADER@")] | ||
[CCode(cheader_filename="wren-vala-merged.h")] | ||
public class Tramp : Object { | ||
|
||
/** | ||
|
Oops, something went wrong.