[Bf-committers] SDL mess in nan_definitions.mk

Hans Lambermont bf-committers@blender.org
Mon, 11 Aug 2003 23:56:18 +0200


Hi,

I'd like to squash the SDL definition mess in nan_definitions.mk
Normally I'd commit this right away, but as it is now things are
redefined multiple times, and lots of dead ifdef code exists, so my
proposed cleanup *might* break things. Hence this email.

First of all, remove the 

 ifneq ($(OS), irix)
    export NAN_SDL ?= $(shell sdl-config --prefix)
    export NAN_SDLLIBS ?= $(shell sdl-config --libs)
    export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 endif

part which voids all other SDL ifdef stuff lateron.

Secondly let's not use weird combinations like this:

    export NAN_SDL ?= $(LCGDIR)/sdl
    export NAN_SDLLIBS ?= $(shell sdl-config --libs)
    export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)

or this one :

    export NAN_SDL ?= /usr/local
        ifeq ($(NAN_SDL),)
            ... #never reached

Either manually define all, or use sdl-config everywhere.

What about the following patch :

Index: nan_definitions.mk
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/nan_definitions.mk,v
retrieving revision 1.49
diff -u -w -r1.49 nan_definitions.mk
--- nan_definitions.mk	4 Aug 2003 03:26:07 -0000	1.49
+++ nan_definitions.mk	11 Aug 2003 21:54:44 -0000
@@ -81,13 +81,6 @@
       export NAN_FTGL ?= $(LCGDIR)/ftgl
     endif
 
-   ifneq ($(OS), irix)
-      export NAN_SDL ?= $(shell sdl-config --prefix)
-      export NAN_SDLLIBS ?= $(shell sdl-config --libs)
-      export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
-   endif
-
-
   # Platform Dependent settings go below:
 
   ifeq ($(OS),beos)
@@ -101,7 +94,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= $(LCGDIR)/jpeg
     export NAN_PNG ?= $(LCGDIR)/png
-    export NAN_SDL ?= $(LCGDIR)/sdl
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -109,6 +101,7 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= $(LCGDIR)/freetype
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
+    export NAN_SDL ?= $(shell sdl-config --prefix)
 	export NAN_SDLLIBS ?= $(shell sdl-config --libs)
 	export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 
@@ -142,7 +135,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= /sw
     export NAN_PNG ?= /sw
-    export NAN_SDL ?= $(LCGDIR)/sdl
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -150,11 +142,9 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= /sw
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
-    ifeq ($(NAN_SDL),)
 		export NAN_SDL = $(LCGDIR)/sdl
 		export NAN_SDLCFLAGS = -I$(NAN_SDL)/include
 		export NAN_SDLLIBS = $(NAN_SDL)/lib/libSDL.a -framework Cocoa
-    endif
 
     # Uncomment the following line to use Mozilla inplace of netscape
     # CPPFLAGS +=-DMOZ_NOT_NET
@@ -189,7 +179,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= /usr/local
     export NAN_PNG ?= /usr/local
-    export NAN_SDL ?= /usr/local
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -197,8 +186,9 @@
     export NAN_NSPR ?= /usr/local
     export NAN_FREETYPE ?= $(LCGDIR)/freetype
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
-	export NAN_SDLLIBS ?= $(shell sdl-config --libs)
-	export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
+    export NAN_SDL ?= $(shell sdl11-config --prefix)
+    export NAN_SDLLIBS ?= $(shell sdl11-config --libs)
+    export NAN_SDLCFLAGS ?= $(shell sdl11-config --cflags)
 
     # Uncomment the following line to use Mozilla inplace of netscape
     # CPPFLAGS +=-DMOZ_NOT_NET
@@ -230,7 +220,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= $(LCGDIR)/jpeg
     export NAN_PNG ?= $(LCGDIR)/png
-    export NAN_SDL ?= $(LCGDIR)/sdl
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -238,6 +227,7 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= /usr/freeware
     export NAN_GETTEXT ?= /usr/freeware
+    export NAN_SDL ?= $(shell sdl-config --prefix)
 	export NAN_SDLLIBS ?= $(shell sdl-config --libs)
 	export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 
@@ -271,7 +261,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= /usr
     export NAN_PNG ?= /usr
-#    export NAN_SDL ?= /usr
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr
@@ -279,11 +268,9 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= /usr
     export NAN_GETTEXT ?= /usr
-	ifeq ($(NAN_SDL),)
-		export NAN_SDL = $(LCGDIR)/sdl
-		export NAN_SDLCFLAGS = -I$(NAN_SDL)/include/SDL
-		export NAN_SDLLIBS = -L$(NAN_SDL)/lib -lSDL
-	endif
+    export NAN_SDL ?= $(shell sdl-config --prefix)
+    export NAN_SDLLIBS ?= $(shell sdl-config --libs)
+    export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 
     # Uncomment the following line to use Mozilla inplace of netscape
     export CPPFLAGS += -DMOZ_NOT_NET
@@ -316,7 +303,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= $(LCGDIR)/jpeg
     export NAN_PNG ?= $(LCGDIR)/png
-    export NAN_SDL ?= $(LCGDIR)/sdl
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -324,13 +310,9 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= $(LCGDIR)/freetype
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
+    export NAN_SDL ?= $(shell sdl-config --prefix)
 	export NAN_SDLLIBS ?= $(shell sdl-config --libs)
 	export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
-	ifeq ($(NAN_SDL),)
-		export NAN_SDL = $(LCGDIR)/sdl
-		export NAN_SDLCFLAGS = -I$(NAN_SDL)/include/SDL
-		export NAN_SDLLIBS = -L$(NAN_SDL)/lib -lSDL
-	endif
 
     # Uncomment the following line to use Mozilla inplace of netscape
     # CPPFLAGS +=-DMOZ_NOT_NET
@@ -362,7 +344,6 @@
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= /usr/local
     export NAN_PNG ?= /usr/local
-    export NAN_SDL ?= /usr/local
     export NAN_ODE ?= $(LCGDIR)/ode
     export NAN_TERRAPLAY ?=
     export NAN_MESA ?= /usr/src/Mesa-3.1
@@ -370,11 +351,9 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= $(LCGDIR)/freetype
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
-	ifeq ($(NAN_SDL),)
-		export NAN_SDL = $(LCGDIR)/sdl
-		export NAN_SDLCFLAGS = -I$(NAN_SDL)/include/SDL
-		export NAN_SDLLIBS = -L$(NAN_SDL)/lib -lSDL
-	endif
+    export NAN_SDL ?= $(shell sdl-config --prefix)
+    export NAN_SDLLIBS ?= $(shell sdl-config --libs)
+    export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 
     # Uncomment the following line to use Mozilla inplace of netscape
     # CPPFLAGS +=-DMOZ_NOT_NET
@@ -406,23 +385,22 @@
       export NAN_FREETYPE ?= $(LCGDIR)/gcc/freetype
       export NAN_ODE ?= $(LCGDIR)/gcc/ode
       ifeq ($(NAN_SDL),)
-	      export NAN_SDL = $(LCGDIR)/gcc/sdl
-		  export NAN_SDLCFLAGS = -I$(NAN_SDL)/include
+	  export NAN_SDL ?= $(LCGDIR)/gcc/sdl
+	  export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include
 	  endif
     else
       export NAN_PYTHON_BINARY ?= python
       export NAN_FREETYPE ?= $(LCGDIR)/freetype
       export NAN_ODE ?= $(LCGDIR)/ode
       ifeq ($(NAN_SDL),)
-	      export NAN_SDL = $(LCGDIR)/sdl
-		  export NAN_SDLCFLAGS = -I$(NAN_SDL)/include
+	  export NAN_SDL ?= $(LCGDIR)/sdl
+	  export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include
       endif
 	endif
 	export NAN_OPENAL ?= $(LCGDIR)/openal
     export NAN_FMOD ?= $(LCGDIR)/fmod
     export NAN_JPEG ?= $(LCGDIR)/jpeg
     export NAN_PNG ?= $(LCGDIR)/png
-    export NAN_SDL ?= $(LCGDIR)/sdl
     export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
     export NAN_MESA ?= /usr/src/Mesa-3.1
     export NAN_ZLIB ?= $(LCGDIR)/zlib
@@ -467,11 +445,9 @@
     export NAN_NSPR ?= $(LCGDIR)/nspr
     export NAN_FREETYPE ?= $(LCGDIR)/freetype
     export NAN_GETTEXT ?= $(LCGDIR)/gettext
-	ifeq ($(NAN_SDL),)
-		export NAN_SDL = $(LCGDIR)/sdl
-		export NAN_SDLCFLAGS = -I$(NAN_SDL)/include/SDL
-		export NAN_SDLLIBS = -L$(NAN_SDL)/lib -lSDL
-	endif
+    export NAN_SDL ?= $(shell sdl-config --prefix)
+    export NAN_SDLLIBS ?= $(shell sdl-config --libs)
+    export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags)
 
     # Uncomment the following line to use Mozilla inplace of netscape
     # CPPFLAGS +=-DMOZ_NOT_NET

Question: how does windows link against SDL ? there's no NAN_SDLLIBS in
the windows section ...

Hans
-- 
http://lambermont.webhop.org/   () ascii ribbon campaign - against HTML mail,
                                /\ vCards and proprietary formats