Files in /usr/share/emacs/site-lisp are not necessarily compatible
with XEmacs. So XEmacs should not try to byte-compile them, or
at least, package installation should no fail because of that.
For instance, mmm-mode is not compatible with xemacs21, so that
its maintainer had to add "Conflicts: xemacs21". This is not
satisfactory: a multi-user machine may have the packages emacs-gtk
and xemacs21 installed because there are users who use GNU Emacs
and other users who use XEmacs. In such a case, with the current
situation, it is not possible to install mmm-mode for GNU Emacs
users because of the conflict. This is really bad.
FYI, here are the errors one obtains when installing mmm-mode
if "Conflicts: xemacs21" is removed and xemacs21 is installed:
[...]
Setting up mmm-mode (0.5.9-2) ...
Install emacsen-common for emacs
emacsen-common: Handling install of emacsen flavor emacs
Install emacsen-common for xemacs21
emacsen-common: Handling install of emacsen flavor xemacs21
Loading /usr/share/emacsen-common/debian-startup...
Loading 00debian...
Compiling /usr/share/xemacs21/site-lisp/debian-startup.el...
Wrote /usr/share/xemacs21/site-lisp/debian-startup.elc
Done
Install mmm-mode for emacs
install/mmm-mode: Handling install of emacsen flavor emacs
install/mmm-mode: byte-compiling for emacs
Install mmm-mode for xemacs21
install/mmm-mode: Handling install of emacsen flavor xemacs21
install/mmm-mode: byte-compiling for xemacs21
Compiling /usr/share/xemacs21/site-lisp/mmm-mode/cl-lib.el...
While compiling toplevel forms in file /usr/share/xemacs21/site-lisp/mmm-mode/mmm-auto.el:
!! File error (("Cannot open load file" "cl-lib"))
installed mmm-mode package post-installation script subprocess returned error exit status 1
If a cl-lib file is provided in order to attempt to support xemacs21,
there are other errors like
Wrong number of arguments: (lambda (oldfun newfun)
(byte-code "..." [newfun oldfun define-function make-obsolete] 3)), 4
because for some functions, the number of arguments for xemacs21
is different from the one for the latest GNU Emacs versions.