Change README.md
[navi2ch.git] / configure.in
blob03d77fba7578ea175eaeccf0a3cda10a5ea53efc
1 AC_INIT(navi2ch.el)
2 AM_INIT_AUTOMAKE(navi2ch, 2.0.0-DEV)
3 AM_MAINTAINER_MODE
5 AC_PREREQ(2.53)
7 AM_PATH_LISPDIR
9 AC_MSG_CHECKING([detecting your emacs type])
10 AC_EMACS_LISP(emacstype, [dnl
11 (princ (cond ((featurep 'xemacs) 'xemacs)
12              ((>= emacs-major-version 21) 'emacs21)
13              ((= emacs-major-version 20) 'emacs20)
14              (t 'UNKNOWN)))])
15 AC_MSG_RESULT([$emacstype])
17 if test -z "$emacstype" || test "$emacstype" = UNKNOWN; then
18   AC_MSG_ERROR(this package does not work on your emacs)
21 # detect packagedir
22 AC_ARG_WITH(packagedir,
23 [  --with-packagedir[[=DIR]] Use package directory
24                           (With XEmacs, this option also sets
25                            icondir, lispdir, infodir, etc...)],
26 [ AC_MSG_CHECKING([where package files should go])
27 test "$emacstype" != xemacs && AC_MSG_ERROR(packagedir only works with XEmacs)
28 case "$withval" in
29 yes) AC_EMACS_LISP(packagedir,[
30 (let ((prefix argv)
31       (default data-directory))
32   (princ
33    (if (and prefix
34             (not (string= prefix "NONE"))
35             (string-match "/\\(\\(?:lib\\|share\\)/xemacs[[^/]]*/.*$\\)" default))
36        (expand-file-name "site-packages"
37                          (expand-file-name (match-string 1 default)
38                                            prefix))
39        (expand-file-name "../site-packages" default))))],
40 \"${prefix}\")
42 no)  unset packagedir ;;
43 *)   packagedir="$withval" ;;
44 esac
45 AC_MSG_RESULT([$packagedir])])
47 AC_SUBST(packagedir)
49 if test "$emacstype" = xemacs && test -n "$packagedir"; then
50   icondir='${packagedir}/etc/navi2ch'
51   lispdir='${packagedir}/lisp/navi2ch'
52   infodir='${packagedir}/info'
55 AC_ARG_WITH(icondir,
56 [  --with-icondir=DIR      Override the default icons directory],
57 [ icondir="$withval"
58 AC_MSG_CHECKING([where icon files should go])
59 AC_MSG_RESULT([$icondir])],
61 if test -z "${icondir}"; then
62   AC_CACHE_CHECK([where icon files should go], [_cv_icondir], [dnl
63     AC_EMACS_LISP(_cv_icondir,[
64 (let ((prefix argv)
65       (default data-directory))
66   (princ (expand-file-name "navi2ch/icons"
67                            (if (and prefix
68                                     (not (string= prefix "NONE"))
69                                     (string-match "/\\(\\(?:lib\\|share\\)/x?emacs[[^/]]*/.*$\\)" default))
70                                (expand-file-name (match-string 1 default)
71                                                  prefix)
72                              default))))],
73 \"${prefix}\")
74     if test -z "$_cv_icondir"; then
75       _cv_icondir='${datadir}/pixmaps/navi2ch'
76     fi
77   ])
78   icondir="$_cv_icondir"
82 AC_SUBST(icondir)
84 AC_OUTPUT([Makefile contrib/Makefile doc/Makefile icons/Makefile test/Makefile
85 navi2ch-config.el])