]> www.wagner.pp.ru Git - oss/catdoc.git/blob - configure.in
Recreated CVS repository from working copy
[oss/catdoc.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(acconfig.h)
3 catdoc_version=0.94.1
4 dnl Checks for programs.
5 AC_PROG_CC
6 case ${CC} in
7 *djgpp*) ac_cv_c_bigendian=no
8                 ac_cv_func_setvbuf_reversed=no
9 ;;
10 *)
11 ;;
12 esac
13 AC_C_BIGENDIAN
14 AC_PROG_INSTALL
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],
18 WISH=$withval,[
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,
22 changequote(<<,>>)dnl
23 <<changequote(<<,>>)dnl>>
24 <<echo 'if {[info tclversion]>=7.6} {
25  puts -nonewline "yes"
26 } else {
27  puts -nonewline "no"
28
29 exit'>tmp$$.tcl
30 GOOD_WISH=`$WISH tmp$$.tcl`
31 rm tmp$$.tcl >>
32 <<changequote([, ])dnl>>
33 changequote([, ])dnl
34 )
35 if test "$GOOD_WISH" != yes; then
36 enable_wordview=no
37 fi
38 fi
39 ])
40 fi
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,)
44 replsuffix=.replchars
45 specsuffix=.specchars
46 targetcharset=koi8-r
47 sourcecharset=cp1251
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"
52 else
53 charsetcheck="$sourcecharset.txt $targetcharset.txt"
54 fi
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;
57 then
58  charsetcheck=""
59 fi]) 
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
64                                                 wrapper],[:],)
65 fi
66 if test "$enable_wordview" = no; then
67          installtargets=install-catdoc 
68           buildtargets="catdoc xls2csv catppt"
69 else   
70         installtargets="install-catdoc install-wordview"
71         buildtargets="catdoc xls2csv catppt wordview"
72 fi
73 dnl Checks for libraries.
74
75 dnl Checks for header files.
76 AC_HEADER_STDC
77 AC_CHECK_HEADERS(unistd.h)
78
79 if test -z "$enable_langinfo"; then
80 enable_langinfo=yes
81 fi
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])
89                enable_langinfo=yes
90                ],[enable_langinfo=no])
91 AC_MSG_RESULT([$enable_langinfo])
92                ],[enable_langinfo=no])
93
94         fi],[])
95         
96         
97 dnl Checks for typedefs, structures, and compiler characteristics.
98 AC_C_CONST
99
100 dnl Checks for library functions.
101 AC_FUNC_SETVBUF_REVERSED
102
103 if test "$GCC" = "yes"; then
104         CFLAGS="-g -O2 -Wall"
105 fi
106
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)
114 AC_SUBST(specsuffix)
115 AC_SUBST(replsuffix)
116 AC_SUBST(buildtargets)
117 AC_SUBST(installtargets)
118 AC_SUBST(targetcharset)
119 AC_SUBST(sourcecharset)
120 AC_SUBST(man1dir)
121 AC_SUBST(manext)
122 AC_SUBST(charsetcheck)
123 AC_SUBST(installroot)
124 AC_SUBST(catdoc_version)
125 AC_SUBST(CFLAGS)
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)