The wx-config script goes to great lengths to avoid
putting unnecessary options onto the command line, like
-I/usr/include. However, it is not safe to assume that
every compiler on every platform will necessarily look
in all the locations that you think it will.
For example, if you do the standard configure on most
unix platforms, the prefix defaults to /usr/local. You
do the build, you install the include files and lib
files in /usr/local/*, and it's ok. However, with some
compile switches on cygwin (e.g. -mno-cygwin), and
probably it is the case with some other compilers too
given the large number of them, /usr/local/include is
not in the list of search directories. Because the
compiler doesn't search /usr/local/bin, and wx-config
does not put -I/usr/local/include in the compile line,
the compile of every wxWindows application fails.
The current wx-config includes this code:
if test "${prefix}/include" != "/usr/include" \
-a "${prefix}/include" !=
"/usr/include/c++" \
-a "${prefix}/include" !=
"/usr/local/include" \
-a ( "${cross_compiling}" != "yes" \
-o "${prefix}/include" !=
"/usr/${target}/include" ) ;
then
includes=-I${prefix}/include
fi
In my case I would have to remove the
"${prefix}/include" != "/usr/local/include" comparison
to make compiles with wx-config --cxxflags work
right.
It would be much safer to take out these tests, no
matter how standard you may think those directories
are, and just put -I${prefix}/include in the output all
the time. If you use the backtick style, only the
compiler has to look at it anyway!
(I'm assuming these tests are there for aesthetic
reasons, not because they solve some problem.)
Issue migrated from trac ticket # 571
component: wxMSW | priority: normal
2002-09-26 21:49:42: bdenney created the issue
The wx-config script goes to great lengths to avoid putting unnecessary options onto the command line, like -I/usr/include. However, it is not safe to assume that every compiler on every platform will necessarily look in all the locations that you think it will.
For example, if you do the standard configure on most unix platforms, the prefix defaults to /usr/local. You do the build, you install the include files and lib files in /usr/local/*, and it's ok. However, with some compile switches on cygwin (e.g. -mno-cygwin), and probably it is the case with some other compilers too given the large number of them, /usr/local/include is not in the list of search directories. Because the compiler doesn't search /usr/local/bin, and wx-config does not put -I/usr/local/include in the compile line, the compile of every wxWindows application fails.
The current wx-config includes this code:
"/usr/include/c++" \ -a "${prefix}/include" != "/usr/local/include" \ -a ( "${cross_compiling}" != "yes" \ -o "${prefix}/include" != "/usr/${target}/include" ) ; then includes=-I${prefix}/include fi
$includes"
In my case I would have to remove the "${prefix}/include" != "/usr/local/include" comparison to make compiles with
wx-config --cxxflags
work right.It would be much safer to take out these tests, no matter how standard you may think those directories are, and just put -I${prefix}/include in the output all the time. If you use the backtick style, only the compiler has to look at it anyway!
(I'm assuming these tests are there for aesthetic reasons, not because they solve some problem.)