;;; -*- Mode: lisp -*-
;;;
;;; This system file is used to convert the Fortran files to Lisp
;;; files for use with Maxima.


;; You might have to bind *default-pathname-defaults* to #p"" when
;; running this.  It seems that some part of defsystem wants to merge
;; a pathname with *default-pathname-defaults* to produce the output
;; file name, and that ends up going to the wrong place.

(eval-when (load eval compile)
  ;; You need to define a logical pathname translation for maxima for
  ;; this to work.
  (setf (logical-pathname-translations "slatec")
	`(("**;*.*.*" "maxima:src;numerical;slatec;**;*.*"))))

(mk:define-language :f2cl
    :compiler #'f2cl:f2cl
    :loader #'identity
    :source-extension "f")

(mk:defsystem quadpack
    :source-extension "f"
    :binary-extension "lisp"
    :source-pathname (logical-pathname "slatec:")
    :binary-pathname (logical-pathname "slatec:")
    :components
    ((:module fortran
	      :language :f2cl
	      :compiler-options (:float-format double-float :package "SLATEC")
	      :compile-only t
	      :binary-pathname (logical-pathname "slatec:")
	      :binary-extension "lisp"
	      :components
	      (
	       ;; Support
	       (:file "dqwgtf")
	       (:file "dqcheb")
	       (:file "dqk15w")
	       (:file "dqwgts")
	       (:file "dqwgtc")
	       (:file "dgtsl"
		      :compiler-options (:array-slicing nil :array-type :array
							:float-format double-float :package "SLATEC"))
	       ;;(:file "xerror")
	       
	       ;; Core integration routines
	       (:file "dqk15")
	       (:file "dqk31")
	       (:file "dqk41")
	       (:file "dqk51")
	       (:file "dqk61")
	       (:file "dqk21")
	       (:file "dqk15i")
	       (:file "dqelg")
	       (:file "dqpsrt")
	       (:file "dqc25s"
		      :depends-on ("dqcheb" "dqk15w"))
	       (:file "dqmomo")
	       (:file "dqc25c"
		      :depends-on ("dqcheb"
				   "dqk15w"))
	       (:file "dqc25f"
		      :depends-on ("dgtsl"
				   "dqcheb"
				   "dqk15w"
				   "dqwgtf"))
	       ;; Basic integrators
	       (:file "dqage"
		      :depends-on ("dqk15"
				   "dqk31"
				   "dqk41"
				   "dqk51"
				   "dqk61"
				   "dqk21"
				   "dqpsrt"))
	       (:file "dqagie"
		      :depends-on ("dqelg"
				   "dqk15i"
				   "dqpsrt"))
	       (:file "dqagp"
		      :depends-on ("dqagpe"))
	       (:file "dqagpe"
		      :depends-on ("dqelg"
				   "dqpsrt"
				   "dqk21"
				   ))
	       (:file "dqagse"
		      :depends-on ("dqk21"
				   "dqelg"
				   "dqpsrt"))
	       (:file "dqawfe"
		      :depends-on ("dqagie"
				   "dqawoe"
				   "dqelg")
		      ;; If your defsystem doesn't support :compiler-options, use this:
		      ;; :language :f2cl-no-slice
		      ;; If your defsystem does support :compiler-options, use this:
		      :compiler-options (:array-slicing nil :array-type :array
							:float-format double-float :package "SLATEC")
		      )
	       (:file "dqawoe"
		      :depends-on ("dqc25f"
				   "dqpsrt"
				   "dqelg"))
	       (:file "dqawse"
		      :depends-on ("dqc25s"
				   "dqmomo"
				   "dqpsrt"))
	       (:file "dqawce"
		      :depends-on ("dqc25c"
				   "dqpsrt"))
	       ;; Simplified interface routines
	       (:file "dqng")
	       (:file "dqag"
		      :depends-on ("dqage"))
	       (:file "dqags"
		      :depends-on ("dqagse"))
	       (:file "dqagi"
		      :depends-on ("dqagie"))
	       (:file "dqawf"
		      :depends-on ("dqawfe"))
	       (:file "dqawo"
		      :depends-on ("dqawoe"))
	       (:file "dqaws"
		      :depends-on ("dqawse"))
	       (:file "dqawc"
		      :depends-on ("dqawce"))))))
