1 | dnl Process this file with autoconf to produce a configure script. |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_INIT(psiconv) |
2 | AC_INIT(lib/psiconv) |
3 | AM_INIT_AUTOMAKE(psiconv,0.5.0a) |
3 | AM_INIT_AUTOMAKE(psiconv,0.8.1) |
4 | |
4 | |
5 | AM_CONFIG_HEADER(config.h) |
5 | AM_CONFIG_HEADER(config.h) |
6 | |
6 | |
7 | dnl Checks for programs. |
7 | dnl Checks for programs. |
8 | AM_PROG_LIBTOOL |
8 | AM_PROG_LIBTOOL |
|
|
9 | |
|
|
10 | 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 | |
9 | |
62 | |
10 | dnl Checks for libraries. |
63 | dnl Checks for libraries. |
11 | AC_ARG_WITH(imagemagick, |
64 | AC_ARG_WITH(imagemagick, |
12 | [ --with-imagemagick enable ImageMagick (default = yes)], |
65 | [ --with-imagemagick enable ImageMagick (default = yes)], |
13 | [IMAGEMAGICK=$withval], |
66 | [IMAGEMAGICK=$withval], |
14 | [IMAGEMAGICK='yes']) |
67 | [IMAGEMAGICK='yes']) |
15 | if test x"$IMAGEMAGICK" != xno ; then |
68 | if test x"$IMAGEMAGICK" != xno ; then |
16 | AC_CHECK_LIB(Magick,MagickWarning,IMAGEMAGICK=yes,IMAGEMAGICK=no) |
69 | AC_CHECK_PROG(IMAGEMAGICK,Magick-config,yes,no) |
17 | if test x"$IMAGEMAGICK" = xno ; then |
70 | if test x"$IMAGEMAGICK" != xno ; then |
18 | AC_MSG_WARN(ImageMagick support disabled!) |
71 | CFLAGS_OLD="$CFLAGS" |
|
|
72 | CPPFLAGS_OLD="$CPPFLAGS" |
|
|
73 | LDFLAGS_OLD="$LDFLAGS" |
|
|
74 | LIBS_OLD="$LIBS" |
|
|
75 | CFLAGS="$CFLAGS `Magick-config --cflags`" |
|
|
76 | CPPFLAGS="$CPPFLAGS `Magick-config --cppflags`" |
|
|
77 | LDFLAGS="$LDFLAGS `Magick-config --ldflags`" |
|
|
78 | LIBS="$LIBS `Magick-config --libs`" |
|
|
79 | |
|
|
80 | AC_MSG_CHECKING(whether GetMagickInfo works) |
|
|
81 | AC_TRY_RUN([ #include <magick/magick.h> |
|
|
82 | #include <magick/config.h> |
|
|
83 | #include <stdio.h> |
|
|
84 | extern void OpenModules(void); |
|
|
85 | int main(void) { GetMagickInfo(NULL); |
|
|
86 | #if defined(HasLTDL) |
|
|
87 | OpenModules(); |
|
|
88 | #endif |
|
|
89 | return (NULL == GetMagickInfo(NULL)); }], |
|
|
90 | IMAGEMAGICK=yes,IMAGEMAGICK=no,IMAGEMAGICK=yes) |
|
|
91 | AC_MSG_RESULT($IMAGEMAGICK) |
|
|
92 | LDFLAGS="$LDFLAGS_OLD" |
|
|
93 | LIBS="$LIBS_OLD" |
|
|
94 | dnl Note: CFLAGS can't be set for single directories, so we propagate them |
|
|
95 | if test x"$IMAGEMAGICK" = xno ; then |
|
|
96 | CFLAGS="$CFLAGS_OLD" |
|
|
97 | CPPFLAGS="$CPPFLAGS_OLD" |
|
|
98 | fi |
19 | fi |
99 | fi |
20 | fi |
100 | fi |
21 | if test x"$IMAGEMAGICK" = xyes ; then |
101 | if test x"$IMAGEMAGICK" = xyes ; then |
22 | LIB_MAGICK=-lMagick |
102 | LIB_MAGICK="`Magick-config --libs` `Magick-config --ldflags`" |
23 | AC_DEFINE(IMAGEMAGICK) |
103 | AC_DEFINE(IMAGEMAGICK) |
24 | else |
104 | else |
25 | LIB_MAGICK= |
105 | LIB_MAGICK= |
26 | fi |
106 | fi |
27 | AC_SUBST(LIB_MAGICK) |
107 | AC_SUBST(LIB_MAGICK) |
… | |
… | |
97 | AC_SUBST(INT_16_BIT) |
177 | AC_SUBST(INT_16_BIT) |
98 | AC_SUBST(INT_32_BIT) |
178 | AC_SUBST(INT_32_BIT) |
99 | |
179 | |
100 | dnl Checks for library functions. |
180 | dnl Checks for library functions. |
101 | AC_FUNC_VPRINTF |
181 | AC_FUNC_VPRINTF |
102 | AC_CHECK_FUNCS(strdup) |
|
|
103 | AC_REPLACE_FUNCS(strdup) |
182 | AC_REPLACE_FUNCS(strdup) |
|
|
183 | AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o") |
|
|
184 | |
104 | |
185 | |
105 | dnl With and without functions |
186 | dnl With and without functions |
106 | AC_ARG_ENABLE(html-docs, |
187 | AC_ARG_ENABLE(html-docs, |
107 | [ --disable-html-docs Disable generation of HTML 3.2 docs (default: on)], |
188 | [ --disable-html-docs Disable generation of HTML 3.2 docs (default: on)], |
108 | [case "${enableval}" in |
189 | [case "${enableval}" in |
… | |
… | |
137 | no) rtfdocs=false ;; |
218 | no) rtfdocs=false ;; |
138 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rtf-docs) ;; |
219 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-rtf-docs) ;; |
139 | esac],[rtfdocs=false]) |
220 | esac],[rtfdocs=false]) |
140 | AM_CONDITIONAL(RTFDOCS,test x$rtfdocs = xtrue) |
221 | AM_CONDITIONAL(RTFDOCS,test x$rtfdocs = xtrue) |
141 | |
222 | |
142 | dnl This is stolen from gnome-libs-1.0.14 |
|
|
143 | AC_ARG_ENABLE(compile-warnings, |
|
|
144 | [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.], |
|
|
145 | ,enable_compile_warnings=minimum) |
|
|
146 | |
223 | |
147 | AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
|
|
148 | warnCFLAGS= |
|
|
149 | if test "x$GCC" != xyes; then |
|
|
150 | enable_compile_warnings=no |
|
|
151 | fi |
|
|
152 | if test "x$enable_compile_warnings" != "xno"; then |
|
|
153 | if test "x$GCC" = "xyes"; then |
|
|
154 | case " $CFLAGS " in |
|
|
155 | *[\ \ ]-Wall[\ \ ]*) ;; |
|
|
156 | *) warnCFLAGS="-Wall -Wunused" ;; |
|
|
157 | esac |
|
|
158 | |
|
|
159 | ## -W is not all that useful. And it cannot be controlled |
|
|
160 | ## with individual -Wno-xxx flags, unlike -Wall |
|
|
161 | if test "x$enable_compile_warnings" = "xyes"; then |
|
|
162 | warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith" |
|
|
163 | fi |
|
|
164 | fi |
|
|
165 | fi |
|
|
166 | AC_MSG_RESULT($warnCFLAGS) |
|
|
167 | |
|
|
168 | AC_ARG_ENABLE(iso-c, |
|
|
169 | [ --enable-iso-c Try to warn if code is not ISO C ],, |
|
|
170 | enable_iso_c=no) |
|
|
171 | |
|
|
172 | AC_MSG_CHECKING(what language compliance flags to pass to the C compiler) |
|
|
173 | complCFLAGS= |
|
|
174 | if test "x$enable_iso_c" != "xno"; then |
|
|
175 | if test "x$GCC" = "xyes"; then |
|
|
176 | case " $CFLAGS " in |
|
|
177 | *[\ \ ]-ansi[\ \ ]*) ;; |
|
|
178 | *) complCFLAGS="$complCFLAGS -ansi" ;; |
|
|
179 | esac |
|
|
180 | |
|
|
181 | case " $CFLAGS " in |
|
|
182 | *[\ \ ]-pedantic[\ \ ]*) ;; |
|
|
183 | *) complCFLAGS="$complCFLAGS -pedantic" ;; |
|
|
184 | esac |
|
|
185 | fi |
|
|
186 | fi |
|
|
187 | AC_MSG_RESULT($complCFLAGS) |
|
|
188 | if test "x$cflags_set" != "xyes"; then |
|
|
189 | CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS" |
|
|
190 | cflags_set=yes |
|
|
191 | AC_SUBST(cflags_set) |
|
|
192 | fi |
|
|
193 | |
|
|
194 | AC_OUTPUT([Makefile compat/Makefile lib/Makefile psiconv/Makefile lib/general.h formats/Makefile docs/Makefile]) |
224 | AC_OUTPUT([Makefile compat/Makefile lib/Makefile lib/psiconv/Makefile program/Makefile program/psiconv/Makefile lib/psiconv/general.h formats/Makefile docs/Makefile extra/Makefile]) |