Hello Charles, all,

I suggest this patch to fix the export test on MinGW.  It did not fail
on Cygwin due to auto-import, but on MinGW it did for the data objects.
WDYT?  I guess stresstest.at needs a similar fix, but there the same
code is currently used to link against a shared and a static version of
the library, so that would need to be fixed as well.

The only thing that's then still worrying me is that on Cygwin, the
mdemo and mdemo_static programs sometimes throw segmentation faults
on my system.  Not all the time though.

And then on both Cygwin and MinGW test 16 (Link order of deplibs) still
fails.  I guess I need to weaken it even further...


2007-02-25  Ralf Wildenhues  <[EMAIL PROTECTED]>

        * tests/export.at: For data object imported from shared library,
        define appropriate macros to expand __declspec(dllimport) on
        w32.  Fixes test failure on MinGW.

Index: tests/export.at
RCS file: /sources/libtool/libtool/tests/export.at,v
retrieving revision 1.2
diff -u -r1.2 export.at
--- tests/export.at     12 Feb 2007 20:50:36 -0000      1.2
+++ tests/export.at     25 Feb 2007 19:04:43 -0000
@@ -89,18 +89,26 @@
+#if defined(LIBA_DLL_IMPORT)
+#  if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
+#    define LIBA_SCOPE extern __declspec(dllimport)
+#  endif
+#if !defined(LIBA_SCOPE)
+#  define LIBA_SCOPE extern
 #ifdef __cplusplus
 extern "C" {
 extern int v1;
 extern int v3, v4;
-extern const int v5, v6;
+LIBA_SCOPE const int v5, v6;
 extern const char* v7;
 extern const char v8[];
 extern int v9(void);
 extern int (*v10) (void);
 extern int (*v11) (void);
-extern int (*const v12) (void);
+LIBA_SCOPE int (*const v12) (void);
 #ifdef __cplusplus
@@ -134,7 +142,7 @@
 AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c 
-AT_CHECK([$CC $CPPFLAGS $CFLAGS -c main.c],[0],[ignore],[ignore])
 AT_CHECK([$CC $CPPFLAGS $CFLAGS -c broken.c],[0],[ignore],[ignore])
 for exportsyms in '' '-export-symbols-regex "v.*"' '-export-symbols asyms'

Reply via email to