1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
# Makefile for Linux nss_ldap using Netscape's Mozilla LDAP
# client library. We've used their thread wrappers in ltf.c
# and define LDAP_VERSION3_API, like we do with their C LDAP SDK.
#
# Copyright (C) 1997 Luke Howard.
# This file is part of the nss_ldap Library.
# The nss_ldap library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
# The nss_ldap Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
# You should have received a copy of the GNU Library General Public
# License along with the nss_ldap Library; see the file COPYING.LIB. If not,
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# $Id: Makefile.linux.openldap2,v 2.6 2000/08/28 13:08:05 lukeh Exp $
#
MODULE=nss_ldap
HDRS= \
ldap-alias.h \
ldap-ethers.h \
ldap-grp.h \
ldap-hosts.h \
ldap-netgrp.h \
ldap-network.h \
ldap-nss.h \
ldap-proto.h \
ldap-pwd.h \
ldap-rpc.h \
ldap-service.h \
ldap-spwd.h \
util.h \
globals.h \
ltf.h \
irs-nss.h \
ldap-parse.h \
snprintf.h \
resolve.h \
dnsconfig.h
SRCS= ldap-nss.c \
ldap-pwd.c \
ldap-grp.c \
ldap-rpc.c \
ldap-hosts.c \
ldap-network.c \
ldap-proto.c \
ldap-spwd.c \
ldap-alias.c \
ldap-service.c \
ldap-ethers.c \
ldap-bp.c \
util.c \
globals.c \
ltf.c \
snprintf.c \
resolve.c \
dnsconfig.c
OBJS=$(SRCS:.c=.o)
NSFLAGS=-I/usr/local/include -DLDAP_VERSION3_API -DRFC2307BIS
GNUFLAGS=-DGNU_NSS -DHAVE_SNPRINTF -D_REENTRANT
LIBCVERS= `ls /lib/libc-*.so | tail -1 |sed -e 's/\/lib\/libc-\(.*\)\.so/\1/'`
SOLIB=lib$(MODULE).so.$(NSSLIBVER)
NSSLIB=lib$(MODULE)-$(LIBCVERS).so
NSSLIBVER=$(shell ls /lib/libnss_files.so.? | tail -1 | sed -e 's/\/lib\/libnss_files\.so\.\(.*\)/\1/')
LIBDIRS=-L.
LIBS=-lldap -llber -lnsl -lpthread -lresolv -lsasl
GCCFLAGS=-O -g -Wall -fPIC
DEBUGFLAGS=
CC=gcc
COMPILERFLAGS=$(GCCFLAGS)
LD=gcc
GNULDFLAGS=-shared -Wl,-soname,$(SOLIB)
LDFLAGS=$(GNULDFLAGS)
CFLAGS=-DLDAP_REFERRALS $(DEBUGFLAGS) $(NSFLAGS) $(SUNFLAGS) $(BSDFLAGS) $(GNUFLAGS) $(COMPILERFLAGS) $(INCDIRS)
all: $(MODULE)
# This symlink is purely to keep RC happy.
$(MODULE): $(OBJS)
$(LD) $(LIBDIRS) $(LDFLAGS) -o $(NSSLIB) $(OBJS) $(LIBS)
-ln -sf $(NSSLIB) $(MODULE).so.1
install: install_lib install_conf
install_lib:
install -m 644 -o root -g root $(NSSLIB) /lib/$(NSSLIB)
ln -sf $(NSSLIB) /lib/$(SOLIB)
ln -sf /lib/$(NSSLIB) /usr/lib/$(MODULE).so
install_conf:
if [ ! -f /etc/nsswitch.ldap ]; then cp nsswitch.ldap /etc/nsswitch.ldap; fi
if [ ! -f /etc/ldap.conf ]; then cp ldap.conf /etc/ldap.conf; fi
clean:
rm -f $(OBJS) $(LIB) core
|