Commit 29dfca23 authored by Paul Eggert's avatar Paul Eggert
Browse files

Use ‘echo’ safely with ‘\’ or leading ‘-’

POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
parent ec0d4d24
...@@ -314,8 +314,6 @@ etc-emacsver: ...@@ -314,8 +314,6 @@ etc-emacsver:
${srcdir}/build-aux/move-if-change emacsver.tex.$$$$ \ ${srcdir}/build-aux/move-if-change emacsver.tex.$$$$ \
${srcdir}/etc/refcards/emacsver.tex ${srcdir}/etc/refcards/emacsver.tex
removenullpaths=sed -e 's/^:*//' -e 's/:*$$//g' -e 's/::*/:/g'
# Generate epaths.h from epaths.in. This target is invoked by 'configure'. # Generate epaths.h from epaths.in. This target is invoked by 'configure'.
# See comments in configure.ac for why it is done this way, as opposed # See comments in configure.ac for why it is done this way, as opposed
# to just letting configure generate epaths.h from epaths.in in a # to just letting configure generate epaths.h from epaths.in in a
...@@ -324,20 +322,18 @@ epaths-force: ...@@ -324,20 +322,18 @@ epaths-force:
@for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \ @for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \
case $$dir in \ case $$dir in \
*:*) \ *:*) \
echo >&2 "Build or installation directory '$$dir'"; \ printf >&2 "Build or installation directory '%s'\\n" "$$dir"; \
echo >&2 "cannot contain ':'."; \ echo >&2 "cannot contain ':'."; \
exit 1;; \ exit 1;; \
esac; \ esac; \
done done
@(standardlisppath=`echo "${standardlisppath}" | ${removenullpaths}` ; \ @(gamedir='${gamedir}'; \
locallisppath=`echo "${locallisppath}" | ${removenullpaths}` ; \
buildlisppath=`echo "${buildlisppath}" | ${removenullpaths}` ; \
x_default_search_path=`echo ${x_default_search_path}`; \
gamedir=`echo ${gamedir}`; \
sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \ sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
-e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${standardlisppath}"'";' \ -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \
-e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${locallisppath}"'";' \ -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \
-e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \ -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \
-e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \
-e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \
-e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
-e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
-e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
...@@ -577,7 +573,7 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} ...@@ -577,7 +573,7 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
fi; \ fi; \
rm -rf "$${dest}" ; \ rm -rf "$${dest}" ; \
umask 022; ${MKDIR_P} "$${dest}" ; \ umask 022; ${MKDIR_P} "$${dest}" ; \
echo "Copying $${dir} to $${dest}..." ; \ printf 'Copying %s to %s...\n' "$$dir" "$$dest" ; \
(cd $${dir}; tar -chf - . ) \ (cd $${dir}; tar -chf - . ) \
| (cd "$${dest}"; umask 022; \ | (cd "$${dest}"; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \ tar -xvf - && cat > /dev/null) || exit 1; \
...@@ -632,7 +628,8 @@ install-etcdoc: src install-arch-indep ...@@ -632,7 +628,8 @@ install-etcdoc: src install-arch-indep
if [ "`cd ./etc; /bin/pwd`" != "$$exp_etcdocdir" ]; \ if [ "`cd ./etc; /bin/pwd`" != "$$exp_etcdocdir" ]; \
then \ then \
docfile="DOC"; \ docfile="DOC"; \
echo "Copying etc/$${docfile} to $(DESTDIR)${etcdocdir} ..." ; \ printf 'Copying %s to %s ...\n' "etc/$$docfile" \
"$(DESTDIR)${etcdocdir}"; \
${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \ ${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \
$(set_installuser); \ $(set_installuser); \
chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \ chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \
...@@ -721,7 +718,7 @@ install-etc: ...@@ -721,7 +718,7 @@ install-etc:
for icon in $${dir}/${EMACS_ICON}[.-]*; do \ for icon in $${dir}/${EMACS_ICON}[.-]*; do \
[ -r $${icon} ] || continue ; \ [ -r $${icon} ] || continue ; \
ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \ ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \
dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\.$${ext}$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \ dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\\.$${ext}\$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \
( cd "$${thisdir}"; \ ( cd "$${thisdir}"; \
${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \ ${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \
|| exit 1; \ || exit 1; \
......
...@@ -64,7 +64,7 @@ case "$3" in ...@@ -64,7 +64,7 @@ case "$3" in
KANJI-DATABASE) KANJI-DATABASE)
SOURCE="http://kanji-database.cvs.sourceforge.net/viewvc/*checkout*/kanji-database/kanji-database/data/cns2ucsdkw.txt?revision=1.4";; SOURCE="http://kanji-database.cvs.sourceforge.net/viewvc/*checkout*/kanji-database/kanji-database/data/cns2ucsdkw.txt?revision=1.4";;
*) *)
echo "Unknown file type: $3"; printf 'Unknown file type: %s\n' "$3"
exit 1;; exit 1;;
esac esac
...@@ -147,7 +147,6 @@ elif [ "$3" = "KANJI-DATABASE" ] ; then ...@@ -147,7 +147,6 @@ elif [ "$3" = "KANJI-DATABASE" ] ; then
| sed -e 's/...\(....\) U+\([0-9A-F]*\).*/0x\1 0x\2/' \ | sed -e 's/...\(....\) U+\([0-9A-F]*\).*/0x\1 0x\2/' \
| sort | ${AWKPROG} | sort | ${AWKPROG}
else else
echo "Invalid arguments: $3" printf 'Invalid arguments: %s\n' "$3"
exit 1 exit 1
fi fi
...@@ -71,7 +71,7 @@ case $gnulib_srcdir in ...@@ -71,7 +71,7 @@ case $gnulib_srcdir in
esac esac
case $src in case $src in
-*) -*)
echo >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]] printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
SRCDIR is the Emacs source directory (default: working directory). SRCDIR is the Emacs source directory (default: working directory).
GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)." GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
...@@ -79,7 +79,7 @@ case $src in ...@@ -79,7 +79,7 @@ case $src in
esac esac
test -x "$src"autogen.sh || { test -x "$src"autogen.sh || {
echo >&2 "$0: '${src:-.}' is not an Emacs source directory." printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory."
exit 1 exit 1
} }
...@@ -88,7 +88,7 @@ git clone -- "$GNULIB_URL" "$gnulib_srcdir" || ...@@ -88,7 +88,7 @@ git clone -- "$GNULIB_URL" "$gnulib_srcdir" ||
exit exit
test -x "$gnulib_srcdir"/gnulib-tool || { test -x "$gnulib_srcdir"/gnulib-tool || {
echo >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory." printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
exit 1 exit 1
} }
......
...@@ -49,15 +49,15 @@ ...@@ -49,15 +49,15 @@
test -n "$dir" test -n "$dir"
} || { } || {
echo >&2 "$0: cannot find pkg.m4" printf >&2 '%s\n' "$0: cannot find pkg.m4"
exit 1 exit 1
} }
test -d m4 || { test -d m4 || {
echo >&2 "$0: please run this command in the main source directory" printf >&2 '%s\n' "$0: please run this command in the main source directory"
exit 1 exit 1
} }
echo >&2 "$0: copying $dir/pkg.m4 to m4/pkg.m4" printf >&2 '%s\n' "$0: copying $dir/pkg.m4 to m4/pkg.m4"
cp $dir/pkg.m4 m4 cp $dir/pkg.m4 m4
...@@ -121,11 +121,11 @@ EOF ...@@ -121,11 +121,11 @@ EOF
-[!-]?*) -[!-]?*)
# split concatenated single-letter options apart # split concatenated single-letter options apart
FIRST="$1"; shift FIRST="$1"; shift
set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@" set -- `printf '%s\n' "$FIRST" | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
;; ;;
-*) -*)
echo 1>&2 "$me: unrecognized option '$1'" printf '%s\n' >&2 "$me: unrecognized option '$1'"
echo 1>&2 "$TRY" printf '%s\n' >&2 "$TRY"
exit 1 exit 1
;; ;;
*) *)
...@@ -140,17 +140,18 @@ case $# in ...@@ -140,17 +140,18 @@ case $# in
1) BUILD="$1";; 1) BUILD="$1";;
2) BUILD="$1"; prefix="$2";; 2) BUILD="$1"; prefix="$2";;
*) *)
echo 1>&2 "$USAGE" printf '%s\n' >&2 "$USAGE"
echo 1>&2 "$TRY" printf '%s\n' >&2 "$TRY"
exit 1 exit 1
;; ;;
esac esac
if test ! -d "$BUILD"; then if test ! -d "$BUILD"; then
echo 1>&2 "$me: $BUILD: Build tree not found" printf '%s\n' >&2 "$me: $BUILD: Build tree not found"
exit 2 exit 2
elif test ! -r "$BUILD/config.status"; then elif test ! -r "$BUILD/config.status"; then
echo 1>&2 "$me: $BUILD: Not a proper build tree, config.status not found" printf '%s\n' >&2 \
"$me: $BUILD: Not a proper build tree, config.status not found"
exit 2 exit 2
fi fi
...@@ -160,7 +161,8 @@ get_config_var () ...@@ -160,7 +161,8 @@ get_config_var ()
{ sed -n "s/^S[[]\"$1\"[]]=\"\([^\"]*\)\"/\1/p" $CONFIG_STATUS | sed q | grep ''; } || { sed -n "s/^S[[]\"$1\"[]]=\"\([^\"]*\)\"/\1/p" $CONFIG_STATUS | sed q | grep ''; } ||
{ sed -n "s/^s\(.\)@$1@\1\(|#_!!_#|\)*\(.*\)\1.*$/\3/p" $CONFIG_STATUS | sed q | grep ''; } || { sed -n "s/^s\(.\)@$1@\1\(|#_!!_#|\)*\(.*\)\1.*$/\3/p" $CONFIG_STATUS | sed q | grep ''; } ||
{ {
echo 1>&2 "$me: $1: Configuration variable not found in $CONFIG_STATUS" printf '%s\n' >&2 \
"$me: $1: Configuration variable not found in $CONFIG_STATUS"
exit 4 exit 4
} }
} }
...@@ -172,7 +174,7 @@ test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; } ...@@ -172,7 +174,7 @@ test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
VERSION=` VERSION=`
sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <$SRC/configure.ac sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <$SRC/configure.ac
` || exit 4 ` || exit 4
test -n "$VERSION" || { echo >&2 "$me: no version in configure.ac"; exit 4; } test -n "$VERSION" || { printf '%s\n' >&2 "$me: no version in configure.ac"; exit 4; }
DST_SHARE="$prefix/share/emacs/$VERSION" DST_SHARE="$prefix/share/emacs/$VERSION"
DST_BIN="$prefix/bin" DST_BIN="$prefix/bin"
...@@ -209,7 +211,7 @@ maybe_mkdir "$DST_INFO" ...@@ -209,7 +211,7 @@ maybe_mkdir "$DST_INFO"
PRUNED="" PRUNED=""
if test x"$PRUNE" != xno; then if test x"$PRUNE" != xno; then
for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do for D in `ls -1t $BUILD/src/emacs-$VERSION.* | sed 1d`; do
echo $REMOVE_CMD $D printf '%s\n' "$REMOVE_CMD $D"
PRUNED="$PRUNED $D" PRUNED="$PRUNED $D"
done done
fi fi
...@@ -219,7 +221,7 @@ test x"$PRUNE" = xonly && exit 0 ...@@ -219,7 +221,7 @@ test x"$PRUNE" = xonly && exit 0
maybe_emit_copy () maybe_emit_copy ()
{ {
if test "$FORCE" = yes || ! cmp -s $1 $2; then if test "$FORCE" = yes || ! cmp -s $1 $2; then
echo $LINK_CMD $1 $2 printf '%s\n' "$LINK_CMD $1 $2"
fi fi
} }
...@@ -240,7 +242,7 @@ for SUBDIR in lisp leim etc lib-src info; do ...@@ -240,7 +242,7 @@ for SUBDIR in lisp leim etc lib-src info; do
# defaults # defaults
SHARED=no SHARED=no
FORCED='' FORCED=''
AVOID_PAT="`echo "($AVOID)" | tr ' ' '|'`" AVOID_PAT="`printf '%s\n' "($AVOID)" | tr ' ' '|'`"
# Set subdir-specific values # Set subdir-specific values
case $SUBDIR in case $SUBDIR in
...@@ -255,7 +257,7 @@ for SUBDIR in lisp leim etc lib-src info; do ...@@ -255,7 +257,7 @@ for SUBDIR in lisp leim etc lib-src info; do
;; ;;
lib-src) lib-src)
DST="$DST_LIBEXEC" DST="$DST_LIBEXEC"
AVOID_PAT="`echo "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`" AVOID_PAT="`printf '%s\n' "($AVOID ($PUBLIC_LIBSRC_BINARIES)\$)" | tr ' ' '|'`"
;; ;;
info) info)
DST="$DST_INFO" DST="$DST_INFO"
...@@ -267,10 +269,10 @@ for SUBDIR in lisp leim etc lib-src info; do ...@@ -267,10 +269,10 @@ for SUBDIR in lisp leim etc lib-src info; do
if [ -d $PFX/$SUBDIR ]; then if [ -d $PFX/$SUBDIR ]; then
for DIR in `(cd $PFX/$SUBDIR; find . -type d -print | sed 's@^./@@')`; do for DIR in `(cd $PFX/$SUBDIR; find . -type d -print | sed 's@^./@@')`; do
if [ -d $DST/$DIR ]; then if [ -d $DST/$DIR ]; then
echo Directory $DST/$DIR exists printf '%s\n' "Directory $DST/$DIR exists"
else else
echo Directory $DST/$DIR non-existent printf '%s\n' "Directory $DST/$DIR non-existent"
if [ "`echo $DIR | egrep -v "$AVOID_PAT"`" ]; then if [ "`printf '%s\n' "$DIR" | grep -Ev "$AVOID_PAT"`" ]; then
maybe_mkdir $DST/$DIR maybe_mkdir $DST/$DIR
fi fi
fi fi
......
...@@ -35,14 +35,14 @@ while [ $# -gt 0 ]; do ...@@ -35,14 +35,14 @@ while [ $# -gt 0 ]; do
-f|--force) force=1 ;; -f|--force) force=1 ;;
-n|--nmax) nmax="$2"; shift ;; -n|--nmax) nmax="$2"; shift ;;
-o|--output) output="$2" ; shift ;; -o|--output) output="$2" ; shift ;;
*) echo "Unrecognized argument: $1" >&2; exit 1 ;; *) printf '%s\n' "Unrecognized argument: $1" >&2; exit 1 ;;
esac esac
shift shift
done done
if [ ! -f ChangeLog.$nmax ]; then if [ ! -f ChangeLog.$nmax ]; then
echo "Can't find ChangeLog.$nmax" >&2 printf '%s\n' "Can't find ChangeLog.$nmax" >&2
echo "Must be run from the top source directory" >&2 printf '%s\n' "Must be run from the top source directory" >&2
exit 1 exit 1
fi fi
...@@ -52,7 +52,7 @@ fi ...@@ -52,7 +52,7 @@ fi
gen_origin_line=` gen_origin_line=`
grep -E '^commit [0-9a-f]+ [(]inclusive[)]' ChangeLog.$nmax grep -E '^commit [0-9a-f]+ [(]inclusive[)]' ChangeLog.$nmax
` || { ` || {
echo "ChangeLog.$nmax lacks a 'commit ... (inclusive)' line" >&2 printf '%s\n' "ChangeLog.$nmax lacks a 'commit ... (inclusive)' line" >&2
exit 1 exit 1
} }
set $gen_origin_line set $gen_origin_line
...@@ -63,7 +63,7 @@ fi ...@@ -63,7 +63,7 @@ fi
new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit
if [ -f "$output" ]; then if [ -f "$output" ]; then
[ ! "$force" ] && echo "$output exists" >&2 && exit 1 [ ! "$force" ] && printf '%s\n' "$output exists" >&2 && exit 1
rm -f "$output" || exit 1 rm -f "$output" || exit 1
fi fi
......
...@@ -401,7 +401,7 @@ gamegroup= ...@@ -401,7 +401,7 @@ gamegroup=
case ${with_gameuser} in case ${with_gameuser} in
no) ;; no) ;;
"" | yes) gamegroup=games ;; "" | yes) gamegroup=games ;;
:*) gamegroup=`echo "${with_gameuser}" | sed -e "s/://"` ;; :*) gamegroup=${with_gameuser#:} ;;
*) gameuser=${with_gameuser} ;; *) gameuser=${with_gameuser} ;;
esac esac
...@@ -1702,15 +1702,17 @@ fi ...@@ -1702,15 +1702,17 @@ fi
LD_SWITCH_X_SITE_RPATH= LD_SWITCH_X_SITE_RPATH=
if test "${x_libraries}" != NONE; then if test "${x_libraries}" != NONE; then
if test -n "${x_libraries}"; then if test -n "${x_libraries}"; then
LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` LD_SWITCH_X_SITE=-L`AS_ECHO(["$x_libraries"]) | sed -e 's/:/ -L/g'`
LD_SWITCH_X_SITE_RPATH=-Wl,-rpath,`echo ${x_libraries} | sed -e "s/:/ -Wl,-rpath,/g"` LD_SWITCH_X_SITE_RPATH=-Wl,-rpath,`
AS_ECHO(["$x_libraries"]) | sed -e 's/:/ -Wl,-rpath,/g'
`
fi fi
x_default_search_path="" x_default_search_path=""
x_search_path=${x_libraries} x_search_path=${x_libraries}
if test -z "${x_search_path}"; then if test -z "${x_search_path}"; then
x_search_path=/usr/lib x_search_path=/usr/lib
fi fi
for x_library in `echo ${x_search_path}: | \ for x_library in `AS_ECHO(["$x_search_path:"]) | \
sed -e "s/:/ /g" -e p -e "s:/lib[[^ /]]* :/share :g"`; do sed -e "s/:/ /g" -e p -e "s:/lib[[^ /]]* :/share :g"`; do
x_search_path="\ x_search_path="\
${x_library}/X11/%L/%T/%N%C%S:\ ${x_library}/X11/%L/%T/%N%C%S:\
...@@ -1729,15 +1731,15 @@ fi ...@@ -1729,15 +1731,15 @@ fi
AC_SUBST(LD_SWITCH_X_SITE_RPATH) AC_SUBST(LD_SWITCH_X_SITE_RPATH)
if test "${x_includes}" != NONE && test -n "${x_includes}"; then if test "${x_includes}" != NONE && test -n "${x_includes}"; then
C_SWITCH_X_SITE="$isystem"`echo ${x_includes} | sed -e "s/:/ $isystem/g"` C_SWITCH_X_SITE=$isystem`AS_ECHO(["$x_includes"]) | sed -e "s/:/ $isystem/g"`
fi fi
if test x"${x_includes}" = x; then if test x"${x_includes}" = x; then
bitmapdir=/usr/include/X11/bitmaps bitmapdir=/usr/include/X11/bitmaps
else else
# accumulate include directories that have X11 bitmap subdirectories # accumulate include directories that have X11 bitmap subdirectories
bmd_acc="dummyval" bmd_acc=
for bmd in `echo ${x_includes} | sed -e "s/:/ /g"`; do for bmd in `AS_ECHO(["$x_includes"]) | sed -e 's/:/ /g'`; do
if test -d "${bmd}/X11/bitmaps"; then if test -d "${bmd}/X11/bitmaps"; then
bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps" bmd_acc="${bmd_acc}:${bmd}/X11/bitmaps"
fi fi
...@@ -1745,9 +1747,7 @@ else ...@@ -1745,9 +1747,7 @@ else
bmd_acc="${bmd_acc}:${bmd}/bitmaps" bmd_acc="${bmd_acc}:${bmd}/bitmaps"
fi fi
done done
if test ${bmd_acc} != "dummyval"; then bitmapdir=${bmdacc#:}
bitmapdir=`echo ${bmd_acc} | sed -e "s/^dummyval://"`
fi
fi fi
test "${with_ns}" = maybe && test "${opsys}" != darwin && with_ns=no test "${with_ns}" = maybe && test "${opsys}" != darwin && with_ns=no
...@@ -1777,11 +1777,23 @@ if test "${with_ns}" != no; then ...@@ -1777,11 +1777,23 @@ if test "${with_ns}" != no; then
elif test -f $GNUSTEP_CONFIG_FILE; then elif test -f $GNUSTEP_CONFIG_FILE; then
NS_IMPL_GNUSTEP=yes NS_IMPL_GNUSTEP=yes
dnl FIXME sourcing this several times in subshells seems inefficient. dnl FIXME sourcing this several times in subshells seems inefficient.
GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_HEADERS=$(
GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" . $GNUSTEP_CONFIG_FILE
AS_ECHO(["$GNUSTEP_SYSTEM_HEADERS"])
)
GNUSTEP_SYSTEM_LIBRARIES=$(
. $GNUSTEP_CONFIG_FILE
AS_ECHO(["$GNUSTEP_SYSTEM_LIBRARIES"])
)
dnl I seemed to need these as well with GNUstep-startup 0.25. dnl I seemed to need these as well with GNUstep-startup 0.25.
GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)" GNUSTEP_LOCAL_HEADERS=$(
GNUSTEP_LOCAL_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_LIBRARIES)" . $GNUSTEP_CONFIG_FILE
AS_ECHO(["$GNUSTEP_LOCAL_HEADERS"])
)
GNUSTEP_LOCAL_LIBRARIES=$(
. $GNUSTEP_CONFIG_FILE
AS_ECHO(["$GNUSTEP_LOCAL_LIBRARIES"])
)
test "x${GNUSTEP_LOCAL_HEADERS}" != "x" && \ test "x${GNUSTEP_LOCAL_HEADERS}" != "x" && \
GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}" GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}"
test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \ test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \
...@@ -2057,7 +2069,11 @@ if test "$window_system" = none && test "X$with_x" != "Xno"; then ...@@ -2057,7 +2069,11 @@ if test "$window_system" = none && test "X$with_x" != "Xno"; then
AC_CHECK_PROG(HAVE_XSERVER, X, true, false) AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
if test "$HAVE_XSERVER" = true || if test "$HAVE_XSERVER" = true ||
test -n "$DISPLAY" || test -n "$DISPLAY" ||
test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then {
for emacs_libX11 in /usr/lib/libX11.*; do break; done
test "$emacs_libX11" != '/usr/lib/libX11.*'
}
then
AC_MSG_ERROR([You seem to be running X, but no X development libraries AC_MSG_ERROR([You seem to be running X, but no X development libraries
were found. You should install the relevant development files for X were found. You should install the relevant development files for X
and for the toolkit you want, such as Gtk+ or Motif. Also make and for the toolkit you want, such as Gtk+ or Motif. Also make
...@@ -4718,11 +4734,13 @@ CPPFLAGS="$REAL_CPPFLAGS" ...@@ -4718,11 +4734,13 @@ CPPFLAGS="$REAL_CPPFLAGS"
LIBS="$REAL_LIBS" LIBS="$REAL_LIBS"
## Hack to detect a buggy GCC version. ## Hack to detect a buggy GCC version.
if test "x$GCC" = xyes \ if test "$GCC" = yes && \
&& test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ $CC --version 2> /dev/null | grep 'gcc.* 4.5.0' >/dev/null; then
&& test x"`echo $CFLAGS | grep '\-O@<:@23@:>@'`" != x \ case $CFLAGS in
&& test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then *-fno-optimize-sibling-calls*) ;;
AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.]) *-O@<:@23@:>@*)
AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS.]);;
esac
fi fi
version=$PACKAGE_VERSION version=$PACKAGE_VERSION
...@@ -4976,7 +4994,7 @@ LIBS=$SAVE_LIBS ...@@ -4976,7 +4994,7 @@ LIBS=$SAVE_LIBS
if test "${opsys}" = "mingw32"; then if test "${opsys}" = "mingw32"; then
CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I \${abs_top_srcdir}/nt/inc" CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I \${abs_top_srcdir}/nt/inc"
# Remove unneeded switches from the value of CC that goes to Makefiles # Remove unneeded switches from the value of CC that goes to Makefiles
CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"` CC=`AS_ECHO(["$CC"]) | sed -e "s,$GCC_TEST_OPTIONS,,"`
fi fi
case "$opsys" in case "$opsys" in
...@@ -5124,7 +5142,8 @@ else ...@@ -5124,7 +5142,8 @@ else
ACL_SUMMARY=no ACL_SUMMARY=no
fi fi
echo " emacs_standard_dirs='Standard dirs'
AS_ECHO(["
Configured for '${canonical}'. Configured for '${canonical}'.
Where should the build process find the source code? ${srcdir} Where should the build process find the source code? ${srcdir}
...@@ -5133,18 +5152,9 @@ Configured for '${canonical}'. ...@@ -5133,18 +5152,9 @@ Configured for '${canonical}'.
Should Emacs use a relocating allocator for buffers? ${REL_ALLOC} Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
What window system should Emacs use? ${window_system} What window system should Emacs use? ${window_system}
What toolkit should Emacs use? ${USE_X_TOOLKIT}" What toolkit should Emacs use? ${USE_X_TOOLKIT}
Where do we find X Windows header files? ${x_includes:-$emacs_standard_dirs}
if test -n "${x_includes}"; then Where do we find X Windows libraries? ${x_libraries:-$emacs_standard_dirs}"])
echo " Where do we find X Windows header files? ${x_includes}"
else
echo " Where do we find X Windows header files? Standard dirs"
fi
if test -n "${x_libraries}"; then
echo " Where do we find X Windows libraries? ${x_libraries}"
else
echo " Where do we find X Windows libraries? Standard dirs"
fi
optsep= optsep=
emacs_config_features= emacs_config_features=
...@@ -5174,57 +5184,53 @@ done ...@@ -5174,57 +5184,53 @@ done
AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}", AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}",
[Summary of some of the main features enabled by configure.]) [Summary of some of the main features enabled by configure.])
echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}" AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D}
echo " Does Emacs use -lXpm? ${HAVE_XPM}" Does Emacs use -lXpm? ${HAVE_XPM}
echo " Does Emacs use -ljpeg? ${HAVE_JPEG}" Does Emacs use -ljpeg? ${HAVE_JPEG}
echo " Does Emacs use -ltiff? ${HAVE_TIFF}" Does Emacs use -ltiff? ${HAVE_TIFF}
echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF" Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF
echo " Does Emacs use a png library? ${HAVE_PNG} $LIBPNG" Does Emacs use a png library? ${HAVE_PNG} $LIBPNG
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" Does Emacs use -lrsvg-2? ${HAVE_RSVG}
echo " Does Emacs use cairo? ${USE_CAIRO}" Does Emacs use cairo? ${USE_CAIRO}
echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}