config.apple   [plain text]


#
# config.apple
#
# Copyright Apple Computer, Inc., 2003
#

# Overridable ".weak_definition" support.
# Infer support for ".weak_definition" by experimentation with buildhost assembler.
# Completely overridable via hard-to-spell environment variables;
# permits construction of a Puma-compatible compiler on a Jaguar system, in theory.
# ".weak_definition" was first supported in the Jaguar assembler.
#
# if ${APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO} == "1",
#   build compiler to employ ".weak_definition" pseudo
# elseif ${APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO} != "1",
#   build compiler to never use ".weak_definition" pseudo
# else if ${APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO} is undefined,
#   (usual case)
#   test buildhost assembler for ".weak_directive" support
#
# the "other" host in a two-way fat build is assumed to have a similar assembler
#
muttering="checking whether assembler supports weak section attribute."
echo -n "$muttering"".... " 1>&6
echo "config.apple: $muttering" >&5
apple_gcc_as_weak_assembler_directive="no"
target_arch=$(echo $target | sed 's/\([^-]*\)-.*/\1/')
if test s${APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO:+et} == set ; then
  echo -n "(overridden by \$APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO) " 1>&6
  if test x${APPLE_ASSEMBLER_HAS_WEAK_DEFINITION_PSEUDO} == x1 ; then
    apple_gcc_as_weak_assembler_directive="yes"
  fi
else
  cat > conftest.s <<EOF
.section __TEXT,text,coalesced
	.align 2
        .weak_definition foo
	.globl foo
foo:
EOF
  if /usr/bin/as -arch $target_arch -o conftest.o conftest.s > /dev/null 2>&1 ; then
    apple_gcc_as_weak_assembler_directive="yes"
  fi
  rm -f conftest.s conftest.o
  if test x"$apple_gcc_as_weak_assembler_directive" = xyes; then
	cat >> confdefs.h <<\EOF
#define APPLE_WEAK_ASSEMBLER_DIRECTIVE 1
EOF
  fi
fi
unset target_arch
echo $apple_gcc_as_weak_assembler_directive  1>&6
echo "site script $CONFIG_SITE done."