Bug in build system (solved by a temporary hack)

12 views
Skip to first unread message

Tom

unread,
Feb 9, 2012, 12:46:54 AM2/9/12
to zero...@googlegroups.com
Just downloaded current release and have had problems building. The culprit seems to be that I have g++ 4.4.5 (current on Ubuntu 10.10) and two headers (one I believe is auto-generated from the other) think that a g++ major of 4 has lambda support which is not true. That only happened with g++ 4.5 (a minor of 5).

The two offending files are:
./zdk/make/Common.mak
./zdk/make/Common.mak.in # <== I think this is the master file

The offending code block is:

ifeq ($(CXX_MAJOR),4)
CXXFLAGS+=-Wno-attributes
CXXFLAGS+=-std=c++0x
CXXFLAGS+=-DHAVE_LAMBDA_SUPPORT # <= I just commented out this line
endif

I think there is a way to get make to create a var that could be tested to be true if gcc is 4.5 or greater, but I leave that as an exercise for masochists. (I would just use Perl and auto-generate the offending master file.)

The build and installation thereafter went fine. So now I'm experimenting.

Thanks again for a great product, Cristian--it's sorely needed (I occasionally try gdb raw or ddd but give up in frustration soon thereafter).

Best regards,

-Tom

Tom Browder
Niceville, Florida
USA

C. Vlasceanu

unread,
Feb 9, 2012, 2:39:45 AM2/9/12
to zero...@googlegroups.com
Tom

I am sorry about the bug. I will be fixed in the next commit. I developed this autoconf.ac function that now properly detects lambda support (rather than using the compiler version, which was a silly hack to begin with):

    # Check for C++12 lambda support in the compiler
    AC_DEFUN([AC_CXX_LAMBDA],
        [AC_CACHE_CHECK([for C++11 Lambda compiler support],
                   [ac_cv_lambda],
                   [ac_cv_lambda=false
    cat > tmp.cpp << ---end---

    int main()
    {   
        return [[]]()->int { return 0; }();
    }   
    ---end---
        if $CXX -std=c++0x tmp.cpp 2>/dev/null; then 
            ac_cv_lambda=true
            rm a.out
        fi  
        rm tmp.cpp])

        if test "$ac_cv_lambda" = true; then
            AC_DEFINE([HAVE_LAMBDA_SUPPORT], [1],
                    [Define if C++11 lambda functions are supported])
        fi  
    ])  

    AC_CXX_LAMBDA


Thanks for using ZeroBUGS and keep the feedback coming!

Cristian



--
You received this message because you are subscribed to the Google Groups "zerobugs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/zerobugs/-/ATsYuhhSiycJ.
To post to this group, send email to zero...@googlegroups.com.
To unsubscribe from this group, send email to zerobugs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/zerobugs?hl=en.




--
"These are family names that have been derived from either Vlach or Romanian. Most of these names have been given when a Romanian settled in a non-Romanian region. Examples: Oláh (37,147 Hungarians have this name), Vlach, Vlahuta, Vlasa, Vlasi, Vlašic, Vlasceanu, Vlachopoulos, Voloh, Bolog/Balogh, Volyh, Vlack, Flack and Vlax."
 

Reply all
Reply to author
Forward
0 new messages