- Fixed a whole bunch of dependencies on defines between files, examples and tests
diff --git a/programs/hash/generic_sum.c b/programs/hash/generic_sum.c
index 2b0e7cc..04e1c04 100644
--- a/programs/hash/generic_sum.c
+++ b/programs/hash/generic_sum.c
@@ -30,8 +30,17 @@
#include <string.h>
#include <stdio.h>
+#include "polarssl/config.h"
+
#include "polarssl/md.h"
+#if !defined(POLARSSL_MD_C)
+int main( void )
+{
+ printf("POLARSSL_MD_C not defined.\n");
+ return( 0 );
+}
+#else
static int generic_wrapper( const md_info_t *md_info, char *filename, unsigned char *sum )
{
int ret = md_file( md_info, filename, sum );
@@ -201,3 +210,4 @@
return( ret );
}
+#endif /* POLARSSL_MD_C */
diff --git a/programs/hash/hello.c b/programs/hash/hello.c
index f9dc3f3..d40c695 100644
--- a/programs/hash/hello.c
+++ b/programs/hash/hello.c
@@ -29,8 +29,17 @@
#include <stdio.h>
+#include "polarssl/config.h"
+
#include "polarssl/md5.h"
+#if !defined(POLARSSL_MD5_C)
+int main( void )
+{
+ printf("POLARSSL_MD5_C not defined.\n");
+ return( 0 );
+}
+#else
int main( void )
{
int i;
@@ -53,3 +62,4 @@
return( 0 );
}
+#endif /* POLARSSL_MD5_C */
diff --git a/programs/hash/md5sum.c b/programs/hash/md5sum.c
index 2d72d99..fb7283c 100644
--- a/programs/hash/md5sum.c
+++ b/programs/hash/md5sum.c
@@ -30,8 +30,17 @@
#include <string.h>
#include <stdio.h>
+#include "polarssl/config.h"
+
#include "polarssl/md5.h"
+#if !defined(POLARSSL_MD5_C) || !defined(POLARSSL_FS_IO)
+int main( void )
+{
+ printf("POLARSSL_MD5_C and/or POLARSSL_FS_IO not defined.\n");
+ return( 0 );
+}
+#else
static int md5_wrapper( char *filename, unsigned char *sum )
{
int ret = md5_file( filename, sum );
@@ -159,3 +168,4 @@
return( ret );
}
+#endif /* POLARSSL_MD5_C && POLARSSL_FS_IO */
diff --git a/programs/hash/sha1sum.c b/programs/hash/sha1sum.c
index 03b7766..155bfbf 100644
--- a/programs/hash/sha1sum.c
+++ b/programs/hash/sha1sum.c
@@ -30,8 +30,17 @@
#include <string.h>
#include <stdio.h>
+#include "polarssl/config.h"
+
#include "polarssl/sha1.h"
+#if !defined(POLARSSL_SHA1_C) || !defined(POLARSSL_FS_IO)
+int main( void )
+{
+ printf("POLARSSL_SHA1_C and/or POLARSSL_FS_IO not defined.\n");
+ return( 0 );
+}
+#else
static int sha1_wrapper( char *filename, unsigned char *sum )
{
int ret = sha1_file( filename, sum );
@@ -159,3 +168,4 @@
return( ret );
}
+#endif /* POLARSSL_SHA1_C && POLARSSL_FS_IO */
diff --git a/programs/hash/sha2sum.c b/programs/hash/sha2sum.c
index b369295..52939e4 100644
--- a/programs/hash/sha2sum.c
+++ b/programs/hash/sha2sum.c
@@ -30,8 +30,17 @@
#include <string.h>
#include <stdio.h>
+#include "polarssl/config.h"
+
#include "polarssl/sha2.h"
+#if !defined(POLARSSL_SHA2_C) || !defined(POLARSSL_FS_IO)
+int main( void )
+{
+ printf("POLARSSL_SHA2_C and/or POLARSSL_FS_IO not defined.\n");
+ return( 0 );
+}
+#else
static int sha2_wrapper( char *filename, unsigned char *sum )
{
int ret = sha2_file( filename, sum, 0 );
@@ -159,3 +168,4 @@
return( ret );
}
+#endif /* POLARSSL_SHA2_C && POLARSSL_FS_IO */