aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/lua/build.sh
diff options
context:
space:
mode:
authorGravatar DavidKorczynski <david@adalogics.com>2020-11-30 19:48:27 +0000
committerGravatar GitHub <noreply@github.com>2020-11-30 11:48:27 -0800
commit0736b5b08f61be9ff9f62f885912f934c7df5aed (patch)
treef548b038c1c43c7eb677f7ee5039526d1e4e9061 /projects/lua/build.sh
parentc63ba21574e4d4e72c79a1f399977e26e533100a (diff)
[Lua]initial integration. (#4653)
Diffstat (limited to 'projects/lua/build.sh')
-rwxr-xr-xprojects/lua/build.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/projects/lua/build.sh b/projects/lua/build.sh
new file mode 100755
index 00000000..7c65d0d3
--- /dev/null
+++ b/projects/lua/build.sh
@@ -0,0 +1,26 @@
+#!/bin/bash -eu
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+sed "s/CFLAGS=/CFLAGS+=/g" -i $SRC/lua/makefile
+sed "s/MYLDFLAGS=/MYLDFLAGS=${CFLAGS} /g" -i $SRC/lua/makefile
+sed "s/CC= gcc/CC= ${CC}/g" -i $SRC/lua/makefile
+
+cd $SRC/lua
+make
+cp ../fuzz_lua.c .
+$CC $CFLAGS -c fuzz_lua.c -o fuzz_lua.o
+$CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz_lua.o -o $OUT/fuzz_lua ./liblua.a