build: fix MacOS support
- Detect host OS - Add CoreFoundation framework to linker flags - Comment out a chdir which breaks the app on load - Document how to work around locale building on a Mac Fixes #3
This commit is contained in:
parent
d6731c09d4
commit
c4f3a1f936
|
@ -13,10 +13,12 @@ src/starfighter
|
|||
aclocal.m4
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
|
@ -28,6 +30,7 @@ config.h.in~
|
|||
src/Makefile
|
||||
src/Makefile.in
|
||||
src/.deps
|
||||
src/conf
|
||||
misc/Makefile
|
||||
misc/Makefile.in
|
||||
misc/.deps
|
||||
|
|
|
@ -136,6 +136,14 @@ terminal window:
|
|||
|
||||
The arguments to autoreconf are technically optional, but recommended.
|
||||
|
||||
The Python script build.py may fail on MacOS due to a missing msgfmt
|
||||
program. msgfmt is part of gettext and the version that ships on a Mac
|
||||
does not include the msgfmt utility. This can be solved by using gettext
|
||||
from Homebrew:
|
||||
|
||||
brew install gettext
|
||||
export PATH="$(brew --prefix gettext)/bin:$PATH"
|
||||
|
||||
If for some reason you need to remove all of these files from your
|
||||
directory, you can do so via the following command (requires Git):
|
||||
|
||||
|
@ -143,4 +151,3 @@ directory, you can do so via the following command (requires Git):
|
|||
|
||||
Note: automatically generated files are listed in .gitignore, so you
|
||||
generally don't actually have to do this.
|
||||
|
||||
|
|
12
configure.ac
12
configure.ac
|
@ -20,6 +20,18 @@ AC_PROG_INSTALL
|
|||
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\" -Wall -Wformat-truncation=0"
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
# Detect MacOS
|
||||
AC_CANONICAL_HOST
|
||||
build_mac=no
|
||||
|
||||
case $host_os in
|
||||
darwin*) build_mac=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([BUILD_MACOS], [test "$build_mac" = "yes"])
|
||||
|
||||
AC_SEARCH_LIBS([atanf], [m])
|
||||
|
||||
PKG_CHECK_EXISTS([SDL2_mixer], [
|
||||
|
|
|
@ -11,6 +11,10 @@ else
|
|||
starfighter_CPPFLAGS = $(STARFIGHTER_CPPFLAGS) -DDATADIR=\"$(pkgdatadir)\"
|
||||
endif
|
||||
|
||||
if BUILD_MACOS
|
||||
starfighter_LDFLAGS = -framework CoreFoundation
|
||||
endif
|
||||
|
||||
starfighter_CFLAGS = $(SDL_CFLAGS) $(PANGO_CFLAGS)
|
||||
starfighter_LDADD = $(SDL_LIBS) $(PANGO_LIBS)
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ int main(int argc, char **argv)
|
|||
char path[PATH_MAX];
|
||||
if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
|
||||
{
|
||||
chdir(path);
|
||||
// chdir(path);
|
||||
printf("Current directory \"%s\"\n", path);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue