lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

commit a4278ab4c97808e3817062cdd57e6f3ebbe258c3
parent fc030b7c032b9d3e862b3e79ea6327b05b77e501
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 22 Jan 2022 18:22:39 -0800

macos: fix build

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
M.gitignore | 2++
MMakefile | 12++++++------
Dconfig.h | 18------------------
Mrpc.c | 2++
4 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -4,6 +4,8 @@ /.direnv /tags *.o +/config.h +/configurator.out.dSYM /configurator /test TODO.bak diff --git a/Makefile b/Makefile @@ -6,7 +6,7 @@ SUBMODULES=deps/libsodium deps/secp256k1 ARS=deps/secp256k1/.libs/libsecp256k1.a deps/libsodium/src/libsodium/.libs/libsodium.a OBJS=sha256.o hkdf.o hmac.o sha512.o lnsocket.o error.o handshake.o crypto.o bigsize.o -DEPS=$(OBJS) config.h +DEPS=$(OBJS) $(ARS) config.h all: test lnrpc @@ -50,19 +50,19 @@ deps/libsodium/src/libsodium/.libs/libsodium.a: deps/libsodium/config.status cd deps/libsodium/src/libsodium; \ make -j2 libsodium.la -test: test.o $(DEPS) $(ARS) +test: test.o $(DEPS) @echo "ld test" - @$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + @$(CC) $(CFLAGS) test.o $(OBJS) $(ARS) $(LDFLAGS) -o $@ -lnrpc: rpc.o commando.o $(DEPS) $(ARS) +lnrpc: rpc.o commando.o $(DEPS) @echo "ld lnrpc" - @$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + @$(CC) $(CFLAGS) rpc.o commando.o $(OBJS) $(ARS) $(LDFLAGS) -o $@ tags: fake find . -name '*.c' -or -name '*.h' | xargs ctags clean: fake - rm -f test lnrpc $(DEPS) + rm -f test lnrpc config.h $(OBJS) deepclean: clean rm -f $(ARS) deps/secp256k1/src/libsecp256k1-config.h diff --git a/config.h b/config.h @@ -1,18 +0,0 @@ -/* Generated by CCAN configurator */ -#ifndef CCAN_CONFIG_H -#define CCAN_CONFIG_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE /* Always use GNU extensions. */ -#endif -#define CCAN_COMPILER "cc" -#define CCAN_CFLAGS "-g3 -ggdb -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition" -#define CCAN_OUTPUT_EXE_CFLAG "-o" - -#define HAVE_CCAN 1 -#define HAVE_UNALIGNED_ACCESS 1 -#define HAVE_TYPEOF 1 -#define HAVE_BIG_ENDIAN 0 -#define HAVE_BYTESWAP_H 1 -#define HAVE_BSWAP_64 1 -#define HAVE_LITTLE_ENDIAN 1 -#endif /* CCAN_CONFIG_H */ diff --git a/rpc.c b/rpc.c @@ -9,6 +9,8 @@ #include <stdio.h> #include <assert.h> +#include <sys/select.h> + int usage() { printf("lnrpc <nodeid> <ip/hostname> <method> <rune> [params (json string)]\n\n");