]>
Commit | Line | Data |
---|---|---|
739457f4 CF |
1 | dnl Process this with autoconf to create configure |
2 | ||
26fe6c30 RC |
3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([zlib.h]) | |
5 | AC_PREREQ(2.53) | |
6 | AC_CONFIG_AUX_DIR(../cfgaux) | |
7 | AC_CANONICAL_TARGET([]) | |
739457f4 CF |
8 | AM_INIT_AUTOMAKE(zlib, 1.1.3) |
9 | ||
10 | AM_MAINTAINER_MODE | |
11 | ||
12 | dnl We use these options to decide which functions to include. | |
13 | AC_ARG_WITH(target-subdir, | |
14 | [ --with-target-subdir=SUBDIR | |
15 | configuring in a subdirectory]) | |
16 | AC_ARG_WITH(cross-host, | |
17 | [ --with-cross-host=HOST configuring with a cross compiler]) | |
18 | ||
19 | AC_ARG_WITH(system-zlib, | |
20 | [ --with-system-zlib use installed libz]) | |
21 | ||
26fe6c30 | 22 | dnl LIB_AC_PROG_CC |
739457f4 | 23 | |
302f1b6d RC |
24 | AC_PROG_CC |
25 | ||
739457f4 CF |
26 | if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then |
27 | COMPPATH=. | |
28 | else | |
29 | COMPPATH=.. | |
30 | fi | |
31 | AC_SUBST(COMPPATH) | |
32 | ||
33 | if test -n "$with_cross_host"; then | |
34 | # We are being configured with a cross compiler. AC_REPLACE_FUNCS | |
35 | # may not work correctly, because the compiler may not be able to | |
36 | # link executables. | |
37 | ||
38 | # We assume newlib. This lets us hard-code the functions we know | |
39 | # we'll have. | |
40 | AC_DEFINE(HAVE_MEMCPY) | |
41 | AC_DEFINE(HAVE_STRERROR) | |
42 | ||
43 | # We ignore --with-system-zlib in this case. | |
44 | target_all=libzcygw.a | |
45 | else | |
46 | AC_FUNC_MMAP | |
47 | AC_CHECK_FUNCS(memcpy strerror) | |
48 | ||
49 | if test "$with_system_zlib" = yes; then | |
50 | AC_CHECK_LIB(z, deflate, target_all=, target_all=libzcygw.a) | |
51 | else | |
52 | target_all=libzcygw.a | |
53 | fi | |
54 | fi | |
55 | ||
56 | AC_SUBST(target_all) | |
57 | ||
58 | AC_CHECK_HEADERS(unistd.h) | |
59 | ||
60 | AC_CHECK_TOOL(AR, ar, ar) | |
61 | AC_SUBST(AR) | |
62 | AC_CHECK_TOOL(AS, as, as) | |
63 | AC_SUBST(AS) | |
64 | AC_CHECK_TOOL(RANLIB, ranlib, ranlib) | |
65 | AC_SUBST(RANLIB) | |
66 | AC_CHECK_TOOL(LD, ld, ld) | |
67 | AC_SUBST(LD) | |
fb087b80 CF |
68 | AC_CHECK_TOOL(NM, nm, nm) |
69 | AC_SUBST(NM) | |
739457f4 CF |
70 | AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool) |
71 | AC_SUBST(DLLTOOL) | |
72 | AC_CHECK_TOOL(WINDRES, windres, windres) | |
73 | AC_SUBST(WINDRES) | |
74 | ||
75 | AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") | |
76 | ||
26fe6c30 RC |
77 | AC_CONFIG_FILES([Makefile]) |
78 | AC_OUTPUT |