Blame nscd/Makefile

Packit 6c4009
# Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
# The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
# modify it under the terms of the GNU Lesser General Public
Packit 6c4009
# License as published by the Free Software Foundation; either
Packit 6c4009
# version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
# The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
# Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
# You should have received a copy of the GNU Lesser General Public
Packit 6c4009
# License along with the GNU C Library; if not, see
Packit 6c4009
# <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
#
Packit 6c4009
#	Sub-makefile for nscd portion of the library.
Packit 6c4009
#
Packit 6c4009
subdir	:= nscd
Packit 6c4009
Packit 6c4009
include ../Makeconfig
Packit 6c4009
Packit 6c4009
ifneq ($(use-nscd),no)
Packit 6c4009
routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
Packit 6c4009
	    nscd_initgroups nscd_getserv_r nscd_netgroup
Packit 6c4009
aux	:= nscd_helper
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
# To find xmalloc.c
Packit 6c4009
vpath %.c ../locale/programs
Packit 6c4009
Packit 6c4009
nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
Packit 6c4009
		getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm3_r \
Packit 6c4009
		getsrvbynm_r getsrvbypt_r servicescache \
Packit 6c4009
		dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
Packit 6c4009
		xmalloc xstrdup aicache initgrcache gai res_hconf \
Packit 6c4009
		netgroupcache
Packit 6c4009
Packit 6c4009
ifeq ($(build-nscd)$(have-thread-library),yesyes)
Packit 6c4009
Packit 6c4009
others += nscd
Packit 6c4009
others-pie += nscd
Packit 6c4009
install-sbin := nscd
Packit 6c4009
Packit 6c4009
extra-objs = $(nscd-modules:=.o)
Packit 6c4009
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
all-nscd-modules := $(nscd-modules) selinux
Packit 6c4009
ifeq (yes,$(have-selinux))
Packit 6c4009
ifeq (yes,$(have-libaudit))
Packit 6c4009
libaudit = -laudit
Packit 6c4009
ifeq (yes,$(have-libcap))
Packit 6c4009
libcap = -lcap
Packit 6c4009
endif
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
nscd-modules += selinux
Packit 6c4009
selinux-LIBS := -lselinux $(libaudit) $(libcap)
Packit 6c4009
Packit 6c4009
# The configure.ac check for libselinux and its headers did not use
Packit 6c4009
# $SYSINCLUDES.  The directory specified by --with-headers usually
Packit 6c4009
# contains only the basic kernel interface headers, not something like
Packit 6c4009
# libselinux.  So the simplest thing is to presume that the standard
Packit 6c4009
# system headers will be ok for this file.
Packit 6c4009
$(objpfx)nscd_stat.o: sysincludes = # nothing
Packit 6c4009
$(objpfx)selinux.o: sysincludes = # nothing
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
LDLIBS-nscd = $(selinux-LIBS)
Packit 6c4009
Packit 6c4009
include ../Rules
Packit 6c4009
Packit 6c4009
CFLAGS-nscd_getpw_r.c += -fexceptions
Packit 6c4009
CFLAGS-nscd_getgr_r.c += -fexceptions
Packit 6c4009
CFLAGS-nscd_gethst_r.c += -fexceptions
Packit 6c4009
CFLAGS-nscd_getai.c += -fexceptions
Packit 6c4009
CFLAGS-nscd_initgroups.c += -fexceptions
Packit 6c4009
Packit 6c4009
CPPFLAGS-nscd += -D_FORTIFY_SOURCE=2
Packit 6c4009
Packit 6c4009
ifeq (yesyes,$(have-fpie)$(build-shared))
Packit 6c4009
CFLAGS-nscd += $(pie-ccflag)
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
ifeq (yesyes,$(have-fpie)$(build-shared))
Packit 6c4009
LDFLAGS-nscd = -Wl,-z,now
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
# Set libof-nscd.
Packit 6c4009
cpp-srcs-left := $(nscd-modules)
Packit 6c4009
lib := nscd
Packit 6c4009
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
Packit 6c4009
Packit 6c4009
$(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
Packit 6c4009
Packit 6c4009
ifeq ($(build-shared),yes)
Packit 6c4009
$(objpfx)nscd: $(shared-thread-library)
Packit 6c4009
else
Packit 6c4009
$(objpfx)nscd: $(static-thread-library)
Packit 6c4009
endif