]> gitweb.factorcode.org Git - factor.git/commitdiff
gtk, opengl: try out update-library
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 17 Jun 2015 01:44:29 +0000 (18:44 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 17 Jun 2015 03:14:04 +0000 (20:14 -0700)
opengl.gl: Only find the opengl library if we are on unix and not on macosx.

basis/gtk/ffi/ffi.factor
basis/opengl/gl/gl.factor

index 5e2a379f22b07706c7e779df7486e0ff7aab0213..feef7b6497dd0a55d6c076092bb672ec2a272d64 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2010 Anton Gorenko.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.destructors alien.libraries
-alien.syntax combinators gobject-introspection
-gobject-introspection.standard-types kernel pango.ffi system
-vocabs ;
+alien.libraries.finder alien.syntax gobject-introspection
+gobject-introspection.standard-types init pango.ffi vocabs ;
 IN: gtk.ffi
 
 <<
@@ -13,13 +12,7 @@ IN: gtk.ffi
 
 LIBRARY: gtk
 
-<<
-"gtk" {
-    { [ os windows? ] [ "libgtk-win32-2.0-0.dll" cdecl add-library ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libgtk-x11-2.0.so" cdecl add-library ] }
-} cond
->>
+[ "gtk" "gtk-x11-2.0" find-library cdecl update-library ] "gtk" add-startup-hook
 
 IMPLEMENT-STRUCTS: GtkTreeIter ;
 
index 4869928154b3a28489621046a575c62ea991e962..4ceb0ebc987b6eb60b7974ac878ab510d02be689 100644 (file)
@@ -3,9 +3,9 @@
 
 ! This file is based on the gl.h that comes with xorg-x11 6.8.2
 
-USING: alien alien.c-types alien.libraries alien.syntax
-combinators kernel parser sequences system words
-opengl.gl.extensions io.encodings.ascii ;
+USING: alien alien.c-types alien.libraries
+alien.libraries.finder alien.syntax init io.encodings.ascii
+kernel opengl.gl.extensions system ;
 FROM: alien.c-types => short ;
 IN: opengl.gl
 
@@ -629,13 +629,10 @@ CONSTANT: GL_CLIENT_ALL_ATTRIB_BITS         0xFFFFFFFF
 
 LIBRARY: gl
 
-<<
-"gl" {
-    { [ os windows? ] [ drop ] }
-    { [ os macosx? ] [ drop ] }
-    { [ os unix? ] [ "libGL.so" cdecl add-library ] }
-} cond
->>
+[
+    os [ linux? ] [ macosx? not ] bi and
+    [ "gl" "GL" find-library cdecl update-library ] when
+] "find-gl" add-startup-hook
 
 ! Miscellaneous