* configure.in (RUBY_EXTERN): macro to export symbols in shared

library.  [ruby-core:05528]

* defines.h, {bcc32,win32,wince}/Makefile.sub (RUBY_EXTERN): moved to
  configuration pass.

* ext/extmk.rb (extmake): RUBY_EXTERN for static linked extensions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-10-25 17:00:03 +00:00
Родитель ed91275a98
Коммит 8a2612b335
7 изменённых файлов: 26 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,13 @@
Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_EXTERN): macro to export symbols in shared
library. [ruby-core:05528]
* defines.h, {bcc32,win32,wince}/Makefile.sub (RUBY_EXTERN): moved to
configuration pass.
* ext/extmk.rb (extmake): RUBY_EXTERN for static linked extensions.
Tue Oct 25 20:06:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> Tue Oct 25 20:06:59 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate * ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate

Просмотреть файл

@ -226,6 +226,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)bcc32/Makefile.sub
\#define TOKEN_PASTE(x,y) x\#\#y \#define TOKEN_PASTE(x,y) x\#\#y
\#define HAVE_STDARG_PROTOTYPES 1 \#define HAVE_STDARG_PROTOTYPES 1
\#define NORETURN(x) x \#define NORETURN(x) x
\#define RUBY_EXTERN extern __declspec(dllimport)
\#define HAVE_DECL_SYS_NERR 1 \#define HAVE_DECL_SYS_NERR 1
\#define HAVE_LIMITS_H 1 \#define HAVE_LIMITS_H 1
\#define HAVE_FCNTL_H 1 \#define HAVE_FCNTL_H 1

Просмотреть файл

@ -308,6 +308,17 @@ RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
RUBY_FUNC_ATTRIBUTE(stdcall) RUBY_FUNC_ATTRIBUTE(stdcall)
RUBY_FUNC_ATTRIBUTE(cdecl) RUBY_FUNC_ATTRIBUTE(cdecl)
AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
[rb_cv_ruby_extern=no
for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
AC_TRY_COMPILE(
[extern $mac void conftest(void);],
[rb_cv_ruby_extern="extern $mac"; break])
done])
test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
dnl Check whether we need to define sys_nerr locally dnl Check whether we need to define sys_nerr locally
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
#include <errno.h>]) #include <errno.h>])
@ -1375,7 +1386,6 @@ case "$target_os" in
COMMON_HEADERS="winsock2.h windows.h" COMMON_HEADERS="winsock2.h windows.h"
;; ;;
esac esac
XCFLAGS="$XCFLAGS"
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
LIBRUBY_ALIASES='' LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in

Просмотреть файл

@ -195,11 +195,8 @@ void xfree(void*);
#include <net/socket.h> /* intern.h needs fd_set definition */ #include <net/socket.h> /* intern.h needs fd_set definition */
#endif #endif
#ifdef RUBY_EXPORT
#undef RUBY_EXTERN #undef RUBY_EXTERN
#if defined _WIN32 && !defined __GNUC__
# ifndef RUBY_EXPORT
# define RUBY_EXTERN extern __declspec(dllimport)
# endif
#endif #endif
#ifndef RUBY_EXTERN #ifndef RUBY_EXTERN

Просмотреть файл

@ -129,6 +129,7 @@ def extmake(target)
then then
ok = false ok = false
init_mkmf init_mkmf
$defs << "-DRUBY_EXPORT" if $static
Logging::logfile 'mkmf.log' Logging::logfile 'mkmf.log'
rm_f makefile rm_f makefile
if File.exist?($0 = "#{$srcdir}/makefile.rb") if File.exist?($0 = "#{$srcdir}/makefile.rb")

Просмотреть файл

@ -228,6 +228,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
#define DEPRECATED(x) __declspec(deprecated) x #define DEPRECATED(x) __declspec(deprecated) x
#define NOINLINE(x) __declspec(noinline) x #define NOINLINE(x) __declspec(noinline) x
!endif !endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1 #define HAVE_DECL_SYS_NERR 1
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1

Просмотреть файл

@ -223,6 +223,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/wince/Makefile.sub
#define DEPRECATED(x) __declspec(deprecated) x #define DEPRECATED(x) __declspec(deprecated) x
#define NOINLINE(x) __declspec(noinline) x #define NOINLINE(x) __declspec(noinline) x
!endif !endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1 #define HAVE_DECL_SYS_NERR 1
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1 #define HAVE_SYS_UTIME_H 1