1## Makefile.am -- Process this file with automake to produce Makefile.in
2##
3##   Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
4##   Written by Gary V. Vaughan, 2003
5##
6##   NOTE: The canonical source of this file is maintained with the
7##   GNU Libtool package.  Report bugs to bug-libtool@gnu.org.
8##
9## GNU Libltdl is free software; you can redistribute it and/or
10## modify it under the terms of the GNU Lesser General Public
11## License as published by the Free Software Foundation; either
12## version 2 of the License, or (at your option) any later version.
13##
14## As a special exception to the GNU Lesser General Public License,
15## if you distribute this file as part of a program or library that
16## is built using GNU libtool, you may include this file under the
17## same distribution terms that you use for the rest of that program.
18##
19## GNU Libltdl is distributed in the hope that it will be useful,
20## but WITHOUT ANY WARRANTY; without even the implied warranty of
21## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22## GNU Lesser General Public License for more details.
23##
24## You should have received a copy of the GNU LesserGeneral Public
25## License along with GNU Libltdl; see the file COPYING.LIB.  If not, a
26## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27## or obtained by writing to the Free Software Foundation, Inc.,
28## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29#####
30
31ACLOCAL_AMFLAGS = -I m4
32AUTOMAKE_OPTIONS = foreign
33AM_CPPFLAGS =
34AM_LDFLAGS =
35BUILT_SOURCES =
36include_HEADERS =
37noinst_LTLIBRARIES =
38lib_LTLIBRARIES =
39EXTRA_LTLIBRARIES =
40EXTRA_DIST =
41CLEANFILES =
42MOSTLYCLEANFILES =
43
44# -I$(srcdir) is needed for user that built libltdl with a sub-Automake
45# (not as a sub-package!) using 'nostdinc':
46AM_CPPFLAGS	       += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \
47			  -DLTDL -I. -I$(srcdir) -Ilibltdl \
48			  -I$(srcdir)/libltdl -I$(srcdir)/libltdl
49AM_LDFLAGS	       += -no-undefined
50LTDL_VERSION_INFO	= -version-info 10:0:3
51
52noinst_LTLIBRARIES	+= $(LT_DLLOADERS)
53
54if INSTALL_LTDL
55ltdlincludedir		= $(includedir)/libltdl
56ltdlinclude_HEADERS	= libltdl/lt_system.h \
57			  libltdl/lt_error.h \
58			  libltdl/lt_dlloader.h
59include_HEADERS	       += ltdl.h
60lib_LTLIBRARIES	       += libltdl.la
61endif
62
63if CONVENIENCE_LTDL
64noinst_LTLIBRARIES     += libltdlc.la
65endif
66
67libltdl_la_SOURCES = libltdl/lt__alloc.h \
68			  libltdl/lt__dirent.h \
69			  libltdl/lt__glibc.h \
70			  libltdl/lt__private.h \
71			  libltdl/lt__strl.h \
72			  libltdl/lt_dlloader.h \
73			  libltdl/lt_error.h \
74	                  libltdl/lt_system.h \
75			  libltdl/slist.h \
76			  loaders/preopen.c \
77			  lt__alloc.c \
78			  lt_dlloader.c \
79			  lt_error.c \
80			  ltdl.c \
81			  ltdl.h \
82			  slist.c
83
84EXTRA_DIST	       += lt__dirent.c \
85			  lt__strl.c
86
87libltdl_la_CPPFLAGS	= -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS)
88libltdl_la_LDFLAGS	= $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN)
89libltdl_la_LIBADD	= $(LTLIBOBJS)
90libltdl_la_DEPENDENCIES	= $(LT_DLLOADERS) $(LTLIBOBJS)
91
92libltdlc_la_SOURCES	= $(libltdl_la_SOURCES)
93libltdlc_la_CPPFLAGS	= -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS)
94libltdlc_la_LDFLAGS	= $(AM_LDFLAGS) $(LT_DLPREOPEN)
95libltdlc_la_LIBADD	= $(libltdl_la_LIBADD)
96libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES)
97
98## The loaders are preopened by libltdl, itself always built from
99## pic-objects (either as a shared library, or a convenience library),
100## so the loaders themselves must be made from pic-objects too.  We
101## use convenience libraries for that purpose:
102EXTRA_LTLIBRARIES	       += dlopen.la \
103				  dld_link.la \
104				  dyld.la \
105				  load_add_on.la \
106				  loadlibrary.la \
107				  shl_load.la
108
109dlopen_la_SOURCES	= loaders/dlopen.c
110dlopen_la_LDFLAGS	= -module -avoid-version
111dlopen_la_LIBADD 	= $(LIBADD_DLOPEN)
112
113dld_link_la_SOURCES	= loaders/dld_link.c
114dld_link_la_LDFLAGS	= -module -avoid-version
115dld_link_la_LIBADD	= -ldld
116
117dyld_la_SOURCES		= loaders/dyld.c
118dyld_la_LDFLAGS		= -module -avoid-version
119
120load_add_on_la_SOURCES	= loaders/load_add_on.c
121load_add_on_la_LDFLAGS	= -module -avoid-version
122
123loadlibrary_la_SOURCES	= loaders/loadlibrary.c
124loadlibrary_la_LDFLAGS	= -module -avoid-version
125
126shl_load_la_SOURCES	= loaders/shl_load.c
127shl_load_la_LDFLAGS	= -module -avoid-version
128shl_load_la_LIBADD	= $(LIBADD_SHL_LOAD)
129
130## Make sure these will be cleaned even when they're not built by default:
131CLEANFILES		       += libltdl.la \
132				  libltdlc.la \
133				  libdlloader.la
134
135## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects
136## automatically:
137CLEANFILES	       += $(LIBOBJS) $(LTLIBOBJS)
138
139EXTRA_DIST	       += COPYING.LIB \
140			  configure.ac \
141			  Makefile.am \
142			  aclocal.m4 \
143			  Makefile.in \
144			  configure \
145			  config-h.in \
146			  README
147
148## --------------------------- ##
149## Gnulib Makefile.am snippets ##
150## --------------------------- ##
151
152BUILT_SOURCES	+= $(ARGZ_H)
153EXTRA_DIST	+= argz_.h \
154		   argz.c
155
156# We need the following in order to create an <argz.h> when the system
157# doesn't have one that works with the given compiler.
158all-local $(lib_OBJECTS): $(ARGZ_H)
159argz.h: argz_.h
160	$(mkinstalldirs) .
161	cp $(srcdir)/argz_.h $@-t
162	mv $@-t $@
163MOSTLYCLEANFILES += argz.h \
164		    argz.h-t
165