summaryrefslogtreecommitdiffhomepage
path: root/compile
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-08-20 16:20:03 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-27 00:46:09 +0100
commita1998f2f7ce4153d670e2e5cb5018366517cc1ca (patch)
tree4d899fbad24c728c0b51f183c61ed6a7fb213c04 /compile
parent38fa6c52a8a26ac178a3e1f80a8317740b8e82b3 (diff)
Get things at least compiling under Linux
Nothing really works yet, but at least test.h and fastspin are fixed and some of the issues with RTTI and libdl and stuff are maybe kind of sorted, subject to more testing later. The main issue now seems to be the cvar interface not quite lining up and crashing pretty much immediately. That'll probably take a lot more debugging to figure out, which likely still won't be a priority for quite a while.
Diffstat (limited to 'compile')
-rwxr-xr-xcompile16
1 files changed, 8 insertions, 8 deletions
diff --git a/compile b/compile
index a94d8b1..ce45ced 100755
--- a/compile
+++ b/compile
@@ -14,18 +14,18 @@ esac
mkdir -p .build/include
-: "${CC:=clang --target=-i686-pc-linux-gnu -fuse-ld=lld}"
-: "${HOSTCC:=clang -fuse-ld=lld}"
+: "${CC:=clang --target=-i686-pc-linux-gnu}"
+: "${HOSTCC:=clang}"
warnings="-Wall -pedantic -Wno-parentheses -Wno-missing-braces \
-Wno-gnu-zero-variadic-macro-arguments"
dbg=0
if [ "$dbg" = 1 ]; then
- cflags="-Og -g3"
- ldflags="-Og -g3"
+ cflags="-O0 -g3"
+ ldflags="-O0 -g3"
else
- cflags="-O2"
+ cflags="-O2 -fvisibility=hidden"
ldflags="-O2 -s"
fi
@@ -38,14 +38,14 @@ cc() {
if [ "$_mn" = " -DMODULE_NAME=con_" ]; then _mn=" -DMODULE_NAME=con"
elif [ "$_mn" = "-DMODULE_NAME=sst" ]; then _mn=; fi
# note: using typeof and bool from C23 - see detailed comment in compile.bat
- $CC -m32 -c -flto -fpic $cflags $warnings -I.build/include \
+ $CC -m32 -c -flto -fpic -fno-ident $cflags $warnings -I.build/include \
-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64$_mn \
-Dtypeof=__typeof -include stdbool.h -o ".build/${_bn%%.c}.o" "src/$1"
}
ld() {
- $CC -m32 -shared -flto -fpic -fno-ident -fuse-ld=lld $ldflags \
- -L.build -ldl -ltier0 -lvstdlib -o sst.so$objs
+ $CC -shared -flto -fpic -fuse-ld=lld $ldflags -L.build -ldl \
+ -ltier0 -lvstdlib -o sst.so$objs
}
src="\