Enrico Forestieri a écrit :
On Sat, Apr 15, 2006 at 02:33:39PM +0200, Abdelrazak Younes wrote:

Enrico Forestieri a écrit :
On Fri, Apr 14, 2006 at 06:02:25PM +0200, Abdelrazak Younes wrote:
[...]
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 :(
I am not sure I understand, you say in the first paragraph it kicks in if you pass --with-packaging=windows and that we must specify CC and CXX manually in the second. Please clarify.

I mean that you know that you should use -mno-cygwin only after
ascertaining that you want windows packaging. Until this point,
the configure script has already performed many checks using
the cygwin compiler and thus it has made many wrong choices.
I cannot even have the Qt library recognized because the previous
choices bring in options that make the check for it fail.

So, this is not the way to go and instead you have to specify
the CC, CXX, CPP, CXXCPP variables when invoking configure,
such that the right compiler is used from the beginning.

It's weird because it works here. I mean I see the -mno-cygwin. But I don't know if it comes from the new cygwin.m4 or the --windows-packaging. The difference here is that cygwin gcc is not installed on my system so all the tests are done with mngw gcc (which doesn't mind the -mno-cygwin option apparently).

# 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"
If this is not working, then we should delete the above. If we can add the option when --with-packaging=windows is passed _and_ platform is cygwin then that's the way to go.

          CPPFLAGS="${CPPFLAGS} -IC:/MinGW/include"
          LDFLAGS="${LDFLAGS} -LC:/MinGW/lib"
We should maybe inverse the order in order to make sure that the mingw headers and libs are used first:

            CPPFLAGS="$-IC:/MinGW/include {CPPFLAGS}"
            LDFLAGS="-LC:/MinGW/lib ${LDFLAGS}"

This works fine in my system also. But the path is hardcoded :-(


Thanks a lot Enrico, I'll try this and commit if it works.

I am sorry, it doesn't work. The only thing which works is
automatically adding -DQ_CYGWIN_WIN to CPPFLAGS when it is
needed. Working cygwin.m4 attached.

OK, I will commit that.

Anyway, I don't think that it is a so great pain having to specify
some variables on the configure command line. You can setup a script
for that if you don't want type them everytime.

It's not about me Enrico, it's about the casual tester. But I agree it's not a big deal.

Thanks,
Abdel.

Reply via email to