1
0
Fork 0

compile.sh - 70 columns print limit

This commit is contained in:
LogicParrot 2016-01-13 09:29:25 +02:00
parent da19b1708c
commit 0affb47c7d
1 changed files with 42 additions and 35 deletions

View File

@ -3,6 +3,8 @@
{ # put the whole thing in a block so as not to behave weirdly if interrupted { # put the whole thing in a block so as not to behave weirdly if interrupted
set -e set -e
#TODO command line parameter handling for non-interactive mode.
# Do we already have a repo? # Do we already have a repo?
if [ \( -d .git \) -a \( -f easyinstall.sh \) -a \( -f src/BlockArea.cpp \) ]; then # A good enough indicator that we're in the Cuberite git repo. if [ \( -d .git \) -a \( -f easyinstall.sh \) -a \( -f src/BlockArea.cpp \) ]; then # A good enough indicator that we're in the Cuberite git repo.
cd ../ cd ../
@ -33,14 +35,14 @@ missingDepsExit ()
# Echo: Greetings. # Echo: Greetings.
echo echo "
echo "Hello, this script will download and compile Cuberite." Hello, this script will download and compile Cuberite.
echo "On subsequent runs, it will update Cuberite." On subsequent runs, it will update Cuberite.
echo "The compilation and download will occur in the current directory." The compilation and download will occur in the current directory.
echo "If you're updating, you should run <Path to Cuberite>/cuberite/compile.sh" If you're updating, you should run: <Path to Cuberite>/compile.sh
echo "Compiling from source takes time, but it usually generates faster executables." Compiling from source takes time, but it usually generates faster
echo "If you prefer ready-to-use binaries or if you want more info, please visit:" executables. If you prefer ready-to-use binaries or if you want
echo "http://cuberite.org/" more info, please visit: http://cuberite.org/"
### Dependency checks start. ### ### Dependency checks start. ###
MISSING_PACKAGES="" MISSING_PACKAGES=""
@ -55,7 +57,7 @@ PROGRAMS='git git
make make make make
cmake cmake' cmake cmake'
# If any OS deviates from the defaults, detect the OS here, and change PROGRAMS,COMPILER_PACKAGE_NAME, etc. as needed. # If any OS deviates from the defaults, detect the OS here, and change PROGRAMS, COMPILER_PACKAGE_NAME, etc. as needed.
# Fedora, CentOS, RHEL, Mageia, openSUSE, Mandriva # Fedora, CentOS, RHEL, Mageia, openSUSE, Mandriva
if (rpm --help > /dev/null 2> /dev/null); then if (rpm --help > /dev/null 2> /dev/null); then
@ -121,18 +123,18 @@ inactiveCode ()
{ {
# Echo: Branch choice. # Echo: Branch choice.
echo echo "
echo "You can choose between 2 branches:" You can choose between 3 branches:
echo "* (S)Stable: (Coming soon) Choose the stable branch if you want the most reliable server." * (S)Stable: Choose the stable branch if you want the most
echo " As of now, Stable is not yet available, please use testing instead." reliable server.
echo
echo "* (T)Testing: The testing branch is less stable," * (T)Testing: The testing branch is less stable,
echo " but using it and finding and reporting bugs helps us a lot!" but using it and reporting bugs helps us a lot!
echo
echo "* (D)Dev: The least stable of the three. (Master branch)" * (D)Dev: The least stable of the three. (Master branch)
echo " Choose the development branch if you are feeling adventurous and" Choose the development branch if you want to try new,
echo " want to try new, bleeding edge features." bleeding-edge features.
echo "
# Input: Branch choice. # Input: Branch choice.
@ -153,16 +155,20 @@ fi
### Inactive code end. ### ### Inactive code end. ###
# Echo: Compile mode choice. # Echo: Compile mode choice.
echo echo "
echo "Choose compile mode:" Choose compile mode:
echo "* (N)Normal: Compiles normally." * (N)Normal: Compiles normally.
echo Generates the fastest build.
echo "* (D)Debug: Compiles in debug mode. Makes your console and crashes much more verbose."
echo " But it costs performance." * (D)Debug: Compiles in debug mode.
echo Makes your console and crashes more verbose.
echo "Note that the script will connect to the internet in order to fetch code after this step." A bit slower than Normal mode. If you plan to help
echo "It will then compile your program." development by reporting bugs, this is preferred.
echo
Note that the script will connect to the internet in order to fetch
code after this step. It will then compile your program.
"
# Input: Compile mode choice. # Input: Compile mode choice.
echo -n "Choose compile mode: (n/d): " echo -n "Choose compile mode: (n/d): "
@ -226,10 +232,11 @@ else
echo "`pwd`/Cuberite" echo "`pwd`/Cuberite"
fi fi
cd .. cd ..
echo echo "
echo "You can always update Cuberite by executing `pwd`/compile.sh" You can always update Cuberite by executing:
echo `pwd`/compile.sh
echo "Enjoy :)"
Enjoy :)"
exit 0 exit 0
:windows_detected :windows_detected