]> git.lyx.org Git - lyx.git/blob - 3rdparty/libiconv/configure.cmake
upgrade boost to 1.75.0
[lyx.git] / 3rdparty / libiconv / configure.cmake
1 # Simulate autotools detection for config generation
2 # This insanity is needed for autotools infected packages
3
4 # Type checks
5 include ( CheckTypeSize )
6 check_type_size ( ptrdiff_t SIZEOF_PTRDIFF_T )
7 if ( SIZEOF_PTRDIFF_T )
8   math ( EXPR BITSIZEOF_PTRDIFF_T "${SIZEOF_PTRDIFF_T} * 8" )
9 endif ()
10
11 set ( CMAKE_EXTRA_INCLUDE_FILES signal.h )
12 check_type_size ( sig_atomic_t SIZEOF_SIG_ATOMIC_T )
13 if ( SIZEOF_SIG_ATOMIC_T )
14   math ( EXPR BITSIZEOF_SIG_ATOMIC_T "${SIZEOF_SIG_ATOMIC_T} * 8" )
15 endif ()
16
17 check_type_size ( size_t SIZEOF_SIZE_T )
18 if ( SIZEOF_SIZE_T )
19   math ( EXPR BITSIZEOF_SIZE_T "${SIZEOF_SIZE_T} * 8" )
20 endif ()
21
22 set ( CMAKE_EXTRA_INCLUDE_FILES wchar.h )
23 check_type_size ( wchar_t SIZEOF_WCHAR_T )
24 if ( SIZEOF_WCHAR_T )
25   set ( HAVE_WCHAR_T 1)
26   math ( EXPR BITSIZEOF_WCHAR_T "${SIZEOF_WCHAR_T} * 8" )
27 endif ()
28
29 check_type_size ( wint_t SIZEOF_WINT_T )
30 if ( SIZEOF_WINT_T )
31   math ( EXPR BITSIZEOF_WINT_T "${SIZEOF_WINT_T} * 8" )
32 endif ()
33
34 check_type_size ( "long long int" HAVE_LONG_LONG_INT )
35 check_type_size ( "unsigned long long int" HAVE_UNSIGNED_LONG_LONG_INT )
36 check_type_size ( _Bool HAVE__BOOL )
37
38 # Header checks
39 include ( CheckIncludeFiles )
40 check_include_files ( alloca.h HAVE_ALLOCA_H )
41 check_include_files ( dlfcn.h HAVE_DLFCN_H )
42 check_include_files ( inttypes.h HAVE_INTTYPES_H )
43 check_include_files ( mach-o/dyld.h HAVE_MACH_O_DYLD_H )
44 check_include_files ( memory.h HAVE_MEMORY_H )
45 check_include_files ( search.h HAVE_SEARCH_H )
46 check_include_files ( stdint.h HAVE_STDINT_H )
47 check_include_files ( stdlib.h HAVE_STDLIB_H )
48 check_include_files ( strings.h HAVE_STRINGS_H )
49 check_include_files ( string.h HAVE_STRING_H )
50 check_include_files ( sys/bitypes.h HAVE_SYS_BITYPES_H )
51 check_include_files ( sys/inttypes.h HAVE_SYS_INTTYPES_H )
52 check_include_files ( sys/param.h HAVE_SYS_PARAM_H )
53 check_include_files ( sys/socket.h HAVE_SYS_SOCKET_H )
54 check_include_files ( sys/stat.h HAVE_SYS_STAT_H )
55 check_include_files ( sys/time.h HAVE_SYS_TIME_H )
56 check_include_files ( sys/types.h HAVE_SYS_TYPES_H )
57 check_include_files ( unistd.h HAVE_UNISTD_H )
58 check_include_files ( wchar.h HAVE_WCHAR_H )
59 check_include_files ( winsock2.h HAVE_WINSOCK2_H )
60
61 # Function checks
62 include ( CheckFunctionExists )
63 check_function_exists ( canonicalize_file_name HAVE_CANONICALIZE_FILE_NAME )
64 check_function_exists ( dcgettext HAVE_DCGETTEXT )
65 check_function_exists ( gettext HAVE_GETTEXT )
66 check_function_exists ( iconv HAVE_ICONV )
67 check_function_exists ( lstat HAVE_LSTAT )
68 check_function_exists ( mbrtowc HAVE_MBRTOWC )
69 check_function_exists ( mbsinit HAVE_MBSINIT )
70 check_function_exists ( memmove HAVE_MEMMOVE )
71 check_function_exists ( atoll HAVE_RAW_DECL_ATOLL )
72 check_function_exists ( chown HAVE_RAW_DECL_CHOWN )
73 check_function_exists ( dprintf HAVE_RAW_DECL_DPRINTF )
74 check_function_exists ( dup2 HAVE_RAW_DECL_DUP2 )
75 check_function_exists ( dup3 HAVE_RAW_DECL_DUP3 )
76 check_function_exists ( endusershell HAVE_RAW_DECL_ENDUSERSHELL )
77 check_function_exists ( environ HAVE_RAW_DECL_ENVIRON )
78 check_function_exists ( euidaccess HAVE_RAW_DECL_EUIDACCESS )
79 check_function_exists ( faccessat HAVE_RAW_DECL_FACCESSAT )
80 check_function_exists ( fchdir HAVE_RAW_DECL_FCHDIR )
81 check_function_exists ( fchmodat HAVE_RAW_DECL_FCHMODAT )
82 check_function_exists ( fchownat HAVE_RAW_DECL_FCHOWNAT )
83 check_function_exists ( fcntl HAVE_RAW_DECL_FCNTL )
84 check_function_exists ( ffsl HAVE_RAW_DECL_FFSL )
85 check_function_exists ( ffsll HAVE_RAW_DECL_FFSLL )
86 check_function_exists ( fpurge HAVE_RAW_DECL_FPURGE )
87 check_function_exists ( fseeko HAVE_RAW_DECL_FSEEKO )
88 check_function_exists ( fstatat HAVE_RAW_DECL_FSTATAT )
89 check_function_exists ( fsync HAVE_RAW_DECL_FSYNC )
90 check_function_exists ( ftello HAVE_RAW_DECL_FTELLO )
91 check_function_exists ( ftruncate HAVE_RAW_DECL_FTRUNCATE )
92 check_function_exists ( futimens HAVE_RAW_DECL_FUTIMENS )
93 check_function_exists ( getcwd HAVE_RAW_DECL_GETCWD )
94 check_function_exists ( getdelim HAVE_RAW_DECL_GETDELIM )
95 check_function_exists ( getdomainname HAVE_RAW_DECL_GETDOMAINNAME )
96 check_function_exists ( canonicalize_file_name HAVE_RAW_DECL_CANONICALIZE_FILE_NAME )
97 check_function_exists ( getdtablesize HAVE_RAW_DECL_GETDTABLESIZE )
98 check_function_exists ( getgroups HAVE_RAW_DECL_GETGROUPS )
99 check_function_exists ( gethostname HAVE_RAW_DECL_GETHOSTNAME )
100 check_function_exists ( getline HAVE_RAW_DECL_GETLINE )
101 check_function_exists ( getloadavg HAVE_RAW_DECL_GETLOADAVG )
102 check_function_exists ( getlogin HAVE_RAW_DECL_GETLOGIN )
103 check_function_exists ( getlogin_r HAVE_RAW_DECL_GETLOGIN_R )
104 check_function_exists ( getpagesize HAVE_RAW_DECL_GETPAGESIZE )
105 check_function_exists ( getsubopt HAVE_RAW_DECL_GETSUBOPT )
106 check_function_exists ( getusershell HAVE_RAW_DECL_GETUSERSHELL )
107 check_function_exists ( grantpt HAVE_RAW_DECL_GRANTPT )
108 check_function_exists ( group_member HAVE_RAW_DECL_GROUP_MEMBER )
109 check_function_exists ( initstat_r HAVE_RAW_DECL_INITSTAT_R )
110 check_function_exists ( lchmod HAVE_RAW_DECL_LCHMOD )
111 check_function_exists ( lchown HAVE_RAW_DECL_LCHOWN )
112 check_function_exists ( link HAVE_RAW_DECL_LINK )
113 check_function_exists ( linkat HAVE_RAW_DECL_LINKAT )
114 check_function_exists ( lseek HAVE_RAW_DECL_LSEEK )
115 check_function_exists ( lstat HAVE_RAW_DECL_LSTAT )
116 check_function_exists ( memmem HAVE_RAW_DECL_MEMMEM )
117 check_function_exists ( mempcpy HAVE_RAW_DECL_MEMPCPY )
118 check_function_exists ( memrchr HAVE_RAW_DECL_MEMRCHR )
119 check_function_exists ( mkdirat HAVE_RAW_DECL_MKDIRAT )
120 check_function_exists ( mkdtemp HAVE_RAW_DECL_MKDTEMP )
121 check_function_exists ( mkfifo HAVE_RAW_DECL_MKFIFO )
122 check_function_exists ( mkfifoat HAVE_RAW_DECL_MKFIFOAT )
123 check_function_exists ( mknod HAVE_RAW_DECL_MKNOD )
124 check_function_exists ( mknodat HAVE_RAW_DECL_MKNODAT )
125 check_function_exists ( mkostemp HAVE_RAW_DECL_MKOSTEMP )
126 check_function_exists ( mkostemps HAVE_RAW_DECL_MKOSTEMPS )
127 check_function_exists ( openat HAVE_RAW_DECL_OPENAT )
128 check_function_exists ( pipe HAVE_RAW_DECL_PIPE )
129 check_function_exists ( pipe2 HAVE_RAW_DECL_PIPE2 )
130 check_function_exists ( popen HAVE_RAW_DECL_POPEN )
131 check_function_exists ( pread HAVE_RAW_DECL_PREAD )
132 check_function_exists ( pthread_sigmask HAVE_RAW_DECL_PTHREAD_SIGMASK )
133 check_function_exists ( ptsname HAVE_RAW_DECL_PTSNAME )
134 check_function_exists ( pwrite HAVE_RAW_DECL_PWRITE )
135 check_function_exists ( random_r HAVE_RAW_DECL_RANDOM_R )
136 check_function_exists ( rawmemchr HAVE_RAW_DECL_RAWMEMCHR )
137 check_function_exists ( readlink HAVE_RAW_DECL_READLINK )
138 check_function_exists ( readlinkat HAVE_RAW_DECL_READLINKAT )
139 check_function_exists ( realpath HAVE_RAW_DECL_REALPATH )
140 check_function_exists ( renameat HAVE_RAW_DECL_RENAMEAT )
141 check_function_exists ( rmdir HAVE_RAW_DECL_RMDIR )
142 check_function_exists ( rpmatch HAVE_RAW_DECL_RPMATCH )
143 check_function_exists ( setenv HAVE_RAW_DECL_SETENV )
144 check_function_exists ( setstate_r HAVE_RAW_DECL_SETSTATE_R )
145 check_function_exists ( setusershell HAVE_RAW_DECL_SETUSERSHELL )
146 check_function_exists ( sigaction HAVE_RAW_DECL_SIGACTION )
147 check_function_exists ( sigaddset HAVE_RAW_DECL_SIGADDSET )
148 check_function_exists ( sigdelset HAVE_RAW_DECL_SIGDELSET )
149 check_function_exists ( sigemptyset HAVE_RAW_DECL_SIGEMPTYSET )
150 check_function_exists ( sigfillset HAVE_RAW_DECL_SIGFILLSET )
151 check_function_exists ( sigismember HAVE_RAW_DECL_SIGISMEMBER )
152 check_function_exists ( sigpending HAVE_RAW_DECL_SIGPENDING )
153 check_function_exists ( sigprocmask HAVE_RAW_DECL_SIGPROCMASK )
154 check_function_exists ( sleep HAVE_RAW_DECL_SLEEP )
155 check_function_exists ( snprintf HAVE_RAW_DECL_SNPRINTF )
156 check_function_exists ( srandom_r HAVE_RAW_DECL_SRANDOM_R )
157 check_function_exists ( stat HAVE_RAW_DECL_STAT )
158 check_function_exists ( stpcpy HAVE_RAW_DECL_STPCPY )
159 check_function_exists ( stpncpy HAVE_RAW_DECL_STPNCPY )
160 check_function_exists ( strcasestr HAVE_RAW_DECL_STRCASESTR )
161 check_function_exists ( strchrnul HAVE_RAW_DECL_STRCHRNUL )
162 check_function_exists ( strdup HAVE_RAW_DECL_STRDUP )
163 check_function_exists ( strerror_r HAVE_RAW_DECL_STRERROR_R )
164 check_function_exists ( strncat HAVE_RAW_DECL_STRNCAT )
165 check_function_exists ( strndup HAVE_RAW_DECL_STRNDUP )
166 check_function_exists ( strnlen HAVE_RAW_DECL_STRNLEN )
167 check_function_exists ( strpbrk HAVE_RAW_DECL_STRSEP )
168 check_function_exists ( strsignal HAVE_RAW_DECL_STRSIGNAL )
169 check_function_exists ( strtod HAVE_RAW_DECL_STRTOD )
170 check_function_exists ( strtok_r HAVE_RAW_DECL_STRTOK_R )
171 check_function_exists ( strtoll HAVE_RAW_DECL_STRTOLL )
172 check_function_exists ( strtoull HAVE_RAW_DECL_STRTOULL )
173 check_function_exists ( strverscmp HAVE_RAW_DECL_STRVERSCMP )
174 check_function_exists ( symlink HAVE_RAW_DECL_SYMLINK )
175 check_function_exists ( symlinkat HAVE_RAW_DECL_SYMLINKAT )
176 check_function_exists ( tmpfile HAVE_RAW_DECL_TMPFILE )
177 check_function_exists ( ttyname_r HAVE_RAW_DECL_TTYNAME_R )
178 check_function_exists ( unlink HAVE_RAW_DECL_UNLINK )
179 check_function_exists ( unlinkat HAVE_RAW_DECL_UNLINKAT )
180 check_function_exists ( unlockpt HAVE_RAW_DECL_UNLOCKPT )
181 check_function_exists ( unsetenv HAVE_RAW_DECL_UNSETENV )
182 check_function_exists ( usleep HAVE_RAW_DECL_USLEEP )
183 check_function_exists ( utimensat HAVE_RAW_DECL_UTIMENSAT )
184 check_function_exists ( vdprintf HAVE_RAW_DECL_VDPRINTF )
185 check_function_exists ( vsnprintf HAVE_RAW_DECL_VSNPRINTF )
186 check_function_exists ( _Exit HAVE_RAW_DECL__EXIT )
187 check_function_exists ( readlink HAVE_READLINK )
188 check_function_exists ( readlinkat HAVE_READLINKAT )
189 check_function_exists ( realpath HAVE_REALPATH )
190 check_function_exists ( setenv HAVE_SETENV )
191 check_function_exists ( setlocale HAVE_SETLOCALE )
192 check_function_exists ( strerror_r HAVE_STRERROR_R )
193 check_function_exists ( tsearch HAVE_TSEARCH )
194 check_function_exists ( wcrtomb HAVE_WCRTOMB )
195 check_function_exists ( _NSGetExecutablePath HAVE__NSGETEXECUTABLEPATH )
196
197 # Symbols
198 include ( CheckSymbolExists )
199 check_symbol_exists ( alloca "alloca.h" HAVE_ALLOCA )
200 check_symbol_exists ( clearerr_unlocked "stdio.h" HAVE_DECL_CLEARERR_UNLOCKED )
201 check_symbol_exists ( feof_unlocked "stdio.h" HAVE_DECL_FEOF_UNLOCKED )
202 check_symbol_exists ( ferror_unlocked "stdio.h" HAVE_DECL_FERROR_UNLOCKED )
203 check_symbol_exists ( fflush_unlocked "stdio.h" HAVE_DECL_FFLUSH_UNLOCKED )
204 check_symbol_exists ( fgets_unlocked "stdio.h" HAVE_DECL_FGETS_UNLOCKED )
205 check_symbol_exists ( fputc_unlocked "stdio.h" HAVE_DECL_FPUTC_UNLOCKED )
206 check_symbol_exists ( fputs_unlocked "stdio.h" HAVE_DECL_FPUTS_UNLOCKED )
207 check_symbol_exists ( fread_unlocked "stdio.h" HAVE_DECL_FREAD_UNLOCKED )
208 check_symbol_exists ( fwrite_unlocked "stdio.h" HAVE_DECL_FWRITE_UNLOCKED )
209 check_symbol_exists ( getchar_unlocked "stdio.h" HAVE_DECL_GETCHAR_UNLOCKED )
210 check_symbol_exists ( getc_unlocked "stdio.h" HAVE_DECL_GETC_UNLOCKED )
211 check_symbol_exists ( program_invocation_name "stdio.h" HAVE_DECL_PROGRAM_INVOCATION_NAME )
212 check_symbol_exists ( program_invocation_short_name "stdio.h" HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME )
213 check_symbol_exists ( putchar_unlocked "stdio.h" HAVE_DECL_PUTCHAR_UNLOCKED )
214 check_symbol_exists ( putc_unlocked "stdio.h" HAVE_DECL_PUTC_UNLOCKED )
215 check_symbol_exists ( setenv "stdlib.h" HAVE_DECL_SETENV )
216 check_symbol_exists ( strerror_r "string.h" HAVE_DECL_STRERROR_R )
217 check_symbol_exists ( environ "unistd.h" HAVE_ENVIRON_DECL )
218 check_symbol_exists ( getcwd "unistd.h" HAVE_GETCWD )
219 check_symbol_exists ( getc_unlocked "stdio.h" HAVE_GETC_UNLOCKED )
220 check_symbol_exists ( nl_langinfo "langinfo.h" HAVE_LANGINFO_CODESET )
221 check_symbol_exists ( mbstate_t "wchar.h" HAVE_MBSTATE_T )
222
223 # Other
224 if ( APPLE )
225   set ( HAVE_CFLOCALECOPYCURRENT 1 )
226   set ( HAVE_CFPREFERENCESCOPYAPPVALUE 1 )
227   set ( HAVE__NSGETEXECUTABLEPATH 1 )
228 endif ()
229
230 # From dist.info
231 set ( PACKAGE "${DIST_NAME}" )
232 set ( PACKAGE_BUGREPORT "https://github.com/LuaDist/Repository/issues" )
233 set ( PACKAGE_NAME "${DIST_NAME}-${DIST_VERSION}" )
234 set ( PACKAGE_STRING "iconv" )
235 set ( PACKAGE_TARNAME "${DIST_NAME}-${DIST_VERSION}.dist" )
236 set ( PACKAGE_URL "${DIST_URL}" )
237 set ( PACKAGE_VERSION "${DIST_VERSION}" )
238
239 set ( INSTALLPREFIX "" )
240 set ( HAVE_SIGNED_WCHAR_T 1)
241 set ( HAVE_SIGNED_SIG_ATOMIC_T 1 )
242 set ( HAVE_SIGNED_WINT_T 1)
243 set ( HAVE_SIGSET_T )
244
245 if(MSVC)
246 set ( HAVE_VISIBILITY 0 )
247 else()
248 set ( HAVE_VISIBILITY 1 )
249 endif()
250 set ( ICONV_CONST "const" )
251 set ( INSTALLPREFIX "" )
252 set ( MALLOC_0_IS_NONNULL 1 )
253 set ( HAVE_WORKING_O_NOATIME 0 )
254 set ( HAVE_WORKING_O_NOFOLLOW 1 )
255 set ( LSTAT_FOLLOWS_SLASHED_SYMLINK 0 )
256 set ( PTRDIFF_T_SUFFIX l )
257 set ( READLINK_TRAILING_SLASH_BUG 1 )
258 set ( REPLACE_FUNC_STAT_DIR 0 )
259 set ( REPLACE_FUNC_STAT_FILE 1 )
260 set ( REPLACE_STRERROR_0 1 )
261 set ( SIG_ATOMIC_T_SUFFIX 1 )
262 set ( SIZE_T_SUFFIX ul )
263 set ( STDC_HEADERS 1 )
264 set ( STRERROR_R_CHAR_P 0 )
265 set ( USER_LABEL_PREFIX _ )
266 set ( USE_UNLOCKED_IO 1 )
267 set ( VERSION "${DIST_VERSION}" )
268 set ( WCHAR_T_SUFFIX "" )
269 set ( WINT_T_SUFFIX "" )
270 set ( WORDS_LITTLEENDIAN 1 )
271
272 # GNULIB settings
273 set ( GNULIB_CANONICALIZE_LGPL 1 )
274 set ( GNULIB_SIGPIPE 1 )
275 set ( GNULIB_STRERROR 1 )
276 set ( GNULIB_TEST_CANONICALIZE_FILE_NAME 1 )
277 set ( GNULIB_TEST_ENVIRON 1 )
278 set ( GNULIB_TEST_LSTAT 1 )
279 set ( GNULIB_TEST_READ 1 )
280 set ( GNULIB_TEST_READLINK 1 )
281 set ( GNULIB_TEST_REALPATH 1 )
282 set ( GNULIB_TEST_SIGPROCMASK 1 )
283 set ( GNULIB_TEST_STAT 1 )
284 set ( GNULIB_TEST_STRERROR 1 )