1# Makefile.am for the SASL library
2# Rob Earhart
3# $Id: Makefile.am,v 1.7 2006/01/24 20:37:08 snsimon Exp $
4# Copyright (c) 2000 Carnegie Mellon University.  All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer. 
12#
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in
15#    the documentation and/or other materials provided with the
16#    distribution.
17#
18# 3. The name "Carnegie Mellon University" must not be used to
19#    endorse or promote products derived from this software without
20#    prior written permission. For permission or any other legal
21#    details, please contact  
22#      Office of Technology Transfer
23#      Carnegie Mellon University
24#      5000 Forbes Avenue
25#      Pittsburgh, PA  15213-3890
26#      (412) 268-4387, fax: (412) 268-7395
27#      tech-transfer@andrew.cmu.edu
28#
29# 4. Redistributions of any form whatsoever must retain the following
30#    acknowledgment:
31#    "This product includes software developed by Computing Services
32#     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
33#
34# CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
35# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36# AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
37# FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
38# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
39# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
40# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
41#
42
43# Library version info - here at the top, for sanity
44sasl_version = 2:22:0
45
46INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/plugins -I$(top_builddir)/include -I$(top_srcdir)/sasldb
47
48EXTRA_DIST = windlopen.c staticopen.h NTMakefile
49EXTRA_LIBRARIES = libsasl2.a
50noinst_LIBRARIES = @SASL_STATIC_LIBS@
51libsasl2_a_SOURCES=
52
53common_headers = saslint.h
54common_sources = auxprop.c canonusr.c checkpw.c client.c common.c config.c external.c md5.c saslutil.c server.c seterror.c dlopen.c ../plugins/plugin_common.c
55
56LTLIBOBJS = @LTLIBOBJS@
57LIBOBJS = @LIBOBJS@
58LIB_DOOR= @LIB_DOOR@
59
60lib_LTLIBRARIES = libsasl2.la
61
62libsasl2_la_SOURCES = $(common_sources) $(common_headers)
63libsasl2_la_LDFLAGS = -version-info $(sasl_version)
64libsasl2_la_DEPENDENCIES = $(LTLIBOBJS)
65libsasl2_la_LIBADD = $(LTLIBOBJS) $(SASL_DL_LIB) $(LIB_SOCKET) $(LIB_DOOR)
66
67if MACOSX
68framedir = /Library/Frameworks/SASL2.framework
69install-exec-hook:
70	$(mkinstalldirs) $(framedir)/Versions/A
71	ln -fs $(libdir)/libsasl2.dylib $(framedir)/Versions/A/SASL2
72	cd $(framedir) ; ln -fs Versions/A/SASL2 .
73else
74install-exec-hook:
75endif
76
77libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
78	@echo adding static plugins and dependencies
79	$(AR) cru .libs/$@ $(SASL_STATIC_OBJS)
80	@for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \
81	if test ! -f $$i; then continue; fi; . $$i; \
82	for j in $$dependency_libs foo; do \
83	case $$j in foo) ;; \
84	-L*) for k in $$depdirs foo; do \
85	    if test $$k = $$j; then break; fi; done; \
86	  if test $$k = foo; then depdirs="$$depdirs $$j"; fi ;; \
87	-l*) for k in $$deplibs foo; do \
88	    if test $$k = $$j; then break; fi; done; \
89	  if test $$k = foo; then deplibs="$$deplibs $$j"; fi ;; \
90	esac; done; dependency_libs=""; done; \
91	sed -e "/^dependency_libs=/s%=.*%='$${depdirs}$${deplibs}'%" \
92	libsasl2.la >TMP.$$ && mv TMP.$$ libsasl2.la
93	rm -f $@
94	ln -s .libs/$@ $@
95
96$(SASL_STATIC_OBJS): linksrcs
97
98linksrcs:
99	-ln -s $(SASL_STATIC_SRCS) .
100
101