Skip to content

Instantly share code, notes, and snippets.

@Cheeseness
Created August 26, 2013 06:34
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 Cheeseness/6338585 to your computer and use it in GitHub Desktop.
Save Cheeseness/6338585 to your computer and use it in GitHub Desktop.
Linux 32/64bit detection launcher script for intel/AMD architectures. Rename game_64 and game_32 to the 64 and 32 bit binaries for your application. Uncomment LD_LIBRARY_PATH lines if you distribute libs. Inspired by the launcher @flibitijibibo distributes with his games ^_^
#!/bin/bash
# Change to the directory that the script and binaries are in
cd "`dirname "$0"`"
# uname provides some system information. -m is the machine hardware name and returns x86_64 for 64 bit kernels.
if [ $(uname -m) == "x86_64" ]; then
# Print some output to let the user know what's going on
echo "Running 64 bit"
# Exporting the libary path is only necessary if you're bundling libraries
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib_64/
# Run your 64 bit binary
./game_64
else
echo "Running 32 bit"
# Exporting the libary path is only necessary if you're bundling libraries
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib_32/
# Run your 32 bit binary
./game_32
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment