-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to create amalgamated build
Fixes: #688
- Loading branch information
1 parent
9a902ba
commit ef3cd55
Showing
2 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {loadFile, writeFile} from "qjs:std" | ||
|
||
const cutils_c = loadFile("cutils.c") | ||
const cutils_h = loadFile("cutils.h") | ||
const libbf_c = loadFile("libbf.c") | ||
const libbf_h = loadFile("libbf.h") | ||
const libregexp_c = loadFile("libregexp.c") | ||
const libregexp_h = loadFile("libregexp.h") | ||
const libregexp_opcode_h = loadFile("libregexp-opcode.h") | ||
const libunicode_c = loadFile("libunicode.c") | ||
const libunicode_h = loadFile("libunicode.h") | ||
const libunicode_table_h = loadFile("libunicode-table.h") | ||
const list_h = loadFile("list.h") | ||
const quickjs_atom_h = loadFile("quickjs-atom.h") | ||
const quickjs_c = loadFile("quickjs.c") | ||
const quickjs_c_atomics_h = loadFile("quickjs-c-atomics.h") | ||
const quickjs_h = loadFile("quickjs.h") | ||
const quickjs_libc_c = loadFile("quickjs-libc.c") | ||
const quickjs_libc_h = loadFile("quickjs-libc.h") | ||
const quickjs_opcode_h = loadFile("quickjs-opcode.h") | ||
|
||
let source = "#if defined(CONFIG_QUICKJS_LIBC) && defined(__linux__) && !defined(_GNU_SOURCE)\n" | ||
+ "#define _GNU_SOURCE\n" | ||
+ "#endif\n" | ||
+ quickjs_c_atomics_h | ||
+ cutils_h | ||
+ list_h | ||
+ libbf_h | ||
+ libunicode_h // exports lre_is_id_start, used by libregexp.h | ||
+ libregexp_h | ||
+ libunicode_table_h | ||
+ quickjs_h | ||
+ quickjs_c | ||
+ cutils_c | ||
+ libbf_c | ||
+ libregexp_c | ||
+ libunicode_c | ||
+ "#ifdef CONFIG_QUICKJS_LIBC\n" | ||
+ quickjs_libc_h | ||
+ quickjs_libc_c | ||
+ "#endif // CONFIG_QUICKJS_LIBC\n" | ||
source = source.replace(/#include "quickjs-atom.h"/g, quickjs_atom_h) | ||
source = source.replace(/#include "quickjs-opcode.h"/g, quickjs_opcode_h) | ||
source = source.replace(/#include "libregexp-opcode.h"/g, libregexp_opcode_h) | ||
source = source.replace(/#include "[^"]+"/g, "") | ||
writeFile("quickjs-amalgam.c", source) |
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