summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-15 13:28:52 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:51 +0000
commitb9dcd6e3440aaf7dd6d01efadfbb63fc25464f13 (patch)
tree6f0e83b32c2c7542324fa6233d1dbe2e2ca7ba08 /Makefile
parentfc8352965d47d726086baae033a283839bb1358c (diff)
* Merge ioq3-r1669
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c533f577..47bd645d 100644
--- a/Makefile
+++ b/Makefile
@@ -172,11 +172,13 @@ LIBSDIR=$(MOUNT_DIR)/libs
MASTERDIR=$(MOUNT_DIR)/master
TEMPDIR=/tmp
+bin_path=$(shell which $(1) 2> /dev/null)
+
# We won't need this if we only build the server
ifneq ($(BUILD_CLIENT),0)
# set PKG_CONFIG_PATH to influence this, e.g.
# PKG_CONFIG_PATH=/opt/cross/i386-mingw32msvc/lib/pkgconfig
- ifeq ($(shell which pkg-config > /dev/null; echo $$?),0)
+ ifneq ($(call bin_path, pkg-config),)
CURL_CFLAGS=$(shell pkg-config --silence-errors --cflags libcurl)
CURL_LIBS=$(shell pkg-config --silence-errors --libs libcurl)
OPENAL_CFLAGS=$(shell pkg-config --silence-errors --cflags openal)
@@ -187,7 +189,7 @@ ifneq ($(BUILD_CLIENT),0)
endif
# Use sdl-config if all else fails
ifeq ($(SDL_CFLAGS),)
- ifeq ($(shell which sdl-config > /dev/null; echo $$?),0)
+ ifneq ($(call bin_path, sdl-config),)
SDL_CFLAGS=$(shell sdl-config --cflags)
SDL_LIBS=$(shell sdl-config --libs)
endif
@@ -429,7 +431,7 @@ ifeq ($(PLATFORM),mingw32)
# Some MinGW installations define CC to cc, but don't actually provide cc,
# so explicitly use gcc instead (which is the only option anyway)
- ifeq ($(shell which $(CC) > /dev/null; echo $$?),1)
+ ifeq ($(call bin_path, $(CC)),)
CC=gcc
endif