diff options
author | Richard Purdie <richard@openedhand.com> | 2008-10-10 11:20:30 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-10-10 11:20:30 +0000 |
commit | e3609610471809a8890b2dd4bb5fa88688e02977 (patch) | |
tree | 87cdff7d6019351a80ef4cea2216003b1409272d /meta/packages/libtool/libtool-2.2.6/dolt.m4 | |
parent | 3860decab26d0b0a839734f2bd882c5b857431ea (diff) | |
download | poky-e3609610471809a8890b2dd4bb5fa88688e02977.tar.gz |
libtool: Upgrade to 2.2.6
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5475 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/libtool/libtool-2.2.6/dolt.m4')
-rw-r--r-- | meta/packages/libtool/libtool-2.2.6/dolt.m4 | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/meta/packages/libtool/libtool-2.2.6/dolt.m4 b/meta/packages/libtool/libtool-2.2.6/dolt.m4 new file mode 100644 index 0000000000..9bedecf273 --- /dev/null +++ b/meta/packages/libtool/libtool-2.2.6/dolt.m4 | |||
@@ -0,0 +1,129 @@ | |||
1 | dnl dolt, a replacement for libtool | ||
2 | dnl Copyright © 2007-2008 Josh Triplett <josh@freedesktop.org> | ||
3 | dnl Copying and distribution of this file, with or without modification, | ||
4 | dnl are permitted in any medium without royalty provided the copyright | ||
5 | dnl notice and this notice are preserved. | ||
6 | dnl | ||
7 | dnl To use dolt, invoke the DOLT macro immediately after the libtool macros. | ||
8 | dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it | ||
9 | dnl installed when running autoconf on your project. | ||
10 | |||
11 | AC_DEFUN([DOLT], [ | ||
12 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
13 | # dolt, a replacement for libtool | ||
14 | # Josh Triplett <josh@freedesktop.org> | ||
15 | AC_PATH_PROG(DOLT_BASH, bash) | ||
16 | AC_MSG_CHECKING([if dolt supports this host]) | ||
17 | dolt_supported=yes | ||
18 | if test x$DOLT_BASH = x; then | ||
19 | AC_MSG_ERROR([dolt: Bash not found, fatal error]) | ||
20 | fi | ||
21 | if test x$GCC != xyes; then | ||
22 | AC_MSG_ERROR([dolt: gcc not found, fatal error]) | ||
23 | fi | ||
24 | case $host in | ||
25 | i?86-*-linux*|x86_64-*-linux*|arm-*-linux*) ;; | ||
26 | *) AC_MSG_ERROR([dolt: incompatible host, fatal error]) ;; | ||
27 | esac | ||
28 | AC_MSG_RESULT([yes, replacing libtool]) | ||
29 | |||
30 | dnl Start writing out doltcompile. | ||
31 | cat <<__DOLTCOMPILE__EOF__ >doltcompile | ||
32 | #!$DOLT_BASH | ||
33 | __DOLTCOMPILE__EOF__ | ||
34 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
35 | args=("$[]@") | ||
36 | for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do | ||
37 | if test x"${args@<:@$arg@:>@}" = x-o ; then | ||
38 | objarg=$((arg+1)) | ||
39 | break | ||
40 | fi | ||
41 | done | ||
42 | if test x$objarg = x ; then | ||
43 | echo 'Error: no -o on compiler command line' 1>&2 | ||
44 | exit 1 | ||
45 | fi | ||
46 | lo="${args@<:@$objarg@:>@}" | ||
47 | obj="${lo%.lo}" | ||
48 | if test x"$lo" = x"$obj" ; then | ||
49 | echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2 | ||
50 | exit 1 | ||
51 | fi | ||
52 | objbase="${obj##*/}" | ||
53 | __DOLTCOMPILE__EOF__ | ||
54 | |||
55 | dnl Write out shared compilation code. | ||
56 | if test x$enable_shared = xyes; then | ||
57 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
58 | libobjdir="${obj%$objbase}.libs" | ||
59 | if test ! -d "$libobjdir" ; then | ||
60 | mkdir "$libobjdir" | ||
61 | mkdir_ret=$? | ||
62 | if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then | ||
63 | exit $mkdir_ret | ||
64 | fi | ||
65 | fi | ||
66 | pic_object="$libobjdir/$objbase.o" | ||
67 | args@<:@$objarg@:>@="$pic_object" | ||
68 | "${args@<:@@@:>@}" -fPIC -DPIC | ||
69 | __DOLTCOMPILE__EOF__ | ||
70 | fi | ||
71 | |||
72 | dnl Write out static compilation code. | ||
73 | dnl Avoid duplicate compiler output if also building shared objects. | ||
74 | if test x$enable_static = xyes; then | ||
75 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
76 | non_pic_object="$obj.o" | ||
77 | args@<:@$objarg@:>@="$non_pic_object" | ||
78 | __DOLTCOMPILE__EOF__ | ||
79 | if test x$enable_shared = xyes; then | ||
80 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
81 | "${args@<:@@@:>@}" >/dev/null 2>&1 | ||
82 | __DOLTCOMPILE__EOF__ | ||
83 | else | ||
84 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
85 | "${args@<:@@@:>@}" | ||
86 | __DOLTCOMPILE__EOF__ | ||
87 | fi | ||
88 | fi | ||
89 | |||
90 | dnl Write out the code to write the .lo file. | ||
91 | dnl The second line of the .lo file must match "^# Generated by .*libtool" | ||
92 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
93 | { | ||
94 | echo "# $lo - a libtool object file" | ||
95 | echo "# Generated by doltcompile, not libtool" | ||
96 | __DOLTCOMPILE__EOF__ | ||
97 | |||
98 | if test x$enable_shared = xyes; then | ||
99 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
100 | echo "pic_object='$pic_object'" | ||
101 | __DOLTCOMPILE__EOF__ | ||
102 | else | ||
103 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
104 | echo pic_object=none | ||
105 | __DOLTCOMPILE__EOF__ | ||
106 | fi | ||
107 | |||
108 | if test x$enable_static = xyes; then | ||
109 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
110 | echo "non_pic_object='$non_pic_object'" | ||
111 | __DOLTCOMPILE__EOF__ | ||
112 | else | ||
113 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
114 | echo non_pic_object=none | ||
115 | __DOLTCOMPILE__EOF__ | ||
116 | fi | ||
117 | |||
118 | cat <<'__DOLTCOMPILE__EOF__' >>doltcompile | ||
119 | } > "$lo" | ||
120 | __DOLTCOMPILE__EOF__ | ||
121 | |||
122 | dnl Done writing out doltcompile; substitute it for libtool compilation. | ||
123 | chmod +x doltcompile | ||
124 | LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)' | ||
125 | AC_SUBST(LTCOMPILE) | ||
126 | LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)' | ||
127 | AC_SUBST(LTCXXCOMPILE) | ||
128 | # end dolt | ||
129 | ]) | ||