aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
commitb4ed613595432ece6802d09bfabad18e09aa26f3 (patch)
treebd2db6b09b756624c1b2babdd12ea05a9dffcdaf /CMakeLists.txt
parent7cef6c685d23e4dcdf3f64b0b2ea92151e652db6 (diff)
downloadsrc-vendor/nvi.tar.gz
src-vendor/nvi.zip
Import nvi 2.2.0-05ed8b9vendor/nvi/2.2.0-05ed8b9vendor/nvi
This snapshot just brings a bunch of fixes in particular a fix for vi -w PR: 241985 Reported by: fernape
Notes
Notes: svn path=/vendor/nvi/dist/; revision=366307 svn path=/vendor/nvi/2.2.0-05ed8b9/; revision=366308; tag=vendor/nvi/2.2.0-05ed8b9
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 22 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00f43283f022..996e0e72de99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ project(nvi2 C)
include(CheckIncludeFiles)
include(CheckFunctionExists)
+include(CheckStructHasMember)
include(CheckCSourceCompiles)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
@@ -127,6 +128,7 @@ endif()
if(USE_WIDECHAR)
find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib)
+ find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib)
# link to the wchar_t awared BSD libregex.a
add_library(regex STATIC)
@@ -136,13 +138,14 @@ if(USE_WIDECHAR)
target_link_libraries(nvi PRIVATE regex)
else()
find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib)
+ find_library(TERMINFO_LIBRARY NAMES tinfo terminfo HINTS /usr/lib)
target_compile_options(nvi PRIVATE -Wno-pointer-sign)
endif()
-target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY})
+target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY})
if(USE_ICONV)
- check_function_exists(__iconv ICONV_IN_LIBC)
+ check_function_exists(iconv ICONV_IN_LIBC)
if(NOT ICONV_IN_LIBC)
find_path(ICONV_INCLUDE_DIR iconv.h)
find_library(ICONV_LIBRARY iconv)
@@ -173,9 +176,26 @@ if(USE_ICONV)
target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY})
endif()
+check_function_exists(getprogname GETPROGNAME_IN_LIBC)
+check_function_exists(strlcpy STRLCPY_IN_LIBC)
+if(NOT GETPROGNAME_IN_LIBC OR NOT STRLCPY_IN_LIBC)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(LIBBSD libbsd-overlay)
+ add_definitions(${LIBBSD_CFLAGS})
+ target_link_libraries(nvi PRIVATE ${LIBBSD_LIBRARIES})
+endif()
+
+check_function_exists(dbopen DBOPEN_IN_LIBC)
+if(NOT DBOPEN_IN_LIBC)
+ target_link_libraries(nvi PRIVATE db1)
+endif()
+
check_include_files(libutil.h HAVE_LIBUTIL_H)
check_include_files(ncurses.h HAVE_NCURSES_H)
+check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H)
+check_include_files(pty.h HAVE_PTY_H)
check_include_files(term.h HAVE_TERM_H)
+check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C)
configure_file(files/config.h.in config.h)