mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
2006-05-18 Enrico Forestieri <forenr@tlc.unipr.it>
* configure.py: fix setting of \cygwin_path_fix_needed; remove extra \r at end of line for cygwin. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13861 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
995da7bafc
commit
c8410c3e0a
@ -80,6 +80,7 @@ def createDirectories():
|
||||
|
||||
def checkCygwinPath(srcdir):
|
||||
''' Adjust PATH for Win32 (Cygwin) '''
|
||||
cygwin_path_fix = ''
|
||||
if sys.platform == 'cygwin':
|
||||
from tempfile import mkstemp
|
||||
fd, tmpfname = mkstemp(suffix='.ltx', dir='/tmp')
|
||||
@ -96,15 +97,17 @@ def checkCygwinPath(srcdir):
|
||||
os.close(wfd)
|
||||
if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
|
||||
print "configure: cygwin detected; path correction is not needed"
|
||||
cygwin_path_fix = 'false'
|
||||
else:
|
||||
print "configure: cygwin detected; path correction"
|
||||
srcdir = cmdOutput('cygpath -m ' + srcdir)
|
||||
print "srcdir = ", srcdir
|
||||
addToRC(r'\cygwin_path_fix_needed true')
|
||||
cygwin_path_fix = 'true'
|
||||
tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
|
||||
wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
|
||||
removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
|
||||
tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
|
||||
return cygwin_path_fix
|
||||
|
||||
|
||||
## Searching some useful programs
|
||||
@ -544,7 +547,8 @@ def checkLatexConfig(check_config, bool_docbook, bool_linuxdoc):
|
||||
values = {}
|
||||
for line in open('chkconfig.vars').readlines():
|
||||
key, val = re.sub('-', '_', line).split('=')
|
||||
values[key] = val.strip("'\n")
|
||||
val = val.strip()
|
||||
values[key] = val.strip("'")
|
||||
# chk_fontenc may not exist
|
||||
try:
|
||||
addToRC(r'\font_encoding "%s"' % values["chk_fontenc"])
|
||||
@ -671,7 +675,7 @@ Options:
|
||||
sys.exit(1)
|
||||
setEnviron()
|
||||
createDirectories()
|
||||
checkCygwinPath(srcdir)
|
||||
cygwin_path_fix = checkCygwinPath(srcdir)
|
||||
## Write the first part of outfile
|
||||
writeToFile(outfile, '''# This file has been automatically generated by LyX' lib/configure.py
|
||||
# script. It contains default settings that have been determined by
|
||||
@ -688,6 +692,8 @@ Options:
|
||||
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
|
||||
checkTeXAllowSpaces()
|
||||
checkOtherEntries()
|
||||
if cygwin_path_fix != '':
|
||||
addToRC(r'\cygwin_path_fix_needed %s' % cygwin_path_fix)
|
||||
# --without-latex-config can disable lyx_check_config
|
||||
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook, bool_linuxdoc)
|
||||
createLaTeXConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user