How to write directly to config.h from configure?

2018-07-26 Thread Jeffrey Walton
Hi Everyone, I have a bad interaction with a project and Autotools. The project is not an Autotools project but we are trying to [cleanly] support Autotools. The project provides its own config.h since the mid-1990's. We want to supply roughly the same file though Autotools. The problem is, the p

AC_COMPILE_ELSEIF and AC_LINK_ELSEIF misdetections

2018-07-26 Thread Jeffrey Walton
Hi Everyone, In case this can make it into the upcoming release... AC_COMPILE_ELSEIF and AC_LINK_ELSEIF often misdetects which results in bad configurations and broken compiles on AIX with XL C/C++ and Solaris with SunCC. We found we can't use the macros. We use the following string to detect ba

Re: How to write directly to config.h from configure?

2018-07-26 Thread Zack Weinberg
On Thu, Jul 26, 2018 at 11:36 AM, Jeffrey Walton wrote: ... > The problem is, the project's config.h has some stuff that does not > seem to fit in the Autotools model like typedefs and declarations of > namespaces. I think the solution is to write directly to config.h but > I can't figure out how

Re: AC_COMPILE_ELSEIF and AC_LINK_ELSEIF misdetections

2018-07-26 Thread Zack Weinberg
On Thu, Jul 26, 2018 at 11:47 AM, Jeffrey Walton wrote: > > AC_COMPILE_ELSEIF and AC_LINK_ELSEIF often misdetects which results in > bad configurations and broken compiles on AIX with XL C/C++ and > Solaris with SunCC. We found we can't use the macros. Could you please supply a short, self-contai

Re: How to write directly to config.h from configure?

2018-07-26 Thread Nick Bowler
On 7/26/18, Jeffrey Walton wrote: > I have a bad interaction with a project and Autotools. The project is > not an Autotools project but we are trying to [cleanly] support > Autotools. The project provides its own config.h since the mid-1990's. > We want to supply roughly the same file though Auto

Re: How to write directly to config.h from configure?

2018-07-26 Thread Eric Blake
On 07/26/2018 10:36 AM, Jeffrey Walton wrote: Hi Everyone, I have a bad interaction with a project and Autotools. The project is not an Autotools project but we are trying to [cleanly] support Autotools. The project provides its own config.h since the mid-1990's. We want to supply roughly the sa

Re: AC_COMPILE_ELSEIF and AC_LINK_ELSEIF misdetections

2018-07-26 Thread Jeffrey Walton
On Thu, Jul 26, 2018 at 11:55 AM, Zack Weinberg wrote: > On Thu, Jul 26, 2018 at 11:47 AM, Jeffrey Walton wrote: >> >> AC_COMPILE_ELSEIF and AC_LINK_ELSEIF often misdetects which results in >> bad configurations and broken compiles on AIX with XL C/C++ and >> Solaris with SunCC. We found we can't

Re: AC_COMPILE_ELSEIF and AC_LINK_ELSEIF misdetections

2018-07-26 Thread Jeffrey Walton
On Thu, Jul 26, 2018 at 11:55 AM, Zack Weinberg wrote: > On Thu, Jul 26, 2018 at 11:47 AM, Jeffrey Walton wrote: >> >> AC_COMPILE_ELSEIF and AC_LINK_ELSEIF often misdetects which results in >> bad configurations and broken compiles on AIX with XL C/C++ and >> Solaris with SunCC. We found we can't

Re: How to write directly to config.h from configure?

2018-07-26 Thread Warren Young
On Jul 26, 2018, at 9:36 AM, Jeffrey Walton wrote: > >cat << EOT >> config.h > typedef unsigned char byte; > typedef unsigned short word16; > typedef unsigned int word32; >EOT You’re reinventing C99’s stdint.h here. Unless you still must build on C89 or older compilers,

Re: How to write directly to config.h from configure?

2018-07-26 Thread Jeffrey Walton
On Thu, Jul 26, 2018 at 1:20 PM, Warren Young wrote: > On Jul 26, 2018, at 9:36 AM, Jeffrey Walton wrote: >> >>cat << EOT >> config.h >> typedef unsigned char byte; >> typedef unsigned short word16; >> typedef unsigned int word32; >>EOT > > You’re reinventing C99’s stdint.h

Re: How to write directly to config.h from configure?

2018-07-26 Thread Paul Eggert
On 07/26/2018 10:26 AM, Jeffrey Walton wrote: The problem is we risk breaking user code, especially on Windows platforms where or did not arrive until about 2010. Gnulib's stdint.h module solves this. Use it, and the rest of your code can just use "#include ". https://www.gnu.org/software/

Re: How to write directly to config.h from configure?

2018-07-26 Thread Bob Friesenhahn
On Thu, 26 Jul 2018, Jeffrey Walton wrote: Yeah, we changed minimum requirements to C++03 recently (from C++98). The problem is we risk breaking user code, especially on Windows platforms where or did not arrive until about 2010. Using is more portable than since it was defined earlier.