GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — livecode/config.sh at develop · Skipis/livecode Expand file tree/ Copy pathconfig.shMore file actions executable file ·414 lines (361 loc) · 11.6 KB / Copy pathconfig.shFile metadata and controlsexecutable file ·414 lines (361 loc) · 11.6 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 #!/bin/bash # Copyright (C) 2015 LiveCode Ltd. # # This file is part of LiveCode. # # LiveCode is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License v3 as published by the Free # Software Foundation. # # LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with LiveCode. If not see <http://www.gnu.org/licenses/>. usage () { cat <<EOF Use gyp to generate project files when compiling LiveCode. Usage: config.sh [--platform PLATFORM] [options ...] [gyp_options ...] Options: -p, --platform PLATFORM Choose which platform to build for -h, --help Print this message gyp Options: --generator-output DIR Puts generated build files under DIR --depth PATH Set DEPTH gyp variable to a relative path to PATH -f, format FORMATS Output formats to generate -Gmsvs_version=WIN_MSVS_VERSION Version of Microsoft Visual Studio to be used -Gandroid_ndk_version=ANDROID_NDK_VERSION Version of Android Native Development Kit to be used -DOS=OS Compile LiveCode for target operating system -Dtarget_arch=TARGET_ARCH Compile LiveCode to run on ARCH processors -Dtarget_sdk=XCODE_TARGET_SDK Compile LiveCode using the specified SDK in Xcode -Dhost_sdk=XCODE_HOST_SDK Compile build tools using the specified SDK in Xcode All unrecognised options get passed directly to gyp. If you don't specify an required option, config.sh will try to guess a suitable value. The currently-supported PLATFORMs are: mac ios linux-x86 linux-x86_64 android-armv6 win-x86 emscripten EOF exit $1 } guess_platform () { case "$(uname -s)" in Darwin) echo "mac" return 0 ;; Linux) case "$(uname -p)" in x86_64) echo "linux-x86_64" return 0 ;; i*86|x86) echo "linux-x86" return 0 ;; esac;; esac return 1 } invoke_gyp () { echo gyp/gyp "$@" 2>&1 exec gyp/gyp "$@" } ################################################################ # Parse command-line options ################################################################ num_save_opts=0 while [[ $# > $num_save_opts ]]; do key="$1" case "$key" in -h|--help) usage 1 ;; -p|--platform) PLATFORM="$2" shift ;; --generator-output) GENERATOR_OUTPUT="$2" shift ;; --depth) DEPTH="$2" shift ;; -f|--format) FORMATS="$2 ${FORMATS}" shift ;; # Intercept -D options that config.sh tries to generate -D*) d="${key#*=}" case "$key" in -Dhost_sdk=*) XCODE_HOST_SDK="$d" ;; -Dtarget_sdk=*) XCODE_TARGET_SDK="$d" ;; -Dtarget_arch=*) TARGET_ARCH="$d" ;; -DOS=*) OS="$d" ;; *) # Pass directly through to gyp set x "$@" "$key" let num_save_opts++ shift ;; esac ;; # Intercept -G options that config.sh tries to generate -G*) d="${key#*=}" case "$key" in -Gmsvs_version=*) WIN_MSVS_VERSION="$d" ;; -Gandroid_ndk_version=*) ANDROID_NDK_VERSION="$d" ;; *) # Pass directly through to gyp set x "$@" "$key" let num_save_opts++ shift ;; esac ;; *) # Unrecognised option echo "ERROR: Unrecognised option '$key'" exit 1 ;; esac shift done ################################################################ # Guess and validate platform ################################################################ # If no platform specified, try to guess the platform if test -z "${PLATFORM}"; then PLATFORM=$(guess_platform) if test $? -ne 0; then echo "ERROR: Cannot guess platform; specify '--platform <name>'" >&2 exit 1 fi fi # Validate platform case ${PLATFORM} in linux-x86) ;; linux-x86_64) ;; android-armv6) ;; mac) ;; ios) ;; win-x86) ;; emscripten) ;; *) echo "ERROR: Unrecognised platform: '${PLATFORM}'" >&2 exit 1;; esac ################################################################ # Guess other relevant options ################################################################ # Guess generator output directory from platform if test -z "$GENERATOR_OUTPUT"; then GENERATOR_OUTPUT="build-${PLATFORM}/livecode" fi # Guess OS from platform if test -z "$OS"; then case ${PLATFORM} in linux*) OS="linux" ;; android*) OS="android" ;; mac*) OS="mac" ;; ios*) OS="ios" ;; win*) OS="win" ;; emscripten*) OS="emscripten" ;; esac fi # If no output type specified, guess from platform: if test -z "$FORMATS"; then case ${OS} in # Always use Linux-style makefiles for Android as the Android toolchain # is more Linux-y than Darwin-y linux|android|emscripten) FORMATS="make-linux" ;; mac|ios) FORMATS="xcode" ;; win) FORMATS="msvs" ;; esac fi # Default "depth" if test -z "$DEPTH"; then DEPTH=. fi # Default Visual Studio version if test -z "$WIN_MSVS_VERSION"; then WIN_MSVS_VERSION=2010 fi # Default Xcode target SDK if test -z "$XCODE_TARGET_SDK"; then case ${OS} in mac) XCODE_TARGET_SDK="macosx10.8" ;; ios) XCODE_TARGET_SDK="iphoneos" ;; esac fi # Default Xcode host SDK if test -z "$XCODE_HOST_SDK"; then case ${OS} in mac) XCODE_HOST_SDK="${XCODE_TARGET_SDK}" ;; ios) XCODE_HOST_SDK="macosx" ;; esac fi # Default target architectures # iOS architectures are restricted to 32-bit only for iOS 5.1, 6.1 and 7.1 if test -z "$TARGET_ARCH"; then case ${PLATFORM} in *-x86) TARGET_ARCH="x86" ;; *-x86_64) TARGET_ARCH="x86_64" ;; *-armv6) TARGET_ARCH="armv6" ;; emscripten) TARGET_ARCH="js" ;; mac*|ios*) case ${XCODE_TARGET_SDK} in macosx*) TARGET_ARCH="i386" ;; iphoneos5* | \ iphoneos6* | \ iphoneos7*) TARGET_ARCH="armv7" ;; iphoneos*) TARGET_ARCH="armv7 arm64" ;; iphonesimulator5* | \ iphonesimulator6* | \ iphonesimulator7*) TARGET_ARCH="i386" ;; iphonesimulator*) TARGET_ARCH="i386 x86_64" ;; esac ;; *) echo "Couldn't guess 'target_arch'" esac fi # Location of Perl when running Windows builds WIN_PERL=${WIN_PERL:-"C:/perl/bin/perl.exe"} # Android default settings and tools if test "${OS}" = "android" ; then ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-r10d} ANDROID_PLATFORM=${ANDROID_PLATFORM:-android-17} # Attempt to locate an Android NDK if [ -z "${ANDROID_NDK}" -a "${OS}" = "android" ] ; then # Try the symlink we suggest in INSTALL-android.md if [ -d "${HOME}/android/toolchain/android-ndk" ] ; then ANDROID_NDK="${HOME}/android/toolchain/android-ndk" else echo >&2 "Error: Android NDK not found (set \$ANDROID_NDK)" exit 1 fi fi # Attempt to locate an Android SDK if [ -z "${ANDROID_SDK}" ] ; then # Try the symlink we suggest in INSTALL-android.md if [ -d "${HOME}/android/toolchain/android-sdk" ] ; then ANDROID_SDK="${HOME}/android/toolchain/android-sdk" else echo >&2 "Error: Android SDK not found (set \$ANDROID_SDK)" exit 1 fi fi # Attempt to guess the Android build tools version if [ -z "${ANDROID_BUILD_TOOLS}" ] ; then # Check for a sub-folder in the appropriate place # Possibly fragile - are there ever multiple sub-folders? if [ ! "$(echo \"${ANDROID_SDK}/build-tools/\"*)" = "${ANDROID_SDK}/build-tools/*" ] ; then ANDROID_BUILD_TOOLS=$(basename $(echo "${ANDROID_SDK}/build-tools/"*)) else echo >&2 "Error: Android build tools not found (set \$ANDROID_BUILD_TOOLS)" exit 1 fi fi if [ -z "${ANDROID_TOOLCHAIN}" ] ; then # Try the folder we suggest in INSTALL-android.md if [ -d "${HOME}/android/toolchain/standalone" ] ; then ANDROID_TOOLCHAIN="${HOME}/android/toolchain/standalone/bin/arm-linux-androideabi-" else echo >&2 "Error: Android toolchain not found (set \$ANDROID_TOOLCHAIN)" exit 1 fi fi ANDROID_AR=${AR:-${ANDROID_TOOLCHAIN}ar} ANDROID_CC=${CC:-${ANDROID_TOOLCHAIN}clang -target arm-linux-androideabi -march=armv6 -integrated-as} ANDROID_CXX=${CXX:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as} ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as -fuse-ld=bfd} ANDROID_OBJCOPY=${OBJCOPY:-${ANDROID_TOOLCHAIN}objcopy} ANDROID_OBJDUMP=${OBJDUMP:-${ANDROID_TOOLCHAIN}objdump} ANDROID_STRIP=${STRIP:-${ANDROID_TOOLCHAIN}strip} if [ -z "${JAVA_SDK}" ] ; then # Utility used to locate Java on OSX systems if [ -x /usr/libexec/java_home ] ; then ANDROID_JAVA_SDK="$(/usr/libexec/java_home)" elif [ -d /usr/lib/jvm/default ] ; then ANDROID_JAVA_SDK=/usr/lib/jvm/default elif [ -d /usr/lib/jvm/default-java ] ; then ANDROID_JAVA_SDK=/usr/lib/jvm/default-java else echo >&2 "Error: no Java SDK found - set \$JAVA_SDK" exit 1 fi else ANDROID_JAVA_SDK="${JAVA_SDK}" fi fi # End of Android defaults & tools # Emscripten default settings and tools if test "${OS}" = "emscripten" ; then NODE_JS=${NODE_JS:-node} fi ################################################################ # Invoke gyp ################################################################ format_args="$(for f in ${FORMATS}; do echo --format ${f} ; done)" if test "${OS}" = "win" ; then basic_args="${format_args} --depth ${DEPTH} --generator-output ${GENERATOR_OUTPUT}" else basic_args="${format_args} --depth ${DEPTH} --generator-output ${GENERATOR_OUTPUT} -G default_target=default" fi if [ "${BUILD_EDITION}" == "commercial" ] ; then basic_args="${basic_args} ../livecode-commercial.gyp" fi case ${OS} in linux) invoke_gyp $basic_args "-DOS=${OS}" "-Dtarget_arch=${TARGET_ARCH}" "$@" ;; emscripten) export NODE_JS invoke_gyp $basic_args "-DOS=${OS}" "-Dtarget_arch=${TARGET_ARCH}" "$@" ;; android) export ANDROID_BUILD_TOOLS export ANDROID_NDK export ANDROID_PLATFORM export ANDROID_SDK export JAVA_SDK="${ANDROID_JAVA_SDK}" export AR="${ANDROID_AR}" export CC="${ANDROID_CC}" export CXX="${ANDROID_CXX}" export LINK="${ANDROID_LINK}" export OBJCOPY="${ANDROID_OBJCOPY}" export OBJDUMP="${ANDROID_OBJDUMP}" export STRIP="${ANDROID_STRIP}" invoke_gyp $basic_args "-DOS=${OS}" "-Dtarget_arch=${TARGET_ARCH}" \ -Dcross_compile=1 \ "-Gandroid_ndk_version=${ANDROID_NDK_VERSION}" "$@" ;; win) invoke_gyp $basic_args "-Gmsvs_version=${WIN_MSVS_VERSION}" \ "-Dunix_configure=1" \ "-Dperl=${WIN_PERL}" "$@" ;; mac|ios) invoke_gyp $basic_args "-DOS=${OS}" \ "-Dtarget_sdk=${XCODE_TARGET_SDK}" \ "-Dhost_sdk=${XCODE_HOST_SDK}" \ "-Dtarget_arch=${TARGET_ARCH}" "$@" ;; *) echo "ERROR: Bad configuration for generating project files" exit 1 ;; esac |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |