xref: /aosp_15_r20/external/curl/m4/xc-lt-iface.m4 (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker#---------------------------------------------------------------------------
2*6236dae4SAndroid Build Coastguard Worker#
3*6236dae4SAndroid Build Coastguard Worker# xc-lt-iface.m4
4*6236dae4SAndroid Build Coastguard Worker#
5*6236dae4SAndroid Build Coastguard Worker# Copyright (C) Daniel Stenberg, <[email protected]>
6*6236dae4SAndroid Build Coastguard Worker#
7*6236dae4SAndroid Build Coastguard Worker# Permission to use, copy, modify, and distribute this software for any
8*6236dae4SAndroid Build Coastguard Worker# purpose with or without fee is hereby granted, provided that the above
9*6236dae4SAndroid Build Coastguard Worker# copyright notice and this permission notice appear in all copies.
10*6236dae4SAndroid Build Coastguard Worker#
11*6236dae4SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12*6236dae4SAndroid Build Coastguard Worker# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13*6236dae4SAndroid Build Coastguard Worker# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14*6236dae4SAndroid Build Coastguard Worker# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15*6236dae4SAndroid Build Coastguard Worker# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16*6236dae4SAndroid Build Coastguard Worker# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17*6236dae4SAndroid Build Coastguard Worker# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18*6236dae4SAndroid Build Coastguard Worker#
19*6236dae4SAndroid Build Coastguard Worker# SPDX-License-Identifier: ISC
20*6236dae4SAndroid Build Coastguard Worker#
21*6236dae4SAndroid Build Coastguard Worker#---------------------------------------------------------------------------
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard Worker# serial 1
24*6236dae4SAndroid Build Coastguard Worker
25*6236dae4SAndroid Build Coastguard Worker
26*6236dae4SAndroid Build Coastguard Workerdnl _XC_LIBTOOL_PREAMBLE
27*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
28*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
29*6236dae4SAndroid Build Coastguard Workerdnl
30*6236dae4SAndroid Build Coastguard Workerdnl Checks some configure script options related with
31*6236dae4SAndroid Build Coastguard Workerdnl libtool and customizes its default behavior before
32*6236dae4SAndroid Build Coastguard Workerdnl libtool code is actually used in script.
33*6236dae4SAndroid Build Coastguard Worker
34*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_LIBTOOL_PREAMBLE],
35*6236dae4SAndroid Build Coastguard Worker[dnl
36*6236dae4SAndroid Build Coastguard Worker# ------------------------------------ #
37*6236dae4SAndroid Build Coastguard Worker#  Determine libtool default behavior  #
38*6236dae4SAndroid Build Coastguard Worker# ------------------------------------ #
39*6236dae4SAndroid Build Coastguard Worker
40*6236dae4SAndroid Build Coastguard Worker#
41*6236dae4SAndroid Build Coastguard Worker# Default behavior is to enable shared and static libraries on systems
42*6236dae4SAndroid Build Coastguard Worker# where libtool knows how to build both library versions, and does not
43*6236dae4SAndroid Build Coastguard Worker# require separate configuration and build runs for each flavor.
44*6236dae4SAndroid Build Coastguard Worker#
45*6236dae4SAndroid Build Coastguard Worker
46*6236dae4SAndroid Build Coastguard Workerxc_lt_want_enable_shared='yes'
47*6236dae4SAndroid Build Coastguard Workerxc_lt_want_enable_static='yes'
48*6236dae4SAndroid Build Coastguard Worker
49*6236dae4SAndroid Build Coastguard Worker#
50*6236dae4SAndroid Build Coastguard Worker# User may have disabled shared or static libraries.
51*6236dae4SAndroid Build Coastguard Worker#
52*6236dae4SAndroid Build Coastguard Workercase "x$enable_shared" in @%:@ (
53*6236dae4SAndroid Build Coastguard Worker  xno)
54*6236dae4SAndroid Build Coastguard Worker    xc_lt_want_enable_shared='no'
55*6236dae4SAndroid Build Coastguard Worker    ;;
56*6236dae4SAndroid Build Coastguard Workeresac
57*6236dae4SAndroid Build Coastguard Workercase "x$enable_static" in @%:@ (
58*6236dae4SAndroid Build Coastguard Worker  xno)
59*6236dae4SAndroid Build Coastguard Worker    xc_lt_want_enable_static='no'
60*6236dae4SAndroid Build Coastguard Worker    ;;
61*6236dae4SAndroid Build Coastguard Workeresac
62*6236dae4SAndroid Build Coastguard Workerif test "x$xc_lt_want_enable_shared" = 'xno' &&
63*6236dae4SAndroid Build Coastguard Worker  test "x$xc_lt_want_enable_static" = 'xno'; then
64*6236dae4SAndroid Build Coastguard Worker  AC_MSG_ERROR([can not disable shared and static libraries simultaneously])
65*6236dae4SAndroid Build Coastguard Workerfi
66*6236dae4SAndroid Build Coastguard Worker
67*6236dae4SAndroid Build Coastguard Worker#
68*6236dae4SAndroid Build Coastguard Worker# Default behavior on systems that require independent configuration
69*6236dae4SAndroid Build Coastguard Worker# and build runs for shared and static is to enable shared libraries
70*6236dae4SAndroid Build Coastguard Worker# and disable static ones. On these systems option '--disable-shared'
71*6236dae4SAndroid Build Coastguard Worker# must be used in order to build a proper static library.
72*6236dae4SAndroid Build Coastguard Worker#
73*6236dae4SAndroid Build Coastguard Worker
74*6236dae4SAndroid Build Coastguard Workerif test "x$xc_lt_want_enable_shared" = 'xyes' &&
75*6236dae4SAndroid Build Coastguard Worker  test "x$xc_lt_want_enable_static" = 'xyes'; then
76*6236dae4SAndroid Build Coastguard Worker  case $host_os in @%:@ (
77*6236dae4SAndroid Build Coastguard Worker    pw32* | cegcc* | os2* | aix*)
78*6236dae4SAndroid Build Coastguard Worker      xc_lt_want_enable_static='no'
79*6236dae4SAndroid Build Coastguard Worker      ;;
80*6236dae4SAndroid Build Coastguard Worker  esac
81*6236dae4SAndroid Build Coastguard Workerfi
82*6236dae4SAndroid Build Coastguard Worker
83*6236dae4SAndroid Build Coastguard Worker#
84*6236dae4SAndroid Build Coastguard Worker# Make libtool aware of current shared and static library preferences
85*6236dae4SAndroid Build Coastguard Worker# taking in account that, depending on host characteristics, libtool
86*6236dae4SAndroid Build Coastguard Worker# may modify these option preferences later in this configure script.
87*6236dae4SAndroid Build Coastguard Worker#
88*6236dae4SAndroid Build Coastguard Worker
89*6236dae4SAndroid Build Coastguard Workerenable_shared=$xc_lt_want_enable_shared
90*6236dae4SAndroid Build Coastguard Workerenable_static=$xc_lt_want_enable_static
91*6236dae4SAndroid Build Coastguard Worker
92*6236dae4SAndroid Build Coastguard Worker#
93*6236dae4SAndroid Build Coastguard Worker# Default behavior is to build PIC objects for shared libraries and
94*6236dae4SAndroid Build Coastguard Worker# non-PIC objects for static libraries.
95*6236dae4SAndroid Build Coastguard Worker#
96*6236dae4SAndroid Build Coastguard Worker
97*6236dae4SAndroid Build Coastguard Workerxc_lt_want_with_pic='default'
98*6236dae4SAndroid Build Coastguard Worker
99*6236dae4SAndroid Build Coastguard Worker#
100*6236dae4SAndroid Build Coastguard Worker# User may have specified PIC preference.
101*6236dae4SAndroid Build Coastguard Worker#
102*6236dae4SAndroid Build Coastguard Worker
103*6236dae4SAndroid Build Coastguard Workercase "x$with_pic" in @%:@ ((
104*6236dae4SAndroid Build Coastguard Worker  xno)
105*6236dae4SAndroid Build Coastguard Worker    xc_lt_want_with_pic='no'
106*6236dae4SAndroid Build Coastguard Worker    ;;
107*6236dae4SAndroid Build Coastguard Worker  xyes)
108*6236dae4SAndroid Build Coastguard Worker    xc_lt_want_with_pic='yes'
109*6236dae4SAndroid Build Coastguard Worker    ;;
110*6236dae4SAndroid Build Coastguard Workeresac
111*6236dae4SAndroid Build Coastguard Worker
112*6236dae4SAndroid Build Coastguard Worker#
113*6236dae4SAndroid Build Coastguard Worker# Default behavior on some systems where building a shared library out
114*6236dae4SAndroid Build Coastguard Worker# of non-PIC compiled objects will fail with following linker error
115*6236dae4SAndroid Build Coastguard Worker# "relocation R_X86_64_32 can not be used when making a shared object"
116*6236dae4SAndroid Build Coastguard Worker# is to build PIC objects even for static libraries. This behavior may
117*6236dae4SAndroid Build Coastguard Worker# be overridden using 'configure --disable-shared --without-pic'.
118*6236dae4SAndroid Build Coastguard Worker#
119*6236dae4SAndroid Build Coastguard Worker
120*6236dae4SAndroid Build Coastguard Workerif test "x$xc_lt_want_with_pic" = 'xdefault'; then
121*6236dae4SAndroid Build Coastguard Worker  case $host_cpu in @%:@ (
122*6236dae4SAndroid Build Coastguard Worker    x86_64 | amd64 | ia64)
123*6236dae4SAndroid Build Coastguard Worker      case $host_os in @%:@ (
124*6236dae4SAndroid Build Coastguard Worker        linux* | freebsd* | midnightbsd*)
125*6236dae4SAndroid Build Coastguard Worker          xc_lt_want_with_pic='yes'
126*6236dae4SAndroid Build Coastguard Worker          ;;
127*6236dae4SAndroid Build Coastguard Worker      esac
128*6236dae4SAndroid Build Coastguard Worker      ;;
129*6236dae4SAndroid Build Coastguard Worker  esac
130*6236dae4SAndroid Build Coastguard Workerfi
131*6236dae4SAndroid Build Coastguard Worker
132*6236dae4SAndroid Build Coastguard Worker#
133*6236dae4SAndroid Build Coastguard Worker# Make libtool aware of current PIC preference taking in account that,
134*6236dae4SAndroid Build Coastguard Worker# depending on host characteristics, libtool may modify PIC default
135*6236dae4SAndroid Build Coastguard Worker# behavior to fit host system idiosyncrasies later in this script.
136*6236dae4SAndroid Build Coastguard Worker#
137*6236dae4SAndroid Build Coastguard Worker
138*6236dae4SAndroid Build Coastguard Workerwith_pic=$xc_lt_want_with_pic
139*6236dae4SAndroid Build Coastguard Workerdnl
140*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
141*6236dae4SAndroid Build Coastguard Worker])
142*6236dae4SAndroid Build Coastguard Worker
143*6236dae4SAndroid Build Coastguard Worker
144*6236dae4SAndroid Build Coastguard Workerdnl _XC_LIBTOOL_BODY
145*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
146*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
147*6236dae4SAndroid Build Coastguard Workerdnl
148*6236dae4SAndroid Build Coastguard Workerdnl This macro performs embedding of libtool code into
149*6236dae4SAndroid Build Coastguard Workerdnl configure script, regardless of libtool version in
150*6236dae4SAndroid Build Coastguard Workerdnl use when generating configure script.
151*6236dae4SAndroid Build Coastguard Worker
152*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_LIBTOOL_BODY],
153*6236dae4SAndroid Build Coastguard Worker[dnl
154*6236dae4SAndroid Build Coastguard Worker## ----------------------- ##
155*6236dae4SAndroid Build Coastguard Worker##  Start of libtool code  ##
156*6236dae4SAndroid Build Coastguard Worker## ----------------------- ##
157*6236dae4SAndroid Build Coastguard Workerm4_ifdef([LT_INIT],
158*6236dae4SAndroid Build Coastguard Worker[dnl
159*6236dae4SAndroid Build Coastguard WorkerLT_INIT([win32-dll])
160*6236dae4SAndroid Build Coastguard Worker],[dnl
161*6236dae4SAndroid Build Coastguard WorkerAC_LIBTOOL_WIN32_DLL
162*6236dae4SAndroid Build Coastguard WorkerAC_PROG_LIBTOOL
163*6236dae4SAndroid Build Coastguard Worker])dnl
164*6236dae4SAndroid Build Coastguard Worker## --------------------- ##
165*6236dae4SAndroid Build Coastguard Worker##  End of libtool code  ##
166*6236dae4SAndroid Build Coastguard Worker## --------------------- ##
167*6236dae4SAndroid Build Coastguard Workerdnl
168*6236dae4SAndroid Build Coastguard Workerm4_define([$0], [])[]dnl
169*6236dae4SAndroid Build Coastguard Worker])
170*6236dae4SAndroid Build Coastguard Worker
171*6236dae4SAndroid Build Coastguard Worker
172*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_BUILD_LIBRARIES
173*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
174*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
175*6236dae4SAndroid Build Coastguard Workerdnl
176*6236dae4SAndroid Build Coastguard Workerdnl Checks whether libtool shared and static libraries
177*6236dae4SAndroid Build Coastguard Workerdnl are finally built depending on user input, default
178*6236dae4SAndroid Build Coastguard Workerdnl behavior and knowledge that libtool has about host
179*6236dae4SAndroid Build Coastguard Workerdnl characteristics.
180*6236dae4SAndroid Build Coastguard Workerdnl Results stored in following shell variables:
181*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared
182*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static
183*6236dae4SAndroid Build Coastguard Worker
184*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_BUILD_LIBRARIES],
185*6236dae4SAndroid Build Coastguard Worker[dnl
186*6236dae4SAndroid Build Coastguard Worker#
187*6236dae4SAndroid Build Coastguard Worker# Verify if finally libtool shared libraries will be built
188*6236dae4SAndroid Build Coastguard Worker#
189*6236dae4SAndroid Build Coastguard Worker
190*6236dae4SAndroid Build Coastguard Workercase "x$enable_shared" in @%:@ ((
191*6236dae4SAndroid Build Coastguard Worker  xyes | xno)
192*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_shared=$enable_shared
193*6236dae4SAndroid Build Coastguard Worker    ;;
194*6236dae4SAndroid Build Coastguard Worker  *)
195*6236dae4SAndroid Build Coastguard Worker    AC_MSG_ERROR([unexpected libtool enable_shared value: $enable_shared])
196*6236dae4SAndroid Build Coastguard Worker    ;;
197*6236dae4SAndroid Build Coastguard Workeresac
198*6236dae4SAndroid Build Coastguard Worker
199*6236dae4SAndroid Build Coastguard Worker#
200*6236dae4SAndroid Build Coastguard Worker# Verify if finally libtool static libraries will be built
201*6236dae4SAndroid Build Coastguard Worker#
202*6236dae4SAndroid Build Coastguard Worker
203*6236dae4SAndroid Build Coastguard Workercase "x$enable_static" in @%:@ ((
204*6236dae4SAndroid Build Coastguard Worker  xyes | xno)
205*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_static=$enable_static
206*6236dae4SAndroid Build Coastguard Worker    ;;
207*6236dae4SAndroid Build Coastguard Worker  *)
208*6236dae4SAndroid Build Coastguard Worker    AC_MSG_ERROR([unexpected libtool enable_static value: $enable_static])
209*6236dae4SAndroid Build Coastguard Worker    ;;
210*6236dae4SAndroid Build Coastguard Workeresac
211*6236dae4SAndroid Build Coastguard Workerdnl
212*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
213*6236dae4SAndroid Build Coastguard Worker])
214*6236dae4SAndroid Build Coastguard Worker
215*6236dae4SAndroid Build Coastguard Worker
216*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_SHLIB_USE_VERSION_INFO
217*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
218*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
219*6236dae4SAndroid Build Coastguard Workerdnl
220*6236dae4SAndroid Build Coastguard Workerdnl Checks if the -version-info linker flag must be
221*6236dae4SAndroid Build Coastguard Workerdnl provided when building libtool shared libraries.
222*6236dae4SAndroid Build Coastguard Workerdnl Result stored in xc_lt_shlib_use_version_info.
223*6236dae4SAndroid Build Coastguard Worker
224*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_SHLIB_USE_VERSION_INFO],
225*6236dae4SAndroid Build Coastguard Worker[dnl
226*6236dae4SAndroid Build Coastguard Worker#
227*6236dae4SAndroid Build Coastguard Worker# Verify if libtool shared libraries should be linked using flag -version-info
228*6236dae4SAndroid Build Coastguard Worker#
229*6236dae4SAndroid Build Coastguard Worker
230*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build shared libraries with -version-info])
231*6236dae4SAndroid Build Coastguard Workerxc_lt_shlib_use_version_info='yes'
232*6236dae4SAndroid Build Coastguard Workerif test "x$version_type" = 'xnone'; then
233*6236dae4SAndroid Build Coastguard Worker  xc_lt_shlib_use_version_info='no'
234*6236dae4SAndroid Build Coastguard Workerfi
235*6236dae4SAndroid Build Coastguard Workercase $host_os in @%:@ (
236*6236dae4SAndroid Build Coastguard Worker  amigaos*)
237*6236dae4SAndroid Build Coastguard Worker    xc_lt_shlib_use_version_info='yes'
238*6236dae4SAndroid Build Coastguard Worker    ;;
239*6236dae4SAndroid Build Coastguard Workeresac
240*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_shlib_use_version_info])
241*6236dae4SAndroid Build Coastguard Workerdnl
242*6236dae4SAndroid Build Coastguard Workerm4_define([$0], [])[]dnl
243*6236dae4SAndroid Build Coastguard Worker])
244*6236dae4SAndroid Build Coastguard Worker
245*6236dae4SAndroid Build Coastguard Worker
246*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED
247*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
248*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
249*6236dae4SAndroid Build Coastguard Workerdnl
250*6236dae4SAndroid Build Coastguard Workerdnl Checks if the -no-undefined linker flag must be
251*6236dae4SAndroid Build Coastguard Workerdnl provided when building libtool shared libraries.
252*6236dae4SAndroid Build Coastguard Workerdnl Result stored in xc_lt_shlib_use_no_undefined.
253*6236dae4SAndroid Build Coastguard Worker
254*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED],
255*6236dae4SAndroid Build Coastguard Worker[dnl
256*6236dae4SAndroid Build Coastguard Worker#
257*6236dae4SAndroid Build Coastguard Worker# Verify if libtool shared libraries should be linked using flag -no-undefined
258*6236dae4SAndroid Build Coastguard Worker#
259*6236dae4SAndroid Build Coastguard Worker
260*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build shared libraries with -no-undefined])
261*6236dae4SAndroid Build Coastguard Workerxc_lt_shlib_use_no_undefined='no'
262*6236dae4SAndroid Build Coastguard Workerif test "x$allow_undefined" = 'xno'; then
263*6236dae4SAndroid Build Coastguard Worker  xc_lt_shlib_use_no_undefined='yes'
264*6236dae4SAndroid Build Coastguard Workerelif test "x$allow_undefined_flag" = 'xunsupported'; then
265*6236dae4SAndroid Build Coastguard Worker  xc_lt_shlib_use_no_undefined='yes'
266*6236dae4SAndroid Build Coastguard Workerfi
267*6236dae4SAndroid Build Coastguard Workercase $host_os in @%:@ (
268*6236dae4SAndroid Build Coastguard Worker  cygwin* | mingw* | pw32* | cegcc* | os2* | aix*)
269*6236dae4SAndroid Build Coastguard Worker    xc_lt_shlib_use_no_undefined='yes'
270*6236dae4SAndroid Build Coastguard Worker    ;;
271*6236dae4SAndroid Build Coastguard Workeresac
272*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_shlib_use_no_undefined])
273*6236dae4SAndroid Build Coastguard Workerdnl
274*6236dae4SAndroid Build Coastguard Workerm4_define([$0], [])[]dnl
275*6236dae4SAndroid Build Coastguard Worker])
276*6236dae4SAndroid Build Coastguard Worker
277*6236dae4SAndroid Build Coastguard Worker
278*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT
279*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
280*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
281*6236dae4SAndroid Build Coastguard Workerdnl
282*6236dae4SAndroid Build Coastguard Workerdnl Checks if the -mimpure-text linker flag must be
283*6236dae4SAndroid Build Coastguard Workerdnl provided when building libtool shared libraries.
284*6236dae4SAndroid Build Coastguard Workerdnl Result stored in xc_lt_shlib_use_mimpure_text.
285*6236dae4SAndroid Build Coastguard Worker
286*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT],
287*6236dae4SAndroid Build Coastguard Worker[dnl
288*6236dae4SAndroid Build Coastguard Worker#
289*6236dae4SAndroid Build Coastguard Worker# Verify if libtool shared libraries should be linked using flag -mimpure-text
290*6236dae4SAndroid Build Coastguard Worker#
291*6236dae4SAndroid Build Coastguard Worker
292*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build shared libraries with -mimpure-text])
293*6236dae4SAndroid Build Coastguard Workerxc_lt_shlib_use_mimpure_text='no'
294*6236dae4SAndroid Build Coastguard Workercase $host_os in @%:@ (
295*6236dae4SAndroid Build Coastguard Worker  solaris2*)
296*6236dae4SAndroid Build Coastguard Worker    if test "x$GCC" = 'xyes'; then
297*6236dae4SAndroid Build Coastguard Worker      xc_lt_shlib_use_mimpure_text='yes'
298*6236dae4SAndroid Build Coastguard Worker    fi
299*6236dae4SAndroid Build Coastguard Worker    ;;
300*6236dae4SAndroid Build Coastguard Workeresac
301*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_shlib_use_mimpure_text])
302*6236dae4SAndroid Build Coastguard Workerdnl
303*6236dae4SAndroid Build Coastguard Workerm4_define([$0], [])[]dnl
304*6236dae4SAndroid Build Coastguard Worker])
305*6236dae4SAndroid Build Coastguard Worker
306*6236dae4SAndroid Build Coastguard Worker
307*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_BUILD_WITH_PIC
308*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
309*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
310*6236dae4SAndroid Build Coastguard Workerdnl
311*6236dae4SAndroid Build Coastguard Workerdnl Checks whether libtool shared and static libraries
312*6236dae4SAndroid Build Coastguard Workerdnl would be built with PIC depending on user input,
313*6236dae4SAndroid Build Coastguard Workerdnl default behavior and knowledge that libtool has
314*6236dae4SAndroid Build Coastguard Workerdnl about host characteristics.
315*6236dae4SAndroid Build Coastguard Workerdnl Results stored in following shell variables:
316*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared_with_pic
317*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static_with_pic
318*6236dae4SAndroid Build Coastguard Worker
319*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_BUILD_WITH_PIC],
320*6236dae4SAndroid Build Coastguard Worker[dnl
321*6236dae4SAndroid Build Coastguard Worker#
322*6236dae4SAndroid Build Coastguard Worker# Find out whether libtool libraries would be built with PIC
323*6236dae4SAndroid Build Coastguard Worker#
324*6236dae4SAndroid Build Coastguard Worker
325*6236dae4SAndroid Build Coastguard Workercase "x$pic_mode" in @%:@ ((((
326*6236dae4SAndroid Build Coastguard Worker  xdefault)
327*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_shared_with_pic='yes'
328*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_static_with_pic='no'
329*6236dae4SAndroid Build Coastguard Worker    ;;
330*6236dae4SAndroid Build Coastguard Worker  xyes)
331*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_shared_with_pic='yes'
332*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_static_with_pic='yes'
333*6236dae4SAndroid Build Coastguard Worker    ;;
334*6236dae4SAndroid Build Coastguard Worker  xno)
335*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_shared_with_pic='no'
336*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_static_with_pic='no'
337*6236dae4SAndroid Build Coastguard Worker    ;;
338*6236dae4SAndroid Build Coastguard Worker  *)
339*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_shared_with_pic='unknown'
340*6236dae4SAndroid Build Coastguard Worker    xc_lt_build_static_with_pic='unknown'
341*6236dae4SAndroid Build Coastguard Worker    AC_MSG_WARN([unexpected libtool pic_mode value: $pic_mode])
342*6236dae4SAndroid Build Coastguard Worker    ;;
343*6236dae4SAndroid Build Coastguard Workeresac
344*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build shared libraries with PIC])
345*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_build_shared_with_pic])
346*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build static libraries with PIC])
347*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_build_static_with_pic])
348*6236dae4SAndroid Build Coastguard Workerdnl
349*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
350*6236dae4SAndroid Build Coastguard Worker])
351*6236dae4SAndroid Build Coastguard Worker
352*6236dae4SAndroid Build Coastguard Worker
353*6236dae4SAndroid Build Coastguard Workerdnl _XC_CHECK_LT_BUILD_SINGLE_VERSION
354*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
355*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
356*6236dae4SAndroid Build Coastguard Workerdnl
357*6236dae4SAndroid Build Coastguard Workerdnl Checks whether a libtool shared or static library
358*6236dae4SAndroid Build Coastguard Workerdnl is finally built exclusively without the other.
359*6236dae4SAndroid Build Coastguard Workerdnl Results stored in following shell variables:
360*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared_only
361*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static_only
362*6236dae4SAndroid Build Coastguard Worker
363*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_CHECK_LT_BUILD_SINGLE_VERSION],
364*6236dae4SAndroid Build Coastguard Worker[dnl
365*6236dae4SAndroid Build Coastguard Worker#
366*6236dae4SAndroid Build Coastguard Worker# Verify if libtool shared libraries will be built while static not built
367*6236dae4SAndroid Build Coastguard Worker#
368*6236dae4SAndroid Build Coastguard Worker
369*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build shared libraries only])
370*6236dae4SAndroid Build Coastguard Workerif test "$xc_lt_build_shared" = 'yes' &&
371*6236dae4SAndroid Build Coastguard Worker  test "$xc_lt_build_static" = 'no'; then
372*6236dae4SAndroid Build Coastguard Worker  xc_lt_build_shared_only='yes'
373*6236dae4SAndroid Build Coastguard Workerelse
374*6236dae4SAndroid Build Coastguard Worker  xc_lt_build_shared_only='no'
375*6236dae4SAndroid Build Coastguard Workerfi
376*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_build_shared_only])
377*6236dae4SAndroid Build Coastguard Worker
378*6236dae4SAndroid Build Coastguard Worker#
379*6236dae4SAndroid Build Coastguard Worker# Verify if libtool static libraries will be built while shared not built
380*6236dae4SAndroid Build Coastguard Worker#
381*6236dae4SAndroid Build Coastguard Worker
382*6236dae4SAndroid Build Coastguard WorkerAC_MSG_CHECKING([whether to build static libraries only])
383*6236dae4SAndroid Build Coastguard Workerif test "$xc_lt_build_static" = 'yes' &&
384*6236dae4SAndroid Build Coastguard Worker  test "$xc_lt_build_shared" = 'no'; then
385*6236dae4SAndroid Build Coastguard Worker  xc_lt_build_static_only='yes'
386*6236dae4SAndroid Build Coastguard Workerelse
387*6236dae4SAndroid Build Coastguard Worker  xc_lt_build_static_only='no'
388*6236dae4SAndroid Build Coastguard Workerfi
389*6236dae4SAndroid Build Coastguard WorkerAC_MSG_RESULT([$xc_lt_build_static_only])
390*6236dae4SAndroid Build Coastguard Workerdnl
391*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
392*6236dae4SAndroid Build Coastguard Worker])
393*6236dae4SAndroid Build Coastguard Worker
394*6236dae4SAndroid Build Coastguard Worker
395*6236dae4SAndroid Build Coastguard Workerdnl _XC_LIBTOOL_POSTLUDE
396*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
397*6236dae4SAndroid Build Coastguard Workerdnl Private macro.
398*6236dae4SAndroid Build Coastguard Workerdnl
399*6236dae4SAndroid Build Coastguard Workerdnl Performs several checks related with libtool that
400*6236dae4SAndroid Build Coastguard Workerdnl can not be done unless libtool code has already
401*6236dae4SAndroid Build Coastguard Workerdnl been executed. See individual check descriptions
402*6236dae4SAndroid Build Coastguard Workerdnl for further info.
403*6236dae4SAndroid Build Coastguard Worker
404*6236dae4SAndroid Build Coastguard Workerm4_define([_XC_LIBTOOL_POSTLUDE],
405*6236dae4SAndroid Build Coastguard Worker[dnl
406*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_BUILD_LIBRARIES
407*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_SHLIB_USE_VERSION_INFO
408*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_SHLIB_USE_NO_UNDEFINED
409*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_SHLIB_USE_MIMPURE_TEXT
410*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_BUILD_WITH_PIC
411*6236dae4SAndroid Build Coastguard Worker_XC_CHECK_LT_BUILD_SINGLE_VERSION
412*6236dae4SAndroid Build Coastguard Workerdnl
413*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
414*6236dae4SAndroid Build Coastguard Worker])
415*6236dae4SAndroid Build Coastguard Worker
416*6236dae4SAndroid Build Coastguard Worker
417*6236dae4SAndroid Build Coastguard Workerdnl XC_LIBTOOL
418*6236dae4SAndroid Build Coastguard Workerdnl -------------------------------------------------
419*6236dae4SAndroid Build Coastguard Workerdnl Public macro.
420*6236dae4SAndroid Build Coastguard Workerdnl
421*6236dae4SAndroid Build Coastguard Workerdnl This macro embeds libtool machinery into configure
422*6236dae4SAndroid Build Coastguard Workerdnl script, regardless of libtool version, and performs
423*6236dae4SAndroid Build Coastguard Workerdnl several additional checks whose results can be used
424*6236dae4SAndroid Build Coastguard Workerdnl later on.
425*6236dae4SAndroid Build Coastguard Workerdnl
426*6236dae4SAndroid Build Coastguard Workerdnl Usage of this macro ensures that generated configure
427*6236dae4SAndroid Build Coastguard Workerdnl script uses equivalent logic irrespective of autoconf
428*6236dae4SAndroid Build Coastguard Workerdnl or libtool version being used to generate configure
429*6236dae4SAndroid Build Coastguard Workerdnl script.
430*6236dae4SAndroid Build Coastguard Workerdnl
431*6236dae4SAndroid Build Coastguard Workerdnl Results stored in following shell variables:
432*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared
433*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static
434*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_shlib_use_version_info
435*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_shlib_use_no_undefined
436*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_shlib_use_mimpure_text
437*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared_with_pic
438*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static_with_pic
439*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_shared_only
440*6236dae4SAndroid Build Coastguard Workerdnl   xc_lt_build_static_only
441*6236dae4SAndroid Build Coastguard Worker
442*6236dae4SAndroid Build Coastguard WorkerAC_DEFUN([XC_LIBTOOL],
443*6236dae4SAndroid Build Coastguard Worker[dnl
444*6236dae4SAndroid Build Coastguard WorkerAC_PREREQ([2.50])dnl
445*6236dae4SAndroid Build Coastguard Workerdnl
446*6236dae4SAndroid Build Coastguard WorkerAC_BEFORE([$0],[LT_INIT])dnl
447*6236dae4SAndroid Build Coastguard WorkerAC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
448*6236dae4SAndroid Build Coastguard WorkerAC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl
449*6236dae4SAndroid Build Coastguard Workerdnl
450*6236dae4SAndroid Build Coastguard WorkerAC_REQUIRE([XC_CHECK_PATH_SEPARATOR])dnl
451*6236dae4SAndroid Build Coastguard WorkerAC_REQUIRE([AC_CANONICAL_HOST])dnl
452*6236dae4SAndroid Build Coastguard WorkerAC_REQUIRE([AC_PROG_CC])dnl
453*6236dae4SAndroid Build Coastguard Workerdnl
454*6236dae4SAndroid Build Coastguard Worker_XC_LIBTOOL_PREAMBLE
455*6236dae4SAndroid Build Coastguard Worker_XC_LIBTOOL_BODY
456*6236dae4SAndroid Build Coastguard Worker_XC_LIBTOOL_POSTLUDE
457*6236dae4SAndroid Build Coastguard Workerdnl
458*6236dae4SAndroid Build Coastguard Workerm4_ifdef([AC_LIBTOOL_WIN32_DLL],
459*6236dae4SAndroid Build Coastguard Worker  [m4_undefine([AC_LIBTOOL_WIN32_DLL])])dnl
460*6236dae4SAndroid Build Coastguard Workerm4_ifdef([AC_PROG_LIBTOOL],
461*6236dae4SAndroid Build Coastguard Worker  [m4_undefine([AC_PROG_LIBTOOL])])dnl
462*6236dae4SAndroid Build Coastguard Workerm4_ifdef([LT_INIT],
463*6236dae4SAndroid Build Coastguard Worker  [m4_undefine([LT_INIT])])dnl
464*6236dae4SAndroid Build Coastguard Workerdnl
465*6236dae4SAndroid Build Coastguard Workerm4_define([$0],[])dnl
466*6236dae4SAndroid Build Coastguard Worker])
467