Check if config.h passed correctly via gcc -include
authorMartin Willi <martin@revosec.ch>
Wed, 4 Jul 2012 12:53:21 +0000 (14:53 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 11 Jul 2012 07:57:07 +0000 (09:57 +0200)
configure.in
src/libstrongswan/library.h

index 51ce46b..fc96929 100644 (file)
@@ -20,6 +20,7 @@ AC_INIT(strongSwan,5.0.0)
 AM_INIT_AUTOMAKE(tar-ustar)
 AC_CONFIG_MACRO_DIR([m4/config])
 AC_CONFIG_HEADERS([config.h])
+AC_DEFINE([CONFIG_H_INCLUDED], [], [defined if config.h included])
 PKG_PROG_PKG_CONFIG
 
 dnl =================================
index 7e76e19..d357ddf 100644 (file)
 #ifndef LIBRARY_H_
 #define LIBRARY_H_
 
+#ifndef CONFIG_H_INCLUDED
+# error config.h not included, pass "-include [...]/config.h" to gcc
+#endif
+
 #include "printf_hook.h"
 #include "utils.h"
 #include "chunk.h"