You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/09/20 12:04:56 UTC

[mynewt-core] 01/02: crypto/mbedtls: Fix build with alternative implementations

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4a862c4c7db023738d9ac6304ac92fcab5a2c2f2
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Tue Sep 19 11:26:56 2023 +0200

    crypto/mbedtls: Fix build with alternative implementations
    
    If _ALT implementation are used mbedtls failed to build due to missing
    include path.
---
 crypto/mbedtls/include/mbedtls/mbedtls_test.h | 32 ---------------------------
 crypto/mbedtls/pkg.yml                        |  1 +
 crypto/mbedtls/selftest/src/mbedtls_test.c    |  2 +-
 crypto/mbedtls/selftest/src/mbedtls_test.h    |  4 +---
 4 files changed, 3 insertions(+), 36 deletions(-)

diff --git a/crypto/mbedtls/include/mbedtls/mbedtls_test.h b/crypto/mbedtls/include/mbedtls/mbedtls_test.h
deleted file mode 100644
index 2c583f9f8..000000000
--- a/crypto/mbedtls/include/mbedtls/mbedtls_test.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef _MBEDTLS_TEST_H_
-#define _MBEDTLS_TEST_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-TEST_SUITE_DECL(mbedtls_test_all);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/crypto/mbedtls/pkg.yml b/crypto/mbedtls/pkg.yml
index 4eb6fe3b8..0363f46c4 100644
--- a/crypto/mbedtls/pkg.yml
+++ b/crypto/mbedtls/pkg.yml
@@ -33,6 +33,7 @@ pkg.cflags.TEST: -DTEST
 
 pkg.include_dirs:
     - "include"
+    - "include/mbedtls"
     - "@mbedtls/include"
     - "@mbedtls/library"
 
diff --git a/crypto/mbedtls/selftest/src/mbedtls_test.c b/crypto/mbedtls/selftest/src/mbedtls_test.c
index a8941cc3c..f746cc866 100644
--- a/crypto/mbedtls/selftest/src/mbedtls_test.c
+++ b/crypto/mbedtls/selftest/src/mbedtls_test.c
@@ -22,7 +22,7 @@
 #include "os/mynewt.h"
 #include "testutil/testutil.h"
 
-#include "mbedtls/mbedtls_test.h"
+#include "mbedtls_test.h"
 #include "mbedtls/sha1.h"
 #include "mbedtls/sha256.h"
 #include "mbedtls/sha512.h"
diff --git a/crypto/mbedtls/selftest/src/mbedtls_test.h b/crypto/mbedtls/selftest/src/mbedtls_test.h
index f0ffc7a83..0d1c75140 100644
--- a/crypto/mbedtls/selftest/src/mbedtls_test.h
+++ b/crypto/mbedtls/selftest/src/mbedtls_test.h
@@ -24,8 +24,6 @@
 #include "os/mynewt.h"
 #include "testutil/testutil.h"
 
-#include "mbedtls/mbedtls_test.h"
-
 #include "mbedtls/aes.h"
 #include "mbedtls/arc4.h"
 #include "mbedtls/aria.h"
@@ -63,7 +61,7 @@
 extern "C" {
 #endif
 
-/* This space intentionally left blank */
+TEST_SUITE_DECL(mbedtls_test_all);
 
 #ifdef __cplusplus
 }