modernize for asdf3
[cl-satwrap.git] / satwrap.asd
blobabd1583cc6f05c67dcb0f491c784d7f0f13a8103
1 ;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; -*-
2 ;;;
3 ;;; satwrap.asd --- SAT solver wrapper for CL
5 ;; Copyright (C) 2010 Utz-Uwe Haus <lisp@uuhaus.de>
6 ;;
7 ;; $Id:$
8 ;;
9 ;; This code is free software; you can redistribute it and/or modify
10 ;; it under the terms of the version 3 of the GNU General
11 ;; Public License as published by the Free Software Foundation, as
12 ;; clarified by the prequel found in LICENSE.Lisp-GPL-Preface.
14 ;; This code is distributed in the hope that it will be useful, but
15 ;; without any warranty; without even the implied warranty of
16 ;; merchantability or fitness for a particular purpose. See the GNU
17 ;; Lesser General Public License for more details.
19 ;; Version 3 of the GNU General Public License is in the file
20 ;; LICENSE.GPL that was distributed with this file. If it is not
21 ;; present, you can access it from
22 ;; http://www.gnu.org/copyleft/gpl.txt (until superseded by a
23 ;; newer version) or write to the Free Software Foundation, Inc., 59
24 ;; Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ;; Commentary:
28 ;; 
30 ;;; Code:
32 #-cffi
33 (progn
34   #+quicklisp
35   (ql:quickload "cffi")
36   #-quicklisp
37   (asdf:operate 'asdf:load-op "cffi"))
39 ;; my old asdf-component-shared-unix-library-system.asd, mostly
40 (defclass shared-unix-library (module)
41   ((library-designator
42     :type (or symbol string list pathname)
43     :initarg :library-designator
44     :documentation
45     "Library designator suitable to be passed to cffi:load-foreign-library")))
47 ;; (defmethod source-file-type ((component shared-unix-library) system)
48 ;;   "so")
49 (defmethod input-files (operation (component shared-unix-library))
50   nil)
51 (defmethod output-files ((operation compile-op) (component shared-unix-library))
52   nil)
53 (defmethod perform ((operation compile-op) (component shared-unix-library))
54   nil)
55 (defmethod operation-done-p ((o compile-op) (c shared-unix-library))
56   t)
57 (defmethod operation-done-p ((o load-op) (c shared-unix-library))
58   nil)
59 (defmethod perform ((operation load-op) (component shared-unix-library))
60   (let ((cffi:*foreign-library-directories*
61          ;; add autoconf substitution here:
62          `(#p"/Users/uhaus/work/cray/eiger-cpp/.libs/"
63              #p"/usr/local/lib/" ;; might work...
64              ,cffi:*foreign-library-directories*)))
65     (let ((lib
66            (cffi:load-foreign-library
67             (slot-value component 'library-designator))))
68       (format *standard-output*
69               "~&;; loaded shared-unix-library ~A as ~A~%"
70               (component-name component)
71               lib)
72       lib)))
74 (defsystem #:satwrap
75     :description "?"
76     :version     "0"
77     :author      "Utz-Uwe Haus <lisp@uuhaus.de>"
78     :license     "ask me"
79     :depends-on  ("cffi"
80                   "trivial-garbage")
81     :components  ((:file "package")
82                   (:file "backend" :depends-on ("package"))
83                   (:module :backends
84                            :components
85                            ((:module
86                              :precosat
87                              :serial T
88                              :components ((:shared-unix-library 
89                                            "libprecosat"
90                                            :library-designator
91                                            (:or
92                                             "libprecosat"
93                                             "libprecosat_so"
94                                             "libprecosat.so"
95                                             "libprecosat.dylib"))
96                                           (:file "satwrap.precosat")))
97                             (:module
98                              :minisat
99                              :serial T
100                              :components ((:shared-unix-library 
101                                            "libminisat"
102                                            :library-designator
103                                            (:or
104                                             "simp/.libs/libminisat"
105                                             "simp/.libs/libminisat.so"
106                                             "libminisat_so"
107                                             "libminisat.so"))
108                                           (:file "satwrap.minisat"))))
109                            :depends-on ("backend" "package"))
110                   ;; top-level:
112                   (:file "satwrap" :depends-on ("package" 
113                                                 "backends"))
114                   (:file "dimacs" :depends-on ("package" "backend" "satwrap"))
115                   ))