Try and figure out why the C Compiler thinks it needs to find iostream when the C++ library has already been compiled. Make the makefile aware of variables in the environment

This commit is contained in:
idk 2021-06-17 18:25:55 -04:00
parent 45ef6cba9d
commit 5013ce5649
No known key found for this signature in database
GPG Key ID: D75C03B39B5E14E1
2 changed files with 37 additions and 14 deletions

View File

@ -13,11 +13,11 @@ DAEMON_SRC_DIR := daemon
# import source files lists # import source files lists
include filelist.mk include filelist.mk
USE_AESNI := yes USE_AESNI := $(or $(USE_AESNI),yes)
USE_STATIC := no USE_STATIC := $(or $(USE_STATIC),no)
USE_MESHNET := no USE_MESHNET := $(or $(USE_MESHNET),no)
USE_UPNP := no USE_UPNP := $(or $(USE_UPNP),no)
DEBUG := yes DEBUG := $(or $(DEBUG),yes)
ifeq ($(DEBUG),yes) ifeq ($(DEBUG),yes)
CXX_DEBUG = -g CXX_DEBUG = -g
@ -82,13 +82,6 @@ api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT)
obj/%.o: %.cpp obj/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -c -o $@ $<
flags:
@echo $(CXXFLAGS)
@echo $(NEEDED_CXXFLAGS)
@echo $(INCFLAGS)
@echo $(LDFLAGS)
@echo $(LDLIBS)
# '-' is 'ignore if missing' on first run # '-' is 'ignore if missing' on first run
-include $(DEPS) -include $(DEPS)
@ -144,9 +137,23 @@ doxygen:
.PHONY: install .PHONY: install
.PHONY: strip .PHONY: strip
flags:
@echo $(CXXFLAGS)
@echo $(NEEDED_CXXFLAGS)
@echo $(INCFLAGS)
@echo $(LDFLAGS)
@echo $(LDLIBS)
@echo $(USE_AESNI)
@echo $(USE_STATIC)
@echo $(USE_MESHNET)
@echo $(USE_UPNP)
@echo $(DEBUG)
##TODO: delete this before a PR ##TODO: delete this before a PR
testc: api api_client testc: api api_client
# g++ -Ii18n -c test.c -o test.o # g++ -Ii18n -c test.c -o test.o
gcc -llibi2pd.so -c _test.c -o test.o # gcc -llibi2pd.so -c _test.c -o test.o
$(CC) -g -Wall -o test.o _test.c libi2pd.a
# gcc -o i2pd _test.c libi2pd.a -lstdc++ -llibi2pd -Llibi2pd
# gcc -Ii18n -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -llibi2pd.a -c test.c -o test.o # gcc -Ii18n -I/usr/include/c++/10 -I/usr/include/x86_64-linux-gnu/c++/10 -llibi2pd.a -c test.c -o test.o
g++ test.o libi2pd.so libi2pdclient.so -o test.main # g++ test.o libi2pd.so libi2pdclient.so -o test.main

16
libi2pd/api.swigcxx Normal file
View File

@ -0,0 +1,16 @@
// See swig.org for more inteface options,
// e.g. map std::string to Go string
%{
#include "api.h"
//#include "Streaming.h"
#include "Destination.h"
//#include "Identity.h"
//#include "Tag.h"
%}
%include "api.h"
//%include "Streaming.h"
//%include "Destination.h"
//%include "Identity.h"
//%include "Tag.h"