[Mew-dist 1797] Re: use install command patch at mew-1.90/bin
Maybe TABOO
y-koga at example.com
1997年 8月 29日 (金) 18:04:55 JST
SAKAI Kiyotaka <ksakai at example.com>:
> mew-1.90/bin で install コマンドを使用するためのパッチです。
んー、これじゃ×では? Makefile はできないし、configure コマンド中に全
然 INSTALL をいじる箇所がないですから。
また、mew-1.90 のディレクトリの Makefile も修正しないと×です。
とりあえず、IM-65 から必要そうな箇所を切り取って configure に加えまし
た。一応これで通ります。
BEGIN------------------- ここから ------------------------
diff -urN ../mew-1.90.orig/Makefile ./Makefile
--- ../mew-1.90.orig/Makefile Wed Aug 20 20:31:19 1997
+++ ./Makefile Fri Aug 29 17:34:02 1997
@@ -68,7 +68,7 @@
$(EMACS) -batch -l ./$(LDPATH) -f batch-byte-compile $<
all: $(OBJS) $(MEW)
- cd $(BIN); $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)"
+ cd $(BIN); ./configure; $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)"
$(OBJS): $(LDPATH) mew.el
diff -urN ../mew-1.90.orig/bin/Makefile ./bin/Makefile
--- ../mew-1.90.orig/bin/Makefile Tue Aug 26 15:26:46 1997
+++ ./bin/Makefile Thu Jan 1 09:00:00 1970
@@ -1,35 +0,0 @@
-SRC = mewencode.c getopt.c
-OBJ = mewencode.o getopt.o
-PRG = mewencode
-AL1 = mewdecode
-AL2 = mewcat
-OTH = uumerge
-CNF = config.status config.cache config.log
-RM = rm -f
-
-BINDIR = /usr/local/bin
-
-#CFLAGS = -g
-
-all: $(PRG) $(OTH)
-
-$(PRG) : $(OBJ)
- $(CC) -o $@ $(OBJ)
- $(RM) $(AL1)
- $(RM) $(AL2)
- ln $(PRG) $(AL1)
- ln $(PRG) $(AL2)
-
-$(OTH) :
- ./configure
-
-install: $(PRG) $(OTH)
- $(RM) $(BINDIR)/$(AL1)
- $(RM) $(BINDIR)/$(AL2)
- cp $(PRG) $(BINDIR)
- ln $(BINDIR)/$(PRG) $(BINDIR)/$(AL1)
- ln $(BINDIR)/$(PRG) $(BINDIR)/$(AL2)
- cp -f $(OTH) $(BINDIR)
-
-clean:
- $(RM) $(OBJ) $(PRG) $(AL1) $(AL2) $(CNF) $(OTH)
diff -urN ../mew-1.90.orig/bin/Makefile.in ./bin/Makefile.in
--- ../mew-1.90.orig/bin/Makefile.in Thu Jan 1 09:00:00 1970
+++ ./bin/Makefile.in Fri Aug 29 16:54:35 1997
@@ -0,0 +1,39 @@
+SRC = mewencode.c getopt.c
+OBJ = mewencode.o getopt.o
+PRG = mewencode
+AL1 = mewdecode
+AL2 = mewcat
+OTH = uumerge
+CNF = config.status config.cache config.log
+RM = rm -f
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+BINDIR = /usr/local/bin
+
+#CFLAGS = -g
+
+all: $(PRG) $(OTH)
+
+$(PRG) : $(OBJ)
+ $(CC) -o $@ $(OBJ)
+ $(RM) $(AL1)
+ $(RM) $(AL2)
+ ln $(PRG) $(AL1)
+ ln $(PRG) $(AL2)
+
+$(OTH) :
+ ./configure
+
+install: $(PRG) $(OTH)
+ $(RM) $(BINDIR)/$(AL1)
+ $(RM) $(BINDIR)/$(AL2)
+ $(INSTALL_PROGRAM) $(PRG) $(BINDIR)
+ ln $(BINDIR)/$(PRG) $(BINDIR)/$(AL1)
+ ln $(BINDIR)/$(PRG) $(BINDIR)/$(AL2)
+ $(INSTALL_PROGRAM) $(OTH) $(BINDIR)
+
+clean:
+ $(RM) $(OBJ) $(PRG) $(AL1) $(AL2) $(CNF) $(OTH)
diff -urN ../mew-1.90.orig/bin/configure ./bin/configure
--- ../mew-1.90.orig/bin/configure Mon Jun 23 21:28:17 1997
+++ ./bin/configure Fri Aug 29 17:55:01 1997
@@ -517,6 +517,84 @@
ac_n= ac_c='\c' ac_t=
fi
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:555: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ for ac_prog in ginstall installbsd scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ # OSF/1 installbsd also uses dspmsg, but is usable.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "perl", so it can be a program name with args.
@@ -662,6 +740,7 @@
done
ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "uumerge" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
@@ -693,6 +772,8 @@
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PERL@%$PERL%g
CEOF
@@ -735,7 +816,7 @@
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"uumerge"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile uumerge"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -770,6 +851,10 @@
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
echo creating "$ac_file"
rm -f "$ac_file"
@@ -785,6 +870,7 @@
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
diff -urN ../mew-1.90.orig/bin/configure.in ./bin/configure.in
--- ../mew-1.90.orig/bin/configure.in Mon Jun 23 21:28:13 1997
+++ ./bin/configure.in Fri Aug 29 17:31:36 1997
@@ -2,5 +2,6 @@
AC_INIT(uumerge.in)
dnl Checks for programs.
+AC_PROG_INSTALL
AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
-AC_OUTPUT(uumerge, chmod 555 uumerge)
+AC_OUTPUT(Makefile uumerge, chmod 555 uumerge)
diff -urN ../mew-1.90.orig/bin/install-sh ./bin/install-sh
--- ../mew-1.90.orig/bin/install-sh Thu Jan 1 09:00:00 1970
+++ ./bin/install-sh Thu Apr 24 10:26:48 1997
@@ -0,0 +1,238 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+tranformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
END--------------------- ここまで ------------------------
----
NEC ネットワーキング技術研究所 & 慶應義塾SFC研究所
こがよういちろう <y-koga at example.com> 他
Mew-dist メーリングリストの案内