1 |
frodo |
2 |
dnl Process this file with autoconf to produce a configure script. |
2 |
|
|
AC_INIT(psiconv) |
3 |
frodo |
46 |
AM_INIT_AUTOMAKE(psiconv,0.6.1) |
4 |
frodo |
2 |
|
5 |
|
|
AM_CONFIG_HEADER(config.h) |
6 |
|
|
|
7 |
|
|
dnl Checks for programs. |
8 |
|
|
AM_PROG_LIBTOOL |
9 |
|
|
|
10 |
frodo |
21 |
dnl This is stolen from gnome-libs-1.0.14 |
11 |
|
|
AC_ARG_ENABLE(compile-warnings, |
12 |
|
|
[ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.], |
13 |
|
|
,enable_compile_warnings=minimum) |
14 |
|
|
|
15 |
|
|
AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
16 |
|
|
warnCFLAGS= |
17 |
|
|
if test "x$GCC" != xyes; then |
18 |
|
|
enable_compile_warnings=no |
19 |
|
|
fi |
20 |
|
|
if test "x$enable_compile_warnings" != "xno"; then |
21 |
|
|
if test "x$GCC" = "xyes"; then |
22 |
|
|
case " $CFLAGS " in |
23 |
|
|
*[\ \ ]-Wall[\ \ ]*) ;; |
24 |
|
|
*) warnCFLAGS="-Wall -Wunused" ;; |
25 |
|
|
esac |
26 |
|
|
|
27 |
|
|
## -W is not all that useful. And it cannot be controlled |
28 |
|
|
## with individual -Wno-xxx flags, unlike -Wall |
29 |
|
|
if test "x$enable_compile_warnings" = "xyes"; then |
30 |
|
|
warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith" |
31 |
|
|
fi |
32 |
|
|
fi |
33 |
|
|
fi |
34 |
|
|
AC_MSG_RESULT($warnCFLAGS) |
35 |
|
|
|
36 |
|
|
AC_ARG_ENABLE(iso-c, |
37 |
|
|
[ --enable-iso-c Try to warn if code is not ISO C ],, |
38 |
|
|
enable_iso_c=no) |
39 |
|
|
|
40 |
|
|
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler) |
41 |
|
|
complCFLAGS= |
42 |
|
|
if test "x$enable_iso_c" != "xno"; then |
43 |
|
|
if test "x$GCC" = "xyes"; then |
44 |
|
|
case " $CFLAGS " in |
45 |
|
|
*[\ \ ]-ansi[\ \ ]*) ;; |
46 |
|
|
*) complCFLAGS="$complCFLAGS -ansi" ;; |
47 |
|
|
esac |
48 |
|
|
|
49 |
|
|
case " $CFLAGS " in |
50 |
|
|
*[\ \ ]-pedantic[\ \ ]*) ;; |
51 |
|
|
*) complCFLAGS="$complCFLAGS -pedantic" ;; |
52 |
|
|
esac |
53 |
|
|
fi |
54 |
|
|
fi |
55 |
|
|
AC_MSG_RESULT($complCFLAGS) |
56 |
|
|
if test "x$cflags_set" != "xyes"; then |
57 |
|
|
CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS" |
58 |
|
|
cflags_set=yes |
59 |
|
|
AC_SUBST(cflags_set) |
60 |
|
|
fi |
61 |
|
|
|
62 |
|
|
|
63 |
frodo |
2 |
dnl Checks for libraries. |
64 |
frodo |
16 |
AC_ARG_WITH(imagemagick, |
65 |
|
|
[ --with-imagemagick enable ImageMagick (default = yes)], |
66 |
|
|
[IMAGEMAGICK=$withval], |
67 |
|
|
[IMAGEMAGICK='yes']) |
68 |
|
|
if test x"$IMAGEMAGICK" != xno ; then |
69 |
frodo |
49 |
AC_CHECK_LIB(Magick,ConstituteImage,IMAGEMAGICK=yes,IMAGEMAGICK=no) |
70 |
frodo |
50 |
if test x"$IMAGEMAGICK" != xno ; then |
71 |
|
|
AC_MSG_CHECKING(whether GetMagickInfo works) |
72 |
|
|
AC_TRY_RUN([ #include <magick/magick.h> |
73 |
|
|
int main(void) { return (NULL == GetMagickInfo(NULL)) }], |
74 |
|
|
IMAGEMAGICK=yes,IMAGEMAGICK=no,IMAGEMAGICK=yes) |
75 |
|
|
AC_MSG_RESULT($IMAGEMAGICK) |
76 |
|
|
fi |
77 |
frodo |
16 |
if test x"$IMAGEMAGICK" = xno ; then |
78 |
|
|
AC_MSG_WARN(ImageMagick support disabled!) |
79 |
|
|
fi |
80 |
|
|
fi |
81 |
|
|
if test x"$IMAGEMAGICK" = xyes ; then |
82 |
|
|
LIB_MAGICK=-lMagick |
83 |
|
|
AC_DEFINE(IMAGEMAGICK) |
84 |
|
|
else |
85 |
|
|
LIB_MAGICK= |
86 |
|
|
fi |
87 |
|
|
AC_SUBST(LIB_MAGICK) |
88 |
frodo |
2 |
|
89 |
|
|
dnl Checks for header files. |
90 |
|
|
AC_HEADER_STDC |
91 |
|
|
AC_CHECK_HEADERS(unistd.h) |
92 |
|
|
|
93 |
|
|
dnl Checks for typedefs, structures, and compiler characteristics. |
94 |
|
|
AC_C_CONST |
95 |
|
|
AC_TYPE_SIZE_T |
96 |
|
|
|
97 |
|
|
dnl Here we check for large enough integer types. This is not quite |
98 |
|
|
dnl good enough, but it should work almost always. |
99 |
|
|
|
100 |
|
|
AC_CHECK_SIZEOF(char,1) |
101 |
|
|
AC_CHECK_SIZEOF(short,1) |
102 |
|
|
AC_CHECK_SIZEOF(int,2) |
103 |
|
|
AC_CHECK_SIZEOF(long,4) |
104 |
|
|
|
105 |
|
|
AC_MSG_CHECKING(for an 8 bit integer type) |
106 |
|
|
if test $ac_cv_sizeof_char -ge 1 ; then |
107 |
|
|
INT_8_BIT=char |
108 |
|
|
AC_MSG_RESULT(char) |
109 |
|
|
elif test $ac_cv_sizeof_short -ge 1 ; then |
110 |
|
|
INT_8_BIT=short |
111 |
|
|
AC_MSG_RESULT(short) |
112 |
|
|
elif test $ac_cv_sizeof_int -ge 1 ; then |
113 |
|
|
INT_8_BIT=int |
114 |
|
|
AC_MSG_RESULT(int) |
115 |
|
|
elif test $ac_cv_sizeof_long -ge 1 ; then |
116 |
|
|
INT_8_BIT=long |
117 |
|
|
AC_MSG_RESULT(long) |
118 |
|
|
else |
119 |
|
|
AC_MSG_ERROR(No integer type of at least 8 bits found) |
120 |
|
|
fi |
121 |
|
|
|
122 |
|
|
AC_MSG_CHECKING(for a 16 bit integer type) |
123 |
|
|
if test $ac_cv_sizeof_char -ge 2 ; then |
124 |
|
|
INT_16_BIT=char |
125 |
|
|
AC_MSG_RESULT(char) |
126 |
|
|
elif test $ac_cv_sizeof_short -ge 2 ; then |
127 |
|
|
INT_16_BIT=short |
128 |
|
|
AC_MSG_RESULT(short) |
129 |
|
|
elif test $ac_cv_sizeof_int -ge 2 ; then |
130 |
|
|
INT_16_BIT=int |
131 |
|
|
AC_MSG_RESULT(int) |
132 |
|
|
elif test $ac_cv_sizeof_long -ge 2 ; then |
133 |
|
|
INT_16_BIT=long |
134 |
|
|
AC_MSG_RESULT(long) |
135 |
|
|
else |
136 |
|
|
AC_MSG_ERROR(No integer type of at least 16 bits found) |
137 |
|
|
fi |
138 |
|
|
|
139 |
|
|
AC_MSG_CHECKING(for a 32 bit integer type) |
140 |
|
|
if test $ac_cv_sizeof_char -ge 4 ; then |
141 |
|
|
INT_32_BIT=char |
142 |
|
|
AC_MSG_RESULT(char) |
143 |
|
|
elif test $ac_cv_sizeof_short -ge 4 ; then |
144 |
|
|
INT_32_BIT=short |
145 |
|
|
AC_MSG_RESULT(short) |
146 |
|
|
elif test $ac_cv_sizeof_int -ge 4 ; then |
147 |
|
|
INT_32_BIT=int |
148 |
|
|
AC_MSG_RESULT(int) |
149 |
|
|
elif test $ac_cv_sizeof_long -ge 4 ; then |
150 |
|
|
INT_32_BIT=long |
151 |
|
|
AC_MSG_RESULT(long) |
152 |
|
|
else |
153 |
|
|
AC_MSG_ERROR(No integer type of at least 32 bits found) |
154 |
|
|
fi |
155 |
|
|
|
156 |
|
|
AC_SUBST(INT_8_BIT) |
157 |
|
|
AC_SUBST(INT_16_BIT) |
158 |
|
|
AC_SUBST(INT_32_BIT) |
159 |
|
|
|
160 |
|
|
dnl Checks for library functions. |
161 |
|
|
AC_FUNC_VPRINTF |
162 |
|
|
AC_REPLACE_FUNCS(strdup) |
163 |
frodo |
21 |
AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o") |
164 |
frodo |
2 |
|
165 |
frodo |
21 |
|
166 |
frodo |
2 |
dnl With and without functions |
167 |
|
|
AC_ARG_ENABLE(html-docs, |
168 |
|
|
[ --disable-html-docs Disable generation of HTML 3.2 docs (default: on)], |
169 |
|
|
[case "${enableval}" in |
170 |
|
|
yes) htmldocs=true ;; |
171 |
|
|
no) htmldocs=false ;; |
172 |
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-html-docs) ;; |
173 |
|
|
esac],[htmldocs=true]) |
174 |
|
|
AM_CONDITIONAL(HTMLDOCS,test x$htmldocs = xtrue) |
175 |
|
|
|
176 |
|
|
AC_ARG_ENABLE(html4-docs, |
177 |
|
|
[ --enable-html4-docs Enable generation of HTML 4 docs (default: off)], |
178 |
|
|
[case "${enableval}" in |
179 |
|
|
yes) html4docs=true ;; |
180 |
|
|
no) html4docs=false ;; |
181 |
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-html4-docs) ;; |
182 |
|
|
esac],[html4docs=false]) |
183 |
|
|
AM_CONDITIONAL(HTML4DOCS,test x$html4docs = xtrue) |
184 |
|
|
|
185 |
|
|
AC_ARG_ENABLE(ascii-docs, |
186 |
|
|
[ --enable-ascii-docs Enable generation of ASCII docs (default: off)], |
187 |
|
|
[case "${enableval}" in |
188 |
|
|
yes) asciidocs=true ;; |
189 |
|
|
no) asciidocs=false ;; |
190 |
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ascii-docs) ;; |
191 |
|
|
esac],[asciidocs=false]) |
192 |
|
|
AM_CONDITIONAL(ASCIIDOCS,test x$asciidocs = xtrue) |
193 |
|
|
|
194 |
frodo |
7 |
AC_ARG_ENABLE(rtf-docs, |
195 |
|
|
[ --enable-rtf-docs Enable generation of RTF docs (default: off)], |
196 |
|
|
[case "${enableval}" in |
197 |
|
|
yes) rtfdocs=true ;; |
198 |
|
|
no) rtfdocs=false ;; |
199 |
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-rtf-docs) ;; |
200 |
|
|
esac],[rtfdocs=false]) |
201 |
|
|
AM_CONDITIONAL(RTFDOCS,test x$rtfdocs = xtrue) |
202 |
|
|
|
203 |
frodo |
19 |
|
204 |
frodo |
2 |
AC_OUTPUT([Makefile compat/Makefile lib/Makefile psiconv/Makefile lib/general.h formats/Makefile docs/Makefile]) |