]> gcc.gnu.org Git - gcc.git/blame - zlib/configure.ac
Config,Darwin: Allow for configuring Darwin to use embedded runpath.
[gcc.git] / zlib / configure.ac
CommitLineData
dfac8a13
TT
1dnl Process this with autoconf to create configure
2
22e05272 3AC_INIT([zlib], [1.1.4])
a8aea176 4AC_CONFIG_SRCDIR([zlib.h])
0fd91e0a 5
8006534c
NC
6if test -n "${with_target_subdir}"; then
7 AM_ENABLE_MULTILIB(, ..)
8fi
0fd91e0a 9
dfac8a13 10AC_CANONICAL_SYSTEM
8b55628e
TT
11
12# This works around an automake problem.
1e6347d8 13mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
8b55628e
TT
14AC_SUBST(mkinstalldirs)
15
22e05272 16AM_INIT_AUTOMAKE
dfac8a13
TT
17
18AM_MAINTAINER_MODE
dfac8a13 19
dfac8a13
TT
20dnl We use these options to decide which functions to include.
21AC_ARG_WITH(target-subdir,
3ef1cea8
RO
22[ --with-target-subdir=SUBDIR
23 configuring in a subdirectory])
a8aea176
NN
24
25if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
26 COMPPATH=.
27else
28 COMPPATH=..
29fi
30AC_SUBST(COMPPATH)
31
dfac8a13 32AC_ARG_WITH(cross-host,
3ef1cea8 33[ --with-cross-host=HOST configuring with a cross compiler])
dfac8a13
TT
34
35dnl Default to --enable-multilib
36AC_ARG_ENABLE(multilib,
3ef1cea8 37[ --enable-multilib build many library versions (default)],
dfac8a13
TT
38[case "${enableval}" in
39 yes) multilib=yes ;;
40 no) multilib=no ;;
41 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
67d08194 42 esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
dfac8a13 43
79a9a529 44AC_ARG_WITH(system-zlib,
3ef1cea8 45[ --with-system-zlib use installed libz])
79a9a529 46
a8aea176
NN
47# Make sure we don't test executables when making cross-tools.
48GCC_NO_EXECUTABLES
dfac8a13 49
076e5443
PB
50# The same as in boehm-gc and libstdc++. Have to borrow it from there.
51# We must force CC to /not/ be precious variables; otherwise
52# the wrong, non-multilib-adjusted value will be used in multilibs.
53# As a side effect, we have to subst CFLAGS ourselves.
54
55m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
56m4_define([_AC_ARG_VAR_PRECIOUS],[])
a8aea176 57AC_PROG_CC
1b3b24c2 58m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
a8aea176 59
076e5443
PB
60AC_SUBST(CFLAGS)
61
c0827870
L
62# Add CET specific flags if CET is enabled
63GCC_CET_FLAGS(CET_FLAGS)
64AC_SUBST(CET_FLAGS)
65
076e5443 66AC_PROG_LIBTOOL
6a6d3817 67AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
dfac8a13 68
35241f18
CD
69# Find CPP now so that any conditional tests below won't do it and
70# thereby make the resulting definitions conditional.
71AC_PROG_CPP
dfac8a13
TT
72
73if test -n "$with_cross_host"; then
74 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
75 # may not work correctly, because the compiler may not be able to
76 # link executables.
77
78 # We assume newlib. This lets us hard-code the functions we know
79 # we'll have.
80 AC_DEFINE(HAVE_MEMCPY)
81 AC_DEFINE(HAVE_STRERROR)
82else
83 AC_FUNC_MMAP
84 AC_CHECK_FUNCS(memcpy strerror)
85fi
86
87AC_CHECK_HEADERS(unistd.h)
88
e8e66971
MR
89GCC_WITH_TOOLEXECLIBDIR
90
0ccf2c33
AO
91if test -n "$with_cross_host" &&
92 test x"$with_cross_host" != x"no"; then
93 toolexecdir='$(exec_prefix)/$(target_alias)'
e8e66971
MR
94 case ${with_toolexeclibdir} in
95 no)
96 toolexeclibdir='$(toolexecdir)/lib'
97 ;;
98 *)
99 toolexeclibdir=${with_toolexeclibdir}
100 ;;
101 esac
0ccf2c33
AO
102else
103 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
104 toolexeclibdir='$(libdir)'
105fi
905280ac
AO
106if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
107 multiosdir=/`$CC -print-multi-os-directory`
ff8b9ca8
AS
108 case $multiosdir in
109 /.) multiosdir= ;; # Avoid trailing /.
110 esac
905280ac
AO
111else
112 multiosdir=
113fi
114toolexeclibdir=${toolexeclibdir}${multiosdir}
0ccf2c33
AO
115AC_SUBST(toolexecdir)
116AC_SUBST(toolexeclibdir)
117
e093c992 118AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
b48ed568 119
dfac8a13
TT
120if test "${multilib}" = "yes"; then
121 multilib_arg="--enable-multilib"
122else
123 multilib_arg=
124fi
125
b6cb10af 126# Enable --enable-host-shared.
459260ec
DM
127AC_ARG_ENABLE(host-shared,
128[AS_HELP_STRING([--enable-host-shared],
b6cb10af
MP
129 [build host code as shared libraries])])
130AC_SUBST(enable_host_shared)
131
132# Enable --enable-host-pie.
133AC_ARG_ENABLE(host-pie,
134[AS_HELP_STRING([--enable-host-pie],
135 [build host code as PIE])])
136AC_SUBST(enable_host_pie)
137
138if test x$enable_host_shared = xyes; then
139 PICFLAG=-fPIC
140elif test x$enable_host_pie = xyes; then
141 PICFLAG=-fPIE
142else
143 PICFLAG=
144fi
04711f51 145
b6cb10af 146AC_SUBST(PICFLAG)
a8aea176 147AC_CONFIG_FILES([Makefile])
a8aea176 148AC_OUTPUT
This page took 2.499174 seconds and 5 git commands to generate.