libcheck: Update the compatibility code and checks
[platform/upstream/gstreamer.git] / libs / gst / check / libcheck / Makefile.am
1 noinst_LTLIBRARIES      = libcheckinternal.la
2
3 EXTRA_DIST = check.h.in
4
5 CFILES =\
6         check.c         \
7         check_error.c   \
8         check_list.c    \
9         check_log.c     \
10         check_msg.c     \
11         check_pack.c    \
12         check_print.c   \
13         check_run.c     \
14         check_str.c     \
15         libcompat/libcompat.c
16
17 if !HAVE_ALARM
18 CFILES += libcompat/alarm.c
19 endif
20
21 if !HAVE_CLOCK_GETTIME
22 CFILES += libcompat/clock_gettime.c
23 endif
24
25 if !HAVE_GETTIMEOFDAY
26 CFILES += libcompat/gettimeofday.c
27 endif
28
29 if !HAVE_LOCALTIME_R
30 CFILES += libcompat/localtime_r.c
31 endif
32
33 if !HAVE_MALLOC
34 CFILES += libcompat/malloc.c
35 endif
36
37 if !HAVE_REALLOC
38 CFILES += libcompat/realloc.c
39 endif
40
41 if !HAVE_STRSIGNAL
42 CFILES += libcompat/strsignal.c
43 endif
44
45 # If either vsnprintf or snprintf is unavailable
46 # XXX: Commented out because none of our supported platforms need it yet and the
47 #      check is a bit involved. No use slowing everyone down for this yet.
48 #if !HAVE_VSNPRINTF
49 #CFILES += libcompat/snprintf.c
50 #else
51 #if !HAVE_SNPRINTF
52 #CFILES += libcompat/snprintf.c
53 #endif
54 #endif
55
56 if !HAVE_STRDUP
57 CFILES += libcompat/strdup.c
58 endif
59
60 if !HAVE_GETLINE
61 CFILES += libcompat/getline.c
62 endif
63
64 if !HAVE_TIMER_CREATE_SETTIME_DELETE
65 CFILES +=\
66         libcompat/timer_create.c        \
67         libcompat/timer_settime.c       \
68         libcompat/timer_delete.c
69 endif
70
71 HFILES =\
72         check_error.h   \
73         check_impl.h    \
74         check_list.h    \
75         check_log.h     \
76         check_msg.h     \
77         check_pack.h    \
78         check_print.h   \
79         check_str.h     \
80         libcompat/libcompat.h
81
82 noinst_HEADERS = $(HFILES)
83
84 libcheckinternal_la_SOURCES     = $(CFILES) $(HFILES)
85
86 libcheckinternal_la_CFLAGS      = -I$(top_builddir)/libs/gst/check
87 libcheckinternal_la_LIBADD      =
88
89 # define HAVE_PTHREAD here as well so we keep changes to the code to a minimum
90 if HAVE_PTHREAD
91 libcheckinternal_la_CFLAGS      += $(PTHREAD_CFLAGS) -D_GNU_SOURCE -DHAVE_PTHREAD
92 libcheckinternal_la_LIBADD      += $(PTHREAD_LIBS)
93 else
94 libcheckinternal_la_CFLAGS      += -D_GNU_SOURCE
95 endif
96
97 # Don't want libcompat to think we don't have these and substitute replacements
98 # See the commented-out vsnprintf/snprintf CFILES stuff above
99 libcheckinternal_la_CFLAGS      += -DHAVE_SNPRINTF -DHAVE_VSNPRINTF