#
# Copyright (c) 1994, 1995, 1996 Gunther Schadow.  All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program 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 General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

TOPDIR  := ../..
DISTJUNK += pg_compat.h

include $(TOPDIR)/config.mk

ifdef NEED_STRSEP
C_SRCS	+= strsep.c
h_define += -DNEED_STRSEP 
endif

ifdef NEED_REGSUB
H_SRCS  += v8regexp.h v8regmagic.h pg_compat.h
C_SRCS	+= v8regerror.c v8regexp.c v8regsub.c
h_define += -DNEED_REGSUB
endif

ifdef NEED_SYSLOG
H_SRCS  += fsyslog.h
C_SRCS	+= fsyslog.c
h_define += -DNEED_SYSLOG
endif

ifdef NEED_SIGLIST
C_SRCS	+= $(NEED_SIGLIST)
h_define += -DNEED_SIGLIST
endif

ifdef NEED_USLEEP
C_SRCS	+= usleep.c
h_define += -DNEED_USLEEP
endif

ifdef NEED_UALARM
C_SRCS	+= ualarm.c
h_define += -DNEED_UALARM
endif

ifdef NEED_STRRSTR
C_SRCS	+= strrstr.c
h_define += -DNEED_STRRSTR
endif

ifdef NEED_CONFIG
C_SRCS	+= config.c
h_define += -DNEED_CONFIG
endif

ifdef NEED_CFMAKERAW
C_SRCS	+= cfmakeraw.c
h_define += -DNEED_CFMAKERAW
endif

all: lib
source: pg_compat.h

include $(TOPDIR)/GNUmakefile.inc

pg_compat.h: pg_compat.h.m4 $(TOPDIR)/config.mk
	$(M4) $(h_define) $< > $@	

### Do not change this line, make depend uses it! ###