|
From: | Michael Dickens |
Subject: | [Discuss-gnuradio] QtGUI QWT #includes? |
Date: | Tue, 17 Mar 2009 08:02:25 -0400 |
Since I'm using ${prefix}=/usr/local -- which is a standard one searched for by the modern autoconf configure scripts -- the qwt and qwtplot3d headers are found correctly by GNU Radio's configure script (in this case, in ${prefix}/include/qwt and .../qwtplot3d). But then compilation fails because the headers can't be found with the known include path. I traced this down to the file config/ grc_gr_qtgui.m4:61-86, which does the checking and then assumes that the include path is "/usr/include" -- which isn't necessarily true because of the way autoconf works. [In the qtgui C++ code, headers are included directly via "#include <qwt.h>" etc., so-as to try to avoid the unknown subdirectory name containing the headers. This is normal and fine; just means that the correct #include path needs to be in CXXFLAGS.]
I haven't been able to track down a way to use AC_CHECK_HEADER to obtain the path to the header. Best I've found is done by config/ ax_boost_base.m4:102-114, which checks over each of "/usr /usr/local / opt /opt/local" for "include/boost" and breaks when it finds one. The script then goes on to check to see if <boost/version.hpp> works, and then (again looping over the directories above) that the version # is new enough (per that provided as input to the macro by the user).
It seems to me that something to the effect of what boost is doing could be implemented for QWT (assuming the user doesn't specify a path via an environment variable or configure flag): loop over "/usr /usr/ local /opt /opt/local" and an inner loop over "qwt qwt-qt4 (etc)" and "qwtplot3d qwtplot3d-qt4 (etc)"; the first path of each which passes some appropriate test would then be appended to CXXFLAGS ($ {found_prefix}/include) and LDFLAGS (${found_prefix}/lib). This search would be much more robust than the current method.
Yes, I know I can set the "--with-qwt-incdir=[path]" and "--with- qwtplot3d-incdir=[path]" flags to configure ... I'm just trying to find ways to automate the process, to work for "more" or "most" typical installs.
Comments? Thoughts? - MLD
[Prev in Thread] | Current Thread | [Next in Thread] |