[CMake] Converting from autoconf to cmake problem
Aaron Turner
synfinatic at gmail.com
Tue Nov 2 12:24:42 EDT 2010
On Tue, Nov 2, 2010 at 12:40 AM, Michael Wild <themiwi at gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi
>
> In addition to the other replies, here some thoughts on the mentioned
> macros (see below):
>
> On 10/30/2010 05:45 AM, mina adel wrote:
>>
>> Hi All
>>
>> I am converting a code from configure.ac to cmake.
>> Can any one please advice me about what is the corresponding macro for the
>> following. I have searched the cmake wiki and documentation and didnot find any.
>>
>> AC_HEADER_STDBOOL
>
> That one's fine, since not all compilers implement C99.
>
>> AC_C_CONST
>
> This macro is marked as obsolescent:
> http://www.gnu.org/software/hello/manual/autoconf/C-Compiler.html#index-AC_005fC_005fCONST-885
>
>> AC_TYPE_PID_T
>> AC_TYPE_SIZE_T
>
> Those two might be useful.
>
>> AC_STRUCT_TM
>
> That one's obsolescent too:
> http://www.gnu.org/software/hello/manual/autoconf/Particular-Structures.html#index-AC_005fSTRUCT_005fTM-693
>
>>
>> # Checks for library functions.
>> AC_FUNC_CLOSEDIR_VOID
>
> Obsolescent:
> http://www.gnu.org/software/hello/manual/autoconf/Particular-Functions.html#index-AC_005fFUNC_005fCLOSEDIR_005fVOID-380
>
>> AC_FUNC_ERROR_AT_LINE
>
> Obsolescent, use Gnulib instead:
> http://www.gnu.org/software/hello/manual/autoconf/Particular-Functions.html#index-AC_005fFUNC_005fERROR_005fAT_005fLINE-385
>
>> AC_FUNC_FORK
>> AC_FUNC_MALLOC
>> AC_FUNC_REALLOC
>
> Could be useful too.
>
>> AC_TYPE_SIGNAL
>
> I pretty much bet that you require a C89 compiler and thus this macro is
> also pretty much useless to you:
> http://www.gnu.org/software/hello/manual/autoconf/Obsolete-Macros.html#index-AC_005fTYPE_005fSIGNAL-2139
>
>> AC_FUNC_VPRINTF
>
> Obsolescent:
> http://www.gnu.org/software/hello/manual/autoconf/Particular-Functions.html#index-AC_005fFUNC_005fVPRINTF-546
>
>>
>> Thank u
>> Mina
>>
>
> HTH
>
> Michael
Michael brings up a good point and I'd take it one step further.
Rather then re-creating the laundry list of Autoconf macros, I'd
rather just see a few macros like:
CMAKE_CHECK_C99_COMPATIBILITY
CMAKE_CHECK_PLATFORM_BITS
CMAKE_CHECK_POSIX_COMPATIBILITY
CMAKE_CHECK_BSD_COMPATIBILITY
Which are basically are best practices for checking your compiler for
C99, etc and if your platform is 32 or 64 bits. These macros would
provide both individual feature results and a single yes/no for each
group.
Ideally cmake would also provide a sample config.h template with the
appropriate #cmakedefine entries.
--
Aaron Turner
http://synfin.net/ Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
"carpe diem quam minimum credula postero"
More information about the CMake
mailing list