Ruby 1.8.3 Build error on AIX 5.2 with gcc 3.4.4

P

Philippe Lucas

Hello,

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)

-B) Compiler errors :
-1) ext/readline.c line 13 : <unistd.h> 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 <unistd.h>

-C) Linker errors :
-1) Configuration program set LDFLAGS = ${CFLAGS} -brtl. This is an
error. In gcc the correct parameter is -Wl,-brtl.

-D) Warning messages :
-1) On my system, configure:3866 produces the _ALL_SOURCE macro which is
defined in <standards.h>:144 from <error.h>:37. So i can suppress it in the
config.h but it is a uggly patch !!

Philippe Lucas
 
N

nobu.nokada

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 : <unistd.h> 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 <unistd.h>

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 <standards.h>:144 from <error.h>: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)'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top