Debian Codegraph @

configure.in

raw
1 AC_INIT(mew.el)
2 AC_CONFIG_SUBDIRS(bin)
3 AC_ARG_WITH(emacs,
4 [ --with-emacs=EMACS use EMACS],
5 emacsbin="${withval}")
6 AC_SUBST(emacsbin)
7 AC_ARG_WITH(elispdir,
8 [ --with-elispdir=DIR where elisp files should go],
9 elispdir="${withval}")
10 AC_SUBST(elispdir)
11 AC_ARG_WITH(etcdir,
12 [ --with-etcdir=DIR where etc files should go],
13 etcdir="${withval}")
14 AC_SUBST(etcdir)
15
16 if test -z "${emacsbin}"; then
17 AC_PATH_PROGS(emacsbin, emacs, emacs)
18 fi
19 chk_prefix=
20 if test "${datadir}" = "\${prefix}/share" && \
21 test -z "${elispdir}" -o -z "${etcdir}"; then
22 chk_prefix=yes
23 fi
24
25 if test ! -x "${emacsbin}"; then
26 chk_prefix=
27 fi
28 if test "${chk_prefix}"; then
29 AC_MSG_CHECKING(for prefix of ${emacsbin})
30 AC_CACHE_VAL(emacsbin_cv_emacs_prefix,[
31 OUTPUT=./conftest-$$
32 echo ${emacsbin}' -q -no-site-file -batch -eval '\''(write-region (princ (expand-file-name ".." invocation-directory)) nil "'${OUTPUT}'" nil 5)'\' >& AC_FD_CC 2>&1
33 eval ${emacsbin}' -q -no-site-file -batch -eval '\''(write-region (princ (expand-file-name ".." invocation-directory)) nil "'${OUTPUT}'" nil 5)'\' >& AC_FD_CC 2>&1
34 retval="`cat ${OUTPUT}`"
35 rm -f ${OUTPUT}
36 emacsbin_cv_emacs_prefix="${retval}"])
37 emacs_prefix=${emacsbin_cv_emacs_prefix}
38 AC_MSG_RESULT(${emacs_prefix})
39 fi
40
41 if test "${chk_prefix}" -a -z "${elispdir}"; then
42 AC_MSG_CHECKING([where lisp files should go])
43 if test -d "${emacs_prefix}/share/emacs/site-lisp"; then
44 elispdir="${emacs_prefix}/share/emacs/site-lisp/mew"
45 fi
46 if test "${elispdir}"; then
47 AC_MSG_RESULT(${elispdir})
48 else
49 AC_MSG_RESULT([none (fall back to the default value)])
50 fi
51 fi
52 if test -z "${elispdir}"; then
53 elispdir="\${datadir}/emacs/site-lisp/mew"
54 fi
55
56 if test "${chk_prefix}" -a -z "${etcdir}"; then
57 AC_MSG_CHECKING([where etc files should go])
58 if test -d "${emacs_prefix}/share/emacs/site-lisp"; then
59 etcdir="${emacs_prefix}/share/emacs/site-lisp/mew/etc"
60 fi
61 if test "${etcdir}"; then
62 AC_MSG_RESULT(${etcdir})
63 else
64 AC_MSG_RESULT([none (fall back to the default value)])
65 fi
66 fi
67 if test -z "${etcdir}"; then
68 etcdir="\${datadir}/emacs/site-lisp/mew/etc"
69 fi
70
71 AC_OUTPUT(Makefile)
72
73 echo_value () {
74 case "$1" in
75 *\$*)
76 eval "echo_value \"$1\""
77 ;;
78 *)
79 echo "$1"
80 ;;
81 esac
82 }
83
84 echo
85 echo "***************************"
86 echo " Mew configuration results"
87 echo "***************************"
88 echo
89 echo $ECHO_N "use emacs : $ECHO_C"; echo_value "${emacsbin}"
90 echo $ECHO_N "elisp files should go : $ECHO_C"; echo_value "${elispdir}"
91 echo $ECHO_N "etc files should go : $ECHO_C"; echo_value "${etcdir}"
92 echo $ECHO_N "exec files should go : $ECHO_C"; echo_value "${bindir}"
93 echo $ECHO_N "info files should go : $ECHO_C"; echo_value "${infodir}"
94 echo $ECHO_N "man files should go : $ECHO_C"; echo_value "${mandir}/man1"
95 echo
96 echo "Then type 'make' and 'make install'."
97 echo "For Japanese environment, also 'make install-jinfo'."
98 echo