Page 1 of 1

Autoconf AM_PATH_WXCONFIG macro question

Posted: Thu May 13, 2010 2:56 pm
by Cursor
Hi all.

I intend to write a configure.ac file using wxwin.m4 macros instead of using `wx-config ...` directly.

As described in wxwin.m4, I wrote :

Code: Select all

AM_OPTIONS_WXCONFIG
reqwx=2.9.1
AM_PATH_WXCONFIG($reqwx, wxWin=1,,[ribbon,aui,stc,core,net])
if test "$wxWin" != 1; then
	AC_MSG_ERROR([
		wxWidgets must be installed on your system.
 
		Please check that wx-config is in path, the directory
		where wxWidgets libraries are installed (returned by
		'wx-config --libs' or 'wx-config --static --libs' command)
		is in LD_LIBRARY_PATH or equivalent variable and
		wxWidgets version is $reqwx or above.
		])
fi
echo "wxWidgets version : $WX_VERSION"
echo "wxWidgets libs    : $WX_LIBS"
In order to enable wx (2.9.1 from svn) with ribbon, stc and aui enabled.

But when I ran the generated configure, it provides :

Code: Select all

...
checking for wx-config... /usr/local/bin/wx-config
checking for wxWidgets version >= 2.9.1... yes (version 2.9.1)
checking for wxWidgets static library... no
wxWidgets version : 2.9.1
wxWidgets libs    : -L/usr/local/lib -pthread   -lwx_gtk2u_xrc-2.9 -lwx_gtk2u_html-2.9 -lwx_gtk2u_qa-2.9 -lwx_gtk2u_adv-2.9 -lwx_gtk2u_core-2.9 -lwx_baseu_xml-2.9 -lwx_baseu_net-2.9 -lwx_baseu-2.9
No linked lib to aui, stc nor ribbon ... strange.

Moreover, in the same terminal, when I query it by hand, it say to me :

Code: Select all

$ wx-config --libs ribbon,aui,stc,core,net
-L/usr/local/lib -pthread   -lwx_gtk2u_ribbon-2.9 -lwx_gtk2u_aui-2.9 -lwx_gtk2u_stc-2.9 -lwx_gtk2u_core-2.9 -lwx_baseu_net-2.9 -lwx_baseu-2.9
What should I do to enable correct libs ? (enable all libs is also good for me ;))

Thanks.
Emilien

Posted: Thu May 13, 2010 7:03 pm
by DavidHart
Hi,

I see that you use AM_PATH_WXCONFIG, which is deprecated in the 2.9.1 wxwin.m4.

Are you using the 2.9.1 version? If not, do so, as (afaict) the new macro, WX_CONFIG_CHECK, does look specifically for the requested libs.

Regards,

David

Posted: Thu May 13, 2010 7:35 pm
by Cursor
Yes I do. I use an up-to-date svn trunk working copy so 2.9.1.

I will invastigate with using WX_CONFIG_CHECK.

Thanks.

Posted: Thu May 13, 2010 7:57 pm
by Cursor
Thanks very much David.
Work well now.