Masao Uebayashi
uebay****@pulte*****
2004年 3月 2日 (火) 11:53:08 JST
あれは私の手元にしかないバージョンの emacs.mk 仕様に基づいていて、私に しか使えないと思います (汗) 。まだ日の目を見ていないバージョンの emacs.mk を添付します。 # $NetBSD: emacs.mk,v 1.14 2003/04/24 18:22:07 jmc Exp $ # # emacs.mk - a Makefile fragment for Emacs Lisp packages in Pkgsrc # # The design is heavily affected by Python packages written by Matthias # Drochner. # # # NOTYET .if !defined(EMACS_MK) # NOTYET EMACS_MK= # defined .include "../../mk/bsd.prefs.mk" # # Default versions. # # - For users, "emacs21" is preferred by default. If a user defines # USE_XEMACS, use the stable XEmacs flavors. # # - For ELPs, "emacs21" and "emacs21nox" are regarded as # EMACS_VERSIONS_ACCEPTED. # .if !defined(USE_XEMACS) || empty(USE_XEMACS:M[Yy][Ee][Ss]) EMACS_VERSION_DEFAULT?= emacs21 .else EMACS_VERSION_DEFAULT?= xemacs214 .endif EMACS_VERSIONS_ACCEPTED?= emacs21 emacs21nox # # Survey installed Emacs versions. If USE_XEMACS isn't defined, look for # only GNU Emacs flavors, or vice versa. # # XXX Need to also find "Emacs as base" for non-NetBSD systems. # # Check if GNU Emacs 21/GNU Emacs 20 are installed. _EMACS_VERSION_INSTALLED= .if !defined(USE_XEMACS) || empty(USE_XEMACS:M[Yy][Ee][Ss]) _TMP!= ${PKG_INFO} -e emacs || ${ECHO} .if !empty(_TMP) _EMACS_VERSION_EMACS_FULL:= ${_TMP} _EMACS_VERSION_EMACS= ${_EMACS_VERSION_EMACS_FULL:C/^.*-//} _EMACS_VERSION_EMACS_MAJOR= ${_EMACS_VERSION_EMACS:C/\..*//} . if ${_EMACS_VERSION_EMACS_MAJOR} == "21" _EMACS_VERSION_INSTALLED= emacs21 . elif ${_EMACS_VERSION_EMACS_MAJOR} == "20" _EMACS_VERSION_INSTALLED= emacs20 . endif . endif # Check if GNU Emacs 21 without X11 is installed. _TMP!= ${PKG_INFO} -e emacs-nox11 || ${ECHO} . if ${_TMP} != "" _EMACS_VERSION_EMACS_FULL:= ${_TMP} _EMACS_VERSION_EMACS= ${_EMACS_VERSION_EMACS_FULL:C/^.*-//} _EMACS_VERSION_EMACS_MAJOR= ${_EMACS_VERSION_EMACS:C/\..*//} . if ${_EMACS_VERSION_EMACS_MAJOR} == "21" _EMACS_VERSION_INSTALLED= emacs21nox . endif . endif .else # !defined(USE_XEMACS) # Check if XEmacs 21.5/XEmacs 21.4 are installed. _TMP!= ${PKG_INFO} -e xemacs || ${ECHO} . if !empty(_TMP) _EMACS_VERSION_EMACS_FULL:= ${_TMP:C/^.*-//} _EMACS_VERSION_EMACS= ${_EMACS_VERSION_EMACS_FULL:C/^.*-//} _EMACS_VERSION_EMACS_MAJOR= ${_EMACS_VERSION_EMACS:C/\..*//} _EMACS_VERSION_EMACS_MINOR= ${_EMACS_VERSION_EMACS:C/^[0-9]*\.//:C/[^0-9].*//} . if ${_EMACS_VERSION_EMACS_MAJOR} == "21" && \ ${_EMACS_VERSION_EMACS_MINOR} == "4" _EMACS_VERSION_INSTALLED= xemacs214 . elif ${_EMACS_VERSION_EMACS_MAJOR} == "21" && \ ${_EMACS_VERSION_EMACS_MINOR} == "5" _EMACS_VERSION_INSTALLED= xemacs215 . endif . endif # XXX Check if XEmacs without X11 is installed. _TMP!= ${PKG_INFO} -e emacs-nox11 || ${ECHO} # XXX .endif # !defined(USE_XEMACS) # XXX # Search "Emacs as base" too. # Then, how to know where the found Emacs's files are installed? # # Pick one Emacs up, set the version as _EMACS_VERSION. # # 1st trial - ${EMACS_VERSION_DEFAULT}, if no Emacs is installed, # # If it's found in this Emacs lisp package's ${EMACS_VERSIONS_ACCEPTED} set, # it's okay to build the Emacs version before this Emacs lisp package is built! # Otherwise, don't progress because installing an Emacs which only a certain # Emacs lisp package prefers can surprise users! .if !defined(_EMACS_VERSION) .if empty(_EMACS_VERSION_INSTALLED) .if !empty(EMACS_VERSIONS_ACCEPTED:M${EMACS_VERSION_DEFAULT}) _EMACS_VERSION= ${EMACS_VERSION_DEFAULT} .else _EMACS_VERSION= PKG_SKIP_REASON+= "Your system don't have any Emacs installed" PKG_SKIP_REASON+= "This Emacs Lisp package accepts ${EMACS_VERSIONS_ACCEPTED}" PKG_SKIP_REASON+= "Please install one of ${EMACS_VERSIONS_ACCEPTED} manually for this package" .endif .endif .endif # 2nd trial - ${_EMACS_VERSION_INSTALLED}, if acceptable. .if !defined(_EMACS_VERSION) .if defined(_EMACS_VERSION_INSTALLED) .if !empty(EMACS_VERSIONS_ACCEPTED:M${_EMACS_VERSION_INSTALLED}) # XXX _EMACS_VERSION= ${_EMACS_VERSION_INSTALLED} .endif .endif .endif # Else. .if !defined(_EMACS_VERSION) _EMACS_VERSION= # Define to not break make(1) syntax. PKG_SKIP_REASON+= "Your system have ${_EMACS_VERSION_INSTALLED} installed" PKG_SKIP_REASON+= "This Emacs Lisp package accepts ${EMACS_VERSIONS_ACCEPTED}" PKG_SKIP_REASON+= "No valid Emacs version installed found" PKG_SKIP_REASON+= "(Could you test this package for ${_EMACS_VERSION_INSTALLED}? :-)" .endif # # Map version specific values. # _DEPENDS.emacs21?= emacs>=21.3 _DEPENDS.emacs21nox?= emacs-nox11>=21.3 _DEPENDS.emacs20?= emacs>=20.7 _DEPENDS.xemacs214?= xemacs>=21.4 _DEPENDS.xemacs215?= xemacs>=21.5 _DEPENDS.leim21?= leim>=21.3 _DEPENDS.leim20?= leim>=20.7 _FOR.emacs21= "@comment " _FOR.emacs21nox= "@comment " _FOR.emacs20= "@comment " _FOR.xemacs214= "@comment " _FOR.xemacs215= "@comment " .if ${_EMACS_VERSION} == "emacs21" EMACS_FLAVOR= emacs _EMACS_DEPENDENCY= ${_DEPENDS.emacs21}:../../editors/emacs _FOR.emacs21= "" . if defined(EMACS_USE_LEIM) DEPENDS+= ${_DEPENDS.leim21}:../../editors/leim . endif .elif ${_EMACS_VERSION} == "emacs21nox" EMACS_FLAVOR= emacs _EMACS_DEPENDENCY= ${_DEPENDS.emacs21nox}:../../editors/emacs-nox11 _FOR.emacs21nox= "" . if defined(EMACS_USE_LEIM) DEPENDS+= ${_DEPENDS.leim21}:../../editors/leim . endif .elif ${_EMACS_VERSION} == "emacs20" EMACS_FLAVOR= emacs _EMACS_DEPENDENCY= ${_DEPENDS.emacs20}:../../editors/emacs20 _FOR.emacs20= "" . if defined(EMACS_USE_LEIM) DEPENDS+= ${_DEPENDS.leim20}:../../editors/leim20 . endif .elif ${_EMACS_VERSION} == "xemacs214" EMACS_FLAVOR= xemacs _EMACS_DEPENDENCY= ${_DEPENDS.xemacs214}:../../editors/xemacs _FOR.xemacs214= "" .elif ${_EMACS_VERSION} == "xemacs215" EMACS_FLAVOR= xemacs _EMACS_DEPENDENCY= ${_DEPENDS.xemacs215}:../../editors/xemacs-current _FOR.xemacs215= "" .else EMACS_FLAVOR= # Define to not break make(1) syntax. .endif # # Emacs related directories; definitions for the Emacs picked up. # .if ${EMACS_FLAVOR} == "emacs" _EMACS_PREFIX= ${PREFIX} _EMACS_ETCPREFIX= share _EMACS_LISPPREFIX= share/emacs/site-lisp .elif ${EMACS_FLAVOR} == "xemacs" _EMACS_PREFIX= ${PREFIX}/lib/xemacs/site-packages _EMACS_ETCPREFIX= etc _EMACS_LISPPREFIX= lisp .endif EMACS_BIN= ${LOCALBASE}/bin/${EMACS_FLAVOR} EMACS_PREFIX= ${_EMACS_PREFIX} EMACS_ETCDIR= ${_EMACS_PREFIX}/${_EMACS_ETCPREFIX}/${_EMACS_PKGBASE} EMACS_INFODIR= ${_EMACS_PREFIX}/info EMACS_LISPDIR= ${_EMACS_PREFIX}/${_EMACS_LISPPREFIX}/${_EMACS_PKGBASE} EMACS_VERSION= ${_EMACS_VERSION_EMACS_FULL:C|^.*-||:C|nb[0-9]*$||}#Ugh! # # Fixups for package names, dependencies, and conflicts. # # - An ELP "foo" is renamed "emacs-foo" for GNU Emacs and "xemacs-foo" # for XEmacs. # # - An ELP depends on the Emacs it uses. If it depends on other ELPs, # take into account if it's "xemacs-" one or not. # # - If an ELP explicitly set ${EMACS_COEXIST} to "YES", it can be # installed for both GNU Emacs & XEmacs simultaneously. Otherwise, # the ELP for GNU Emacs and that for XEmacs conflict. # .if defined(PKGNAME) _EMACS_PKGBASE:= ${PKGNAME:C/-[^-]*$//:C/^x?emacs-//} _EMACS_PKGNAME:= ${PKGNAME:C/^x?emacs-//} .else _EMACS_PKGBASE:= ${DISTNAME:C/-[^-]*$//:C/^x?emacs-//} _EMACS_PKGNAME:= ${DISTNAME:C/^x?emacs-//} .endif PKGBASE:= ${EMACS_FLAVOR}-${_EMACS_PKGBASE} PKGNAME:= ${EMACS_FLAVOR}-${_EMACS_PKGNAME} DEPENDS+= ${_EMACS_DEPENDENCY} DEPENDS+= ${EMACS_DEPENDS:C|^|${EMACS_FLAVOR}}|g} .if !defined(EMACS_COEXIST) || empty(EMACS_COEXIST:M[Yy][Ee][Ss]) .if ${EMACS_FLAVOR} == "emacs" CONFLICTS+= xemacs-${PKGNAME:C|^${EMACS_FLAVOR}-||}-[0-9]* .elif ${EMACS_FLAVOR} == "xemacs" CONFLICTS+= emacs-${PKGNAME:C|^${EMACS_FLAVOR}-||}-[0-9]* .endif .endif # # PLIST definitions. # PLIST_SUBST+= EMACS_BIN=${EMACS_BIN:C|^${PREFIX}/||} PLIST_SUBST+= EMACS_ETCDIR=${EMACS_ETCDIR:C|^${PREFIX}/||} PLIST_SUBST+= EMACS_INFODIR=${EMACS_INFODIR:C|^${PREFIX}/||} PLIST_SUBST+= EMACS_LISPDIR=${EMACS_LISPDIR:C|^${PREFIX}/||} PLIST_SUBST+= EMACS_VERSION=${EMACS_VERSION:C|^${PREFIX}/||} PLIST_SUBST+= FOR_emacs21=${_FOR.emacs21} PLIST_SUBST+= FOR_emacs21nox=${_FOR.emacs21nox} PLIST_SUBST+= FOR_emacs20=${_FOR.emacs20} PLIST_SUBST+= FOR_xemacs214=${_FOR.xemacs214} PLIST_SUBST+= FOR_xemacs215=${_FOR.xemacs215} # NOTYET .endif # EMACS_MK