Revert "network: Android has vlc_getaddrinfo_i11e"
[vlc.git] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 EXTRA_DIST = \
9         vlc-plugin.pc.in \
10         libvlccore.sym \
11         revision.txt
12
13 BUILT_SOURCES = $(nodist_pluginsinclude_HEADERS)
14 CLEANFILES = $(BUILT_SOURCES)
15
16 SUFFIXES = .pc.in .pc .rc.in .rc
17
18 ###############################################################################
19 # Headers
20 ###############################################################################
21
22 pluginsincludedir = $(pkgincludedir)/plugins
23
24 pluginsinclude_HEADERS = \
25         ../include/vlc_access.h \
26         ../include/vlc_addons.h \
27         ../include/vlc_aout.h \
28         ../include/vlc_aout_volume.h \
29         ../include/vlc_arrays.h \
30         ../include/vlc_atomic.h \
31         ../include/vlc_avcodec.h \
32         ../include/vlc_bits.h \
33         ../include/vlc_block.h \
34         ../include/vlc_block_helper.h \
35         ../include/vlc_boxes.h \
36         ../include/vlc_charset.h \
37         ../include/vlc_codec.h \
38         ../include/vlc_common.h \
39         ../include/vlc_config.h \
40         ../include/vlc_config_cat.h \
41         ../include/vlc_configuration.h \
42         ../include/vlc_cpu.h \
43         ../include/vlc_dialog.h \
44         ../include/vlc_demux.h \
45         ../include/vlc_epg.h \
46         ../include/vlc_es.h \
47         ../include/vlc_es_out.h \
48         ../include/vlc_events.h \
49         ../include/vlc_filter.h \
50         ../include/vlc_fourcc.h \
51         ../include/vlc_fs.h \
52         ../include/vlc_gcrypt.h \
53         ../include/vlc_opengl.h \
54         ../include/vlc_http.h \
55         ../include/vlc_httpd.h \
56         ../include/vlc_image.h \
57         ../include/vlc_inhibit.h \
58         ../include/vlc_input.h \
59         ../include/vlc_input_item.h \
60         ../include/vlc_interface.h \
61         ../include/vlc_keys.h \
62         ../include/vlc_keystore.h \
63         ../include/vlc_main.h \
64         ../include/vlc_md5.h \
65         ../include/vlc_messages.h \
66         ../include/vlc_meta.h \
67         ../include/vlc_meta_fetcher.h \
68         ../include/vlc_media_library.h \
69         ../include/vlc_memstream.h \
70         ../include/vlc_mime.h \
71         ../include/vlc_modules.h \
72         ../include/vlc_mouse.h \
73         ../include/vlc_mtime.h \
74         ../include/vlc_network.h \
75         ../include/vlc_objects.h \
76         ../include/vlc_picture.h \
77         ../include/vlc_picture_fifo.h \
78         ../include/vlc_picture_pool.h \
79         ../include/vlc_playlist.h \
80         ../include/vlc_plugin.h \
81         ../include/vlc_probe.h \
82         ../include/vlc_rand.h \
83         ../include/vlc_services_discovery.h \
84         ../include/vlc_fingerprinter.h \
85         ../include/vlc_interrupt.h \
86         ../include/vlc_renderer_discovery.h \
87         ../include/vlc_sout.h \
88         ../include/vlc_spu.h \
89         ../include/vlc_stream.h \
90         ../include/vlc_strings.h \
91         ../include/vlc_subpicture.h \
92         ../include/vlc_text_style.h \
93         ../include/vlc_threads.h \
94         ../include/vlc_tls.h \
95         ../include/vlc_url.h \
96         ../include/vlc_variables.h \
97         ../include/vlc_vlm.h \
98         ../include/vlc_video_splitter.h \
99         ../include/vlc_vout.h \
100         ../include/vlc_vout_display.h \
101         ../include/vlc_vout_osd.h \
102         ../include/vlc_vout_window.h \
103         ../include/vlc_xml.h \
104         ../include/vlc_xlib.h \
105         $(NULL)
106 nodist_pluginsinclude_HEADERS = ../include/vlc_about.h
107
108 noinst_HEADERS = \
109         ../include/vlc_codec_synchro.h \
110         ../include/vlc_codecs.h \
111         ../include/vlc_extensions.h \
112         ../include/vlc_fixups.h \
113         ../include/vlc_intf_strings.h \
114         ../include/vlc_iso_lang.h \
115         ../include/vlc_memory.h \
116         ../include/vlc_pgpkey.h \
117         ../include/vlc_update.h \
118         ../include/vlc_vod.h \
119         ../include/vlc_vout_wrapper.h \
120         $(NULL)
121
122 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
123         $(AM_V_at)rm -f -- "$@.tmp"
124         $(AM_V_at)mkdir -p -- ../include
125         $(AM_V_GEN)(echo "/* Automatically generated file - DO NOT EDIT */" && \
126         echo "static const char psz_license[] =" && \
127         sed 's/"/\\"/g;s/^.*$$/\"&\\n\"/' "$(top_srcdir)/COPYING" && \
128         echo ";" && \
129         echo "static const char psz_thanks[] =" && \
130         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
131                 "$(top_srcdir)/THANKS" && \
132         echo ";" && \
133         echo "static const char psz_authors[] =" && \
134         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
135                 "$(top_srcdir)/AUTHORS" && \
136         echo ";") >> "$@.tmp"
137         $(AM_V_at)mv -f -- "$@.tmp" "$@"
138
139 ###############################################################################
140 # pkg-config integration
141 ###############################################################################
142
143 pkgconfigdir = $(libdir)/pkgconfig
144 pkgconfig_DATA = vlc-plugin.pc
145 CLEANFILES += $(pkgconfig_DATA)
146
147 .pc.in.pc: $(top_builddir)/config.status
148         $(AM_V_GEN)cd "$(top_builddir)" && \
149         $(SHELL) ./config.status --file="src/$@"
150
151 ##############################################################################
152 # Windows resource files
153 ##############################################################################
154
155 if HAVE_WIN32
156 noinst_DATA = libvlc_win32_rc.rc
157 endif
158 EXTRA_DIST += libvlc_win32_rc.rc.in
159
160 .rc.in.rc: $(top_builddir)/config.status
161         cd "$(top_builddir)" && \
162         $(SHELL) ./config.status --file="src/$@"
163
164 ###############################################################################
165 # Building libvlc
166 ###############################################################################
167
168 lib_LTLIBRARIES = libvlccore.la
169
170 AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
171         -DMODULE_STRING=\"core\" \
172         -DLOCALEDIR=\"$(localedir)\" \
173         -DPKGDATADIR=\"$(vlcdatadir)\" \
174         -DPKGLIBDIR=\"$(vlclibdir)\"
175 AM_CFLAGS = $(CFLAGS_libvlccore)
176 if HAVE_DYNAMIC_PLUGINS
177 AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
178 endif
179 if HAVE_DBUS
180 AM_CPPFLAGS += -DHAVE_DBUS
181 AM_CFLAGS += $(DBUS_CFLAGS)
182 endif
183
184 libvlccore_la_SOURCES = \
185         libvlc.c \
186         libvlc.h \
187         libvlc-module.c \
188         missing.c \
189         revision.c \
190         version.c \
191         config/configuration.h \
192         config/core.c \
193         config/chain.c \
194         config/file.c \
195         config/help.c \
196         config/intf.c \
197         config/keys.c \
198         config/cmdline.c \
199         config/getopt.c \
200         config/vlc_getopt.h \
201         extras/libc.c \
202         extras/tdestroy.c \
203         modules/modules.h \
204         modules/modules.c \
205         modules/bank.c \
206         modules/cache.c \
207         modules/entry.c \
208         modules/textdomain.c \
209         interface/dialog.c \
210         interface/interface.c \
211         playlist/playlist_internal.h \
212         playlist/art.c \
213         playlist/art.h \
214         playlist/aout.c \
215         playlist/thread.c \
216         playlist/control.c \
217         playlist/engine.c \
218         playlist/fetcher.c \
219         playlist/fetcher.h \
220         playlist/sort.c \
221         playlist/loadsave.c \
222         playlist/preparser.c \
223         playlist/preparser.h \
224         playlist/tree.c \
225         playlist/item.c \
226         playlist/search.c \
227         playlist/services_discovery.c \
228         input/item.c \
229         input/access.c \
230         input/clock.c \
231         input/control.c \
232         input/decoder.c \
233         input/decoder_synchro.c \
234         input/demux.c \
235         input/demux_chained.c \
236         input/es_out.c \
237         input/es_out_timeshift.c \
238         input/event.c \
239         input/input.c \
240         input/info.h \
241         input/meta.c \
242         input/clock.h \
243         input/decoder.h \
244         input/demux.h \
245         input/es_out.h \
246         input/es_out_timeshift.h \
247         input/event.h \
248         input/item.h \
249         input/stream.h \
250         input/input_internal.h \
251         input/input_interface.h \
252         input/vlm_internal.h \
253         input/vlm_event.h \
254         input/resource.h \
255         input/resource.c \
256         input/stats.c \
257         input/stream.c \
258         input/stream_fifo.c \
259         input/stream_filter.c \
260         input/stream_memory.c \
261         input/subtitles.c \
262         input/var.c \
263         audio_output/aout_internal.h \
264         audio_output/common.c \
265         audio_output/dec.c \
266         audio_output/filters.c \
267         audio_output/output.c \
268         audio_output/volume.c \
269         video_output/chrono.h \
270         video_output/control.c \
271         video_output/control.h \
272         video_output/display.c \
273         video_output/display.h \
274         video_output/event.h \
275         video_output/inhibit.c \
276         video_output/inhibit.h \
277         video_output/interlacing.c \
278         video_output/interlacing.h \
279         video_output/snapshot.c \
280         video_output/snapshot.h \
281         video_output/statistic.h \
282         video_output/video_output.c \
283         video_output/video_text.c \
284         video_output/video_epg.c \
285         video_output/video_widgets.c \
286         video_output/vout_subpictures.c \
287         video_output/window.c \
288         video_output/window.h \
289         video_output/opengl.c \
290         video_output/vout_intf.c \
291         video_output/vout_internal.h \
292         video_output/vout_control.h \
293         video_output/vout_wrapper.c \
294         network/getaddrinfo.c \
295         network/http_auth.c \
296         network/io.c \
297         network/tcp.c \
298         network/udp.c \
299         network/rootbind.c \
300         network/tls.c \
301         text/charset.c \
302         text/memstream.c \
303         text/strings.c \
304         text/unicode.c \
305         text/url.c \
306         text/filesystem.c \
307         text/iso_lang.c \
308         text/iso-639_def.h \
309         misc/md5.c \
310         misc/probe.c \
311         misc/rand.c \
312         misc/mtime.c \
313         misc/block.c \
314         misc/fifo.c \
315         misc/fourcc.c \
316         misc/fourcc_list.h \
317         misc/es_format.c \
318         misc/picture.c \
319         misc/picture.h \
320         misc/picture_fifo.c \
321         misc/picture_pool.c \
322         misc/interrupt.h \
323         misc/interrupt.c \
324         misc/keystore.c \
325         misc/renderer_discovery.c \
326         misc/threads.c \
327         misc/cpu.c \
328         misc/epg.c \
329         misc/exit.c \
330         misc/events.c \
331         misc/image.c \
332         misc/messages.c \
333         misc/mime.c \
334         misc/objects.c \
335         misc/variables.h \
336         misc/variables.c \
337         misc/error.c \
338         misc/update.h \
339         misc/update.c \
340         misc/update_crypto.c \
341         misc/xml.c \
342         misc/addons.c \
343         misc/filter.c \
344         misc/filter_chain.c \
345         misc/httpcookies.c \
346         misc/fingerprinter.c \
347         misc/text_style.c \
348         misc/subpicture.c \
349         misc/subpicture.h
350 libvlccore_la_LIBADD = $(LIBS_libvlccore) \
351         ../compat/libcompat.la \
352         $(LTLIBINTL) $(LTLIBICONV) \
353         $(IDN_LIBS) $(LIBPTHREAD) $(SOCKET_LIBS) $(LIBRT) $(LIBDL) $(LIBM)
354
355 if HAVE_WIN32
356 libvlccore_la_SOURCES += \
357         win32/dirs.c \
358         win32/error.c \
359         win32/filesystem.c \
360         win32/netconf.c \
361         win32/plugin.c \
362         win32/rand.c \
363         win32/specific.c \
364         win32/thread.c \
365         win32/winsock.c
366 if HAVE_WINSTORE
367 libvlccore_la_SOURCES += posix/timer.c
368 else
369 libvlccore_la_SOURCES += win32/timer.c
370 endif
371 else
372 if HAVE_OS2
373 libvlccore_la_SOURCES += \
374         os2/dirs.c \
375         darwin/error.c \
376         os2/filesystem.c \
377         os2/getaddrinfo.c \
378         os2/netconf.c \
379         os2/plugin.c \
380         os2/specific.c \
381         os2/rand.c \
382         os2/thread.c
383 else
384 libvlccore_la_SOURCES += \
385         posix/filesystem.c \
386         posix/plugin.c \
387         posix/rand.c \
388         posix/timer.c
389 if HAVE_ANDROID
390 libvlccore_la_SOURCES += \
391         android/error.c \
392         android/specific.c \
393         android/thread.c \
394         linux/cpu.c \
395         linux/dirs.c \
396         linux/thread.c
397 else
398 if HAVE_DARWIN
399 libvlccore_la_SOURCES += \
400         darwin/dirs.c \
401         darwin/error.c \
402         darwin/netconf.c \
403         darwin/specific.c \
404         darwin/thread.c
405 else
406 libvlccore_la_SOURCES += \
407         posix/dirs.c \
408         posix/error.c \
409         posix/netconf.c \
410         posix/specific.c \
411         posix/thread.c
412 if HAVE_LINUX
413 libvlccore_la_SOURCES += \
414         linux/cpu.c \
415         linux/dirs.c \
416         linux/getaddrinfo.c \
417         linux/thread.c
418 libvlccore_la_LIBADD += -lanl
419 else
420 libvlccore_la_SOURCES += \
421         posix/getaddrinfo.c
422 endif
423 endif
424 endif
425 endif
426 endif
427
428 if BUILD_HTTPD
429 libvlccore_la_SOURCES += network/httpd.c
430 endif
431
432 if ENABLE_SOUT
433 libvlccore_la_SOURCES += \
434         stream_output/sap.c stream_output/sdp.c \
435         stream_output/stream_output.c stream_output/stream_output.h
436 if ENABLE_VLM
437 libvlccore_la_SOURCES += input/vlm.c input/vlm_event.c input/vlmshell.c
438 endif
439 endif
440
441 libvlccore_la_LDFLAGS = \
442         $(LDFLAGS_libvlccore) \
443         -no-undefined \
444         -export-symbols $(srcdir)/libvlccore.sym \
445         -version-info 8:0:0
446 libvlccore_la_DEPENDENCIES = libvlccore.sym
447 if HAVE_WIN32
448 libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
449 libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version -Wc,-static
450 endif
451 if HAVE_OS2
452 libvlccore_la_LDFLAGS += -avoid-version
453 endif
454 if HAVE_DBUS
455 libvlccore_la_LIBADD += $(DBUS_LIBS)
456 endif
457
458 libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
459         $(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
460
461 # FourCC tables
462 BUILT_SOURCES += fourcc_tables.h
463 EXTRA_DIST += misc/fourcc_gen.c
464 MOSTLYCLEANFILES = fourcc_gen$(BUILDEXEEXT)
465
466 fourcc_gen$(BUILDEXEEXT): misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
467         $(AM_V_at)rm -f -- $@
468         $(AM_V_CC)$(BUILDCC) -I$(srcdir) -o $@ $<
469
470 fourcc_tables.h: fourcc_gen$(BUILDEXEEXT)
471         $(AM_V_at)rm -f -- $@.tmp
472         $(AM_V_GEN)$(builddir)/fourcc_gen > $@.tmp
473         $(AM_V_at)mv -f -- $@.tmp $@
474
475 # Unit/regression tests
476 #
477 check_PROGRAMS = \
478         test_block \
479         test_dictionary \
480         test_i18n_atof \
481         test_interrupt \
482         test_md5 \
483         test_picture_pool \
484         test_timer \
485         test_url \
486         test_utf8 \
487         test_xmlent \
488         test_headers
489
490 TESTS = $(check_PROGRAMS) check_symbols
491
492 test_block_SOURCES = test/block_test.c
493 test_block_LDADD = $(LDADD) $(LIBS_libvlccore)
494 test_block_DEPENDENCIES =
495
496 test_dictionary_SOURCES = test/dictionary.c
497 test_i18n_atof_SOURCES = test/i18n_atof.c
498 test_interrupt_SOURCES = test/interrupt.c
499 test_interrupt_LDADD = $(LDADD) $(LIBS_libvlccore) $(LIBPTHREAD)
500 test_md5_SOURCES = test/md5.c
501 test_picture_pool_SOURCES = test/picture_pool.c
502 test_timer_SOURCES = test/timer.c
503 test_url_SOURCES = test/url.c
504 test_utf8_SOURCES = test/utf8.c
505 test_xmlent_SOURCES = test/xmlent.c
506 test_headers_SOURCES = test/headers.c
507
508 AM_LDFLAGS = -no-install
509 LDADD = libvlccore.la \
510         ../compat/libcompat.la
511
512 ###############################################################################
513 # GIT revision
514 ###############################################################################
515
516 BUILT_SOURCES += stamp-revision
517 MAINTAINERCLEANFILES = $(srcdir)/revision.txt $(srcdir)/revision.c
518
519 $(srcdir)/revision.c: $(srcdir)/revision.txt
520         $(AM_V_at)rm -f -- $@
521         $(AM_V_GEN)echo "const char psz_vlc_changeset[] = \"$$(cat $<)\";" \
522                 > $@
523
524 $(srcdir)/revision.txt:
525         $(AM_V_at)$(MAKE) stamp-revision
526         $(AM_V_GEN)touch $@
527
528 stamp-revision:
529         $(AM_V_at)rm -f -- revision.tmp
530         $(AM_V_GEN)if ! git \
531                         --git-dir="$(top_srcdir)/.git/" describe \
532                         --tags --long --match '?.*.*' --always; then \
533                 cat $(srcdir)/revision.txt ; \
534         fi > revision.tmp
535         $(AM_V_at)if diff revision.tmp $(srcdir)/revision.txt >/dev/null 2>&1; then \
536                 rm -f -- revision.tmp; \
537         else \
538                 mv -f -- revision.tmp $(srcdir)/revision.txt; \
539         fi
540 #2>&1
541
542 ###############################################################################
543 # Unit/regression test
544 ###############################################################################
545
546 dist_check_SCRIPTS = check_headers check_symbols
547
548 check-local:
549         for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
550         do \
551                 echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
552                 if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
553                 then \
554                         echo "Header $$h not included in test/headers.c!"; \
555                         exit 1; \
556                 fi ; \
557         done
558         $(SHELL) $(srcdir)/check_headers $(pluginsinclude_HEADERS)
559
560 FORCE:
561         @echo "Generated source cannot be phony. Go away." >&2
562         @exit 1
563
564 .PHONY: FORCE