Commit c3c8d859c309ed245b255d03937ac8e0cb98a425

Guillem Jover 2017-06-01T02:43:22

build: Drop GCC specific compiler flag -include Instead, explicitly include <config.h> in library and test source files for increased portability. Based-on-patch-by: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index 5fdcb8f..77f677f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
 AM_CPPFLAGS = \
+	-I$(top_builddir) \
 	-I$(top_srcdir)/include \
-	-include $(top_builddir)/config.h
+	$(nil)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = \
diff --git a/src/helper.c b/src/helper.c
index 5b16ec1..b0875bd 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -9,6 +9,8 @@
  * ----------------------------------------------------------------------------
  */
 
+#include <config.h>
+
 #include <sys/param.h>
 #include <sys/stat.h>
 
diff --git a/src/md2.c b/src/md2.c
index 20487f0..c3121c2 100644
--- a/src/md2.c
+++ b/src/md2.c
@@ -29,6 +29,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #if defined(LIBC_SCCS) && !defined(lint)
 __RCSID("$NetBSD: md2.c,v 1.7 2012/06/25 22:32:44 abs Exp $");
 #endif /* LIBC_SCCS and not lint */
diff --git a/src/md4.c b/src/md4.c
index cf32b29..25d4d95 100644
--- a/src/md4.c
+++ b/src/md4.c
@@ -18,6 +18,8 @@
  * will fill a supplied 16-byte array with the digest.
  */
 
+#include <config.h>
+
 #include <sys/types.h>
 #include <string.h>
 #include <md4.h>
diff --git a/src/md5.c b/src/md5.c
index 0fc118a..b3a0935 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -17,6 +17,8 @@
  * will fill a supplied 16-byte array with the digest.
  */
 
+#include <config.h>
+
 #include <sys/types.h>
 #include <string.h>
 #include <md5.h>
diff --git a/src/rmd160.c b/src/rmd160.c
index d68f2e4..3f13243 100644
--- a/src/rmd160.c
+++ b/src/rmd160.c
@@ -26,6 +26,9 @@
  * RSA Laboratories, CryptoBytes, Volume 3, Number 2, Autumn 1997,
  * ftp://ftp.rsasecurity.com/pub/cryptobytes/crypto3n2.pdf
  */
+
+#include <config.h>
+
 #include <string.h>
 #include <sys/types.h>
 #ifdef HAVE_SYS_ENDIAN_H
diff --git a/src/sha1.c b/src/sha1.c
index 9f69f15..19b9219 100644
--- a/src/sha1.c
+++ b/src/sha1.c
@@ -14,6 +14,8 @@
  *   34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
  */
 
+#include <config.h>
+
 #include <sys/param.h>
 #include <string.h>
 #include <sha1.h>
diff --git a/src/sha2.c b/src/sha2.c
index 029d0d4..24a68e7 100644
--- a/src/sha2.c
+++ b/src/sha2.c
@@ -34,6 +34,8 @@
  * $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $
  */
 
+#include <config.h>
+
 #include <sys/types.h>
 
 #include <string.h>
diff --git a/test/Makefile.am b/test/Makefile.am
index 8a4512e..136debc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
 AM_CPPFLAGS = \
-	-include $(top_builddir)/config.h \
 	-I$(top_builddir) \
 	-I$(top_srcdir)/include \
 	$(nil)
diff --git a/test/md2.c b/test/md2.c
index 01849e0..36ba9e4 100644
--- a/test/md2.c
+++ b/test/md2.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <md2.h>
 #include <string.h>
diff --git a/test/md4.c b/test/md4.c
index 177ed3d..e78077e 100644
--- a/test/md4.c
+++ b/test/md4.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <md4.h>
 #include <string.h>
diff --git a/test/md5.c b/test/md5.c
index 7fd3833..5dac6e1 100644
--- a/test/md5.c
+++ b/test/md5.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <md5.h>
 #include <string.h>
diff --git a/test/rmd160.c b/test/rmd160.c
index b4adbcf..b4dcd54 100644
--- a/test/rmd160.c
+++ b/test/rmd160.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <rmd160.h>
 #include <string.h>
diff --git a/test/sha1.c b/test/sha1.c
index 426af01..4cda990 100644
--- a/test/sha1.c
+++ b/test/sha1.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <sha1.h>
 #include <string.h>
diff --git a/test/sha2.c b/test/sha2.c
index 536dcb5..0cd274e 100644
--- a/test/sha2.c
+++ b/test/sha2.c
@@ -24,6 +24,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <assert.h>
 #include <sha2.h>
 #include <string.h>