Various fixes and updates

This commit is contained in:
Alcaro 2019-04-28 21:58:26 +02:00
parent 7e78e9e3cd
commit 373ea0ae5c
6 changed files with 84 additions and 62 deletions

View File

@ -31,11 +31,11 @@ Third-party forks, or separate tools, covering usecases this version doesn't (th
Compilation - Linux (Debian/Ubuntu):
- `sudo apt-get install g++ build-essential`; for GUI support, also `sudo apt-get install libgtk-3-dev pkg-config`
- `./make.sh` to build an optimized binary; for development, use `make CFLAGS=-g`
- `./make.sh` to build an optimized binary; for development, use `make CFLAGS=-g` (ignore make-maintainer.sh)
Compilation - other Linux:
- Install make and g++; for GUI support, also install pkg-config and GTK+ 3 headers; for profiling support, also install curl or wget
- `./make.sh` to build an optimized binary; for development, use `make CFLAGS=-g`
- `./make.sh` to build an optimized binary; for development, use `make CFLAGS=-g` (ignore make-maintainer.sh)
Compilation - OSX, other Unix, or anything else with a C++ compiler:
- Install a C++ compiler
@ -46,7 +46,7 @@ Compilation - OSX, other Unix, or anything else with a C++ compiler:
Compilation - Windows:
- Install [mingw-w64](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.2.0/threads-win32/seh/)
- `mingw32-make CFLAGS=-O3` (GUI is automatically enabled), or extract the appropriate optimization commands from make.sh
- Alternatively, [here's a binary](https://www.smwcentral.net/?p=section&a=details&id=11474).
- Alternatively, [here's a binary](https://www.smwcentral.net/?p=section&a=details&id=11474) (though it's slightly outdated).
Usage:
- If GUI is enabled, just run the program. File pickers' window titles tell what they want; Enable automatic ROM picker and Run in Emulator can cause file pickers to appear and disappear depending on the chosen patch, making usage less predictable, so it's disabled by default.

View File

@ -1157,6 +1157,7 @@ void usage()
GUIClaimConsole();
fputs(
// 12345678901234567890123456789012345678901234567890123456789012345678901234567890
flipsversion "\n"
"usage:\n"
" "
#ifndef FLIPS_CLI
@ -1295,6 +1296,9 @@ int flipsmain(int argc, WCHAR * argv[])
else if (!wcscmp(argv[i], TEXT("--help")) || !wcscmp(argv[i], TEXT("-h")) || !wcscmp(argv[i], TEXT("-?"))) usage();
else usage();
}
#ifdef _WIN32
else if (!wcscmp(argv[i], TEXT("/?"))) usage();
#endif
else
{
if (numargs==3) usage();

58
make-maintainer.sh Executable file
View File

@ -0,0 +1,58 @@
#!/bin/sh
if [ "$HOME" != "/home/alcaro" ]; then
#This script is for making official releases, including a Windows build.
#If you're intending to fork Floating IPS, or take over maintenance, you're welcome to edit this script.
#If not, you don't want it. make.sh enables all optimizations for a local build.
echo "Use ./make.sh instead."
exit 1
fi
rm floating.zip
profile/download.sh || exit $?
# . rather than ./make.sh, so $FLAGS remains set
. ./make.sh
mv flips flips-linux
7z a floating.zip flips-linux
mv ./flips-linux ~/bin/flips
#create windows binary
mingwver 64 || true # this is a script that sets the Wine PATH
#if trying to make a 32bit Flips, add -Wl,--large-address-aware
#I am not completely sure if this is a good idea.
FLAGS=$FLAGS' -fopenmp'
FLAGS=$FLAGS' Z:/home/alcaro/tools/mingw64-8.1.0/lib/gcc/x86_64-w64-mingw32/8.1.0/libgomp.a'
FLAGS=$FLAGS' Z:/home/alcaro/tools/mingw64-8.1.0/lib/gcc/x86_64-w64-mingw32/8.1.0/libgcc_eh.a'
FLAGS=$FLAGS' Z:/home/alcaro/tools/mingw64-8.1.0/x86_64-w64-mingw32/lib/libwinpthread.a'
echo 'Windows (1/3)'
rm obj/* flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-generate -lgcov"
[ -e flips.exe ] || exit
echo 'Windows (2/3)'
profile/profile.sh 'wine flips.exe'
echo 'Windows (3/3)'
rm flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-use"
#verify that there are no unexpected dependencies
objdump -p flips.exe | grep 'DLL Name' | \
grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32)' && \
echo "Invalid dependency" && exit
#test cli binaries
echo "CLI"
make TARGET=cli DIVSUF=no
[ -e flips ] || exit
rm flips
echo Finishing
7z a floating.zip flips.exe
zipcrush floating.zip
#The random numbers are the size of Lunar IPS v1.02, which I wish to stay below.
#(Or wished a while ago, but my feature set is so much greater than Lunar that I'll accept being bigger.)
echo Size: $(stat -c%s flips.exe)/155648
echo \(Linux: $(stat -c%s ~/bin/flips)\)
echo \(Zipped: $(stat -c%s floating.zip)/59881\)
#./special.sh

View File

@ -1,46 +0,0 @@
#!/bin/sh
if [ "$HOME" != "/home/alcaro" ]; then
#This script is for making official releases only.
#If you're intending to fork Floating IPS, or take over maintenance, you're welcome to edit this script.
echo "Use ./make.sh instead."
exit 1
fi
profile/download.sh || exit $?
# . rather than ./make.sh, so $FLAGS remains set
. ./make.sh
mv ./flips ~/bin/flips
#create windows binary
mingwver 64 || true # this is a script that sets the Wine PATH
echo 'Windows (1/3)'
rm obj/* flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-generate -lgcov"
[ -e flips.exe ] || exit
echo 'Windows (2/3)'
profile/profile.sh 'wine flips.exe'
echo 'Windows (3/3)'
rm flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-use"
#verify there are no unexpected dependencies
objdump -p flips.exe | grep 'DLL Name' | \
grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32)' && \
echo "Invalid dependency" && exit
#test cli binaries
echo "CLI"
make TARGET=cli DIVSUF=no
[ -e flips ] || exit
rm flips
#echo Finishing
#7z a floating.zip flips.exe
#zipcrush floating.zip
##The random numbers are the size of Lunar IPS, which I wish to stay below.
##(Or wished a while ago, but my feature set is so much greater than Lunar that I'll accept being bigger.)
#echo Size: $(stat -c%s flips.exe)/96768
#echo \(Linux: $(stat -c%s ~/bin/flips)\)
#echo \(Zipped: $(stat -c%s floating.zip)/59881\)
#./special.sh

28
make.sh
View File

@ -5,7 +5,7 @@
FLAGS='-Wall -Werror -O3 -s -flto -fuse-linker-plugin -fweb -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden'
FLAGS=$FLAGS' -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables'
FLAGS=$FLAGS' -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/'
#Linux flags - they don't make sense on Windows
#Linux flags, they don't make sense on Windows
#make-release.sh uses this
LINFLAGS=' -Wl,-z,relro,-z,now,--as-needed,--hash-style=gnu,--relax'
@ -16,6 +16,8 @@ if [ -e profile/firefox-45.0esr.tar ]; then
touch profile/firefox-10.0esr.tar
fi
PROFILE=yes
for i in "$@"; do
case "$i" in
--harden=no)
@ -26,24 +28,28 @@ case "$i" in
FLAGS=$FLAGS' -mmitigate-rop'
;;
--profile=no)
echo n > profile/choice
rm profile/firefox-10.0esr.tar
rm profile/firefox-17.0esr.tar
echo n > profile/choice
rm profile/firefox-10.0esr.tar
rm profile/firefox-17.0esr.tar
;;
--profile=no-once)
PROFILE=no
;;
--profile=yes)
if [ ! -e profile/firefox-10.0esr.tar ]; then
profile/download.sh || exit $?
fi
if [ ! -e profile/firefox-10.0esr.tar ]; then
profile/download.sh || exit $?
fi
;;
*)
echo "Unknown argument $1; valid arguments are: --harden=no --harden=yes --profile=no --profile=yes"
echo "Unknown argument $1; valid arguments are:"
echo "--harden=no --harden=yes --profile=no --profile=no-once --profile=yes"
exit 1
;;
esac
done
if [ ! -e profile/choice ]; then
if [ $PROFILE = yes -a ! -e profile/choice ]; then
while true; do
# 1 2 3 4 5 6 7 8
# 12345678901234567890123456789012345678901234567890123456789012345678901234567890
@ -64,9 +70,9 @@ if [ -e profile/firefox-10.0esr.tar ]; then
profile/download.sh || exit $?
fi
rm flips flips.exe floating.zip obj/*
rm flips flips.exe obj/*
if [ -e profile/firefox-10.0esr.tar ]; then
if [ $PROFILE = yes -a -e profile/firefox-10.0esr.tar ]; then
echo 'GTK+ (1/3)'
rm obj/* flips; TARGET=gtk make OPTFLAGS="$FLAGS$LINFLAGS -fprofile-generate -lgcov" || exit $?
[ -e flips ] || exit 1

View File

@ -1,8 +1,8 @@
#!/bin/sh
#why firefox? I need two large, freely available, mostly similar, binary files; two versions of an executable would be a good choice
#why 10/17? older firefoxes are smaller, so profiling needs less RAM; but I also want to skip a few versions,
# to ensure they're not too similar; and I want something chosen with a minimum of arbitrariness. The oldest ESRs satisfy those constraints.
#why 10/17? older firefoxes are smaller, so profiling needs less RAM; but I also want to skip a few versions, to ensure they're
# not too similar; and I want something chosen with a minimum of arbitrariness. The oldest ESRs satisfy those constraints.
SRC=profile/firefox-10.0esr.tar
DST=profile/firefox-17.0esr.tar
SRCSIZE=39526400