Whitespace fixes
[amule.git] / src / utils / scripts / MacOSX / defs-global.sh
blobe150ec604fab5c1442e48555ace66810620cc474
1 # Global definitions for MacOSX builds
2 # (c) 2011 Angel Vidal ( kry@amule.org )
3 # Public domain. Use at your own risk.
5 . defs-functions.sh
7 # Wouldn't I love to have bash4 on MacOSX (case fallthrough)
9 pn "-- Begin global def section --"
11 SVN_REPOSITORY=$1
13 if [ -z $SVN_REPOSITORY ]; then
14 AMULE_FOLDER=`cd ${SCRIPTDIR}/../../../../; pwd`
15 if [ -f "${AMULE_FOLDER}/src/amule.cpp" ]; then
16 pc $GREEN "\tSVN repository has not been specified, using detected local sources at \"${AMULE_FOLDER}\""
17 else
18 pc $RED "\tSVN repository has not been specified, and no local sources found at \"${AMULE_FOLDER}\".\n\tPlease specify your aMule source folder by setting the AMULE_FOLDER variable, or call the script with the SVN repository of your choice as a first parameter, or \"public\" to download from our public SVN repository."
19 exit
23 if [ -z "$BUILD_FOLDER" ]; then
24 if [ -z $SVN_REPOSITORY ]; then
25 BUILD_FOLDER="$AMULE_FOLDER/build/"
26 mkdir $BUILD_FOLDER 2>/dev/null
27 else
28 BUILD_FOLDER=`pwd`
31 pc $BLUE "\tAutomatically setting build folder to ${BUILD_FOLDER} - set BUILD_FOLDER to your preferred folder to change this setting."
32 else
33 pc $GREEN "\tSetting build folder to $BUILD_FOLDER"
36 ROOT_FOLDER=`cd $BUILD_FOLDER; pwd`
38 if [ -z $AMULE_FOLDER ]; then
39 AMULE_FOLDER="${ROOT_FOLDER}/amule-dev"
42 pc $GREEN "\tBuild root absolute path is $ROOT_FOLDER"
44 if [ "$SDKNUMBER" == "" ]; then
45 pc $BLUE "\tAutomatically setting SDK to 10.4u (tiger with i386 and ppc, gcc 4.0) - set SDKNUMBER to your preferred SDK if you want to target it (10.5, 10.6, 10.7) or \"default\" for the default SDK."
46 SDKNUMBER=10.4
49 case "$SDKNUMBER" in
50 "10.4")
51 SDKRELEASE=10.4u
52 CCVERSION="-4.0"
54 "10.5"|"10.6"|"10.7")
55 SDKRELEASE=$SDKNUMBER
57 default)
60 pc $RED "Valid SDKNUMBER values are 10.4, 10.5, 10.6, 10.7 and default."
61 exit
63 esac
65 pc $GREEN "\tUsing $SDKNUMBER SDK"
67 if [ "$SDKNUMBER" != "default" ]; then
68 SDK="-isysroot /Developer/SDKs/MacOSX${SDKRELEASE}.sdk -mmacosx-version-min=$SDKNUMBER"
69 else
70 SDKNUMBER=""
73 if [ "$UNIVERSAL" == "" ]; then
74 pc $BLUE "\tAutomatically enabling universal (i386, ppc) build. Set UNIVERSAL=NO to build just for the current architecture."
75 UNIVERSAL="YES"
78 case "$UNIVERSAL" in
79 "NO"|"no")
80 pc $GREEN "\tDisabling universal build"
81 ARCHCPPFLAGS="$BUILDARCHS"
82 ARCHCONFIGFLAGS=""
84 "YES"|"yes")
85 pc $GREEN "\tUsing universal build (i386, pcc)"
86 ARCHCPPFLAGS="-arch i386 -arch ppc"
87 ARCHCONFIGFLAGS="--enable-universal_binary"
88 CCVERSION="-4.0"
91 pc $RED "Only the values \"NO\" and \"YES\" are valid for UNIVERSAL"
92 exit
94 esac
96 if [ "$STDOUT_FILE" == "" ]; then
97 STDOUT_FILE=${ROOT_FOLDER}/build_output
100 if [ "$ERROR_FILE" == "" ]; then
101 ERROR_FILE=${ROOT_FOLDER}/error_output
104 pc $GREEN "\tErrors will be redirected to $ERROR_FILE, normal build output to $STDOUT_FILE"
106 pn "-- End global def section --"