Reorganized the Mac stuff.

This commit is contained in:
Layla Marchant 2020-03-12 16:01:13 -04:00
parent 0ec878c213
commit e382adb08a
2 changed files with 11 additions and 10 deletions

View File

@ -18,20 +18,19 @@ AC_PROG_CC
AC_PROG_INSTALL
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\" -Wall -Wformat-truncation=0"
STARFIGHTER_LDADD=""
# Checks for libraries.
# Detect MacOS
AC_CANONICAL_HOST
build_mac=no
case $host_os in
darwin*) build_mac=yes
darwin*)
build_mac=1
;;
esac
AM_CONDITIONAL([BUILD_MACOS], [test "$build_mac" = "yes"])
AC_SEARCH_LIBS([atanf], [m])
PKG_CHECK_EXISTS([SDL2_mixer], [
@ -85,9 +84,15 @@ AS_IF([test -n "$SF_RUN_IN_PLACE"], [
echo "Preparing a run-in-place build"
])
AS_IF([test -n "$build_mac"], [
STARFIGHTER_LDADD="$STARFIGHTER_LDADD -framework CoreFoundation"
echo "Building for MacOS"
])
AM_CONDITIONAL([RUN_IN_PLACE], [test -n "$SF_RUN_IN_PLACE"])
AC_SUBST([STARFIGHTER_CPPFLAGS])
AC_SUBST([STARFIGHTER_LDADD])
# Checks for header files.
AC_CHECK_HEADERS([ctype.h errno.h libintl.h locale.h stdio.h stdlib.h string.h time.h math.h pwd.h sys/stat.h unistd.h])

View File

@ -11,12 +11,8 @@ 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)
starfighter_LDADD = $(STARFIGHTER_LDADD) $(SDL_LIBS) $(PANGO_LIBS)
starfighter_SOURCES = \
Starfighter.c \