blob: b4a87afe6ef3109cfe06ec3727c7b557dcf78aa6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# relocatable.m4 serial 14
AC_DEFUN([gl_RELOCATABLE],
[
AC_REQUIRE([gl_RELOCATABLE_BODY])
gl_RELOCATABLE_LIBRARY
if test $RELOCATABLE = yes; then
AC_LIBOBJ([progreloc])
fi
: ${RELOCATABLE_CONFIG_H_DIR='$(top_builddir)'}
RELOCATABLE_SRC_DIR="\$(top_srcdir)/$gl_source_base"
RELOCATABLE_BUILD_DIR="\$(top_builddir)/$gl_source_base"
])
AC_DEFUN([gl_RELOCATABLE_BODY],
[
AC_REQUIRE([AC_PROG_INSTALL])
AC_BEFORE([AC_PROG_INSTALL],[gl_RELOCATABLE_BODY])
AC_REQUIRE([AC_LIB_LIBPATH])
AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
is_noop=no
use_elf_origin_trick=no
if test $RELOCATABLE = yes; then
# --enable-relocatable implies --disable-rpath
enable_rpath=no
AC_CHECK_HEADERS([mach-o/dyld.h])
AC_CHECK_FUNCS([_NSGetExecutablePath])
case "$host_os" in
mingw*) is_noop=yes ;;
linux*) use_elf_origin_trick=yes ;;
esac
if test $is_noop = yes; then
RELOCATABLE_LDFLAGS=:
AC_SUBST([RELOCATABLE_LDFLAGS])
else
if test $use_elf_origin_trick = yes; then
case "$ac_aux_dir" in
/*) reloc_ldflags="$ac_aux_dir/reloc-ldflags" ;;
*) reloc_ldflags="\$(top_builddir)/$ac_aux_dir/reloc-ldflags" ;;
esac
RELOCATABLE_LDFLAGS="\"$reloc_ldflags\" \"\$(host)\" \"\$(RELOCATABLE_LIBRARY_PATH)\""
AC_SUBST([RELOCATABLE_LDFLAGS])
else
INSTALL_PROGRAM_ENV="RELOC_LIBRARY_PATH_VAR=\"$shlibpath_var\" RELOC_LIBRARY_PATH_VALUE=\"\$(RELOCATABLE_LIBRARY_PATH)\" RELOC_PREFIX=\"\$(prefix)\" RELOC_DESTDIR=\"\$(DESTDIR)\" RELOC_COMPILE_COMMAND=\"\$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(LDFLAGS)\" RELOC_SRCDIR=\"\$(RELOCATABLE_SRC_DIR)\" RELOC_BUILDDIR=\"\$(RELOCATABLE_BUILD_DIR)\" RELOC_CONFIG_H_DIR=\"\$(RELOCATABLE_CONFIG_H_DIR)\" RELOC_EXEEXT=\"\$(EXEEXT)\" RELOC_STRIP_PROG=\"\$(RELOCATABLE_STRIP)\" RELOC_INSTALL_PROG=\"$INSTALL_PROGRAM\""
AC_SUBST([INSTALL_PROGRAM_ENV])
case "$ac_aux_dir" in
/*) INSTALL_PROGRAM="$ac_aux_dir/install-reloc" ;;
*) INSTALL_PROGRAM="\$(top_builddir)/$ac_aux_dir/install-reloc" ;;
esac
fi
fi
fi
AM_CONDITIONAL([RELOCATABLE_VIA_LD],
[test $is_noop = yes || test $use_elf_origin_trick = yes])
AC_SUBST([RELOCATABLE_LIBRARY_PATH])
AC_SUBST([RELOCATABLE_CONFIG_H_DIR])
AC_SUBST([RELOCATABLE_SRC_DIR])
AC_SUBST([RELOCATABLE_BUILD_DIR])
])
AC_DEFUN([AC_LIB_LIBPATH],
[
AC_REQUIRE([AC_LIB_PROG_LD])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])
AC_CACHE_CHECK([for shared library path variable], [acl_cv_libpath], [
LD="$LD" \
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.libpath" "$host" > conftest.sh
. ./conftest.sh
rm -f ./conftest.sh
acl_cv_libpath=${acl_cv_shlibpath_var:-none}
])
shlibpath_var="$acl_cv_shlibpath_var"
])
|