From: nobu.nokada@... Date: 2005-06-03T08:54:41+09:00 Subject: Re: Ruby 1.8.3 Build error on AIX 5.2 with gcc 3.4.4 Hi, At Thu, 2 Jun 2005 02:05:12 +0900, Philippe Lucas wrote in [ruby-talk:144239]: > I've found errors on AIX 5.2 with gcc 3.4.4 : > > -A) Configuration errors : > -1) Bind error in ext/bigdecimal because the file ruby.imp doesn't > exist. In the main Makefile, $(RBCONFIG) target needs $(ARCHFILE). You can > have the line : > $(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP) $(ARCHFILE) Sorry, I removed $(ARCHFILE) from $(PREP) but forgot to let others depend on it. > -B) Compiler errors : > -1) ext/readline.c line 13 : includes some 64 bits features > if the configuration program set the macro __LARGE_FILES. So, if you don't > use 64 bits file acces you have to add "#undef __LARGE_FILES" in line 13 > just before #include Can't readline compile with 64 bits file access? > -C) Linker errors : > -1) Configuration program set LDFLAGS = ${CFLAGS} -brtl. This is an > error. In gcc the correct parameter is -Wl,-brtl. I see. > -D) Warning messages : > -1) On my system, configure:3866 produces the _ALL_SOURCE macro which is > defined in :144 from :37. So i can suppress it in the > config.h but it is a uggly patch !! autoconf seems to add it automatically on AIX. I'm not sure why it conflicts. How does standards.h define it? Does this patch work? Index: common.mk =================================================================== RCS file: /cvs/ruby/src/ruby/common.mk,v retrieving revision 1.15 diff -U2 -p -r1.15 common.mk --- common.mk 20 Apr 2005 14:22:57 -0000 1.15 +++ common.mk 2 Jun 2005 23:48:32 -0000 @@ -63,5 +63,5 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extstatic $(EXTSTATIC) -- -all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) +all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) $(ARCHFILE) @$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) prog: $(PROGRAM) $(WPROGRAM) Index: configure.in =================================================================== RCS file: /cvs/ruby/src/ruby/configure.in,v retrieving revision 1.277 diff -U2 -p -r1.277 configure.in --- configure.in 15 May 2005 09:56:49 -0000 1.277 +++ configure.in 2 Jun 2005 23:38:46 -0000 @@ -227,4 +227,22 @@ AC_CHECK_SIZEOF(double, 8) AC_CHECK_SIZEOF(time_t, 0) +AC_DEFUN(RUBY_TRY_CFLAGS, +[{ +cflags_ok= +if test "${CFLAGS+set}"; then + save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS [$1]" +else + unset save_CFLAGS; CFLAGS="[$1]" +fi +AC_TRY_COMPILE([], [], [cflags_ok=yes], [cflags_ok=no]) +if test "${save_CFLAGS+set}"; then + CFLAGS="$save_CFLAGS" + unset save_CFLAGS +else + unset CFLAGS +fi +test $cflags_ok = yes +}]) + for id in pid_t gid_t uid_t; do AC_CHECK_TYPE($id, [typ=$id], [typ=int]) @@ -936,6 +954,11 @@ if test "$with_dln_a_out" != yes; then 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" + DLDFLAGS='-eInit_$(TARGET) -bI:$(topdir)/ruby.imp -bM:SRE -T512 -H512 '"$DLDFLAGS" + flag=-brtl + test "$GCC" = yes && flag=-Wl,$flag + if RUBY_TRY_CFLAGS(-brtl); then + DLDFLAGS="-brtl $DLDFLAGS" + LDFLAGS="-brtl $LDFLAGS" + fi : ${ARCHFILE="ruby.imp"} TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS) $(CFLAGS)' -- Nobu Nakada