mirror of https://github.com/polistern/i2psam
[Anoncoin] Adding i2psam
parent
e2b1069a5f
commit
323d016db8
|
@ -0,0 +1 @@
|
|||
libi2psam.a
|
11
i2psam.cpp
11
i2psam.cpp
|
@ -4,17 +4,6 @@
|
|||
//--------------------------------------------------------------------------------------------------
|
||||
#include "i2psam.h"
|
||||
|
||||
#ifdef WIN32
|
||||
//#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#define FD_SETSIZE
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h> // for sockaddr_in
|
||||
#include <arpa/inet.h> // for ntohs and htons
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <string.h> // for memset
|
||||
|
|
24
i2psam.h
24
i2psam.h
|
@ -12,18 +12,15 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
//#ifdef WIN32
|
||||
////#define _WIN32_WINNT 0x0501
|
||||
//#define WIN32_LEAN_AND_MEAN 1
|
||||
//#define FD_SETSIZE
|
||||
//#include <winsock2.h>
|
||||
//#else
|
||||
//#include <sys/socket.h>
|
||||
//#include <netinet/in.h> // for sockaddr_in
|
||||
//#include <arpa/inet.h> // for ntohs and htons
|
||||
//#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#ifdef WIN32
|
||||
//#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h> // for sockaddr_in
|
||||
#include <arpa/inet.h> // for ntohs and htons
|
||||
#endif
|
||||
|
||||
// TODO: check a possible bug about cast -1 to SOCKET
|
||||
#define SAM_INVALID_SOCKET (-1)
|
||||
|
@ -236,9 +233,6 @@ public:
|
|||
const sockaddr_in& getAddress() const;
|
||||
|
||||
private:
|
||||
struct SocketImpl;
|
||||
std::auto_ptr<SocketImpl> impl_;
|
||||
|
||||
SOCKET socket_;
|
||||
sockaddr_in servAddr_;
|
||||
std::string SAMHost_;
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
####### Compiler, tools and options
|
||||
|
||||
CC = i586-mingw32msvc-gcc
|
||||
CXX = i586-mingw32msvc-g++
|
||||
CC = i686-w64-mingw32-gcc
|
||||
CXX = i686-w64-mingw32-g++
|
||||
DEFINES = -D_MT -DWIN32 -D_WINDOWS
|
||||
CFLAGS = -pipe -isystem /usr/i586-mingw32msvc/include/ -O2 -Wall -Wextra $(DEFINES)
|
||||
CFLAGS = -pipe -isystem /usr/i686-w64-mingw32/include/ -O2 -Wall -Wextra $(DEFINES)
|
||||
CXXFLAGS = -O2 -fexceptions -Wall -Wextra $(DEFINES)
|
||||
INCPATH = -I'../../dependencies/mingw32/qt/include' -I'../../dependencies/mingw32' -I'../../dependencies/mingw32/qt/include/ActiveQt' -I'../../dependencies/mingw32/qt/mkspecs/unsupported/win32-g++-cross'
|
||||
LIB = i586-mingw32msvc-ar -ru
|
||||
LIB = i686-w64-mingw32-ar -ru
|
||||
COPY = cp
|
||||
SED = sed
|
||||
COPY_FILE = $(COPY)
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
#############################################################################
|
||||
# Makefile for building: libi2psam
|
||||
# Generated by qmake (2.01a) (Qt 4.8.3) on: ?? ????. 10 02:43:02 2013
|
||||
# Project: i2psam.pro
|
||||
# Template: lib
|
||||
#############################################################################
|
||||
|
||||
####### Compiler, tools and options
|
||||
|
||||
CC = i686-w64-mingw32-gcc
|
||||
CXX = i686-w64-mingw32-g++
|
||||
DEFINES = -D_MT -DWIN32 -D_WINDOWS
|
||||
CFLAGS = -pipe -isystem /usr/i686-w64-mingw32/include/ -O2 -Wall -Wextra $(DEFINES)
|
||||
CXXFLAGS = -O2 -fexceptions -Wall -Wextra $(DEFINES)
|
||||
INCPATH = -I'../../dependencies/mingw32/qt/include' -I'../../dependencies/mingw32' -I'../../dependencies/mingw32/qt/include/ActiveQt' -I'../../dependencies/mingw32/qt/mkspecs/unsupported/win32-g++-cross'
|
||||
LIB = i686-w64-mingw32-ar -ru
|
||||
COPY = cp
|
||||
SED = sed
|
||||
COPY_FILE = $(COPY)
|
||||
COPY_DIR = cp -R
|
||||
DEL_FILE = rm -f
|
||||
DEL_DIR = rmdir
|
||||
MOVE = mv
|
||||
CHK_DIR_EXISTS= test -d
|
||||
MKDIR = mkdir -p
|
||||
INSTALL_FILE = $(COPY_FILE)
|
||||
INSTALL_PROGRAM = $(COPY_FILE)
|
||||
INSTALL_DIR = $(COPY_DIR)
|
||||
|
||||
####### Files
|
||||
|
||||
SOURCES = i2psam.cpp
|
||||
OBJECTS = i2psam.o
|
||||
TARGET = libi2psam.a
|
||||
|
||||
####### Implicit rules
|
||||
|
||||
.SUFFIXES: .cpp .cc .cxx .C .c
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
|
||||
|
||||
.cc.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
|
||||
|
||||
.cxx.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
|
||||
|
||||
.C.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
|
||||
|
||||
####### Build rules
|
||||
|
||||
first: all
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(LIB) $(TARGET) $(OBJECTS)
|
||||
|
||||
clean:
|
||||
-$(DEL_FILE) release/$(TARGET)
|
||||
-$(DEL_FILE) release/i2psam.o
|
||||
|
||||
distclean: clean
|
||||
-$(DEL_FILE) $(TARGET)
|
||||
|
||||
####### Compile
|
||||
|
||||
release/i2psam.o: i2psam.cpp i2psam.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/i2psam.o i2psam.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
FORCE:
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -m64 -pipe -O2 -fPIC -Wall -W -D_REENTRANT $(DEFINES)
|
||||
CXXFLAGS = -m64 -pipe -O2 -fPIC -Wall -W -D_REENTRANT $(DEFINES)
|
||||
CFLAGS = -pipe -O2 -fPIC -Wall -W -D_REENTRANT $(DEFINES)
|
||||
CXXFLAGS = -pipe -O2 -fPIC -Wall -W -D_REENTRANT $(DEFINES)
|
||||
AR = ar cqs
|
||||
RANLIB =
|
||||
TAR = tar -cf
|
||||
|
|
Loading…
Reference in New Issue