We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5316

Summary: several detection issues with cmake (alloca, iconv, ...)
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: buildAssignee: Ozkan Sezer <sezeroz>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-1.2.14
Version: HG 2.0   
Hardware: All   
OS: All   

Description Ozkan Sezer 2020-10-11 23:55:24 UTC
There are several detection issues is SDL's cmake'ry. Ones
that I'm aware of:

- iconv (HAVE_ICONV): SDL's cmake only looks for iconv_open()
  in libiconv.  However, it can be in other libraries, most
  importantly it can be in libc itself which is the case with
  glibc: On linux, cmake reports failure for it and does not
  define HAVE_ICONV. One solution I can find is here:
  https://fossies.org/linux/poppler/cmake/modules/FindIconv.cmake
  There can be others.

- alloca (HAVE_ALLOCA): SDL's cmake defines HAVE_ALLOCA only with
  alloca.h in (NOT APPLE) cases, which need not be true:  MinGW,
  for example, does have alloca() but it's in malloc.h. Therefore
  cmake doesn't define HAVE_ALLOCA for MinGW.

There may be other issues...