home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / lib / configure (.txt) < prev    next >
LaTeX Document  |  1998-04-23  |  13KB  |  377 lines

  1. #! /bin/sh
  2. # This script is a hand-made configure script. It contains a lot of
  3. # code stolen from GNU autoconf. I removed all the code that was not
  4. # useful for configuring a LyX installation.
  5. ####some configuration variables
  6. lyx_check_config=yes
  7. lyx_keep_temps=no
  8. lyx_called_from_configure=no;
  9. srcdir=
  10. #### Parse the command line
  11. for ac_option do
  12.   case "$ac_option" in
  13.     -help | --help | -h)
  14.       cat << EOF
  15. Usage: configure [options] 
  16. Options: 
  17.   --help                   show this help lines
  18.   --keep-temps             keep temporary files (for debug. purposes)
  19.   --without-latex-config   do not run LaTeX to determine configuration
  20.       exit 0;;
  21.     --without-latex-config)
  22.       lyx_check_config=no ;;
  23.     --keep-temps)
  24.       lyx_keep_temps=yes ;;
  25.     --srcdir*)
  26.       lyx_called_from_configure=yes;;
  27.   esac 
  28. #### Checking for some echo oddities
  29. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  30.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  31.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  32.     ac_n= ac_c='
  33. ' ac_t='    '
  34.   else
  35.     ac_n=-n ac_c= ac_t=
  36.   ac_n= ac_c='\c' ac_t=
  37. #### I do not really know why this is useful, but we might as well keep it.
  38. # NLS nuisances.
  39. # Only set these to C if already set.  These must not be set unconditionally
  40. # because not all systems understand e.g. LANG=C (notably SCO).
  41. # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
  42. # Non-C LC_CTYPE values break the ctype check.
  43. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  44. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  45. if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
  46. if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
  47. #### Guess the directory in which configure is located.
  48. ac_prog=$0
  49. srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` 
  50. srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  51. test "x$srcdir" = "x$ac_prog" && srcdir=.
  52. if test ! -r ${srcdir}/chkconfig.ltx ; then
  53.   echo "configure: error: cannot find chkconfig.ltx script"
  54.   exit 1
  55. #### Create the build directories if necessary
  56. for dir in bind doc kbd layouts templates ; do
  57.   test ! -d $dir && mkdir $dir
  58. #### Searching some useful programs
  59. # Search LaTeX2e
  60. echo $ac_n "checking for a LaTeX2e program""... $ac_c"
  61. echo "$ac_t"""
  62. LATEX=
  63. for ac_prog in latex latex2e
  64. # Extract the first word of "$ac_prog", so it can be a program name with args.
  65. set dummy $ac_prog ; ac_word=$2
  66. if test -n "$ac_word"; then
  67.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  68.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  69.   for ac_dir in $PATH; do
  70.     test -z "$ac_dir" && ac_dir=.
  71.     if test -x $ac_dir/$ac_word; then
  72.       LATEX="$ac_prog"
  73.       break
  74.     fi
  75.   done
  76.   IFS="$ac_save_ifs"
  77.   if test -n "$LATEX"; then
  78.     ac_result=yes
  79.   else
  80.     ac_result=no
  81. ## Check whether this is really LaTeX2e
  82. rm -f chklatex.ltx
  83. cat >chklatex.ltx <<EOF
  84. \\nonstopmode\\makeatletter
  85. \\ifx\\undefined\\documentclass\\else
  86.   \\message{ThisIsLaTeX2e}
  87. \\@@end
  88. if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
  89.                        | grep 'ThisIsLaTeX2e' >/dev/null; then
  90.   LATEX=
  91.   ac_result="not useable"
  92. rm -f chklatex.ltx chklatex.log
  93.   echo "$ac_t""$ac_result"
  94.   test -n "$LATEX" && break
  95. if test -z "$LATEX" ; then
  96.   LATEX=none
  97.     lyx_check_config=no
  98. # Search for a Postscript interpreter
  99. echo $ac_n "checking for a Postscript interpreter""... $ac_c"
  100. echo "$ac_t"""
  101. for ac_prog in gs
  102. # Extract the first word of "$ac_prog", so it can be a program name with args.
  103. set dummy $ac_prog ; ac_word=$2
  104. if test -n "$ac_word"; then
  105.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  106.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  107.   for ac_dir in $PATH; do
  108.     test -z "$ac_dir" && ac_dir=.
  109.     if test -x $ac_dir/$ac_word; then
  110.       GS="$ac_prog"
  111.       break
  112.     fi
  113.   done
  114.   IFS="$ac_save_ifs"
  115.   if test -n "$GS"; then
  116.     ac_result=yes
  117.   else
  118.     ac_result=no
  119.   echo "$ac_t""$ac_result"
  120.   test -n "$GS" && break
  121. if test -z "$GS" ; then
  122.   GS=none
  123. # Search something to preview postscript
  124. echo $ac_n "checking for a Postscript previewer""... $ac_c"
  125. echo "$ac_t"""
  126. GHOSTVIEW=
  127. for ac_prog in gv ghostview
  128. # Extract the first word of "$ac_prog", so it can be a program name with args.
  129. set dummy $ac_prog ; ac_word=$2
  130. if test -n "$ac_word"; then
  131.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  132.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  133.   for ac_dir in $PATH; do
  134.     test -z "$ac_dir" && ac_dir=.
  135.     if test -x $ac_dir/$ac_word; then
  136.       GHOSTVIEW="$ac_prog"
  137.       break
  138.     fi
  139.   done
  140.   IFS="$ac_save_ifs"
  141.   if test -n "$GHOSTVIEW"; then
  142.     ac_result=yes
  143.   else
  144.     ac_result=no
  145.   echo "$ac_t""$ac_result"
  146.   test -n "$GHOSTVIEW" && break
  147. if test -z "$GHOSTVIEW" ; then
  148.   GHOSTVIEW=none
  149. # Search a *roff program (used to translate tables in ASCII export)
  150. echo $ac_n "checking for a *roff formatter""... $ac_c"
  151. echo "$ac_t"""
  152. ROFF=
  153. for ac_prog in groff nroff
  154. # Extract the first word of "$ac_prog", so it can be a program name with args.
  155. set dummy $ac_prog ; ac_word=$2
  156. if test -n "$ac_word"; then
  157.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  158.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  159.   for ac_dir in $PATH; do
  160.     test -z "$ac_dir" && ac_dir=.
  161.     if test -x $ac_dir/$ac_word; then
  162.       ROFF="$ac_prog"
  163.       break
  164.     fi
  165.   done
  166.   IFS="$ac_save_ifs"
  167.   if test -n "$ROFF"; then
  168.     ac_result=yes
  169.   else
  170.     ac_result=no
  171.   echo "$ac_t""$ac_result"
  172.   test -n "$ROFF" && break
  173. if test -z "$ROFF" ; then
  174.   ROFF=none
  175. ascii_roff_command=$ROFF
  176. test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
  177. test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
  178. # Search the ChkTeX program
  179. echo $ac_n "checking for ChkTeX""... $ac_c"
  180. echo "$ac_t"""
  181. CHKTEX=
  182. for ac_prog in chktex
  183. # Extract the first word of "$ac_prog", so it can be a program name with args.
  184. set dummy $ac_prog ; ac_word=$2
  185. if test -n "$ac_word"; then
  186.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  187.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  188.   for ac_dir in $PATH; do
  189.     test -z "$ac_dir" && ac_dir=.
  190.     if test -x $ac_dir/$ac_word; then
  191.       CHKTEX="$ac_prog"
  192.       break
  193.     fi
  194.   done
  195.   IFS="$ac_save_ifs"
  196.   if test -n "$CHKTEX"; then
  197.     ac_result=yes
  198.   else
  199.     ac_result=no
  200.   echo "$ac_t""$ac_result"
  201.   test -n "$CHKTEX" && break
  202. if test -z "$CHKTEX" ; then
  203.   CHKTEX=none
  204. chktex_command=$CHKTEX
  205. test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
  206. # Search a Fax handling program
  207. echo $ac_n "checking for a fax driver""... $ac_c"
  208. echo "$ac_t"""
  209. for ac_prog in sendfax faxsend fax
  210. # Extract the first word of "$ac_prog", so it can be a program name with args.
  211. set dummy $ac_prog ; ac_word=$2
  212. if test -n "$ac_word"; then
  213.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  214.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  215.   for ac_dir in $PATH; do
  216.     test -z "$ac_dir" && ac_dir=.
  217.     if test -x $ac_dir/$ac_word; then
  218.       FAX="$ac_prog"
  219.       break
  220.     fi
  221.   done
  222.   IFS="$ac_save_ifs"
  223.   if test -n "$FAX"; then
  224.     ac_result=yes
  225.   else
  226.     ac_result=no
  227.   echo "$ac_t""$ac_result"
  228.   test -n "$FAX" && break
  229. if test -z "$FAX" ; then
  230.   FAX=none
  231. if test $FAX = sendfax ; then
  232.   fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
  233. elif test $FAX = faxsend ; then
  234.   fax_command="faxsend '\$\$Phone' '\$\$FName'"
  235. elif test $FAX = fax ; then
  236.   fax_command="fax send '\$\$Phone' '\$\$FName'"
  237.   fax_command="none"
  238. # Search for LinuxDoc/SGML-tools
  239. echo $ac_n "checking for SGML-tools (aka LinuxDoc-SGML)""... $ac_c"
  240. echo "$ac_t"""
  241. SGMLTOOLS=
  242. for ac_prog in sgml2lyx
  243. # Extract the first word of "$ac_prog", so it can be a program name with args.
  244. set dummy $ac_prog ; ac_word=$2
  245. if test -n "$ac_word"; then
  246.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  247.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  248.   for ac_dir in $PATH; do
  249.     test -z "$ac_dir" && ac_dir=.
  250.     if test -x $ac_dir/$ac_word; then
  251.       SGMLTOOLS="$ac_prog"
  252.       break
  253.     fi
  254.   done
  255.   IFS="$ac_save_ifs"
  256.   if test -n "$SGMLTOOLS"; then
  257.     ac_result=yes
  258.   else
  259.     ac_result=no
  260.   echo "$ac_t""$ac_result"
  261.   test -n "$SGMLTOOLS" && break
  262. if test -z "$SGMLTOOLS" ; then
  263.   SGMLTOOLS=none
  264. chk_sgmltools=no
  265. if test $SGMLTOOLS != none; then
  266.   chk_sgmltools=yes
  267.   sgmltools_cmd="\\def\\hassgmltools{}"
  268. # Search for a spool command
  269. echo $ac_n "checking for a spool command""... $ac_c"
  270. echo "$ac_t"""
  271. for ac_prog in lp lpr
  272. # Extract the first word of "$ac_prog", so it can be a program name with args.
  273. set dummy $ac_prog ; ac_word=$2
  274. if test -n "$ac_word"; then
  275.   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
  276.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  277.   for ac_dir in $PATH; do
  278.     test -z "$ac_dir" && ac_dir=.
  279.     if test -x $ac_dir/$ac_word; then
  280.       LPR="$ac_prog"
  281.       break
  282.     fi
  283.   done
  284.   IFS="$ac_save_ifs"
  285.   if test -n "$LPR"; then
  286.     ac_result=yes
  287.   else
  288.     ac_result=no
  289.   echo "$ac_t""$ac_result"
  290.   test -n "$LPR" && break
  291. if test -z "$LPR" ; then
  292.   LPR=none
  293. case $LPR in
  294.   lp) print_spool_command=lp
  295.       print_spool_printerprefix="-d ";;
  296.  lpr) print_spool_command=lpr
  297.       print_spool_printerprefix="-P";;
  298.    *) :;; # leave to empty values
  299. #### Explore the LaTeX configuration
  300. echo $ac_n "checking LaTeX configuration""... $ac_c"
  301. if test ${lyx_check_config} = no ; then
  302.   echo "$ac_t""default"
  303.   # Create dumb versions of the different files.
  304.   cat >textclass.lst <<EOF
  305. # This file declares layouts and their associated definition files
  306. # (include dir. relative to the place where this file is).
  307. # It contains only default values, since chkconfig.ltx could not be run 
  308. # for some reason. Run ./configure if you need to update it after a
  309. # configuration change.  
  310. article    article    article
  311. report    report    report
  312. book    book    book
  313. linuxdoc    linuxdoc    linuxdoc
  314. letter    letter    letter
  315.   cat >chkconfig.sed <<EOF
  316. s/@.*@/???/g
  317.   touch packages.lst
  318.   echo "$ac_t""auto"
  319.   rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
  320.   cat >wrap_chkconfig.ltx <<EOF
  321. \\newcommand\\srcdir{${srcdir}}
  322. ${sgmltools_cmd}
  323. \\input{${srcdir}/chkconfig.ltx}
  324.   ## Construct the list of classes to test for.
  325.   # build the list of available layout files and convert it to commands 
  326.   # for chkconfig.ltx 
  327.   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do 
  328.     case $file in
  329.       */\*.layout) ;;
  330.       *) echo $file ;;
  331.     esac
  332.   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
  333.              > chklayouts.tex
  334.   eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
  335.   eval `cat chkconfig.vars | sed 's/-/_/g'`
  336. # This is a bit of cheating since chkconfig.ltx did it for us, but it
  337. # is better to have some output 
  338. echo creating textclass.lst 
  339. echo creating packages.lst
  340. echo creating doc/LaTeXConfig.lyx
  341. echo "s/@chk_sgmltools@/$chk_sgmltools/g" >> chkconfig.sed
  342. sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
  343. echo creating lyxrc.defaults
  344. rm -f lyxrc.defaults
  345. cat >lyxrc.defaults <<EOF
  346. # This file has been automatically generated by LyX' lib/configure
  347. # script. It contains default settings that have been determined by
  348. # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
  349. # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
  350. # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
  351. # override the values given here.
  352. \\latex_command "$LATEX"
  353. \\ps_command "$GS"
  354. \\view_ps_command "$GHOSTVIEW -swap"
  355. \\view_pspic_command "$GHOSTVIEW"
  356. \\ascii_roff_command "$ascii_roff_command"
  357. \\chktex_command "$chktex_command"
  358. \\fax_command "$fax_command"
  359. \\print_spool_command "$print_spool_command"
  360. \\print_spool_printerprefix "$print_spool_printerprefix"
  361. \\font_encoding "$chk_fontenc"
  362. # Remove superfluous files if we are not writing in the main lib
  363. # directory (i.e. if chkconfig.ltx is *not* in the current directory).
  364. if test $lyx_called_from_configure = no ; then
  365.   for file in lyxrc.defaults textclass.lst packages.lst \
  366.               doc/LaTeXConfig.lyx ; do
  367.     if test -r $srcdir/$file && diff $file $srcdir/$file >/dev/null 2>/dev/null ; 
  368.     then 
  369.       echo "removing $file, which is identical to the system global version"
  370.       rm -f $file
  371.     fi
  372.   done
  373. # Final clean-up
  374. if test $lyx_keep_temps = no ; then
  375. rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \
  376.       missfont.log
  377.