Created
October 12, 2015 00:01
-
-
Save Anime4000/dd4602952c57a313667b to your computer and use it in GitHub Desktop.
mkbundle Mono 4.0 and Cygwin (32bit mode)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run this on Cygwin Terminal | |
# | |
# Required: | |
# 1. gcc-mingw | |
# 2. pkg-config | |
# 3. mingw-zlib1 | |
# 4. mingw-zlib-devel | |
# | |
# Adjust: | |
# 1. copy "/bin/i686-pc-mingw32-as.exe" to "/bin/as.exe" | |
# 2. copy "/bin/i686-pc-mingw32-windres.exe" to "/bin/windres.exe" | |
# Note: | |
# https://gist.github.com/tebjan/5581296 | |
# http://stackoverflow.com/questions/4474613/can-not-compile-simple-c-sharp-application-with-mkbundle | |
# crash immediately if anything bad happens | |
set -o errexit | |
set -o nounset | |
export MONO=/cygdrive/c/progra~2/Mono | |
export PATH=$PATH:$MONO/bin | |
export PKG_CONFIG_PATH=$MONO/lib/pkgconfig | |
machineconfig=$PROGRAMFILES\\Mono\\etc\\mono\\4.0\\machine.config | |
# Add an icon, create .rc, compile | |
icon_name='"icon.ico"' | |
echo "1 ICON $icon_name" > icon.rc | |
windres icon.rc icon.o | |
# mkbundle | |
mkbundle -c -o host.c -oo bundle.o --machine-config "$machineconfig" --deps ifme.exe INIFileParser.dll MediaInfoDotNet.dll | |
# gcc | |
gcc -U _WIN32 -Os -o ifme-mono.exe -Wall host.c `pkg-config --cflags --libs mono-2` icon.o bundle.o | |
# Copy mono-2.0.dll and zlib1.dll here since they depends on it. | |
cp $MONO/bin/mono-2.0.dll ./ | |
cp $MONO/bin/zlib1.dll ./ | |
# clean | |
rm icon.rc | |
rm icon.o | |
rm bundle.o | |
rm host.c | |
rm temp.c | |
rm temp.o | |
rm temp.s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment