From 50ef220b5a60260dd44d994a99f2baee9f8582f4 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Aug 2006 05:44:43 +0000 Subject: [PATCH] * configure.in, common.mk: AIX link issue. a patch from Yutaka Kanemoto . [ruby-dev:29190] * ext/socket/socket.c: AIX socket support. [ruby-dev:29190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 +++++++++- common.mk | 10 ++++++---- configure.in | 30 +++++++++++++++++------------- ext/socket/socket.c | 6 ++++++ 4 files changed, 38 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b813f399b..06b4001dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ +Mon Aug 7 14:37:48 2006 Yukihiro Matsumoto + + * configure.in, common.mk: AIX link issue. a patch from Yutaka + Kanemoto . [ruby-dev:29190] + + * ext/socket/socket.c: AIX socket support. [ruby-dev:29190] + Mon Aug 7 12:05:28 2006 Yukihiro Matsumoto - * dln.c, eval.c, gc.c, ruby.h: shut up AIX alloca warning. + * dln.c, eval.c, gc.c, ruby.h: shut up AIX alloca warning. + a patch from Yutaka Kanemoto . [ruby-dev:29191] Sun Aug 6 20:34:24 2006 Tadayoshi Funaba diff --git a/common.mk b/common.mk index b191c2e2b5..2c4602dd55 100644 --- a/common.mk +++ b/common.mk @@ -75,16 +75,16 @@ miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(D $(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP) -$(LIBRUBY_A): $(OBJS) $(DMYEXT) +$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE) -$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE) +$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) @$(RM) $@ $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS) -ruby.imp: $(LIBRUBY_A) - @$(NM) -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@ +ruby.imp: $(OBJS) + @$(NM) -Pgp $(OBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@ install: install-nodoc $(RDOCTARGET) install-all: install-nodoc install-doc @@ -121,6 +121,8 @@ do-install-doc: $(PROGRAM) pre-install: pre-install-local pre-install-ext pre-install-local:: PHONY + $(RM) $(prefix)/lib/$(LIBRUBY) + $(RM) -r $(prefix)/lib/ruby/$(MAJOR).$(MINOR)/$(arch) pre-install-ext:: PHONY pre-install-doc:: PHONY diff --git a/configure.in b/configure.in index 02c33e2c81..0feaa29ab8 100644 --- a/configure.in +++ b/configure.in @@ -973,16 +973,20 @@ if test "$with_dln_a_out" != yes; then : ${LDFLAGS=""} : ${LIBPATHENV=DYLD_LIBRARY_PATH} rb_cv_dlopen=yes ;; - aix*) : ${LDSHARED='/usr/ccs/bin/ld'} - XLDFLAGS="$XLDFLAGS -Wl,-bE:ruby.imp" - DLDFLAGS='-brtl -eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 '"$DLDFLAGS" - LDFLAGS="-brtl $LDFLAGS" - : ${ARCHFILE="ruby.imp"} - TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS) $(CFLAGS)' - TRY_LINK="$TRY_LINK"' $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)' - : ${LIBPATHENV=SHLIB_PATH} - rb_cv_dlopen=yes ;; - + aix*) if test "$GCC" = yes; then + : ${LDSHARED='gcc -shared'} + DLDFLAGS='-Wl,-G -eInit_$(TARGET)' + LDFLAGS='-Wl,-brtl -Wl,-bE:ruby.imp' + else + : ${LDSHARED='/usr/ccs/bin/ld'} + DLDFLAGS='-G -eInit_$(TARGET)' + LDFLAGS="-brtl -bE:ruby.imp" + fi + : ${ARCHFILE="ruby.imp"} + TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)' + TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)' + : ${LIBPATHENV=SHLIB_PATH} + rb_cv_dlopen=yes ;; human*) : ${DLDFLAGS=''} : ${LDSHARED=''} : ${LDFLAGS=''} @@ -1299,12 +1303,12 @@ if test "$enable_shared" = 'yes'; then aix*) if test "$GCC" = yes; then LIBRUBY_LDSHARED='$(CC) -shared' - LIBRUBY_DLDFLAGS='-Wl,-bE:ruby.imp' + LIBRUBY_DLDFLAGS='-Wl,-G -Wl,-bE:ruby.imp -Wl,-bnoentry' else LIBRUBY_LDSHARED='/usr/ccs/bin/ld' - LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry' + LIBRUBY_DLDFLAGS='-G -bE:ruby.imp -bnoentry' fi - LIBRUBYARG_SHARED='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so' + LIBRUBYARG_SHARED='-L${libdir} -lruby' SOLIBS='-lm -lc' ;; beos*) diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 113b60c0cd..2badf1b27c 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -185,6 +185,12 @@ ruby_getaddrinfo__aix(char *nodename, char *servname, } #undef getaddrinfo #define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__aix((node),(serv),(hints),(res)) +#ifndef CMSG_SPACE +# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len)) +#endif +#ifndef CMSG_LEN +# define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#endif #endif #ifdef __BEOS__