sgl

changeset 35:3d6ee9fb9ac1

- added a cflags declaration for modules files
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 24 Feb 2012 05:17:47 +0200
parents 46e90f9c1e0f
children af9d2e895594
files Makefile.in configure src/wsys_sdl.c
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/Makefile.in	Tue Jul 05 06:19:31 2011 +0300
     1.2 +++ b/Makefile.in	Fri Feb 24 05:17:47 2012 +0200
     1.3 @@ -23,7 +23,7 @@
     1.4  
     1.5  AR = ar
     1.6  CC = gcc
     1.7 -CFLAGS = -pedantic -Wall -g -fPIC -Iinclude -Isrc $(CFLAGS_extra)
     1.8 +CFLAGS = -pedantic -Wall -g -fPIC -Iinclude -Isrc $(wsys_cflags) $(CFLAGS_extra)
     1.9  LDFLAGS = $(wsys_libs)
    1.10  
    1.11  .PHONY: all
     2.1 --- a/configure	Tue Jul 05 06:19:31 2011 +0300
     2.2 +++ b/configure	Fri Feb 24 05:17:47 2012 +0200
     2.3 @@ -28,6 +28,11 @@
     2.4  	extract $1 mac-framework
     2.5  }
     2.6  
     2.7 +get_cflags()
     2.8 +{
     2.9 +	extract $1 cflags
    2.10 +}
    2.11 +
    2.12  get_usedef()
    2.13  {
    2.14  	grep '#ifdef *USE_WSYS_MODULE' $1 | sed 's/^.*\(USE_WSYS_MODULE_.*\)/\1/'
    2.15 @@ -104,6 +109,8 @@
    2.16  		fi
    2.17  	fi
    2.18  
    2.19 +	cfl=`get_cflags $m`
    2.20 +
    2.21  	name=`echo $m | sort | sed 's/src\/wsys_//' | sed 's/\.c//' | sed 's/\.m//'`
    2.22  	message -n "-> trying module $name (needs: $dep) ... "
    2.23  
    2.24 @@ -113,6 +120,7 @@
    2.25  	elif try_link "$dep"; then
    2.26  		message ok
    2.27  
    2.28 +		cflags="$cflags $cfl"
    2.29  		libs="$libs $dep"
    2.30  
    2.31  		# emmit the USE_ define in config.h
    2.32 @@ -126,6 +134,9 @@
    2.33  	fi
    2.34  done
    2.35  
    2.36 +if [ -n "$cflags" ]; then
    2.37 +	message "will compile with: $cflags"
    2.38 +fi
    2.39  message "Will link with: $libs"
    2.40  
    2.41  # wrap up the modules.c file
    2.42 @@ -139,6 +150,7 @@
    2.43  
    2.44  message "install prefix: $prefix"
    2.45  echo "PREFIX = $prefix" >Makefile
    2.46 +echo "wsys_cflags = $cflags" >>Makefile
    2.47  echo "wsys_libs = $libs" >>Makefile
    2.48  cat Makefile.in >>Makefile
    2.49  
     3.1 --- a/src/wsys_sdl.c	Tue Jul 05 06:19:31 2011 +0300
     3.2 +++ b/src/wsys_sdl.c	Fri Feb 24 05:17:47 2012 +0200
     3.3 @@ -1,11 +1,12 @@
     3.4  /* SimplyGL window system module for SDL */
     3.5 +/* cflags: `sdl-config --cflags` */
     3.6  /* link-with: `sdl-config --libs` */
     3.7  
     3.8  #include "config.h"
     3.9  
    3.10  #ifdef USE_WSYS_MODULE_SDL
    3.11  
    3.12 -#include <SDL/SDL.h>
    3.13 +#include <SDL.h>
    3.14  #include "sgl.h"
    3.15  #include "wsys.h"
    3.16