Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Zach Welch
On Sun, 2009-05-03 at 01:43 +0200, Michael Bruck wrote: > On Sun, May 3, 2009 at 1:03 AM, Zach Welch wrote: > > On Sun, 2009-05-03 at 00:40 +0200, Michael Schwingen wrote: > >> Zach Welch wrote: > >> > If the header is required, the configure step should fail when it is not > >> > found in the sys

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Michael Bruck
On Sun, May 3, 2009 at 1:03 AM, Zach Welch wrote: > On Sun, 2009-05-03 at 00:40 +0200, Michael Schwingen wrote: >> Zach Welch wrote: >> > If the header is required, the configure step should fail when it is not >> > found in the system.  The rule is to fail as early as possible. >> > >> > Which he

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Zach Welch
On Sun, 2009-05-03 at 00:40 +0200, Michael Schwingen wrote: > Zach Welch wrote: > > If the header is required, the configure step should fail when it is not > > found in the system. The rule is to fail as early as possible. > > > > Which headers? > > > Not system headers - I was thinking about

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Michael Schwingen
Zach Welch wrote: > If the header is required, the configure step should fail when it is not > found in the system. The rule is to fail as early as possible. > > Which headers? > Not system headers - I was thinking about in-project headers (either user-edited, config.h or similar) that define s

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Zach Welch
On Sat, 2009-05-02 at 12:26 +0200, Michael Schwingen wrote: > Zach Welch wrote: > > With autotools, #ifdef should be preferred. For example, HAVE_FOO_H > > will be defined 1 by the AC_CHECK_HEADERS([foo.h],[1],[Comment]) macro; > > configure defines the symbol to the given value if foo.h is prese

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Michael Bruck
On Sat, May 2, 2009 at 12:26 PM, Michael Schwingen wrote: > Zach Welch wrote: >> With autotools, #ifdef should be preferred.   For example, HAVE_FOO_H >> will be defined 1 by the AC_CHECK_HEADERS([foo.h],[1],[Comment]) macro; >> configure defines the symbol to the given value if foo.h is present,

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Michael Schwingen
Zach Welch wrote: > With autotools, #ifdef should be preferred. For example, HAVE_FOO_H > will be defined 1 by the AC_CHECK_HEADERS([foo.h],[1],[Comment]) macro; > configure defines the symbol to the given value if foo.h is present, and > the symbol is not defined if absent. In both cases, the d

Re: [Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-02 Thread Zach Welch
On Sat, 2009-05-02 at 07:04 +0200, Michael Bruck wrote: > I would like to start another holy war while we are at it: > > > 1. Are false preprocessor variables in OpenOCD specified by not > defining a variable or by defining it as 0 ? OpenOCD's variables are defined as 0 or 1. This is not standa

[Openocd-development] #if vs. #ifdef, autotools vs. Cmake

2009-05-01 Thread Michael Bruck
I would like to start another holy war while we are at it: 1. Are false preprocessor variables in OpenOCD specified by not defining a variable or by defining it as 0 ? 2. config.h generated by autotools and cmake use different paradigms for this 3. several files (including my latest patch for j