36
|
1 #!/bin/sh
|
|
2 EMACS=${1:-emacs}
|
118
|
3
|
|
4 if [ -n "$WIDGETDIR" ]; then
|
|
5 exit 0
|
|
6 fi
|
|
7
|
36
|
8 if [ -z "$HOME" ]; then
|
|
9 HOME=`(cd ; pwd)`
|
|
10 fi
|
|
11
|
116
|
12 if [ -f "${HOME}/.emacs" ]; then
|
|
13 DOTEMACS="-l ${HOME}/.emacs"
|
36
|
14 fi
|
|
15
|
118
|
16 WITH=` ${EMACS} -batch ${DOTEMACS} -eval '(princ (file-truename (locate-library "custom")))' 2> /dev/null`
|
|
17 WITHOUT=`${EMACS} -batch -q -no-site-file -eval '(princ (file-truename (locate-library "custom")))' 2>/dev/null`
|
|
18
|
|
19 # For some reason XEmacs sometimes ends up with a newline at the beginning
|
|
20 # of the output... this will hopefully strip it out.
|
|
21 WITH=`echo $WITH | tr '\010\013' ' '`
|
|
22 WITHOUT=`echo $WITHOUT | tr '\013\010' ' '`
|
36
|
23
|
|
24 if [ "${WITH}" = "${WITHOUT}" ]; then
|
|
25 exit 0
|
|
26 else
|
118
|
27 DIRECTORY=`dirname ${WITH}`
|
|
28
|
36
|
29 echo "WARNING -- WARNING -- WARNING"
|
|
30 echo "Found custom in different places with and without ${HOME}/.emacs"
|
|
31 echo
|
|
32 echo "This could cause potential problems. Please recompile with"
|
|
33 echo "the environment variable WIDGETDIR set correctly. Try this"
|
|
34 echo "command:"
|
118
|
35 echo "make WIDGETDIR=${DIRECTORY}"
|
36
|
36 exit 1
|
|
37 fi
|