overkill 32 bits avx2 assembly code
[mini2dgl.git] / build.sh
blob46d2066197e4863644b238a63a318b59df774574
1 #!/bin/sh
3 # this is actually UN-TESTED, this is supposely working on massive
4 # mainstream distros.
5 # (we use nyan.sh where almost everything is in isolation)
6 # (this code should be decent enough to work with naive and simple C compilers,
7 # like tinycc)
9 # the following should be something like "/home/user/.local/share/"
10 steam_install_dir=FILL_IN_WITH_YOUR_STEAM_INSTALL_DIRECTORY
12 AVX2_32BITS_CPPFLAGS=-DAVX2_32BITS
13 #AVX2_32BITS_CPPFLAGS=
15 if test "x$AVX2_32BITS_CPPFLAGS" != x; then
16 AVX2_32BITS_LDFLAGS=/run/user/$(id -u)/avx2.o
17 export INCLUDE=$(readlink -f ./fasm/examples/x86/include/)
18 ./fasm/fasmg.x64 ./avx2.s $AVX2_32BITS_LDFLAGS
19 unset INCLUDE
22 gcc -O2 -fPIC -pipe -shared -static-libgcc \
23 $AVX2_32BITS_CPPFLAGS \
24 main.c \
25 $AVX2_32BITS_LDFLAGS \
26 -o libGL.so.1 \
27 -Wl,--version-script=libgl.map \
28 $steam_install_dir/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libX11.so.6 \
29 $steam_install_dir/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libXext.so.6
32 # steam client bug: forcing libva + libdrm (would not work on any solo
33 # software libGL install)
34 gcc -O2 -fPIC -pipe -shared -static-libgcc \
35 drm.c \
36 -o libdrm.so.2 \
37 -Wl,--version-script=drm.map \
38 $steam_install_dir/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libX11.so.6 \
39 $steam_install_dir/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libXext.so.6