-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
81 lines (69 loc) · 2.96 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env gosh
;; Configuring msicon
;; Run ./configure (or gosh ./configure) to generate Makefiles.
(use gauche.configure)
(use gauche.version)
;; Disable environment variables
(with-module gauche.configure (define (cf-arg-var symbol) #f))
;; Define extra --with-PACKAGE and --enable-FEATURE options.
;; These should come before cf-init so that cf-init can construct
;; proper usage string.
(cf-arg-with 'local
(cf-help-string
"--with-local=PATH:PATH..."
"For each PATH, add PATH/include to the include search
paths and PATH/lib to the library search paths. Useful if you have some
libraries installed in non-standard places. ")
(^[with-local]
(unless (member with-local '("yes" "no" ""))
(cf-subst 'LOCAL_PATHS with-local)))
(^[] (cf-subst 'LOCAL_PATHS "")))
;; Initialize configure. This creates the global context, parses
;; command-line args and sets up default values.
(if (version<=? (gauche-version) "0.9.4")
(cf-init "msicon" "1.04" "fkyo0985@gmail.com")
(cf-init))
;; Set up gauche related commands. The commands are set by scanning
;; PATH. You can override them by "GOSH=/my/gosh ./configure" etc.
;; These variables may contain spaces in the pathnames (especially on
;; Windows); Makefile.ins and other files that refer to those variables
;; have to quote them properly.
(cf-path-prog 'GOSH "gosh")
(cf-path-prog 'GAUCHE_CONFIG "gauche-config")
(cf-path-prog 'GAUCHE_PACKAGE "gauche-package")
(cf-path-prog 'GAUCHE_INSTALL "gauche-install")
(cf-path-prog 'GAUCHE_CESCONV "gauche-cesconv")
;; Some common parameters
(cf-subst 'default_prefix (gauche-config "--prefix"))
(unless (cf-have-subst? 'CFLAGS)
(cf-subst 'CFLAGS (gauche-config "--default-cflags")))
(unless (cf-have-subst? 'CPPFLAGS) (cf-subst 'CPPFLAGS ""))
(unless (cf-have-subst? 'LDFLAGS) (cf-subst 'LDFLAGS ""))
(unless (cf-have-subst? 'LIBS) (cf-subst 'LIBS ""))
(cf-subst 'DEF_UNICODE
(cond-expand
[(and gauche.os.windows gauche.ces.utf8) "-DUNICODE"]
[else ""]))
(when (version<=? (gauche-version) "0.9.4")
(cf-subst 'SOEXT (gauche-config "--so-suffix"))
(cf-subst 'OBJEXT (gauche-config "--object-suffix"))
(cf-subst 'EXEEXT (gauche-config "--executable-suffix")))
(cf-subst 'GAUCHE_PKGINCDIR (gauche-config "--pkgincdir"))
(cf-subst 'GAUCHE_PKGLIBDIR (gauche-config "--pkglibdir"))
(cf-subst 'GAUCHE_PKGARCHDIR (gauche-config "--pkgarchdir"))
;; Output
(use gauche.package)
(if (version<=? (gauche-version) "0.9.4")
(let1 gpd-file #"~(cf$ 'PACKAGE_NAME).gpd"
(with-output-to-file gpd-file
(cut write-gauche-package-description
(make <gauche-package-description>
:name (cf$ 'PACKAGE_NAME)
:version (cf$ 'PACKAGE_VERSION)
:configure (string-join (command-line))))))
(cf-make-gpd))
(cf-echo (cf$ 'PACKAGE_VERSION) > "VERSION")
(cf-output "Makefile")
;; Local variables:
;; mode: scheme
;; end: