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

Annotation of /psiconv/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 253 - (hide annotations)
Thu Apr 29 22:14:09 2004 UTC (19 years, 11 months ago) by frodo
File size: 7927 byte(s)
(Frodo) Bump up the libary version and program version

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 252 #include <time.h>
85 frodo 152 #include <magick/api.h>
86 frodo 118 int main(void) { ExceptionInfo exception;
87     GetExceptionInfo(&exception);
88     OpenModules(&exception);
89     return (NULL == GetMagickInfo(NULL,&exception)); }],
90 frodo 152 IMAGEMAGICK=new,IMAGEMAGICK=no,IMAGEMAGICK=no)
91     if test x"$IMAGEMAGICK" = xno ; then
92     AC_TRY_RUN([ #include <magick/magick.h>
93     int main(void) { ExceptionInfo exception;
94     GetExceptionInfo(&exception);
95     OpenModules(&exception);
96     return (NULL == GetMagickInfo(NULL,&exception)); }],
97     IMAGEMAGICK=old,IMAGEMAGICK=no,IMAGEMAGICK=no)
98     fi
99 frodo 50 AC_MSG_RESULT($IMAGEMAGICK)
100 frodo 53 LDFLAGS="$LDFLAGS_OLD"
101     LIBS="$LIBS_OLD"
102     dnl Note: CFLAGS can't be set for single directories, so we propagate them
103     if test x"$IMAGEMAGICK" = xno ; then
104     CFLAGS="$CFLAGS_OLD"
105     CPPFLAGS="$CPPFLAGS_OLD"
106     fi
107 frodo 50 fi
108 frodo 16 fi
109 frodo 152 if test x"$IMAGEMAGICK" != xno ; then
110 frodo 53 LIB_MAGICK="`Magick-config --libs` `Magick-config --ldflags`"
111 frodo 116 AC_DEFINE(IMAGEMAGICK,1,[ImageMagick availability])
112 frodo 152 if test x"$IMAGEMAGICK" = xold ; then
113     AC_DEFINE(IMAGEMAGICK_OLD,1,[ImageMagick old API version])
114     fi
115 frodo 16 else
116     LIB_MAGICK=
117     fi
118     AC_SUBST(LIB_MAGICK)
119 frodo 2
120     dnl Checks for header files.
121     AC_HEADER_STDC
122     AC_CHECK_HEADERS(unistd.h)
123    
124     dnl Checks for typedefs, structures, and compiler characteristics.
125     AC_C_CONST
126     AC_TYPE_SIZE_T
127    
128     dnl Here we check for large enough integer types. This is not quite
129     dnl good enough, but it should work almost always.
130    
131     AC_CHECK_SIZEOF(char,1)
132     AC_CHECK_SIZEOF(short,1)
133     AC_CHECK_SIZEOF(int,2)
134     AC_CHECK_SIZEOF(long,4)
135    
136     AC_MSG_CHECKING(for an 8 bit integer type)
137     if test $ac_cv_sizeof_char -ge 1 ; then
138     INT_8_BIT=char
139     AC_MSG_RESULT(char)
140     elif test $ac_cv_sizeof_short -ge 1 ; then
141     INT_8_BIT=short
142     AC_MSG_RESULT(short)
143     elif test $ac_cv_sizeof_int -ge 1 ; then
144     AC_MSG_RESULT(int)
145     elif test $ac_cv_sizeof_long -ge 1 ; then
146     INT_8_BIT=long
147     AC_MSG_RESULT(long)
148     else
149     AC_MSG_ERROR(No integer type of at least 8 bits found)
150     fi
151    
152     AC_MSG_CHECKING(for a 16 bit integer type)
153     if test $ac_cv_sizeof_char -ge 2 ; then
154     INT_16_BIT=char
155     AC_MSG_RESULT(char)
156     elif test $ac_cv_sizeof_short -ge 2 ; then
157     INT_16_BIT=short
158     AC_MSG_RESULT(short)
159     elif test $ac_cv_sizeof_int -ge 2 ; then
160     INT_16_BIT=int
161     AC_MSG_RESULT(int)
162     elif test $ac_cv_sizeof_long -ge 2 ; then
163     INT_16_BIT=long
164     AC_MSG_RESULT(long)
165     else
166     AC_MSG_ERROR(No integer type of at least 16 bits found)
167     fi
168    
169     AC_MSG_CHECKING(for a 32 bit integer type)
170     if test $ac_cv_sizeof_char -ge 4 ; then
171     INT_32_BIT=char
172     AC_MSG_RESULT(char)
173     elif test $ac_cv_sizeof_short -ge 4 ; then
174     INT_32_BIT=short
175     AC_MSG_RESULT(short)
176     elif test $ac_cv_sizeof_int -ge 4 ; then
177     INT_32_BIT=int
178     AC_MSG_RESULT(int)
179     elif test $ac_cv_sizeof_long -ge 4 ; then
180     INT_32_BIT=long
181     AC_MSG_RESULT(long)
182     else
183     AC_MSG_ERROR(No integer type of at least 32 bits found)
184     fi
185    
186     AC_SUBST(INT_8_BIT)
187     AC_SUBST(INT_16_BIT)
188     AC_SUBST(INT_32_BIT)
189    
190     dnl Checks for library functions.
191     AC_FUNC_VPRINTF
192     AC_REPLACE_FUNCS(strdup)
193 frodo 186 AC_CHECK_FUNC(getopt_long,getopt=yes,getopt=no)
194     if test $getopt = no; then
195     AC_LIBOBJ([getopt])
196     AC_LIBOBJ([getopt1])
197     fi
198 frodo 2
199 frodo 142 AC_ARG_ENABLE(dmalloc,
200     [ --enable-dmalloc Enable dmalloc for developers (default:off)],
201     [case "${enableval}" in
202     yes) dmalloc=yes ;;
203     no) dmalloc=no ;;
204     *) AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc) ;;
205     esac],[dmalloc=false])
206     if test x"$dmalloc" = xyes; then
207     AC_CHECK_LIB(dmalloc,malloc,dmalloc=yes,dmalloc=no)
208     fi
209     if test x"$dmalloc" = xyes; then
210     AC_CHECK_HEADER(dmalloc.h,dmalloc=yes,dmalloc=no)
211     fi
212     if test x"$dmalloc" = xyes ; then
213     LIB_DMALLOC=-ldmalloc
214     AC_DEFINE(DMALLOC,1,[DMalloc availability])
215     else
216     LIB_DMALLOC=
217     fi
218     AC_SUBST(LIB_DMALLOC)
219 frodo 21
220 frodo 2 dnl With and without functions
221 frodo 193 AC_ARG_ENABLE(xhtml-docs,
222     [ --disable-xhtml-docs Disable generation of XHTML docs (default: on)],
223 frodo 2 [case "${enableval}" in
224 frodo 193 yes) xhtmldocs=true ;;
225     no) xhtmldocs=false ;;
226     *) AC_MSG_ERROR(bad value ${enableval} for --enable-xhtml-docs) ;;
227     esac],[xhtmldocs=true])
228     AM_CONDITIONAL(XHTMLDOCS,test x$xhtmldocs = xtrue)
229 frodo 2
230     AC_ARG_ENABLE(html4-docs,
231     [ --enable-html4-docs Enable generation of HTML 4 docs (default: off)],
232     [case "${enableval}" in
233     yes) html4docs=true ;;
234     no) html4docs=false ;;
235     *) AC_MSG_ERROR(bad value ${enableval} for --enable-html4-docs) ;;
236     esac],[html4docs=false])
237     AM_CONDITIONAL(HTML4DOCS,test x$html4docs = xtrue)
238    
239     AC_ARG_ENABLE(ascii-docs,
240     [ --enable-ascii-docs Enable generation of ASCII docs (default: off)],
241     [case "${enableval}" in
242     yes) asciidocs=true ;;
243     no) asciidocs=false ;;
244     *) AC_MSG_ERROR(bad value ${enableval} for --enable-ascii-docs) ;;
245     esac],[asciidocs=false])
246     AM_CONDITIONAL(ASCIIDOCS,test x$asciidocs = xtrue)
247    
248 frodo 197 AC_ARG_WITH(etcdir,
249     [ --with-etcdir=DIR Set configfile dir (default: SYSCONFDIR/psiconv)],
250     [PSICONVETCDIR=${withval}],
251     [PSICONVETCDIR=${sysconfdir}/psiconv])
252     AC_SUBST(PSICONVETCDIR)
253    
254     AC_ARG_WITH(imagemagick,
255     [ --with-imagemagick enable ImageMagick (default = yes)],
256     [IMAGEMAGICK=$withval],
257     [IMAGEMAGICK='yes'])
258    
259 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])
260 frodo 116 AC_OUTPUT

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