On Fri, Apr 14, 2006 at 06:02:25PM +0200, Abdelrazak Younes wrote: > Enrico Forestieri a écrit : > > On Fri, Apr 14, 2006 at 05:07:47PM +0200, Abdelrazak Younes wrote: > >>> I am no m4 expert, but could see what I can do. Anyway, this is not > >>> strictly necessary as that define can be set through CPPFLAGS. > >> I would prefer something that is ready to compile out of the box so > >> let's try to improve the wannabe windows developer ;-) > >> I am checking in my change right now and we work from there. > > > > Ok, I'll have a look at it, then. > > Great! > > [...] > > Actually, it is quite simple. You should set CC, CPP, CXX, and CXXPP > > when invoking configure, like this: > > > > cd build > > ../configure CC='gcc -mno-cygwin' CPP='gcc -mno-cygwin -E' \ > > CXX='g++ -mno-cygwin' CXXCPP='g++ -mno-cygwin -E' ... > > Are the CPP and CXXCPP used in the build process? What does the '-E' option? > > At autogen.sh time, we have to configure between for two potential > platforms: > - CYGWIN > - MSYS > > At configure time, we have four different platforms: > - CYGWIN-cygwin-X11 > -> no special flags > - CYGWIN-cygwin-WIN32 > -> -DQ_CYGWIN_WIN for compilation > - CYGWIN-mingw > -> -mno-cygwin for compilation (and linking?) > -> maybe -L<mingw directory>/lib for linking? > > - MSYS-mingw > -> Nothing that I remember for now. > > I am not sure anymore we need cygwin.m4 for what we want to do... But > then I know nothing about autoconf :-(
Abdel, I have come up with the attached cygwin.m4, but I am sorry to say that the -mno-cygwin thing doesn't work when done this way. Notice that it kicks in when --with-packaging=windows is specified, as this should be done when using cygwin, otherwise posix would be used. The point is that -mno-cygwin cannot be seen as flag buth rather "gcc -mno-cygwin" and "g++ -mno-cygwin" should be considered as the compilers. So, only when specifying CC='gcc -mno-cygwin' and CXX='g++ -mno-cygwin' as parameters to configure it works :( -- Enrico
# Macro added for some Cygwin-specific support -*- sh -*- # @author@: Kayvan Sylvan AC_DEFUN([CHECK_WITH_CYGWIN], [ case $host_os in cygwin* ) for frontend in $FRONTENDS ; do case "$frontend" in qt* ) if test "$lyx_use_packaging" = "windows"; then CFLAGS="-mno-cygwin $CFLAGS" CXXFLAGS="-mno-cygwin $CXXFLAGS" CPPFLAGS="${CPPFLAGS} -IC:/MinGW/include" LDFLAGS="${LDFLAGS} -LC:/MinGW/lib" else AC_MSG_CHECKING([window system for Qt]) if test "x$with_x" = xno; then CPPFLAGS="${CPPFLAGS} -DQ_CYGWIN_WIN" AC_MSG_RESULT([Windows]) else AC_MSG_RESULT([X11]) fi fi ;; esac done ;; esac ])