Fix ELF test so it doesn't spit up on all non-ELF systems...

use Autoconf-approved method of testing for predefined symbols, and move
it down to where we know what compiler to run and how to run it.
This commit is contained in:
Tom Lane 1999-08-03 00:09:32 +00:00
parent b0984e6995
commit b15a7c9fbe
2 changed files with 455 additions and 438 deletions

852
src/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -58,18 +58,12 @@ nextstep*) os=nextstep need_tas=no ;;
exit;;
esac
# If this test fails then it is ELF for sure
if echo __ELF__ | ${CC} -E - | grep -q __ELF__
then
if test "X$elf" = "Xyes"
then
ELF_SYS=true
else
ELF_SYS=
fi
else
ELF_SYS=true
fi
PORTNAME=${os}
CPU=${host_cpu}
AC_LINK_FILES(backend/port/dynloader/${os}.c, backend/port/dynloader.c)
AC_LINK_FILES(backend/port/dynloader/${os}.h, include/dynloader.h)
AC_LINK_FILES(include/port/${os}.h, include/os.h)
AC_LINK_FILES(makefiles/Makefile.${os}, Makefile.port)
if test "X$need_tas" = "Xyes"
then
@ -78,13 +72,6 @@ then
AC_SUBST(TAS)
fi
PORTNAME=${os}
CPU=${host_cpu}
AC_LINK_FILES(backend/port/dynloader/${os}.c, backend/port/dynloader.c)
AC_LINK_FILES(backend/port/dynloader/${os}.h, include/dynloader.h)
AC_LINK_FILES(include/port/${os}.h, include/os.h)
AC_LINK_FILES(makefiles/Makefile.${os}, Makefile.port)
echo "checking echo setting..."
if echo '\c' | grep -s c >/dev/null 2>&1
then
@ -424,6 +411,22 @@ echo "- setting CPPFLAGS=$CPPFLAGS"
LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
echo "- setting LDFLAGS=$LDFLAGS"
# Assume system is ELF if it predefines __ELF__ as 1,
# otherwise believe "elf" setting from check of host_os above.
AC_EGREP_CPP(yes,
[#if __ELF__
yes
#endif
],
ELF_SYS=true,
[if test "X$elf" = "Xyes"
then
ELF_SYS=true
else
ELF_SYS=
fi
])
AC_SUBST(ELF_SYS)
AC_SUBST(PORTNAME)
AC_SUBST(CPU)