diff --git a/api/Makefile b/api/Makefile index b8f6584d5e6f52a0e930883862612aae06944823..a14f7356647d4cfcaececb8e9f721c7bfdb332f1 100644 --- a/api/Makefile +++ b/api/Makefile @@ -1,4 +1,5 @@ -TARGET = i586-mingw32msvc- +#TARGET = i586-mingw32msvc- +#LIBS = -lwsock32 -lws2_32 FLAGS = -Wall -Wmissing-declarations -O0 -g -m32 #FLAGS := $(FLAGS) -DEB_USE_DYNAMIC # deterministic untill table overflow (default) @@ -12,8 +13,6 @@ CXXFLAGS= $(FLAGS) CC = $(TARGET)gcc CXX = $(TARGET)g++ -LIBS = -lwsock32 -lws2_32 - GOALS = demo/sizes demo/eb-read demo/eb-write demo/eb-snoop test/loopback LIBRARY = etherbone.a OBJECTS = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SOURCES))) @@ -42,9 +41,9 @@ all: $(GOALS) $(LIBRARY) $(LIBRARY): $(OBJECTS) rm -f $@ - i586-mingw32msvc-g++ $(CXXFLAGS) -shared -Wl,--out-implib=libetherbone.dll.a -Wl,--output-def,etherbone.def -o $@ $^ $(LIBS) -# $(TARGET)ar rcs $@ $^ -# $(TARGET)ranlib $@ +# i586-mingw32msvc-g++ $(CXXFLAGS) -shared -Wl,--out-implib=libetherbone.dll.a -Wl,--output-def,etherbone.def -o $@ $^ $(LIBS) + $(TARGET)ar rcs $@ $^ + $(TARGET)ranlib $@ demo/%: demo/%.c $(LIBRARY) $(CC) $(CFLAGS) -o $@ $^ $(LIBS) diff --git a/api/transport/posix-ip.h b/api/transport/posix-ip.h index 8c8f83bca0775a6b4cacdd5277acdc9410e1c727..f831c1ce84ba2b3bd8101186c55136256c8db73b 100644 --- a/api/transport/posix-ip.h +++ b/api/transport/posix-ip.h @@ -28,6 +28,8 @@ #ifndef EB_POSIX_IP_H #define EB_POSIX_IP_H +#include "../etherbone.h" + #ifdef __WIN32 #define _WIN32_WINNT 0x0501 #define MSG_DONTWAIT 0 // !!! @@ -43,11 +45,10 @@ typedef SOCKET eb_posix_sock_t; #include <sys/time.h> #include <netinet/in.h> #include <netdb.h> +#include <unistd.h> typedef eb_descriptor_t eb_posix_sock_t; #endif -#include "../etherbone.h" - EB_PRIVATE void eb_posix_ip_close(eb_posix_sock_t sock); EB_PRIVATE eb_posix_sock_t eb_posix_ip_open(int type, int port); EB_PRIVATE socklen_t eb_posix_ip_resolve(const char* prefix, const char* address, int type, struct sockaddr_storage* out); diff --git a/api/transport/ssh.c b/api/transport/ssh.c index 05ede8f39898d7210123fa2d516ae8d14e018248..f190ed1e9ce27cdc863682b9b6ab47e2e3509e4d 100644 --- a/api/transport/ssh.c +++ b/api/transport/ssh.c @@ -35,6 +35,10 @@ #include <stdlib.h> #include <errno.h> +#ifndef __WIN32 +#include <unistd.h> +#endif + eb_status_t eb_ssh_open(struct eb_transport* transportp, int port) { /* noop */ return EB_OK;