]> git.lyx.org Git - lyx.git/blob - lib/configure.m4
update to TeXFiles.sh
[lyx.git] / lib / configure.m4
1 #! /bin/sh
2 dnl Use 'make' to create configure from this m4 script.
3 # This script is a hand-made configure script. It contains a lot of
4 # code stolen from GNU autoconf. I removed all the code that was not
5 # useful for configuring a LyX installation.
6
7
8 dnl ######### Begin M4 macros #########################################
9 dnl This is a template for my stripped-down configure script.
10 dnl First, a few convenient macros.
11 changequote([,])dnl
12 dnl
13 dnl
14 dnl MSG_CHECKING(FEATURE-DESCRIPTION,PREFIX)
15 dnl
16 define(MSG_CHECKING,
17 [echo $ac_n "$2checking $1""... $ac_c"])dnl
18 dnl
19 dnl
20 dnl MSG_RESULT(RESULT-DESCRIPTION)
21 dnl
22 define(MSG_RESULT,
23 [echo "$ac_t""$1"])dnl
24 dnl
25 dnl
26 dnl SEARCH_PROG(FEATURE-DESCRIPTION,VARIABLE-NAME,PROGRAMS-LIST,
27 dnl             ACTION-IF-FOUND,ACTION-IF-NOT-FOUND)
28 dnl
29 define(SEARCH_PROG,[dnl
30 changequote([,])dnl
31 MSG_CHECKING($1)
32 MSG_RESULT(($3))
33 $2=
34 for ac_prog in $3
35 do
36 # Extract the first word of "$ac_prog", so it can be a program name with args.
37 set dummy $ac_prog ; ac_word=$[2]
38 if test -n "$ac_word"; then
39   MSG_CHECKING([for \"$ac_word\"],[+])
40   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
41   for ac_dir in $PATH; do
42     test -z "$ac_dir" && ac_dir=.
43     if test -x [$ac_dir/$ac_word]; then
44       $2="$ac_prog"
45       break
46     fi
47   done
48   IFS="$ac_save_ifs"
49
50   if test -n "[$]$2"; then
51     ac_result=yes
52     ifelse($4,,,[$4])
53   else
54     ac_result=no
55   fi
56   MSG_RESULT($ac_result)
57   test -n "[$]$2" && break
58 fi
59 done
60
61 if test -z "[$]$2" ; then
62   $2=none
63 ifelse($5,,,[  $5
64 ])dnl
65 fi
66 changequote(,)dnl
67 ])dnl
68 dnl
69 dnl
70 dnl PROVIDE_DEFAULT_FILE(FILE, DEFAULT-VALUE)
71 dnl
72 define(PROVIDE_DEFAULT_FILE,[dnl
73 # if $1 does not exist (because LaTeX did not run), 
74 # then provide a standard version.
75 if test ! -f $1 ; then
76   cat >$1 <<EOF
77 $2
78 EOF
79 fi])
80 changequote(,)dnl
81 dnl ######### End M4 macros #############################################
82
83
84 ####some configuration variables
85 lyx_check_config=yes
86 lyx_keep_temps=no
87 srcdir=
88 lyx_suffix=
89
90 #### Parse the command line
91 for ac_option do
92   case "$ac_option" in
93     -help | --help | -h)
94       cat << EOF
95 Usage: configure [options] 
96 Options: 
97   --help                   show this help lines
98   --keep-temps             keep temporary files (for debug. purposes)
99   --without-latex-config   do not run LaTeX to determine configuration
100   --with-lyx-suffix=suffix suffix of binary installed files
101 EOF
102       exit 0;;
103     --without-latex-config)
104       lyx_check_config=no ;;
105     --keep-temps)
106       lyx_keep_temps=yes ;;
107     --with-lyx-suffix*)
108       lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
109   esac 
110 done
111
112
113 #### Checking for some echo oddities
114 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
115   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
116   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
117     ac_n= ac_c='
118 ' ac_t='        '
119   else
120     ac_n=-n ac_c= ac_t=
121   fi
122 else
123   ac_n= ac_c='\c' ac_t=
124 fi
125
126
127 #### I do not really know why this is useful, but we might as well keep it.
128 # NLS nuisances.
129 # Only set these to C if already set.  These must not be set unconditionally
130 # because not all systems understand e.g. LANG=C (notably SCO).
131 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
132 # Non-C LC_CTYPE values break the ctype check.
133 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
134 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
135 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
136 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
137
138
139 #### Guess the directory in which configure is located.
140 changequote([,])dnl
141 ac_prog=[$]0
142 changequote(,)dnl
143 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` 
144 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
145 test "x$srcdir" = "x$ac_prog" && srcdir=.
146 if test ! -r ${srcdir}/chkconfig.ltx ; then
147   echo "configure: error: cannot find chkconfig.ltx script"
148   exit 1
149 fi
150
151 #### Adjust PATH for Win32 (Cygwin)
152 if test "x$OSTYPE" = xcygwin; then
153   echo "configure: cygwin detected; path correction"
154   srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
155   echo "srcdir=${srcdir}"
156 fi
157
158 #### Create the build directories if necessary
159 for dir in bind clipart doc examples help images kbd layouts reLyX \
160     scripts templates ui ; do
161   test ! -d $dir && mkdir $dir
162 done
163
164
165 #### Searching some useful programs
166 define(CHECKLATEX2E,[
167 ## Check whether this is really LaTeX2e
168 rm -f chklatex.ltx
169 cat >chklatex.ltx <<EOF
170 \\nonstopmode\\makeatletter
171 \\ifx\\undefined\\documentclass\\else
172   \\message{ThisIsLaTeX2e}
173 \\fi
174 \\@@end
175 EOF
176 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
177                        | grep 'ThisIsLaTeX2e' >/dev/null; then
178   :
179 else
180   LATEX=
181   ac_result="not useable"
182 fi
183 rm -f chklatex.ltx chklatex.log])dnl
184 dnl
185 # Search LaTeX2e
186 SEARCH_PROG([for a LaTeX2e program],LATEX,latex latex2e,CHECKLATEX2E,dnl
187   [lyx_check_config=no])
188 latex_to_dvi=$LATEX
189 test -z "$latex_to_dvi" && latex_to_dvi="none"
190
191 # Search for pdflatex
192 if test ${lyx_check_config} = no ; then
193   latex_to_pdf=none
194 else
195   SEARCH_PROG([for the pdflatex program],latex_to_pdf,pdflatex)
196 fi
197
198 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
199 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
200
201 # Search for an installed reLyX or a ready-to-install one
202 save_PATH=${PATH}
203 PATH=${PATH}:./reLyX/
204 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
205 PATH=${save_PATH}
206 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
207 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
208
209 SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,noweb2lyx)
210 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
211 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
212
213 # Search something to process a literate document
214 SEARCH_PROG([for a Noweb -> LaTeX converter],literate_to_tex_command,noweave)
215 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
216
217 SEARCH_PROG([for a HTML -> Latex converter],html_to_latex_command,html2latex)
218 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
219
220 SEARCH_PROG([for a MSWord -> Latex converter],word_to_latex_command,wvCleanLatex word2x)
221 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
222 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
223
224 SEARCH_PROG([for Image converter],image_command,convert)
225 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
226
227 # Search for a Postscript interpreter
228 SEARCH_PROG([for a Postscript interpreter],GS, gs)
229
230 # Search something to preview postscript
231 SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gv ghostview)
232
233 # Search for a program to preview pdf
234 SEARCH_PROG([for a PDF preview],PDF_VIEWER,acroread gv ghostview xpdf)
235
236 # Search something to preview dvi
237 SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi windvi yap)
238
239 # Search something to preview html
240 SEARCH_PROG([for a HTML previewer],HTML_VIEWER, netscape)
241
242 # Search for a program to convert ps to pdf
243 SEARCH_PROG([for a PS to PDF converter],ps_to_pdf_command,ps2pdf)
244 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
245
246 # Search for a program to convert dvi to ps
247 SEARCH_PROG([for a DVI to PS converter],dvi_to_ps_command,dvips)
248 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
249
250 # Search for a program to convert dvi to pdf
251 SEARCH_PROG([for a DVI to PDF converter],dvi_to_pdf_command,dvipdfm)
252 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
253
254 # Search a *roff program (used to translate tables in ASCII export)
255 SEARCH_PROG([for a *roff formatter],ROFF,groff nroff)
256 ascii_roff_command=$ROFF
257 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
258 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
259
260 # Search the ChkTeX program
261 SEARCH_PROG([for ChkTeX],CHKTEX,chktex)
262 chktex_command=$CHKTEX
263 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
264
265 # Search for a spellchecker
266 SEARCH_PROG([for a spell-checker], SPELL,ispell)
267
268 dnl # Search a Fax handling program
269 dnl SEARCH_PROG([for a fax driver], FAX, sendfax faxsend fax)
270 dnl if test $FAX = sendfax ; then
271 dnl   fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
272 dnl elif test $FAX = faxsend ; then
273 dnl   fax_command="faxsend '\$\$Phone' '\$\$FName'"
274 dnl elif test $FAX = fax ; then
275 dnl   fax_command="fax send '\$\$Phone' '\$\$FName'"
276 dnl else
277 dnl   fax_command="none"
278 dnl fi
279
280 # Search a GUI Fax program
281 SEARCH_PROG([for a fax program], fax_command, ksendfax)
282 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
283
284 # Search for LinuxDoc support
285 SEARCH_PROG([for SGML-tools 1.x (LinuxDoc)], LINUXDOC, sgml2lyx)
286 chk_linuxdoc=no
287 if test $LINUXDOC != none; then
288   chk_linuxdoc=yes
289   linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
290 fi
291
292 case $LINUXDOC in
293   sgml2lyx)
294     linuxdoc_to_latex_command="sgml2latex \$\$i"
295     linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
296     linuxdoc_to_html_command="sgml2html \$\$i"
297     linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
298   none)
299     linuxdoc_to_latex_command="none"
300     linuxdoc_to_dvi_command="none"
301     linuxdoc_to_html_command="none"
302     linuxdoc_to_lyx_command="none";;
303 esac
304
305 # Search for DocBook support
306 SEARCH_PROG([for SGML-tools 2.x (DocBook) or db2x scripts], DOCBOOK, sgmltools db2dvi)
307 chk_docbook=no
308 if test $DOCBOOK != none; then
309   chk_docbook=yes
310   docbook_cmd="\\def\\hasdocbook{yes}"
311 fi
312
313 case $DOCBOOK in
314   sgmltools)
315     docbook_to_dvi_command="sgmltools -b dvi \$\$i"
316     docbook_to_html_command="sgmltools -b html \$\$i";;
317   db2dvi)
318     docbook_to_dvi_command="db2dvi \$\$i"
319     docbook_to_html_command="db2html \$\$i";;
320   none)
321     docbook_to_dvi_command="none"
322     docbook_to_html_command="none";;
323 esac
324
325 # Search for a spool command
326 SEARCH_PROG([for a spool command], LPR, lp lpr)
327 case $LPR in
328   lp) print_spool_command=lp
329       print_spool_printerprefix="-d ";;
330  lpr) print_spool_command=lpr
331       print_spool_printerprefix="-P";;
332    *) :;; # leave to empty values
333 esac
334
335 SEARCH_PROG([for a LaTeX -> HTML converter], TOHTML, tth latex2html hevea)
336 latex_to_html_command=$TOHTML
337 case $TOHTML in
338         tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
339  latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
340       hevea) latex_to_html_command="hevea -s \$\$i";;
341 esac
342
343 #### Search for image conversion ####
344 SEARCH_PROG([for an Image -> EPS converter], TOEPS, convert pnmtops)
345 case $TOEPS in
346         convert) gif_to_eps="convert GIF:\$\$i EPS:\$\$o" png_to_eps="convert PNG:\$\$i EPS:\$\$o" jpg_to_eps="convert JPG:\$\$i EPS:\$\$o";;
347         pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
348 esac
349
350 SEARCH_PROG([for a Image -> PNG converter], TOPNG, convert pnmtopng)
351 case $TOPNG in
352         convert) gif_to_png="convert GIF:\$\$i PNG:\$\$o" eps_to_png="convert EPS:\$\$i PNG:\$\$o" jpg_to_png="convert JPG:\$\$i PNG:\$\$o";;
353         pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
354 esac
355
356 SEARCH_PROG([for a Image -> XPM converter], TOXPM, convert)
357 if test "$TOXPM" = "convert"; then
358         gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
359         eps_to_xpm="convert EPS:\$\$i XPM:\$\$o" 
360         jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
361         png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
362 fi
363
364 SEARCH_PROG([For an EPS -> PDF converter], EPSTOPDF, epstopdf)
365 case $EPSTOPDF in
366         epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
367 esac
368
369 #### Explore the LaTeX configuration
370 MSG_CHECKING(LaTeX configuration)
371 # First, remove the files that we want to re-create
372 rm -f textclass.lst packages.lst chkconfig.sed
373 if test ${lyx_check_config} = no ; then
374   MSG_RESULT(default values)
375 else
376   MSG_RESULT(auto)
377   rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
378   cat >wrap_chkconfig.ltx <<EOF
379 \\newcommand\\srcdir{${srcdir}}
380 ${linuxdoc_cmd}
381 ${docbook_cmd}
382 \\input{${srcdir}/chkconfig.ltx}
383 EOF
384   ## Construct the list of classes to test for.
385   # build the list of available layout files and convert it to commands 
386   # for chkconfig.ltx 
387   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do 
388     case $file in
389       */\*.layout) ;;
390       *) test -r "$file" && echo $file ;;
391     esac
392   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
393              > chklayouts.tex
394 changequote([,])dnl
395   [eval] ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
396   [eval] `cat chkconfig.vars | sed 's/-/_/g'`
397 changequote(,)dnl
398 fi
399
400 # Do we have all the files we need? Useful if latex did not run
401 changequote([,])dnl
402 echo creating textclass.lst 
403 PROVIDE_DEFAULT_FILE(textclass.lst,dnl
404 [# This file declares layouts and their associated definition files
405 # (include dir. relative to the place where this file is).
406 # It contains only default values, since chkconfig.ltx could not be run 
407 # for some reason. Run ./configure if you need to update it after a
408 # configuration change.  
409 article article article
410 report  report  report
411 book    book    book
412 linuxdoc        linuxdoc        linuxdoc
413 letter  letter  letter])
414
415 PROVIDE_DEFAULT_FILE(chkconfig.sed,[s/@.*@/???/g])
416
417 echo creating packages.lst
418 PROVIDE_DEFAULT_FILE(packages.lst,dnl
419 [# This file should contain the list of LaTeX packages that have been
420 # recognized by LyX. Unfortunately, since configure could not find
421 # your LaTeX2e program, the tests have not been run. Run ./configure
422 # if you need to update it after a configuration change.
423 ])
424 changequote(,)dnl
425
426 echo creating doc/LaTeXConfig.lyx
427 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
428 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
429 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
430
431 echo creating lyxrc.defaults
432 rm -f lyxrc.defaults
433 cat >lyxrc.defaults <<EOF
434 # This file has been automatically generated by LyX' lib/configure
435 # script. It contains default settings that have been determined by
436 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
437 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
438 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
439 # override the values given here.
440 \\Format text     txt   ASCII           A
441 \\Format textparagraph txt ASCII(paragraphs)    ""
442 \\Format docbook  sgml  DocBook         B
443 \\Format dvi      dvi   DVI             D
444 \\Format eps      eps   EPS             ""
445 \\Format epsi     epsi  EPSI    ""
446 \\Format fax      ""    Fax             ""
447 \\Format gif      gif   GIF             ""
448 \\Format html     html  HTML            H
449 \\Format jpg      jpg   JPEG            ""
450 \\Format latex    tex   LaTeX           L
451 \\Format linuxdoc sgml  LinuxDoc        x
452 \\Format lyx      lyx   LyX             ""
453 \\Format literate nw    NoWeb           N
454 \\Format pdf      pdf   PDF             P
455 \\Format pdf2     pdf  "PDF (pdflatex)" F
456 \\Format pdf3     pdf  "PDF (dvipdfm)"  m
457 \\Format png      png   PNG             ""
458 \\Format ps       ps    Postscript      t
459 \\Format program  ""    Program         ""
460 \\Format xpm      xpm   XPM             ""
461 \\Format word     doc   Word            W
462
463 \\converter latex dvi "$latex_to_dvi" "latex"
464 \\converter latex pdf2 "$latex_to_pdf" "latex"
465 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
466 \\converter literate latex "$literate_to_tex_command" ""
467 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
468 \\converter dvi ps "$dvi_to_ps_command" ""
469 \\converter ps pdf "$ps_to_pdf_command" ""
470 \\converter ps fax "$fax_command" ""
471 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
472 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
473 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
474 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
475 \\converter docbook dvi "$docbook_to_dvi_command" ""
476 \\converter docbook html "$docbook_to_html_command" ""
477
478 \\converter latex lyx "$tex_to_lyx_command" ""
479 \\converter literate lyx "$literate_to_lyx_command" ""
480 \\converter html latex "$html_to_latex_command" ""
481 \\converter word latex "$word_to_latex_command" ""
482
483 \\converter gif  eps "$gif_to_eps" ""
484 \\converter png  eps "$png_to_eps" ""
485 \\converter jpg  eps "$jpg_to_eps" ""
486
487 \\converter gif  png "$gif_to_png" ""
488 \\converter eps  png "$eps_to_png" ""
489 \\converter epsi png "$eps_to_png" ""
490 \\converter jpg  png "$jpg_to_png" ""
491
492 \\converter gif  xpm "$gif_to_xpm" ""
493 \\converter eps  xpm "$eps_to_xpm" ""
494 \\converter epsi xpm "$eps_to_xpm" ""
495 \\converter jpg  xpm "$jpg_to_xpm" ""
496 \\converter png  xpm "$png_to_xpm" ""
497  
498 \\converter eps  pdf "$eps_to_pdf" ""
499 \\converter epsi pdf "$eps_to_pdf" ""
500
501 \\viewer dvi "$DVI_VIEWER"
502 \\viewer html "$HTML_VIEWER"
503 \\viewer pdf "$PDF_VIEWER"
504 \\viewer ps "$GHOSTVIEW -swap"
505 \\viewer eps "$GHOSTVIEW"
506
507 \\ps_command "$GS"
508 \\ascii_roff_command "$ascii_roff_command"
509 \\chktex_command "$chktex_command"
510 \\spell_command "$SPELL"
511 dnl \\fax_command "$fax_command"
512 \\print_spool_command "$print_spool_command"
513 \\print_spool_printerprefix "$print_spool_printerprefix"
514 \\font_encoding "$chk_fontenc"
515 EOF
516
517 # Remove superfluous files if we are not writing in the main lib
518 # directory 
519 for file in lyxrc.defaults textclass.lst packages.lst \
520             doc/LaTeXConfig.lyx ; do
521   # we rename the file first, so that we avoid comparing a file with itself
522   mv $file $file.new
523   if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ; 
524   then 
525     echo "removing $file, which is identical to the system global version"
526     rm -f $file.new
527   else
528     mv $file.new $file
529   fi
530 done
531
532
533 # Final clean-up
534 if test $lyx_keep_temps = no ; then
535 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \
536       missfont.log
537 fi