X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure.py;h=210aad99b74ded4c40c79db60b90885ef4578bfe;hb=246baa610eecba28100fdc4f9363e38bc3735cbf;hp=38310e3a5d1636167040c59c17191236af3a5266;hpb=727a421a1f0cdc3d899b8f533bc2bcff352755c4;p=lyx.git diff --git a/lib/configure.py b/lib/configure.py index 38310e3a5d..210aad99b7 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -158,17 +158,19 @@ def checkProg(description, progs, rc_entry = [], path = [], not_found = ''): ac_word = ac_prog.split(' ')[0] print '+checking for "' + ac_word + '"... ', path = os.environ["PATH"].split(os.pathsep) + path + extlist = [''] + if os.environ.has_key("PATHEXT"): + extlist = extlist + os.environ["PATHEXT"].split(os.pathsep) for ac_dir in path: - # check both ac_word and ac_word.exe (for windows system) - if os.path.isfile( os.path.join(ac_dir, ac_word) ) or \ - os.path.isfile( os.path.join(ac_dir, ac_word + ".exe") ): - print ' yes' - # write rc entries for this command - if len(rc_entry) == 1: - addToRC(rc_entry[0].replace('%%', ac_prog)) - elif len(rc_entry) > 1: - addToRC(rc_entry[idx].replace('%%', ac_prog)) - return [ac_dir, ac_word] + for ext in extlist: + if os.path.isfile( os.path.join(ac_dir, ac_word + ext) ): + print ' yes' + # write rc entries for this command + if len(rc_entry) == 1: + addToRC(rc_entry[0].replace('%%', ac_prog)) + elif len(rc_entry) > 1: + addToRC(rc_entry[idx].replace('%%', ac_prog)) + return [ac_dir, ac_word] # if not successful print ' no' # write rc entries for 'not found' @@ -202,7 +204,7 @@ def checkLatex(dtl_tools): \converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' else: converter_entry = r'\converter latex dvi "%%" "latex"' - path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'latex $$i', 'latex2e $$i'], + path, LATEX = checkProg('a Latex2e program', ['pplatex $$i', 'platex $$i', 'latex $$i', 'latex2e $$i'], rc_entry = [converter_entry]) # no latex if LATEX != '':