~ubuntu-branches/ubuntu/wily/luatex/wily

« back to all changes in this revision

Viewing changes to source/libs/zziplib/zziplib-0.13.58/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2010-04-29 00:47:19 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100429004719-o42etkqe90n97b9e
Tags: 0.60.1-1
* new upstream release, adapt build-script patch
* disable patch: upstream-epstopdf_cc_no_xpdf_patching, included upstream
* disable patch: libpoppler-0.12, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_INIT([zziplib.spec])
 
2
AC_PREREQ(2.49)
 
3
AC_COPYRIGHT([Guido Draheim <guido@gmx.de> for ZZipLib.SF.net])
 
4
AC_REVISION($Revision: 1.15 $)
 
5
AC_CONFIG_AUX_DIR([uses])
 
6
AC_CONFIG_MACRO_DIR([m4])
 
7
# =======================================================================
 
8
AC_CANONICAL_SYSTEM
 
9
dnl AM_ENABLE_MULTILIB([Makefile],[$host])
 
10
AX_ENABLE_BUILDDIR_UNAME
 
11
AC_SET_DEFAULT_PATHS_SYSTEM
 
12
# -----------------------------------------------------------------------
 
13
AC_ARG_ENABLE([thread-safe],
 
14
AC_HELP_STRING([--disable-thread-safe],[disable thread-safe libtool option])
 
15
   ,,[ enable_thread_safe="yes"])
 
16
THREAD_SAFE=""
 
17
test "$enable_thread_safe" = "yes" && THREAD_SAFE="-thread-safe"
 
18
test "$enable_thread_safe" = "$host_os" && THREAD_SAFE="-thread-safe"
 
19
AC_SUBST(THREAD_SAFE)
 
20
if test -n "$THREAD_SAFE" ; then
 
21
  AC_MSG_RESULT(...using thread-safe linkage)
 
22
else
 
23
  AC_MSG_RESULT(disabled thread-safe linkage)
 
24
fi
 
25
# ----------------------------------------------------------------
 
26
AC_MSG_CHECKING(zlib install prefix)
 
27
AC_ARG_WITH(zlib, AC_HELP_STRING(
 
28
    [--with-zlib],[zlib prefix (e.g. '$HOME/software')])
 
29
    ,,[with_zlib="no"])
 
30
if test "${with_zlib}" = yes ; then # choose --prefix paths
 
31
   if test "${prefix}" = NONE ; then
 
32
      AC_MSG_RESULT(oops, but only itself...)
 
33
      AC_MSG_ERROR(--with-zlib requires a path argument or a --prefix path set)
 
34
   fi
 
35
   with_zlib="$prefix"
 
36
fi
 
37
 
 
38
case ".$with_zlib" in
 
39
   .no|.no,*)
 
40
      AC_MSG_RESULT(none)
 
41
      with_zlib="no, not configured" ;;
 
42
  ./usr)
 
43
      AC_MSG_RESULT([oops, ignored (may try --with-zlib=/usr/.)])
 
44
      with_zlib="no, /usr ignored" ;;
 
45
  *)  if test ! -d "$with_zlib/include" ; then
 
46
         AC_MSG_RESULT(oops, given but...)
 
47
         AC_MSG_ERROR("$with_zlib/include" is not a directory)
 
48
      fi
 
49
      if test ! -d "$with_zlib/lib" ; then
 
50
         AC_MSG_RESULT(oops, given but...)
 
51
         AC_MSG_ERROR("$with_zlib/lib" is not a directory)
 
52
      fi
 
53
      AC_MSG_RESULT($with_zlib)
 
54
      ZLIB_INCL="-I$with_zlib/include"
 
55
      ZLIB_LDIR="-L$with_zlib/lib"
 
56
      AC_MSG_RESULT(..adding CPPFLAGS $ZLIB_INCL)
 
57
      AC_MSG_RESULT(..adding LDFLAGS  $ZLIB_LDIR)
 
58
      CPPFLAGS="$CPPFLAGS $ZLIB_INCL"
 
59
      LDFLAGS="$LDFLAGS $ZLIB_LDIR"
 
60
  ;;
 
61
esac
 
62
AC_SUBST(ZLIB_INCL)
 
63
AC_SUBST(ZLIB_LDIR)
 
64
# -----------------------------------------------------------------------
 
65
AX_SPEC_DEFAULTS
 
66
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
 
67
dnl test ".$CFLAGS" = "." && CFLAGS=""
 
68
AC_PROG_CC
 
69
dnl test ".$CFLAGS" = "." && test "$GCC" = "yes" && CFLAGS="-O3"
 
70
AC_PROG_INSTALL
 
71
AC_LIBTOOL_WIN32_DLL
 
72
AM_PROG_LIBTOOL
 
73
AX_SET_VERSION_INFO
 
74
 
 
75
# -----------------------------------------------------------------------
 
76
AC_MSG_RESULT([creating zzip/_msvc.in via zzip/_msvc.sed of config.h.in])
 
77
test -d zzip || mkdir zzip
 
78
sed -f $srcdir/zzip/_msvc.sed $srcdir/config.h.in >zzip/_msvc.in
 
79
AC_CONFIG_HEADERS([config.h])
 
80
AX_PREFIX_CONFIG_H([zzip/_config.h],[zzip],[config.h])
 
81
AX_PREFIX_CONFIG_H([zzip/_msvc.h],[zzip],[zzip/_msvc.in])
 
82
AM_MAINTAINER_MODE
 
83
 
 
84
AX_CREATE_PKGCONFIG_INFO(dnl
 
85
[zzip/zziplib.pc], [zzip-zlib-config],[-lzzip],,[ ])
 
86
# -----------------------------------------------------------------------
 
87
echo extrac.t..
 
88
AX_PAX_TAR_CREATE
 
89
AX_PAX_TAR_EXTRACT
 
90
AC_PATH_PROGS(PERL, perl5 perl, echo no perl found for)
 
91
AC_PATH_PROGS(PYTHON, python, echo no python found for)
 
92
AC_PATH_PROGS(MKZIP, zip pkzip, :)
 
93
AC_PATH_PROGS(XMLTO, xmlto, :)
 
94
 
 
95
AC_C_INLINE
 
96
AC_C_CONST
 
97
ACX_C_RESTRICT
 
98
AC_STDC_HEADERS
 
99
AC_HEADER_DIRENT
 
100
AC_CHECK_HEADERS(stdint.h unistd.h windows.h winnt.h winbase.h sys/int_types.h)
 
101
AC_CHECK_HEADERS(sys/types.h sys/mman.h sys/stat.h sys/param.h) dnl posix'ish
 
102
AC_CHECK_HEADERS(io.h direct.h zlib.h byteswap.h)
 
103
AC_CHECK_HEADERS(fnmatch.h)
 
104
AC_CHECK_FUNCS( strcasecmp strndup )
 
105
 
 
106
AC_TYPE_OFF_T
 
107
AC_TYPE_SIZE_T
 
108
dnl AC_TYPE_SSIZE_T
 
109
AC_CHECK_TYPE(ssize_t,int)
 
110
AC_CHECK_TYPE(off64_t,_zzip_off_t)
 
111
AC_CHECK_TYPE(__int64,long long)
 
112
AC_COMPILE_CHECK_SIZEOF(short)
 
113
AC_COMPILE_CHECK_SIZEOF(int)
 
114
AC_COMPILE_CHECK_SIZEOF(long)
 
115
AC_C_BIGENDIAN
 
116
AX_CHECK_ALIGNED_ACCESS_REQUIRED
 
117
dnl -------------------------------------------------------------
 
118
# the default is _disabled_!! anyway, result is prefixed in zzip/_config.h!!
 
119
AC_SYS_LARGEFILE_SENSITIVE
 
120
test ".$LARGEFILE_CFLAGS" = "." && LARGEFILE_CFLAGS=""
 
121
AC_ARG_WITH(largefile,AC_HELP_STRING(
 
122
    [--with-largefile],[compile as off64_t instead of 32bit off_t])
 
123
    ,,[with_largefile="no"])
 
124
if test ".$ac_cv_sys_largefile_sensitive" = ".no" ; then
 
125
  AC_MSG_RESULT(compiles library with the only off_t seen)
 
126
elif test ".$with_largefile" != ".no" ; then
 
127
  AC_MSG_RESULT(compiles library as 64bit off_t variant dnl
 
128
- and renaming some function names)
 
129
  LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGEFILE_SOURCE"
 
130
  AC_MSG_RESULT(..adding CFLAGS $LARGEFILE_CFLAGS)
 
131
  CFLAGS="$CFLAGS $LARGEFILE_CFLAGS"
 
132
  AC_MSG_RESULT(..adding 64 into RELEASE_INFO for the libraries)
 
133
  RELEASE_INFO="$RELEASE_INFO-64"
 
134
else
 
135
  AC_MSG_RESULT(compiles library as 32bit off_t variant dnl
 
136
- largefile is not the default here)
 
137
fi
 
138
AC_SUBST(LARGEFILE_CFLAGS)
 
139
dnl -------------------------------------------------------------
 
140
AC_MSG_CHECKING(for zlib being found)
 
141
if test "_$ac_cv_header_zlib_h" != "_yes" ; then
 
142
  AC_MSG_RESULT(dnl
 
143
...oops: zlib.h not found - try adding some CPPFLAGS to configure call)
 
144
         AC_MSG_RESULT(dnl
 
145
...note: and when linkage fails you might also need to set some LDFLAGS)
 
146
  case "$prefix" in
 
147
    NONE|/usr)
 
148
            AC_MSG_RESULT(dnl
 
149
...note: both can be set by specifying the install prefix of the zlib library)
 
150
            AC_MSG_RESULT(dnl
 
151
...note: via --with-zlib=path ... it will test for -Ipath/include -Lpath/lib)
 
152
    ;;
 
153
    *) if test -d $prefix/include ; then
 
154
         AC_MSG_RESULT(dnl
 
155
...note: -I$prefix/include is not added to CPPFLAGS automatically and)
 
156
         AC_MSG_RESULT(dnl
 
157
...note: neither is -L$prefix/lib for LDFLAGS .. both will be if you specify)
 
158
         AC_MSG_RESULT(dnl
 
159
...note: --with-zlib to configure call, or use --with-zlib=installprefix)
 
160
       fi
 
161
     ;;
 
162
  esac
 
163
  AC_MSG_ERROR(zlib.h not found: "zlib" is required to build "$PACKAGE")
 
164
  exit 1
 
165
fi
 
166
cat >conftest.c <<EOF
 
167
#include <zlib.h>
 
168
const char* zlib_VeRsIoN = ZLIB_VERSION "dEtEcT";
 
169
EOF
 
170
ZLIB_VERSION=`(eval "$ac_cpp conftest.c") 2>/dev/null \
 
171
| grep zlib_VeRsIoN | sed -e 's,.*= *.,,' -e 's,. *.dEtEcT.*,,'`
 
172
rm conftest.c
 
173
AC_SUBST(ZLIB_VERSION)
 
174
AC_MSG_RESULT(yes - $ZLIB_VERSION)
 
175
# ----------------------------------------------------------------
 
176
AC_MSG_CHECKING(docdir default)
 
177
AC_ARG_WITH(docdir, AC_HELP_STRING(
 
178
    [--with-docdir],[docdir prefix (prefix/share/doc)])
 
179
    ,,[with_docdir="no"])
 
180
case "${with_docdir}" in
 
181
 prefix/*)  docdir=` echo "$withval" | sed 's/^prefix/${prefix}'` ;;
 
182
 datadir/*) docdir=` echo "$withval" | sed 's/^datadir/${datadir}'` ;;
 
183
 yes) docdir='${prefix}/doc' ;;
 
184
 no)  docdir='${datadir}/doc' ;;
 
185
 /*|\\*|[a-zA-Z]:*) docdir="$with_docdir"  ;;
 
186
 *) AC_MSG_RESULT(oops)
 
187
    AC_MSG_ERROR(bad value ${withval} for --with-docdir)
 
188
 ;;
 
189
esac
 
190
AC_SUBST(docdir)
 
191
AC_MSG_RESULT($docdir)
 
192
# ----------------------------------------------------------------
 
193
AC_MSG_CHECKING(whether using debugging messages in libraries)
 
194
AC_ARG_WITH(debug, AC_HELP_STRING(
 
195
    [--with-debug],[debug messages in library])
 
196
    , [case "${withval}" in
 
197
                yes|no) with_debug="$withval" ;;
 
198
                *) AC_MSG_RESULT(oops)
 
199
                   AC_MSG_ERROR(bad value ${withval} for --with-debug) ;;
 
200
       esac], [with_debug="no"])
 
201
test "$with_debug" != "yes" && with_debug="no" # yes or no
 
202
test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG"
 
203
result="$with_debug" ; test "$result" = "yes" && result="yes, added -DDEBUG"
 
204
AC_MSG_RESULT($result)
 
205
if test "$with_debug" = "yes" ; then if test -n "$RELEASE_INFO" ; then
 
206
   RELEASE_INFO="$RELEASE_INFO-dbg"
 
207
   AC_MSG_RESULT(modified release, $RELEASE_INFO)
 
208
fi fi
 
209
# ----------------------------------------------------------------
 
210
AC_MSG_CHECKING(whether thread stack is too small for bufsiz buffers)
 
211
 # many embedded platforms, superthreaded systems and kernel usage
 
212
 # will severely limit the stackspace for its threads. Use _LOWSTK
 
213
 # compile-define on those platforms.
 
214
AC_ARG_WITH(lowstk, AC_HELP_STRING(
 
215
    [--with-lowstk], [limited thread stack])
 
216
    , [case "${withval}" in
 
217
                yes|no|auto) with_lowstk="$withval" ;;
 
218
                *) AC_MSG_ERROR(bad value ${withval} for --with-lowstk) ;;
 
219
       esac], [with_lowstk="auto"])
 
220
if test "$with_lowstk" = "auto"; then
 
221
  case $target in
 
222
        *-palmos-*) $with_lowstk="yes" ;;
 
223
  esac
 
224
fi
 
225
test "$with_lowstk" != "yes" && with_lowstk="no" # yes or no
 
226
test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK"
 
227
result="$with_lowstk" ; test "$result" = "yes" && result="yes, added -D_LOWSTK"
 
228
AC_MSG_RESULT($with_lowstk)
 
229
# ---------------------------------------------------------------
 
230
AC_MSG_CHECKING(whether can use mmap for file scanning)
 
231
 # system with mmap are probably better performing an searching
 
232
 # and parsing - atleast memory consumption is far better
 
233
AC_ARG_ENABLE(mmap, AC_HELP_STRING(
 
234
   [--disable-mmap],[disable mmap usage])
 
235
   , [case "${enableval}" in
 
236
                yes|no|auto) enable_mmap="${enableval}" ;;
 
237
                *) AC_MSG_RESULT(oops)
 
238
                   AC_MSG_ERROR(bad value ${enableval} for --disable-mmap) ;;
 
239
      esac], [enable_mmap="auto"])
 
240
if test "$enable_mmap" = "auto"
 
241
then
 
242
    test "$ac_cv_header_winbase_h"  && enable_mmap="yes, winbase.h"
 
243
    test "$ac_cv_header_sys_mman_h" && enable_mmap="yes, sys/mman.h"
 
244
fi
 
245
case "$enable_mmap" in
 
246
   yes|yes,*) CFLAGS="$CFLAGS -D_USE_MMAP"
 
247
      AC_MSG_RESULT($enable_mmap, added -D_USE_MMAP) ;;
 
248
   *) enable_mmap="no"
 
249
      AC_MSG_RESULT(no (just a bit slower)) ;;
 
250
esac
 
251
# ---------------------------------------------------------------
 
252
AC_MSG_CHECKING(whether making SDL parts)
 
253
SDL=""
 
254
AC_ARG_ENABLE(sdl, AC_HELP_STRING(
 
255
    [--enable-sdl],[enable SDL usage (if present)])
 
256
    ,,[enable_sdl="no"])
 
257
if test "$enable_sdl" = "no" ; then
 
258
   AC_MSG_RESULT([no, disabled])
 
259
else
 
260
   enable_sdl=`sdl-config --version 2>/dev/null`
 
261
   case ".$enable_sdl" in
 
262
     .1.*) AC_MSG_RESULT([yes, for SDL $enable_sdl])
 
263
           SDL="SDL" ;;
 
264
     .2.*) AC_MSG_RESULT([yes, untested $enable_sdl])
 
265
           SDL="SDL" ;;
 
266
     *)    AC_MSG_RESULT([no, $enable_sdl]) ;;
 
267
   esac
 
268
fi
 
269
AC_SUBST(SDL)
 
270
# ---------------------------------------------------------------
 
271
AC_MSG_CHECKING(running extra tests on make check)
 
272
if test "MKZIP" != ":" ; then
 
273
  AC_MSG_RESULT(yes)
 
274
  ZIPTESTS=""
 
275
else
 
276
  AC_MSG_RESULT(no)
 
277
  ZIPTESTS="#"
 
278
fi
 
279
AC_SUBST(ZIPTESTS)
 
280
# ---------------------------------------------------------------
 
281
AC_MSG_CHECKING(link options)
 
282
case "$host_os" in
 
283
  mingw*)
 
284
    ZZIPLIB_LDFLAGS="-no-undefined -export-all-symbols -mconsole"
 
285
    RESOLVES=' '
 
286
  ;;
 
287
  *)
 
288
 
 
289
    if test ".$can_build_shared" = .no
 
290
    then ZZIPLIB_LDFLAGS=""
 
291
    else ZZIPLIB_LDFLAGS="--export-dynamic"
 
292
    fi
 
293
    RESOLVES=' # '
 
294
  ;;
 
295
esac
 
296
AC_MSG_RESULT([$ZZIPLIB_LDFLAGS $RESOLVES])
 
297
AC_SUBST([ZZIPLIB_LDFLAGS])
 
298
AC_SUBST([RESOLVES])
 
299
# ---------------------------------------------------------------
 
300
AX_MAINTAINER_MODE_AUTO_SILENT
 
301
AX_NOT_ENABLE_FRAME_POINTER
 
302
AX_CFLAGS_WARN_ALL
 
303
AX_CFLAGS_GCC_OPTION(-Wpointer-arith)
 
304
AX_CFLAGS_GCC_OPTION(-Wsign-compare)
 
305
AX_CFLAGS_GCC_OPTION(-Wmissing-declarations)
 
306
AX_CFLAGS_GCC_OPTION(-Wdeclaration-after-statement)
 
307
AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration)
 
308
AX_CFLAGS_GCC_OPTION(-Wstrict-aliasing)
 
309
AX_CFLAGS_GCC_OPTION(-Warray-bounds)
 
310
AX_CFLAGS_NO_WRITABLE_STRINGS
 
311
AX_CFLAGS_STRICT_PROTOTYPES
 
312
# ---------------------------------------------------------------
 
313
AX_ENABLE_DEFAULT_PKGCONFIGDIR
 
314
AX_ENABLE_DEFAULT_ACLOCALDIR
 
315
AC_SUBST([CONFIG_FILES])
 
316
AC_OUTPUT([Makefile
 
317
           zzip/Makefile zzipwrap/Makefile SDL/Makefile
 
318
           docs/Makefile test/Makefile bins/Makefile])
 
319
dnl -------------------------------------------------------------
 
320
PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING
 
321
PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC
 
322
PATCH_LIBTOOL_TO_ADD_HOST_CC
 
323
# ---------------------------------------------------------------
 
324
echo '-----' $PACKAGE $VERSION $prefix
 
325
$SHELL libtool --features || true
 
326
echo "CFLAGS=$CFLAGS"
 
327
test "$enable_mmap" != "no" && echo "enable  mmap   ($enable_mmap)"
 
328
test "$enable_mmap"  = "no" && echo "disable mmap   ($enable_mmap)"
 
329
test "$with_lowstk" != "no" && echo "with    lowstk ($with_lowstk)"
 
330
test "$with_lowstk"  = "no" && echo "without lowstk ($with_lowstk)"
 
331
test "$with_debug"  != "no" && echo "with    debug  ($with_debug)"
 
332
test "$with_debug"   = "no" && echo "without debug  ($with_debug)"
 
333
# test -f ./zziplib.spec && echo warning - do not build in the source dirs
 
334
echo '# make  && make check  && make install'