diff options
| author | kinichiro <kinichiro.inoguchi@gmail.com> | 2016-04-07 15:08:12 +0900 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2016-04-09 12:06:40 -0500 |
| commit | 2510a5e6f98360bb7cd4a52ecf2274656fe75dcc (patch) | |
| tree | 4ae888795d7c741f0c01eed81c8581d33b39cd07 /apps/nc | |
| parent | 9a98de6c34d9fbb97f2619617c102691d6065a81 (diff) | |
| download | portable-2510a5e6f98360bb7cd4a52ecf2274656fe75dcc.tar.gz portable-2510a5e6f98360bb7cd4a52ecf2274656fe75dcc.tar.bz2 portable-2510a5e6f98360bb7cd4a52ecf2274656fe75dcc.zip | |
modify cmake to build nc
- modify structure of CMakeLists.txt under apps/
* move apps/CMakeLists.txt to apps/openssl/ since this is for openssl build
* create new apps/nc/CMakeLists.txt for nc build
* modify apps/CMakeLists.txt just add_subdirectory()
- add checking and compile of arc4random_uniform()
- add installing man files, openssl.1 and nc.1
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 |
