1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([catdoc],[0.95])
3 dnl Checks for programs.
6 *djgpp*) ac_cv_c_bigendian=no
7 ac_cv_func_setvbuf_reversed=no
14 if test "$enable_wordview" != "no" ;then
15 AC_ARG_WITH(wish,[ --with-wish=fullpath allows to specify full path for Tk interpreter to
16 avoid checking, which requires X],
18 AC_PATH_PROGS(WISH,wish wish8.1 wish8.2 wish8.3 wish8.4)
19 if test -n "$WISH"; then
20 AC_CACHE_CHECK(checking if wish version is 8.1 or above ,[ac_cv_GOOD_WISH],
22 <<changequote(<<,>>)dnl>>
23 <<echo 'if {[info tclversion]>=7.6} {
29 ac_cv_GOOD_WISH=`$WISH tmp$$.tcl`
31 <<changequote([, ])dnl>>
34 if test "$ac_cv_GOOD_WISH" != yes; then
40 AC_ARG_WITH(install-root,[ --with-install-root=path
41 allows to install catdoc into other directory
42 than compilied-in path points to],installroot=$withval,)
47 AC_ARG_WITH(input,[ --with-input=charset set default charset to expect in 8-bit word files],sourcecharset=$withval,sourcecharset=cp1251)
48 AC_ARG_WITH(output,[ --with-output=charset set default charset to output],targetcharset=$withval,targetcharset=koi8-r)
49 if test "$targetcharset" = "utf-8"; then
50 charsetcheck="$sourcecharset.txt"
52 charsetcheck="$sourcecharset.txt $targetcharset.txt"
54 AC_ARG_ENABLE(charset-check,[ --disable-charset-check allow make in charsets directory to succeed
55 even if files for default charsets are not found],[if test "$enable_charset_check" = no;
59 test -z "$manext" && manext=.1
60 test -z "$man1dir" && man1dir=\${prefix}/man/man1
61 if test -n "$WISH"; then
62 AC_ARG_ENABLE(wordview,[ --disable-wordview Do not install tcl-tk
65 if test "$enable_wordview" = no; then
66 installtargets=install-catdoc
67 buildtargets="catdoc xls2csv catppt"
69 installtargets="install-catdoc install-wordview"
70 buildtargets="catdoc xls2csv catppt wordview"
72 dnl Checks for libraries.
74 dnl Checks for header files.
76 AC_CHECK_HEADERS([unistd.h stdint.h])
77 if test -z "$enable_langinfo"; then
80 AC_ARG_ENABLE(langinfo,[ --disable-langinfo Do not use system
81 locale for output encoding],[
82 if test "$enable_langinfo" = yes; then
83 AC_CHECK_HEADER(langinfo.h,[
84 AC_MSG_CHECKING([For nl_langinfo(CODESET)])
85 AC_TRY_COMPILE([#include <langinfo.h>],[nl_langinfo(CODESET);],[
86 AC_DEFINE(HAVE_LANGINFO,1,[Define this if you have XPG4 comliant nl_langinfo, which accepts CODESET argument])
88 ],[enable_langinfo=no])
89 AC_MSG_RESULT([$enable_langinfo])
90 ],[enable_langinfo=no])
95 dnl Checks for typedefs, structures, and compiler characteristics.
98 dnl Checks for library functions.
99 AC_FUNC_SETVBUF_REVERSED
101 #if test "$GCC" = "yes"; then
102 # CFLAGS="-g -O2 -Wall"
105 AC_DEFINE_UNQUOTED([SOURCE_CHARSET],"$sourcecharset",[Character encoding used by default for 8-bit source files])
106 AC_DEFINE_UNQUOTED([TARGET_CHARSET],"$targetcharset",[Output character encoding used by default, if impossible to determine encoding from locale])
107 AC_DEFINE_UNQUOTED([SPEC_EXT],"$specsuffix",[Suffix for files with special symbols map (ones to be replaced regardless of availability in target encoding)])
108 AC_DEFINE_UNQUOTED([REPL_EXT],"$replsuffix",[Suffix for symbols replacement map (what to do with symbols, which are not available in the target encoding)])
109 AC_DEFINE_UNQUOTED([UNKNOWN_CHAR],"?",[Symbol to represent character which is not available either in target encoding or in replacement map])
110 AC_CHECK_FUNCS(strdup strtol)
111 AC_REPLACE_FUNCS(strftime)
114 AC_SUBST(buildtargets)
115 AC_SUBST(installtargets)
116 AC_SUBST(targetcharset)
117 AC_SUBST(sourcecharset)
120 AC_SUBST(charsetcheck)
121 AC_SUBST(installroot)
122 AC_SUBST(PACKAGE_VERSION)
124 AC_SUBST(WORDS_BIGENDIAN)
125 AC_CONFIG_HEADER(src/config.h)
126 AC_OUTPUT(doc/Makefile charsets/Makefile src/Makefile Makefile doc/catdoc.1 doc/xls2csv.1 doc/wordview.1 doc/catppt.1)