1 |
|
## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*- |
2 |
|
## Copyright (C) 1999-2000 Free Software Foundation, Inc. |
3 |
|
## |
4 |
|
## This program is free software; you can redistribute it and/or modify |
5 |
|
## it under the terms of the GNU General Public License as published by |
6 |
|
## the Free Software Foundation; either version 2 of the License, or |
7 |
|
## (at your option) any later version. |
8 |
|
## |
9 |
|
## This program is distributed in the hope that it will be useful, but |
10 |
|
## WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
|
## General Public License for more details. |
13 |
|
## |
14 |
|
## You should have received a copy of the GNU General Public License |
15 |
|
## along with this program; if not, write to the Free Software |
16 |
|
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 |
|
## |
18 |
|
## As a special exception to the GNU General Public License, if you |
19 |
|
## distribute this file as part of a program that contains a |
20 |
|
## configuration script generated by Autoconf, you may include it under |
21 |
|
## the same distribution terms that you use for the rest of that program. |
22 |
|
|
23 |
|
# serial 2 AC_LIB_LTDL |
24 |
|
|
25 |
|
# AC_LIB_LTDL |
26 |
|
# ----------- |
27 |
|
AC_DEFUN(AC_LIB_LTDL, |
28 |
|
[AC_PREREQ(2.13)dnl |
29 |
|
AC_REQUIRE([AC_PROG_CC])dnl |
30 |
|
AC_REQUIRE([AC_C_CONST])dnl |
31 |
|
|
32 |
|
# Perform all the checks necessary for compilation of the ltdl objects |
33 |
|
# -- including compiler checks (above) and header checks (below). |
34 |
|
AC_REQUIRE([AC_HEADER_STDC])dnl |
35 |
|
AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl |
36 |
|
|
37 |
|
AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dl.h sys/dl.h dld.h) |
38 |
|
AC_CHECK_HEADERS(string.h strings.h, break) |
39 |
|
AC_CHECK_FUNCS(strchr index, break) |
40 |
|
AC_CHECK_FUNCS(strrchr rindex, break) |
41 |
|
AC_CHECK_FUNCS(memcpy bcopy, break) |
42 |
|
AC_CHECK_FUNCS(strcmp) |
43 |
|
|
44 |
|
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl |
45 |
|
AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl |
46 |
|
AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl |
47 |
|
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl |
48 |
|
AC_REQUIRE([AC_LTDL_OBJDIR])dnl |
49 |
|
AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl |
50 |
|
AC_REQUIRE([AC_LTDL_DLLIB])dnl |
51 |
|
AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl |
52 |
|
AC_REQUIRE([AC_LTDL_DLSYM_USCORE])dnl |
53 |
|
AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])dnl |
54 |
|
])# AC_LIB_LTDL |
55 |
|
|
56 |
|
# AC_LTDL_ENABLE_INSTALL |
57 |
|
# ---------------------- |
58 |
|
AC_DEFUN(AC_LTDL_ENABLE_INSTALL, |
59 |
|
[AC_ARG_ENABLE(ltdl-install, |
60 |
|
[ --enable-ltdl-install install libltdl]) |
61 |
|
|
62 |
|
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) |
63 |
|
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) |
64 |
|
])])# AC_LTDL_ENABLE_INSTALL |
65 |
|
|
66 |
|
# AC_LTDL_SYS_DLOPEN_DEPLIBS |
67 |
|
# -------------------------- |
68 |
|
AC_DEFUN(AC_LTDL_SYS_DLOPEN_DEPLIBS, |
69 |
|
[AC_REQUIRE([AC_CANONICAL_HOST]) |
70 |
|
AC_CACHE_CHECK([whether deplibs are loaded by dlopen], |
71 |
|
libltdl_cv_sys_dlopen_deplibs, [dnl |
72 |
|
# PORTME does your system automatically load deplibs for dlopen()? |
73 |
|
libltdl_cv_sys_dlopen_deplibs=unknown |
74 |
|
case "$host_os" in |
75 |
|
linux*) |
76 |
|
libltdl_cv_sys_dlopen_deplibs=yes |
77 |
|
;; |
78 |
|
netbsd*) |
79 |
|
libltdl_cv_sys_dlopen_deplibs=yes |
80 |
|
;; |
81 |
|
solaris*) |
82 |
|
libltdl_cv_sys_dlopen_deplibs=yes |
83 |
|
;; |
84 |
|
esac |
85 |
|
]) |
86 |
|
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then |
87 |
|
AC_DEFINE(LTDL_DLOPEN_DEPLIBS, 1, |
88 |
|
[Define if the OS needs help to load dependent libraries for dlopen(). ]) |
89 |
|
fi |
90 |
|
])# AC_LTDL_SYS_DLOPEN_DEPLIBS |
91 |
|
|
92 |
|
# AC_LTDL_SHLIBEXT |
93 |
|
# ---------------- |
94 |
|
AC_DEFUN(AC_LTDL_SHLIBEXT, |
95 |
|
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
96 |
|
AC_CACHE_CHECK([which extension is used for shared libraries], |
97 |
|
libltdl_cv_shlibext, |
98 |
|
[ac_last= |
99 |
|
for ac_spec in $library_names_spec; do |
100 |
|
ac_last="$ac_spec" |
101 |
|
done |
102 |
|
echo "$ac_last" | [sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//'] > conftest |
103 |
|
libltdl_cv_shlibext=`cat conftest` |
104 |
|
rm -f conftest |
105 |
|
]) |
106 |
|
if test -n "$libltdl_cv_shlibext"; then |
107 |
|
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext", |
108 |
|
[Define to the extension used for shared libraries, say, ".so". ]) |
109 |
|
fi |
110 |
|
])# AC_LTDL_SHLIBEXT |
111 |
|
|
112 |
|
# AC_LTDL_SHLIBPATH |
113 |
|
# ----------------- |
114 |
|
AC_DEFUN(AC_LTDL_SHLIBPATH, |
115 |
|
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
116 |
|
AC_CACHE_CHECK([which variable specifies run-time library path], |
117 |
|
libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"]) |
118 |
|
if test -n "$libltdl_cv_shlibpath_var"; then |
119 |
|
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var", |
120 |
|
[Define to the name of the environment variable that determines the dynamic library search path. ]) |
121 |
|
fi |
122 |
|
])# AC_LTDL_SHLIBPATH |
123 |
|
|
124 |
|
# AC_LTDL_SYSSEARCHPATH |
125 |
|
# --------------------- |
126 |
|
AC_DEFUN(AC_LTDL_SYSSEARCHPATH, |
127 |
|
[AC_REQUIRE([_LT_AC_LTCONFIG_HACK]) |
128 |
|
AC_CACHE_CHECK([for the default library search path], |
129 |
|
libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) |
130 |
|
if test -n "$libltdl_cv_sys_search_path"; then |
131 |
|
case "$host" in |
132 |
|
*-*-mingw*) pathsep=";" ;; |
133 |
|
*) pathsep=":" ;; |
134 |
|
esac |
135 |
|
sys_search_path= |
136 |
|
for dir in $libltdl_cv_sys_search_path; do |
137 |
|
if test -z "$sys_search_path"; then |
138 |
|
sys_search_path="$dir" |
139 |
|
else |
140 |
|
sys_search_path="$sys_search_path$pathsep$dir" |
141 |
|
fi |
142 |
|
done |
143 |
|
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path", |
144 |
|
[Define to the system default library search path. ]) |
145 |
|
fi |
146 |
|
])# AC_LTDL_SYSSEARCHPATH |
147 |
|
|
148 |
|
# AC_LTDL_OBJDIR |
149 |
|
# -------------- |
150 |
|
AC_DEFUN(AC_LTDL_OBJDIR, |
151 |
|
[AC_CACHE_CHECK([for objdir], |
152 |
|
libltdl_cv_objdir, [libltdl_cv_objdir="$objdir" |
153 |
|
if test -n "$objdir"; then |
154 |
|
: |
155 |
|
else |
156 |
|
rm -f .libs 2>/dev/null |
157 |
|
mkdir .libs 2>/dev/null |
158 |
|
if test -d .libs; then |
159 |
|
libltdl_cv_objdir=.libs |
160 |
|
else |
161 |
|
# MS-DOS does not allow filenames that begin with a dot. |
162 |
|
libltdl_cv_objdir=_libs |
163 |
|
fi |
164 |
|
rmdir .libs 2>/dev/null |
165 |
|
fi]) |
166 |
|
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/", |
167 |
|
[Define to the sub-directory in which libtool stores uninstalled libraries. ]) |
168 |
|
])# AC_LTDL_OBJDIR |
169 |
|
|
170 |
|
# AC_LTDL_DLPREOPEN |
171 |
|
# ----------------- |
172 |
|
AC_DEFUN(AC_LTDL_DLPREOPEN, |
173 |
|
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl |
174 |
|
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], |
175 |
|
libltdl_cv_preloaded_symbols, [dnl |
176 |
|
if test -n "$global_symbol_pipe"; then |
177 |
|
libltdl_cv_preloaded_symbols=yes |
178 |
|
else |
179 |
|
libltdl_cv_preloaded_symbols=no |
180 |
|
fi |
181 |
|
]) |
182 |
|
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then |
183 |
|
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1, |
184 |
|
[Define if libtool can extract symbol lists from object files. ]) |
185 |
|
fi |
186 |
|
])# AC_LTDL_DLPREOPEN |
187 |
|
|
188 |
|
# AC_LTDL_DLLIB |
189 |
|
# ------------- |
190 |
|
AC_DEFUN(AC_LTDL_DLLIB, |
191 |
|
[LIBADD_DL= |
192 |
|
AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
193 |
|
[Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"], |
194 |
|
[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
195 |
|
[Define if you have the libdl library or equivalent.])], |
196 |
|
[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1, |
197 |
|
[Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"] |
198 |
|
)])]) |
199 |
|
AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1, |
200 |
|
[Define if you have the shl_load function.])], |
201 |
|
[AC_CHECK_LIB(dld, shl_load, |
202 |
|
[AC_DEFINE(HAVE_SHL_LOAD, 1, |
203 |
|
[Define if you have the shl_load function.]) |
204 |
|
LIBADD_DL="$LIBADD_DL -ldld"]) |
205 |
|
]) |
206 |
|
AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1, |
207 |
|
[Define if you have the GNU dld library.])dnl |
208 |
|
test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"]) |
209 |
|
AC_SUBST(LIBADD_DL) |
210 |
|
|
211 |
|
if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then |
212 |
|
LIBS_SAVE="$LIBS" |
213 |
|
LIBS="$LIBS $LIBADD_DL" |
214 |
|
AC_CHECK_FUNCS(dlerror) |
215 |
|
LIBS="$LIBS_SAVE" |
216 |
|
fi |
217 |
|
])# AC_LTDL_DLLIB |
218 |
|
|
219 |
|
# AC_LTDL_SYMBOL_USCORE |
220 |
|
# --------------------- |
221 |
|
AC_DEFUN(AC_LTDL_SYMBOL_USCORE, |
222 |
|
[dnl does the compiler prefix global symbols with an underscore? |
223 |
|
AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl |
224 |
|
AC_MSG_CHECKING([for _ prefix in compiled symbols]) |
225 |
|
AC_CACHE_VAL(ac_cv_sys_symbol_underscore, |
226 |
|
[ac_cv_sys_symbol_underscore=no |
227 |
|
cat > conftest.$ac_ext <<EOF |
228 |
|
void nm_test_func(){} |
229 |
|
int main(){nm_test_func;return 0;} |
230 |
|
EOF |
231 |
|
if AC_TRY_EVAL(ac_compile); then |
232 |
|
# Now try to grab the symbols. |
233 |
|
ac_nlist=conftest.nm |
234 |
|
if AC_TRY_EVAL(NM conftest.$ac_objext \| $global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then |
235 |
|
# See whether the symbols have a leading underscore. |
236 |
|
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then |
237 |
|
ac_cv_sys_symbol_underscore=yes |
238 |
|
else |
239 |
|
if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then |
240 |
|
: |
241 |
|
else |
242 |
|
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC |
243 |
|
fi |
244 |
|
fi |
245 |
|
else |
246 |
|
echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC |
247 |
|
fi |
248 |
|
else |
249 |
|
echo "configure: failed program was:" >&AC_FD_CC |
250 |
|
cat conftest.c >&AC_FD_CC |
251 |
|
fi |
252 |
|
rm -rf conftest* |
253 |
|
]) |
254 |
|
AC_MSG_RESULT($ac_cv_sys_symbol_underscore) |
255 |
|
])# AC_LTDL_SYMBOL_USCORE |
256 |
|
|
257 |
|
|
258 |
|
# AC_LTDL_DLSYM_USCORE |
259 |
|
# -------------------- |
260 |
|
AC_DEFUN(AC_LTDL_DLSYM_USCORE, |
261 |
|
[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl |
262 |
|
if test x"$ac_cv_sys_symbol_underscore" = xyes; then |
263 |
|
if test x"$ac_cv_func_dlopen" = xyes || |
264 |
|
test x"$ac_cv_lib_dl_dlopen" = xyes ; then |
265 |
|
AC_CACHE_CHECK([whether we have to add an underscore for dlsym], |
266 |
|
libltdl_cv_need_uscore, [dnl |
267 |
|
libltdl_cv_need_uscore=unknown |
268 |
|
save_LIBS="$LIBS" |
269 |
|
LIBS="$LIBS $LIBADD_DL" |
270 |
|
_LT_AC_TRY_DLOPEN_SELF( |
271 |
|
libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes, |
272 |
|
[], libltdl_cv_need_uscore=cross) |
273 |
|
LIBS="$save_LIBS" |
274 |
|
]) |
275 |
|
fi |
276 |
|
fi |
277 |
|
|
278 |
|
if test x"$libltdl_cv_need_uscore" = xyes; then |
279 |
|
AC_DEFINE(NEED_USCORE, 1, |
280 |
|
[Define if dlsym() requires a leading underscode in symbol names. ]) |
281 |
|
fi |
282 |
|
])# AC_LTDL_DLSYM_USCORE |
283 |
|
|
284 |
dnl Autoconf macros for libmcrypt |
dnl Autoconf macros for libmcrypt |
285 |
dnl $id$ |
dnl $id$ |
286 |
|
|
301 |
[dnl |
[dnl |
302 |
dnl Get the cflags and libraries from the libmcrypt-config script |
dnl Get the cflags and libraries from the libmcrypt-config script |
303 |
dnl |
dnl |
304 |
|
AC_LTDL_DLLIB |
305 |
AC_ARG_WITH(libmcrypt-prefix, |
AC_ARG_WITH(libmcrypt-prefix, |
306 |
[ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)], |
[ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)], |
307 |
libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="") |
libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="") |
352 |
TTINCLUDE="-I${libmcrypt_config_prefix}/include" |
TTINCLUDE="-I${libmcrypt_config_prefix}/include" |
353 |
fi |
fi |
354 |
LIBMCRYPT_CFLAGS="${TTINCLUDE}" |
LIBMCRYPT_CFLAGS="${TTINCLUDE}" |
355 |
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl" |
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" |
356 |
AC_DEFINE(LIBMCRYPT24)) |
AC_DEFINE(LIBMCRYPT24)) |
357 |
else |
else |
358 |
dnl libmcrypt-config was found |
dnl libmcrypt-config was found |