From 35c6b8aecf1985f7b3fc6e3d273413ba592a9331 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 27 Jul 2002 20:09:37 +0000 Subject: [PATCH] Changed tests for joe editor --- Makefile.global.in | 4 ++++ configure | 29 +++++++++++++++++++++++++++++ configure.in | 21 +++++++++++++++++++++ script/Makefile | 30 ++++++++++++------------------ 4 files changed, 66 insertions(+), 18 deletions(-) diff --git a/Makefile.global.in b/Makefile.global.in index 46b80f18..281169cc 100644 --- a/Makefile.global.in +++ b/Makefile.global.in @@ -26,6 +26,10 @@ AWK = @AWK@ TAR = @TAR@ ZIP = @ZIP@ +# joe editor +JOEBIN = @joebin@ +JOELIB = @joelib@ + CFLAGS = -O2 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe LIBS = @LIBS@ diff --git a/configure b/configure index 44bd6817..4ad9644b 100755 --- a/configure +++ b/configure @@ -7790,6 +7790,33 @@ esac +echo "$as_me:$LINENO: checking location of joe editor" >&5 +echo $ECHO_N "checking location of joe editor... $ECHO_C" >&6 +for joebin in /usr/bin /usr/local/bin NONE; do + if test "$joebin" = "NONE"; then + { echo "$as_me:$LINENO: WARNING: not found" >&5 +echo "$as_me: WARNING: not found" >&2;} + elif test -x $joebin/joe; then + + echo "$as_me:$LINENO: result: $joebin" >&5 +echo "${ECHO_T}$joebin" >&6 + echo "$as_me:$LINENO: checking location of joe rc files" >&5 +echo $ECHO_N "checking location of joe rc files... $ECHO_C" >&6 + for joelib in /etc/joe /usr/lib/joe /usr/local/etc/joe /usr/local/lib/joe NONE; do + if test "$joelib" = "NONE"; then + { echo "$as_me:$LINENO: WARNING: not found" >&5 +echo "$as_me: WARNING: not found" >&2;} + elif test -f $joelib/joerc; then + + echo "$as_me:$LINENO: result: $joelib" >&5 +echo "${ECHO_T}$joelib" >&6 + break + fi + done + break + fi +done + echo "$as_me:$LINENO: checking location of utmp" >&5 echo $ECHO_N "checking location of utmp... $ECHO_C" >&6 for utmpdir in /var/run /var/adm /usr/adm /etc NONE; do @@ -8458,6 +8485,8 @@ s,@GOLDEDBIN@,$GOLDEDBIN,;t t s,@GOLDNODE@,$GOLDNODE,;t t s,@LOG_COMPRESS@,$LOG_COMPRESS,;t t s,@LOG_COMPRESSEXT@,$LOG_COMPRESSEXT,;t t +s,@joebin@,$joebin,;t t +s,@joelib@,$joelib,;t t CEOF _ACEOF diff --git a/configure.in b/configure.in index 86c4a3fa..bf9c933f 100644 --- a/configure.in +++ b/configure.in @@ -195,6 +195,27 @@ AC_SUBST(LOG_COMPRESS) AC_SUBST(LOG_COMPRESSEXT) dnl +AC_MSG_CHECKING(location of joe editor) +for joebin in /usr/bin /usr/local/bin NONE; do + if test "$joebin" = "NONE"; then + AC_MSG_WARN(not found) + elif test -x $joebin/joe; then + AC_SUBST(joebin) + AC_MSG_RESULT($joebin) + AC_MSG_CHECKING(location of joe rc files) + for joelib in /etc/joe /usr/lib/joe /usr/local/etc/joe /usr/local/lib/joe NONE; do + if test "$joelib" = "NONE"; then + AC_MSG_WARN(not found) + elif test -f $joelib/joerc; then + AC_SUBST(joelib) + AC_MSG_RESULT($joelib) + break + fi + done + break + fi +done + AC_MSG_CHECKING(location of utmp) for utmpdir in /var/run /var/adm /usr/adm /etc NONE; do if test "$utmpdir" = "NONE"; then diff --git a/script/Makefile b/script/Makefile index edfa0cf1..f2b49251 100644 --- a/script/Makefile +++ b/script/Makefile @@ -38,25 +38,19 @@ install: ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 hatch ${BINDIR} ; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 hatch ${BINDIR}" ; \ fi - @if [ -x /usr/bin/joe ]; then \ - rm -f /usr/bin/bbsjoe ; \ - rm -f /usr/bin/bbsjmacs ; \ - echo "ln -s /usr/bin/joe /usr/bin/bbsjoe" ; \ - ln -s /usr/bin/joe /usr/bin/bbsjoe ; \ - echo "ln -s /usr/bin/joe /usr/bin/bbsjmacs" ; \ - ln -s /usr/bin/joe /usr/bin/bbsjmacs ; \ + @if [ -x ${JOEBIN}/joe ]; then \ + rm -f ${JOEBIN}/bbsjoe ; \ + rm -f ${JOEBIN}/bbsjmacs ; \ + echo "ln -s ${JOEBIN}/joe ${JOEBIN}/bbsjoe" ; \ + ln -s ${JOEBIN}/joe ${JOEBIN}/bbsjoe ; \ + echo "ln -s ${JOEBIN}/joe ${JOEBIN}/bbsjmacs" ; \ + ln -s ${JOEBIN}/joe ${JOEBIN}/bbsjmacs ; \ fi - @if [ -d /usr/lib/joe ]; then \ - ${INSTALL} -c -o root -g root -m 0644 bbsjoerc /usr/lib/joe ; \ - echo "${INSTALL} -c -o root -g root -m 0644 bbsjoerc /usr/lib/joe" ; \ - ${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc /usr/lib/joe ; \ - echo "${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc /usr/lib/joe" ; \ - fi - @if [ -d /etc/joe ]; then \ - ${INSTALL} -c -o root -g root -m 0644 bbsjoerc /etc/joe ; \ - echo "${INSTALL} -c -o root -g root -m 0644 bbsjoerc /etc/joe" ; \ - ${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc /etc/joe ; \ - echo "${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc /etc/joe" ; \ + @if [ -d ${JOELIB} ]; then \ + ${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB} ; \ + echo "${INSTALL} -c -o root -g root -m 0644 bbsjoerc ${JOELIB}" ; \ + ${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB} ; \ + echo "${INSTALL} -c -o root -g root -m 0644 bbsjmacsrc ${JOELIB}" ; \ fi ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0755 editor ${BINDIR} @if [ ! -x ${BINDIR}/bbsdoor.sh ]; then \