Thread: acinclude.m4 and wx detection question

acinclude.m4 and wx detection question

From
Raphaël Enrici
Date:
Hi Adam,

I have a small question in mind I never asked concerning the way we
check for wxwidgets files installed while in configure scripts (for
example stc headers).
Why don't we try to build small C or C++ examples which includes the
required files and check to see if the build failed instead of
hardcoding some test on file existance ? Or maybe we could parse the
'-I' outputs of wx-confg --cflags or cxxflags to take as a base for the
tests ?

IMHO we would gain in both portability (it would be easier to take care
of specific configuration) and maintenance (no more change needed to
acinclude.m4 if we change the version of wxwidgets we support).

As an example, my wx-config outputs is this one:
 wx-config --cflags
-I/usr/lib/wx/include/gtk2-unicode-debug-static-2.6-pga3
-I/usr/include/wx-2.6-pga3 -D__WXDEBUG__ -D__WXGTK__
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1

If I want the configure script to pass with such a configuration, I must
patch acinclude.m4 so that it refers to the correct path. If not, it
just fails and tells me that I did not install stc which is not true.

If we were trying to detect this with a small program like this:
#include <wx/stc/stc.h>
...
void main(void) { .... }

After building it successfully with the wx-config --cflags output passed
to the compiler, wouldn't this be sufficient (we may also add a check on
the wx version detected if needed) ?

Tell me if I missed something.

Regards,
Raphaël

Re: acinclude.m4 and wx detection question

From
"Adam H. Pendleton"
Date:
On May 5, 2005, at 4:47 PM, Raphaël Enrici wrote:

> Hi Adam,
>
> I have a small question in mind I never asked concerning the way we
> check for wxwidgets files installed while in configure scripts (for
> example stc headers).
> Why don't we try to build small C or C++ examples which includes the
> required files and check to see if the build failed instead of
> hardcoding some test on file existance ? Or maybe we could parse the
> '-I' outputs of wx-confg --cflags or cxxflags to take as a base for
> the
> tests ?

We do use the wx-confg output for our basis:

WX_NEW_LDFLAGS=`${WX_CONFIG} --static --libs`

>
> IMHO we would gain in both portability (it would be easier to take
> care
> of specific configuration) and maintenance (no more change needed to
> acinclude.m4 if we change the version of wxwidgets we support).
>
> As an example, my wx-config outputs is this one:
>  wx-config --cflags
> -I/usr/lib/wx/include/gtk2-unicode-debug-static-2.6-pga3
> -I/usr/include/wx-2.6-pga3 -D__WXDEBUG__ -D__WXGTK__
> -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1

Yes, but how would we go about finding the wx-config file in the
first place?

>
> If I want the configure script to pass with such a configuration, I
> must
> patch acinclude.m4 so that it refers to the correct path. If not, it
> just fails and tells me that I did not install stc which is not true.
>
> If we were trying to detect this with a small program like this:
> #include <wx/stc/stc.h>
> ...
> void main(void) { .... }

Again, you have to find wx-config.  The other problem is that wx
programs will fail if you don't link against the wx libraries.  Since
the wx library names are not reported by wx-config, we have to try
all the possible wx lib names (because they've changed to many times).

I'll take another look at this and see if we can't make some
improvements, but the acinclude.m4 has to be able to handle all the
one-offs, which usually requires a lot of manual checking, but we'll
see what we can do!

ahp

Re: acinclude.m4 and wx detection question

From
Andreas Pflug
Date:
Raphaël Enrici wrote:

>Hi Adam,
>
>I have a small question in mind I never asked concerning the way we
>check for wxwidgets files installed while in configure scripts (for
>example stc headers).
>Why don't we try to build small C or C++ examples which includes the
>required files and check to see if the build failed instead of
>hardcoding some test on file existance ?
>
Why not, AFAICS many configure scripts already work like this.OTOH, care
should be taken that non-existence can be separated from other failures.

Regards,
Andreas


Re: acinclude.m4 and wx detection question

From
Raphaël Enrici
Date:
Adam H. Pendleton wrote:
> On May 5, 2005, at 4:47 PM, Raphaël Enrici wrote:
>
>
>>Hi Adam,
>>
>>I have a small question in mind I never asked concerning the way we
>>check for wxwidgets files installed while in configure scripts (for
>>example stc headers).
>>Why don't we try to build small C or C++ examples which includes the
>>required files and check to see if the build failed instead of
>>hardcoding some test on file existance ? Or maybe we could parse the
>>'-I' outputs of wx-confg --cflags or cxxflags to take as a base for
>>the
>>tests ?
>
>
> We do use the wx-confg output for our basis:
>
> WX_NEW_LDFLAGS=`${WX_CONFIG} --static --libs`

yes I've seen that the build process is ok and that's a good thing.


>>IMHO we would gain in both portability (it would be easier to take
>>care
>>of specific configuration) and maintenance (no more change needed to
>>acinclude.m4 if we change the version of wxwidgets we support).
>>
>>As an example, my wx-config outputs is this one:
>> wx-config --cflags
>>-I/usr/lib/wx/include/gtk2-unicode-debug-static-2.6-pga3
>>-I/usr/include/wx-2.6-pga3 -D__WXDEBUG__ -D__WXGTK__
>>-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1
>
>
> Yes, but how would we go about finding the wx-config file in the
> first place?

Aren't the --with-wx* flags you gave to us useable for this ?
I personnaly use them each time I build pga3 like this:
--with-wx=/usr --with-wx-config=wx-config


>>If I want the configure script to pass with such a configuration, I
>>must
>>patch acinclude.m4 so that it refers to the correct path. If not, it
>>just fails and tells me that I did not install stc which is not true.
>>
>>If we were trying to detect this with a small program like this:
>>#include <wx/stc/stc.h>
>>...
>>void main(void) { .... }
>
>
> Again, you have to find wx-config.  The other problem is that wx
> programs will fail if you don't link against the wx libraries.  Since
> the wx library names are not reported by wx-config, we have to try
> all the possible wx lib names (because they've changed to many times).

mmmh, I missed that part of the process, but:

wx-config --libs gives some informations. In my case :
-pthread   -L/usr/X11R6/lib  /usr/lib/libwx_gtk2ud_pga3_xrc-2.6.a
/usr/lib/libwx_gtk2ud_pga3_html-2.6.a
/usr/lib/libwx_gtk2ud_pga3_adv-2.6.a
/usr/lib/libwx_gtk2ud_pga3_core-2.6.a
/usr/lib/libwx_baseud_pga3_xml-2.6.a
/usr/lib/libwx_baseud_pga3_net-2.6.a /usr/lib/libwx_baseud_pga3-2.6.a
-Wl,--export-dynamic -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lpng -ljpeg
-ltiff -lexpat -lwxregexud_pga3-2.6 -lz -ldl -lm


> I'll take another look at this and see if we can't make some
> improvements, but the acinclude.m4 has to be able to handle all the
> one-offs, which usually requires a lot of manual checking, but we'll
> see what we can do!

thanks! :)

Raphaël

Re: acinclude.m4 and wx detection question

From
"Adam H. Pendleton"
Date:
On May 5, 2005, at 5:23 PM, Raphaël Enrici wrote:

>>
>>
>> Yes, but how would we go about finding the wx-config file in the
>> first place?
>>
>
> Aren't the --with-wx* flags you gave to us useable for this ?
> I personnaly use them each time I build pga3 like this:
> --with-wx=/usr --with-wx-config=wx-config

Absolutely, but the configure script must be able to deal with
situations in which the user does not pass that flag.  In theory, a
user should be able to do the following to build pgAdmin3:

./configure
make
make install

>> Again, you have to find wx-config.  The other problem is that wx
>> programs will fail if you don't link against the wx libraries.  Since
>> the wx library names are not reported by wx-config, we have to try
>> all the possible wx lib names (because they've changed to many
>> times).
>>
>
> mmmh, I missed that part of the process, but:
>
> wx-config --libs gives some informations. In my case :
> -pthread   -L/usr/X11R6/lib  /usr/lib/libwx_gtk2ud_pga3_xrc-2.6.a
> /usr/lib/libwx_gtk2ud_pga3_html-2.6.a
> /usr/lib/libwx_gtk2ud_pga3_adv-2.6.a
> /usr/lib/libwx_gtk2ud_pga3_core-2.6.a
> /usr/lib/libwx_baseud_pga3_xml-2.6.a
> /usr/lib/libwx_baseud_pga3_net-2.6.a /usr/lib/libwx_baseud_pga3-2.6.a
> -Wl,--export-dynamic -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
> -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0
> -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lpng -
> ljpeg
> -ltiff -lexpat -lwxregexud_pga3-2.6 -lz -ldl -lm

See this is new.  wx-config didn't use to return this.  With this
information I can make the autoconf script much cleaner!

ahp