Skip to content

Commit 40a3473

Browse files
build: Fix #include "..." paths to get rid of further -I arguments
This simplifies building without a build system. This is in line with bitcoin-core#925; the paths fixed here were either forgotten there or only introduced later. This commit also makes the Makefile stricter so that further "wrong" #include paths will lead to build errors even in autotools builds. This belongs to bitcoin-core#929. Co-authored-by: Hennadii Stepanov <[email protected]>
1 parent 43756da commit 40a3473

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ endif
8787
endif
8888

8989
libsecp256k1_la_SOURCES = src/secp256k1.c
90-
libsecp256k1_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
90+
libsecp256k1_la_CPPFLAGS = $(SECP_INCLUDES)
9191
libsecp256k1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
9292
libsecp256k1_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
9393

@@ -112,7 +112,7 @@ TESTS =
112112
if USE_TESTS
113113
noinst_PROGRAMS += tests
114114
tests_SOURCES = src/tests.c
115-
tests_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
115+
tests_CPPFLAGS = $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
116116
if VALGRIND_ENABLED
117117
tests_CPPFLAGS += -DVALGRIND
118118
noinst_PROGRAMS += valgrind_ctime_test

src/modules/ecdh/bench_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef SECP256K1_MODULE_ECDH_BENCH_H
88
#define SECP256K1_MODULE_ECDH_BENCH_H
99

10-
#include "../include/secp256k1_ecdh.h"
10+
#include "../../../include/secp256k1_ecdh.h"
1111

1212
typedef struct {
1313
secp256k1_context *ctx;

src/modules/extrakeys/tests_exhaustive_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#ifndef SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
88
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
99

10-
#include "src/modules/extrakeys/main_impl.h"
1110
#include "../../../include/secp256k1_extrakeys.h"
11+
#include "main_impl.h"
1212

1313
static void test_exhaustive_extrakeys(const secp256k1_context *ctx, const secp256k1_ge* group) {
1414
secp256k1_keypair keypair[EXHAUSTIVE_TEST_ORDER - 1];

src/modules/recovery/bench_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef SECP256K1_MODULE_RECOVERY_BENCH_H
88
#define SECP256K1_MODULE_RECOVERY_BENCH_H
99

10-
#include "../include/secp256k1_recovery.h"
10+
#include "../../../include/secp256k1_recovery.h"
1111

1212
typedef struct {
1313
secp256k1_context *ctx;

src/modules/recovery/tests_exhaustive_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
88
#define SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
99

10-
#include "src/modules/recovery/main_impl.h"
10+
#include "main_impl.h"
1111
#include "../../../include/secp256k1_recovery.h"
1212

1313
void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {

src/modules/schnorrsig/tests_exhaustive_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
99

1010
#include "../../../include/secp256k1_schnorrsig.h"
11-
#include "src/modules/schnorrsig/main_impl.h"
11+
#include "main_impl.h"
1212

1313
static const unsigned char invalid_pubkey_bytes[][32] = {
1414
/* 0 */

src/tests_exhaustive.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,15 @@ void test_exhaustive_sign(const secp256k1_context *ctx, const secp256k1_ge *grou
342342
}
343343

344344
#ifdef ENABLE_MODULE_RECOVERY
345-
#include "src/modules/recovery/tests_exhaustive_impl.h"
345+
#include "modules/recovery/tests_exhaustive_impl.h"
346346
#endif
347347

348348
#ifdef ENABLE_MODULE_EXTRAKEYS
349-
#include "src/modules/extrakeys/tests_exhaustive_impl.h"
349+
#include "modules/extrakeys/tests_exhaustive_impl.h"
350350
#endif
351351

352352
#ifdef ENABLE_MODULE_SCHNORRSIG
353-
#include "src/modules/schnorrsig/tests_exhaustive_impl.h"
353+
#include "modules/schnorrsig/tests_exhaustive_impl.h"
354354
#endif
355355

356356
int main(int argc, char** argv) {

0 commit comments

Comments
 (0)