OSDN Git Service

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