config.h: fix layering and don't duplicate definitions

Also correct the llvm-config.h header guard so it doesn't depend on 'CONFIG_H'
which is commonly defined in external projects and caused trouble for
embedders.

In future llvm/Config/llvm-config.h will be installed, but not
the private llvm/Config/config.h header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker
2014-06-04 03:21:38 +00:00
parent 5c0b13f3be
commit 4830b9c727
4 changed files with 25 additions and 176 deletions

View File

@ -3,6 +3,12 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
/* Exported configuration */
#include "llvm/Config/llvm-config.h"
/* Patch version of the LLVM API */
#cmakedefine LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH}
/* Bug report URL. */ /* Bug report URL. */
#define BUG_REPORT_URL "${BUG_REPORT_URL}" #define BUG_REPORT_URL "${BUG_REPORT_URL}"
@ -474,87 +480,9 @@
/* Define if we link Polly to the tools */ /* Define if we link Polly to the tools */
#cmakedefine LINK_POLLY_INTO_TOOLS #cmakedefine LINK_POLLY_INTO_TOOLS
/* Installation directory for binary executables */
#cmakedefine LLVM_BINDIR "${LLVM_BINDIR}"
/* Time at which LLVM was configured */
#cmakedefine LLVM_CONFIGTIME "${LLVM_CONFIGTIME}"
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
/* Target triple LLVM will generate code for by default */
#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
/* Installation directory for documentation */
#cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"
/* Define if threads enabled */
#cmakedefine01 LLVM_ENABLE_THREADS
/* Define if zlib compression is available */ /* Define if zlib compression is available */
#cmakedefine01 LLVM_ENABLE_ZLIB #cmakedefine01 LLVM_ENABLE_ZLIB
/* Installation directory for config files */
#cmakedefine LLVM_ETCDIR "${LLVM_ETCDIR}"
/* Has gcc/MSVC atomic intrinsics */
#cmakedefine01 LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
/* Installation directory for include files */
#cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"
/* Installation directory for .info files */
#cmakedefine LLVM_INFODIR "${LLVM_INFODIR}"
/* Installation directory for man pages */
#cmakedefine LLVM_MANDIR "${LLVM_MANDIR}"
/* LLVM architecture name for the native architecture, if available */
#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}
/* LLVM name for the native AsmParser init function, if available */
#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser
/* LLVM name for the native AsmPrinter init function, if available */
#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
/* LLVM name for the native Disassembler init function, if available */
#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
/* LLVM name for the native Target init function, if available */
#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
/* LLVM name for the native TargetInfo init function, if available */
#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
/* LLVM name for the native target MC init function, if available */
#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC
/* Define if this is Unixish platform */
#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX}
/* Define if this is Win32ish platform */
#cmakedefine LLVM_ON_WIN32 ${LLVM_ON_WIN32}
/* Installation prefix directory */
#cmakedefine LLVM_PREFIX "${LLVM_PREFIX}"
/* Define if we have the Intel JIT API runtime support library */
#cmakedefine LLVM_USE_INTEL_JITEVENTS 1
/* Define if we have the oprofile JIT-support library */
#cmakedefine LLVM_USE_OPROFILE 1
/* Major version of the LLVM API */
#cmakedefine LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR}
/* Minor version of the LLVM API */
#cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR}
/* Define if the OS needs help to load dependent libraries for dlopen(). */ /* Define if the OS needs help to load dependent libraries for dlopen(). */
#cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS} #cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS}
@ -635,7 +563,7 @@
/* Define to 1 if you have the `_chsize_s' function. */ /* Define to 1 if you have the `_chsize_s' function. */
#cmakedefine HAVE__CHSIZE_S ${HAVE__CHSIZE_S} #cmakedefine HAVE__CHSIZE_S ${HAVE__CHSIZE_S}
/* Added by Kevin -- Maximum path length */ /* Maximum path length */
#cmakedefine MAXPATHLEN ${MAXPATHLEN} #cmakedefine MAXPATHLEN ${MAXPATHLEN}
#endif #endif

View File

@ -3,6 +3,12 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
/* Exported configuration */
#include "llvm/Config/llvm-config.h"
/* Patch version of the LLVM API */
#undef LLVM_VERSION_PATCH
/* Bug report URL. */ /* Bug report URL. */
#undef BUG_REPORT_URL #undef BUG_REPORT_URL
@ -456,90 +462,9 @@
/* Linker version detected at compile time. */ /* Linker version detected at compile time. */
#undef HOST_LINK_VERSION #undef HOST_LINK_VERSION
/* Installation directory for binary executables */
#undef LLVM_BINDIR
/* Time at which LLVM was configured */
#undef LLVM_CONFIGTIME
/* Installation directory for data files */
#undef LLVM_DATADIR
/* Target triple LLVM will generate code for by default */
#undef LLVM_DEFAULT_TARGET_TRIPLE
/* Installation directory for documentation */
#undef LLVM_DOCSDIR
/* Define if threads enabled */
#undef LLVM_ENABLE_THREADS
/* Define if zlib is enabled */ /* Define if zlib is enabled */
#undef LLVM_ENABLE_ZLIB #undef LLVM_ENABLE_ZLIB
/* Installation directory for config files */
#undef LLVM_ETCDIR
/* Has gcc/MSVC atomic intrinsics */
#undef LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#undef LLVM_HOST_TRIPLE
/* Installation directory for include files */
#undef LLVM_INCLUDEDIR
/* Installation directory for .info files */
#undef LLVM_INFODIR
/* Installation directory for man pages */
#undef LLVM_MANDIR
/* LLVM architecture name for the native architecture, if available */
#undef LLVM_NATIVE_ARCH
/* LLVM name for the native AsmParser init function, if available */
#undef LLVM_NATIVE_ASMPARSER
/* LLVM name for the native AsmPrinter init function, if available */
#undef LLVM_NATIVE_ASMPRINTER
/* LLVM name for the native Disassembler init function, if available */
#undef LLVM_NATIVE_DISASSEMBLER
/* LLVM name for the native Target init function, if available */
#undef LLVM_NATIVE_TARGET
/* LLVM name for the native TargetInfo init function, if available */
#undef LLVM_NATIVE_TARGETINFO
/* LLVM name for the native target MC init function, if available */
#undef LLVM_NATIVE_TARGETMC
/* Define if this is Unixish platform */
#undef LLVM_ON_UNIX
/* Define if this is Win32ish platform */
#undef LLVM_ON_WIN32
/* Installation prefix directory */
#undef LLVM_PREFIX
/* Define if we have the Intel JIT API runtime support library */
#undef LLVM_USE_INTEL_JITEVENTS
/* Define if we have the oprofile JIT-support library */
#undef LLVM_USE_OPROFILE
/* Major version of the LLVM API */
#undef LLVM_VERSION_MAJOR
/* Minor version of the LLVM API */
#undef LLVM_VERSION_MINOR
/* Patch version of the LLVM API */
#undef LLVM_VERSION_PATCH
/* The shared library extension */ /* The shared library extension */
#undef LTDL_SHLIB_EXT #undef LTDL_SHLIB_EXT

View File

@ -1,4 +1,4 @@
/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ /*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/
/* */ /* */
/* The LLVM Compiler Infrastructure */ /* The LLVM Compiler Infrastructure */
/* */ /* */
@ -7,14 +7,12 @@
/* */ /* */
/*===----------------------------------------------------------------------===*/ /*===----------------------------------------------------------------------===*/
/* This file enumerates all of the llvm variables from configure so that /* This file enumerates variables from the LLVM configuration so that they
they can be in exported headers and won't override package specific can be in exported headers and won't override package specific directives.
directives. This is a C file so we can include it in the llvm-c headers. */ This is a C header that can be included in the llvm-c headers. */
/* To avoid multiple inclusions of these variables when we include the exported #ifndef LLVM_CONFIG_H
headers and config.h, conditionally include these. */ #define LLVM_CONFIG_H
/* TODO: This is a bit of a hack. */
#ifndef CONFIG_H
/* Installation directory for binary executables */ /* Installation directory for binary executables */
#cmakedefine LLVM_BINDIR "${LLVM_BINDIR}" #cmakedefine LLVM_BINDIR "${LLVM_BINDIR}"

View File

@ -1,4 +1,4 @@
/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ /*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/
/* */ /* */
/* The LLVM Compiler Infrastructure */ /* The LLVM Compiler Infrastructure */
/* */ /* */
@ -7,14 +7,12 @@
/* */ /* */
/*===----------------------------------------------------------------------===*/ /*===----------------------------------------------------------------------===*/
/* This file enumerates all of the llvm variables from configure so that /* This file enumerates variables from the LLVM configuration so that they
they can be in exported headers and won't override package specific can be in exported headers and won't override package specific directives.
directives. This is a C file so we can include it in the llvm-c headers. */ This is a C header that can be included in the llvm-c headers. */
/* To avoid multiple inclusions of these variables when we include the exported #ifndef LLVM_CONFIG_H
headers and config.h, conditionally include these. */ #define LLVM_CONFIG_H
/* TODO: This is a bit of a hack. */
#ifndef CONFIG_H
/* Installation directory for binary executables */ /* Installation directory for binary executables */
#undef LLVM_BINDIR #undef LLVM_BINDIR