2 AM_INIT_AUTOMAKE(navi2ch, 2.0.0-DEV)
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)
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)
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)
29 yes) AC_EMACS_LISP(packagedir,[
31 (default data-directory))
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)
39 (expand-file-name "../site-packages" default))))],
42 no) unset packagedir ;;
43 *) packagedir="$withval" ;;
45 AC_MSG_RESULT([$packagedir])])
49 if test "$emacstype" = xemacs && test -n "$packagedir"; then
50 icondir='${packagedir}/etc/navi2ch'
51 lispdir='${packagedir}/lisp/navi2ch'
52 infodir='${packagedir}/info'
56 [ --with-icondir=DIR Override the default icons directory],
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,[
65 (default data-directory))
66 (princ (expand-file-name "navi2ch/icons"
68 (not (string= prefix "NONE"))
69 (string-match "/\\(\\(?:lib\\|share\\)/x?emacs[[^/]]*/.*$\\)" default))
70 (expand-file-name (match-string 1 default)
74 if test -z "$_cv_icondir"; then
75 _cv_icondir='${datadir}/pixmaps/navi2ch'
78 icondir="$_cv_icondir"
84 AC_OUTPUT([Makefile contrib/Makefile doc/Makefile icons/Makefile test/Makefile