Обсуждение: Re: SUN Studio 11 vs pgAdmin - code cleanup]

Поиск
Список
Период
Сортировка

Re: SUN Studio 11 vs pgAdmin - code cleanup]

От
"Dave Page"
Дата:

> -----Original Message-----
> From: Zdenek.Kotala@Sun.COM [mailto:Zdenek.Kotala@Sun.COM]
> Sent: 02 August 2006 07:33
> To: pgadmin-hackers@postgresql.org; Dave Page
> Subject: SUN Studio 11 vs pgAdmin - code cleanup]
>
>
> I tried compiled pgAdmin with the SUN Studio 11 and I found
> some problem
> in the code. I send patch which fix two errors and lot of warnings:
>
> 1) New C++ standard brings overloaded definition of strchr
> function. See
>    http://www.cplusplus.com/ref/cstring/strchr.html for detail.
>
> 2) Missing const in the pgCollection::FindChild method definition
> generate mangling problem with linking. See
> http://developers.sun.com/prodtech/cc/documentation/ss11/mr/RE
> ADMEs/c++.html#cNameMangling
>
> 3) I removed extra ; in the code on many places.

Thanks - patch applied to the stable branch. Would you mind taking some
time to port the patch to SVN TRUNK please? It's most likely that that
will go beta within a few weeks and unfortunately I'm *really* pushed
for time right now :-(

> There are still many warnings about hiding virtual functions,
> attributes... I think It is not good practice but it works.
>
> I have still problem with building (autoconf/automake). There are hard
> coded switches related to the gcc compiler. I would like to
> fix it, but
> I'm not familiar with automake/autoconf. Is there anybody who can help
> me wit it?

I can certainly try - what do you need to change? (BTW, build system
changes like this will only be applied to trunk - I consider support for
a new compiler to be a new feature, especially when we already have an
option for the target platform).

Regards, Dave.

Re: SUN Studio 11 vs pgAdmin - code cleanup]

От
Zdenek Kotala
Дата:
Dave Page wrote:

>
> Thanks - patch applied to the stable branch.   Would you mind taking some
> time to port the patch to SVN TRUNK please? It's most likely that that
> will go beta within a few weeks and unfortunately I'm *really* pushed
> for time right now :-(
>

Ok. No problem. I will do it.

>> I have still problem with building (autoconf/automake). There are hard
>> coded switches related to the gcc compiler. I would like to
>> fix it, but
>> I'm not familiar with automake/autoconf. Is there anybody who can help
>> me wit it?
>
> I can certainly try - what do you need to change? (BTW, build system
> changes like this will only be applied to trunk - I consider support for
> a new compiler to be a new feature, especially when we already have an
> option for the target platform).

The problem what I have is that when I set CC and CXX environment
variable to Sun Studio compilers, configure generates Makefile which
contains wrong compiler switches (-Wall ...). I must manually change
makefile If I want to compile pgAdmin with Sun Studio. There is some
problem with openssl library detection on solaris as well.

        Zdenek

Re: SUN Studio 11 vs pgAdmin - code cleanup]

От
"Dave Page"
Дата:

> -----Original Message-----
> From: Zdenek.Kotala@Sun.COM [mailto:Zdenek.Kotala@Sun.COM]
> Sent: 03 August 2006 15:15
> To: Dave Page
> Cc: pgadmin-hackers@postgresql.org
> Subject: Re: SUN Studio 11 vs pgAdmin - code cleanup]
>
> Dave Page wrote:
>
> >
> > Thanks - patch applied to the stable branch.   Would you
> mind taking some
> > time to port the patch to SVN TRUNK please? It's most
> likely that that
> > will go beta within a few weeks and unfortunately I'm
> *really* pushed
> > for time right now :-(
> >
>
> Ok. No problem. I will do it.


Thanks.

> The problem what I have is that when I set CC and CXX environment
> variable to Sun Studio compilers, configure generates Makefile which
> contains wrong compiler switches (-Wall ...). I must manually change
> makefile If I want to compile pgAdmin with Sun Studio. There is some
> problem with openssl library detection on solaris as well.

OK, well I'll warn you up front that I'm not an automake/autoconf
*expert* so others on the list may have better ideas. I'm also going on
holiday for 2 weeks this weekend, so if I don't reply to you immediately
I'm not being rude :-)

At the moment most of the GCC flags are set in the Makefile.am files -
in particular we set

-Wall -Wno-non-virtual-dtor

I would look at moving that into the CLEANUP macro in acinclude.m4 (and
perhaps giving it a more suitable name), along with a conditional
alternative for the Sun compiler (if you check your config.log file,
hopefully you'll find a suitable variable to test for the compiler
name). I notice there are also a couple of other hacks at the end of
SETUP_WXWIDGETS (for Apple and Solaris) that could also move into that
macro.

I also notice that we setup CXXFLAGS and CFLAGS in the Makefile.am's
which we don't need at all - those lines can be removed from all the
Makefile.am's I guess.

When you've made changes to any of the Makefile.am's, acinclude.m4 or
configure.ac.in (in which you may need to update/add/remove and macro
names from acinclude.m4), just run the bootstrap script in $PGADMIN_SRC/
to regenerate everything, then run "./configure; make clean; make" to
test.

Regards, Dave.