diff --git a/Makefile.am b/Makefile.am index 3406079c7..2445822f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,13 @@ EXTRA_PROGRAMS = CppUTestExtTests lib_LIBRARIES = lib/libCppUTest.a check_PROGRAMS = $(CPPUTEST_TESTS) +# HACK: Replace the HAVE_CONFIG_H macro with CPPUTEST_HAVE_GENERATED_CONFIG_H. +# The name HAVE_CONFIG_H is a hard-coded in autoconf and cannot be changed in +# any "normal" ways. This isn't typically a problem, but CppUTest exposes the +# macro in its public headers. This leads to collisions with any other projects +# built with autoconf. +DEFS = $(filter-out -DHAVE_CONFIG_H,@DEFS@) -DCPPUTEST_HAVE_GENERATED_CONFIG_H + if INCLUDE_CPPUTEST_EXT lib_LIBRARIES+= lib/libCppUTestExt.a check_PROGRAMS += $(CPPUTESTEXT_TESTS) diff --git a/include/CppUTest/CppUTestGeneratedConfig.h b/include/CppUTest/CppUTestGeneratedConfig.h index 5bcd53768..4ae6b6048 100644 --- a/include/CppUTest/CppUTestGeneratedConfig.h +++ b/include/CppUTest/CppUTestGeneratedConfig.h @@ -41,7 +41,7 @@ * */ -#ifdef HAVE_CONFIG_H +#ifdef CPPUTEST_HAVE_GENERATED_CONFIG_H #include "generated/CppUTestGeneratedConfig.h" #endif