From 11c11ed88bea41c6b86898937d006f74b61ba3bb Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 25 Jul 2001 15:05:10 +0000 Subject: [PATCH] --enable-optimization configure option git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2340 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 9 +++++ INSTALL | 11 +++++- config/ChangeLog | 9 +++++ config/lyxinclude.m4 | 32 ++++++++-------- configure.in | 39 ++++++++++--------- lib/configure | 91 +++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 150 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d8015ccf8..4a99643814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-07-25 Jean-Marc Lasgouttes + + * configure.in: move --enable-assertions a bit higher. + move the setup of libtool a bit later. + +2001-07-23 John Levon + + * INSTALL: document --disable-optimization + 2001-07-25 Lars Gullik Bjønnes * Makefile.am (EXTRA_DIST): add sourcedoc diff --git a/INSTALL b/INSTALL index 99ceeb3693..6662268ec2 100644 --- a/INSTALL +++ b/INSTALL @@ -133,6 +133,13 @@ flags: You can use this feature to install more than one version of LyX on the same system. You can optionally specify a "version" of your own, by doing something like : ./configure --with-version-suffix=-latestcvs + + o --enable-optimization=VALUE enables you to set optimization to a + higher level as the default (-O), for example --enable-optimization=-O3. + + o --disable-optimization - you can use this to disable compiler + optimization of LyX. The compile may be much quicker with some + compilers, but LyX will run more slowly. There are also flags to control the internationalization support in LyX: @@ -190,8 +197,8 @@ this file. In particular, the following options could be useful in some desperate cases: - o --with-warnings that make the compiler output more warnings during - the compilation of LyX. Opposite is --without-warnings. By default, + o --enable-warnings that make the compiler output more warnings during + the compilation of LyX. Opposite is --disable-warnings. By default, this flag is on for development versions only. o --enable-assertions that make the compilier generater run-time diff --git a/config/ChangeLog b/config/ChangeLog index 5a36f4ca15..3785173ed7 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,12 @@ +2001-07-25 Jean-Marc Lasgouttes + + * lyxinclude.m4 (LYX_PROG_CXX): do not handle gcc 2.97. Rename + --with-warnings to --enable-warnings. + +2001-07-23 John Levon + + * lyxinclude.m4: honour --disable-optimization + 2001-07-18 Jean-Marc Lasgouttes * lyxinclude.m4 (LYX_PATH_XFORMS): do not warn against xforms diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 68bd87704c..ff112e7e8f 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -176,27 +176,30 @@ AC_MSG_RESULT($cross_compiling) AC_PROG_CXX_GNU -dnl We might want to get or shut warnings. -AC_ARG_WITH(warnings, - [ --with-warnings tell the compiler to display more warnings],, +### We might want to get or shut warnings. +AC_ARG_ENABLE(warnings, + [ --enable-warnings tell the compiler to display more warnings],, [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes && test $ac_cv_prog_gxx = yes ; then - with_warnings=yes; + enable_warnings=yes; else - with_warnings=no; + enable_warnings=no; fi;]) -if test x$with_warnings = xyes ; then +if test x$enable_warnings = xyes ; then lyx_flags="$lyx_flags warnings" AC_DEFINE(WITH_WARNINGS, 1, [Define this if you want to see the warning directives put here and there by the developpers to get attention]) fi -# optimize less for development versions -if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then - lyx_opt="-O" -else - lyx_opt="-O2" -fi +### set up optimization +AC_ARG_ENABLE(optimization, + [ --enable-optimization[=value] enable compiler optimisation],, + enable_optimization=yes;) +case $enable_optimization in + yes) lyx_opt=-O;; + no) lyx_opt=;; + *) lyx_opt=${enable_optimization};; +esac # set the debug flags correctly. if test $ac_cv_prog_gxx = yes; then @@ -226,18 +229,17 @@ dnl Check the version of g++ else CXXFLAGS="$lyx_opt" fi - if test x$with_warnings = xyes ; then + if test x$enable_warnings = xyes ; then case $gxx_version in 2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall";; 2.96*) CXXFLAGS="$CXXFLAGS -W -Wall";; - 2.97*) CXXFLAGS="$CXXFLAGS -W -Wall";; *) CXXFLAGS="$CXXFLAGS -W -Wall";; esac if test $lyx_devel_version = yes ; then case $gxx_version in 2.95.*) ;; 2.96*) ;; - 2.97*) CXXFLAGS="$CXXFLAGS -Wconversion -Winline";; + 2.97*) ;; *2.91*) ;; *) ;; esac diff --git a/configure.in b/configure.in index f0843f7aa5..14a13021c9 100644 --- a/configure.in +++ b/configure.in @@ -74,11 +74,6 @@ esac AC_LANG_CPLUSPLUS LYX_PROG_CXX AC_PROG_CXXCPP -AC_DISABLE_SHARED -AC_LIBTOOL_WIN32_DLL -#AM_PROG_LIBTOOL -LYX_PROG_LIBTOOL - ### Some checks on what the C++ compiler can(not) do dnl we do not need that currently (and probably all our supported dnl compiler allow that) @@ -94,6 +89,20 @@ dnl LYX_CXX_RTTI AC_CHECK_HEADERS(ostream istream sstream locale limits) LYX_CXX_STL_MODERN_STREAMS +### and now some special lyx flags. +AC_ARG_ENABLE(assertions, + [ --enable-assertions add runtime sanity checks in the program],, + [if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then + enable_assertions=yes; + else + enable_assertions=no; + fi;]) +if test "x$enable_assertions" = xyes ; then + lyx_flags="$lyx_flags assertions" + AC_DEFINE(ENABLE_ASSERTIONS,1, + [Define if you want assertions to be enabled in the code]) +fi + ### We need a regex implementation, so we provide our own if none is found. LYX_REGEX @@ -129,6 +138,12 @@ if test x$lyx_use_liberty = xyes; then AC_CHECK_LIB(iberty,main) fi +### Setup libtool +AC_DISABLE_SHARED +AC_LIBTOOL_WIN32_DLL +#AM_PROG_LIBTOOL +LYX_PROG_LIBTOOL + ### Check which libsigc++ we're using LYX_WITH_SIGC @@ -279,20 +294,6 @@ AC_REPLACE_FUNCS(strerror atexit) LYX_CHECK_DECL_HDRS(mkstemp,[unistd.h stdlib.h]) -### and now some special lyx flags. -AC_ARG_ENABLE(assertions, - [ --enable-assertions add runtime sanity checks in the program],, - [if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then - enable_assertions=yes; - else - enable_assertions=no; - fi;]) -if test "x$enable_assertions" = xyes ; then - lyx_flags="$lyx_flags assertions" - AC_DEFINE(ENABLE_ASSERTIONS,1, - [Define if you want assertions to be enabled in the code]) -fi - ### Finish the work. AC_CONFIG_SUBDIRS(sigc++ lib lib/reLyX) AC_OUTPUT([Makefile \ diff --git a/lib/configure b/lib/configure index 3361f42776..3ec21e1575 100755 --- a/lib/configure +++ b/lib/configure @@ -1051,6 +1051,85 @@ case $TOHTML in hevea) latex_to_html_command="hevea -s \$\$i";; esac +#### Search for image conversion #### +echo $ac_n "checking for an Image -> EPS converter""... $ac_c" +echo "$ac_t""(convert pnmtops)" +TOEPS= +for ac_prog in convert pnmtops +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog ; ac_word=$2 +if test -n "$ac_word"; then + echo $ac_n "+checking for \"$ac_word\"""... $ac_c" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -x $ac_dir/$ac_word; then + TOEPS="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" + + if test -n "$TOEPS"; then + ac_result=yes + else + ac_result=no + fi + + echo "$ac_t""$ac_result" + test -n "$TOEPS" && break +fi +done + +if test -z "$TOEPS" ; then + TOEPS=none +fi + +case $TOEPS in + 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";; + pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";; +esac + +echo $ac_n "checking for a GIF -> PNG converter""... $ac_c" +echo "$ac_t""(convert pnmtopng)" +TOPNG= +for ac_prog in convert pnmtopng +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog ; ac_word=$2 +if test -n "$ac_word"; then + echo $ac_n "+checking for \"$ac_word\"""... $ac_c" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -x $ac_dir/$ac_word; then + TOPNG="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" + + if test -n "$TOPNG"; then + ac_result=yes + else + ac_result=no + fi + + echo "$ac_t""$ac_result" + test -n "$TOPNG" && break +fi +done + +if test -z "$TOPNG" ; then + TOPNG=none +fi + +case $TOPNG in + 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";; + pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";; +esac + #### Explore the LaTeX configuration echo $ac_n "checking LaTeX configuration""... $ac_c" # First, remove the files that we want to re-create @@ -1155,7 +1234,6 @@ cat >lyxrc.defaults <lyxrc.defaults <