Make threads mandatory
[platform/upstream/glib.git] / gthread / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/Makefile.decl
3
4 SUBDIRS = . tests
5 DIST_SUBDIRS = tests
6
7 AM_CPPFLAGS =                           \
8         $(glib_INCLUDES)                \
9         -DG_LOG_DOMAIN=\"GThread\"      \
10         @GTHREAD_COMPILE_IMPL_DEFINES@  \
11         @GLIB_DEBUG_FLAGS@              \
12         -DG_DISABLE_DEPRECATED
13
14 EXTRA_DIST +=                           \
15                 makefile.msc.in         \
16                 gthread-posix.c         \
17                 gthread-win32.c         \
18                 gthread-none.c          \
19                 gthread.def             \
20                 gthread.rc.in
21
22 BUILT_EXTRA_DIST =                      \
23                 makefile.msc            \
24                 gthread.rc
25
26 libglib = $(top_builddir)/glib/libglib-2.0.la
27
28 top_builddir_full=`cd \$(top_builddir); pwd`
29
30 lib_LTLIBRARIES = libgthread-2.0.la
31
32 if OS_WIN32_AND_DLL_COMPILATION
33 if MS_LIB_AVAILABLE
34 noinst_DATA = gthread-2.0.lib
35
36 install_ms_lib_cmd = $(INSTALL) gthread-2.0.lib $(DESTDIR)$(libdir)
37 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gthread-2.0.lib
38 endif
39 endif
40
41 install-ms-lib:
42         $(install_ms_lib_cmd)
43
44 uninstall-ms-lib:
45         $(uninstall_ms_lib_cmd)
46
47 if PLATFORM_WIN32
48 no_undefined = -no-undefined
49 endif
50
51 if OS_WIN32_AND_DLL_COMPILATION
52 export_symbols = -export-symbols $(srcdir)/gthread.def
53 gthread_def = gthread.def
54
55 install-def-file:
56         $(INSTALL) $(srcdir)/gthread.def $(DESTDIR)$(libdir)/gthread-2.0.def
57
58 uninstall-def-file:
59         -rm $(DESTDIR)$(libdir)/gthread-2.0.def
60 else
61 install-def-file:
62 uninstall-def-file:
63 endif
64
65 if OS_WIN32_AND_DLL_COMPILATION
66 gthread_win32_res = gthread-win32-res.o
67 gthread_win32_res_ldflag = -Wl,$(gthread_win32_res)
68 endif
69
70 libgthread_2_0_la_SOURCES = gthread-impl.c
71 libgthread_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
72         $(gthread_win32_res_ldflag) \
73         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
74         -export-dynamic $(no_undefined) $(export_symbols)
75
76 libgthread_2_0_la_LIBADD = $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(libglib)
77
78 libgthread_2_0_la_DEPENDENCIES = $(gthread_win32_res) $(gthread_def)
79
80 gthread-win32-res.o: gthread.rc
81         $(AM_V_GEN) $(WINDRES) gthread.rc $@
82
83 gthread-2.0.lib: libgthread-2.0.la gthread.def
84         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gthread.def -out:$@
85
86 dist-hook: $(BUILT_EXTRA_DIST)
87         files='$(BUILT_EXTRA_DIST)'; \
88         for f in $$files; do \
89           if test -f $$f; then d=.; else d=$(srcdir); fi; \
90           cp $$d/$$f $(distdir) || exit 1; done
91
92 install-data-local: install-ms-lib install-def-file
93
94 uninstall-local: uninstall-ms-lib uninstall-def-file
95
96 if HAVE_GLIB_RUNTIME_LIBDIR
97 install-data-hook:
98         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
99         mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
100         mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
101         rm -f $(DESTDIR)$(libdir)/libgthread-2.0.so
102         ln -s $(GLIB_RUNTIME_LIBDIR)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgthread-2.0.so
103 endif