[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[osx-users:0641] curlのインストール



 中村です。
環境はeMac900MHz OS X 10.2.6です。

 今、curl7.10.7のインストールをしようとしているのですが、うまく行きません。
エラーメッセージは
ldap.c: In function `DynaOpen':
ldap.c:88: `RTLD_LAZY' undeclared (first use in this function)
ldap.c:88: (Each undeclared identifier is reported only once
ldap.c:88: for each function it appears in.)
ldap.c:88: warning: assignment makes pointer from integer without a cast
ldap.c:89: warning: assignment makes pointer from integer without a cast
ldap.c: In function `DynaGetFunction':
ldap.c:114: warning: assignment makes pointer from integer without a cast
 って感じです。多分、RTLD_LAZYてのが問題だと思います。
 で、これでいろいろ調べていたのですが、MacOSXのdlopenとかが、少し他の環境と違うとか書いてありました。

 で、上記ldap.cファイルを、以下のように修正を行ったのですが、正しい修正だと思いますか?エラー処理は省いています(^^;;
 一応、appleのHPのdlopenの修正方法に書いてあった通りにやったつもりです。
 curl自体は正常に動作しているみたいですが、make test だとひとつだけfailします(;_:)

 すいませんが、よろしくお願いします。

 ではでは

1.
 #include <mach-o/dyld.h>を追加
2.下記DynaOpen関数を
**********ここから、オリジナル関数**********
static void *libldap = NULL;
static void *liblber = NULL;
static void DynaOpen(void)
{
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
if (libldap == NULL) {
/*
* libldap.so should be able to resolve its dependency on
* liblber.so automatically, but since it does not we will
* handle it here by opening liblber.so as global.
*/
liblber = dlopen("liblber.so",
#ifdef RTLD_LAZY_GLOBAL /* It turns out some systems use this: */
RTLD_LAZY_GLOBAL
#else
#ifdef RTLD_GLOBAL
RTLD_LAZY | RTLD_GLOBAL
#else
/* and some systems don't have the RTLD_GLOBAL symbol */
RTLD_LAZY
#endif
#endif
);
libldap = dlopen("libldap.so", RTLD_LAZY);
}
#endif
}
 を、このように修正しました。
**********ここから、修正した関数**********
NSObjectFileImage *liblber ;
NSObjectFileImage *libldap = NULL;
static void DynaOpen(void)
{
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
if (libldap == NULL) {
/*
* libldap.so should be able to resolve its dependency on
* liblber.so automatically, but since it does not we will
* handle it here by opening liblber.so as global.
*/
NSCreateObjectFileImageFromFile("liblber.so",liblber);
NSCreateObjectFileImageFromFile("libldap.so",libldap);
}
#endif
}


--[PR]------------------------------------------------------------------
 ●   ★☆★「水のクリタのうまい水」お試しキャンペーン実施中!★☆★
.∧>
 <\ =3        終了間近ッ! 急げ急げ!!
─────────────────────────────────────
     http://ad.freeml.com/cgi-bin/ad.cgi?id=cdwmx
------------------------------------------------------------------[PR]--
<GMO GROUP> Global Media Online www.gmo.jp