r1332 - trunk

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Apr 28 03:10:33 EDT 2008


Author: ludwig
Date: 2008-04-28 03:10:32 -0400 (Mon, 28 Apr 2008)
New Revision: 1332

Modified:
   trunk/Makefile
Log:
mingw32: allow to override cflags and libs for external libraries


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2008-04-27 21:09:03 UTC (rev 1331)
+++ trunk/Makefile	2008-04-28 07:10:32 UTC (rev 1332)
@@ -102,7 +102,11 @@
 endif
 
 ifndef USE_OPENAL_DLOPEN
-USE_OPENAL_DLOPEN=0
+  ifeq ($(PLATFORM),mingw32)
+    USE_OPENAL_DLOPEN=1
+  else
+    USE_OPENAL_DLOPEN=0
+  endif
 endif
 
 ifndef USE_CURL
@@ -154,6 +158,16 @@
 LIBSDIR=$(MOUNT_DIR)/libs
 TEMPDIR=/tmp
 
+# set PKG_CONFIG_PATH to influence this, e.g.
+# PKG_CONFIG_PATH=/opt/cross/i386-mingw32msvc/lib/pkgconfig
+CURL_CFLAGS=$(shell pkg-config --cflags libcurl)
+CURL_LIBS=$(shell pkg-config --libs libcurl)
+OPENAL_CFLAGS=$(shell pkg-config --cflags openal)
+OPENAL_LIBS=$(shell pkg-config --libs openal)
+# FIXME: introduce CLIENT_CFLAGS
+SDL_CFLAGS=$(shell pkg-config --cflags sdl|sed 's/-Dmain=SDL_main//')
+SDL_LIBS=$(shell pkg-config --libs sdl)
+
 # extract version info
 
 ifeq ($(BUILD_STANDALONE),1)
@@ -391,18 +405,13 @@
   # Require Windows XP or later
   BASE_CFLAGS += -DWINVER=0x501
 
-  ifeq ($(USE_LOCAL_HEADERS),1)
-    BASE_CFLAGS += -I$(SDLHDIR)/include
-  endif
-
   ifeq ($(USE_OPENAL),1)
-    BASE_CFLAGS += -DUSE_OPENAL=1 -DUSE_OPENAL_DLOPEN
-  endif
-
-  ifeq ($(USE_CURL),1)
-    BASE_CFLAGS += -DUSE_CURL
-    ifneq ($(USE_CURL_DLOPEN),1)
-      BASE_CFLAGS += -DCURL_STATICLIB
+    BASE_CFLAGS += -DUSE_OPENAL
+    BASE_CFLAGS += $(OPENAL_CFLAGS)
+    ifeq ($(USE_OPENAL_DLOPEN),1)
+      BASE_CFLAGS += -DUSE_OPENAL_DLOPEN
+    else
+      CLIENT_LDFLAGS += $(OPENAL_LDFLAGS)
     endif
   endif
 
@@ -426,8 +435,15 @@
   CLIENT_LDFLAGS = -mwindows -lgdi32 -lole32 -lopengl32
 
   ifeq ($(USE_CURL),1)
+    BASE_CFLAGS += -DUSE_CURL
+    BASE_CFLAGS += $(CURL_CFLAGS)
     ifneq ($(USE_CURL_DLOPEN),1)
-      CLIENT_LDFLAGS += $(LIBSDIR)/win32/libcurl.a
+      ifeq ($(USE_LOCAL_HEADERS),1)
+        BASE_CFLAGS += -DCURL_STATICLIB
+        CLIENT_LDFLAGS += $(LIBSDIR)/win32/libcurl.a
+      else
+        CLIENT_LDFLAGS += $(CURL_LIBS)
+      endif
     endif
   endif
 
@@ -445,10 +461,18 @@
   RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
 
   # libmingw32 must be linked before libSDLmain
-  CLIENT_LDFLAGS += -lmingw32 \
-                    $(LIBSDIR)/win32/libSDLmain.a \
-                    $(LIBSDIR)/win32/libSDL.dll.a
+  CLIENT_LDFLAGS += -lmingw32
+  ifeq ($(USE_LOCAL_HEADERS),1)
+    BASE_CFLAGS += -I$(SDLHDIR)/include
+    CLIENT_LDFLAGS += $(LIBSDIR)/win32/libSDLmain.a \
+                      $(LIBSDIR)/win32/libSDL.dll.a
+  else
+    BASE_CFLAGS += $(SDL_CFLAGS)
+    CLIENT_LDFLAGS += $(SDL_LIBS)
+  endif
 
+
+
   BUILD_CLIENT_SMP = 0
 
 else # ifeq mingw32




More information about the quake3-commits mailing list