Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zenroom
Zenroom
Commits
608faeec
Commit
608faeec
authored
Oct 01, 2018
by
Jaromil
Browse files
release build fixes
parent
cbd368e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
build/javascript.mk
View file @
608faeec
...
...
@@ -24,18 +24,10 @@ javascript-rn: apply-patches lua53 milagro lpeglabel
sed
-i
's/;ENVIRONMENT_IS_WEB=[^;]*;/;ENVIRONMENT_IS_WEB=false;/g'
src/zenroom.js
@
cp
-v
src/zenroom.js build/rnjs/
javascript-wasm
:
cflags += -DARCH_WASM -D'ARCH=
\"
WASM
\"
' -D MAX_STRING=128000
javascript-wasm
:
ldflags += -s WASM=1 -s MODULARIZE=1
javascript-wasm
:
apply-patches lua53 milagro lpeglabel
CC
=
${gcc}
CFLAGS
=
"
${cflags}
"
LDFLAGS
=
"
${ldflags}
"
LDADD
=
"
${ldadd}
"
\
make
-C
src js
@
mkdir
-p
build/wasm
@
cp
-v
src/zenroom.js build/wasm/
@
cp
-v
src/zenroom.wasm build/wasm/
javascript-demo
:
cflags += -DARCH_WASM -D'ARCH=
\"
WASM
\"
'
javascript-demo
:
cflags += -DARCH_WASM -D'ARCH=
\"
WASM
\"
' -D MAX_STRING=128000
javascript-demo
:
ldflags += -s WASM=1 -s ASSERTIONS=1 --shell-file ${extras}/shell_minimal.html -s NO_EXIT_RUNTIME=1
javascript-demo
:
apply-patches lua53 milagro lpeglabel
CC
=
${gcc}
CFLAGS
=
"
${cflags}
"
LDFLAGS
=
"
${ldflags}
"
LDADD
=
"
${ldadd}
"
\
make
-C
src js-demo
@
mkdir
-p
build/wasm
@
cp
-v
docs/demo/index.
*
build/wasm/
build/linux.mk
View file @
608faeec
...
...
@@ -2,6 +2,7 @@ musl: ldadd += /usr/lib/${ARCH}-linux-musl/libc.a
musl
:
apply-patches lua53 milagro lpeglabel
CC
=
${gcc}
AR
=
"
${ar}
"
CFLAGS
=
"
${cflags}
"
LDFLAGS
=
"
${ldflags}
"
LDADD
=
"
${ldadd}
"
\
make
-C
src musl
@
cp
-v
src/zenroom-static build/zenroom.x86
musl-local
:
ldadd += /usr/local/musl/lib/libc.a
musl-local
:
apply-patches lua53 milagro lpeglabel
...
...
@@ -58,6 +59,7 @@ linux-go: apply-patches lua53 milagro lpeglabel
${gcc}
${cflags}
-c
${pwd}
/build/swig_wrap.c
-o
src/zen_go.o
CC
=
${gcc}
CFLAGS
=
"
${cflags}
"
LDFLAGS
=
"
${ldflags}
"
LDADD
=
"
${ldadd}
"
\
make
-C
src go
@
mkdir
-p
${pwd}
/build/go
&&
cp
-v
${pwd}
/src/libzenroomgo.so
${pwd}
/build/go
linux-java
:
cflags += -I /opt/jdk/include -I /opt/jdk/include/linux
linux-java
:
apply-patches lua53 milagro lpeglabel
...
...
build/zip-binaries.sh
View file @
608faeec
...
...
@@ -52,13 +52,17 @@ for t in $targets; do
linux
)
checkbin zenroom.x86
$dir
checkbin zenroom.armhf
$dir
checkbin _zenroom.so
$dir
checkbin zenroom-wrapper.py
$dir
checkbin python2
$dir
checkbin python3
$dir
checkbin go
$dir
checkbin zenroom-wrapper.py
$dir
/python2
checkbin zenroom-wrapper.py
$dir
/python3
checkbin libzenroomgo.so
$dir
continue
;;
javascript
)
checkdir nodejs
$dir
checkdir wasm
$dir
checkdir rnjs
$dir
checkbin nodejs/zenroom.js.mem
$dir
checkbin zenroom_exec.js
$dir
continue
;;
...
...
src/zen_memory.c
View file @
608faeec
...
...
@@ -12,12 +12,22 @@ void *zen_memalign(const size_t size, const size_t align) {
// preserve const values as they seem to be overwritten by calls
size_t
vsize
=
size
;
size_t
valign
=
align
;
// TODO: Round up to the next highest power of 2
// uint32_t v = valign; // compute the next highest power of 2 of 32-bit v
// v--;
// v |= v >> 1;
// v |= v >> 2;
// v |= v >> 4;
// v |= v >> 8;
// v |= v >> 16;
// v++;
// // from https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
(
void
)
valign
;
# if defined(_WIN32)
mem
=
__mingw_aligned_malloc
(
vsize
,
valign
);
if
(
!
mem
)
{
error
(
0
,
"error in %u byte aligned memory allocation of %u bytes."
,
align
,
size
);
align
,
size
);
return
NULL
;
}
# elif defined(__EMSCRIPTEN__)
mem
=
malloc
(
vsize
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment