X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/f58a6533dfd4e0ac3d31f0ae77f0361e6dcc8b9e..95f727fa1e4fba3b0ffe3d16918d44f396d65603:/clg.system diff --git a/clg.system b/clg.system index 9e4e520..b72edc1 100644 --- a/clg.system +++ b/clg.system @@ -1,95 +1,148 @@ ;;; -*- Mode: lisp -*- -(setf - (logical-pathname-translations "clg") - '(("**;*.*.*" "/home/espen/src/clg/**/*.*.*"))) -(setq mk::*cmu-errors-to-file* nil) +(defpackage "CLG-SYSTEM" + (:use "COMMON-LISP" "EXTENSIONS" "ALIEN") + (:export "*GTK-LIBRARY-PATH*")) + +(in-package "CLG-SYSTEM") + +;; We used to do this, but I think it's better if everybody puts such +;; definitions in his/her own Lisp startup files so that clg.system +;; can be used without local modifications. +;(setf +; (logical-pathname-translations "clg") +; '(("**;*.*.*" "/home/espen/src/clg/**/*.*.*"))) + +;; Uncomment and edit the next line if pkg-config needs to search for +;; .pc files in directories other than the default (/usr/lib/pkgconfig) +;(push '(:PKG_CONFIG_PATH . "/opt/gnome/lib/pkgconfig") ext:*environment-list*) (load "clg:tools;config") (load "clg:tools;sharedlib") -(import 'alien:load-shared-library) +(defvar *gtk-library-path* (pkg-variable "gtk+-2.0" "libdir")) +(defvar *cmucl-include-path* (ext:unix-namestring "target:lisp")) + +;; A hack to get around a bug in gdk's init code +(defvar argc (make-alien c-call:int)) +(defvar progname (make-alien c-call:char)) +(defvar argv0 (make-alien (* c-call:char))) +(defvar argv (make-alien (* (* c-call:char)))) +(setf (deref argc) 1) +(setf (deref progname) 0) +(setf (deref argv0) progname) +(setf (deref argv) argv0) + +;; Without this, MAKE uses "CLG:glib;.err" as a namestring, which fails. +;; TODO: Find and fix the bug, then remove this. +(setq mk::*cmu-errors-to-file* nil) (eval `(mk:defsystem clg + :initially-do + (progn + (pkg-exists-p "glib-2.0" :atleast-version "1.3.9") + (pkg-exists-p "pango" :atleast-version "0.20") + (pkg-exists-p "gtk+-2.0" :atleast-version "1.3.9")) :source-pathname "clg:" :binary-pathname "clg:" :components ((:module tools :components ("autoexport")) + (:file "pcl" :source-pathname "glib;" :binary-pathname "glib;") (:module glib :initially-do (progn - (load-shared-library "libglib-1.3.so.2") - (load-shared-library "libgobject-1.3.so.2" :init "g_type_init")) + (load-shared-library "libglib-1.3.so") + (load-shared-library "libgobject-1.3.so" :init "g_type_init")) :components ((:file "callback" :language :c + :source-extension "c" + :binary-extension "o" :compiler-options - (:cflags ,(configure-cflags "glib-config-2.0") + (:cflags ,(pkg-cflags "glib-2.0") :optimize 2 :definitions (#+cmu CMUCL) - :include-paths ("/usr/src/cmucl-2.4.20/src/lisp"))) + :include-paths (,*cmucl-include-path*))) (:file "glib-package") (:file "gutils" :depends-on ("glib-package")) (:file "gforeign" :depends-on ("gutils")) (:file "glib" :depends-on ("gforeign")) - (:file "gtype" :depends-on ("glib")) - (:file "gparam" :depends-on ("glib")) - (:file "gcallback" :depends-on ("gtype" "gparam" "callback")) - (:file "gobject" :depends-on ("gtype")) + (:file "proxy" :depends-on ("glib")) + (:file "gtype" :depends-on ("proxy")) + (:file "gboxed" :depends-on ("gtype")) + (:file "genums" :depends-on ("gtype")) + (:file "gparam" :depends-on ("genums")) + (:file "gobject" :depends-on ("gparam")) + (:file "gcallback" :depends-on ("gtype" "gparam" "gobject" "callback")) (:file "glib-export" - :depends-on ("gutils" "glib" "gtype" "gparam" "gcallback" "gobject"))) - :depends-on (tools)) + :depends-on + ("gutils" "glib" "proxy" "gboxed" "gtype" "gparam" "gcallback" + "genums" "gobject"))) + :depends-on (tools "pcl")) (:file "gdkglue" :source-pathname "gdk;" :binary-pathname "gdk;" :initially-do (progn - (load-shared-library "libgdk_pixbuf-1.3.so.2") - (load-shared-library "libgdk-x11-1.3.so.2") - ;; Initializing of gdk types is done by gtk, so we - ;; have to load an initialize it at this point - (load-shared-library - "libgtk-x11-1.3.so.2" - :init "gtk_init" + (load-shared-library "libgdk_pixbuf-1.3.so") + (load-shared-library "libgdk-x11-1.3.so" + :init "gdk_init" :prototype '(function - c-call:void - alien:system-area-pointer - alien:system-area-pointer) - :initargs (list (system:int-sap 0) (system:int-sap 0)))) + c-call:void (* c-call:int) (* (* (* char)))) + :initargs (list argc argv))) :language :c - :compiler-options (:cflags ,(configure-cflags "gtk-config-2.0") - :optimize 2)) + :source-extension "c" + :binary-extension "o" + :compiler-options (:cflags ,(pkg-cflags "gtk+-2.0") + :optimize 2)) (:module gdk - :components - ((:file "gdk-package") - (:file "gdk-export" :depends-on ("gdkenums" "gdktypes" "gdk")) - (:file "gdkenums" :depends-on ("gdk-package")) - (:file "gdktypes" :depends-on ("gdkenums")) - (:file "gdk" :depends-on ("gdktypes"))) - :depends-on (glib "gdkglue")) + :components + ((:file "gdk-package") + (:file "gdk-export" :depends-on ("gdkevents" "gdktypes" "gdk")) + (:file "gdktypes" :depends-on ("gdk-package")) + (:file "gdkevents" :depends-on ("gdktypes")) + (:file "gdk" :depends-on ("gdkevents"))) + :depends-on (glib "gdkglue")) + (:module pango + :initially-do (load-shared-library "libpango.so") + :components + ((:file "pango-package") + (:file "pango" :depends-on ("pango-package")) + (:file "pango-export" :depends-on ("pango"))) + :depends-on (glib)) (:file "gtkglue" :source-pathname "gtk;" :binary-pathname "gtk;" + :initially-do + (progn + (load-shared-library + "libgtk-x11-1.3.so" + :init "gtk_init" + :prototype '(function + c-call:void + system-area-pointer + system-area-pointer) + :initargs (list (system:int-sap 0) (system:int-sap 0)))) :language :c - :compiler-options (:cflags ,(configure-cflags "gtk-config-2.0") + :source-extension "c" + :binary-extension "o" + :compiler-options (:cflags ,(pkg-cflags "gtk+-2.0") :optimize 2 :definitions (#+cmu CMUCL) - :include-paths ("/usr/lib/cmucl"))) + :include-paths (,*cmucl-include-path*))) (:module gtk :components ((:file "gtk-package") - (:file "gtk-export" :depends-on ("gtkenums" "gtktypes" "gtk")) + (:file "gtk-export" :depends-on ("gtktypes" "gtk")) (:file "gtkobject" :depends-on ("gtk-package")) - (:file "gtkenums" :depends-on ("gtk-package")) - (:file "gtktypes" :depends-on ("gtkenums" "gtkobject")) - (:file "gtkwidget" :depends-on ("gtktypes")) - (:file "gtkcontainer" :depends-on ("gtktypes")) - (:file "gtk" :depends-on ("gtktypes")) - (:file "gtkutils" :depends-on ("gtk")) - ) - :depends-on (glib gdk "gtkglue"))))) + (:file "gtktypes" :depends-on ("gtkobject")) + (:file "gtkwidget" :depends-on ("gtktypes")) + (:file "gtkcontainer" :depends-on ("gtktypes")) + (:file "gtk" :depends-on ("gtktypes")) + (:file "gtkutils" :depends-on ("gtk"))) + :depends-on (glib gdk pango "gtkglue")))))