Skip to content
Snippets Groups Projects
Commit c04b21d7 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Port back to linux

parent 59bf8bbb
Branches
Tags
No related merge requests found
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)
......
......@@ -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);
......
......@@ -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;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment