summaryrefslogtreecommitdiff
path: root/contrib/hpux-plugins.patch
blob: 4642845b055e9ddfae72e822d93958866d28b904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
diff -Naur cppunit-1.9.11/config/ac_dll.m4 cppunit-1.9.11.hp/config/ac_dll.m4
--- cppunit-1.9.11/config/ac_dll.m4	1969-12-31 16:00:00.000000000 -0800
+++ cppunit-1.9.11.hp/config/ac_dll.m4	2003-04-14 10:02:10.000000000 -0700
@@ -0,0 +1,47 @@
+
+# AC_LTDL_DLLIB
+# -------------
+AC_DEFUN([AC_LTDL_DLLIB],
+[LIBADD_DL=
+AC_SUBST(LIBADD_DL)
+
+AC_CHECK_FUNC([shl_load],
+      [AC_DEFINE([HAVE_SHL_LOAD], [1],
+		 [Define if you have the shl_load function.])],
+  [AC_CHECK_LIB([dld], [shl_load],
+	[AC_DEFINE([HAVE_SHL_LOAD], [1],
+		   [Define if you have the shl_load function.])
+	LIBADD_DL="$LIBADD_DL -ldld"],
+    [AC_CHECK_LIB([dl], [dlopen],
+	  [AC_DEFINE([HAVE_LIBDL], [1],
+		     [Define if you have the libdl library or equivalent.])
+	  LIBADD_DL="-ldl"],
+      [AC_TRY_LINK([#if HAVE_DLFCN_H
+#  include <dlfcn.h>
+#endif
+      ],
+	[dlopen(0, 0);],
+	    [AC_DEFINE([HAVE_LIBDL], [1],
+		       [Define if you have the libdl library or equivalent.])],
+	[AC_CHECK_LIB([svld], [dlopen],
+	      [AC_DEFINE([HAVE_LIBDL], [1],
+			 [Define if you have the libdl library or equivalent.])
+	      LIBADD_DL="-lsvld"],
+	  [AC_CHECK_LIB([dld], [dld_link],
+	        [AC_DEFINE([HAVE_DLD], [1],
+			   [Define if you have the GNU dld library.])
+	 	LIBADD_DL="$LIBADD_DL -ldld"
+          ])
+        ])
+      ])
+    ])
+  ])
+])
+
+if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
+ LIBS_SAVE="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ AC_CHECK_FUNCS(dlerror)
+ LIBS="$LIBS_SAVE"
+fi
+])# AC_LTDL_DLLIB
diff -Naur cppunit-1.9.11/configure.in cppunit-1.9.11.hp/configure.in
--- cppunit-1.9.11/configure.in	2002-09-05 00:40:04.000000000 -0700
+++ cppunit-1.9.11.hp/configure.in	2003-04-14 10:18:11.000000000 -0700
@@ -59,6 +59,9 @@
 
 AC_PROG_LIBTOOL
 
+# check for dlopen,dlsym... or shl_load, shl_findsym...
+AC_LTDL_DLLIB
+
 # check for doxygen
 BB_ENABLE_DOXYGEN
 
diff -Naur cppunit-1.9.11/examples/cppunittest/Makefile.am cppunit-1.9.11.hp/examples/cppunittest/Makefile.am
--- cppunit-1.9.11/examples/cppunittest/Makefile.am	2003-03-15 06:54:34.000000000 -0800
+++ cppunit-1.9.11.hp/examples/cppunittest/Makefile.am	2003-04-14 10:26:48.000000000 -0700
@@ -76,6 +76,6 @@
 cppunittestmain_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la 
 
-cppunittestmain_LDFLAGS = -ldl
+cppunittestmain_LDFLAGS = $(LIBADD_DL)
 
 
diff -Naur cppunit-1.9.11/examples/hierarchy/Makefile.am cppunit-1.9.11.hp/examples/hierarchy/Makefile.am
--- cppunit-1.9.11/examples/hierarchy/Makefile.am	2002-04-20 15:26:56.000000000 -0700
+++ cppunit-1.9.11.hp/examples/hierarchy/Makefile.am	2003-04-14 10:26:30.000000000 -0700
@@ -16,4 +16,4 @@
 hierarchy_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la 
 
-hierarchy_LDFLAGS = -ldl
+hierarchy_LDFLAGS = $(LIBADD_DL)
diff -Naur cppunit-1.9.11/examples/money/Makefile.am cppunit-1.9.11.hp/examples/money/Makefile.am
--- cppunit-1.9.11/examples/money/Makefile.am	2002-04-21 05:50:44.000000000 -0700
+++ cppunit-1.9.11.hp/examples/money/Makefile.am	2003-04-14 10:27:14.000000000 -0700
@@ -17,5 +17,5 @@
 MoneyApp_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la 
 
-MoneyApp_LDFLAGS = $(CPPUNIT_LIBS) -ldl
+MoneyApp_LDFLAGS = $(CPPUNIT_LIBS) $(LIBADD_DL)
 
diff -Naur cppunit-1.9.11/examples/simple/Makefile.am cppunit-1.9.11.hp/examples/simple/Makefile.am
--- cppunit-1.9.11/examples/simple/Makefile.am	2002-04-20 14:51:33.000000000 -0700
+++ cppunit-1.9.11.hp/examples/simple/Makefile.am	2003-04-14 10:27:05.000000000 -0700
@@ -9,4 +9,4 @@
 simple_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la 
 
-simple_LDFLAGS = -ldl
\ No newline at end of file
+simple_LDFLAGS = $(LIBADD_DL)
diff -Naur cppunit-1.9.11/include/cppunit/config/SelectDllLoader.h cppunit-1.9.11.hp/include/cppunit/config/SelectDllLoader.h
--- cppunit-1.9.11/include/cppunit/config/SelectDllLoader.h	2002-04-20 14:51:33.000000000 -0700
+++ cppunit-1.9.11.hp/include/cppunit/config/SelectDllLoader.h	2003-04-14 11:29:38.000000000 -0700
@@ -54,8 +54,12 @@
 #elif defined(__BEOS__)
 #define CPPUNIT_HAVE_BEOS_DLL_LOADER 1
 
+// Is Unix platform and have shl_load()
+#elif defined(CPPUNIT_HAVE_SHL_LOAD)
+#define CPPUNIT_HAVE_UNIX_SHL_LOADER 1
+
 // Is Unix platform and have include <dlfcn.h>
-#elif defined(CPPUNIT_HAVE_DLFCN_H)
+#elif defined(CPPUNIT_HAVE_LIBDL)
 #define CPPUNIT_HAVE_UNIX_DLL_LOADER 1
 
 // Otherwise, disable support for DllLoader
diff -Naur cppunit-1.9.11/include/cppunit/plugin/TestPlugIn.h cppunit-1.9.11.hp/include/cppunit/plugin/TestPlugIn.h
--- cppunit-1.9.11/include/cppunit/plugin/TestPlugIn.h	2002-08-29 12:27:07.000000000 -0700
+++ cppunit-1.9.11.hp/include/cppunit/plugin/TestPlugIn.h	2003-04-14 10:10:23.000000000 -0700
@@ -157,7 +157,7 @@
   typedef char __CppUnitPlugInImplementMainDummyTypeDef
 
 // Unix
-#elif defined(CPPUNIT_HAVE_UNIX_DLL_LOADER)
+#elif defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(HAVE_UNIX_SHL_LOADER)
 #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN()               \
   int main( int argc, char *argv[] )                  \
   {                                                   \
diff -Naur cppunit-1.9.11/include/cppunit/tools/Algorithm.h cppunit-1.9.11.hp/include/cppunit/tools/Algorithm.h
--- cppunit-1.9.11/include/cppunit/tools/Algorithm.h	2003-03-15 01:23:34.000000000 -0800
+++ cppunit-1.9.11.hp/include/cppunit/tools/Algorithm.h	2003-04-14 11:37:38.000000000 -0700
@@ -20,4 +20,4 @@
 CPPUNIT_NS_END
 
 
-#endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
\ No newline at end of file
+#endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
diff -Naur cppunit-1.9.11/Makefile.am cppunit-1.9.11.hp/Makefile.am
--- cppunit-1.9.11/Makefile.am	2002-08-30 13:05:14.000000000 -0700
+++ cppunit-1.9.11.hp/Makefile.am	2003-04-14 10:05:22.000000000 -0700
@@ -26,7 +26,8 @@
 	config/ac_cxx_namespaces.m4			\
 	config/ac_cxx_rtti.m4				\
 	config/ac_cxx_string_compare_string_first.m4	\
-	config/bb_enable_doxygen.m4
+	config/bb_enable_doxygen.m4			\
+	config/ac_dll.m4
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = cppunit.m4
diff -Naur cppunit-1.9.11/src/cppunit/BeOsDynamicLibraryManager.cpp cppunit-1.9.11.hp/src/cppunit/BeOsDynamicLibraryManager.cpp
--- cppunit-1.9.11/src/cppunit/BeOsDynamicLibraryManager.cpp	2002-07-11 22:59:57.000000000 -0700
+++ cppunit-1.9.11.hp/src/cppunit/BeOsDynamicLibraryManager.cpp	2003-04-14 11:36:45.000000000 -0700
@@ -46,4 +46,4 @@
 CPPUNIT_NS_END
 
 
-#endif // defined(CPPUNIT_HAVE_BEOS_DLL_LOADER)
\ No newline at end of file
+#endif // defined(CPPUNIT_HAVE_BEOS_DLL_LOADER)
diff -Naur cppunit-1.9.11/src/cppunit/Makefile.am cppunit-1.9.11.hp/src/cppunit/Makefile.am
--- cppunit-1.9.11/src/cppunit/Makefile.am	2002-08-28 15:20:52.000000000 -0700
+++ cppunit-1.9.11.hp/src/cppunit/Makefile.am	2003-04-14 15:28:34.000000000 -0700
@@ -54,6 +54,7 @@
   TextTestRunner.cpp \
   TypeInfoHelper.cpp \
   UnixDynamicLibraryManager.cpp \
+  ShlDynamicLibraryManager.cpp \
   XmlDocument.cpp \
   XmlElement.cpp \
   XmlOutputter.cpp \
diff -Naur cppunit-1.9.11/src/cppunit/ShlDynamicLibraryManager.cpp cppunit-1.9.11.hp/src/cppunit/ShlDynamicLibraryManager.cpp
--- cppunit-1.9.11/src/cppunit/ShlDynamicLibraryManager.cpp	1969-12-31 16:00:00.000000000 -0800
+++ cppunit-1.9.11.hp/src/cppunit/ShlDynamicLibraryManager.cpp	2003-04-14 10:07:33.000000000 -0700
@@ -0,0 +1,52 @@
+#include <cppunit/Portability.h>
+
+#if defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
+#include <cppunit/plugin/DynamicLibraryManager.h>
+
+#include <dl.h>
+#include <unistd.h>
+
+
+CPPUNIT_NS_BEGIN
+
+
+DynamicLibraryManager::LibraryHandle 
+DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
+{
+   return ::shl_load(libraryName.c_str(), BIND_IMMEDIATE, 0L);
+   //return ::dlopen( libraryName.c_str(), RTLD_NOW );   // RTLD_LAZY ?
+}
+
+
+void 
+DynamicLibraryManager::doReleaseLibrary()
+{
+  ::shl_unload( (shl_t)m_libraryHandle);
+  //::dlclose( m_libraryHandle);
+}
+
+
+DynamicLibraryManager::Symbol 
+DynamicLibraryManager::doFindSymbol( const std::string &symbol )
+{
+   DynamicLibraryManager::Symbol L_symaddr = 0;
+   if ( ::shl_findsym ( (shl_t*)(&m_libraryHandle), symbol.c_str(), TYPE_UNDEFINED, &L_symaddr ) == 0 ) {
+      return L_symaddr;
+   } else {
+      return 0;
+   }
+   //return ::dlsym ( m_libraryHandle, symbol.c_str() );
+}
+
+
+std::string 
+DynamicLibraryManager::getLastErrorDetail() const
+{
+  return "";
+}
+
+
+CPPUNIT_NS_END
+
+
+#endif // defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
diff -Naur cppunit-1.9.11/src/cppunit/TestDecorator.cpp cppunit-1.9.11.hp/src/cppunit/TestDecorator.cpp
--- cppunit-1.9.11/src/cppunit/TestDecorator.cpp	2002-08-03 08:47:52.000000000 -0700
+++ cppunit-1.9.11.hp/src/cppunit/TestDecorator.cpp	2003-04-14 11:36:25.000000000 -0700
@@ -50,4 +50,4 @@
 }
 
 
-CPPUNIT_NS_END
\ No newline at end of file
+CPPUNIT_NS_END
diff -Naur cppunit-1.9.11/src/cppunit/UnixDynamicLibraryManager.cpp cppunit-1.9.11.hp/src/cppunit/UnixDynamicLibraryManager.cpp
--- cppunit-1.9.11/src/cppunit/UnixDynamicLibraryManager.cpp	2002-07-11 22:59:58.000000000 -0700
+++ cppunit-1.9.11.hp/src/cppunit/UnixDynamicLibraryManager.cpp	2003-04-14 11:37:50.000000000 -0700
@@ -41,4 +41,4 @@
 CPPUNIT_NS_END
 
 
-#endif // defined(CPPUNIT_HAVE_UNIX_DLL_LOADER)
\ No newline at end of file
+#endif // defined(CPPUNIT_HAVE_UNIX_DLL_LOADER)
diff -Naur cppunit-1.9.11/src/cppunit/Win32DynamicLibraryManager.cpp cppunit-1.9.11.hp/src/cppunit/Win32DynamicLibraryManager.cpp
--- cppunit-1.9.11/src/cppunit/Win32DynamicLibraryManager.cpp	2002-07-11 22:59:58.000000000 -0700
+++ cppunit-1.9.11.hp/src/cppunit/Win32DynamicLibraryManager.cpp	2003-04-14 11:38:01.000000000 -0700
@@ -67,4 +67,4 @@
 CPPUNIT_NS_END
 
 
-#endif // defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)
\ No newline at end of file
+#endif // defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)
diff -Naur cppunit-1.9.11/src/DllPlugInTester/Makefile.am cppunit-1.9.11.hp/src/DllPlugInTester/Makefile.am
--- cppunit-1.9.11/src/DllPlugInTester/Makefile.am	2002-04-21 03:57:52.000000000 -0700
+++ cppunit-1.9.11.hp/src/DllPlugInTester/Makefile.am	2003-04-14 10:26:09.000000000 -0700
@@ -14,7 +14,7 @@
 DllPlugInTester_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la
 
-DllPlugInTester_LDFLAGS = -ldl
+DllPlugInTester_LDFLAGS = $(LIBADD_DL)
 
 DllPlugInTesterTest_SOURCES = DllPlugInTesterTest.cpp \
 	CommandLineParser.cpp \
@@ -25,4 +25,4 @@
 DllPlugInTesterTest_LDADD= \
   $(top_builddir)/src/cppunit/libcppunit.la
 
-DllPlugInTesterTest_LDFLAGS = -ldl
+DllPlugInTesterTest_LDFLAGS = $(LIBADD_DL)