3 # Directories and Files
6 LIBAFLA
=libaudiofile.la
7 AUDDIR
=.
/tools
/audiofile-0.3
.6
10 OPTIONS
=("Analog Camera" "No Draw Distance" "Text-saves" "Smoke Texture Fix" "Release build" "Clean build")
11 EXTRA
=("BETTERCAMERA=1" "NODRAWINGDISTANCE=1" "TEXTSAVES=1" "TEXTURE_FIX=1" "DEBUG=0" "clean")
16 YELLOW
=$
(tput setaf
3)
20 # Checks to see if the libaudio directory and files exist
21 if [ -d "$LIBDIR" -a -e "${LIBDIR}$LIBAFA" -a -e "${LIBDIR}$LIBAFLA" ]; then
22 printf "\n${GREEN}libaudio files exist, going straight to compiling.${RESET}\n"
24 printf "\n${GREEN}libaudio files not found, starting initialization process.${RESET}\n\n"
26 printf "${YELLOW} Changing directory to: ${CYAN}${AUDDIR}${RESET}\n\n"
29 printf "${YELLOW} Executing: ${CYAN}autoreconf -i${RESET}\n\n"
32 printf "\n${YELLOW} Executing: ${CYAN}./configure --disable-docs${RESET}\n\n"
33 PATH
=/mingw64
/bin
:/mingw32
/bin
:$PATH LIBS
=-lstdc++ .
/configure
--disable-docs
35 printf "\n${YELLOW} Executing: ${CYAN}make -j${RESET}\n\n"
36 PATH
=/mingw64
/bin
:/mingw32
/bin
:$PATH make -j
38 printf "\n${YELLOW} Making new directory ${CYAN}../lib${RESET}\n\n"
42 printf "${YELLOW} Copying libaudio files to ${CYAN}../lib${RESET}\n\n"
43 cp libaudiofile
/.libs
/libaudiofile.a ..
/lib
/
44 cp libaudiofile
/.libs
/libaudiofile.la ..
/lib
/
46 printf "${YELLOW} Going up one directory.${RESET}\n\n"
49 printf "${GREEN}Notepad will now open, please follow the instructions carefully.\n\n"
50 printf "${YELLOW}Locate the line: "
51 printf "${CYAN}tabledesign_CFLAGS := -Wno-uninitialized -laudiofile\n"
52 printf "${YELLOW}Then add at the end: ${CYAN}-lstdc++\n"
53 printf "${YELLOW}So it reads: "
54 printf "${CYAN}tabledesign_CFLAGS := -Wno-uninitialized -laudiofile -lstdc++\n\n"
56 read -n 1 -r -s -p $
'\e[32mPRESS ENTER TO CONTINUE...\e[0m\n'
58 printf "${YELLOW} Executing: ${CYAN}make -j${RESET}\n\n"
59 PATH
=/mingw64
/bin
:/mingw32
/bin
:$PATH make -j
61 printf "\n${YELLOW} Going up one directory.${RESET}\n"
66 printf "\nAvaliable options:\n"
67 for i
in ${!OPTIONS[@]}; do
68 printf "%3d%s) %s\n" $
((i
+1)) "${choices[i]:- }" "${OPTIONS[i]}"
70 if [[ "$msg" ]]; then echo "$msg"; fi
71 printf "${YELLOW}Please do not select \"Clean build\" with any other option.\n"
72 printf "Leave all options unchecked for a Vanilla build.\n${RESET}"
75 prompt
="Check an option (again to uncheck, press ENTER):"
76 while menu
&& read -rp "$prompt" num
&& [[ "$num" ]]; do
77 [[ "$num" != *[![:digit
:]]* ]] &&
78 (( num
> 0 && num
<= ${#OPTIONS[@]} )) ||
79 { msg
="Invalid option: $num"; continue; }
80 ((num--
)); # msg="${OPTIONS[num]} was ${choices[num]:+un}checked"
81 [[ "${choices[num]}" ]] && choices
[num
]="" || choices
[num
]="+"
84 for i
in ${!OPTIONS[@]}; do
85 [[ "${choices[i]}" ]] && { CMDL+=" ${EXTRA[i]}"; }
88 printf "\n${YELLOW} Executing: ${CYAN}make ${CMDL} -j${RESET}\n\n"
89 PATH=/mingw32/bin:/mingw64/bin:$PATH make $CMDL -j
91 if [ "${CMDL}" != " clean
" ]; then
93 printf "\n${GREEN}If all went well you should have a compiled .EXE
in the
'builds/us_pc/' folder.
\n"
94 printf "${CYAN}Would you like to run the game?
[y or n
]: ${RESET}"
97 if [ "${TEST}" = "y
" ]; then
98 exec ./build/us_pc/sm64.us.f3dex2e.exe
101 printf "\nYour build is now clean
\n"