- if test "$ac_env_CPPFLAGS_set" != set; then
- if test x$enable_warnings = xyes ; then
- case $gxx_version in
- 3.1*|3.2*|3.3*)
- CPPFLAGS="-W -Wall $CPPFLAGS"
- ;;
- *)
- CPPFLAGS="-Wextra -Wall $CPPFLAGS "
- ;;
- esac
- fi
+
+ AM_CXXFLAGS="$lyx_optim"
+ if test x$enable_debug = xyes ; then
+ AM_CXXFLAGS="-g $AM_CXXFLAGS"
+ fi
+ if test $build_type = gprof ; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -pg"
+ AM_LDFLAGS="$AM_LDFLAGS -pg"
+ fi
+ if test $build_type = profiling ; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -fno-omit-frame-pointer"
+ fi
+
+ if test x$USE_QT5 = xyes ; then
+ AS_CASE([$host], [*mingw*|*cygwin*], [], [AM_CXXFLAGS="-fPIC $AM_CXXFLAGS"])
+ fi
+ dnl Warnings are for preprocessor too
+ if test x$enable_warnings = xyes ; then
+ case $gxx_version in
+ 3.1*|3.2*|3.3*)
+ AM_CPPFLAGS="$AM_CPPFLAGS -Wall -W"
+ ;;
+ 3.4*|4.0*|4.1*|4.2*|4.3*|4.4*|4.5*|4.6*|4.7*|4.8*|clang)
+ AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra"
+ ;;
+ *)
+ AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra -Wfloat-conversion"
+ ;;
+ esac