autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multi-Line Definitions


From: Eric Lemings
Subject: Multi-Line Definitions
Date: Mon, 17 Sep 2007 15:53:23 -0600

Greetings,

I have a Autoconf M4 macro that defines a multi-line preprocessor
symbol.
The symbol is defined correctly when written from the generated
configure
script into confdefs.h.  Here's the part of the conrfigure script that
writes the definition to confdefs.h:

configure: 
...
echo "$as_me:$LINENO: result: $ac_cv_struct_tm_def" >&5
echo "${ECHO_T}$ac_cv_struct_tm_def" >&6
 
cat >>confdefs.h <<_ACEOF
#define _RWSTD_STRUCT_TM $ac_cv_struct_tm_def
_ACEOF
cp confdefs.h asd9f8
...
 
I manually added the copy statement just to capture the contents of
confdefs.h.  Here is the macro definition:

confdefs.h:
...
#define _RWSTD_STRUCT_TM {   /* sizeof (struct tm) == 56 */ \
    int tm_sec;              /* seconds after the minute [O..61]  */ \
    int tm_min;              /* minutes after the hour   [0..59]  */ \
    int tm_hour;             /* hours since midnight     [0..23]  */ \
    int tm_mday;             /* day of the month         [1..31]  */ \
    int tm_mon;              /* months since January     [0..11]  */ \
    int tm_year;             /* years since 1900                  */ \
    int tm_wday;             /* days since Sunday        [0..6]   */ \
    int tm_yday;             /* days since January 1     [0..365] */ \
    int tm_isdst;            /* Daylight Saving Time              */ \
    char _C_fill [20];        /* fill to size                      */ \
  } 
 
The problem is that the part of 'configure' that transforms confdefs.h
into the configure headers, config.log, and company does not account
for such macro definitions AFAICT.

config.log:
...
ac_cv_struct_tm_def='{   /* sizeof (struct tm) == 56 */ \
...

config.h:
...
/* The definition of `tm' structure, as defined in <time.h>. */
#define _RWSTD_STRUCT_TM {   /* sizeof (struct tm) == 56 */ \
...

How hard would it be to handle such macro definitions?  Is it even
possible?

Thanks,
Eric.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]