| 1 |
libcheck_files = files( |
| 2 |
'check.c', |
| 3 |
'check_error.c', |
| 4 |
'check_list.c', |
| 5 |
'check_log.c', |
| 6 |
'check_msg.c', |
| 7 |
'check_pack.c', |
| 8 |
'check_print.c', |
| 9 |
'check_run.c', |
| 10 |
'check_str.c', |
| 11 |
'libcompat/libcompat.c' |
| 12 |
) |
| 13 |
|
| 14 |
if not cdata.has('HAVE_ALARM') |
| 15 |
libcheck_files += ['libcompat/alarm.c'] |
| 16 |
endif |
| 17 |
|
| 18 |
if not cdata.has('HAVE_GETTIMEOFDAY') |
| 19 |
libcheck_files += ['libcompat/gettimeofday.c'] |
| 20 |
endif |
| 21 |
|
| 22 |
if not cdata.has('HAVE_CLOCK_GETTIME') |
| 23 |
libcheck_files += ['libcompat/clock_gettime.c'] |
| 24 |
endif |
| 25 |
|
| 26 |
if not cdata.has('HAVE_DECL_LOCALTIME_R') |
| 27 |
libcheck_files += ['libcompat/localtime_r.c'] |
| 28 |
endif |
| 29 |
|
| 30 |
if not cdata.has('HAVE_DECL_STRSIGNAL') |
| 31 |
libcheck_files += ['libcompat/strsignal.c'] |
| 32 |
endif |
| 33 |
|
| 34 |
if not cdata.has('HAVE_DECL_STRDUP') and not cdata.has('HAVE__STRDUP') |
| 35 |
libcheck_files += ['libcompat/strdup.c'] |
| 36 |
endif |
| 37 |
|
| 38 |
if not cdata.has('HAVE_GETLINE') |
| 39 |
libcheck_files += ['libcompat/getline.c'] |
| 40 |
endif |
| 41 |
|
| 42 |
# FIXME: check that timer_create, timer_settime, timer_delete are in rt_lib |
| 43 |
if not rt_lib.found() |
| 44 |
libcheck_files += files( |
| 45 |
'libcompat/timer_create.c', |
| 46 |
'libcompat/timer_settime.c', |
| 47 |
'libcompat/timer_delete.c' |
| 48 |
) |
| 49 |
endif |
| 50 |
|
| 51 |
configure_file(input : 'check.h.in', |
| 52 |
output : 'check.h', |
| 53 |
configuration : check_cdata) |
| 54 |
|
| 55 |
internal_check_h_inc = include_directories('..') |
| 56 |
|
| 57 |
# Must explicitly make symbols public if default visibility is hidden |
| 58 |
if host_system in ['windows', 'cygwin'] and not static_build |
| 59 |
libcheck_visibility_args = ['-DCK_DLL_EXP=extern __declspec(dllexport)'] |
| 60 |
elif have_visibility_hidden |
| 61 |
libcheck_visibility_args = ['-DCK_DLL_EXP=extern __attribute__ ((visibility ("default")))'] |
| 62 |
else |
| 63 |
libcheck_visibility_args = ['-DCK_DLL_EXP=extern'] |
| 64 |
endif |
| 65 |
|
| 66 |
no_warn_args = [] |
| 67 |
foreach arg : [ |
| 68 |
'-Wno-undef', |
| 69 |
'-Wno-redundant-decls', |
| 70 |
'-Wno-missing-prototypes', |
| 71 |
'-Wno-missing-declarations', |
| 72 |
'-Wno-old-style-definition', |
| 73 |
'-Wno-declaration-after-statement', |
| 74 |
'-Wno-format-nonliteral', |
| 75 |
'-Wno-tautological-constant-out-of-range-compare'] |
| 76 |
if cc.has_argument(arg) |
| 77 |
no_warn_args += [arg] |
| 78 |
endif |
| 79 |
endforeach |
| 80 |
|
| 81 |
libcheck = static_library('check', |
| 82 |
libcheck_files, |
| 83 |
include_directories : [configinc, internal_check_h_inc], |
| 84 |
dependencies : [rt_lib, mathlib, glib_dep], |
| 85 |
c_args: gst_c_args + libcheck_visibility_args + no_warn_args + |
| 86 |
# Don't want libcompat to think we don't have these and substitute |
| 87 |
# replacements since we don't check for or define these. See libcompat.h |
| 88 |
['-DHAVE_VSNPRINTF', '-DHAVE_SNPRINTF', '-DHAVE_MALLOC', '-DHAVE_REALLOC'], |
| 89 |
pic: true) |