1 dnl Process this file with autoconf to produce a configure script.
4 dnl Checks for programs.
7 *djgpp*) ac_cv_c_bigendian=no
8 ac_cv_func_setvbuf_reversed=no
15 if test "$enable_wordview" != "no" ;then
16 AC_ARG_WITH(wish,[ --with-wish=fullpath allows to specify full path for Tk interpreter to
17 avoid checking, which requires X],
19 AC_PATH_PROGS(WISH,wish wish8.1 wish8.2 wish8.3 wish8.4)
20 if test -n "$WISH"; then
21 AC_CACHE_CHECK(checking if wish version is 8.1 or above ,GOOD_WISH,
23 <<changequote(<<,>>)dnl>>
24 <<echo 'if {[info tclversion]>=7.6} {
30 GOOD_WISH=`$WISH tmp$$.tcl`
32 <<changequote([, ])dnl>>
35 if test "$GOOD_WISH" != yes; then
41 AC_ARG_WITH(install-root,[ --with-install-root=path
42 allows to install catdoc into other directory
43 than compilied-in path points to],installroot=$withval,)
48 AC_ARG_WITH(input,[ --with-input=charset set default charset to expect in 8-bit word files],sourcecharset=$withval,sourcecharset=cp1251)
49 AC_ARG_WITH(output,[ --with-output=charset set default charset to output],targetcharset=$withval,targetcharset=koi8-r)
50 if test "$targetcharset" = "utf-8"; then
51 charsetcheck="$sourcecharset.txt"
53 charsetcheck="$sourcecharset.txt $targetcharset.txt"
55 AC_ARG_ENABLE(charset-check,[ --disable-charset-check allow make in charsets directory to succeed
56 even if files for default charsets are not found],[if test "$enable_charset_check" = no;
60 test -z "$manext" && manext=.1
61 test -z "$man1dir" && man1dir=\${prefix}/man/man1
62 if test -n "$WISH"; then
63 AC_ARG_ENABLE(wordview,[ --disable-wordview Do not install tcl-tk
66 if test "$enable_wordview" = no; then
67 installtargets=install-catdoc
68 buildtargets="catdoc xls2csv catppt"
70 installtargets="install-catdoc install-wordview"
71 buildtargets="catdoc xls2csv catppt wordview"
73 dnl Checks for libraries.
75 dnl Checks for header files.
77 AC_CHECK_HEADERS(unistd.h)
79 if test -z "$enable_langinfo"; then
82 AC_ARG_ENABLE(langinfo,[ --disable-langinfo Do not use system
83 locale for output encoding],[
84 if test "$enable_langinfo" = yes; then
85 AC_CHECK_HEADER(langinfo.h,[
86 AC_MSG_CHECKING([For nl_langinfo(CODESET)])
87 AC_TRY_COMPILE([#include <langinfo.h>],[nl_langinfo(CODESET);],[
88 AC_DEFINE(HAVE_LANGINFO,1,[Define this if you have XPG4 comliant nl_langinfo, which accepts CODESET argument])
90 ],[enable_langinfo=no])
91 AC_MSG_RESULT([$enable_langinfo])
92 ],[enable_langinfo=no])
97 dnl Checks for typedefs, structures, and compiler characteristics.
100 dnl Checks for library functions.
101 AC_FUNC_SETVBUF_REVERSED
103 if test "$GCC" = "yes"; then
104 CFLAGS="-g -O2 -Wall"
107 AC_DEFINE_UNQUOTED([SOURCE_CHARSET],"$sourcecharset",[Character encoding used by default for 8-bit source files])
108 AC_DEFINE_UNQUOTED([TARGET_CHARSET],"$targetcharset",[Output character encoding used by default, if impossible to determine encoding from locale])
109 AC_DEFINE_UNQUOTED([SPEC_EXT],"$specsuffix",[Suffix for files with special symbols map (ones to be replaced regardless of availability in target encoding)])
110 AC_DEFINE_UNQUOTED([REPL_EXT],"$replsuffix",[Suffix for symbols replacement map (what to do with symbols, which are not available in the target encoding)])
111 AC_DEFINE_UNQUOTED([UNKNOWN_CHAR],"?",[Symbol to represent character which is not available either in target encoding or in replacement map])
112 AC_CHECK_FUNCS(strdup strtol)
113 AC_REPLACE_FUNCS(strftime)
116 AC_SUBST(buildtargets)
117 AC_SUBST(installtargets)
118 AC_SUBST(targetcharset)
119 AC_SUBST(sourcecharset)
122 AC_SUBST(charsetcheck)
123 AC_SUBST(installroot)
124 AC_SUBST(catdoc_version)
126 AC_SUBST(WORDS_BIGENDIAN DEFS)
127 AC_CONFIG_HEADER(src/config.h)
128 AC_OUTPUT(doc/Makefile charsets/Makefile src/Makefile Makefile doc/catdoc.1 doc/xls2csv.1 doc/wordview.1 doc/catppt.1)