add support for hosts that have custom symbol prefixes

From: Mike Frysinger <vapier@gentoo.org>

some architectures, like Blackfin, have a prefix added to all symbols (in our
case it's historical baggage)

while normally packages shouldnt care, when code starts mixing assembler with
C (like symbol versioning), you need to dip down into the inner details.
find attached a patch which queries gcc for the prefix (all gcc toolchains
have a builtin define of __USER_LABEL_PREFIX__) and then automatically has
asm() constructs utilize this

since most targets define __USER_LABEL_PREFIX__ to nothing, hopefully this
shouldnt cause any problems :)
This commit is contained in:
Takashi Iwai 2006-09-19 18:07:51 +02:00
parent 0211bc3b68
commit f0fbd4c03e
3 changed files with 33 additions and 19 deletions

View file

@ -34,6 +34,7 @@ fi
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_DISABLE_STATIC
@ -105,6 +106,16 @@ else
fi
AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes)
dnl See if toolchain has a custom prefix for symbols ...
AC_MSG_CHECKING(for custom symbol prefixes)
SYMBOL_PREFIX=` \
echo "PREFIX=__USER_LABEL_PREFIX__" \
| ${CPP-${CC-gcc} -E} - 2>&1 \
| ${EGREP-grep} "^PREFIX=" \
| ${SED-sed} "s:^PREFIX=::"`
AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
AC_MSG_RESULT($SYMBOL_PREFIX)
dnl Check for debug...
AC_MSG_CHECKING(for debug)
AC_ARG_WITH(debug,