## Process this file with automake to produce Makefile.in

AM_CFLAGS = -Wall

# libraries and files to compile and install
lib_LTLIBRARIES = libticonv.la
libticonvincludedir = $(includedir)/tilp2
libticonvinclude_HEADERS = \
	ticonv.h export4.h charset.h stdints4.h

# build instructions
libticonv_la_CPPFLAGS = -I$(top_srcdir)/intl \
	-DLOCALEDIR=\"$(datadir)/locale\" \
	@GLIB_CFLAGS@ -DTICONV_EXPORTS
libticonv_la_LIBADD = @GLIB_LIBS@
libticonv_la_LDFLAGS = -no-undefined -version-info @LT_LIBVERSION@
libticonv_la_SOURCES = \
	ticonv.c charset.c tokens.c filename.c type2str.c

if USE_ICONV
  libticonv_la_SOURCES += iconv.c
if OS_WIN32
    libticonv_la_LIBADD += -liconv
endif
endif

if OS_WIN32
  libticonv_la_DEPENDENCIES = ../build/mingw/ticonv-rc.o
  libticonv_la_LDFLAGS += -Wl,../build/mingw/ticonv-rc.o -Wl,--output-def,libticonv.def
  EXTRA_DIST = libticonv.def
endif

if !USE_ICONV
install-data-hook:
	sed -e 's/#define TICONV_ICONV_INTERFACE/#undef TICONV_ICONV_INTERFACE/g' $(DESTDIR)$(prefix)/include/tilp2/ticonv.h >$(DESTDIR)$(prefix)/include/tilp2/ticonv.h.tmp && mv -f $(DESTDIR)$(prefix)/include/tilp2/ticonv.h.tmp $(DESTDIR)$(prefix)/include/tilp2/ticonv.h;
endif
