better fix to #7239. Actually the whole switch and kaboodle (see r37229) is needed (otherwise sweave is broken)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37322 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2011-01-25 11:22:47 +00:00
parent 297a74b7ad
commit 3b316bc83f
3 changed files with 57 additions and 45 deletions

View File

@ -103,20 +103,21 @@ to create the Makefile by typing
./configure ./configure
For more complicated cases, LyX configure takes the following specific For more complicated cases, LyX configure honors the following specific
flags: flags:
o --enable-build-type=[rel(ease), dev(elopment), pre(release)] o --enable-build-type=[rel(ease), dev(elopment), pre(release)]
allows to tweak the compiled code. The following table describes allows to tweak the compiled code. The following table describes
the settings in terms of various options that are described later the settings in terms of various options that are described later
release prerelease development release prerelease development gprof
optimization -O2 -O2 -O optimization -O2 -O2 -O -O2
assertions X X assertions X X
stdlib-debug X stdlib-debug X
concept-checks X X concept-checks X X
warnings X X warnings X X
debug X X debug X X X
gprof X
The default are as follows in terms of version number The default are as follows in terms of version number
release: stable release (1.x.y) release: stable release (1.x.y)

View File

@ -19,6 +19,8 @@ AC_ARG_ENABLE(build-type,
build_type=development;; build_type=development;;
pre*) lyx_prerelease=yes pre*) lyx_prerelease=yes
build_type=prerelease;; build_type=prerelease;;
gp*) lyx_profiling=yes
build_type=gprof;;
rel*) ;; rel*) ;;
*) AC_ERROR([Bad build type specification \"$enableval\". Please use one of dev(elopment), rel(ease) or pre(release)]);; *) AC_ERROR([Bad build type specification \"$enableval\". Please use one of dev(elopment), rel(ease) or pre(release)]);;
esac], esac],
@ -188,7 +190,7 @@ fi
### We might want to disable debug ### We might want to disable debug
AC_ARG_ENABLE(debug, AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[enable debug information]),, AC_HELP_STRING([--enable-debug],[enable debug information]),,
[ if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes -o $lyx_profiling = yes ; then
enable_debug=yes; enable_debug=yes;
else else
enable_debug=no; enable_debug=no;
@ -212,7 +214,11 @@ AC_ARG_ENABLE(concept-checks,
AC_ARG_ENABLE(gprof, AC_ARG_ENABLE(gprof,
AC_HELP_STRING([--enable-gprof],[enable profiling using gprof]),, AC_HELP_STRING([--enable-gprof],[enable profiling using gprof]),,
enable_gprof=no;) [if test $build_type = gprof ; then
enable_gprof=yes;
else
enable_gprof=no;
fi;])
### set up optimization ### set up optimization
AC_ARG_ENABLE(optimization, AC_ARG_ENABLE(optimization,

View File

@ -380,6 +380,40 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
return lines; return lines;
} }
namespace {
// output the proper paragraph start according to latextype.
void parStartCommand(Paragraph const & par, odocstream & os, TexRow & texrow,
OutputParams const & runparams,Layout const & style)
{
switch (style.latextype) {
case LATEX_COMMAND:
os << '\\' << from_ascii(style.latexname());
// Separate handling of optional argument inset.
if (style.optargs != 0 || style.reqargs != 0) {
int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
while (ret > 0) {
texrow.newline();
--ret;
}
}
else
os << from_ascii(style.latexparam());
break;
case LATEX_ITEM_ENVIRONMENT:
case LATEX_LIST_ENVIRONMENT:
os << "\\item ";
break;
case LATEX_BIB_ENVIRONMENT:
// ignore this, the inset will write itself
break;
default:
break;
}
}
} // namespace anon
// FIXME: this should be anonymous // FIXME: this should be anonymous
void TeXOnePar(Buffer const & buf, void TeXOnePar(Buffer const & buf,
@ -444,23 +478,18 @@ void TeXOnePar(Buffer const & buf,
if (style.pass_thru) { if (style.pass_thru) {
Font const outerfont = text.outerFont(pit); Font const outerfont = text.outerFont(pit);
// can we have pass_thru for lists? if so, we need to do the whole parStartCommand(par, os, texrow,runparams, style);
// switch and kaboodle here.
os << '\\' << from_ascii(style.latexname());
// Separate handling of optional argument inset.
if (style.optargs != 0 || style.reqargs != 0) {
int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
while (ret > 0) {
texrow.newline();
--ret;
}
}
else
os << from_ascii(style.latexparam());
par.latex(bparams, outerfont, os, texrow, runparams, start_pos, par.latex(bparams, outerfont, os, texrow, runparams, start_pos,
end_pos); end_pos);
// I did not create a parEndCommand for this minuscule
// task because in the other user of parStartCommand
// the code is different (JMarc)
if (style.isCommand())
os << from_ascii("}\n"); os << from_ascii("}\n");
else
os << from_ascii("\n");
texrow.newline(); texrow.newline();
if (!style.parbreak_is_newline) { if (!style.parbreak_is_newline) {
os << '\n'; os << '\n';
@ -687,31 +716,7 @@ void TeXOnePar(Buffer const & buf,
} }
} }
switch (style.latextype) { parStartCommand(par, os, texrow,runparams, style);
case LATEX_COMMAND:
os << '\\' << from_ascii(style.latexname());
// Separate handling of optional argument inset.
if (style.optargs != 0 || style.reqargs != 0) {
int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
while (ret > 0) {
texrow.newline();
--ret;
}
}
else
os << from_ascii(style.latexparam());
break;
case LATEX_ITEM_ENVIRONMENT:
case LATEX_LIST_ENVIRONMENT:
os << "\\item ";
break;
case LATEX_BIB_ENVIRONMENT:
// ignore this, the inset will write itself
break;
default:
break;
}
Font const outerfont = text.outerFont(pit); Font const outerfont = text.outerFont(pit);