aboutsummaryrefslogtreecommitdiff
path: root/apps/nc
diff options
context:
space:
mode:
Diffstat (limited to 'apps/nc')
-rw-r--r--apps/nc/CMakeLists.txt54
-rw-r--r--apps/nc/Makefile.am1
2 files changed, 55 insertions, 0 deletions
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt
new file mode 100644
index 0000000..a218899
--- /dev/null
+++ b/apps/nc/CMakeLists.txt
@@ -0,0 +1,54 @@
1if(BUILD_NC)
2
3include_directories(
4 .
5 ./compat
6 ../../include
7 ../../include/compat
8)
9
10set(
11 NC_SRC
12 atomicio.c
13 netcat.c
14 socks.c
15 compat/socket.c
16)
17
18check_function_exists(b64_ntop HAVE_B64_NTOP)
19if(HAVE_B64_NTOP)
20 add_definitions(-DHAVE_B64_NTOP)
21else()
22 set(NC_SRC ${NC_SRC} compat/base64.c)
23endif()
24
25check_function_exists(accept4 HAVE_ACCEPT4)
26if(HAVE_ACCEPT4)
27 add_definitions(-DHAVE_ACCEPT4)
28else()
29 set(NC_SRC ${NC_SRC} compat/accept4.c)
30endif()
31
32check_function_exists(readpassphrase HAVE_READPASSPHRASE)
33if(HAVE_READPASSPHRASE)
34 add_definitions(-DHAVE_READPASSPHRASE)
35else()
36 set(NC_SRC ${NC_SRC} compat/readpassphrase.c)
37endif()
38
39check_function_exists(strtonum HAVE_STRTONUM)
40if(HAVE_STRTONUM)
41 add_definitions(-DHAVE_STRTONUM)
42else()
43 set(NC_SRC ${NC_SRC} compat/strtonum.c)
44endif()
45
46add_executable(nc ${NC_SRC})
47target_link_libraries(nc tls ${OPENSSL_LIBS})
48
49if(ENABLE_NC)
50 install(TARGETS nc DESTINATION bin)
51 install(FILES nc.1 DESTINATION share/man/man1)
52endif()
53
54endif()
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index 34c5cd3..ceb72b8 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -9,6 +9,7 @@ noinst_PROGRAMS = nc
9endif 9endif
10 10
11EXTRA_DIST = nc.1 11EXTRA_DIST = nc.1
12EXTRA_DIST += CMakeLists.txt
12 13
13nc_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) 14nc_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
14nc_LDADD += $(top_builddir)/crypto/libcrypto.la 15nc_LDADD += $(top_builddir)/crypto/libcrypto.la