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