Merge remote branch 'origin/7.8'
[mesa.git] / src / glut / glx / SConscript
index 99b3bb7df64a7f811d2bbe61c4033c59efcf7a44..29d2cc01494841b0dd68909febe3aa626be01134 100644 (file)
@@ -2,16 +2,9 @@ Import('*')
 
 env = env.Clone()
 
-if env['platform'] != 'windows':
-    Return()
-
-target = 'glut32'
-
 env.Replace(CPPDEFINES = [
     'BUILD_GLUT32', 
     'GLUT_BUILDING_LIB', 
-    'MESA', 
-    '_DLL',
     'NDEBUG',
     'GLUT_NO_WARNING_DISABLE',
 ])
@@ -20,14 +13,6 @@ env.AppendUnique(CPPPATH = [
     '#/include',
 ])
 
-env.PrependUnique(LIBS = [
-    'winmm', 
-    'gdi32', 
-    'user32', 
-    'opengl32', 
-    'glu32',
-])
-
 sources = [
     'glut_bitmap.c',
     'glut_bwidth.c',
@@ -38,7 +23,6 @@ sources = [
     'glut_dstr.c',
     'glut_event.c',
     'glut_ext.c',
-    'glut_fcb.c',
     'glut_fullscrn.c',
     'glut_gamemode.c',
     'glut_get.c',
@@ -51,6 +35,7 @@ sources = [
     'glut_mesa.c',
     'glut_modifier.c',
     'glut_overlay.c',
+    'glut_ppm.c',
     'glut_shapes.c',
     'glut_space.c',
     'glut_stroke.c',
@@ -63,12 +48,6 @@ sources = [
     'glut_warp.c',
     'glut_win.c',
     'glut_winmisc.c',
-
-    'win32_glx.c',
-    'win32_menu.c',
-    'win32_util.c',
-    'win32_winproc.c',
-    'win32_x11.c',
     
     'glut_8x13.c',
     'glut_9x15.c',
@@ -79,11 +58,55 @@ sources = [
     'glut_roman.c',
     'glut_tr10.c',
     'glut_tr24.c',
-
-    'glut.def',
 ]
 
-env.SharedLibrary(
+if env['platform'] == 'windows':
+    env.PrependUnique(LIBS = [
+        'winmm', 
+        'gdi32', 
+        'user32', 
+        'opengl32', 
+        'glu32',
+    ])
+    target = 'glut32'
+    sources += [
+        'win32_glx.c',
+        'win32_menu.c',
+        'win32_util.c',
+        'win32_winproc.c',
+        'win32_x11.c',
+        'glut.def',
+    ]
+else:
+    env.Tool('x11')
+    env.PrependUnique(LIBS = [
+        'GLU',
+        'GL',
+        'X11',
+        'Xext',
+        'Xmu',
+        'Xi',
+    ])
+    target = 'glut'
+    sources += [
+        'glut_fcb.c',
+        'glut_menu.c',
+        'glut_menu2.c',
+        'glut_glxext.c',
+        'layerutil.c',
+    ]
+
+
+glut = env.SharedLibrary(
     target = target,
     source = sources,
 )
+
+env.InstallSharedLibrary(glut, version=(3, 7, 1))
+
+if env['platform'] == 'windows':
+    glut = env.FindIxes(glut, 'LIBPREFIX', 'LIBSUFFIX')
+else:
+    glut = env.FindIxes(glut, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+
+Export('glut')