File: acinclude.m4

package info (click to toggle)
t-code 2:2.3.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,804 kB
  • sloc: lisp: 10,356; perl: 748; sh: 384; makefile: 134
file content (101 lines) | stat: -rw-r--r-- 2,724 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl
dnl Execute arbitrary emacs lisp
dnl
AC_DEFUN(AC_EMACS_LISP, [
elisp="$2"
if test -z "$3"; then
	AC_MSG_CHECKING(for $1)
fi
AC_CACHE_VAL(EMACS_cv_SYS_$1,[
	EMACS_cv_SYS_$1=`${EMACS} -batch -q -no-site-file -eval "(let ((x ${elisp})) (if (stringp x) (princ x) (prin1-to-string x)) (kill-emacs))"`
])
$1=${EMACS_cv_SYS_$1}
if test -z "$3"; then
	AC_MSG_RESULT($$1)
fi
])

AC_DEFUN(AC_XEMACS_P, [
  AC_MSG_CHECKING([if $EMACS is really XEmacs])
  AC_EMACS_LISP(xemacsp,(if (string-match \"XEmacs\" emacs-version) \"yes\" \"no\") ,"noecho")
  XEMACS=${EMACS_cv_SYS_xemacsp}
  EMACS_FLAVOR=emacs
  if test "$XEMACS" = "yes"; then
     EMACS_FLAVOR=xemacs
  fi
  AC_MSG_RESULT($XEMACS)
  AC_SUBST(XEMACS)
  AC_SUBST(EMACS_FLAVOR)
])

dnl
dnl Determine the emacs version we are running.
dnl Automatically substitutes @EMACS_VERSION@ with this number.
dnl
AC_DEFUN(AC_EMACS_VERSION, [
AC_MSG_CHECKING(for emacs version)
AC_EMACS_LISP(version,(and (boundp 'emacs-major-version) (format \"%d.%d\" emacs-major-version emacs-minor-version)),"noecho")
EMACS_VERSION=${EMACS_cv_SYS_version}
AC_MSG_RESULT(${EMACS_VERSION})
AC_MSG_CHECKING(for emacs type)
type=`$EMACS -q -no-site-file -batch -l $srcdir/lisp/guess -f guess`
case $type in
nemacs)
	EL_FILES="tc-is18.el"
	ELC_FILES="tc-is18.elc"
	NO_COMPILE_EL_FILES="tc-sysdep.el tc-is19.el tc-is20.el"
	;;
mule1)
	EL_FILES="tc-is18.el"
	ELC_FILES="tc-is18.elc"
	NO_COMPILE_EL_FILES="tc-sysdep.el tc-is19.el tc-is20.el"
	;;
mule4|mule5)
	EL_FILES="tc-is20.el"
	ELC_FILES="tc-is20.elc"
	NO_COMPILE_EL_FILES="tc-sysdep.el tc-is18.el tc-is19.el"
	;;
xemacs21)
	EL_FILES="tc-is19.el"
	ELC_FILES="tc-is19.elc"
	NO_COMPILE_EL_FILES="tc-sysdep.el tc-is18.el tc-is20.el"
	;;
mule*|xemacs20)
	EL_FILES="tc-is19.el"
	ELC_FILES="tc-is19.elc"
	NO_COMPILE_EL_FILES="tc-sysdep.el tc-is18.el tc-is20.el"
	;;
*)
	echo "Unsupported Editor ($type)!!"
	exit 1
esac
AC_MSG_RESULT($type)
AC_SUBST(EMACS_VERSION)
AC_SUBST(EL_FILES)
AC_SUBST(ELC_FILES)
AC_SUBST(NO_COMPILE_EL_FILES)
])

dnl
dnl Determine whether the specified version of Emacs supports packages
dnl or not.  Currently, only XEmacs 20.3 does, but this is a general
dnl check.
dnl
AC_DEFUN(AC_EMACS_PACKAGES, [
AC_ARG_WITH(package-dir,
changequote(<<, >>)dnl
  --with-package-dir      Configure as a XEmacs package in directory,
changequote([, ])dnl
 [ EMACS_PACKAGE_DIR="${withval}"])
if test -n "$EMACS_PACKAGE_DIR"; then
  if test "$prefix" != "NONE"; then
	AC_MSG_ERROR([--with-package-dir and --prefix are mutually exclusive])
  fi
  dnl Massage everything to use $(prefix) correctly.
  prefix=$EMACS_PACKAGE_DIR
  datadir='$(prefix)/etc/tc2'
  infodir='$(prefix)/info'
dnl  lispdir='$(prefix)/lisp/tc2'
fi
AC_SUBST(EMACS_PACKAGE_DIR)
])