Commit 2019ecf6 authored by kilian.sprotte's avatar kilian.sprotte

asd file

darcs-hash:b3bd1a087666d338dc6c8ab0bb91314fd575e5d1
parent dffd2290
;;;; Silly emacs, this is -*- Lisp -*-
;;;; arch-tag: 3AEA583B-0A11-1454-E9321DE74C68
;;; Copyright (c) 2006, Kilian Sprotte. All rights reserved.
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
;;; * Redistributions in binary form must reproduce the above
;;; copyright notice, this list of conditions and the following
;;; disclaimer in the documentation and/or other materials
;;; provided with the distribution.
;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(defpackage :gecol-system (:use :asdf :cl))
(in-package :gecol-system)
;;;; C-SOURCE FILE HANDLING
(defvar *gcc* "/usr/bin/gcc")
(defvar *gcc-options* '(#-darwin "-shared"
#+darwin "-dynamiclib"
"-fPIC"
"-lgecodesearch"
"-lgecodekernel"
"-lgecodeint"
"-lgecodeminimodel"
"-lstdc++"))
(defclass gecode-source-file (source-file)
())
(defmethod source-file-type ((c gecode-source-file) s)
"cpp")
(defmethod output-files ((o compile-op) (c gecode-source-file))
(list (make-pathname :name (component-name c)
:type "so"
:defaults (component-pathname c))))
(defmethod perform ((o load-op) (c gecode-source-file))
(let ((loader (intern "LOAD-FOREIGN-LIBRARY" :cffi)))
(dolist (file (asdf::input-files o c))
(funcall loader file))))
(defmethod perform ((o compile-op) (c gecode-source-file))
(unless (zerop (run-shell-command "~A ~A ~{~A ~}-o ~A"
*gcc*
(namestring (component-pathname c))
*gcc-options*
(namestring (car (output-files o c)))))
(error 'operation-error :component c :operation o)))
(defsystem :gecol
:name "gecol"
:description "gecol"
:author "paul"
:version "0.1"
:serial t
:components
((:file "package")
(:gecode-source-file "glue")
(:file "ffi")
(:file "gec"))
:depends-on
(:iterate :geno :arnesi :cffi))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment