forked from libretro/libretro-super
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libretro-super.sh
executable file
·764 lines (659 loc) · 19.3 KB
/
libretro-super.sh
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
#! /usr/bin/env bash
# vim: set ts=3 sw=3 noet ft=sh : bash
libretro_version="1.1"
default_actions="fetch clean compile"
SCRIPT="${0#./}"
BASE_DIR="${SCRIPT%/*}"
WORKDIR="$PWD"
if [ "$BASE_DIR" = "$SCRIPT" ]; then
BASE_DIR="$WORKDIR"
else
if [[ "$0" != /* ]]; then
# Make the path absolute
BASE_DIR="$WORKDIR/$BASE_DIR"
fi
fi
####################################################################
##
## NEW TOOLCHAIN STUFF
## FIXME: This stuff is incomplete and won't quite work as I've done it here.
## Doing it right is going to depend on the config submodule which isn't
## written yet. Probably after 1.1... :/
##
####################################################################
#
##register_toolchain osx x86 x86_64
#toolchain_osx_CC="cc"
#toolchain_osx_CXX="c++"
#toolchain_osx_CXX11="clang++"
#toolchain_osx_CXX11_args="-std=c++11 -stdlib=libc++"
#toolchain_osx_x86_args=" -arch i386"
#toolchain_osx_x86_64_args=" -arch x86_64"
#toolchain_osx_platform="osx"
#
##register_toolchain ios armv7 # x86?
#toolchain_ios_CC="cc"
#toolchain_ios_CXX="c++"
#toolchain_ios_CXX11="clang++"
#toolchain_ios_CXX11_args="-std=c++11 -stdlib=libc++"
#toolchain_ios_armv7_args="-arch armv7 -marm -miphoneos-version-min=5.0 -isysroot \$IOSSDK"
#toolchain_ios_platform="ios"
#toolchain_ios_configure() {
# if [ -z "$IOSSDK" ]; then
# if [ -z "${xcodebuild:-$(find_tool xcodebuild)}" ]; then
# lsecho "You must set IOSSDK or have xcodebuild in your path for ios"
# return 1
# fi
# export IOSSDK=$(xcodebuild -version -sdk iphoneos Path)
# fi
#
# if [ ! -d "$IOSSDK/usr" ]; then
# lsecho "\"$IOSSDK\" does not appear to be a valid iOS SDK."
# return 1
# fi
#}
#
#toolchain_guess() {
# if [ -z "${UNAME:+$(find_tool $LIBRETRO_UNAME uname)}" ]; then
# lsecho "toolchain_guess: cannot find the uname program to guess your platform"
# return 1
# fi
#
# local cpu="$(uname -m)"
# case "$cpu" in
# x86_64) ;;
# i[3456]86) ;;
# armv4) ;;
# armv7) ;;
# esac
#
# local os="$(uname -s)"
#
# case "$(uname -s)" in
# # uname will find these
#
# *BSD*) os="bsd" ;;
# linux) os="linux" ;;
# *mingw*|*MINGW*|*MSYS_NT*) os="win" ;;
#
# Darwin)
# # TODO: This won't support iOS simulator, add something that will
# if [ "$cpu" = arm* ]; then
# os="ios"
# else
# os="osx"
# fi
# ;;
#
# # Consoles and mobile, uname won't usually report these
# android) os="android" ;;
# ios) os="ios" ;;
# ngc) os="ngc" ;;
# psp1) os="psp1" ;;
# wii) os="wii" ;;
# esac
#}
#
#toolchain_setup() {
# if [[ "$1" != *-* ]]; then
# lsecho "toolchain_setup: Invalid platform \"$1\""
# return 1
# fi
# local os="${1%%-*}"
# local cpu="${1#*-}"
#
# eval "local cpu_prefix=\"\$toolchain_${os}_${cpu}_prefix\""
# eval "local cpu_suffix=\"\$toolchain_${os}_${cpu}_suffix\""
# eval "local cpu_args=\"\$toolchain_${os}_${cpu}_args\""
# toolchain_platform="$1"
#
# if [ "$(type -t toolchain_${os}_configure)" ]; then
# toolchain_configure=toolchatarget_in_${os}_configure
# else
# toolchain_configure=do_nothing
# fi
#
# for compiler in CC CXX CXX11; do
# eval "cmdline=\"\$toolchain_${os}_${cpu}_prefix\$toolchain_${os}_${compiler}\$toolchain_${os}_${cpu}_suffix\""
# eval "compiler_args=\"\$toolchain_${os}_${compiler}_args\""
# if command -v $cmdline > /dev/null; then
# eval "toolchain_$compiler=\"\$cmdline\${cpu_args:+ \$cpu_args}\${compiler_args:+ \$compiler_args}\""
# else
# eval "toolchain_$compiler=\"\""
# fi
# done
#}
###################################################################
#
# OLD TOOLCHAIN STUFF (basically libretro-config.sh)
# For now, if you want to build for other than the detected default
# you're going to have to do it the old way. Something like this:
#
# platform=<foo> ARCH=<bar> ./libretro-super.sh
#
# This will be replaced by a rules-based solution (similar to how
# cores are handled, but not yet.
#
###################################################################
# The platform variable is normally not set at the time libretro-config is
# included by libretro-build.sh. Other platform scripts may begin to include
# libretro-config as well if they define their platform-specific code in the
# case block below. This is a band-aid fix that we will address after 1.1 is
# released.
case "$platform" in
##
## Configs that did not use libretro-config originally
## TODO: Integrate this with everything else (post-1.1)
##
ios)
# NOTE: This config requires a Mac with an Xcode installation. These
# scripts will work at least as far as 10.5 that we're sure of, but
# we build with clang targeting iOS >= 5. We'll accept patches for
# older versions of iOS.
DIST_DIR="ios"
FORMAT_EXT=dylib
IOS=1
ARCH=armv7
FORMAT=_ios
FORMAT_COMPILER_TARGET=ios
FORMAT_COMPILER_TARGET_ALT=ios
export IOSSDK=$(xcodebuild -version -sdk iphoneos Path)
iosver=$(xcodebuild -version -sdk iphoneos ProductVersion)
IOSVER_MAJOR=${iosver%.*}
IOSVER_MINOR=${iosver#*.}
IOSVER=${IOSVER_MAJOR}${IOSVER_MINOR}
MIN_IOS5="-miphoneos-version-min=5.0"
MIN_IOS7="-miphoneos-version-min=7.0"
# Use generic names rather than gcc/clang to better support both
CC="cc -arch armv7 -marm -miphoneos-version-min=5.0 -isysroot $IOSSDK"
CXX="c++ -arch armv7 -marm -miphoneos-version-min=5.0 -isysroot $IOSSDK"
CXX11="clang++ -std=c++11 -stdlib=libc++ -arch armv7 -marm -miphoneos-version-min=5.0 -isysroot $IOSSDK"
;;
##
## Original libretro-config path
##
*)
# Architecture Assignment
config_cpu() {
[ -n "$2" ] && ARCH="$1"
[ -z "$ARCH" ] && ARCH="$(uname -m)"
case "$ARCH" in
x86_64)
X86=true
X86_64=true
;;
i386|i686)
X86=true
;;
armv*)
ARM=true
export FORMAT_COMPILER_TARGET=armv
export RARCHCFLAGS="$RARCHCFLAGS -marm"
case "$ARCH" in
armv5tel) ARMV5=true ;;
armv6l) ARMV6=true ;;
armv7l) ARMV7=true ;;
esac
;;
esac
if [ -n "$PROCESSOR_ARCHITEW6432" -a "$PROCESSOR_ARCHITEW6432" = "AMD64" ]; then
ARCH=x86_64
X86=true && X86_64=true
fi
}
# Platform Assignment
config_platform() {
[ -n "$1" ] && platform="$1"
[ -z "$platform" ] && platform="$(uname)"
case "$platform" in
*BSD*)
platform=bsd
FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="unix"
DIST_DIR="bsd"
;;
*Haiku*)
platform=haiku
FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="unix"
DIST_DIR="haiku"
;;
osx|*Darwin*)
platform=osx
FORMAT_EXT="dylib"
FORMAT_COMPILER_TARGET="osx"
case "$ARCH" in
x86_64|i386|ppc*)
DIST_DIR="osx-$ARCH"
;;
*)
DIST_DIR="osx-unknown"
;;
esac
;;
win|*mingw32*|*MINGW32*|*MSYS_NT*)
platform=win
FORMAT_EXT="dll"
FORMAT_COMPILER_TARGET="win"
DIST_DIR="win_x86"
;;
win64|*mingw64*|*MINGW64*)
platform=win
FORMAT_EXT="dll"
FORMAT_COMPILER_TARGET="win"
DIST_DIR="win_x64"
;;
*psp1*)
platform=psp1
FORMAT_EXT="a"
FORMAT_COMPILER_TARGET="psp1"
DIST_DIR="psp1"
;;
*ps2*)
platform=ps2
FORMAT_EXT="a"
FORMAT_COMPILER_TARGET="ps2"
DIST_DIR="ps2"
;;
*wii*)
platform=wii
FORMAT_EXT="a"
FORMAT_COMPILER_TARGET="wii"
DIST_DIR="wii"
;;
*ngc*)
platform=ngc
FORMAT_EXT="a"
FORMAT_COMPILER_TARGET="ngc"
DIST_DIR="ngc"
;;
theos_ios*)
platform=theos_ios
FORMAT_EXT="dylib"
FORMAT_COMPILER_TARGET="theos_ios"
DIST_DIR="theos_ios"
;;
android)
FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="android"
DIST_DIR="android"
;;
android-armv7)
FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="android-armv7"
DIST_DIR="android/armeabi-v7a"
;;
*)
FORMAT_EXT="so"
FORMAT_COMPILER_TARGET="unix"
DIST_DIR="unix"
;;
esac
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
}
config_log_build_host() {
echo "PLATFORM: $platform"
echo "ARCHITECTURE: $ARCH"
echo "TARGET: $FORMAT_COMPILER_TARGET"
}
config_cpu
config_platform
config_log_build_host
if [ -z "$JOBS" ]; then
# nproc is generally Linux-specific.
if command -v nproc >/dev/null; then
JOBS="$(nproc)"
elif [ "$pltaform" = "osx" ] && command -v sysctl >/dev/null; then
JOBS="$(sysctl -n hw.physicalcpu)"
else
JOBS=1
fi
fi
;;
esac
# Taken from LIBRETRO-BUILD-COMMON.SH
[[ "${ARM_NEON}" ]] && echo '=== ARM NEON opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-neon"
[[ "${CORTEX_A8}" ]] && echo '=== Cortex A8 opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-cortexa8"
[[ "${CORTEX_A9}" ]] && echo '=== Cortex A9 opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-cortexa9"
[[ "${ARM_HARDFLOAT}" ]] && echo '=== ARM hardfloat ABI enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-hardfloat"
[[ "${ARM_SOFTFLOAT}" ]] && echo '=== ARM softfloat ABI enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-softfloat"
[[ "$X86" ]] && echo '=== x86 CPU detected... ==='
[[ "$X86" ]] && [[ "$X86_64" ]] && echo '=== x86_64 CPU detected... ==='
#if uncommented, will build experimental cores as well which are not yet fit for release.
#export BUILD_EXPERIMENTAL=1
#ARM DEFINES
#===========
#if uncommented, will build cores with Cortex A8 compiler optimizations
#export CORTEX_A8=1
#if uncommented, will build cores with Cortex A9 compiler optimizations
#export CORTEX_A9=1
#if uncommented, will build cores with ARM hardfloat ABI
#export ARM_HARDFLOAT=1
#if uncommented, will build cores with ARM softfloat ABI
#export ARM_SOFTFLOAT=1
#if uncommented, will build cores with ARM NEON support (ARMv7+ only)
#export ARM_NEON=1
#OPENGL DEFINES
#==============
#if uncommented, will build libretro GL cores. Ignored for mobile platforms - GL cores will always be built there.
export BUILD_LIBRETRO_GL=1
#if uncommented, will build cores with OpenGL ES 2 support. Not needed
#for platform-specific cores - only for generic core builds (ie. libretro-build.sh)
#export ENABLE_GLES=1
#ANDROID DEFINES
#================
export TARGET_ABIS="armeabi armeabi-v7a x86"
#uncomment to define NDK standalone toolchain for ARM
#export NDK_ROOT_DIR_ARM =
#uncomment to define NDK standalone toolchain for MIPS
#export NDK_ROOT_DIR_MIPS =
#uncomment to define NDK standalone toolchain for x86
#export NDK_ROOT_DIR_X86 =
# android version target if GLES is in use
export NDK_GL_HEADER_VER=android-18
# android version target if GLES is not in use
export NDK_NO_GL_HEADER_VER=android-9
# Retroarch target android API level
export RA_ANDROID_API=android-18
# Retroarch minimum API level (defines low end android version compatability)
export RA_ANDROID_MIN_API=android-9
#OSX DEFINES
#===========
# [snip]
# Let's disable universal builds completely for now. We don't use it, the new
# toolchain code won't need it, and most of the cores don't currently support
# it anyway. We'll revisit this later.
export NOUNIVERSAL=1
# OUTPUT AND LOGGING
# ==================
#
# This is kind of an inline design document that'll be changed for basic user
# instructions when the logging system is finished and tested.
#
# libretro-super has two kinds of output, the basic kind showing what the
# script is doing in a big-picture sense, and the commands and output from
# individual commands. End-users don't necessarily need to see this more
# detailed output, except when we're talking about huge cores like mame.
#
# If each can be directed to null, to the screen, to a log file, or to both
# the screen and a log file, you end up with a matrix os 16 possibilities. Of
# those, only a few are truly useful:
#
# Basic Detailed Useful to
# screen screen developer/end-user w/ space issues
# screen both developer
# both both developer
# screen log end-user
# log log buildbot
#
# What this tells me is that we need to log by default, as long as we kill
# old logfiles to avoid filling your HD with gigabytes of mame build logs.
# Output should go to both screen and log for developers, but users don't need
# to see the make commands, etc. Being able to disable both would be useful,
# but that a near-term TODO item. That just leaves being able to squelch the
# screen output for buildbot usage, and that's just > /dev/null on the command
# line, so not our problem here.
#
# Again, the ability to turn OFF these logs will be wanted very soon.
# Uncomment this to avoid clobbering logs
#LIBRETRO_LOG_APPEND=1
# Change this to adjust where logs are written
#LIBRETRO_LOG_DIR="$WORKDIR/log"
# Change this to rename the libretro-super main log file
#LIBRETRO_LOG_SUPER="libretro-super.log"
# Change this to rename core log files (%s for core's "safe" name)
#LIBRETRO_LOG_CORE="%s.log"
# Comment this if you don't need to see developer output
LIBRETRO_DEVELOPER=1
# COLOR IN OUTPUT
# ===============
#
# If you don't like ANSI-style color in your output, uncomment this line.
#NO_COLOR=1
# If you want to force it even in log files, uncomment this line.
#FORCE_COLOR=1
#USER DEFINES
#------------
#These options should be defined inside your own
#local libretro-config-user.sh file rather than here.
#The following below is just a sample.
if [ -f "$WORKDIR/libretro-config-user.sh" ]; then
. "$WORKDIR/libretro-config-user.sh"
fi
###################################################################
#
# LIBRETRO-BUILD-COMMON
# Summary already re-written, CORE_SUFFIX def may be moved
# RARCH_DIST_DIR stuff will change with new toolchain code
#
###################################################################
CORE_SUFFIX="_libretro${FORMAT}.$FORMAT_EXT"
summary() {
# fmt is external and may not be available
fmt_output="$(find_tool "fmt")"
local num_success="$(numwords $build_success)"
local fmt_success="${fmt_output:+$(echo " $build_success" | $fmt_output)}"
local num_fail="$(numwords $build_fail)"
local fmt_fail="${fmt_output:+$(echo " $build_fail" | $fmt_output)}"
if [[ -z "$build_success" && -z "$build_fail" ]]; then
lsecho "No build actions performed."
return
fi
if [ -n "$build_success" ]; then
secho "$(color 32)$num_success module(s)$(color) compiled successfully:"
lecho "$num_success module(s) successfully processed:"
lsecho "$fmt_success"
fi
if [ -n "$build_fail" ]; then
secho "$(color 31)$num_fail module(s)$(color) failed to compile:"
lecho "$num_fail module(s) failed:"
lsecho "$fmt_fail"
fi
}
create_dist_dir() {
mkdir -p "$RARCH_DIST_DIR"
}
if [ -z "$RARCH_DIST_DIR" ]; then
RARCH_DIR="$WORKDIR/dist"
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
fi
create_dist_dir
# The following bits are from libretro-build.sh
# Will replace with new toolchain code later
if [ -z "$JOBS" ]; then
JOBS=7
fi
if [ "$HOST_CC" ]; then
CC="${HOST_CC}-gcc"
CXX="${HOST_CC}-g++"
CXX11="${HOST_CC}-g++"
STRIP="${HOST_CC}-strip"
fi
if [ -z "$MAKE" ]; then
if uname -s | grep -i MINGW > /dev/null 2>&1; then
MAKE=mingw32-make
else
if type gmake > /dev/null 2>&1; then
MAKE=gmake
else
MAKE=make
fi
fi
fi
if [ -z "$CC" ]; then
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CC=cc
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
CC=mingw32-gcc
else
CC=gcc
fi
fi
if [ -z "$CXX" ]; then
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
CXX=c++
CXX11="clang++ -std=c++11 -stdlib=libc++"
# FIXME: Do this right later.
if [ "$ARCH" = "i386" ]; then
CC="cc -arch i386"
CXX="c++ -arch i386"
CXX11="clang++ -arch i386 -std=c++11 -stdlib=libc++"
fi
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
CXX=mingw32-g++
CXX11=mingw32-g++
else
CXX=g++
CXX11=g++
fi
fi
FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET
###################################################################
#
# END OF INSERTED OLD SCRIPT BITS
#
###################################################################
shopt -q nullglob || reset_nullglob=1
. "$BASE_DIR/script-modules/log.sh"
. "$BASE_DIR/script-modules/util.sh"
. "$BASE_DIR/script-modules/fetch-rules.sh"
. "$BASE_DIR/script-modules/cpu.sh"
. "$BASE_DIR/script-modules/module_base.sh"
. "$BASE_DIR/script-modules/module_process.sh"
# Read all of the rules file
shopt -s nullglob
cd "$BASE_DIR" # Cope with whitespace in $BASE_DIR
for rules_file in rules.d/*; do
. $rules_file
done
[ -n "$reset_noglob" ] && shopt -u nullglob
skip_unchanged=""
libretro_log_init
if [ -n "$1" ]; then
opt_terminator=""
actions=""
types=""
process=""
while [ -n "$1" ]; do
if [[ "$1" = -* && -z "$opt_terminator" ]]; then
case "$1" in
#
# Informational
#
# TODO
--help)
info_only=1
;;
--license|--licence)
info_only=1
show_license=1
LIBRETRO_LOG_SUPER=""
LIBRETRO_LOG_MODULE=""
;;
--nologs)
LIBRETRO_LOG_SUPER=""
LIBRETRO_LOG_MODULE=""
;;
#
# Configuration controls
#
# TODO
--config|--configure) ;;
--devel) LIBRETRO_DEVELOPER=1 ;;
--no-devel) LIBRETRO_DEVELOPER="" ;;
--force) force=1 ;;
--skip-unchanged) skip_unchanged=1 ;;
--no-skip-unchanged) skip_unchanged=0 ;;
#
# Action controls
#
--default)
actions="$default_actions"
;;
--fetch)
actions="$actions fetch"
;;
--clean)
actions="$actions clean"
;;
--compile)
actions="$actions compile"
;;
--build)
actions="$actions clean compile"
;;
--package)
actions="$actions package"
;;
#
# Toolchain controls
#
# TODO, requires configuration system
#
# Module type controls
#
--cores) modtypes="$modtypes cores" ;;
--devkit) modtypes="$modtypes devkits" ;;
--players) modtypes="$modtypes players" ;;
#
# Script plumbing
#
# In case there's ever a need for an option terminator
--) opt_terminator=1 ;;
# Something starting with - that we don't recognize
*)
echo "Unknown command \"$1\""
exit 1
;;
esac
shift
continue
fi
# Non-commands are operating targets
process="$process $1"
shift
done
fi
lsecho "libretro-super v$libretro_version
Script Copyright (C) 2015 by The Libretro Team"
if [ -n "$show_license" ]; then
lsecho "
This script and its components are a work that is licensed under the
Creative Commons Attribution 4.0 International License. To view a copy of
this license, visit http://creativecommons.org/licenses/by/4.0/ or send a
letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA."
exit 0
fi
lsecho "Licensed under CC-BY-4.0 (--license for details)"
if [ -n "$info_only" ]; then
exit 0
fi
# Configure some defaults
[ -z "$actions" ] && actions="$default_actions"
[ -z "$modtypes" ] && modtypes="cores players ${LIBRETRO_DEVELOPER:+devkits}"
[ -n "$process" ] && force=1
# If user didn't ask for anything, they want "everything" (new, at least)
if [ -z "$process" ]; then
[ -z "$skip_unchanged" ] && skip_unchanged=1
if [[ "$modtypes" = *cores* ]]; then
for target in $libretro_cores; do
if [ -n "$LIBRETRO_DEVELOPER" ] || can_build_module $target; then
process="$process $target"
fi
done
fi
# TODO: players and devkits
else
# If user has asked for something specific, don't skip it
[ -z "$skip_unchanged" ] && skip_unchanged=0
fi
###################################################################
#
# DO STUFF
# The bit of this script that actually does all the work is here
#
###################################################################
for target in $process; do
module_process $target
done
summary