dnl Process this file with autoconf to produce a configure script. AC_INIT([catdoc],[0.95]) dnl Checks for programs. AC_PROG_CC case ${CC} in *djgpp*) ac_cv_c_bigendian=no ac_cv_func_setvbuf_reversed=no ;; *) ;; esac AC_C_BIGENDIAN AC_PROG_INSTALL if test "$enable_wordview" != "no" ;then AC_ARG_WITH(wish,[ --with-wish=fullpath allows to specify full path for Tk interpreter to avoid checking, which requires X], WISH=$withval,[ AC_PATH_PROGS(WISH,wish wish8.1 wish8.2 wish8.3 wish8.4) if test -n "$WISH"; then AC_CACHE_CHECK(checking if wish version is 8.1 or above ,[ac_cv_GOOD_WISH], changequote(<<,>>)dnl <>)dnl>> <=7.6} { puts -nonewline "yes" } else { puts -nonewline "no" } exit'>tmp$$.tcl ac_cv_GOOD_WISH=`$WISH tmp$$.tcl` rm tmp$$.tcl >> <> changequote([, ])dnl ) if test "$ac_cv_GOOD_WISH" != yes; then enable_wordview=no fi fi ]) fi AC_ARG_WITH(install-root,[ --with-install-root=path allows to install catdoc into other directory than compilied-in path points to],installroot=$withval,) replsuffix=.replchars specsuffix=.specchars targetcharset=koi8-r sourcecharset=cp1251 AC_ARG_WITH(input,[ --with-input=charset set default charset to expect in 8-bit word files],sourcecharset=$withval,sourcecharset=cp1251) AC_ARG_WITH(output,[ --with-output=charset set default charset to output],targetcharset=$withval,targetcharset=koi8-r) if test "$targetcharset" = "utf-8"; then charsetcheck="$sourcecharset.txt" else charsetcheck="$sourcecharset.txt $targetcharset.txt" fi AC_ARG_ENABLE(charset-check,[ --disable-charset-check allow make in charsets directory to succeed even if files for default charsets are not found],[if test "$enable_charset_check" = no; then charsetcheck="" fi]) test -z "$manext" && manext=.1 test -z "$man1dir" && man1dir=\${prefix}/man/man1 if test -n "$WISH"; then AC_ARG_ENABLE(wordview,[ --disable-wordview Do not install tcl-tk wrapper],[:],) fi if test "$enable_wordview" = no; then installtargets=install-catdoc buildtargets="catdoc xls2csv catppt" else installtargets="install-catdoc install-wordview" buildtargets="catdoc xls2csv catppt wordview" fi dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([unistd.h stdint.h]) if test -z "$enable_langinfo"; then enable_langinfo=yes fi AC_ARG_ENABLE(langinfo,[ --disable-langinfo Do not use system locale for output encoding],[ if test "$enable_langinfo" = yes; then AC_CHECK_HEADER(langinfo.h,[ AC_MSG_CHECKING([For nl_langinfo(CODESET)]) AC_TRY_COMPILE([#include ],[nl_langinfo(CODESET);],[ AC_DEFINE(HAVE_LANGINFO,1,[Define this if you have XPG4 comliant nl_langinfo, which accepts CODESET argument]) enable_langinfo=yes ],[enable_langinfo=no]) AC_MSG_RESULT([$enable_langinfo]) ],[enable_langinfo=no]) fi],[]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. AC_FUNC_SETVBUF_REVERSED #if test "$GCC" = "yes"; then # CFLAGS="-g -O2 -Wall" #fi AC_DEFINE_UNQUOTED([SOURCE_CHARSET],"$sourcecharset",[Character encoding used by default for 8-bit source files]) AC_DEFINE_UNQUOTED([TARGET_CHARSET],"$targetcharset",[Output character encoding used by default, if impossible to determine encoding from locale]) AC_DEFINE_UNQUOTED([SPEC_EXT],"$specsuffix",[Suffix for files with special symbols map (ones to be replaced regardless of availability in target encoding)]) AC_DEFINE_UNQUOTED([REPL_EXT],"$replsuffix",[Suffix for symbols replacement map (what to do with symbols, which are not available in the target encoding)]) AC_DEFINE_UNQUOTED([UNKNOWN_CHAR],"?",[Symbol to represent character which is not available either in target encoding or in replacement map]) AC_CHECK_FUNCS(strdup strtol) AC_REPLACE_FUNCS(strftime) AC_SUBST(specsuffix) AC_SUBST(replsuffix) AC_SUBST(buildtargets) AC_SUBST(installtargets) AC_SUBST(targetcharset) AC_SUBST(sourcecharset) AC_SUBST(man1dir) AC_SUBST(manext) AC_SUBST(charsetcheck) AC_SUBST(installroot) AC_SUBST(PACKAGE_VERSION) AC_SUBST(CFLAGS) AC_SUBST(WORDS_BIGENDIAN) AC_CONFIG_HEADER(src/config.h) AC_OUTPUT(doc/Makefile charsets/Makefile src/Makefile Makefile doc/catdoc.1 doc/xls2csv.1 doc/wordview.1 doc/catppt.1)