cwal

whcl_config.h.in
Login

whcl_config.h.in

File include/wh/cwal/whcl/whcl_config.h.in from the latest check-in


/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 
#if !defined(WANDERINGHORSE_NET_CWAL_WHCL_CONFIG_H_INCLUDED)
#define WANDERINGHORSE_NET_CWAL_WHCL_CONFIG_H_INCLUDED 1
/**
   whcl_config.h is intended to be auto-generated by a configure script
   in order to tell us whether certain system-level features are
   available. If the configuration process is unavailable for some reason,
   toggling all config options to off (with a value of 0) "should" work
   in a pinch.

   We have a fundamental conflict of interest here in terms of
   embedding these options here and accessing them from the loadable
   modules (all of which build against the amalgamation header).

   We disable all of the configurable options by default when
   building in amalgamation mode so as to avoid forcing 3rd-party
   prerequisites on users of libwhcl.[ch].

   When building with the amalgamation build (where these entries
   cannot be easily/maintainably replaced), these defines can be
   passed on via the compiler flags or by `#include`'ing a separate
   header beforehand which sets them. cwal_config.h (which gets
   injected as the top-most section in libcwal.h) supports
   the flag `HAVE_CONFIG_H`, which tells it to `#include "config.h"`,
   so overrides can be put there. Note, however, that THIS file gets
   added to the amalgamation *after* that one, so overriding
   cwal-level options cannot work from this file.
*/

/**
   Optionally #include a user-defined header, whereby compilation
   options may be set prior to where they take effect, but after
   platform setup.  If WHCL_CUSTOM_CONFIG_H=? is defined, its value
   names the #include file (without quotes, which will be added
   automatically).
*/
#ifdef WHCL_CUSTOM_CONFIG_H
# define INC_STRINGIFY_(f) #f
# define INC_STRINGIFY(f) INC_STRINGIFY_(f)
# include INC_STRINGIFY(WHCL_CUSTOM_CONFIG_H)
# undef INC_STRINGIFY
# undef INC_STRINGIFY_
#endif

#if !defined(WHCL_OS_WINDOWS) && !defined(WHCL_OS_UNIX)
#  if defined(_WIN32)
#    define WHCL_OS_WINDOWS
#  else
#    define WHCL_OS_UNIX
#  endif
#endif

#if !defined(WHCL_HAVE_USLEEP)
#  if defined(HAVE_USLEEP)
#    define WHCL_HAVE_USLEEP 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_USLEEP 0
#  else
#    define WHCL_HAVE_USLEEP @HAVE_USLEEP@ /* @ HAVE_USLEEP@ */
#  endif
#endif

#if !defined(WHCL_HAVE_CLOCK_GETTIME)
#  if defined(HAVE_CLOCK_GETTIME)
#    define WHCL_HAVE_CLOCK_GETTIME 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_CLOCK_GETTIME 0
#  else
#    define WHCL_HAVE_CLOCK_GETTIME @HAVE_CLOCK_GETTIME@ /* @ HAVE_CLOCK_GETTIME@ */
#  endif
#endif

#if !defined(WHCL_HAVE_REGCOMP)
#  if defined(HAVE_REGCOMP)
#    define WHCL_HAVE_REGCOMP 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_REGCOMP 0
#  else
#    define WHCL_HAVE_REGCOMP @HAVE_REGCOMP@ /* @ HAVE_REGCOMP@ */
#  endif
#endif

#if !defined(WHCL_HAVE_STAT)
#  if defined(HAVE_STAT)
#    define WHCL_HAVE_STAT 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_STAT 0
#  else
#    define WHCL_HAVE_STAT @HAVE_STAT@ /* @ HAVE_STAT@ */
#  endif
#endif

#if !defined(WHCL_HAVE_MKDIR)
#  if defined(HAVE_MKDIR)
#    define WHCL_HAVE_MKDIR 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_MKDIR 0
#  else
#    define WHCL_HAVE_MKDIR @HAVE_MKDIR@ /* @ HAVE_MKDIR@ */
#  endif
#endif

#if !defined(WHCL_HAVE_LSTAT)
#  if defined(HAVE_LSTAT)
#    define WHCL_HAVE_LSTAT 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_LSTAT 0
#  else
#    define WHCL_HAVE_LSTAT @HAVE_LSTAT@ /* @ HAVE_LSTAT@ */
#  endif
#endif

#if !defined(WHCL_HAVE_CHDIR)
#  if defined(HAVE_CHDIR)
#    define WHCL_HAVE_CHDIR 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_CHDIR 0
#  else
#    define WHCL_HAVE_CHDIR @HAVE_CHDIR@ /* @ HAVE_CHDIR@ */
#  endif
#endif

#if !defined(WHCL_HAVE_GETCWD)
#  if defined(HAVE_GETCWD)
#    define WHCL_HAVE_GETCWD 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_GETCWD 0
#  else
#    define WHCL_HAVE_GETCWD @HAVE_GETCWD@ /* @ HAVE_GETCWD@ */
#  endif
#endif

#if !defined(WHCL_HAVE_REALPATH)
#  if defined(HAVE_REALPATH)
#    define WHCL_HAVE_REALPATH 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_REALPATH 0
#  else
#    define WHCL_HAVE_REALPATH @HAVE_REALPATH@ /* @ HAVE_REALPATH@ */
#  endif
#endif

#if !defined(WHCL_HAVE_DLOPEN)
#  if defined(HAVE_DLOPEN)
#    define WHCL_HAVE_DLOPEN 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_DLOPEN 0
#  else
#    define WHCL_HAVE_DLOPEN @HAVE_LIBDL@ /* @ HAVE_LIBDL@ */
#  endif
#endif

/* Ensure that only 1 of WHCL_HAVE_DLOPEN and WHCL_HAVE_LTDLOPEN are set,
   so that the build doesn't get confused about which to use. The
   makefile(s) must also use this same selection process.
*/
#if WHCL_HAVE_DLOPEN
#  undef WHCL_HAVE_LTDLOPEN
#  define WHCL_HAVE_LTDLOPEN 0
#elif !defined(WHCL_HAVE_LTDLOPEN)
#  if defined(HAVE_LTDLOPEN)
#    define WHCL_HAVE_LTDLOPEN 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    define WHCL_HAVE_LTDLOPEN 0
#  else
#    define WHCL_HAVE_LTDLOPEN @HAVE_LIBLTDL@ /* @ HAVE_LIBLTDL@ */
#  endif
#endif

#if defined(WHCL_OS_UNIX)
/************************************************************************
Massage various defines to try to import specific features which our
local man pages claim we get via such massaging...
************************************************************************/
#  if !defined(_XOPEN_SOURCE)
  /** Linux: _XOPEN_SOURCE
      >=700 for usleep()
      >=500 for lstat(), chdir(), realpath()
  */
#    define _XOPEN_SOURCE 700
#  endif
#  ifndef _XOPEN_SOURCE_EXTENDED
  /* Linux:
     lstat()
  */
#    define _XOPEN_SOURCE_EXTENDED
#  endif
#  ifndef _BSD_SOURCE
  /* Linux: _BSD_SOURCE:
     chdir() (glibc <= 2.19)
     realpath() (glibc <= 2.19)
  */
#    define _BSD_SOURCE
#  endif
#  ifndef _DEFAULT_SOURCE
  /* Linux: _DEFAULT_SOURCE:
     realpath() (glibc >= 2.19)
     >= 200112L for lstat() (glibc 2.20+)
  */
#    define _DEFAULT_SOURCE
#  endif
#  if !defined(_POSIX_C_SOURCE)
  /* Linux: _POSIX_C_SOURCE:
     >= 200112L for lstat() (glibc 2.10+)
     >= 200809L for chdir()
  */
#    define _POSIX_C_SOURCE 200809L /*200112L*/ /*199309L*/
#  endif
#endif /* WHCL_OS_UNIX */

#if !defined(WHCL_HAVE_SIGACTION)
#  if defined(HAVE_SIGACTION)
#    define WHCL_HAVE_SIGACTION 1
#  elif defined(WHCL_AMALGAMATION_BUILD)
#    if defined(WHCL_OS_UNIX)
#      define WHCL_HAVE_SIGACTION 1
#    else
#      define WHCL_HAVE_SIGACTION 0
#    endif
#  else
#    define WHCL_HAVE_SIGACTION @HAVE_SIGACTION@ /* @ HAVE_SIGACTION@ */
#  endif
#endif

#if defined(WHCL_OS_WINDOWS)
#  define WHCL_DIRECTORY_SEPARATOR "\\"
#else
#  define WHCL_DIRECTORY_SEPARATOR "/"
#endif

#endif /* WANDERINGHORSE_NET_CWAL_WHCL_CONFIG_H_INCLUDED */