This already exists in the CMake build, which is part of what makes
building clang separately from llvm via cmake possible. This cleans up
that discrepancy between the build systems.

I'll just add the minimal file include/clang/Config/config.h.in (with
the same contents as its config.h.cmake counterpart), then add it to
LLVM's configure script so it gets generated, then remove the #ifdef
logic from clang that was conditionally including the cmake generated
header.

Okay to commit?

Attachment: config.h.in
Description: Binary data

From 812e913d520bf3954a90a24eebe3a75564cf2d5e Mon Sep 17 00:00:00 2001
From: nobled <[email protected]>
Date: Mon, 30 Jan 2012 20:23:31 +0000
Subject: [PATCH 3/3] autoconf: add clang's private config header

The CMake build already generated one. Brings us one step closer
to compiling and configuring clang separately from LLVM
using the autoconf build, too.
---
 autoconf/configure.ac |    3 +++
 configure             |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index d01cea4..84a120b 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -1586,7 +1586,10 @@ AC_CONFIG_FILES([llvm.spec])
 
 dnl Configure doxygen's configuration file
 AC_CONFIG_FILES([docs/doxygen.cfg])
+
+dnl Configure clang, if present
 if test -f ${srcdir}/tools/clang/README.txt; then
+  AC_CONFIG_HEADERS([tools/clang/include/clang/Config/config.h])
   AC_CONFIG_FILES([tools/clang/docs/doxygen.cfg])
 fi
 
diff --git a/configure b/configure
index d0c3beb..c51abd8 100755
--- a/configure
+++ b/configure
@@ -21109,6 +21109,7 @@ ac_config_files="$ac_config_files llvm.spec"
 ac_config_files="$ac_config_files docs/doxygen.cfg"
 
 if test -f ${srcdir}/tools/clang/README.txt; then
+  ac_config_headers="$ac_config_headers tools/clang/include/clang/Config/config.h"
   ac_config_files="$ac_config_files tools/clang/docs/doxygen.cfg"
 
 fi
-- 
1.7.4.1

From ab55cf5cae79ed155c6d94f29750bc8d568c417c Mon Sep 17 00:00:00 2001
From: nobled <[email protected]>
Date: Mon, 30 Jan 2012 20:31:45 +0000
Subject: [PATCH] include clang's config.h unconditionally

And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too.

Also include the config.h header after all other headers, per
the LLVM coding standards.
---
 CMakeLists.txt                    |    2 +-
 lib/Driver/Driver.cpp             |    7 ++-----
 lib/Driver/ToolChains.cpp         |    6 +-----
 lib/Driver/WindowsToolChain.cpp   |    6 ++----
 lib/Frontend/InitHeaderSearch.cpp |    8 +++-----
 5 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25be7e1..3a1c12e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,7 +233,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
   PATTERN "*.inc"
   )
 
-add_definitions( -D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H )
+add_definitions( -D_GNU_SOURCE )
 
 # Clang version information
 set(CLANG_EXECUTABLE_VERSION
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 10e2fd9..06e51da 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifdef HAVE_CLANG_CONFIG_H
-# include "clang/Config/config.h"
-#endif
-
 #include "clang/Driver/Driver.h"
 
 #include "clang/Driver/Action.h"
@@ -27,7 +23,6 @@
 
 #include "clang/Basic/Version.h"
 
-#include "llvm/Config/config.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/ADT/OwningPtr.h"
@@ -43,6 +38,8 @@
 
 #include <map>
 
+#include "clang/Config/config.h"
+
 using namespace clang::driver;
 using namespace clang;
 
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 5737e17..c3ecbb0 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -9,10 +9,6 @@
 
 #include "ToolChains.h"
 
-#ifdef HAVE_CLANG_CONFIG_H
-# include "clang/Config/config.h"
-#endif
-
 #include "clang/Driver/Arg.h"
 #include "clang/Driver/ArgList.h"
 #include "clang/Driver/Compilation.h"
@@ -37,7 +33,7 @@
 
 #include <cstdlib> // ::getenv
 
-#include "llvm/Config/config.h" // for CXX_INCLUDE_ROOT
+#include "clang/Config/config.h"
 
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
diff --git a/lib/Driver/WindowsToolChain.cpp b/lib/Driver/WindowsToolChain.cpp
index 076dff9..18b0dd3 100644
--- a/lib/Driver/WindowsToolChain.cpp
+++ b/lib/Driver/WindowsToolChain.cpp
@@ -9,10 +9,6 @@
 
 #include "ToolChains.h"
 
-#ifdef HAVE_CLANG_CONFIG_H
-# include "clang/Config/config.h"
-#endif
-
 #include "clang/Driver/Arg.h"
 #include "clang/Driver/ArgList.h"
 #include "clang/Driver/Compilation.h"
@@ -31,6 +27,8 @@
   #include <Windows.h>
 #endif
 
+#include "clang/Config/config.h"
+
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
 using namespace clang;
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index e38ffb6..2736fd8 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -11,10 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifdef HAVE_CLANG_CONFIG_H
-# include "clang/Config/config.h"
-#endif
-
 #include "clang/Frontend/Utils.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/LangOptions.h"
@@ -29,7 +25,9 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Path.h"
-#include "llvm/Config/config.h"
+
+#include "clang/Config/config.h"
+
 using namespace clang;
 using namespace clang::frontend;
 
-- 
1.7.4.1

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to