summaryrefslogtreecommitdiff
path: root/src/configure.in
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-08-03 00:09:32 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-08-03 00:09:32 +0000
commitb15a7c9fbe09ce93d65bbb24b2026d8ff008a71f (patch)
tree7612e78d5e1aeda3996d5b25fb5404a095323d1b /src/configure.in
parentb0984e699505034d7f55c4a0be4a3cf3722b2cd0 (diff)
downloadpostgresql-b15a7c9fbe09ce93d65bbb24b2026d8ff008a71f.tar.gz
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.
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/configure.in b/src/configure.in
index 8a22a2f90d..1b95fd1343 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -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)