-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.in
128 lines (120 loc) · 4.26 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acconfig.h)
catdoc_version=0.94.2
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 ,GOOD_WISH,
changequote(<<,>>)dnl
<<changequote(<<,>>)dnl>>
<<echo 'if {[info tclversion]>=7.6} {
puts -nonewline "yes"
} else {
puts -nonewline "no"
}
exit'>tmp$$.tcl
GOOD_WISH=`$WISH tmp$$.tcl`
rm tmp$$.tcl >>
<<changequote([, ])dnl>>
changequote([, ])dnl
)
if test "$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)
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 <langinfo.h>],[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(catdoc_version)
AC_SUBST(CFLAGS)
AC_SUBST(WORDS_BIGENDIAN DEFS)
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)