On Tue, Jan 27, 2015 at 07:24:28PM +0100, Jean-Marc Lasgouttes wrote: > Le 24/01/2015 00:41, Enrico Forestieri a écrit : > >I just discovered that now also the --with-extra-prefix option is broken. > >The inc and lib dirs are now assigned to AM_CPPFLAGS rather than CPPFLAGS > >and configure fails to find include files that are not in the regular > >search path. > > Grmpf. So I have to modify the normal variables after all. But how > are users supposed to override CPPFLAGS at make time? Do you know > whether there is a set of rules to separate AM_xxx from plain xxx?
I think the attached is the correct patch for the following two reasons. 1) Otherwise configure fails to find headers. 2) The only alternative would be directly using CPPFLAGS. Look, I have aspell installed in /c/MinGW and configure LyX using the --with-extra-prefix=/c/MinGW option, because that path is not in the cross-compiler headers search path: $ `i686-w64-mingw32-g++ -print-prog-name=cc1plus` -v #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i686-w64-mingw32/4.8.3/include/c++ /usr/lib/gcc/i686-w64-mingw32/4.8.3/include/c++/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/4.8.3/include/c++/backward /usr/lib/gcc/i686-w64-mingw32/4.8.3/include /usr/lib/gcc/i686-w64-mingw32/4.8.3/include-fixed /usr/i686-w64-mingw32/sys-root/mingw/include End of search list. But: $ ./configure --with-extra-prefix=/c/MinGW <other options here> ... checking for extra lib+include directory... /c/MinGW (good) ... checking aspell.h usability... no checking aspell.h presence... no checking for aspell.h... no checking for new_aspell_config in -laspell... yes checking whether to use aspell... no ... What? The aspell.h header is there: $ ls /c/MinGW/include/aspell.h /c/MinGW/include/aspell.h but configure is not enabling aspell, even if it later concludes: ... C++ Compiler flags: -I/c/MinGW/include -O2 ... With the attached patch, everything is fine and the final configuration summary is identical to what I obtain when using CPPFLAGS=-I/c/MinGW/include. -- Enrico
diff --git a/configure.ac b/configure.ac index 8b48eaf..5f5d562 100644 --- a/configure.ac +++ b/configure.ac @@ -92,12 +92,12 @@ test ! x"$lyx_ldflags" = x && LDFLAGS="$lyx_ldflags $LDFLAGS" ### Add extra directories to check for include files. LYX_WITH_DIR([extra-inc],[extra include directory],extra_inc, NONE) LYX_LOOP_DIR($lyx_cv_extra_inc,LYX_ADD_INC_DIR(lyx_cppflags,$dir)) -test ! x"$lyx_cppflags" = x && AM_CPPFLAGS="$lyx_cppflags $AM_CPPFLAGS" +test ! x"$lyx_cppflags" = x && CPPFLAGS="$lyx_cppflags $CPPFLAGS" ### Add both includes and libraries LYX_WITH_DIR([extra-prefix],[extra lib+include directory],extra_prefix, NONE, ${prefix}) LYX_LOOP_DIR($lyx_cv_extra_prefix,[ - LYX_ADD_INC_DIR(AM_CPPFLAGS,$dir/include) + LYX_ADD_INC_DIR(CPPFLAGS,$dir/include) LYX_ADD_LIB_DIR(LDFLAGS,$dir/lib) ])