NULL =
noinst_HEADERS = \
	iconv.h \
	convert.h \
	bytes.h \
	thread.h \
	proto.h \
	tds.h \
	odbc.h \
	version.h \
	server.h \
	configs.h \
	enum_cap.h \
	sysdep_private.h \
	stream.h \
	data.h \
	pushvis.h \
	popvis.h \
	time.h \
	tls.h \
	bool.h \
	checks.h \
	alloca.h \
	macros.h \
	windows.h \
	utils.h \
	utils/string.h \
	utils/dlist.h \
	utils/dlist.tmpl.h \
	utils/bjoern-utf8.h \
	utils/md4.h \
	utils/des.h \
	utils/md5.h \
	utils/hmac_md5.h \
	replacements.h \
	replacements/poll.h \
	replacements/readpassphrase.h \
	$(NULL)

DISTCLEANFILES = sysconfdir.h

sysconfdir.h: Makefile
	echo '#define FREETDS_SYSCONFDIR "$(sysconfdir)"' >$@

all-am: sysconfdir.h

GENERATED_HEADER_FILES = encodings.h charset_lookup.h
EXTRA_DIST = $(GENERATED_HEADER_FILES)

if HAVE_PERL_SOURCES
BUILT_SOURCES = $(GENERATED_HEADER_FILES)

clean-local:
	cd $(srcdir) && rm -f $(BUILT_SOURCES)

charset_lookup.h: encodings.h

encodings.h: encodings.pl alternative_character_sets.h character_sets.h Makefile
	perl $(srcdir)/encodings.pl $(srcdir) $(GPERF) > $@.tmp 2> /dev/null
	mv $@.tmp $@
endif
