diff options
Diffstat (limited to 'apps/nc')
-rw-r--r-- | apps/nc/CMakeLists.txt | 54 | ||||
-rw-r--r-- | apps/nc/Makefile.am | 1 |
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 @@ | |||
1 | if(BUILD_NC) | ||
2 | |||
3 | include_directories( | ||
4 | . | ||
5 | ./compat | ||
6 | ../../include | ||
7 | ../../include/compat | ||
8 | ) | ||
9 | |||
10 | set( | ||
11 | NC_SRC | ||
12 | atomicio.c | ||
13 | netcat.c | ||
14 | socks.c | ||
15 | compat/socket.c | ||
16 | ) | ||
17 | |||
18 | check_function_exists(b64_ntop HAVE_B64_NTOP) | ||
19 | if(HAVE_B64_NTOP) | ||
20 | add_definitions(-DHAVE_B64_NTOP) | ||
21 | else() | ||
22 | set(NC_SRC ${NC_SRC} compat/base64.c) | ||
23 | endif() | ||
24 | |||
25 | check_function_exists(accept4 HAVE_ACCEPT4) | ||
26 | if(HAVE_ACCEPT4) | ||
27 | add_definitions(-DHAVE_ACCEPT4) | ||
28 | else() | ||
29 | set(NC_SRC ${NC_SRC} compat/accept4.c) | ||
30 | endif() | ||
31 | |||
32 | check_function_exists(readpassphrase HAVE_READPASSPHRASE) | ||
33 | if(HAVE_READPASSPHRASE) | ||
34 | add_definitions(-DHAVE_READPASSPHRASE) | ||
35 | else() | ||
36 | set(NC_SRC ${NC_SRC} compat/readpassphrase.c) | ||
37 | endif() | ||
38 | |||
39 | check_function_exists(strtonum HAVE_STRTONUM) | ||
40 | if(HAVE_STRTONUM) | ||
41 | add_definitions(-DHAVE_STRTONUM) | ||
42 | else() | ||
43 | set(NC_SRC ${NC_SRC} compat/strtonum.c) | ||
44 | endif() | ||
45 | |||
46 | add_executable(nc ${NC_SRC}) | ||
47 | target_link_libraries(nc tls ${OPENSSL_LIBS}) | ||
48 | |||
49 | if(ENABLE_NC) | ||
50 | install(TARGETS nc DESTINATION bin) | ||
51 | install(FILES nc.1 DESTINATION share/man/man1) | ||
52 | endif() | ||
53 | |||
54 | endif() | ||
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 | |||
9 | endif | 9 | endif |
10 | 10 | ||
11 | EXTRA_DIST = nc.1 | 11 | EXTRA_DIST = nc.1 |
12 | EXTRA_DIST += CMakeLists.txt | ||
12 | 13 | ||
13 | nc_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) | 14 | nc_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) |
14 | nc_LDADD += $(top_builddir)/crypto/libcrypto.la | 15 | nc_LDADD += $(top_builddir)/crypto/libcrypto.la |