OSDN Git Service

set version as 1.4.8-snapshot2
[howm/howm.git] / configure.ac
1 # shamelessly copied from navi2ch-cvs-0.0.20031209
2
3 AC_INIT([howm], [1.4.8-snapshot2])
4 AM_INIT_AUTOMAKE
5 AM_MAINTAINER_MODE
6
7 # Emacs set environment variable EMACS as t
8 test "x$EMACS" = xt && unset EMACS
9
10 emacsen="emacs xemacs"
11
12 AC_CANONICAL_HOST
13
14 case "$host_os" in
15 *cygwin*)
16   with_bash=yes
17   emacsen="$emacsen MeadowNT.exe Meadow95.exe Meadow.exe"
18   ;;
19 esac
20
21 AC_ARG_WITH(bash,
22 [  --with-bash             Use Bash to build],
23 [case "$withval" in
24 yes) SHELL=bash ;;
25 no)  ;;
26 *)   SHELL="$withval" ;;
27 esac])
28
29 AC_ARG_WITH(xemacs,
30 [  --with-xemacs           Use XEmacs to build],
31 [case "$withval" in
32 yes) emacsen="xemacs" ;;
33 no)  emacsen="emacs" ;;
34 *)   EMACS="$withval" ;;
35 esac])
36
37 AC_ARG_WITH(emacs,
38 [  --with-emacs            Use Emacs to build],
39 [case "$withval" in
40 yes) emacsen="emacs" ;;
41 no)  emacsen="xemacs" ;;
42 *)   EMACS="$withval" ;;
43 esac])
44
45 if test -n "${with_xemacs+set}" && test -n "${with_emacs+set}"; then
46   AC_MSG_ERROR(specify one of --with-xemacs or --with-emacs)
47 fi
48
49 AC_CHECK_PROG(CVS, cvs, cvs -z3, :)
50 AC_PROG_LN_S
51
52 AC_CHECK_PROGS(EMACS, ${emacsen}, no)
53 if test "$EMACS" = "no"; then
54   AC_MSG_ERROR(cannot find emacs)
55 fi
56
57 AC_MSG_CHECKING([detecting your emacs type])
58 AC_EMACS_LISP(emacstype, [dnl
59 (princ (cond ((featurep 'xemacs) 'xemacs)
60              ((>= emacs-major-version 21) 'emacs21)
61              ((= emacs-major-version 20) 'emacs20)
62              (t 'UNKNOWN)))])
63 AC_MSG_RESULT([$emacstype])
64
65 if test -z "$emacstype" || test "$emacstype" = UNKNOWN; then
66   AC_MSG_ERROR(this package does not work on your emacs)
67 fi
68
69 # detect packagedir
70 AC_ARG_WITH(packagedir,
71 [  --with-packagedir[[=DIR]] Use package directory
72                           (With XEmacs, this option also sets
73                            docdir, lispdir, etc...)],
74 [ AC_MSG_CHECKING([where package files should go])
75 test "$emacstype" != xemacs && AC_MSG_ERROR(packagedir only works with XEmacs)
76 case "$withval" in
77 yes) AC_EMACS_LISP(packagedir, [dnl
78 (princ (expand-file-name "../site-packages" data-directory))])
79 ;;
80 no)  unset packagedir ;;
81 *)   packagedir="$withval" ;;
82 esac
83 AC_MSG_RESULT([$packagedir])])
84
85 AC_SUBST(packagedir)
86
87 if test "$emacstype" = xemacs && test -n "$packagedir"; then
88   lispdir='${packagedir}/lisp'
89   docdir='${datadir}/howm/doc'
90   extdir='${datadir}/howm/ext'
91 fi
92
93 AM_PATH_LISPDIR
94
95 AC_ARG_WITH(howmdir,
96 [  --with-howmdir=DIR      Override the default howm directory],
97 [ howmdir="$withval"
98 AC_MSG_CHECKING([where howm files should go])
99 AC_MSG_RESULT([$howmdir])],
100 [
101 if test -z "${howmdir}"; then
102   AC_CACHE_CHECK([where howm files should go], [ac_cv_howmdir], [dnl
103         ac_cv_howmdir='${lispdir}/howm'
104   ])
105   howmdir="$ac_cv_howmdir"
106 fi
107 ])
108
109 AC_ARG_WITH(docdir,
110 [  --with-docdir=DIR       Override the default docs directory],
111 [ docdir="$withval"
112 AC_MSG_CHECKING([where doc files should go])
113 AC_MSG_RESULT([$docdir])],
114 [
115 if test -z "${docdir}"; then
116   AC_CACHE_CHECK([where doc files should go], [ac_cv_docdir], [dnl
117 dnl     AC_EMACS_LISP(ac_cv_docdir,[dnl
118 dnl (princ (expand-file-name "howm/doc" data-directory))])
119 dnl     if test -z "$ac_cv_docdir"; then
120 dnl       ac_cv_docdir='${datadir}/pixmaps/howm'
121 dnl     fi
122         ac_cv_docdir='${datadir}/howm/doc'
123   ])
124   docdir="$ac_cv_docdir"
125 fi
126 ])
127
128 AC_ARG_WITH(extdir,
129 [  --with-extdir=DIR       Override the default ext directory],
130 [ extdir="$withval"
131 AC_MSG_CHECKING([where ext files should go])
132 AC_MSG_RESULT([$extdir])],
133 [
134 if test -z "${extdir}"; then
135   AC_CACHE_CHECK([where ext files should go], [ac_cv_extdir], [dnl
136         ac_cv_extdir='${datadir}/howm/ext'
137   ])
138   extdir="$ac_cv_extdir"
139 fi
140 ])
141
142 AC_ARG_WITH(endir,
143 [  --with-endir=DIR        Obsolete. no need. no effect.],
144
145 AC_MSG_WARN([--with-endir is obsolete. no need. no effect.])
146 ])
147
148 AC_ARG_WITH(jadir,
149 [  --with-jadir=DIR        Obsolete. no need. no effect.],
150
151 AC_MSG_WARN([--with-jadir is obsolete. no need. no effect.])
152 ])
153
154 AC_SUBST(howmdir)
155 AC_SUBST(docdir)
156 AC_SUBST(extdir)
157
158 # link files
159 if test `cd ${srcdir}; pwd` != `pwd`; then
160   AC_CONFIG_COMMANDS([link-lisp],
161   [
162     rm -f *.el
163     ${howm_ln_s} ${ac_srcdir}/*.el .
164   ], [howm_ln_s="${LN_S}"])
165 #  AC_CONFIG_LINKS(doc/howm.info:doc/howm.info)
166 fi
167
168 AC_OUTPUT([
169   Makefile doc/Makefile ext/Makefile sample/Makefile
170   en/Makefile fr/Makefile ja/Makefile
171   howm.el
172 ])