1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (C) 2010 Peter Breitenlohner <tex-live@tug.org>
5 dnl This file is free software; the copyright holder
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
9 m4_include([version.ac])[] dnl define ptexenc_version
10 AC_INIT([ptexenc], ptexenc_version, [tex-k@tug.org])
12 AC_CONFIG_SRCDIR([ptexenc.c])
13 AC_CONFIG_AUX_DIR([../../build-aux])
14 AC_CONFIG_MACRO_DIR([../../m4])
16 AC_SUBST([PTEXENCVERSION], [ptexenc_version])
17 KPSE_LT_VERSION([ptexenc])
19 dnl Common code for all programs (or libraries) using libkpathsea.
20 KPSE_COMMON([ptexenc])
24 dnl Using iconv for kanji <=> unicode conversion
25 AC_ARG_ENABLE([kanji-iconv],
26 AS_HELP_STRING([--enable-kanji-iconv],
27 [Use iconv for kanji <=> unicode conversion]))
29 if test "x$enable_kanji_iconv" = "xyes"; then
30 AC_DEFINE([KANJI_ICONV], 1,
31 [Define to 1 if you use iconv for kanji <=> unicode conversion.])
32 AC_CHECK_LIB([iconv], [iconv_open], ,[AC_CHECK_LIB([iconv], [libiconv_open])])
33 AC_CHECK_HEADERS([iconv.h])
34 AC_CHECK_FUNCS([iconv])
35 AC_CHECK_FUNCS([atexit on_exit], [break])
38 dnl Write output here, instead of putting a zillion -D's on the command line.
39 AC_CONFIG_HEADERS([ptexenc/c-auto.h:c-auto.in],
40 [sed -e 's/^#define PACKAGE/#define PTEXENC_PACKAGE/' \
41 -e 's/^#define VERSION/#define PTEXENC_VERSION/' ptexenc/c-auto.h >c-auto.tmp \
42 && mv -f c-auto.tmp ptexenc/c-auto.h])
44 AH_TOP([/* ptexenc/c-auto.h: defines for ptexenc, as determined by configure. */
45 /* Guard against double inclusion. */
46 #ifndef PTEXENC_C_AUTO_H
47 #define PTEXENC_C_AUTO_H
49 /* ptexenc: the version string. */
50 #define PTEXENCVERSION "ptexenc version] ptexenc_version["])
51 AH_BOTTOM([#endif /* !PTEXENC_C_AUTO_H */])
53 AC_CONFIG_FILES([Makefile])