chiark / gitweb /
Applied patches from Kalle Olavi Niemitalo (with modifications)
[clg] / clg.system
CommitLineData
560af5c5 1;;; -*- Mode: lisp -*-
2
95f727fa 3(defpackage "CLG-SYSTEM"
4 (:use "COMMON-LISP" "EXTENSIONS" "ALIEN")
5 (:export "*GTK-LIBRARY-PATH*"))
6
7(in-package "CLG-SYSTEM")
8
9;; We used to do this, but I think it's better if everybody puts such
10;; definitions in his/her own Lisp startup files so that clg.system
11;; can be used without local modifications.
12;(setf
13; (logical-pathname-translations "clg")
14; '(("**;*.*.*" "/home/espen/src/clg/**/*.*.*")))
d67f8348 15
16;; Uncomment and edit the next line if pkg-config needs to search for
17;; .pc files in directories other than the default (/usr/lib/pkgconfig)
95f727fa 18;(push '(:PKG_CONFIG_PATH . "/opt/gnome/lib/pkgconfig") ext:*environment-list*)
560af5c5 19
20(load "clg:tools;config")
21(load "clg:tools;sharedlib")
22
95f727fa 23(defvar *gtk-library-path* (pkg-variable "gtk+-2.0" "libdir"))
24(defvar *cmucl-include-path* (ext:unix-namestring "target:lisp"))
d67f8348 25
3b211135 26;; A hack to get around a bug in gdk's init code
95f727fa 27(defvar argc (make-alien c-call:int))
28(defvar progname (make-alien c-call:char))
29(defvar argv0 (make-alien (* c-call:char)))
30(defvar argv (make-alien (* (* c-call:char))))
31(setf (deref argc) 1)
32(setf (deref progname) 0)
33(setf (deref argv0) progname)
34(setf (deref argv) argv0)
3b211135 35
95f727fa 36;; Without this, MAKE uses "CLG:glib;.err" as a namestring, which fails.
37;; TODO: Find and fix the bug, then remove this.
d67f8348 38(setq mk::*cmu-errors-to-file* nil)
3b211135 39
560af5c5 40(eval
41 `(mk:defsystem clg
d67f8348 42 :initially-do
43 (progn
44 (pkg-exists-p "glib-2.0" :atleast-version "1.3.9")
45 (pkg-exists-p "pango" :atleast-version "0.20")
46 (pkg-exists-p "gtk+-2.0" :atleast-version "1.3.9"))
560af5c5 47 :source-pathname "clg:"
48 :binary-pathname "clg:"
49 :components
50 ((:module tools
51 :components ("autoexport"))
1cd312d1 52 (:file "pcl" :source-pathname "glib;" :binary-pathname "glib;")
560af5c5 53 (:module glib
54 :initially-do
55 (progn
d67f8348 56 (load-shared-library "libglib-1.3.so")
57 (load-shared-library "libgobject-1.3.so" :init "g_type_init"))
560af5c5 58 :components
522b39c1 59 ((:file "callback"
60 :language :c
d67f8348 61 :source-extension "c"
62 :binary-extension "o"
522b39c1 63 :compiler-options
85482331 64 (:cflags ,(pkg-cflags "glib-2.0")
522b39c1 65 :optimize 2
66 :definitions (#+cmu CMUCL)
95f727fa 67 :include-paths (,*cmucl-include-path*)))
522b39c1 68 (:file "glib-package")
560af5c5 69 (:file "gutils" :depends-on ("glib-package"))
70 (:file "gforeign" :depends-on ("gutils"))
71 (:file "glib" :depends-on ("gforeign"))
85482331 72 (:file "proxy" :depends-on ("glib"))
73 (:file "gtype" :depends-on ("proxy"))
74 (:file "gboxed" :depends-on ("gtype"))
85482331 75 (:file "genums" :depends-on ("gtype"))
76 (:file "gparam" :depends-on ("genums"))
77 (:file "gobject" :depends-on ("gparam"))
3b211135 78 (:file "gcallback" :depends-on ("gtype" "gparam" "gobject" "callback"))
522b39c1 79 (:file "glib-export"
85482331 80 :depends-on
81 ("gutils" "glib" "proxy" "gboxed" "gtype" "gparam" "gcallback"
82 "genums" "gobject")))
1cd312d1 83 :depends-on (tools "pcl"))
560af5c5 84 (:file "gdkglue"
85 :source-pathname "gdk;"
86 :binary-pathname "gdk;"
87 :initially-do
88 (progn
d67f8348 89 (load-shared-library "libgdk_pixbuf-1.3.so")
90 (load-shared-library "libgdk-x11-1.3.so"
85482331 91 :init "gdk_init"
560af5c5 92 :prototype '(function
3b211135 93 c-call:void (* c-call:int) (* (* (* char))))
94 :initargs (list argc argv)))
560af5c5 95 :language :c
d67f8348 96 :source-extension "c"
97 :binary-extension "o"
85482331 98 :compiler-options (:cflags ,(pkg-cflags "gtk+-2.0")
99 :optimize 2))
560af5c5 100 (:module gdk
85482331 101 :components
102 ((:file "gdk-package")
103 (:file "gdk-export" :depends-on ("gdkevents" "gdktypes" "gdk"))
104 (:file "gdktypes" :depends-on ("gdk-package"))
105 (:file "gdkevents" :depends-on ("gdktypes"))
106 (:file "gdk" :depends-on ("gdkevents")))
107 :depends-on (glib "gdkglue"))
1cd312d1 108 (:module pango
d67f8348 109 :initially-do (load-shared-library "libpango.so")
1cd312d1 110 :components
111 ((:file "pango-package")
112 (:file "pango" :depends-on ("pango-package"))
113 (:file "pango-export" :depends-on ("pango")))
114 :depends-on (glib))
560af5c5 115 (:file "gtkglue"
116 :source-pathname "gtk;"
117 :binary-pathname "gtk;"
85482331 118 :initially-do
119 (progn
120 (load-shared-library
d67f8348 121 "libgtk-x11-1.3.so"
85482331 122 :init "gtk_init"
123 :prototype '(function
124 c-call:void
95f727fa 125 system-area-pointer
126 system-area-pointer)
85482331 127 :initargs (list (system:int-sap 0) (system:int-sap 0))))
560af5c5 128 :language :c
d67f8348 129 :source-extension "c"
130 :binary-extension "o"
85482331 131 :compiler-options (:cflags ,(pkg-cflags "gtk+-2.0")
560af5c5 132 :optimize 2
133 :definitions (#+cmu CMUCL)
95f727fa 134 :include-paths (,*cmucl-include-path*)))
560af5c5 135 (:module gtk
136 :components
137 ((:file "gtk-package")
1b1bddb3 138 (:file "gtk-export" :depends-on ("gtktypes" "gtk"))
1cd312d1 139 (:file "gtkobject" :depends-on ("gtk-package"))
140 (:file "gtktypes" :depends-on ("gtkobject"))
141 (:file "gtkwidget" :depends-on ("gtktypes"))
142 (:file "gtkcontainer" :depends-on ("gtktypes"))
1b1bddb3 143 (:file "gtk" :depends-on ("gtktypes"))
144 (:file "gtkutils" :depends-on ("gtk")))
1cd312d1 145 :depends-on (glib gdk pango "gtkglue")))))
560af5c5 146
8eab371b 147
148