Mailing List Archive

Avoid 'ifdef USE_GTK' in code with more clever Makefile?
Hi,

I wonder whether it would be OK to avoid a number
of ifdef USE_GTK in the code in nessus-core/nessus
by already detecting in the Makefile which
modules are to be included depending on whether
GTK is opted or not.

Also, the modules would not even be linked
anymore if nessus is build without GTK.

A sample patch is attached.

The only thing I am not sure of is whether
$(if ..) construct is support by most make
tools. So my proposal is to have my patch applied
for only the two modules and wait whether there is
anyone out there reporting problems. In that
case I can immediately resolve the problem and
apply the current style.
If there will be no problems reported for a couple
of month we could then apply the new method for
all gtk modules.

Best

Jan

--
Jan-Oliver Wagner http://intevation.de/~jan/

Intevation GmbH http://intevation.de/
FreeGIS http://freegis.org/
Re: Avoid 'ifdef USE_GTK' in code with more clever Makefile? [ In reply to ]
On Thu, Oct 07, 2004 at 12:24:12PM +0200, Jan-Oliver Wagner wrote:

Hi,

> I wonder whether it would be OK to avoid a number
> of ifdef USE_GTK in the code in nessus-core/nessus
> by already detecting in the Makefile which
> modules are to be included depending on whether
> GTK is opted or not.
>
> Also, the modules would not even be linked
> anymore if nessus is build without GTK.
>
> A sample patch is attached.

Your patch is correct. However some files will still require USE_GTK
(ie: sslui.c)



-- Renaud
Re: Avoid 'ifdef USE_GTK' in code with more clever Makefile? [ In reply to ]
On Thu, Oct 07, 2004 at 08:36:41AM -0400, Renaud Deraison wrote:
> On Thu, Oct 07, 2004 at 12:24:12PM +0200, Jan-Oliver Wagner wrote:
> > I wonder whether it would be OK to avoid a number
> > of ifdef USE_GTK in the code in nessus-core/nessus
> > by already detecting in the Makefile which
> > modules are to be included depending on whether
> > GTK is opted or not.
> >
> > Also, the modules would not even be linked
> > anymore if nessus is build without GTK.
> >
> > A sample patch is attached.
>
> Your patch is correct. However some files will still require USE_GTK
> (ie: sslui.c)

yes, but we can get rid of quite a number and this get the
non-gtk version cleaner. (Also I am a fan of having
GUI and functionality separated as much as possible).
So I will proceed as I proposed and apply this for my new files
and eventually (in some month) change the rest unless any
complains occur.

Best

Jan

--
Jan-Oliver Wagner http://intevation.de/~jan/

Intevation GmbH http://intevation.de/
FreeGIS http://freegis.org/