gallium: Conditionally use posix libraries/includes.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 7 Feb 2008 10:59:17 +0000 (19:59 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 7 Feb 2008 10:59:37 +0000 (19:59 +0900)
.gitignore
SConstruct

index bf50291fc16b5a16d5eecd06b9d5496466dcddbd..b5e59dfc3ecd0fbb1b97e9d0d996dc1dd4927b72 100644 (file)
@@ -9,3 +9,4 @@ lib
 lib64
 .sconsign*
 config.py
+build
index 47f9b5389bbfbf206be85801324eab52eb7b4d8d..22a4072c9334c27df4a1fc67217a7236a04c3349 100644 (file)
@@ -95,19 +95,8 @@ if gcc:
        env.Append(CFLAGS = '-fmessage-length=0')
        env.Append(CXXFLAGS = '-fmessage-length=0')
 
-# Defines
-env.Append(CPPDEFINES = [
-       '_POSIX_SOURCE',
-       ('_POSIX_C_SOURCE', '199309L'), 
-       '_SVID_SOURCE',
-       '_BSD_SOURCE', 
-       '_GNU_SOURCE',
-       
-       'PTHREADS',
-       'HAVE_ALIAS', 
-       'HAVE_POSIX_MEMALIGN',
-])
 
+# Defines
 if debug:
        env.Append(CPPDEFINES = ['DEBUG'])
 else:
@@ -120,8 +109,6 @@ env.Append(CPPPATH = [
        '#/src/mesa',
        '#/src/mesa/main',
        '#/src/mesa/pipe',
-       
-       '/usr/X11R6/include',
 ])
 
 
@@ -137,14 +124,28 @@ if x86:
                env.Append(CFLAGS = '-m32')
                env.Append(CXXFLAGS = '-m32')
 
-env.Append(LIBPATH = ['/usr/X11R6/lib'])
 
-env.Append(LIBS = [
-       'm',
-       'pthread',
-       'expat',
-       'dl',
-])
+# Posix
+if platform in ('posix', 'linux', 'freebsd', 'darwin'):
+       env.Append(CPPDEFINES = [
+               '_POSIX_SOURCE',
+               ('_POSIX_C_SOURCE', '199309L'), 
+               '_SVID_SOURCE',
+               '_BSD_SOURCE', 
+               '_GNU_SOURCE',
+               
+               'PTHREADS',
+               'HAVE_POSIX_MEMALIGN',
+       ])
+       env.Append(CPPPATH = ['/usr/X11R6/include'])
+       env.Append(LIBPATH = ['/usr/X11R6/lib'])
+       env.Append(LIBS = [
+               'm',
+               'pthread',
+               'expat',
+               'dl',
+       ])
+
 
 # DRI
 if dri: