linux packaging almost ready

This commit is contained in:
Allen Webster 2016-03-07 14:37:48 -05:00
parent f39bbd880e
commit 369af51feb
3 changed files with 129 additions and 94 deletions

5
buildsuper.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
#!/bin/sh
g++ -Wno-write-strings -std=gnu++0x 4coder_custom.cpp -shared -o 4coder_custom.so -fPIC

View File

@ -1197,7 +1197,7 @@ static void gl_log(
GLsizei length,
const GLchar* message,
const void* userParam
){
){
printf("GL DEBUG: %s\n", message);
}
#endif
@ -1824,8 +1824,24 @@ main(int argc, char **argv)
}
if (linuxvars.custom){
linuxvars.custom_api.get_alpha_4coder_version = (_Get_Version_Function*)
dlsym(linuxvars.custom, "get_alpha_4coder_version");
if (linuxvars.custom_api.get_alpha_4coder_version == 0 ||
linuxvars.custom_api.get_alpha_4coder_version(MAJOR, MINOR, PATCH) == 0){
printf("failed to use 4coder_custom.so: version mismatch\n");
}
else{
linuxvars.custom_api.get_bindings = (Get_Binding_Data_Function*)
dlsym(linuxvars.custom, "get_bindings");
if (linuxvars.custom_api.get_bindings == 0){
printf("failed to use 4coder_custom.so: get_bindings not exported\n");
}
else{
printf("successfully loaded 4coder_custom.so\n");
}
}
}
#endif

View File

@ -15,8 +15,10 @@
TEMPLATE_DIR="$HOME/Desktop/4coder/release_template/"
CODE_DIR="$HOME/Desktop/4coder"
TMP_DIR="/tmp/4coder"
OUT_ZIP="$HOME/Desktop/4coder-linux.zip"
OUT_ZIP_SUPER="$HOME/Desktop/4coder-linux-super.zip"
OUT_ZIP="$HOME/Desktop/4coder-linux-64.zip"
OUT_ZIP_32="$HOME/Desktop/4coder-linux-32.zip"
OUT_ZIP_SUPER="$HOME/Desktop/4coder-linux-super-64.zip"
OUT_ZIP_SUPER_32="$HOME/Desktop/4coder-linux-super-32.zip"
echo "template: $TEMPLATE_DIR"
echo "base: $CODE_DIR"
@ -25,40 +27,42 @@ echo "out: $OUT_ZIP"
rm -rf "$OUT_ZIP"
rm -rf "$OUT_ZIP_SUPER"
rm -rf "$OUT_ZIP_32"
rm -rf "$OUT_ZIP_SUPER_32"
mkdir -p "$TMP_DIR"
mkdir -p "$TMP_DIR/alpha"
mkdir -p "$TMP_DIR/super"
cat << EOF > "$TMP_DIR/readme.txt"
This is a linux 4coder release.
Brought to you by Mr4thDimention and insofaras.
Enjoy!
EOF
pushd "$CODE_DIR"
echo "Alpha User"
# ALPHA-32
make clean
make release32
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/alpha/32"
cp ./4ed ./4ed_app.so "$TMP_DIR/alpha/32/"
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/alpha"
cp ./4ed ./4ed_app.so "$TMP_DIR/alpha/"
echo " "
pushd "$TMP_DIR"
zip -r "$OUT_ZIP_32" "$(basename alpha)"
popd
rm -rf "$TMP_DIR/alpha"
echo " "
# ALPHA-64
make clean
make release
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/alpha/64"
cp ./4ed ./4ed_app.so "$TMP_DIR/alpha/64/"
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/alpha"
cp ./4ed ./4ed_app.so "$TMP_DIR/alpha/"
echo " "
cp "$TMP_DIR/readme.txt" "$TMP_DIR/alpha/readme.txt"
pushd "$TMP_DIR"
zip -r "$OUT_ZIP" "$(basename alpha)"
popd
rm -rf "$TMP_DIR/alpha"
echo " "
@ -66,24 +70,34 @@ echo " "
echo "Super User"
# SUPER-32
make clean
make release32
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/super/32"
cp ./4ed ./4ed_app.so ./code/4coder_*.h ./code/4coder_*.cpp "$TMP_DIR/super/32/"
make release32_super
cp ./4ed ./4ed_app.so ./code/4coder_*.h ./code/4coder_*.cpp "$TMP_DIR/super/"
cp ./code/buildsuper.sh "$TMP_DIR/super/"
echo " "
make clean
make release
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/super/64"
cp ./4ed ./4ed_app.so ./code/4coder_*.h ./code/4coder_*.cpp "$TMP_DIR/super/64/"
pushd "$TMP_DIR"
zip -r "$OUT_ZIP_SUPER_32" "$(basename super)"
popd
rm -rf "$TMP_DIR/super"
echo " "
# SUPER-64
make clean
make release_super
cp -r "${TEMPLATE_DIR}" "$TMP_DIR/super/"
cp ./4ed ./4ed_app.so ./code/4coder_*.h ./code/4coder_*.cpp "$TMP_DIR/super/"
cp ./code/buildsuper.sh "$TMP_DIR/super/"
echo " "
cp "$TMP_DIR/readme.txt" "$TMP_DIR/super/readme.txt"
pushd "$TMP_DIR"
zip -r "$OUT_ZIP_SUPER" "$(basename super)"
popd
rm -rf "$TMP_DIR/super"
echo " "
@ -95,7 +109,7 @@ rm -rf "$TMP_DIR"
popd
echo "Created linux 4coder package: $OUT_ZIP"
echo "Created linux 4coder packages"
exit