add libs
This commit is contained in:
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[submodule "lib/src/jsoncpp"]
|
||||
path = lib/src/jsoncpp
|
||||
url = https://github.com/open-source-parsers/jsoncpp.git
|
||||
[submodule "lib/src/libtins"]
|
||||
path = lib/src/libtins
|
||||
url = https://github.com/mfontanini/libtins.git
|
||||
2
dist/package/PKGBUILD
vendored
2
dist/package/PKGBUILD
vendored
@@ -5,7 +5,7 @@ pkgdesc="transparent one to one nat"
|
||||
arch=(any)
|
||||
url="http://www.foo.org"
|
||||
license=('MIT')
|
||||
depends=('pth' 'jsoncpp')
|
||||
depends=('pth' 'libpcap')
|
||||
makedepends=('cmake')
|
||||
source=(./$pkgname-$pkgver.tar.gz)
|
||||
md5sums=('0e1494ebbcf0b0ca1bfa8475c5078f21')
|
||||
|
||||
1
lib/.gitignore
vendored
Normal file
1
lib/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/bin/
|
||||
3
lib/buildalllibs.sh
Normal file
3
lib/buildalllibs.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
sh buildjsoncpp.sh
|
||||
sh buildlibtins.sh
|
||||
9
lib/buildjsoncpp.sh
Normal file
9
lib/buildjsoncpp.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
mkdir -p bin
|
||||
mkdir -p build/jsoncpp/
|
||||
cd build/jsoncpp/
|
||||
cmake ../../src/jsoncpp
|
||||
make
|
||||
cp src/lib_json/libjsoncpp.a ../../bin
|
||||
cd ../..
|
||||
rm -Rf build/jsoncpp
|
||||
9
lib/buildlibtins.sh
Normal file
9
lib/buildlibtins.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
mkdir -p bin
|
||||
mkdir -p build/libtins/
|
||||
cd build/libtins/
|
||||
cmake ../../src/libtins -DLIBTINS_BUILD_SHARED=0 -DLIBTINS_ENABLE_CXX11=1 -DLIBTINS_ENABLE_WPA2=0 -DLIBTINS_ENABLE_DOT11=0 -DHAVE_PCAP_IMMEDIATE_MODE=1
|
||||
make
|
||||
cp lib/libtins.so ../../bin
|
||||
cd ../..
|
||||
rm -Rf build/libtins
|
||||
1
lib/src/jsoncpp
Submodule
1
lib/src/jsoncpp
Submodule
Submodule lib/src/jsoncpp added at 9234cbbc90
1
lib/src/libtins
Submodule
1
lib/src/libtins
Submodule
Submodule lib/src/libtins added at 534bdaf30b
@@ -70,12 +70,14 @@ FFLAGS=
|
||||
ASFLAGS=
|
||||
|
||||
# Link Libraries and Options
|
||||
LDLIBSOPTIONS=-ltins -lpthread `pkg-config --libs jsoncpp`
|
||||
LDLIBSOPTIONS=-lpthread lib/bin/libjsoncpp.a -ltins
|
||||
|
||||
# Build Targets
|
||||
.build-conf: ${BUILD_SUBPROJECTS}
|
||||
"${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/121nat
|
||||
|
||||
${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/121nat: lib/bin/libjsoncpp.a
|
||||
|
||||
${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/121nat: ${OBJECTFILES}
|
||||
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
|
||||
${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/121nat ${OBJECTFILES} ${LDLIBSOPTIONS}
|
||||
@@ -83,27 +85,27 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/121nat: ${OBJECTFILES}
|
||||
${OBJECTDIR}/src/PduSender.o: src/PduSender.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/src
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSender.o src/PduSender.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSender.o src/PduSender.cpp
|
||||
|
||||
${OBJECTDIR}/src/PduSniffer.o: src/PduSniffer.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/src
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSniffer.o src/PduSniffer.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSniffer.o src/PduSniffer.cpp
|
||||
|
||||
${OBJECTDIR}/src/main.o: src/main.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/src
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main.o src/main.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main.o src/main.cpp
|
||||
|
||||
${OBJECTDIR}/src/map/NatRange.o: src/map/NatRange.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/src/map
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/NatRange.o src/map/NatRange.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/NatRange.o src/map/NatRange.cpp
|
||||
|
||||
${OBJECTDIR}/src/map/natmap.o: src/map/natmap.cpp
|
||||
${MKDIR} -p ${OBJECTDIR}/src/map
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/natmap.o src/map/natmap.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/natmap.o src/map/natmap.cpp
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
@@ -124,25 +126,25 @@ ${TESTDIR}/TestFiles/f1: ${TESTDIR}/tests/nattest.o ${TESTDIR}/tests/nattestrunn
|
||||
${TESTDIR}/tests/jsontest.o: tests/jsontest.cpp
|
||||
${MKDIR} -p ${TESTDIR}/tests
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/jsontest.o tests/jsontest.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/jsontest.o tests/jsontest.cpp
|
||||
|
||||
|
||||
${TESTDIR}/tests/jsontestrunner.o: tests/jsontestrunner.cpp
|
||||
${MKDIR} -p ${TESTDIR}/tests
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/jsontestrunner.o tests/jsontestrunner.cpp
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/jsontestrunner.o tests/jsontestrunner.cpp
|
||||
|
||||
|
||||
${TESTDIR}/tests/nattest.o: tests/nattest.cpp
|
||||
${MKDIR} -p ${TESTDIR}/tests
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall -I. `pkg-config --cflags jsoncpp` -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/nattest.o tests/nattest.cpp
|
||||
$(COMPILE.cc) -g -Wall -I. -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/nattest.o tests/nattest.cpp
|
||||
|
||||
|
||||
${TESTDIR}/tests/nattestrunner.o: tests/nattestrunner.cpp
|
||||
${MKDIR} -p ${TESTDIR}/tests
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.cc) -g -Wall -I. `pkg-config --cflags jsoncpp` -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/nattestrunner.o tests/nattestrunner.cpp
|
||||
$(COMPILE.cc) -g -Wall -I. -std=c++11 `cppunit-config --cflags` -MMD -MP -MF "$@.d" -o ${TESTDIR}/tests/nattestrunner.o tests/nattestrunner.cpp
|
||||
|
||||
|
||||
${OBJECTDIR}/src/PduSender_nomain.o: ${OBJECTDIR}/src/PduSender.o src/PduSender.cpp
|
||||
@@ -153,7 +155,7 @@ ${OBJECTDIR}/src/PduSender_nomain.o: ${OBJECTDIR}/src/PduSender.o src/PduSender.
|
||||
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
|
||||
then \
|
||||
${RM} "$@.d";\
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSender_nomain.o src/PduSender.cpp;\
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSender_nomain.o src/PduSender.cpp;\
|
||||
else \
|
||||
${CP} ${OBJECTDIR}/src/PduSender.o ${OBJECTDIR}/src/PduSender_nomain.o;\
|
||||
fi
|
||||
@@ -166,7 +168,7 @@ ${OBJECTDIR}/src/PduSniffer_nomain.o: ${OBJECTDIR}/src/PduSniffer.o src/PduSniff
|
||||
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
|
||||
then \
|
||||
${RM} "$@.d";\
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSniffer_nomain.o src/PduSniffer.cpp;\
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/PduSniffer_nomain.o src/PduSniffer.cpp;\
|
||||
else \
|
||||
${CP} ${OBJECTDIR}/src/PduSniffer.o ${OBJECTDIR}/src/PduSniffer_nomain.o;\
|
||||
fi
|
||||
@@ -179,7 +181,7 @@ ${OBJECTDIR}/src/main_nomain.o: ${OBJECTDIR}/src/main.o src/main.cpp
|
||||
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
|
||||
then \
|
||||
${RM} "$@.d";\
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main_nomain.o src/main.cpp;\
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/main_nomain.o src/main.cpp;\
|
||||
else \
|
||||
${CP} ${OBJECTDIR}/src/main.o ${OBJECTDIR}/src/main_nomain.o;\
|
||||
fi
|
||||
@@ -192,7 +194,7 @@ ${OBJECTDIR}/src/map/NatRange_nomain.o: ${OBJECTDIR}/src/map/NatRange.o src/map/
|
||||
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
|
||||
then \
|
||||
${RM} "$@.d";\
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/NatRange_nomain.o src/map/NatRange.cpp;\
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/NatRange_nomain.o src/map/NatRange.cpp;\
|
||||
else \
|
||||
${CP} ${OBJECTDIR}/src/map/NatRange.o ${OBJECTDIR}/src/map/NatRange_nomain.o;\
|
||||
fi
|
||||
@@ -205,7 +207,7 @@ ${OBJECTDIR}/src/map/natmap_nomain.o: ${OBJECTDIR}/src/map/natmap.o src/map/natm
|
||||
(echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \
|
||||
then \
|
||||
${RM} "$@.d";\
|
||||
$(COMPILE.cc) -g -Wall `pkg-config --cflags jsoncpp` -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/natmap_nomain.o src/map/natmap.cpp;\
|
||||
$(COMPILE.cc) -g -Wall -std=c++11 -Dmain=__nomain -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/src/map/natmap_nomain.o src/map/natmap.cpp;\
|
||||
else \
|
||||
${CP} ${OBJECTDIR}/src/map/natmap.o ${OBJECTDIR}/src/map/natmap_nomain.o;\
|
||||
fi
|
||||
|
||||
@@ -64,9 +64,9 @@
|
||||
</ccTool>
|
||||
<linkerTool>
|
||||
<linkerLibItems>
|
||||
<linkerLibLibItem>tins</linkerLibLibItem>
|
||||
<linkerLibLibItem>pthread</linkerLibLibItem>
|
||||
<linkerOptionItem>`pkg-config --libs jsoncpp`</linkerOptionItem>
|
||||
<linkerLibFileItem>lib/bin/libjsoncpp.a</linkerLibFileItem>
|
||||
<linkerLibLibItem>tins</linkerLibLibItem>
|
||||
</linkerLibItems>
|
||||
</linkerTool>
|
||||
</compileType>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
file(GLOB_RECURSE 121Nat_Src_Files "*.h" "*.cpp")
|
||||
add_executable(121Nat ${121Nat_Src_Files})
|
||||
target_link_libraries (121Nat tins pthread jsoncpp)
|
||||
target_link_libraries (121Nat pthread ${CMAKE_SOURCE_DIR}/lib/bin/libtins.so ${CMAKE_SOURCE_DIR}/lib/bin/libjsoncpp.a)
|
||||
target_compile_features(121Nat PRIVATE cxx_range_for)
|
||||
install(TARGETS 121Nat
|
||||
RUNTIME DESTINATION bin
|
||||
|
||||
Reference in New Issue
Block a user