summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-30 11:27:34 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-30 11:27:34 +0000
commitc3f1c5280b5c71f89a7260dd6b00bb39129c5663 (patch)
tree77bce8587a3e27fb9ed80324d284323d52e91bdb
parent9a8cc1f4abdeacb4adf1a7b59fe2bd6f4ea0ad70 (diff)
* configure.in: keep ARCH_FLAG separate. export ARCH_FLAG.
[ruby-core:01819] * Makefile.in: add ARCH_FLAG to CFLAGS. * Makefile.in: add @CPPFLAGS@ to CPPFLAGS. * lib/mkmf.rb (link_command, cc_command): use ARCH_FLAG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--configure.in15
-rw-r--r--lib/mkmf.rb6
3 files changed, 21 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ce251ba54..7cba38d7c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Sun Nov 30 20:18:07 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * configure.in: keep ARCH_FLAG separate. export ARCH_FLAG.
+ [ruby-core:01819]
+
+ * Makefile.in: add ARCH_FLAG to CFLAGS.
+
+ * Makefile.in: add @CPPFLAGS@ to CPPFLAGS.
+
+ * lib/mkmf.rb (link_command, cc_command): use ARCH_FLAG.
+
Sun Nov 30 18:22:48 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: do not override CCDLDFLAGS, LDFLAGS, XLDFLAGS,
diff --git a/configure.in b/configure.in
index c5b3983ecb..108cea9543 100644
--- a/configure.in
+++ b/configure.in
@@ -86,7 +86,7 @@ AC_ARG_ENABLE(fat-binary,
is disabled or omitted entirely, then the package
will be built only for the target platform],
[fat_binary=$enableval], [fat_binary=no])
- if test "$fat_binary" != no; then
+if test "$fat_binary" != no; then
AC_MSG_CHECKING([target architectures])
@@ -125,7 +125,7 @@ AC_ARG_ENABLE(fat-binary,
ARCH_FLAG="$ARCH_FLAG -arch $archs"
done
AC_DEFINE(NEXT_FAT_BINARY)
-fi
+fi
case $target_cpu in
i?86) frame_address=yes;;
@@ -793,6 +793,7 @@ esac
LIBEXT=a
AC_SUBST(DLDFLAGS)dnl
+AC_SUBST(ARCH_FLAG)dnl
AC_SUBST(STATIC)dnl
AC_SUBST(CCDLFLAGS)dnl
@@ -894,19 +895,15 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes ;;
nextstep*) : ${LDSHARED='cc -r -nostdlib'}
LDFLAGS="$LDFLAGS -u libsys_s"
- DLDFLAGS="$DLDFLAGS $ARCH_FLAG"
rb_cv_dlopen=yes ;;
openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
: ${LDFLAGS=""}
- DLDFLAGS="$DLDFLAGS $ARCH_FLAG"
rb_cv_dlopen=yes ;;
rhapsody*) : $LDSHARED='cc -dynamic -bundle -undefined suppress'}
: ${LDFLAGS=""}
- DLDFLAGS="$DLDFLAGS $ARCH_FLAG"
rb_cv_dlopen=yes ;;
darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
: ${LDFLAGS=""}
- DLDFLAGS="$DLDFLAGS $ARCH_FLAG"
rb_cv_dlopen=yes ;;
aix*) : ${LDSHARED='/usr/ccs/bin/ld'}
XLDFLAGS="$XLDFLAGS -Wl,-bE:ruby.imp"
@@ -1103,9 +1100,9 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
-if test "$fat_binary" != no ; then
- CFLAGS="$CFLAGS $ARCH_FLAG"
-fi
+#if test "$fat_binary" != no ; then
+# CFLAGS="$CFLAGS $ARCH_FLAG"
+#fi
if test x"$cross_compiling" = xyes; then
test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 4628cb51c0..e3c65668d4 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -215,6 +215,7 @@ def link_command(ldflags, opt="", libpath=$LIBPATH)
'INCFLAGS' => $INCFLAGS,
'CPPFLAGS' => $CPPFLAGS,
'CFLAGS' => "#$CFLAGS",
+ 'ARCH_FLAG' => "#$ARCH_FLAG",
'LDFLAGS' => "#$LDFLAGS #{ldflags}",
'LIBPATH' => libpathflag(libpath),
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
@@ -223,7 +224,7 @@ end
def cc_command(opt="")
"$(CC) -c #$INCFLAGS -I#{$hdrdir} " \
- "#$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C}"
+ "#$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} #{CONFTEST_C}"
end
def cpp_command(outfile, opt="")
@@ -720,7 +721,7 @@ LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
-CFLAGS = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS
+CFLAGS = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS #$ARCH_FLAG
CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS}
CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
DLDFLAGS = #$LDFLAGS #{CONFIG['DLDFLAGS']} #$DLDFLAGS
@@ -943,6 +944,7 @@ def init_mkmf(config = CONFIG)
$enable_shared = config['ENABLE_SHARED'] == 'yes'
$defs = []
$CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
+ $ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
$LDFLAGS = (with_config("ldflags") || "").dup
$INCFLAGS = "-I#{$topdir}"