Skip to content

Commit

Permalink
* configure.in (RUBY_EXTERN): macro to export symbols in shared
Browse files Browse the repository at this point in the history
  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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Oct 25, 2005
1 parent 8acd2da commit af83254
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -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 15:32:00 2005 Yukihiro Matsumoto <matz@ruby-lang.org>

* lib/rational.rb: applied documentation patch from Gavin Sinclair
Expand Down
1 change: 1 addition & 0 deletions bcc32/Makefile.sub
Expand Up @@ -222,6 +222,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)bcc32/Makefile.sub
\#define TOKEN_PASTE(x,y) x\#\#y
\#define HAVE_STDARG_PROTOTYPES 1
\#define NORETURN(x) x
\#define RUBY_EXTERN extern __declspec(dllimport)
\#define HAVE_DECL_SYS_NERR 1
\#define HAVE_LIMITS_H 1
\#define HAVE_FCNTL_H 1
Expand Down
12 changes: 11 additions & 1 deletion configure.in
Expand Up @@ -283,6 +283,17 @@ NORETURN(void exit(int x));],
done])
AC_DEFINE_UNQUOTED([NORETURN(x)], $rb_cv_noreturn)

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
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
#include <errno.h>])
Expand Down Expand Up @@ -1346,7 +1357,6 @@ case "$target_os" in
COMMON_HEADERS="windows.h winsock.h"
;;
esac
XCFLAGS="$XCFLAGS"
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
LIBRUBY_ALIASES=''
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
Expand Down
5 changes: 1 addition & 4 deletions defines.h
Expand Up @@ -191,11 +191,8 @@ void xfree _((void*));
#include <net/socket.h> /* intern.h needs fd_set definition */
#endif

#ifdef RUBY_EXPORT
#undef RUBY_EXTERN
#if defined _WIN32 && !defined __GNUC__
# ifndef RUBY_EXPORT
# define RUBY_EXTERN extern __declspec(dllimport)
# endif
#endif

#ifndef RUBY_EXTERN
Expand Down
1 change: 1 addition & 0 deletions ext/extmk.rb
Expand Up @@ -129,6 +129,7 @@ def extmake(target)
then
ok = false
init_mkmf
$defs << "-DRUBY_EXPORT" if $static
Logging::logfile 'mkmf.log'
rm_f makefile
if File.exist?($0 = "#{$srcdir}/makefile.rb")
Expand Down
1 change: 1 addition & 0 deletions win32/Makefile.sub
Expand Up @@ -207,6 +207,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
!if $(MSC_VER) > 1100
#define NORETURN(x) __declspec(noreturn) x
!endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1
#define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1
Expand Down
1 change: 1 addition & 0 deletions wince/Makefile.sub
Expand Up @@ -215,6 +215,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/wince/Makefile.sub
!if $(MSC_VER) > 1100
#define NORETURN(x) __declspec(noreturn) x
!endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
Expand Down

0 comments on commit af83254

Please sign in to comment.