/[public]/psiconv/trunk/configure.in
ViewVC logotype

Annotation of /psiconv/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 255 - (hide annotations)
Fri Feb 25 20:36:25 2005 UTC (19 years, 1 month ago) by frodo
File size: 8976 byte(s)
(Frodo) Support ImageMagick 6

1 frodo 2 dnl Process this file with autoconf to produce a configure script.
2 frodo 116 AC_INIT
3     AC_CONFIG_SRCDIR([lib/psiconv])
4 frodo 253 AM_INIT_AUTOMAKE(psiconv,0.9.6)
5 frodo 2
6     AM_CONFIG_HEADER(config.h)
7    
8     dnl Checks for programs.
9     AM_PROG_LIBTOOL
10    
11 frodo 21 dnl This is stolen from gnome-libs-1.0.14
12     AC_ARG_ENABLE(compile-warnings,
13     [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],
14     ,enable_compile_warnings=minimum)
15    
16     AC_MSG_CHECKING(what warning flags to pass to the C compiler)
17     warnCFLAGS=
18     if test "x$GCC" != xyes; then
19     enable_compile_warnings=no
20     fi
21     if test "x$enable_compile_warnings" != "xno"; then
22     if test "x$GCC" = "xyes"; then
23     case " $CFLAGS " in
24     *[\ \ ]-Wall[\ \ ]*) ;;
25     *) warnCFLAGS="-Wall -Wunused" ;;
26     esac
27    
28     ## -W is not all that useful. And it cannot be controlled
29     ## with individual -Wno-xxx flags, unlike -Wall
30     if test "x$enable_compile_warnings" = "xyes"; then
31     warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith"
32     fi
33     fi
34     fi
35     AC_MSG_RESULT($warnCFLAGS)
36    
37     AC_ARG_ENABLE(iso-c,
38     [ --enable-iso-c Try to warn if code is not ISO C ],,
39     enable_iso_c=no)
40    
41     AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
42     complCFLAGS=
43     if test "x$enable_iso_c" != "xno"; then
44     if test "x$GCC" = "xyes"; then
45     case " $CFLAGS " in
46     *[\ \ ]-ansi[\ \ ]*) ;;
47     *) complCFLAGS="$complCFLAGS -ansi" ;;
48     esac
49    
50     case " $CFLAGS " in
51     *[\ \ ]-pedantic[\ \ ]*) ;;
52     *) complCFLAGS="$complCFLAGS -pedantic" ;;
53     esac
54     fi
55     fi
56     AC_MSG_RESULT($complCFLAGS)
57     if test "x$cflags_set" != "xyes"; then
58     CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
59     cflags_set=yes
60     AC_SUBST(cflags_set)
61     fi
62    
63    
64 frodo 2 dnl Checks for libraries.
65 frodo 16 AC_ARG_WITH(imagemagick,
66     [ --with-imagemagick enable ImageMagick (default = yes)],
67     [IMAGEMAGICK=$withval],
68     [IMAGEMAGICK='yes'])
69     if test x"$IMAGEMAGICK" != xno ; then
70 frodo 53 AC_CHECK_PROG(IMAGEMAGICK,Magick-config,yes,no)
71 frodo 50 if test x"$IMAGEMAGICK" != xno ; then
72 frodo 53 CFLAGS_OLD="$CFLAGS"
73     CPPFLAGS_OLD="$CPPFLAGS"
74     LDFLAGS_OLD="$LDFLAGS"
75     LIBS_OLD="$LIBS"
76     CFLAGS="$CFLAGS `Magick-config --cflags`"
77     CPPFLAGS="$CPPFLAGS `Magick-config --cppflags`"
78     LDFLAGS="$LDFLAGS `Magick-config --ldflags`"
79     LIBS="$LIBS `Magick-config --libs`"
80    
81 frodo 152
82     AC_MSG_CHECKING(whether GetMagickInfo works and which API to use)
83     AC_TRY_RUN([ #include <stdio.h>
84 frodo 255 #include <stdlib.h>
85 frodo 252 #include <time.h>
86 frodo 152 #include <magick/api.h>
87 frodo 255 int main(void) {
88     unsigned long number_formats;
89     ExceptionInfo exception;
90     GetExceptionInfo(&exception);
91     OpenModules(&exception);
92     GetMagickInfoList("*",&number_formats,&exception);
93     return number_formats == 0; }],
94     IMAGEMAGICK=4,IMAGEMAGICK=no,IMAGEMAGICK=no)
95 frodo 152 if test x"$IMAGEMAGICK" = xno ; then
96 frodo 255 AC_TRY_RUN([ #include <stdio.h>
97     #include <stdlib.h>
98     #include <time.h>
99     #include <magick/api.h>
100     int main(void) {
101     unsigned long number_formats;
102     ExceptionInfo exception;
103     GetExceptionInfo(&exception);
104     OpenModules(&exception);
105     GetMagickInfoList("*",&number_formats);
106     return number_formats == 0; }],
107     IMAGEMAGICK=3,IMAGEMAGICK=no,IMAGEMAGICK=no)
108     fi
109     if test x"$IMAGEMAGICK" = xno ; then
110     AC_TRY_RUN([ #include <stdio.h>
111     #include <stdlib.h>
112     #include <time.h>
113     #include <magick/api.h>
114     int main(void) { ExceptionInfo exception;
115     GetExceptionInfo(&exception);
116     OpenModules(&exception);
117     return (NULL == GetMagickInfo(NULL,&exception)); }],
118     IMAGEMAGICK=2,IMAGEMAGICK=no,IMAGEMAGICK=no)
119     fi
120     if test x"$IMAGEMAGICK" = xno ; then
121 frodo 152 AC_TRY_RUN([ #include <magick/magick.h>
122     int main(void) { ExceptionInfo exception;
123     GetExceptionInfo(&exception);
124     OpenModules(&exception);
125     return (NULL == GetMagickInfo(NULL,&exception)); }],
126 frodo 255 IMAGEMAGICK=1,IMAGEMAGICK=no,IMAGEMAGICK=no)
127 frodo 152 fi
128 frodo 255 AC_MSG_RESULT("Version $IMAGEMAGICK")
129 frodo 53 LDFLAGS="$LDFLAGS_OLD"
130     LIBS="$LIBS_OLD"
131     dnl Note: CFLAGS can't be set for single directories, so we propagate them
132     if test x"$IMAGEMAGICK" = xno ; then
133     CFLAGS="$CFLAGS_OLD"
134     CPPFLAGS="$CPPFLAGS_OLD"
135     fi
136 frodo 50 fi
137 frodo 16 fi
138 frodo 152 if test x"$IMAGEMAGICK" != xno ; then
139 frodo 53 LIB_MAGICK="`Magick-config --libs` `Magick-config --ldflags`"
140 frodo 255 AC_DEFINE(IMAGEMAGICK, 1 ,[ImageMagick availability])
141     AC_DEFINE_UNQUOTED(IMAGEMAGICK_API, $IMAGEMAGICK, [ImageMagick API version])
142 frodo 16 else
143     LIB_MAGICK=
144     fi
145     AC_SUBST(LIB_MAGICK)
146 frodo 2
147     dnl Checks for header files.
148     AC_HEADER_STDC
149     AC_CHECK_HEADERS(unistd.h)
150    
151     dnl Checks for typedefs, structures, and compiler characteristics.
152     AC_C_CONST
153     AC_TYPE_SIZE_T
154    
155     dnl Here we check for large enough integer types. This is not quite
156     dnl good enough, but it should work almost always.
157    
158     AC_CHECK_SIZEOF(char,1)
159     AC_CHECK_SIZEOF(short,1)
160     AC_CHECK_SIZEOF(int,2)
161     AC_CHECK_SIZEOF(long,4)
162    
163     AC_MSG_CHECKING(for an 8 bit integer type)
164     if test $ac_cv_sizeof_char -ge 1 ; then
165     INT_8_BIT=char
166     AC_MSG_RESULT(char)
167     elif test $ac_cv_sizeof_short -ge 1 ; then
168     INT_8_BIT=short
169     AC_MSG_RESULT(short)
170     elif test $ac_cv_sizeof_int -ge 1 ; then
171     AC_MSG_RESULT(int)
172     elif test $ac_cv_sizeof_long -ge 1 ; then
173     INT_8_BIT=long
174     AC_MSG_RESULT(long)
175     else
176     AC_MSG_ERROR(No integer type of at least 8 bits found)
177     fi
178    
179     AC_MSG_CHECKING(for a 16 bit integer type)
180     if test $ac_cv_sizeof_char -ge 2 ; then
181     INT_16_BIT=char
182     AC_MSG_RESULT(char)
183     elif test $ac_cv_sizeof_short -ge 2 ; then
184     INT_16_BIT=short
185     AC_MSG_RESULT(short)
186     elif test $ac_cv_sizeof_int -ge 2 ; then
187     INT_16_BIT=int
188     AC_MSG_RESULT(int)
189     elif test $ac_cv_sizeof_long -ge 2 ; then
190     INT_16_BIT=long
191     AC_MSG_RESULT(long)
192     else
193     AC_MSG_ERROR(No integer type of at least 16 bits found)
194     fi
195    
196     AC_MSG_CHECKING(for a 32 bit integer type)
197     if test $ac_cv_sizeof_char -ge 4 ; then
198     INT_32_BIT=char
199     AC_MSG_RESULT(char)
200     elif test $ac_cv_sizeof_short -ge 4 ; then
201     INT_32_BIT=short
202     AC_MSG_RESULT(short)
203     elif test $ac_cv_sizeof_int -ge 4 ; then
204     INT_32_BIT=int
205     AC_MSG_RESULT(int)
206     elif test $ac_cv_sizeof_long -ge 4 ; then
207     INT_32_BIT=long
208     AC_MSG_RESULT(long)
209     else
210     AC_MSG_ERROR(No integer type of at least 32 bits found)
211     fi
212    
213     AC_SUBST(INT_8_BIT)
214     AC_SUBST(INT_16_BIT)
215     AC_SUBST(INT_32_BIT)
216    
217     dnl Checks for library functions.
218     AC_FUNC_VPRINTF
219     AC_REPLACE_FUNCS(strdup)
220 frodo 186 AC_CHECK_FUNC(getopt_long,getopt=yes,getopt=no)
221     if test $getopt = no; then
222     AC_LIBOBJ([getopt])
223     AC_LIBOBJ([getopt1])
224     fi
225 frodo 2
226 frodo 142 AC_ARG_ENABLE(dmalloc,
227     [ --enable-dmalloc Enable dmalloc for developers (default:off)],
228     [case "${enableval}" in
229     yes) dmalloc=yes ;;
230     no) dmalloc=no ;;
231     *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
232     esac],[dmalloc=false])
233     if test x"$dmalloc" = xyes; then
234     AC_CHECK_LIB(dmalloc,malloc,dmalloc=yes,dmalloc=no)
235     fi
236     if test x"$dmalloc" = xyes; then
237     AC_CHECK_HEADER(dmalloc.h,dmalloc=yes,dmalloc=no)
238     fi
239     if test x"$dmalloc" = xyes ; then
240     LIB_DMALLOC=-ldmalloc
241     AC_DEFINE(DMALLOC,1,[DMalloc availability])
242     else
243     LIB_DMALLOC=
244     fi
245     AC_SUBST(LIB_DMALLOC)
246 frodo 21
247 frodo 2 dnl With and without functions
248 frodo 193 AC_ARG_ENABLE(xhtml-docs,
249     [ --disable-xhtml-docs Disable generation of XHTML docs (default: on)],
250 frodo 2 [case "${enableval}" in
251 frodo 193 yes) xhtmldocs=true ;;
252     no) xhtmldocs=false ;;
253     *) AC_MSG_ERROR(bad value ${enableval} for --enable-xhtml-docs) ;;
254     esac],[xhtmldocs=true])
255     AM_CONDITIONAL(XHTMLDOCS,test x$xhtmldocs = xtrue)
256 frodo 2
257     AC_ARG_ENABLE(html4-docs,
258     [ --enable-html4-docs Enable generation of HTML 4 docs (default: off)],
259     [case "${enableval}" in
260     yes) html4docs=true ;;
261     no) html4docs=false ;;
262     *) AC_MSG_ERROR(bad value ${enableval} for --enable-html4-docs) ;;
263     esac],[html4docs=false])
264     AM_CONDITIONAL(HTML4DOCS,test x$html4docs = xtrue)
265    
266     AC_ARG_ENABLE(ascii-docs,
267     [ --enable-ascii-docs Enable generation of ASCII docs (default: off)],
268     [case "${enableval}" in
269     yes) asciidocs=true ;;
270     no) asciidocs=false ;;
271     *) AC_MSG_ERROR(bad value ${enableval} for --enable-ascii-docs) ;;
272     esac],[asciidocs=false])
273     AM_CONDITIONAL(ASCIIDOCS,test x$asciidocs = xtrue)
274    
275 frodo 197 AC_ARG_WITH(etcdir,
276     [ --with-etcdir=DIR Set configfile dir (default: SYSCONFDIR/psiconv)],
277     [PSICONVETCDIR=${withval}],
278     [PSICONVETCDIR=${sysconfdir}/psiconv])
279     AC_SUBST(PSICONVETCDIR)
280    
281     AC_ARG_WITH(imagemagick,
282     [ --with-imagemagick enable ImageMagick (default = yes)],
283     [IMAGEMAGICK=$withval],
284     [IMAGEMAGICK='yes'])
285    
286 frodo 210 AC_CONFIG_FILES([Makefile compat/Makefile lib/Makefile lib/psiconv/Makefile program/Makefile program/psiconv/Makefile program/psiconv-config/Makefile program/psiconv-config/psiconv-config program/psiconv-config/psiconv-config.man lib/psiconv/general.h formats/Makefile docs/Makefile program/extra/Makefile etc/Makefile])
287 frodo 116 AC_OUTPUT

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26