makefiledir/Makefile.libdetection
author truelight
Sat, 04 Dec 2004 15:02:45 +0000
changeset 542 2f35c4770b06
parent 528 57b7d2522351
child 543 e3b43338096b
permissions -rw-r--r--
(svn r939) -Fix: Fixed compiler errors
526
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     1
# this file detects what OS and libs the computer have/are running
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     2
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     3
# Automatically recognize if building on Win32
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     4
ifdef WINDIR
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     5
ifndef UNIX
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     6
WIN32:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     7
CYGWIN:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
     8
MINGW:=1
528
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
     9
STATIC:=1
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
    10
SKIP_STATIC_CHECK:=1
526
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    11
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    12
else
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    13
UNIX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    14
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    15
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    16
# Automatically recognize if building on FreeBSD
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    17
ifeq ($(shell uname),FreeBSD)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    18
FREEBSD:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    19
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    20
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    21
# Automatically recognize if building on MacOSX
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    22
ifeq ($(VENDOR), apple)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    23
OSX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    24
# OSX uses the unix setup too
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    25
UNIX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    26
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    27
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    28
# Automatically recognize if building on MorphOS
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    29
ifeq ($(shell uname), MorphOS)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    30
MORPHOS:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    31
# MorphOS uses UNIX setup too
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    32
UNIX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    33
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    34
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    35
# Automatically recognize if building on BeOS
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    36
ifeq ($(shell uname), BeOS)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    37
BEOS:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    38
# BeOS uses UNIX setup too
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    39
UNIX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    40
# Except that in BeOS 5.0 we need to use net_server, not BONE networking
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    41
ifeq ($(shell uname -r), 5.0)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    42
BEOS_NET_SERVER:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    43
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    44
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    45
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    46
# Automatically recognize if building on SunOS/Solaris
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    47
ifeq ($(shell uname), SunOS)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    48
SUNOS:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    49
# SunOS uses UNIX setup too
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    50
UNIX:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    51
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    52
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    53
# FreeBSD uses sdl11 instead of sdl
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    54
ifdef FREEBSD
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    55
SDL-CONFIG:=sdl11-config
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    56
else
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    57
SDL-CONFIG:=sdl-config
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    58
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    59
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    60
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    61
# Library detections
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    62
WITH_SDL:=$(shell $(SDL-CONFIG) --version 2>/dev/null)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    63
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    64
# libpng detection
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    65
ifdef FREEBSD
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    66
# a little hack was needed for FreeBSD because it misses libpng-config
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    67
WITH_PNG:=$(shell ls /usr/lib | grep "libpng" 2>/dev/null) $(shell \
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    68
ls /usr/local/lib | grep "libpng" 2>/dev/null)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    69
ifdef WITH_PNG
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    70
# makes the flag look nicer in makefile.config
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    71
WITH_PNG:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    72
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    73
else
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    74
WITH_PNG:=$(shell libpng-config --version 2>/dev/null)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    75
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    76
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    77
ifdef WITH_PNG
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    78
# LibPNG depends on Zlib
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    79
WITH_ZLIB:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    80
else
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    81
# We go looking for zlib with a little hack
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    82
WITH_ZLIB:=$(shell ls /usr/include | grep "zlib.h" 2>/dev/null) \
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    83
$(shell ls /usr/local/include | grep "zlib.h" 2>/dev/null)
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    84
ifdef WITH_ZLIB
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    85
WITH_ZLIB:=1
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    86
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    87
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    88
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    89
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    90
# sets the default paths
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    91
ifdef UNIX
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    92
ifndef OSX
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    93
ifndef MORPHOS
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    94
ifndef BIN_DIR
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    95
#BINARY_DIR:=
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    96
#DATA_DIR_PREFIX:=
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    97
#INSTALL_DIR:=/usr/local/
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    98
#USE_HOMEDIR:=
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
    99
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
   100
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
   101
endif
bd64ec8b0c00 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config
Bjarni
parents: 446
diff changeset
   102
endif
528
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   103
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   104
# workaround
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   105
# cygwin have problems with libpng, so we will just disable it for now until the problem is solved
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   106
ifdef CYGWIN
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   107
WITH_PNG:=
57b7d2522351 (svn r862) Cygwin: libdetection now sets the flags properly if no Makefile.config is found
bjarni
parents: 526
diff changeset
   108
endif