File: configure.ac

package info (click to toggle)
libgnupdf 0.1~20080701-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,732 kB
  • ctags: 3,780
  • sloc: ansic: 64,322; sh: 9,455; makefile: 350; perl: 173
file content (297 lines) | stat: -rw-r--r-- 10,232 bytes parent folder | download
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
dnl Configuration for autoconf
dnl GNU PDF Library

dnl Please process this file with autoconf to get a `configure' script

dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.

dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.

AC_INIT(src/pdf-global.h)
AM_INIT_AUTOMAKE(gnupdf, 0.1)
AM_CONFIG_HEADER(src/config.h)

gl_EARLY

dnl Libtool
AC_PROG_LIBTOOL

dnl Compiler issues
AC_PROG_CC

dnl System
AC_CANONICAL_HOST
canonical=$host

gl_INIT

dnl Search for headers
AC_CHECK_HEADERS(malloc.h)

dnl Search for data types
AC_CHECK_TYPE(size_t, unsigned)
AC_CHECK_TYPE(off_t, long)

dnl Search for functions
AC_FUNC_FSEEKO

dnl Search for required libraries
CHECK_ZLIB
AM_CONDITIONAL([ZLIB], [test "x$have_zlib" = "xyes"])
AC_CHECK_LIB(m,exp,,,)
AC_CHECK_LIB([check],[suite_create],[have_check=yes],[have_check=no],)
AM_CONDITIONAL([CHECK], [test "x$have_check" = "xyes"])
if test "x$have_check" = "xno"; then
  AC_DEFINE([HAVE_CHECK], [1], [Check Unit Test Framework])
fi

AC_CHECK_LIB([iconv],[iconv_open],[have_iconv=yes],[have_iconv=no],)
AM_CONDITIONAL([ICONV], [test "x$have_iconv" = "xyes"])

dnl Search for required programs for building the sources
AC_PROG_AWK
if test x$AWK = "xno"; then
AC_MSG_ERROR([cannot find a suitable `awk' program. Please install it and rerun `configure'.])
fi
AC_PATH_PROG([PATH_TO_AWK],$AWK)
AC_SUBST(PATH_TO_AWK)

dnl Search for programs for building documentation
AC_CHECK_PROG([have_makeinfo], [makeinfo], [yes], [no],,)
if test "x$have_makeinfo" = "xno"; then
AC_MSG_ERROR([cannot find the `makeinfo' program. Please install the texinfo package and rerun `configure'.])
fi

AC_CHECK_PROG([have_texi2html], [texi2html], [yes], [no],,)
AM_CONDITIONAL([TEXI2HTML], [test "x$have_texi2html" = "xyes"])
if test "x$have_texi2html" = "xyes" ; then
texihtmlprogram=texi2html
else
texihtmlprogram=makeinfo
fi

AC_CHECK_PROG([have_taskjuggler], [taskjuggler], [yes], [no],,)
AM_CONDITIONAL([TASKJUGGLER], [test "x$have_taskjuggler" = "xyes"])

dnl Manage the compilation level
dnl The GNU PDF library is composed by several layers. The following
dnl `compilation levels' are defined allowing the user to compile a
dnl library composed by a specified subset of these layers.
dnl
dnl level\layer | base | object | document | page |
dnl ------------+------+--------+----------+------+
dnl      0      |  *   |        |          |      |
dnl      1      |  *   |    *   |          |      | 
dnl      2      |  *   |    *   |    *     |      |
dnl      3      |  *   |    *   |    *     |   *  |
dnl 
dnl Note that the base layer is always included in the library
dnl regardless the compilation level.

AC_ARG_VAR(PDFLIB_LEVEL,[A level code specifying the library layers to be compiled (default is 3=all layers)])
dnl The default compilation level is 3.
if test "x$PDFLIB_LEVEL" = "x" ; then
PDFLIB_LEVEL=3
fi

AM_CONDITIONAL([COMPILE_BASE_LAYER], [test "true" = "true"])
AM_CONDITIONAL([COMPILE_OBJECT_LAYER], [test "x$PDFLIB_LEVEL" = "x1" -o \
                                             "x$PDFLIB_LEVEL" = "x2" -o \
                                             "x$PDFLIB_LEVEL" = "x3"])
AM_CONDITIONAL([COMPILE_DOCUMENT_LAYER], [test "x$PDFLIB_LEVEL" = "x2" -o \
                                               "x$PDFLIB_LEVEL" = "x3"])
AM_CONDITIONAL([COMPILE_PAGE_LAYER], [test x$PDFLIB_LEVEL = "x3"])


dnl Project management resources
prmgt_mode=no
AC_ARG_ENABLE([prmgt], AS_HELP_STRING([--enable-prmgt],
                                      [build project management resources (default is NO)]), 
              [prmgt_mode=yes], [prmgt_mode=no])

AM_CONDITIONAL([PRMGT],[test "x$prmgt_mode" = "xyes"])
if test "x$prmgt_mode" = "xyes" ; then 

if test "x$have_taskjuggler" = "xyes" ; then
   AC_CHECK_PROG([have_dot], [dot], [yes], [no],,)
   if test "x$have_dot" = "xno"; then
   AC_MSG_ERROR([cannot find the `dot' program. Please install the graphviz package and rerun `configure'.])
   fi
   AC_CHECK_PROG([have_fdp], [fdp], [yes], [no],,)
   if test "x$have_fdp" = "xno"; then
   AC_MSG_ERROR([cannot find the `fdp' program. Please install the graphviz package and rerun `configure'.])
   fi
fi

AC_CHECK_PROG([have_pmccabe], [pmccabe], [yes], [no],,)
if test "x$have_pmccabe" = "xno"; then
AC_MSG_ERROR([cannot find the `pmccabe' program. Please install it and rerun `configure'.])
fi

AC_PATH_PROG([TCLSH], [tclsh], [no],)
if test "x$TCLSH" = "xno"; then
AC_MSG_ERROR([cannot find a suitable tcl interpreter. Please install it and rerun `configure'.])
fi

fi # prmgt_mode

# debug_*_mode
debug_base_mode=no
debug_object_mode=no
debug_document_mode=no
debug_page_mode=no
PDFLIB_DEBUG_DESCR=""
AC_ARG_ENABLE([debug-base], AS_HELP_STRING([--enable-debug-base],
                                      [debug mode at the base layer (default is NO)]), 
              [debug_base_mode=yes], [debug_base_mode=no])

AC_ARG_ENABLE([debug-object], AS_HELP_STRING([--enable-debug-object],
                                      [debug mode at the object layer (default is NO)]), 
              [debug_object_mode=yes], [debug_object_mode=no])

AC_ARG_ENABLE([debug-document], AS_HELP_STRING([--enable-debug-document],
                                      [debug mode at the document layer (default is NO)]), 
              [debug_document_mode=yes], [debug_document_mode=no])

AC_ARG_ENABLE([debug-page], AS_HELP_STRING([--enable-debug-page],
                                      [debug mode at the page layer (default is NO)]), 
              [debug_page_mode=yes], [debug_page_mode=no])

if test "x$debug_base_mode" = "xyes"; then
  AC_DEFINE([HAVE_DEBUG_BASE], [1], [Debugging Base Layer])
  PDFLIB_DEBUG_DESCR="base, "
fi 
if test "x$debug_object_mode" = "xyes"; then
  AC_DEFINE([HAVE_DEBUG_OBJECT], [1], [Debugging Object Layer])
  PDFLIB_DEBUG_DESCR="${PDFLIB_DEBUG_DESCR}object, "
fi
if test "x$debug_document_mode" = "xyes"; then
  AC_DEFINE([HAVE_DEBUG_DOCUMENT], [1], [Debugging Document Layer])
  PDFLIB_DEBUG_DESCR="${PDFLIB_DEBUG_DESCR}document, "
fi
if test "x$debug_page_mode" = "xyes"; then
  AC_DEFINE([HAVE_DEBUG_PAGE], [1], [Debugging Page Layer])
  PDFLIB_DEBUG_DESCR="${PDFLIB_DEBUG_DESCR}page"
fi

if test "x$PDFLIB_DEBUG_DESCR" = "x"; then
  PDFLIB_DEBUG_DESCR="all disabled"
fi

# end debug_*_mode

dnl gcov compilation
use_gcov=no
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage],
                                        [Compile the library with code coverage support (default is NO)]),
                                        [use_gcov=yes], [use_gcov=no])
AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])


dnl nocheck (simple replacement of Check framework when this is not available)
use_nocheck=no
AC_ARG_ENABLE([nocheck], AS_HELP_STRING([--enable-nocheck],
                                      [Use built-in nocheck instead of Check (default is NO)]), 
              [use_nocheck=yes], [use_nocheck=no])
if test "x$use_nocheck" = "xyes"; then
  AC_DEFINE([HAVE_NOCHECK], [1], [Use No-Check instead of Check])
fi
AM_CONDITIONAL([NOCHECK], [test "x$use_nocheck" = "xyes"])



dnl Check if Unit testing support is available with Check or No-Check
ut_support=no
AM_CONDITIONAL([COMPILE_UT], [test "x$use_nocheck" = "xyes" -o "x$have_check" = "xyes"])
if test "x$use_nocheck" = "xyes"; then
  ut_framework="(builtin No-Check)"
  ut_support=yes
else
  if test "x$have_check" = "xyes"; then
    ut_framework="(Check)"
    ut_support=yes
  fi
fi

dnl Get system endianness information
AC_C_BIGENDIAN()
if test "x$ac_cv_c_bigendian" = "xno"; then
  AC_DEFINE([PDF_IS_BIG_ENDIAN], [0], [Big endian?])
else
  AC_DEFINE([PDF_IS_BIG_ENDIAN], [1], [Big endian?])
fi


dnl OS-based compilation options
compile_w32_system=no
case "${host}" in
    *-mingw32*)
        compile_w32_system=yes
        ;;
    *)
        ;;
esac

dnl Specific W32 needs of compilation
AM_CONDITIONAL([COMPILE_W32_SYSTEM], [test "x$compile_w32_system" = "xyes"])



dnl Generate output files
AC_OUTPUT(Makefile lib/Makefile src/Makefile torture/Makefile torture/unit/Makefile doc/Makefile utils/Makefile prmgt/Makefile prmgt/pmccabe2html prmgt/apic2wiki prmgt/testlog2wiki prmgt/docfuncs prmgt/tsdfuncs src/extract-public-hdr build-aux/Makefile)

dnl Report configuration results

if test "x$PDFLIB_LEVEL" = "x3"; then
   PDFLIB_LEVEL_DESCR="build all layers"
fi
if test "x$PDFLIB_LEVEL" = "x2"; then
   PDFLIB_LEVEL_DESCR="build base, object and page layers"
fi
if test "x$PDFLIB_LEVEL" = "x1"; then
   PDFLIB_LEVEL_DESCR="build base and object layers"
fi
if test "x$PDFLIB_LEVEL" = "x0"; then
   PDFLIB_LEVEL_DESCR="build base layer"
fi

echo "
Configured for \`${canonical}'.

  Compilation level:                        ${PDFLIB_LEVEL} (${PDFLIB_LEVEL_DESCR})
  Using FlateDecode filter?                 ${have_zlib}
  With unit tests support?                  ${ut_support} ${ut_framework}
  Program to build html manuals             ${texihtmlprogram}
  Build project management resources?       ${prmgt_mode}
  Layers with debug mode enabled            ${PDFLIB_DEBUG_DESCR}
  Generate code coverage information        ${use_gcov}
"

dnl Report warnings

if test "x$have_zlib" = "xno" ; then
echo "
WARNING: you are going to build a library without FlateDecode support. 
         That means you wont be able to process many PDF files."
fi

if test "ut_support" = "xno" ; then
echo "
WARNING: you are going to build the library without unit testing support.
         If you want to be able to perform the unit testing you should
         either install the 'check' library or run the configure with
         the --enable-nocheck option."
fi

dnl End of configure.ac