Skip to content

Instantly share code, notes, and snippets.

@YamashitaRen
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YamashitaRen/3241028baf47d08ae4d6 to your computer and use it in GitHub Desktop.
Save YamashitaRen/3241028baf47d08ae4d6 to your computer and use it in GitHub Desktop.
fmtconv build script
#!/bin/bash
CC="gcc"
CFLAGS="-march=native -O3 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LIBNAME="libfmtconv.so"
SOURCEFILES=$(echo AvstpWrapper.cpp; echo main.cpp; ls fmtc/*.cpp; ls fmtcl/*.cpp; ls fstb/*.cpp; ls vsutl/*.cpp)
for i in ${SOURCEFILES}; do
echo -e "\e[1m>>> \e[00;32m${i}\e[00m"
if [[ ${i,,} == *"avx.cpp" ]] || [[ ${i,,} == *"avx2.cpp" ]]; then
EXTRAFLAGS="-mavx2"
else
EXTRAFLAGS="-msse2"
fi
${CC} ${CFLAGS} ${EXTRAFLAGS} -fPIC -std=c++11 -I. $(pkg-config --cflags vapoursynth) ${i} -c -o ${i}.o
done
${CC} ${CFLAGS} ${LDFLAGS} -shared -fPIC -o ${LIBNAME} *.o */*.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment