|
From: Jean-Francois P. <pan...@co...> - 2004-07-06 07:49:36
|
In acinclude.m4, there is code to figure out if dlsym() automatically adds an underscore in front of a symbol name on systems where symbols have an underscore prepended to them when an object file is generated. Here is what the code says: dnl ********************* dnl dlsym and Underscores dnl ********************* dnl Check checks whether dlsym (if present) requires a leading underscore. dnl Written by Dan Hagerty <ha...@ai...> for scsh-0.5.0. Unfortunately, this code doesn't work, since it depends on having previously tested for the presence of dlopen and/or whether dlopen lives in libdl, which is not done in configure.in. Thus on OS X, which adds underscores to names in objects but compensates for this in dlsym(), you end up with: /* #undef DLSYM_ADDS_USCORE */ but: #define USCORE 1 in include/openquicktime/config.h when you run ./configure (I know that there's a special macconfig.h in macos, but on OS X 10.3.x, it looks like the generic bootstrap/configure mechanism mostly works without needing special magic). The solution is to add the following tests to configure.in: *** configure.in.orig 2004-07-06 00:40:59.000000000 -0700 --- configure.in 2004-07-06 00:42:31.000000000 -0700 *************** *** 180,185 **** --- 180,187 ---- CFLAGS="$CFLAGS $my_cv_comment" dnl Check to see if dlsym adds an underscore + AC_CHECK_LIB(dl, dlopen) + AC_HAVE_FUNCS(dlopen) MY_DLSYM_USCORE AH_TEMPLATE([USCORE], [Define if symbol tables on this system use leading underscores.]) AH_TEMPLATE([DLSYM_ADDS_USCORE], [Define if dlsym automatically supplies a leading underscore.]) These tests will set the variables ac_cv_func_dlopen and ac_cv_lib_dl_dlopen to the correct values for the platform, and will make the code in MY_DLSYM_USCORE correctly generate the DLSYM_ADDS_USCORE define in config.h With this fix, OpenQuicktime can correctly load codec plugins on OS X 10.3.4. JF |