1244 |
AC_MSG_RESULT($cstack_direction) |
AC_MSG_RESULT($cstack_direction) |
1245 |
|
|
1246 |
|
|
1247 |
|
AC_MSG_CHECKING(for shared library/C stack ceiling to heap) |
1248 |
|
if test "$use" = "mingw" ; then |
1249 |
|
heap_ceiling=2000000000 |
1250 |
|
else |
1251 |
|
echo "int main() {return 0;}" >foo.c |
1252 |
|
$CC foo.c -o foo |
1253 |
|
heap_ceiling=`ldd foo | tail -n 1 | awk '{print $NF}' | tr -d '()'` |
1254 |
|
AC_TRY_RUN([#include <stdio.h> |
1255 |
|
int main() { |
1256 |
|
FILE *fp=fopen("conftest1","w"); |
1257 |
|
unsigned long h=$heap_ceiling,d=$dbegin,c=$cstack_address; |
1258 |
|
h=h<d ? 0 : h; |
1259 |
|
h=c>d && c<h ? c : h; |
1260 |
|
fprintf(fp,"0x%lx",h); |
1261 |
|
return 0;}],heap_ceiling=`cat conftest1`,echo failed;exit 1,echo failed;exit 1) |
1262 |
|
fi |
1263 |
|
AC_MSG_RESULT($heap_ceiling) |
1264 |
|
AC_DEFINE_UNQUOTED(SHARED_LIB_HEAP_CEILING,$heap_ceiling) |
1265 |
|
|
1266 |
## Don't lower heap start if C stack is below default dbegin, as we're |
## Don't lower heap start if C stack is below default dbegin, as we're |
1267 |
# likely to get more heap this way. |
# likely to get more heap this way. |
1268 |
if awk 'END {exit (unsigned long)d<(unsigned long)c ? 0 : 1}' d=$dbegin c=$cstack_address /dev/null ; then |
if awk 'END {exit h && (unsigned long)d<(unsigned long)c ? 0 : 1}' h=$heap_ceiling d=$dbegin c=$cstack_address /dev/null ; then |
1269 |
|
|
1270 |
AC_MSG_CHECKING("finding default linker script") |
AC_MSG_CHECKING("finding default linker script") |
1271 |
touch unixport/gcl.script |
touch unixport/gcl.script |
1343 |
fi |
fi |
1344 |
AC_DEFINE_UNQUOTED(DBEGIN,$dbegin) |
AC_DEFINE_UNQUOTED(DBEGIN,$dbegin) |
1345 |
|
|
|
AC_MSG_CHECKING(for shared library/C stack ceiling to heap) |
|
|
if test "$use" = "mingw" ; then |
|
|
heap_ceiling=2000000000 |
|
|
else |
|
|
echo "int main() {return 0;}" >foo.c |
|
|
$CC foo.c -o foo |
|
|
heap_ceiling=`ldd foo | tail -n 1 | awk '{print $NF}' | tr -d '()'` |
|
|
AC_TRY_RUN([#include <stdio.h> |
|
|
int main() { |
|
|
FILE *fp=fopen("conftest1","w"); |
|
|
unsigned long h=$heap_ceiling,d=$dbegin,c=$cstack_address; |
|
|
h=h<d ? 0 : h; |
|
|
h=c>d && c<h ? c : h; |
|
|
fprintf(fp,"0x%lx",h); |
|
|
return 0;}],heap_ceiling=`cat conftest1`,echo failed;exit 1,echo failed;exit 1) |
|
|
fi |
|
|
AC_MSG_RESULT($heap_ceiling) |
|
|
AC_DEFINE_UNQUOTED(SHARED_LIB_HEAP_CEILING,$heap_ceiling) |
|
|
|
|
1346 |
AC_MSG_CHECKING(for maxpage revision) |
AC_MSG_CHECKING(for maxpage revision) |
1347 |
AC_TRY_RUN([#include <stdio.h> |
AC_TRY_RUN([#include <stdio.h> |
1348 |
main() |
main() |