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