Index: llvm/trunk/tools/llvm-config/BuildVariables.inc.in =================================================================== --- llvm/trunk/tools/llvm-config/BuildVariables.inc.in +++ llvm/trunk/tools/llvm-config/BuildVariables.inc.in @@ -26,3 +26,4 @@ #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" +#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" Index: llvm/trunk/tools/llvm-config/CMakeLists.txt =================================================================== --- llvm/trunk/tools/llvm-config/CMakeLists.txt +++ llvm/trunk/tools/llvm-config/CMakeLists.txt @@ -24,6 +24,8 @@ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}") +set(LLVM_BUILD_SYSTEM cmake) + # Use the C++ link flags, since they should be a superset of C link flags. set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) Index: llvm/trunk/tools/llvm-config/Makefile =================================================================== --- llvm/trunk/tools/llvm-config/Makefile +++ llvm/trunk/tools/llvm-config/Makefile @@ -65,6 +65,8 @@ >> temp.sed $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \ >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_BUILD_SYSTEM@/autoconf/' \ + >> temp.sed $(Verb) $(SED) -f temp.sed < $< > $@ $(Verb) $(RM) temp.sed Index: llvm/trunk/tools/llvm-config/llvm-config.cpp =================================================================== --- llvm/trunk/tools/llvm-config/llvm-config.cpp +++ llvm/trunk/tools/llvm-config/llvm-config.cpp @@ -157,6 +157,7 @@ --host-target Target triple used to configure LLVM.\n\ --build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\ --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\ + --build-system Print the build system used to build LLVM (autoconf or cmake).\n\ Typical components:\n\ all All LLVM libraries (default).\n\ engine Either a native JIT or a bitcode interpreter.\n"; @@ -323,6 +324,8 @@ #else OS << "ON\n"; #endif + } else if (Arg == "--build-system") { + OS << LLVM_BUILD_SYSTEM << '\n'; } else if (Arg == "--obj-root") { OS << ActivePrefix << '\n'; } else if (Arg == "--src-root") {