From f24446d0c53585b595d00a1e2a2359a9fa75c4e4 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sun, 8 Aug 2010 02:44:17 +0000 Subject: [PATCH] Fix PR7809 by creating a header for just llvm variables that can be included in exported interfaces. Update a couple of exported interfaces. llvm-svn: 110532 --- llvm/autoconf/configure.ac | 2 +- llvm/include/llvm-c/Target.h | 36 +++++----- llvm/include/llvm/Config/llvm-config.h.in | 84 +++++++++++++++++++++++ llvm/include/llvm/Target/TargetSelect.h | 2 +- 4 files changed, 104 insertions(+), 20 deletions(-) create mode 100644 llvm/include/llvm/Config/llvm-config.h.in diff --git a/llvm/autoconf/configure.ac b/llvm/autoconf/configure.ac index 7745ab382166..5def41f84211 100644 --- a/llvm/autoconf/configure.ac +++ b/llvm/autoconf/configure.ac @@ -1580,7 +1580,7 @@ dnl WARNING: dnl If you add or remove any of the following config headers, then dnl you MUST also update Makefile.rules so that the variable FilesToConfig dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the dnl files can be updated automatically when their *.in sources change. -AC_CONFIG_HEADERS([include/llvm/Config/config.h]) +AC_CONFIG_HEADERS([include/llvm/Config/config.h include/llvm/Config/llvm-config.h]) AC_CONFIG_FILES([include/llvm/Config/Targets.def]) AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def]) AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def]) diff --git a/llvm/include/llvm-c/Target.h b/llvm/include/llvm-c/Target.h index b1b9f36fb2b9..29bd6fec9a4d 100644 --- a/llvm/include/llvm-c/Target.h +++ b/llvm/include/llvm-c/Target.h @@ -1,26 +1,26 @@ -/*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This header declares the C interface to libLLVMTarget.a, which *| -|* implements target information. *| -|* *| -|* Many exotic languages can interoperate with C code but have a harder time *| -|* with C++ due to name mangling. So in addition to C, this interface enables *| -|* tools written in such languages. *| -|* *| -\*===----------------------------------------------------------------------===*/ +/*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*/ +/* */ +/* The LLVM Compiler Infrastructure */ +/* */ +/* This file is distributed under the University of Illinois Open Source */ +/* License. See LICENSE.TXT for details. */ +/* */ +/*===----------------------------------------------------------------------===*/ +/* */ +/* This header declares the C interface to libLLVMTarget.a, which */ +/* implements target information. */ +/* */ +/* Many exotic languages can interoperate with C code but have a harder time */ +/* with C++ due to name mangling. So in addition to C, this interface enables */ +/* tools written in such languages. */ +/* */ +/*===----------------------------------------------------------------------===*/ #ifndef LLVM_C_TARGET_H #define LLVM_C_TARGET_H #include "llvm-c/Core.h" -#include "llvm/Config/config.h" +#include "llvm/Config/llvm-config.h" #ifdef __cplusplus extern "C" { diff --git a/llvm/include/llvm/Config/llvm-config.h.in b/llvm/include/llvm/Config/llvm-config.h.in new file mode 100644 index 000000000000..1557e272b853 --- /dev/null +++ b/llvm/include/llvm/Config/llvm-config.h.in @@ -0,0 +1,84 @@ +/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ +/* */ +/* The LLVM Compiler Infrastructure */ +/* */ +/* This file is distributed under the University of Illinois Open Source */ +/* License. See LICENSE.TXT for details. */ +/* */ +/*===----------------------------------------------------------------------===*/ + +/* This file enumerates all of the llvm variables from configure so that + they can be in exported headers and won't override package specific + directives. This is a C file so we can include it in the llvm-c headers. */ + +/* 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 + +/* Installation directory for documentation */ +#undef LLVM_DOCSDIR + +/* Installation directory for config files */ +#undef LLVM_ETCDIR + +/* Host triple we were built on */ +#undef LLVM_HOSTTRIPLE + +/* Installation directory for include files */ +#undef LLVM_INCLUDEDIR + +/* Installation directory for .info files */ +#undef LLVM_INFODIR + +/* Installation directory for libraries */ +#undef LLVM_LIBDIR + +/* Installation directory for man pages */ +#undef LLVM_MANDIR + +/* Build multithreading support into LLVM */ +#undef LLVM_MULTITHREADED + +/* LLVM architecture name for the native architecture, if available */ +#undef LLVM_NATIVE_ARCH + +/* Short LLVM architecture name for the native architecture, if available */ +#undef LLVM_NATIVE_ARCHNAME + +/* Define if this is Unixish platform */ +#undef LLVM_ON_UNIX + +/* Define if this is Win32ish platform */ +#undef LLVM_ON_WIN32 + +/* Define to path to circo program if found or 'echo circo' otherwise */ +#undef LLVM_PATH_CIRCO + +/* Define to path to dot program if found or 'echo dot' otherwise */ +#undef LLVM_PATH_DOT + +/* Define to path to dotty program if found or 'echo dotty' otherwise */ +#undef LLVM_PATH_DOTTY + +/* Define to path to fdp program if found or 'echo fdp' otherwise */ +#undef LLVM_PATH_FDP + +/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ +#undef LLVM_PATH_GRAPHVIZ + +/* Define to path to gv program if found or 'echo gv' otherwise */ +#undef LLVM_PATH_GV + +/* Define to path to neato program if found or 'echo neato' otherwise */ +#undef LLVM_PATH_NEATO + +/* Define to path to twopi program if found or 'echo twopi' otherwise */ +#undef LLVM_PATH_TWOPI + +/* Installation prefix directory */ +#undef LLVM_PREFIX diff --git a/llvm/include/llvm/Target/TargetSelect.h b/llvm/include/llvm/Target/TargetSelect.h index 3ade00dc8d49..ab6b62b74e6d 100644 --- a/llvm/include/llvm/Target/TargetSelect.h +++ b/llvm/include/llvm/Target/TargetSelect.h @@ -16,7 +16,7 @@ #ifndef LLVM_TARGET_TARGETSELECT_H #define LLVM_TARGET_TARGETSELECT_H -#include "llvm/Config/config.h" +#include "llvm/Config/llvm-config.h" extern "C" { // Declare all of the target-initialization functions that are available.