I want to add a section in LyX's configure script to check for viewers
of LaTeX-files. I used the following code:
-----
# Search something to view LaTeX-files
echo $ac_n "checking for an editor to view LaTeX-files""... $ac_c"
echo "$ac_t""(jEdit WinShell TeXnicCenter WinEdt WinTeX)"
TEX_VIEWER=
for ac_file in jedit.jar winshell.exe texcntr.exe winedt.exe wintex.exe
do
# Extract the first word of "$ac_file", so it can be a program name with
args.
set dummy $ac_file ; ac_word=$2
if test -n "$ac_word"; then
echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -x $ac_dir/$ac_word; then
TEX_VIEWER="$ac_file"
break
fi
done
IFS="$ac_save_ifs"
if test -n "$TEX_VIEWER"; then
ac_result=yes
else
ac_result=no
fi
echo "$ac_t""$ac_result"
test -n "$TEX_VIEWER" && break
fi
done
if test -z "$TEX_VIEWER" ; then
TEX_VIEWER=none
fi
-----
This works fine except for jedit.jar. This file isn't found although it
is in LyX's path. When I change the line
for ac_file in jedit.jar
to
for ac_file in jedit.exe
and put a file "jedit.exe" in the folder of jedit.jar, it is found. So
the problem is the file ending ".jar". Could anybody help me to fix this?
(I originally used ac_prog and changed to ac_file to allow file endings
but this obviously doesn't help.)
thanks in advance and regards
Uwe