[cfe-dev] [patch] add --enable-examples and produce docs/doxygen.cfg (was Re: Building Clang examples and running)

bruce.r.stephens at gmail.com bruce.r.stephens at gmail.com
Fri Jun 11 12:40:09 PDT 2010


configure also needs to be regenerated (but of course I have a different
version of autoconf, so the diffs aren't enlightening)

diff --git a/Makefile.config.in b/Makefile.config.in
index d073e9b..53fd943 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -340,3 +340,6 @@ NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
 # Flags supported by the linker.
 # bfd ld / gold --version-script=file
 HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
+
+# Whether to build the examples
+BUILD_EXAMPLES = @BUILD_EXAMPLES@
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 8ed3987..751cd57 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -886,6 +886,17 @@ else
    AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[]])
 fi
 
+dnl --enable-examples : should we build the examples?
+AC_ARG_ENABLE(examples,AS_HELP_STRING(
+--enable-examples,
+[Enable building of the examples (default is NO)]),,
+enableval=no)
+if test ${enableval} = "yes" ; then
+   AC_SUBST(BUILD_EXAMPLES,1)
+else
+   AC_SUBST(BUILD_EXAMPLES,[[]])
+fi
+
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 4: Check for programs we need and that they are the right version
@@ -1565,6 +1576,9 @@ AC_CONFIG_FILES([tools/llvmc/plugins/Base/Base.td])
 dnl Do the first stage of configuration for llvm-config.in.
 AC_CONFIG_FILES([tools/llvm-config/llvm-config.in])
 
+dnl doxygen configuration
+AC_CONFIG_FILES(docs/doxygen.cfg)
+
 dnl Do special configuration of Makefiles
 AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
 AC_CONFIG_MAKEFILE(Makefile)
@@ -1580,7 +1594,6 @@ AC_CONFIG_MAKEFILE(utils/Makefile)
 AC_CONFIG_MAKEFILE(projects/Makefile)
 AC_CONFIG_MAKEFILE(bindings/Makefile)
 AC_CONFIG_MAKEFILE(bindings/ocaml/Makefile.ocaml)
-AC_CONFIG_MAKEFILE(docs/doxygen.cfg)
 
 dnl Finally, crank out the output
 AC_OUTPUT



More information about the cfe-dev mailing list