Commits

ecsv committed 5b08d29

Allow to change names of *-config tools for cross compiles

Comments (0)

Files changed (1)

projects/unix/Makefile

 CXXFLAGS += -fvisibility-inlines-hidden
 LDFLAGS += $(SHARED)
 
+# default configuration programs
+SDL_CONFIG ?= sdl-config
+PKG_CONFIG ?= pkg-config
+
 ifeq ($(CPU), X86)
   CFLAGS += -msse
 endif
 endif
 
 # test for essential build dependencies
-ifeq ($(shell which pkg-config 2>/dev/null),)
-  $(error pkg-config not found)
+ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
+  $(error $(PKG_CONFIG) not found)
 endif
-ifeq ($(shell pkg-config --modversion gl 2>/dev/null),)
+ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),)
   $(error No OpenGL development libraries found!)
 endif
-CFLAGS += $(shell pkg-config --cflags gl)
-LDLIBS += $(shell pkg-config --libs gl)
+CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
+LDLIBS += $(shell $(PKG_CONFIG) --libs gl)
 
 # test for presence of SDL
-ifeq ($(shell which sdl-config 2>/dev/null),)
+ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
   $(error No SDL development libraries found!)
 endif
 ifeq ($(OS),FREEBSD)
-    CFLAGS  += $(shell sdl-config --cflags)
-    LDLIBS += $(shell sdl-config --libs)
+    CFLAGS  += $(shell $(SDL_CONFIG) --cflags)
+    LDLIBS += $(shell $(SDL_CONFIG) --libs)
 endif
 ifeq ($(OS),OSX)
-    CFLAGS  += $(shell sdl-config --cflags)
+    CFLAGS  += $(shell $(SDL_CONFIG) --cflags)
     # sdl-config on mac screws up when we're trying to build a library and not an executable
     # SDL 1.3 is supposed to fix that, if it's ever released
     LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa
 endif
 ifeq ($(OS),LINUX)
-    CFLAGS  += $(shell sdl-config --cflags)
-    LDLIBS += $(shell sdl-config --libs)
+    CFLAGS  += $(shell $(SDL_CONFIG) --cflags)
+    LDLIBS += $(shell $(SDL_CONFIG) --libs)
 endif
 
 # set mupen64plus core API header path
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.