Mercurial > hg > xemacs-beta
comparison configure.ac @ 5556:a142ad1a9140
Use dlsym() in preference to NSLookupSymbolInModule() on Darwin, if available.
ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* configure.ac:
On OS X, if dlopen() is available in dlfcn.h, use it in preference
to dyld; the latter API is deprecated.
Move DLSYM_NEEDS_UNDERSCORE together with HAVE_DLYD, it's not
needed if the dlsym() and dlopen() APIs are being used.
Define REALPATH_CORRECTS_CASE, DEFAULT_FILE_SYSTEM_IGNORE_CASE in
this file, don't define them in terms of HAVE_DYLD in
src/config.h.in.
* configure: Regenerate.
src/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* config.h.in:
Move REALPATH_CORRECTS_CASE, DEFAULT_FILE_SYSTEM_IGNORE_CASE to
../configure.ac rather than implementing them in terms of
HAVE_DYLD here.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 24 Aug 2011 23:41:29 +0100 |
parents | 4b5b7dcc19d6 |
children | 53c066311921 |
comparison
equal
deleted
inserted
replaced
5555:a39cd9dc92ba | 5556:a142ad1a9140 |
---|---|
1473 esac | 1473 esac |
1474 fi | 1474 fi |
1475 if test "$with_dynamic" = "yes"; then | 1475 if test "$with_dynamic" = "yes"; then |
1476 case "$opsys" in | 1476 case "$opsys" in |
1477 hpux* ) opsys="${opsys}-shr" ;; | 1477 hpux* ) opsys="${opsys}-shr" ;; |
1478 darwin ) AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) ;; | |
1479 esac | 1478 esac |
1480 else dnl "$with_dynamic" = "no" | 1479 else dnl "$with_dynamic" = "no" |
1481 case "$opsys" in | 1480 case "$opsys" in |
1482 sol2 ) | 1481 sol2 ) |
1483 echo "Static linking is not supported on Solaris 2." | 1482 echo "Static linking is not supported on Solaris 2." |
3373 else | 3372 else |
3374 LIBSTDCPP= | 3373 LIBSTDCPP= |
3375 fi | 3374 fi |
3376 AC_SUBST(LIBSTDCPP) | 3375 AC_SUBST(LIBSTDCPP) |
3377 | 3376 |
3377 dnl Tell the pathname handling code about a couple of Darwin-specific things | |
3378 dnl it needs to know: | |
3379 if test "$opsys" = "darwin"; then | |
3380 AC_DEFINE(REALPATH_CORRECTS_CASE) | |
3381 AC_DEFINE(DEFAULT_FILE_SYSTEM_IGNORE_CASE) | |
3382 fi | |
3383 | |
3378 dnl This must come before the detection code for anything that is in a module | 3384 dnl This must come before the detection code for anything that is in a module |
3379 if test "$with_modules" != "no"; then | 3385 if test "$with_modules" != "no"; then |
3380 AC_MSG_CHECKING([for module support]) | 3386 AC_MSG_CHECKING([for module support]) |
3381 AC_MSG_RESULT() | 3387 AC_MSG_RESULT() |
3382 | 3388 |
3383 case "$opsys" in | 3389 case "$opsys" in |
3384 mingw* | cygwin* ) have_dl=yes ;; | 3390 mingw* | cygwin* ) have_dl=yes ;; |
3385 darwin ) have_dl=yes | 3391 *) |
3386 AC_DEFINE(HAVE_DYLD) | |
3387 ;; | |
3388 * ) | |
3389 dnl Check for the ELFish dlopen() | 3392 dnl Check for the ELFish dlopen() |
3390 AC_CHECK_HEADER(dlfcn.h, [ | 3393 AC_CHECK_HEADER(dlfcn.h, [ |
3391 AC_MSG_CHECKING([for dlopen in -lc]) | 3394 AC_MSG_CHECKING([for dlopen in -lc]) |
3392 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dlfcn.h>], | 3395 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dlfcn.h>], |
3393 [dlopen ("", 0);])], [ have_dl=yes ; AC_MSG_RESULT($have_dl)], [ | 3396 [dlopen ("", 0);])], [ have_dl=yes ; AC_MSG_RESULT($have_dl)], [ |
3404 [dlopen ("", 0);])], [ have_dl=yes; AC_MSG_RESULT($have_dl) ], | 3407 [dlopen ("", 0);])], [ have_dl=yes; AC_MSG_RESULT($have_dl) ], |
3405 [LIBS="$ac_save_LIBS" ; AC_MSG_RESULT([no])])])])]) | 3408 [LIBS="$ac_save_LIBS" ; AC_MSG_RESULT([no])])])])]) |
3406 if test "$have_dl" = "yes"; then | 3409 if test "$have_dl" = "yes"; then |
3407 AC_DEFINE(HAVE_DLOPEN) | 3410 AC_DEFINE(HAVE_DLOPEN) |
3408 else | 3411 else |
3409 dnl Check for HP/UX shl_load | 3412 dnl On Darwin, the DYLD API is deprecated, so we prefer dlopen if |
3410 AC_CHECK_HEADER(dl.h, [ | 3413 dnl available, above. |
3411 AC_MSG_CHECKING([for shl_load in -lc]) | 3414 if test "$opsys" = "darwin"; then |
3412 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], | 3415 have_dl=yes |
3413 [shl_load ("", 0, 0);])], [have_dl=yes; AC_MSG_RESULT($have_dl)], [ | 3416 AC_DEFINE(HAVE_DYLD) |
3414 AC_MSG_RESULT([no]) | 3417 AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) |
3415 AC_MSG_CHECKING([for shl_load in -ldl]) | 3418 else |
3416 ac_save_LIBS="$LIBS" | 3419 dnl Check for HP/UX shl_load |
3417 LIBS="$LIBS -ldld" | 3420 AC_CHECK_HEADER(dl.h, [ |
3418 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], | 3421 AC_MSG_CHECKING([for shl_load in -lc]) |
3419 [shl_load ("", 0, 0);])], [have_dl=yes], | 3422 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], |
3420 [LIBS="$ac_save_LIBS"; AC_MSG_RESULT([no])])])]) | 3423 [shl_load ("", 0, 0);])], [have_dl=yes; AC_MSG_RESULT($have_dl)],[ |
3421 if test "$have_dl" = "yes"; then | 3424 AC_MSG_RESULT([no]) |
3422 AC_DEFINE(HAVE_SHL_LOAD) | 3425 AC_MSG_CHECKING([for shl_load in -ldl]) |
3423 else | 3426 ac_save_LIBS="$LIBS" |
3424 dnl Check for libtool's libltdl | 3427 LIBS="$LIBS -ldld" |
3425 AC_CHECK_HEADER(ltdl.h, [ | 3428 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], |
3426 AC_MSG_CHECKING([for lt_dlinit in -lltdl]) | 3429 [shl_load ("", 0, 0);])], [have_dl=yes], |
3427 ac_save_LIBS="$LIBS" | 3430 [LIBS="$ac_save_LIBS"; AC_MSG_RESULT([no])])])]) |
3428 LIBS="$LIBS -lltdl" | 3431 if test "$have_dl" = "yes"; then |
3429 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ltdl.h>], | 3432 AC_DEFINE(HAVE_SHL_LOAD) |
3430 [lt_dlinit ();])], [have_dl=yes], [LIBS="$ac_save_LIBS"])]) | 3433 else |
3431 AC_MSG_RESULT($have_dl) | 3434 dnl Check for libtool's libltdl |
3432 if test "$have_dl" = "yes"; then | 3435 AC_CHECK_HEADER(ltdl.h, [ |
3433 AC_DEFINE(HAVE_LTDL) | 3436 AC_MSG_CHECKING([for lt_dlinit in -lltdl]) |
3434 fi | 3437 ac_save_LIBS="$LIBS" |
3435 dnl end !HP/UX | 3438 LIBS="$LIBS -lltdl" |
3436 fi | 3439 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ltdl.h>], |
3440 [lt_dlinit ();])], [have_dl=yes], [LIBS="$ac_save_LIBS"])]) | |
3441 AC_MSG_RESULT($have_dl) | |
3442 if test "$have_dl" = "yes"; then | |
3443 AC_DEFINE(HAVE_LTDL) | |
3444 fi | |
3445 dnl end !HP/UX | |
3446 fi | |
3447 fi | |
3437 dnl end !dlopen | 3448 dnl end !dlopen |
3438 fi | 3449 fi |
3439 ac_save_LIBS= | 3450 ac_save_LIBS= |
3440 dnl end !darwin | |
3441 esac | 3451 esac |
3442 | 3452 |
3443 if test -n "$have_dl"; then | 3453 if test -n "$have_dl"; then |
3444 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared | 3454 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared |
3445 XE_SHLIB_STUFF | 3455 XE_SHLIB_STUFF |