Skip to content

Commit

Permalink
build: do not install config.h
Browse files Browse the repository at this point in the history
'config.h' is meant to be a convenience header to be #included at build
time, but not installed. Installing it can cause a host of problems for
various other projects (for instance, attempting to build u-boot from
source while another project's 'config.h' exists in the compiler search
path will cause build failures similar to:
pepe2k/u-boot_mod#148

Further, I've changed '#include <config.h>' to '#include "config.h"',
which should constrain the search path to the current build directories,
so if another package with a bugged build has this file installed, it
will not cause yaml to miscompile/fail.

If you have a file `/usr/include/config.h` on your filesystem, query
your package manager to find out what package owns it, and file a bug
report against it with your distro maintainers.

Signed-off-by: Marty E. Plummer <[email protected]>
  • Loading branch information
hanetzer committed Jan 10, 2018
1 parent d050fe3 commit fa6904f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set(SRCS
src/writer.c
)

set(config_h ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
set(config_h ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
configure_file(
cmake/config.h.in
${config_h}
Expand Down Expand Up @@ -83,7 +83,6 @@ target_include_directories(yaml PUBLIC
install(
FILES
include/yaml.h
${config_h}
DESTINATION include COMPONENT Development
)

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ m4_define([YAML_AGE], 0)
AC_PREREQ(2.59)
AC_INIT([yaml], [YAML_MAJOR.YAML_MINOR.YAML_PATCH], [YAML_BUGS])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([src/config.h])
AM_INIT_AUTOMAKE([1.9 foreign])

# Define macro variables for the package version numbers.
Expand Down
2 changes: 1 addition & 1 deletion src/yaml_private.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#if HAVE_CONFIG_H
#include <config.h>
#include "config.h"
#endif

#include <yaml.h>
Expand Down

0 comments on commit fa6904f

Please sign in to comment.