libtool-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Libtool branch, master, updated. v2.4-5-g13608ea


From: Peter Rosin
Subject: [SCM] GNU Libtool branch, master, updated. v2.4-5-g13608ea
Date: Mon, 27 Sep 2010 11:29:53 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  13608ea10fe98a7418d1392526cde4c1442f2511 (commit)
      from  92651fdcb86f24f893ca25c3fd5fe60ad4c1d0c6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 13608ea10fe98a7418d1392526cde4c1442f2511
Author: Peter Rosin <address@hidden>
Date:   Mon Sep 27 10:06:44 2010 +0200

    tests: clean up importing and exporting on w32.
    
    Makes the touched tests pass for MSVC when DLLs are built.
    
    * tests/demo/Makefile.am, tests/pdemo/Makefile.am: Define
    BUILDING_LIBHELLO when building libhello.la.
    * tests/demo/foo.h, tests/pdemo/foo.h (nothing) <MSVC>: Export
    variable when building the libhello dll and import when using
    libhello.  For GCC and non-w32, and when building a static
    libhello, leave as an ordinary extern.
    * tests/pdemo/foo.h [Cygwin]: Remove unneeded and "dead" export
    and import logic (LIBFOO_DLL is always undefined).
    * tests/pdemo/longer_file_name_foo.c,
    tests/pdemo/longer_file_name_foo2.c (_LIBFOO_COMPILATION_): Not
    useful before, even less so now.  Removed.
    * tests/depdemo/l1/Makefile.am: Define BUILDING_LIBL1 when
    building libl1.la.
    * tests/depdemo/l2/Makefile.am: Define BUILDING_LIBL2 when
    building libl2.la.
    * tests/depdemo/l3/Makefile.am: Define BUILDING_LIBL3 when
    building libl3.la.
    * tests/depdemo/l4/Makefile.am: Define BUILDING_LIBL4 when
    building libl4.la.
    * tests/depdemo/l1/l1.h, tests/depdemo/l2/l2.h,
    tests/depdemo/l3/l3.h, tests/depdemo/l4/l4.h <MSVC>: Export
    variables when building the associated library dll and import
    when using the library.  For GCC and non-w32, and when building
    static libraries, leave as an ordinary extern.
    
    Signed-off-by: Peter Rosin <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                           |   29 +++++++++++++++++++++++++++++
 tests/demo/Makefile.am              |    3 ++-
 tests/demo/foo.h                    |   15 ++++++++++++++-
 tests/depdemo/l1/Makefile.am        |    4 ++--
 tests/depdemo/l1/l1.h               |   17 +++++++++++++++--
 tests/depdemo/l2/Makefile.am        |    4 ++--
 tests/depdemo/l2/l2.h               |   17 +++++++++++++++--
 tests/depdemo/l3/Makefile.am        |    4 ++--
 tests/depdemo/l3/l3.h               |   17 +++++++++++++++--
 tests/depdemo/l4/Makefile.am        |    4 ++--
 tests/depdemo/l4/l4.h               |   17 +++++++++++++++--
 tests/pdemo/Makefile.am             |    3 ++-
 tests/pdemo/foo.h                   |   27 +++++++++++----------------
 tests/pdemo/longer_file_name_foo.c  |    4 +---
 tests/pdemo/longer_file_name_foo2.c |    4 +---
 15 files changed, 128 insertions(+), 41 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a5e4940..a486ac3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2010-09-27  Peter Rosin  <address@hidden>
+
+       tests: clean up importing and exporting on w32.
+       Makes the touched tests pass for MSVC when DLLs are built.
+       * tests/demo/Makefile.am, tests/pdemo/Makefile.am: Define
+       BUILDING_LIBHELLO when building libhello.la.
+       * tests/demo/foo.h, tests/pdemo/foo.h (nothing) <MSVC>: Export
+       variable when building the libhello dll and import when using
+       libhello.  For GCC and non-w32, and when building a static
+       libhello, leave as an ordinary extern.
+       * tests/pdemo/foo.h [Cygwin]: Remove unneeded and "dead" export
+       and import logic (LIBFOO_DLL is always undefined).
+       * tests/pdemo/longer_file_name_foo.c,
+       tests/pdemo/longer_file_name_foo2.c (_LIBFOO_COMPILATION_): Not
+       useful before, even less so now.  Removed.
+       * tests/depdemo/l1/Makefile.am: Define BUILDING_LIBL1 when
+       building libl1.la.
+       * tests/depdemo/l2/Makefile.am: Define BUILDING_LIBL2 when
+       building libl2.la.
+       * tests/depdemo/l3/Makefile.am: Define BUILDING_LIBL3 when
+       building libl3.la.
+       * tests/depdemo/l4/Makefile.am: Define BUILDING_LIBL4 when
+       building libl4.la.
+       * tests/depdemo/l1/l1.h, tests/depdemo/l2/l2.h,
+       tests/depdemo/l3/l3.h, tests/depdemo/l4/l4.h <MSVC>: Export
+       variables when building the associated library dll and import
+       when using the library.  For GCC and non-w32, and when building
+       static libraries, leave as an ordinary extern.
+
 2010-09-26  Ralf Wildenhues  <address@hidden>
 
        docs: do not refer to Libtool version with dlopen functionality.
diff --git a/tests/demo/Makefile.am b/tests/demo/Makefile.am
index 2aa2c0b..a3c6144 100644
--- a/tests/demo/Makefile.am
+++ b/tests/demo/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003, 2004, 2005 Free Software Foundation
+##   Copyright (C) 2003, 2004, 2005, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -31,6 +31,7 @@ lib_LTLIBRARIES = libhello.la
 libhello_la_SOURCES = hello.c foo.c
 libhello_la_LIBADD = $(LIBM)
 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
+libhello_la_AM_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_LIBHELLO
 
 include_HEADERS = foo.h
 
diff --git a/tests/demo/foo.h b/tests/demo/foo.h
index 167096a..e8a2c87 100644
--- a/tests/demo/foo.h
+++ b/tests/demo/foo.h
@@ -37,6 +37,19 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #  endif
 #endif
 
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBHELLO
+#  ifdef DLL_EXPORT
+#   define LIBHELLO_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBHELLO_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBHELLO_SCOPE
+# define LIBHELLO_SCOPE extern
+#endif
+
 /* __BEGIN_DECLS should be used at the beginning of your declarations,
    so that C++ compilers don't mangle their names.  Use __END_DECLS at
    the end of C declarations. */
@@ -83,7 +96,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 __BEGIN_DECLS
 int foo LT_PARAMS((void));
 int hello LT_PARAMS((void));
-extern int nothing;
+LIBHELLO_SCOPE int nothing;
 __END_DECLS
 
 #endif /* !_FOO_H_ */
diff --git a/tests/depdemo/l1/Makefile.am b/tests/depdemo/l1/Makefile.am
index 7cca5c1..b2e7cb8 100644
--- a/tests/depdemo/l1/Makefile.am
+++ b/tests/depdemo/l1/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003 Free Software Foundation
+##   Copyright (C) 2003, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -26,7 +26,7 @@ top_distdir = ../..
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL1
 
 lib_LTLIBRARIES = libl1.la
 libl1_la_SOURCES = l1.c l1.h
diff --git a/tests/depdemo/l1/l1.h b/tests/depdemo/l1/l1.h
index 8e773ca..d357d80 100644
--- a/tests/depdemo/l1/l1.h
+++ b/tests/depdemo/l1/l1.h
@@ -1,7 +1,7 @@
 /* l1.h -- interface to a trivial library
 
    Copyright (C) 1998-1999 Thomas Tanner
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010 Free Software Foundation, Inc.
    Written by Thomas Tanner, 1998
 
    This file is part of GNU Libtool.
@@ -29,8 +29,21 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 #include "sysdep.h"
 
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBL1
+#  ifdef DLL_EXPORT
+#   define LIBL1_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBL1_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBL1_SCOPE
+# define LIBL1_SCOPE extern
+#endif
+
 __BEGIN_DECLS
-extern int var_l1;
+LIBL1_SCOPE int var_l1;
 int    func_l1 __P((int));
 __END_DECLS
 
diff --git a/tests/depdemo/l2/Makefile.am b/tests/depdemo/l2/Makefile.am
index ddd57e2..2cb86c5 100644
--- a/tests/depdemo/l2/Makefile.am
+++ b/tests/depdemo/l2/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003 Free Software Foundation
+##   Copyright (C) 2003, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -26,7 +26,7 @@ top_distdir = ../..
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL2
 
 lib_LTLIBRARIES = libl2.la
 libl2_la_SOURCES = l2.c l2.h
diff --git a/tests/depdemo/l2/l2.h b/tests/depdemo/l2/l2.h
index 728b1df..0f6b3b9 100644
--- a/tests/depdemo/l2/l2.h
+++ b/tests/depdemo/l2/l2.h
@@ -1,7 +1,7 @@
 /* l2.h -- interface to a trivial library
 
    Copyright (C) 1998-1999 Thomas Tanner
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010 Free Software Foundation, Inc.
    Written by Thomas Tanner, 1998
 
    This file is part of GNU Libtool.
@@ -29,8 +29,21 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 #include "sysdep.h"
 
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBL2
+#  ifdef DLL_EXPORT
+#   define LIBL2_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBL2_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBL2_SCOPE
+# define LIBL2_SCOPE extern
+#endif
+
 __BEGIN_DECLS
-extern int var_l2;
+LIBL2_SCOPE int var_l2;
 int    func_l2 __P((int));
 __END_DECLS
 
diff --git a/tests/depdemo/l3/Makefile.am b/tests/depdemo/l3/Makefile.am
index 2dc0805..341932f 100644
--- a/tests/depdemo/l3/Makefile.am
+++ b/tests/depdemo/l3/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003 Free Software Foundation
+##   Copyright (C) 2003, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -27,7 +27,7 @@ extradir    = $(libdir)/extra
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL3
 
 lib_LTLIBRARIES = libl3.la
 libl3_la_SOURCES = l3.c l3.h
diff --git a/tests/depdemo/l3/l3.h b/tests/depdemo/l3/l3.h
index 6f0b446..60fcbd5 100644
--- a/tests/depdemo/l3/l3.h
+++ b/tests/depdemo/l3/l3.h
@@ -1,7 +1,7 @@
 /* l3.h -- interface to a trivial library
 
    Copyright (C) 1998-1999 Thomas Tanner
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010 Free Software Foundation, Inc.
    Written by Thomas Tanner, 1998
 
    This file is part of GNU Libtool.
@@ -29,8 +29,21 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 #include "sysdep.h"
 
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBL3
+#  ifdef DLL_EXPORT
+#   define LIBL3_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBL3_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBL3_SCOPE
+# define LIBL3_SCOPE extern
+#endif
+
 __BEGIN_DECLS
-extern int var_l3;
+LIBL3_SCOPE int var_l3;
 int    func_l3 __P((int));
 __END_DECLS
 
diff --git a/tests/depdemo/l4/Makefile.am b/tests/depdemo/l4/Makefile.am
index d274b6d..fa0d4b2 100644
--- a/tests/depdemo/l4/Makefile.am
+++ b/tests/depdemo/l4/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003 Free Software Foundation
+##   Copyright (C) 2003, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -26,7 +26,7 @@ top_distdir = ../..
 
 AUTOMAKE_OPTIONS = no-dependencies foreign
 
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -DBUILDING_LIBL4
 
 lib_LTLIBRARIES = libl4.la
 libl4_la_SOURCES = l4.c l4.h
diff --git a/tests/depdemo/l4/l4.h b/tests/depdemo/l4/l4.h
index bdf21d0..703743f 100644
--- a/tests/depdemo/l4/l4.h
+++ b/tests/depdemo/l4/l4.h
@@ -1,7 +1,7 @@
 /* l4.h -- interface to a trivial library
 
    Copyright (C) 1998-1999 Thomas Tanner
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010 Free Software Foundation, Inc.
    Written by Thomas Tanner, 1998
 
    This file is part of GNU Libtool.
@@ -29,8 +29,21 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 #include "sysdep.h"
 
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBL4
+#  ifdef DLL_EXPORT
+#   define LIBL4_SCOPE extern __declspec (dllexport)
+#  endif
+# else
+#  define LIBL4_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBL4_SCOPE
+# define LIBL4_SCOPE extern
+#endif
+
 __BEGIN_DECLS
-extern int var_l4;
+LIBL4_SCOPE int var_l4;
 int    func_l4 __P((int));
 __END_DECLS
 
diff --git a/tests/pdemo/Makefile.am b/tests/pdemo/Makefile.am
index 0357e47..91fe1e2 100644
--- a/tests/pdemo/Makefile.am
+++ b/tests/pdemo/Makefile.am
@@ -1,6 +1,6 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003, 2004, 2005 Free Software Foundation
+##   Copyright (C) 2003, 2004, 2005, 2010 Free Software Foundation
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -31,6 +31,7 @@ lib_LTLIBRARIES = libhello.la
 libhello_la_SOURCES = longer_file_name_hello.c longer_file_name_foo.c 
longer_file_name_foo2.c
 libhello_la_LIBADD = $(LIBM)
 libhello_la_LDFLAGS = -no-undefined -version-info 3:12:1
+libhello_la_AM_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_LIBHELLO
 
 include_HEADERS = foo.h
 
diff --git a/tests/pdemo/foo.h b/tests/pdemo/foo.h
index a2b2a4a..d08303b 100644
--- a/tests/pdemo/foo.h
+++ b/tests/pdemo/foo.h
@@ -73,22 +73,17 @@ or obtained by writing to the Free Software Foundation, 
Inc.,
 # define LT_DLSYM_CONST const
 #endif
 
-#ifdef __CYGWIN32__
-#  ifdef LIBFOO_DLL
-     /* need some (as yet non-existant) automake magic to tell
-      * the object whether the libfoo it will be linked with is
-      * a dll or not, ie whether LIBFOO_DLL is defined or not.
-      */
-#    ifdef _LIBFOO_COMPILATION_
-#      define EXTERN __declspec(dllexport)
-#    else
-#      define EXTERN extern __declspec(dllimport)
-#    endif
-#  else
-#    define EXTERN extern
+#if (defined _WIN32 || defined _WIN32_WCE) && !defined __GNUC__
+# ifdef BUILDING_LIBHELLO
+#  ifdef DLL_EXPORT
+#   define LIBHELLO_SCOPE extern __declspec (dllexport)
 #  endif
-#else
-#  define EXTERN extern
+# else
+#  define LIBHELLO_SCOPE extern __declspec (dllimport)
+# endif
+#endif
+#ifndef LIBHELLO_SCOPE
+# define LIBHELLO_SCOPE extern
 #endif
 
 /* Silly constants that the functions return. */
@@ -101,7 +96,7 @@ __BEGIN_DECLS
 int foo LT_PARAMS((void));
 int foo2 LT_PARAMS((void));
 int hello LT_PARAMS((void));
-EXTERN int nothing;
+LIBHELLO_SCOPE int nothing;
 __END_DECLS
 
 #endif /* !_FOO_H_ */
diff --git a/tests/pdemo/longer_file_name_foo.c 
b/tests/pdemo/longer_file_name_foo.c
index 5b10c61..9d92304 100644
--- a/tests/pdemo/longer_file_name_foo.c
+++ b/tests/pdemo/longer_file_name_foo.c
@@ -1,6 +1,6 @@
 /* foo.c -- trivial test function for libfoo
 
-   Copyright (C) 1996-1999, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-1999, 2007, 2010 Free Software Foundation, Inc.
    Written by Gordon Matzigkeit, 1996
 
    This file is part of GNU Libtool.
@@ -22,9 +22,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
 
-#define _LIBFOO_COMPILATION_
 #include "foo.h"
-#undef _LIBFOO_COMPILATION_
 
 #include <stdio.h>
 #include <math.h>
diff --git a/tests/pdemo/longer_file_name_foo2.c 
b/tests/pdemo/longer_file_name_foo2.c
index c7359d0..65d3bba 100644
--- a/tests/pdemo/longer_file_name_foo2.c
+++ b/tests/pdemo/longer_file_name_foo2.c
@@ -1,6 +1,6 @@
 /* foo.c -- trivial test function for libfoo
 
-   Copyright (C) 1996-1999, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-1999, 2007, 2010 Free Software Foundation, Inc.
    Written by Gordon Matzigkeit, 1996
 
    This file is part of GNU Libtool.
@@ -22,9 +22,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
 
-#define _LIBFOO_COMPILATION_
 #include "foo.h"
-#undef _LIBFOO_COMPILATION_
 
 #include <stdio.h>
 #include <math.h>


hooks/post-receive
-- 
GNU Libtool



reply via email to

[Prev in Thread] Current Thread [Next in Thread]