Commit b15a7c9f authored by Tom Lane's avatar Tom Lane

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.
parent b0984e69
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -58,18 +58,12 @@ nextstep*) os=nextstep need_tas=no ;; ...@@ -58,18 +58,12 @@ nextstep*) os=nextstep need_tas=no ;;
exit;; exit;;
esac esac
# If this test fails then it is ELF for sure PORTNAME=${os}
if echo __ELF__ | ${CC} -E - | grep -q __ELF__ CPU=${host_cpu}
then AC_LINK_FILES(backend/port/dynloader/${os}.c, backend/port/dynloader.c)
if test "X$elf" = "Xyes" AC_LINK_FILES(backend/port/dynloader/${os}.h, include/dynloader.h)
then AC_LINK_FILES(include/port/${os}.h, include/os.h)
ELF_SYS=true AC_LINK_FILES(makefiles/Makefile.${os}, Makefile.port)
else
ELF_SYS=
fi
else
ELF_SYS=true
fi
if test "X$need_tas" = "Xyes" if test "X$need_tas" = "Xyes"
then then
...@@ -78,13 +72,6 @@ then ...@@ -78,13 +72,6 @@ then
AC_SUBST(TAS) AC_SUBST(TAS)
fi 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..." echo "checking echo setting..."
if echo '\c' | grep -s c >/dev/null 2>&1 if echo '\c' | grep -s c >/dev/null 2>&1
then then
...@@ -424,6 +411,22 @@ echo "- setting CPPFLAGS=$CPPFLAGS" ...@@ -424,6 +411,22 @@ echo "- setting CPPFLAGS=$CPPFLAGS"
LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS" LDFLAGS="$LDFLAGS $PGSQL_LDFLAGS"
echo "- setting LDFLAGS=$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(ELF_SYS)
AC_SUBST(PORTNAME) AC_SUBST(PORTNAME)
AC_SUBST(CPU) AC_SUBST(CPU)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment