File tree Expand file tree Collapse file tree 8 files changed +30
-36
lines changed
utils/gn/secondary/llvm/include/llvm/Config Expand file tree Collapse file tree 8 files changed +30
-36
lines changed Original file line number Diff line number Diff line change @@ -133,17 +133,16 @@ check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD)
133
133
check_library_exists (execinfo backtrace "" COMPILER_RT_HAS_LIBEXECINFO )
134
134
135
135
# Look for terminfo library, used in unittests that depend on LLVMSupport.
136
- if (LLVM_ENABLE_TERMINFO )
137
- foreach (library terminfo tinfo curses ncurses ncursesw )
138
- string (TOUPPER ${library} library_suffix )
139
- check_library_exists (
140
- ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix} )
141
- if (COMPILER_RT_HAS_TERMINFO_${library_suffix} )
142
- set (COMPILER_RT_HAS_TERMINFO TRUE )
143
- set (COMPILER_RT_TERMINFO_LIB "${library} " )
144
- break ()
145
- endif ()
146
- endforeach ()
136
+ if (LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON )
137
+ set (MAYBE_REQUIRED REQUIRED )
138
+ else ()
139
+ set (MAYBE_REQUIRED )
140
+ endif ()
141
+ find_library (COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} )
142
+ if (COMPILER_RT_TERMINFO_LIB )
143
+ set (LLVM_ENABLE_TERMINFO 1 )
144
+ else ()
145
+ set (LLVM_ENABLE_TERMINFO 0 )
147
146
endif ()
148
147
149
148
if (ANDROID AND COMPILER_RT_HAS_LIBDL )
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ set(XRAY_UNITTEST_LINK_FLAGS
55
55
if (NOT APPLE )
56
56
# Needed by LLVMSupport.
57
57
append_list_if (
58
- COMPILER_RT_HAS_TERMINFO
58
+ LLVM_ENABLE_TERMINFO
59
59
-l${COMPILER_RT_TERMINFO_LIB} XRAY_UNITTEST_LINK_FLAGS )
60
60
61
61
if (COMPILER_RT_STANDALONE_BUILD )
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ set(LLDB_LIBEDIT_LIBS)
11
11
12
12
if (LLDB_ENABLE_CURSES )
13
13
list (APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES} ${PANEL_LIBRARIES} )
14
- if (LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO )
15
- list (APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS } )
14
+ if (LLVM_ENABLE_TERMINFO )
15
+ list (APPEND LLDB_CURSES_LIBS ${TERMINFO_LIB } )
16
16
endif ()
17
17
if (LLVM_BUILD_STATIC )
18
18
list (APPEND LLDB_CURSES_LIBS gpm )
Original file line number Diff line number Diff line change @@ -147,19 +147,16 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
147
147
else ()
148
148
set (HAVE_LIBEDIT 0 )
149
149
endif ()
150
- if (LLVM_ENABLE_TERMINFO )
151
- set (HAVE_TERMINFO 0 )
152
- foreach (library terminfo tinfo curses ncurses ncursesw )
153
- string (TOUPPER ${library} library_suffix )
154
- check_library_exists (${library} setupterm "" HAVE_TERMINFO_${library_suffix} )
155
- if (HAVE_TERMINFO_${library_suffix} )
156
- set (HAVE_TERMINFO 1 )
157
- set (TERMINFO_LIBS "${library} " )
158
- break ()
159
- endif ()
160
- endforeach ()
150
+ if (LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON )
151
+ set (MAYBE_REQUIRED REQUIRED )
152
+ else ()
153
+ set (MAYBE_REQUIRED )
154
+ endif ()
155
+ find_library (TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} )
156
+ if (TERMINFO_LIB )
157
+ set (LLVM_ENABLE_TERMINFO 1 )
161
158
else ()
162
- set (HAVE_TERMINFO 0 )
159
+ set (LLVM_ENABLE_TERMINFO 0 )
163
160
endif ()
164
161
165
162
find_library (ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c )
Original file line number Diff line number Diff line change 209
209
#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
210
210
211
211
/* Define if the setupterm () function is supported this platform. */
212
- #cmakedefine HAVE_TERMINFO ${HAVE_TERMINFO }
212
+ #cmakedefine LLVM_ENABLE_TERMINFO ${LLVM_ENABLE_TERMINFO }
213
213
214
214
/* Define if the xar_open () function is supported this platform. */
215
215
#cmakedefine HAVE_LIBXAR ${HAVE_LIBXAR}
Original file line number Diff line number Diff line change @@ -21,10 +21,8 @@ elseif( CMAKE_HOST_UNIX )
21
21
STRING (REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE} )
22
22
set (system_libs ${system_libs} ${Backtrace_LIBFILE} )
23
23
endif ()
24
- if (LLVM_ENABLE_TERMINFO )
25
- if (HAVE_TERMINFO )
26
- set (system_libs ${system_libs} ${TERMINFO_LIBS} )
27
- endif ()
24
+ if ( LLVM_ENABLE_TERMINFO )
25
+ set (system_libs ${system_libs} ${TERMINFO_LIB} )
28
26
endif ()
29
27
if ( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64 ) )
30
28
set (system_libs ${system_libs} atomic )
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ unsigned Process::StandardErrColumns() {
313
313
return getColumns ();
314
314
}
315
315
316
- #ifdef HAVE_TERMINFO
316
+ #ifdef LLVM_ENABLE_TERMINFO
317
317
// We manually declare these extern functions because finding the correct
318
318
// headers from various terminfo, curses, or other sources is harder than
319
319
// writing their specs down.
@@ -323,12 +323,12 @@ extern "C" int del_curterm(struct term *termp);
323
323
extern " C" int tigetnum (char *capname);
324
324
#endif
325
325
326
- #ifdef HAVE_TERMINFO
326
+ #ifdef LLVM_ENABLE_TERMINFO
327
327
static ManagedStatic<std::mutex> TermColorMutex;
328
328
#endif
329
329
330
330
static bool terminalHasColors (int fd) {
331
- #ifdef HAVE_TERMINFO
331
+ #ifdef LLVM_ENABLE_TERMINFO
332
332
// First, acquire a global lock because these C routines are thread hostile.
333
333
std::lock_guard<std::mutex> G (*TermColorMutex);
334
334
Original file line number Diff line number Diff line change @@ -284,9 +284,9 @@ write_cmake_config("config") {
284
284
}
285
285
286
286
if (llvm_enable_terminfo ) {
287
- values += [ " HAVE_TERMINFO =1" ]
287
+ values += [ " LLVM_ENABLE_TERMINFO =1" ]
288
288
} else {
289
- values += [ " HAVE_TERMINFO =" ]
289
+ values += [ " LLVM_ENABLE_TERMINFO =" ]
290
290
}
291
291
292
292
if (llvm_enable_dia_sdk ) {
You can’t perform that action at this time.
0 commit comments