~ubuntu-branches/ubuntu/natty/zziplib/natty

« back to all changes in this revision

Viewing changes to zziplib/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2008-04-06 08:13:02 UTC
  • mfrom: (4.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080406081302-0fqk6eyn5c4ea3im
Tags: 0.13.49-4
* NMU acknowledgement. Closes: #443880 
* Fixed the following lintian issues:
  - zziplib source: out-of-date-standards-version 3.7.2 (current is 3.7.3)
  - zziplib: description-contains-homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
CONFIG_ARGS="$*" 
2
 
AC_INIT(zzcat.c)
3
 
AC_PREREQ(2.49)
4
 
AC_COPYRIGHT([Guido Draheim <guido@gmx.de> for ZZipLib.SF.net])
5
 
AC_REVISION($Revision: 0.0$)
6
 
ln -s . uses # _AC_CONFIG_AUX_DIR(uses)
7
 
# =======================================================================
8
 
AC_SUBST(CONFIG_ARGS)
9
 
AC_CANONICAL_SYSTEM
10
 
AC_SET_DEFAULT_PATHS_SYSTEM
11
 
# -----------------------------------------------------------------------
12
 
AC_ARG_ENABLE(thread-safe,AC_HELP_STRING([--disable-thread-safe],
13
 
        [disable thread-safe libtool option]),, with_thread_safe="yes")
14
 
THREAD_SAFE=""
15
 
test "$with_thread_safe" = "yes" && THREAD_SAFE="-thread-safe"
16
 
test "$with_thread_safe" = "$host_os" && THREAD_SAFE="-thread-safe"
17
 
AC_SUBST(THREAD_SAFE)
18
 
if test -n "$THREAD_SAFE" ; then
19
 
  AC_MSG_RESULT(...using thread-safe linkage)
20
 
else
21
 
  AC_MSG_RESULT(disabled thread-safe linkage)
22
 
fi
23
 
# ----------------------------------------------------------------
24
 
AC_MSG_CHECKING(zlib install prefix)
25
 
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],
26
 
        [zlib prefix (e.g. '$HOME/software')]),  , [with_zlib="no"])
27
 
if test "${with_zlib}" = yes ; then # choose --prefix paths
28
 
   if test "${prefix}" = NONE ; then
29
 
      AC_MSG_RESULT(oops, but only itself...)
30
 
      AC_MSG_ERROR(--with-zlib requires a path argument or a --prefix path set)
31
 
   fi
32
 
   with_zlib="$prefix"
33
 
fi
34
 
 
35
 
if test ".$with_zlib" = ".no" ; then
36
 
   AC_MSG_RESULT(none)
37
 
elif test ".$with_zlib" = "./usr" ; then
38
 
   AC_MSG_RESULT([oops, ignored (may try --with-zlib=/usr/.)])
39
 
else
40
 
   if test ! -d "$with_zlib/include" ; then
41
 
      AC_MSG_RESULT(oops, given but...)
42
 
      AC_MSG_ERROR("$with_zlib/include" is not a directory)
43
 
   fi
44
 
   if test ! -d "$with_zlib/lib" ; then
45
 
      AC_MSG_RESULT(oops, given but...)
46
 
      AC_MSG_ERROR("$with_zlib/lib" is not a directory)
47
 
   fi
48
 
   CPPFLAGS="$CPPFLAGS -I$with_zlib/include"
49
 
   LDFLAGS="$LDFLAGS -L$with_zlib/lib"
50
 
   AC_MSG_RESULT($with_zlib)
51
 
   AC_MSG_RESULT(..adding CPPFLAGS -I$with_zlib/include)
52
 
   AC_MSG_RESULT(..adding LDFLAGS -L$with_zlib/include)
53
 
fi
54
 
# -----------------------------------------------------------------------
55
 
AC_SPEC_PACKAGE_VERSION(zziplib.spec)
56
 
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
57
 
 
58
 
AC_PROG_CC
59
 
AC_PROG_INSTALL
60
 
AC_LIBTOOL_WIN32_DLL
61
 
AM_PROG_LIBTOOL
62
 
AC_SET_RELEASEINFO_VERSIONINFO
63
 
 
64
 
# -----------------------------------------------------------------------
65
 
AC_MSG_RESULT([creating zzip-msvc.in via zzip-msvc.sed of config.h.in])
66
 
sed -f zzip-msvc.sed config.h.in >zzip-msvc.in
67
 
AM_CONFIG_HEADER(config.h)
68
 
AX_PREFIX_CONFIG_H([zzip-config.h],[zzip])
69
 
AX_PREFIX_CONFIG_H([zzip-msvc.h],[zzip],[zzip-msvc.in])
70
 
AM_MAINTAINER_MODE
71
 
 
72
 
AC_PATH_PROGS(PERL, perl5 perl, echo no perl found for)
73
 
AC_PATH_PROGS(PHP,  php-standalone php, echo no php found for)
74
 
AC_PATH_PROGS(MKZIP, zip pkzip, :)
75
 
AC_PATH_PROGS(XMLTO, xmlto, :)
76
 
 
77
 
AC_C_INLINE
78
 
AC_C_CONST
79
 
AC_STDC_HEADERS
80
 
AC_HEADER_DIRENT
81
 
AC_CHECK_HEADERS(stdint.h unistd.h windows.h winnt.h zlib.h sys/int_types.h) 
82
 
AC_CHECK_HEADERS(sys/types.h sys/mman.h sys/stat.h sys/param.h) dnl posix'ish
83
 
 
84
 
AC_TYPE_OFF_T
85
 
AC_COMPILE_CHECK_SIZEOF(short)
86
 
AC_COMPILE_CHECK_SIZEOF(int)
87
 
AC_COMPILE_CHECK_SIZEOF(long)
88
 
AC_COMPILE_CHECK_SIZEOF(size_t)
89
 
dnl -------------------------------------------------------------
90
 
AC_MSG_CHECKING(for zlib being found)
91
 
if test "_$ac_cv_header_zlib_h" != "_yes" ; then
92
 
  AC_MSG_RESULT(dnl
93
 
...oops: zlib.h not found - try adding some CPPFLAGS to configure call)
94
 
         AC_MSG_RESULT(dnl
95
 
...note: and when linkage fails you might also need to set some LDFLAGS)
96
 
  case "$prefix" in
97
 
    NONE|/usr) 
98
 
            AC_MSG_RESULT(dnl
99
 
...note: both can be set by specifying the install prefix of the zlib library)
100
 
            AC_MSG_RESULT(dnl
101
 
...note: via --with-zlib=path ... it will test for -Ipath/include -Lpath/lib)
102
 
    ;;
103
 
    *) if test -d $prefix/include ; then
104
 
         AC_MSG_RESULT(dnl
105
 
...note: -I$prefix/include is not added to CPPFLAGS automatically and)
106
 
         AC_MSG_RESULT(dnl
107
 
...note: neither is -L$prefix/lib for LDFLAGS .. both will be if you specify)
108
 
         AC_MSG_RESULT(dnl
109
 
...note: --with-zlib to configure call, or use --with-zlib=installprefix)
110
 
       fi
111
 
     ;;
112
 
  esac
113
 
  AC_MSG_ERROR(zlib.h not found: "zlib" is required to build "$PACKAGE")
114
 
  exit 1
115
 
fi
116
 
AC_MSG_RESULT(yes)
117
 
# ----------------------------------------------------------------
118
 
AC_MSG_CHECKING(docdir default)
119
 
AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir],
120
 
        [docdir prefix (prefix/share/doc)]),  , [with_docdir="no"])
121
 
case "${with_docdir}" in
122
 
 prefix/*)  docdir=` echo "$withval" | sed 's/^prefix/${prefix}'` ;;
123
 
 datadir/*) docdir=` echo "$withval" | sed 's/^datadir/${datadir}'` ;;
124
 
 yes) docdir='${prefix}/doc' ;;
125
 
 no)  docdir='${datadir}/doc' ;;
126
 
 /*|\\*|[a-zA-Z]:*) docdir="$with_docdir"  ;;
127
 
 *) AC_MSG_RESULT(oops)
128
 
    AC_MSG_ERROR(bad value ${withval} for --with-docdir) 
129
 
 ;;
130
 
esac
131
 
AC_SUBST(docdir)
132
 
AC_MSG_RESULT($docdir)
133
 
# ----------------------------------------------------------------
134
 
AC_MSG_CHECKING(whether io-wrap needs to wrap system calls)
135
 
AC_ARG_WITH(wrapwrap, AC_HELP_STRING([--with-wrapwrap],
136
 
        [io-wrap needs to wrap systemcalls (no)]), , [with_wrapwrap="auto"])
137
 
case "$with_wrapwrap" in
138
 
  yes|no) WRAPWRAP="$with_wrapwrap"  ;;
139
 
  auto)
140
 
     if test "$ac_cv_sizeof_size_t" != "$ac_cv_sizeof_int" 
141
 
     then WRAPWRAP="yes" ; else WRAPWRAP="no" ; fi ;;
142
 
  *) AC_MSG_RESULT(oops)
143
 
     AC_MSG_ERROR(bad value $with_wrapwrap for --with-wrapwrap) ;;
144
 
esac
145
 
if test "$WRAPWRAP" = "yes" ; then
146
 
  AC_DEFINE(WRAPWRAP, 1, [io-wrap needs to wrap systemcalls])
147
 
fi
148
 
AC_MSG_RESULT($WRAPWRAP)
149
 
# ----------------------------------------------------------------
150
 
AC_MSG_CHECKING(whether using debugging messages in libraries)
151
 
AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug],
152
 
        [debug messages in library]),
153
 
        [case "${withval}" in
154
 
                yes|no) with_debug="$withval" ;;
155
 
                *) AC_MSG_RESULT(oops)
156
 
                   AC_MSG_ERROR(bad value ${withval} for --with-debug) ;;
157
 
        esac], [with_debug="no"])
158
 
test "$with_debug" != "yes" && with_debug="no" # yes or no
159
 
test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG" 
160
 
result="$with_debug" ; test "$result" = "yes" && result="yes, added -DDEBUG"
161
 
AC_MSG_RESULT($result)
162
 
if test "$with_debug" = "yes" ; then if test -n "$RELEASEINFO" ; then
163
 
   RELEASEINFO="$RELEASEINFO-dbg"
164
 
   AC_MSG_RESULT(modified release, $RELEASEINFO)
165
 
fi fi
166
 
# ----------------------------------------------------------------
167
 
AC_MSG_CHECKING(whether thread stack is too small for bufsiz buffers)
168
 
 # many embedded platforms, superthreaded systems and kernel usage
169
 
 # will severely limit the stackspace for its threads. Use _LOWSTK
170
 
 # compile-define on those platforms.
171
 
AC_ARG_WITH(lowstk, AC_HELP_STRING([--with-lowstk],
172
 
        [limited thread stack]),
173
 
        [case "${withval}" in
174
 
                yes|no|auto) with_lowstk="$withval" ;;
175
 
                *) AC_MSG_ERROR(bad value ${withval} for --with-lowstk) ;;
176
 
        esac], [with_lowstk="auto"])
177
 
if test "$with_lowstk" = "auto"; then
178
 
  case $target in
179
 
        *-palmos-*) $with_lowstk="yes" ;;
180
 
  esac
181
 
fi
182
 
test "$with_lowstk" != "yes" && with_lowstk="no" # yes or no
183
 
test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK" 
184
 
result="$with_lowstk" ; test "$result" = "yes" && result="yes, added -D_LOWSTK"
185
 
AC_MSG_RESULT($with_lowstk)
186
 
# ---------------------------------------------------------------
187
 
AC_MSG_CHECKING(whether can use mmap for file scanning)
188
 
 # system with mmap are probably better performing an searching
189
 
 # and parsing - atleast memory consumption is far better
190
 
AC_ARG_ENABLE(mmap, AC_HELP_STRING([--disable-mmap],
191
 
        [disable mmap usage]),
192
 
        [case "${enableval}" in
193
 
                yes|no|auto) enable_mmap="${enableval}" ;;
194
 
                *) AC_MSG_RESULT(oops)
195
 
                   AC_MSG_ERROR(bad value ${enableval} for --disable-mmap) ;;
196
 
        esac], [enable_mmap="auto"])
197
 
if test "$enable_mmap" = "auto"
198
 
then
199
 
    test "$ac_cv_header_winbase_h"  && enable_mmap="yes, winbase.h"
200
 
    test "$ac_cv_header_sys_mman_h" && enable_mmap="yes, sys/mman.h"
201
 
fi
202
 
case "$enable_mmap" in
203
 
   yes|yes,*) CFLAGS="$CFLAGS -D_USE_MMAP"
204
 
      AC_MSG_RESULT($enable_mmap, added -D_USE_MMAP) ;;
205
 
   *) enable_mmap="no"
206
 
      AC_MSG_RESULT(no (just a bit slower)) ;;
207
 
esac
208
 
# ---------------------------------------------------------------
209
 
AC_MSG_CHECKING(running extra tests on make check)
210
 
if test "MKZIP" != ":" ; then
211
 
  AC_MSG_RESULT(yes)
212
 
  ZIPTESTS=""
213
 
else
214
 
  AC_MSG_RESULT(no)
215
 
  ZIPTESTS="#"
216
 
fi
217
 
AC_SUBST(ZIPTESTS)
218
 
# ---------------------------------------------------------------
219
 
test "$GCC" = "yes" && CFLAGS="$CFLAGS -Wall"
220
 
export CFLAGS
221
 
# ---------------------------------------------------------------
222
 
AC_MSG_CHECKING(link options)
223
 
case "$host_os" in
224
 
  mingw*) 
225
 
    ZZIPLIB_LDFLAGS="-no-undefined -export-all-symbols -mconsole"
226
 
    RESOLVES=' '
227
 
  ;;
228
 
  *)
229
 
    ZZIPLIB_LDFLAGS="--export-dynamic"
230
 
    RESOLVES=' # '
231
 
  ;;
232
 
esac
233
 
AC_MSG_RESULT([$ZZIPLIB_LDFLAGS $RESOLVES])
234
 
AC_SUBST([ZZIPLIB_LDFLAGS])
235
 
AC_SUBST([RESOLVES])
236
 
# ---------------------------------------------------------------
237
 
AC_MSG_CHECKING(maintainer mode)
238
 
if test "$USE_MAINTAINER_MODE" = "no" ; then 
239
 
 LIBTOOL="$LIBTOOL --silent"
240
 
 test -z "$TIMEOUT" && TIMEOUT="99"
241
 
 T="sleep $TIMEOUT"
242
 
 AUTOHEADER="$T ; true ERROR: CALL TO AUTOHEADER BUT NO MAINTAINER-MODE"
243
 
 AUTOMAKE="$T ; true ERROR: CALL TO AUTOMAKE BUT NO MAINTAINER-MODE"
244
 
 AUTOCONF="$T ; true ERROR: CALL TO AUTOCONF BUT NO MAINTAINER-MODE"
245
 
 result="libtool-silent, autotools-sleep-$TIMEOUT"
246
 
else
247
 
 result="no"
248
 
fi
249
 
AC_MSG_RESULT([$result])
250
 
# ---------------------------------------------------------------
251
 
AX_CFLAGS_WARN_ALL
252
 
AX_CFLAGS_NO_WRITABLE_STRINGS
253
 
AX_CFLAGS_STRICT_PROTOTYPES
254
 
# ---------------------------------------------------------------
255
 
AC_SUBST([CONFIG_FILES])
256
 
AC_OUTPUT([Makefile zzip-config])
257
 
dnl -------------------------------------------------------------
258
 
PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING
259
 
PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC
260
 
PATCH_LIBTOOL_TO_ADD_HOST_CC
261
 
# ---------------------------------------------------------------
262
 
echo '-----' $PACKAGE $VERSION $prefix
263
 
$SHELL libtool --features || true
264
 
test "$enable_mmap" != "no" && echo "enable  mmap   ($enable_mmap)"
265
 
test "$enable_mmap"  = "no" && echo "disable mmap   ($enable_mmap)"
266
 
test "$with_lowstk" != "no" && echo "with    lowstk ($with_lowstk)"
267
 
test "$with_lowstk"  = "no" && echo "without lowstk ($with_lowstk)"
268
 
test "$with_debug"  != "no" && echo "with    debug  ($with_debug)"
269
 
test "$with_debug"   = "no" && echo "without debug  ($with_debug)"
270
 
echo '# make  && make check  && make install'