2004-12-04 17:54:56 +00:00
|
|
|
# this file detects what OS and libs the computer have/are running
|
|
|
|
|
2006-02-25 16:57:17 +00:00
|
|
|
ifndef CONFIG_VERSION
|
|
|
|
CONFIG_VERSION:=0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(shell expr $(CONFIG_VERSION) \< 9), 1)
|
|
|
|
|
2006-03-14 19:10:33 +00:00
|
|
|
ifndef BYPASS_OS_DETECT
|
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
# Automatically recognize if building on Win32
|
|
|
|
ifdef WINDIR
|
|
|
|
ifndef UNIX
|
|
|
|
WIN32:=1
|
|
|
|
CYGWIN:=1
|
|
|
|
MINGW:=1
|
|
|
|
STATIC:=1
|
|
|
|
SKIP_STATIC_CHECK:=1
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
UNIX:=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Automatically recognize if building on FreeBSD
|
|
|
|
ifeq ($(shell uname),FreeBSD)
|
|
|
|
FREEBSD:=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Automatically recognize if building on MacOSX
|
2005-07-01 18:16:16 +00:00
|
|
|
ifeq ($(shell uname), Darwin)
|
2004-12-04 17:54:56 +00:00
|
|
|
OSX:=1
|
|
|
|
# OSX uses the unix setup too
|
|
|
|
UNIX:=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Automatically recognize if building on MorphOS
|
|
|
|
ifeq ($(shell uname), MorphOS)
|
|
|
|
MORPHOS:=1
|
|
|
|
# MorphOS uses UNIX setup too
|
|
|
|
UNIX:=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Automatically recognize if building on BeOS
|
|
|
|
ifeq ($(shell uname), BeOS)
|
|
|
|
BEOS:=1
|
|
|
|
# BeOS uses UNIX setup too
|
|
|
|
UNIX:=1
|
|
|
|
# Except that in BeOS 5.0 we need to use net_server, not BONE networking
|
|
|
|
ifeq ($(shell uname -r), 5.0)
|
|
|
|
BEOS_NET_SERVER:=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Automatically recognize if building on SunOS/Solaris
|
|
|
|
ifeq ($(shell uname), SunOS)
|
|
|
|
SUNOS:=1
|
|
|
|
# SunOS uses UNIX setup too
|
|
|
|
UNIX:=1
|
|
|
|
endif
|
|
|
|
|
2006-03-14 19:10:33 +00:00
|
|
|
# END BYPASS_OS_DETECT
|
|
|
|
endif
|
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
# FreeBSD uses sdl11 instead of sdl
|
|
|
|
ifdef FREEBSD
|
2006-03-31 21:06:55 +00:00
|
|
|
SDL_CONFIG:=sdl11-config
|
2004-12-04 17:54:56 +00:00
|
|
|
else
|
2006-03-31 21:06:55 +00:00
|
|
|
SDL_CONFIG:=sdl-config
|
2004-12-04 17:54:56 +00:00
|
|
|
endif
|
|
|
|
|
2006-03-30 20:14:06 +00:00
|
|
|
# set libpng-config to the default value
|
2006-03-31 21:06:55 +00:00
|
|
|
LIBPNG_CONFIG :=libpng-config
|
2006-03-30 20:14:06 +00:00
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
# Networking, enabled by default
|
|
|
|
WITH_NETWORK:=1
|
|
|
|
|
|
|
|
# Library detections
|
2006-03-31 21:06:55 +00:00
|
|
|
WITH_SDL:=$(shell $(SDL_CONFIG) --version 2>/dev/null)
|
2004-12-04 17:54:56 +00:00
|
|
|
|
|
|
|
# libpng detection
|
2006-03-31 21:06:55 +00:00
|
|
|
WITH_PNG:=$(shell $(LIBPNG_CONFIG) --version 2>/dev/null)
|
2004-12-04 17:54:56 +00:00
|
|
|
|
|
|
|
ifdef WITH_PNG
|
2006-03-31 10:04:18 +00:00
|
|
|
# LibPNG depends on Zlib
|
|
|
|
WITH_ZLIB:=1
|
2004-12-04 17:54:56 +00:00
|
|
|
else
|
|
|
|
# We go looking for zlib with a little hack
|
|
|
|
WITH_ZLIB:=$(shell ls /usr/include | grep "zlib.h" 2>/dev/null) \
|
|
|
|
$(shell ls /usr/local/include | grep "zlib.h" 2>/dev/null)
|
|
|
|
ifdef WITH_ZLIB
|
|
|
|
WITH_ZLIB:=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2006-03-31 10:04:18 +00:00
|
|
|
ifdef WITH_ZLIB
|
|
|
|
TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a")
|
|
|
|
ifdef TEMP
|
|
|
|
STATIC_ZLIB_PATH:=/lib/$(TEMP)
|
|
|
|
else
|
|
|
|
TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a")
|
|
|
|
ifdef TEMP
|
|
|
|
STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
|
|
|
|
else
|
|
|
|
TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a")
|
|
|
|
ifdef TEMP
|
|
|
|
STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2004-12-04 17:54:56 +00:00
|
|
|
|
|
|
|
# sets the default paths
|
|
|
|
ifdef UNIX
|
|
|
|
ifndef OSX
|
|
|
|
ifndef MORPHOS
|
|
|
|
ifndef BIN_DIR
|
|
|
|
#BINARY_DIR:=
|
|
|
|
#DATA_DIR_PREFIX:=
|
|
|
|
#INSTALL_DIR:=/usr/local/
|
|
|
|
#USE_HOMEDIR:=
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2005-12-10 11:16:45 +00:00
|
|
|
ifdef OSX
|
|
|
|
# we prefer to use cocoa drivers rather than SDL drivers
|
|
|
|
# if you really want SDL drivers, you can always modify Makefile.config
|
2006-03-23 17:38:31 +00:00
|
|
|
ifndef DEDICATED
|
2005-12-10 11:16:45 +00:00
|
|
|
WITH_COCOA:=1
|
|
|
|
WITH_SDL:=
|
|
|
|
endif
|
2006-03-23 17:38:31 +00:00
|
|
|
endif
|
2005-12-10 11:16:45 +00:00
|
|
|
|
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
# workaround
|
|
|
|
# cygwin have problems with libpng, so we will just disable it for now until the problem is solved
|
|
|
|
ifdef CYGWIN
|
|
|
|
WITH_PNG:=
|
|
|
|
endif
|
2006-02-25 16:57:17 +00:00
|
|
|
|
|
|
|
endif
|