[llvm-commits] [llvm] r110547 - in /llvm/trunk: autoconf/configure.ac include/llvm/Config/config.h.in include/llvm/Config/llvm-config.h.in

Eric Christopher echristo at apple.com
Sun Aug 8 02:18:29 PDT 2010


Author: echristo
Date: Sun Aug  8 04:18:29 2010
New Revision: 110547

URL: http://llvm.org/viewvc/llvm-project?rev=110547&view=rev
Log:
Add a bit of a hack to avoid multiple defines of variables in
config.h and llvm-config.h.  This could probably be improved.

Modified:
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/include/llvm/Config/llvm-config.h.in

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110547&r1=110546&r2=110547&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Sun Aug  8 04:18:29 2010
@@ -1581,6 +1581,10 @@
 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 include/llvm/Config/llvm-config.h])
+AH_TOP([#ifndef CONFIG_H
+#define CONFIG_H])
+AH_BOTTOM([#endif])
+
 AC_CONFIG_FILES([include/llvm/Config/Targets.def])
 AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
 AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def])

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=110547&r1=110546&r2=110547&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Sun Aug  8 04:18:29 2010
@@ -1,5 +1,8 @@
 /* include/llvm/Config/config.h.in.  Generated from autoconf/configure.ac by autoheader.  */
 
+#ifndef CONFIG_H
+#define CONFIG_H
+
 /* 32 bit multilib directory. */
 #undef CXX_INCLUDE_32BIT_DIR
 
@@ -607,3 +610,5 @@
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
+
+#endif

Modified: llvm/trunk/include/llvm/Config/llvm-config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/llvm-config.h.in?rev=110547&r1=110546&r2=110547&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/llvm-config.h.in (original)
+++ llvm/trunk/include/llvm/Config/llvm-config.h.in Sun Aug  8 04:18:29 2010
@@ -11,6 +11,11 @@
    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.  */
 
+/* To avoid multiple inclusions of these variables when we include the exported
+   headers and config.h, conditionally include these.  */
+/* TODO: This is a bit of a hack.  */
+#ifndef CONFIG_H
+
 /* Installation directory for binary executables */
 #undef LLVM_BINDIR
 
@@ -82,3 +87,5 @@
 
 /* Installation prefix directory */
 #undef LLVM_PREFIX
+
+#endif





More information about the llvm-commits mailing list