1
dnl Process this with autoconf to create configure
2
AC_INIT(lib/demangle.cc)
4
# This works around the fact that libtool configuration may change LD
5
# for this particular configuration, but some shells, instead of
6
# keeping the changes in LD private, export them just because LD is
8
ORIGINAL_LD_FOR_MULTILIBS=$LD
10
dnl We use these options to decide which functions to include.
11
AC_ARG_WITH(target-subdir,
12
[ --with-target-subdir=SUBDIR Configuring in a subdirectory for target])
13
AC_ARG_WITH(cross-host,
14
[ --with-cross-host=HOST Configuring with a cross compiler])
16
dnl Default to --enable-multilib
17
AC_ARG_ENABLE(multilib,
18
[ --enable-multilib build many library versions (default)],
19
[case "${enableval}" in
22
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
23
esac], [multilib=yes])dnl
25
dnl We may get other options which we don't document:
26
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
28
if test -n "${with_target_subdir}" && test "${srcdir}" = "."; then
29
if test "${with_target_subdir}" != "."; then
30
libdemangler_basedir="${with_multisrctop}../"
32
libdemangler_basedir="${with_multisrctop}"
37
AC_SUBST(libdemangler_basedir)
42
libdemangler_AC_PROG_CXX
45
AM_INIT_AUTOMAKE(demangler,1.0,no-define)
50
libdemangler_AC_NEW_DEMANGLER
51
if test -d ${srcdir}/${libdemangler_basedir}../libiberty; then
53
if test $libdemangler_cv_new_demangler = yes; then
54
libiberty_target=new_demangler
56
libiberty_target=old_demangler
60
libiberty_target=dummy_demangler
61
if test $libdemangler_cv_new_demangler != yes; then
63
*** C++ compiler is unable to compile a working demangler!])
66
AC_SUBST(libiberty_target)
69
if test -n "$with_cross_host" &&
70
test x"$with_cross_host" != x"no"; then
71
toolexecdir='$(exec_prefix)/$(target_alias)'
72
toolexeclibdir='$(toolexecdir)/lib'
74
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
75
toolexeclibdir='$(libdir)'
77
multi_os_directory=`$CC -print-multi-os-directory 2> /dev/null`
79
case $multi_os_directory in
80
.) ;; # Avoid trailing /.
81
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
85
AC_SUBST(toolexeclibdir)
87
if test "${multilib}" = "yes"; then
88
multilib_arg="--enable-multilib"
93
AC_OUTPUT(Makefile lib/Makefile,
95
if test -n "$CONFIG_FILES"; then
96
if test -n "${with_target_subdir}"; then
97
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
98
ac_file=Makefile . ${srcdir}/${libdemangler_basedir}../config-ml.in
105
with_target_subdir=${with_target_subdir}
106
with_multisubdir=${with_multisubdir}
107
ac_configure_args="${multilib_arg} ${ac_configure_args}"
108
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
109
libdemangler_basedir=${libdemangler_basedir}
112
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"