summaryrefslogtreecommitdiff
blob: 975ed4321e57d16dcdac8722b1b4259cbd9f5d43 (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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
Convert all of the static libraries for the embedded libmysqld to build as
shared.

This enables amarok's mysql extension to properly build as a shared object,
without statically including libmysqld or nor forcing libmysqld to be built
with -fPIC.

Thanks to <pageexec@freemail.hu> for the @plt fixes.
Thanks to Diego Elio Pettenò <flameeyes@gentoo.org> for all the extensive build
system help with libtool conversions.

Gentoo-Bug: 238487
Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=238487
MySQL-Bug-URL: http://bugs.mysql.com/bug.php?id=39288
MySQL-Bug: 39288
MySQL-Lists-URL: http://lists.mysql.com/internals/35947
X-Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=188019&action=view
Signed-off-by: Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

- Ported from the 5.1.43 patch. 
- Take two by Maciej Mrozowski <reavertm@gentoo.org>, on bug 306315.
- Also rediffed by robbat2 again.

diff -Nuarp --exclude '*.orig' mysql.orig/client/Makefile.am mysql/client/Makefile.am
--- mysql.orig/client/Makefile.am	2010-09-02 20:38:44.061005582 +0000
+++ mysql/client/Makefile.am	2010-09-02 20:43:04.270330529 +0000
@@ -75,7 +75,7 @@ mysqlimport_CFLAGS=		-DTHREAD -UUNDEF_TH
 mysqlimport_LDADD =		$(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
 				@CLIENT_EXTRA_LDFLAGS@ \
 				$(LIBMYSQLCLIENT_LA) \
-				$(top_builddir)/mysys/libmysys.a
+				$(top_builddir)/mysys/libmysys.la
 
 mysqlshow_SOURCES=		mysqlshow.c
 
@@ -84,15 +84,15 @@ mysqlslap_CFLAGS=		-DTHREAD -UMYSQL_CLIE
 mysqlslap_LDADD =		$(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
 				@CLIENT_EXTRA_LDFLAGS@ \
 				$(LIBMYSQLCLIENT_LA) \
-				$(top_builddir)/mysys/libmysys.a
+				$(top_builddir)/mysys/libmysys.la
 
 mysqltest_SOURCES=		mysqltest.cc
 mysqltest_CXXFLAGS=		-DTHREAD -UMYSQL_CLIENT_NO_THREADS
 mysqltest_LDADD =		$(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
 				@CLIENT_EXTRA_LDFLAGS@ \
 				$(LIBMYSQLCLIENT_LA) \
-				$(top_builddir)/mysys/libmysys.a \
-				$(top_builddir)/regex/libregex.a \
+				$(top_builddir)/mysys/libmysys.la \
+				$(top_builddir)/regex/libregex.la \
 				$(CLIENT_THREAD_LIBS)
 
 mysql_upgrade_SOURCES=          mysql_upgrade.c \
diff -Nuarp --exclude '*.orig' mysql.orig/configure.in mysql/configure.in
--- mysql.orig/configure.in	2010-09-02 20:38:44.061005582 +0000
+++ mysql/configure.in	2010-09-02 20:43:04.270330529 +0000
@@ -2769,7 +2769,7 @@ server_scripts=
 
 dnl This probably should be cleaned up more - for now the threaded
 dnl client is just using plain-old libs.
-sql_client_dirs="strings mysys dbug extra regex libmysql"
+sql_client_dirs="strings regex dbug mysys extra libmysql"
 
 AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
 
@@ -2797,20 +2797,18 @@ fi
 AC_SUBST(netware_dir)
 AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
 
+AM_CONDITIONAL([NEED_THREADS], [test x"$with_server" != xno -o x"$THREAD_SAFE_CLIENT" != xno])
 if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
 then
   AC_DEFINE([THREAD], [1],
             [Define if you want to have threaded code. This may be undef on client code])
-  # Avoid _PROGRAMS names
-  THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o"
-  AC_SUBST(THREAD_LOBJECTS)
 fi
 AM_CONDITIONAL(NEED_THREAD, test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no")
 
 if test "$with_server" != "no"
 then
   server_scripts="mysqld_safe mysql_install_db"
-  sql_server_dirs="strings mysys dbug extra regex storage plugin"
+  sql_server_dirs="strings dbug mysys extra regex storage plugin"
 
   sql_server="vio sql"
 fi
diff -Nuarp --exclude '*.orig' mysql.orig/dbug/Makefile.am mysql/dbug/Makefile.am
--- mysql.orig/dbug/Makefile.am	2010-09-02 20:38:44.061005582 +0000
+++ mysql/dbug/Makefile.am	2010-09-02 20:43:04.270330529 +0000
@@ -16,10 +16,10 @@
 # MA 02111-1307, USA
 
 INCLUDES =              -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADD =                 libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
-pkglib_LIBRARIES =      libdbug.a
+LDADD =                 ../mysys/libmysys.la ../strings/libmystrings.la
+noinst_LTLIBRARIES =    libdbug.la
 noinst_HEADERS =        dbug_long.h
-libdbug_a_SOURCES =     dbug.c sanity.c
+libdbug_la_SOURCES =     dbug.c sanity.c
 EXTRA_DIST =            CMakeLists.txt example1.c example2.c example3.c \
                         user.r monty.doc dbug_add_tags.pl \
                         my_main.c main.c factorial.c dbug_analyze.c \
@@ -31,11 +31,11 @@ CLEANFILES =            $(NROFF_INC) use
 
 
 # Must be linked with libs that are not compiled yet
-noinst_PROGRAMS =       factorial dbug_analyze
+EXTRA_PROGRAMS =        factorial dbug_analyze
 factorial_SOURCES =     my_main.c factorial.c
 dbug_analyze_SOURCES =  dbug_analyze.c
 
-all:            user.t user.ps
+check-local:            user.t user.ps
 
 user.t:         user.r $(NROFF_INC)
 		-nroff -mm user.r > $@
diff -Nuarp --exclude '*.orig' mysql.orig/extra/Makefile.am mysql/extra/Makefile.am
--- mysql.orig/extra/Makefile.am	2010-09-02 20:38:44.061005582 +0000
+++ mysql/extra/Makefile.am	2010-09-02 20:43:04.270330529 +0000
@@ -15,8 +15,8 @@
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include \
 			-I$(top_srcdir)/sql
-LDADD =			@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
-			../dbug/libdbug.a ../strings/libmystrings.a \
+LDADD =			@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.la \
+			../dbug/libdbug.la ../strings/libmystrings.la \
 			$(ZLIB_LIBS)
 BUILT_SOURCES=		$(top_builddir)/include/mysqld_error.h \
                         $(top_builddir)/include/sql_state.h \
diff -Nuarp --exclude '*.orig' mysql.orig/libmysql/Makefile.am mysql/libmysql/Makefile.am
--- mysql.orig/libmysql/Makefile.am	2010-09-02 20:38:44.061005582 +0000
+++ mysql/libmysql/Makefile.am	2010-09-02 20:43:04.270330529 +0000
@@ -106,8 +106,8 @@ do-lib-dist:
 	echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
 	echo 'CFLAGS=	-I. -DMYSQL_CLIENT_NO_THREADS' >>$$dir/Makefile; \
 	echo "obj=$$objs"  >>$$dir/Makefile; \
-	echo 'all: libmysql.a'  >>$$dir/Makefile; \
-	echo 'libmysql.a: $$(obj)'  >>$$dir/Makefile; \
+	echo 'all: libmysql.la'  >>$$dir/Makefile; \
+	echo 'libmysql.la: $$(obj)'  >>$$dir/Makefile; \
 	echo '	$$(AR) r $$@ $$?'  >>$$dir/Makefile; \
 	gtar cvzf $$dir.tar.gz $$dir; \
 	cd $$dir; gmake
diff -Nuarp --exclude '*.orig' mysql.orig/libmysqld/examples/Makefile.am mysql/libmysqld/examples/Makefile.am
--- mysql.orig/libmysqld/examples/Makefile.am	2010-09-02 20:38:44.061005582 +0000
+++ mysql/libmysqld/examples/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -37,13 +37,14 @@ INCLUDES =	-I$(top_builddir)/include -I$
 		-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
 		$(openssl_includes)
 LIBS =		@LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
-LDADD =		@CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
-                @NDB_SCI_LIBS@
+LDADD =		@CLIENT_EXTRA_LDFLAGS@ ../libmysqld.la @LIBDL@ $(CXXLDFLAGS) \
+                @NDB_SCI_LIBS@ $(top_builddir)/libmysql/libmysqlclient.la
 
 mysqltest_embedded_LINK = $(CXXLINK)
 nodist_mysqltest_embedded_SOURCES =	mysqltest.cc
-mysqltest_embedded_LDADD =	$(LDADD) $(top_builddir)/regex/libregex.a \
+mysqltest_embedded_LDADD =	$(LDADD) $(top_builddir)/regex/libregex.la \
 				@MYSQLD_EXTRA_LDFLAGS@
+mysqltest_embedded_LDFLAGS = -static
 
 nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
                 my_readline.h sql_string.h completion_hash.h
@@ -51,6 +52,7 @@ mysql_LDADD = @readline_link@ @TERMCAP_L
 
 mysql_client_test_embedded_LINK = $(CXXLINK)
 nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c
+mysql_client_test_embedded_LDFLAGS = -static
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%
diff -Nuarp --exclude '*.orig' mysql.orig/libmysqld/Makefile.am mysql/libmysqld/Makefile.am
--- mysql.orig/libmysqld/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/libmysqld/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -36,8 +36,8 @@ INCLUDES=		-I$(top_builddir)/include -I$
 			$(openssl_includes) @ZLIB_INCLUDES@ \
 			@condition_dependent_plugin_includes@
 
-noinst_LIBRARIES =	libmysqld_int.a
-pkglib_LIBRARIES =	libmysqld.a
+noinst_LTLIBRARIES =	libmysqld_int.la
+pkglib_LTLIBRARIES =	libmysqld.la
 SUBDIRS =		. examples
 libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
 libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
@@ -79,11 +79,10 @@ sqlsources = derror.cc field.cc field_co
 	rpl_injector.cc my_user.c partition_info.cc \
 	sql_servers.cc event_parse_data.cc
 
-libmysqld_int_a_SOURCES= $(libmysqld_sources)
-nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
-libmysqld_a_SOURCES=
+nodist_libmysqld_int_la_SOURCES= $(libmysqlsources) $(sqlsources)
+libmysqld_la_SOURCES=$(libmysqld_sources)
 
-sqlstoragesources =	$(EXTRA_libmysqld_a_SOURCES)
+sqlstoragesources =	$(EXTRA_libmysqld_la_SOURCES)
 storagesources = @condition_dependent_plugin_modules@
 storageobjects = @condition_dependent_plugin_objects@
 storagesourceslinks = @condition_dependent_plugin_links@
@@ -91,19 +90,20 @@ storagesourceslinks = @condition_depende
 # automake misses these
 sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
 
-# The following libraries should be included in libmysqld.a
-INC_LIB=	$(top_builddir)/regex/libregex.a \
-		$(top_builddir)/mysys/libmysys.a \
-		$(top_builddir)/strings/libmystrings.a \
-		$(top_builddir)/dbug/libdbug.a \
-		$(top_builddir)/vio/libvio.a \
-                @NDB_SCI_LIBS@ \
+# The following libraries should be included in libmysqld.la
+libmysqld_la_LIBADD=	$(top_builddir)/regex/libregex.la \
+		$(top_builddir)/mysys/libmysys.la \
+		$(top_builddir)/strings/libmystrings.la \
+		$(top_builddir)/dbug/libdbug.la \
+		$(top_builddir)/vio/libvio.la \
+		@NDB_SCI_LIBS@ \
 		@mysql_plugin_libs@ \
-		$(yassl_inc_libs)
+		$(yassl_inc_libs) \
+		libmysqld_int.la
 
 if HAVE_YASSL
-yassl_inc_libs=	$(top_builddir)/extra/yassl/src/.libs/libyassl.a \
-		$(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
+yassl_inc_libs=	$(top_builddir)/extra/yassl/src/libyassl.la \
+		$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
 endif
 
 # Storage engine specific compilation options
@@ -139,51 +139,13 @@ ha_myisam.o:ha_myisam.cc
 ha_myisammrg.o:ha_myisammrg.cc
 		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
 
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a:	libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
-if DARWIN_MWCC
-	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
-else
-		-rm -f libmysqld.a
-		if test "$(host_os)" = "netware" ; \
-		then \
-		  $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
-		else \
-		  current_dir=`pwd`; \
-		  rm -rf tmp; mkdir tmp; \
-		  (for arc in $(INC_LIB) ./libmysqld_int.a; do \
-		    arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
-		    artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
-		    for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
-		      if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
-		      mkdir $$artmp; cd $$artmp > /dev/null; \
-		      $(AR) x ../../$$arc; \
-		      cd $$current_dir > /dev/null; \
-		      ls $$artmp/* | grep -v SYMDEF; \
-		      continue 2; fi; done; \
-		  done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
-		  $(AR) r libmysqld.a $(storageobjects); \
-		  $(RANLIB) libmysqld.a	; \
-		  rm -rf tmp; \
-		fi
-endif
-
 ## XXX: any time the client interface changes, we'll need to bump
 ## the version info for libmysqld; however, it's possible for the
 ## libmysqld interface to change without affecting the standard
 ## libmysqlclient interface.  Should we make a separate version
 ## string for the two?
-#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
-#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
+libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
+CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
 
 BUILT_SOURCES = link_sources
 
diff -Nuarp --exclude '*.orig' mysql.orig/mysys/Makefile.am mysql/mysys/Makefile.am
--- mysql.orig/mysys/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/mysys/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -18,10 +18,9 @@ MYSQLSHAREdir =		$(pkgdatadir)
 MYSQLBASEdir=		$(prefix)
 INCLUDES =		@ZLIB_INCLUDES@ -I$(top_builddir)/include \
 			-I$(top_srcdir)/include -I$(srcdir)
-pkglib_LIBRARIES =	libmysys.a
-LDADD =			libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug/libdbug.a
+pkglib_LTLIBRARIES =	libmysys.la
 noinst_HEADERS =	mysys_priv.h my_static.h my_handler_errors.h
-libmysys_a_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
+libmysys_la_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
 			mf_path.c mf_loadpath.c my_file.c \
 			my_open.c my_create.c my_dup.c my_seek.c my_read.c \
 			my_pread.c my_write.c my_getpagesize.c \
@@ -45,7 +44,7 @@ libmysys_a_SOURCES =    my_init.c my_get
 			my_quick.c my_lockmem.c my_static.c \
 			my_sync.c my_getopt.c my_mkdir.c \
 			default_modify.c default.c \
-                        my_compress.c checksum.c \
+			my_compress.c checksum.c \
 			my_net.c my_port.c my_sleep.c \
 			charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
 			my_gethostbyname.c rijndael.c my_aes.c sha1.c \
@@ -53,22 +52,23 @@ libmysys_a_SOURCES =    my_init.c my_get
 			my_memmem.c stacktrace.c \
 			my_windac.c my_access.c base64.c my_libwrap.c
 
+libmysys_la_LIBADD = $(top_builddir)/dbug/libdbug.la $(top_builddir)/strings/libmystrings.la \
+			$(ZLIB_LIBS)
 if NEED_THREAD
 # mf_keycache is used only in the server, so it is safe to leave the file
 # out of the non-threaded library.
 # In fact, it will currently not compile without thread support.
-libmysys_a_SOURCES +=   mf_keycache.c
+libmysys_la_SOURCES +=  thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c my_pthread.c my_thr_init.c mf_keycache.c
 endif
 
 EXTRA_DIST =		thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
 			thr_mutex.c thr_rwlock.c \
 			CMakeLists.txt mf_soundex.c \
 			my_conio.c my_wincond.c my_winthread.c
-libmysys_a_LIBADD =	@THREAD_LOBJECTS@
-# test_dir_DEPENDENCIES=	$(LIBRARIES)
-# testhash_DEPENDENCIES=	$(LIBRARIES)
-# test_charset_DEPENDENCIES=	$(LIBRARIES)
-# charset2html_DEPENDENCIES=	$(LIBRARIES)
+# test_dir_DEPENDENCIES=	$(LTLIBRARIES)
+# testhash_DEPENDENCIES=	$(LTLIBRARIES)
+# test_charset_DEPENDENCIES=	$(LTLIBRARIES)
+# charset2html_DEPENDENCIES=	$(LTLIBRARIES)
 DEFS =			-DDEFAULT_BASEDIR=\"$(prefix)\" \
 			-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
 			-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
@@ -78,8 +78,6 @@ DEFS =			-DDEFAULT_BASEDIR=\"$(prefix)\"
 			-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
                         @DEFS@
 
-libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@
-
 # I hope this always does the right thing. Otherwise this is only test programs
 FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
 
@@ -88,39 +86,39 @@ FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(
 # which automaticly removes the object files you use to compile a final program
 #
 
-test_bitmap$(EXEEXT): my_bitmap.c $(LIBRARIES)
+test_bitmap$(EXEEXT): my_bitmap.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN  ./my_bitmap.c $(LDADD) $(LIBS)
 
-test_priority_queue$(EXEEXT): queues.c $(LIBRARIES)
+test_priority_queue$(EXEEXT): queues.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN  ./queues.c $(LDADD) $(LIBS)
 
-test_thr_alarm$(EXEEXT): thr_alarm.c $(LIBRARIES)
+test_thr_alarm$(EXEEXT): thr_alarm.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/thr_alarm.c ./test_thr_alarm.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_thr_alarm.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_thr_alarm.c
 
-test_thr_lock$(EXEEXT): thr_lock.c $(LIBRARIES)
+test_thr_lock$(EXEEXT): thr_lock.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/thr_lock.c test_thr_lock.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_thr_lock.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_thr_lock.c
 
-test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LIBRARIES)
+test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/my_vsnprintf.c test_vsnprintf.c
 	$(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS)
 	$(RM) -f test_vsnprintf.c
 
-test_io_cache$(EXEEXT): mf_iocache.c $(LIBRARIES)
+test_io_cache$(EXEEXT): mf_iocache.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/mf_iocache.c test_io_cache.c
 	$(LINK) $(FLAGS) -DMAIN ./test_io_cache.c $(LDADD) $(LIBS)
 	$(RM) -f test_io_cache.c
 
-test_dir$(EXEEXT): test_dir.c $(LIBRARIES)
+test_dir$(EXEEXT): test_dir.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
 
-test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
+test_charset$(EXEEXT): test_charset.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
 
-testhash$(EXEEXT): testhash.c $(LIBRARIES)
+testhash$(EXEEXT): testhash.c $(LTLIBRARIES)
 	$(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
 
 test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES)
@@ -128,7 +126,7 @@ test_gethwaddr$(EXEEXT): my_gethwaddr.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_gethwaddr.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_gethwaddr.c
 
-test_base64$(EXEEXT): base64.c $(LIBRARIES)
+test_base64$(EXEEXT): base64.c $(LTLIBRARIES)
 	$(CP) $(srcdir)/base64.c ./test_base64.c
 	$(LINK) $(FLAGS) -DMAIN  ./test_base64.c $(LDADD) $(LIBS)
 	$(RM) -f ./test_base64.c
diff -Nuarp --exclude '*.orig' mysql.orig/netware/Makefile.am mysql/netware/Makefile.am
--- mysql.orig/netware/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/netware/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -16,14 +16,13 @@
 
 if HAVE_NETWARE
 INCLUDES =			-I$(top_builddir)/include -I$(top_srcdir)/include -I..
-LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
-				../dbug/libdbug.a ../strings/libmystrings.a
+LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.la
 bin_PROGRAMS =			mysqld_safe mysql_install_db mysql_test_run libmysql
 mysqld_safe_SOURCES=		mysqld_safe.c my_manage.c
 mysql_install_db_SOURCES=	mysql_install_db.c my_manage.c
 mysql_test_run_SOURCES=		mysql_test_run.c my_manage.c
 libmysql_SOURCES=		libmysqlmain.c
-libmysql_LDADD =		../libmysql/.libs/libmysqlclient.a \
+libmysql_LDADD =		../libmysql/.libs/libmysqlclient.la \
 				@openssl_libs@ @yassl_libs@
 
 netware_build_files =           client/mysql.def client/mysqladmin.def \
diff -Nuarp --exclude '*.orig' mysql.orig/pstack/Makefile.am mysql/pstack/Makefile.am
--- mysql.orig/pstack/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/pstack/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -22,8 +22,8 @@ SUBDIRS =		aout
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
 
-pkglib_LIBRARIES =	libpstack.a
-libpstack_a_SOURCES =	bucomm.c filemode.c linuxthreads.c rddbg.c \
+pkglib_LTLIBRARIES =	libpstack.la
+libpstack_la_SOURCES =	bucomm.c filemode.c linuxthreads.c rddbg.c \
 			debug.c ieee.c pstack.c stabs.c
 noinst_HEADERS =	bucomm.h debug.h ieee.h budbg.h demangle.h \
 			linuxthreads.h pstack.h pstacktrace.h
diff -Nuarp --exclude '*.orig' mysql.orig/regex/Makefile.am mysql/regex/Makefile.am
--- mysql.orig/regex/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/regex/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -16,10 +16,10 @@
 # MA 02111-1307, USA
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-noinst_LIBRARIES =	libregex.a
-LDADD=			libregex.a $(top_builddir)/strings/libmystrings.a
+pkglib_LTLIBRARIES =	libregex.la
+LDADD=			libregex.la $(top_builddir)/strings/libmystrings.la
 noinst_HEADERS =	cclass.h cname.h regex2.h utils.h engine.c my_regex.h
-libregex_a_SOURCES =	regerror.c regcomp.c regexec.c regfree.c reginit.c
+libregex_la_SOURCES =	regerror.c regcomp.c regexec.c regfree.c reginit.c
 noinst_PROGRAMS =	re
 re_SOURCES =		split.c debug.c main.c
 re_LDFLAGS= @NOINST_LDFLAGS@
diff -Nuarp --exclude '*.orig' mysql.orig/server-tools/instance-manager/Makefile.am mysql/server-tools/instance-manager/Makefile.am
--- mysql.orig/server-tools/instance-manager/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/server-tools/instance-manager/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -23,8 +23,7 @@ DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_S
 # default_options.h, generated from default_options.h.in)
 # See automake/autoconf docs for details
 
-noinst_LTLIBRARIES= liboptions.la
-noinst_LIBRARIES=   libnet.a
+noinst_LTLIBRARIES= liboptions.la libnet.la
 
 liboptions_la_CXXFLAGS= $(CXXFLAGS) \
 	-DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \
@@ -36,17 +35,17 @@ liboptions_la_CXXFLAGS= $(CXXFLAGS) \
 	-DPROTOCOL_VERSION=@PROTOCOL_VERSION@
 
 liboptions_la_SOURCES= options.h options.cc priv.h priv.cc
-liboptions_la_LIBADD= $(top_builddir)/libmysql/get_password.lo
+
+liboptions_la_LIBADD= $(top_builddir)/libmysql/libmysqlclient.la
 
 # MySQL sometimes uses symlinks to reuse code 
 # All symlinked files are grouped in libnet.a
 
-nodist_libnet_a_SOURCES= net_serv.cc client_settings.h
-libnet_a_LIBADD= $(top_builddir)/sql/password.$(OBJEXT) \
-	$(top_builddir)/sql/pack.$(OBJEXT) \
-	$(top_builddir)/sql/sql_state.$(OBJEXT) \
-	$(top_builddir)/sql/mini_client_errors.$(OBJEXT)\
-	$(top_builddir)/sql/client.$(OBJEXT)
+nodist_libnet_la_SOURCES= net_serv.cc client_settings.h \
+	$(srcdir)/../../sql/password.c $(srcdir)/../../sql/pack.c \
+	$(srcdir)/../../sql/sql_state.c $(srcdir)/../../sql/mini_client_errors.c \
+	$(srcdir)/../../sql/client.c
+
 
 CLEANFILES= net_serv.cc client_settings.h
 
@@ -86,11 +85,11 @@ mysqlmanager_SOURCES=	command.cc command
 
 mysqlmanager_LDADD=	@CLIENT_EXTRA_LDFLAGS@ \
 			liboptions.la \
-			libnet.a \
-			$(top_builddir)/vio/libvio.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/strings/libmystrings.a \
-			$(top_builddir)/dbug/libdbug.a \
+			libnet.la \
+			$(top_builddir)/vio/libvio.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/strings/libmystrings.la \
+			$(top_builddir)/dbug/libdbug.la \
 			@openssl_libs@ @yassl_libs@ @ZLIB_LIBS@
 
 EXTRA_DIST =		WindowsService.cpp WindowsService.h IMService.cpp \
diff -Nuarp --exclude '*.orig' mysql.orig/sql/Makefile.am mysql/sql/Makefile.am
--- mysql.orig/sql/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/sql/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -32,11 +32,12 @@ bin_PROGRAMS =		mysql_tzinfo_to_sql
 noinst_LTLIBRARIES=	libndb.la \
 			udf_example.la
 
-SUPPORTING_LIBS =	$(top_builddir)/vio/libvio.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/regex/libregex.a \
-			$(top_builddir)/strings/libmystrings.a
+SUPPORTING_LIBS =	$(top_builddir)/vio/libvio.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/regex/libregex.la \
+			$(top_builddir)/strings/libmystrings.la \
+			$(top_builddir)/storage/myisam/libmyisam.la
 mysqld_DEPENDENCIES=	@mysql_plugin_libs@ $(SUPPORTING_LIBS) libndb.la
 LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
 mysqld_LDADD =		libndb.la \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/archive/Makefile.am mysql/storage/archive/Makefile.am
--- mysql.orig/storage/archive/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/archive/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -23,17 +23,18 @@ pkgplugindir =		$(pkglibdir)/plugin
 INCLUDES =              -I$(top_srcdir)/include -I$(top_builddir)/include \
 			-I$(top_srcdir)/regex \
 			-I$(top_srcdir)/sql \
-                        -I$(srcdir) @ZLIB_INCLUDES@
+			-I$(srcdir) @ZLIB_INCLUDES@
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
 noinst_HEADERS =	ha_archive.h azlib.h
 noinst_PROGRAMS	=	archive_test archive_reader
 
-EXTRA_LTLIBRARIES =	ha_archive.la
+EXTRA_LTLIBRARIES =	ha_archive.la libarchive.la
 pkgplugin_LTLIBRARIES =	@plugin_archive_shared_target@
 ha_archive_la_LDFLAGS =	-module -rpath $(pkgplugindir)
 ha_archive_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -41,26 +42,25 @@ ha_archive_la_CFLAGS =	$(AM_CFLAGS) -DMY
 ha_archive_la_SOURCES =	ha_archive.cc azio.c
 
 
-EXTRA_LIBRARIES =	libarchive.a
-noinst_LIBRARIES =	@plugin_archive_static_target@
-libarchive_a_CXXFLAGS =	$(AM_CXXFLAGS)
-libarchive_a_CFLAGS =	$(AM_CFLAGS)
-libarchive_a_SOURCES =	ha_archive.cc azio.c
+noinst_LTLIBRARIES =	@plugin_archive_static_target@
+libarchive_la_CXXFLAGS =	$(AM_CXXFLAGS)
+libarchive_la_CFLAGS =	$(AM_CFLAGS)
+libarchive_la_SOURCES =	ha_archive.cc azio.c
 
 
 archive_test_SOURCES =	archive_test.c azio.c
 archive_test_CFLAGS =	$(AM_CFLAGS)
-archive_test_LDADD =	$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a \
+archive_test_LDADD =	$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/strings/libmystrings.la \
 			@ZLIB_LIBS@
 archive_test_LDFLAGS = @NOINST_LDFLAGS@
 
 archive_reader_SOURCES = archive_reader.c azio.c
 archive_reader_CFLAGS =	$(AM_CFLAGS)
-archive_reader_LDADD =	$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a \
+archive_reader_LDADD =	$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/strings/libmystrings.la \
 			@ZLIB_LIBS@
 archive_reader_LDFLAGS = @NOINST_LDFLAGS@
 
diff -Nuarp --exclude '*.orig' mysql.orig/storage/archive/plug.in mysql/storage/archive/plug.in
--- mysql.orig/storage/archive/plug.in	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/archive/plug.in	2010-09-02 20:43:04.273663976 +0000
@@ -1,4 +1,4 @@
 MYSQL_STORAGE_ENGINE(archive,,  [Archive Storage Engine],
         [Archive Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(archive,    [libarchive.a])
+MYSQL_PLUGIN_STATIC(archive,    [libarchive.la])
 MYSQL_PLUGIN_DYNAMIC(archive,   [ha_archive.la])
diff -Nuarp --exclude '*.orig' mysql.orig/storage/blackhole/Makefile.am mysql/storage/blackhole/Makefile.am
--- mysql.orig/storage/blackhole/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/blackhole/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -27,12 +27,13 @@ INCLUDES =              -I$(top_srcdir)/
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
 noinst_HEADERS =	ha_blackhole.h
 
-EXTRA_LTLIBRARIES =	ha_blackhole.la
+EXTRA_LTLIBRARIES =	ha_blackhole.la libblackhole.la
 pkgplugin_LTLIBRARIES =	@plugin_blackhole_shared_target@
 ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
 ha_blackhole_la_CXXFLAGS=$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -40,11 +41,10 @@ ha_blackhole_la_CFLAGS=	$(AM_CFLAGS) -DM
 ha_blackhole_la_SOURCES=ha_blackhole.cc
 
 
-EXTRA_LIBRARIES =	libblackhole.a
-noinst_LIBRARIES =	@plugin_blackhole_static_target@
-libblackhole_a_CXXFLAGS=$(AM_CXXFLAGS)
-libblackhole_a_CFLAGS =	$(AM_CFLAGS)
-libblackhole_a_SOURCES=	ha_blackhole.cc
+noinst_LTLIBRARIES =	@plugin_blackhole_static_target@
+libblackhole_la_CXXFLAGS=$(AM_CXXFLAGS)
+libblackhole_la_CFLAGS =	$(AM_CFLAGS)
+libblackhole_la_SOURCES=	ha_blackhole.cc
 
 
 EXTRA_DIST =		CMakeLists.txt plug.in
diff -Nuarp --exclude '*.orig' mysql.orig/storage/blackhole/plug.in mysql/storage/blackhole/plug.in
--- mysql.orig/storage/blackhole/plug.in	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/blackhole/plug.in	2010-09-02 20:43:04.273663976 +0000
@@ -1,6 +1,5 @@
 MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
         [Basic Write-only Read-never tables], [max,max-no-ndb])
 MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
-MYSQL_PLUGIN_STATIC(blackhole,  [libblackhole.a])
+MYSQL_PLUGIN_STATIC(blackhole,  [libblackhole.la])
 MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
-
diff -Nuarp --exclude '*.orig' mysql.orig/storage/csv/Makefile.am mysql/storage/csv/Makefile.am
--- mysql.orig/storage/csv/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/csv/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -25,20 +25,20 @@ INCLUDES =              -I$(top_builddir
 			-I$(top_srcdir)/sql \
                         -I$(srcdir)
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =	@DEFS@
 noinst_HEADERS	  =	ha_tina.h transparent_file.h
 
-EXTRA_LTLIBRARIES =	ha_csv.la
+EXTRA_LTLIBRARIES =	ha_csv.la libcsv.la
 pkglib_LTLIBRARIES =	@plugin_csv_shared_target@
 ha_csv_la_LDFLAGS =	-module -rpath $(MYSQLLIBdir)
 ha_csv_la_CXXFLAGS =	$(AM_CXXFLAGS) -DMYSQL_PLUGIN
 ha_csv_la_SOURCES =	transparent_file.cc ha_tina.cc 
 
-EXTRA_LIBRARIES =	libcsv.a
-noinst_LIBRARIES =	@plugin_csv_static_target@
-libcsv_a_CXXFLAGS =	$(AM_CXXFLAGS)
-libcsv_a_SOURCES =	transparent_file.cc ha_tina.cc
+noinst_LTLIBRARIES =	@plugin_csv_static_target@
+libcsv_la_CXXFLAGS =	$(AM_CXXFLAGS)
+libcsv_la_SOURCES =	transparent_file.cc ha_tina.cc
 
 EXTRA_DIST =		CMakeLists.txt plug.in
 # Don't update the files from bitkeeper
diff -Nuarp --exclude '*.orig' mysql.orig/storage/csv/plug.in mysql/storage/csv/plug.in
--- mysql.orig/storage/csv/plug.in	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/csv/plug.in	2010-09-02 20:43:04.273663976 +0000
@@ -1,5 +1,5 @@
 MYSQL_STORAGE_ENGINE(csv,,      [CSV Storage Engine],
         [Stores tables in text CSV format])
 MYSQL_PLUGIN_DIRECTORY(csv,     [storage/csv])
-MYSQL_PLUGIN_STATIC(csv,        [libcsv.a])
-MYSQL_PLUGIN_MANDATORY(csv)     dnl Used for logging
+MYSQL_PLUGIN_STATIC(csv,        [libcsv.la])
+MYSQL_PLUGIN_DYNAMIC(csv,       [ha_csv.la])
diff -Nuarp --exclude '*.orig' mysql.orig/storage/example/Makefile.am mysql/storage/example/Makefile.am
--- mysql.orig/storage/example/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/example/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -27,6 +27,7 @@ INCLUDES =              -I$(top_srcdir)/
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
diff -Nuarp --exclude '*.orig' mysql.orig/storage/federated/Makefile.am mysql/storage/federated/Makefile.am
--- mysql.orig/storage/federated/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/federated/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -27,12 +27,13 @@ INCLUDES =              -I$(top_srcdir)/
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
 noinst_HEADERS =	ha_federated.h
 
-EXTRA_LTLIBRARIES =	ha_federated.la
+EXTRA_LTLIBRARIES =	ha_federated.la libfederated.la
 pkgplugin_LTLIBRARIES =	@plugin_federated_shared_target@
 ha_federated_la_LDFLAGS =	-module -rpath $(pkgplugindir)
 ha_federated_la_CXXFLAGS=	$(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -40,11 +41,10 @@ ha_federated_la_CFLAGS =	$(AM_CFLAGS) -D
 ha_federated_la_SOURCES =	ha_federated.cc
 
 
-EXTRA_LIBRARIES =	libfederated.a
-noinst_LIBRARIES =	@plugin_federated_static_target@
-libfederated_a_CXXFLAGS =	$(AM_CXXFLAGS)
-libfederated_a_CFLAGS =	$(AM_CFLAGS)
-libfederated_a_SOURCES=	ha_federated.cc
+noinst_LTLIBRARIES =	@plugin_federated_static_target@
+libfederated_la_CXXFLAGS =	$(AM_CXXFLAGS)
+libfederated_la_CFLAGS =	$(AM_CFLAGS)
+libfederated_la_SOURCES=	ha_federated.cc
 
 
 EXTRA_DIST =		CMakeLists.txt plug.in
diff -Nuarp --exclude '*.orig' mysql.orig/storage/federated/plug.in mysql/storage/federated/plug.in
--- mysql.orig/storage/federated/plug.in	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/federated/plug.in	2010-09-02 20:43:04.273663976 +0000
@@ -1,5 +1,5 @@
 MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
         [Connects to tables on remote MySQL servers], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(federated,    [libfederated.a])
-MYSQL_PLUGIN_DYNAMIC(federated,   [ha_federated.la])
+MYSQL_PLUGIN_STATIC(federated,    [libfederated.la])
 MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
+MYSQL_PLUGIN_DYNAMIC(federated,   [ha_federated.la])
diff -Nuarp --exclude '*.orig' mysql.orig/storage/heap/Makefile.am mysql/storage/heap/Makefile.am
--- mysql.orig/storage/heap/Makefile.am	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/heap/Makefile.am	2010-09-02 20:43:04.273663976 +0000
@@ -24,23 +24,23 @@ INCLUDES =              -I$(top_srcdir)/
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
-pkglib_LIBRARIES =	libheap.a
+pkglib_LTLIBRARIES =	libheap.la
 noinst_PROGRAMS	=	hp_test1 hp_test2
-noinst_LIBRARIES =	libheap.a
 hp_test1_LDFLAGS = @NOINST_LDFLAGS@
-hp_test1_LDADD =	libheap.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a
+hp_test1_LDADD =	libheap.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/strings/libmystrings.la
 hp_test2_LDFLAGS = @NOINST_LDFLAGS@
-hp_test2_LDADD =	libheap.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a
+hp_test2_LDADD =	libheap.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/strings/libmystrings.la
 noinst_HEADERS =	heapdef.h ha_heap.h
-libheap_a_SOURCES =	hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
+libheap_la_SOURCES =	hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
 			hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
 			hp_rsame.c hp_create.c hp_rename.c hp_rfirst.c \
 			hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/heap/plug.in mysql/storage/heap/plug.in
--- mysql.orig/storage/heap/plug.in	2010-09-02 20:38:44.064339040 +0000
+++ mysql/storage/heap/plug.in	2010-09-02 20:43:04.273663976 +0000
@@ -1,7 +1,5 @@
 MYSQL_STORAGE_ENGINE(heap,no,   [Memory Storage Engine],
         [Volatile memory based tables])
 MYSQL_PLUGIN_DIRECTORY(heap,    [storage/heap])
-MYSQL_PLUGIN_STATIC(heap,       [libheap.a])
-MYSQL_PLUGIN_MANDATORY(heap)    dnl Memory tables
+MYSQL_PLUGIN_DYNAMIC(heap,      [libheap.la])
 MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc])
-
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ibmdb2i/Makefile.am mysql/storage/ibmdb2i/Makefile.am
--- mysql.orig/storage/ibmdb2i/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ibmdb2i/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -21,6 +21,7 @@ INCLUDES =              -I$(top_srcdir)/
 WRAPLIBS=
 
 LDADD =			
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
diff -Nuarp --exclude '*.orig' mysql.orig/storage/innobase/Makefile.am mysql/storage/innobase/Makefile.am
--- mysql.orig/storage/innobase/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/innobase/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -122,9 +122,9 @@ noinst_HEADERS=		include/btr0btr.h inclu
 			include/ut0list.ic include/ut0wqueue.h		\
 			include/ha_prototypes.h handler/ha_innodb.h
 
-EXTRA_LIBRARIES=	libinnobase.a
-noinst_LIBRARIES=	@plugin_innobase_static_target@
-libinnobase_a_SOURCES=	btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c	\
+EXTRA_LTLIBRARIES=	ha_innodb.la libinnobase.la
+noinst_LTLIBRARIES=	@plugin_innobase_static_target@
+libinnobase_la_SOURCES=	btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c	\
 			btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c	\
 			buf/buf0lru.c buf/buf0rea.c data/data0data.c	\
 			data/data0type.c dict/dict0boot.c		\
@@ -156,10 +156,9 @@ libinnobase_a_SOURCES=	btr/btr0btr.c btr
 			ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c		\
 			handler/ha_innodb.cc
 
-libinnobase_a_CXXFLAGS=	$(AM_CXXFLAGS)
-libinnobase_a_CFLAGS=	$(AM_CFLAGS)
+libinnobase_la_CXXFLAGS=	$(AM_CXXFLAGS)
+libinnobase_la_CFLAGS=	$(AM_CFLAGS)
 
-EXTRA_LTLIBRARIES=	ha_innodb.la
 pkgplugin_LTLIBRARIES=	@plugin_innobase_shared_target@
 
 ha_innodb_la_LDFLAGS=	-module -rpath $(pkgplugindir)
diff -Nuarp --exclude '*.orig' mysql.orig/storage/innobase/plug.in mysql/storage/innobase/plug.in
--- mysql.orig/storage/innobase/plug.in	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/innobase/plug.in	2010-09-02 20:43:04.276997427 +0000
@@ -1,8 +1,8 @@
 MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
         [Transactional Tables using InnoDB], [max,max-no-ndb])
 MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
-MYSQL_PLUGIN_STATIC(innobase,   [libinnobase.a])
-MYSQL_PLUGIN_DYNAMIC(innobase,  [ha_innodb.la])
+MYSQL_PLUGIN_STATIC(innobase,   [libinnobase.la])
+MYSQL_PLUGIN_DYNAMIC(innobase,  [ha_innodb.so])
 MYSQL_PLUGIN_ACTIONS(innobase,  [
   AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
   AC_SUBST(innodb_system_libs)
diff -Nuarp --exclude '*.orig' mysql.orig/storage/myisam/Makefile.am mysql/storage/myisam/Makefile.am
--- mysql.orig/storage/myisam/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/myisam/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -20,70 +20,38 @@ MYSQLLIBdir=            $(pkglibdir)
 INCLUDES =              -I$(top_srcdir)/include -I$(top_builddir)/include \
 			-I$(top_srcdir)/regex \
 			-I$(top_srcdir)/sql \
-                        -I$(srcdir)
+			-I$(srcdir)
 WRAPLIBS=
 
-LDADD =
+LDADD =					@CLIENT_EXTRA_LDFLAGS@ libmyisam.la \
+			$(top_builddir)/mysys/libmysys.la \
+			$(top_builddir)/dbug/libdbug.la \
+			$(top_builddir)/strings/libmystrings.la @ZLIB_LIBS@
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
 
 EXTRA_DIST =		mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt plug.in
 pkgdata_DATA =		mi_test_all mi_test_all.res
 
-pkglib_LIBRARIES =	libmyisam.a
+noinst_LTLIBRARIES =	libmyisam.la
 bin_PROGRAMS =		myisamchk myisamlog myisampack myisam_ftdump
-myisamchk_DEPENDENCIES=	$(LIBRARIES)
-myisamchk_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-myisamlog_DEPENDENCIES=	$(LIBRARIES)
-myisamlog_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-myisampack_DEPENDENCIES=$(LIBRARIES)
-myisampack_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
+myisamchk_DEPENDENCIES=	$(LTLIBRARIES)
+myisamlog_DEPENDENCIES=	$(LTLIBRARIES)
+myisampack_DEPENDENCIES=$(LTLIBRARIES)
 noinst_PROGRAMS =	mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
 noinst_HEADERS =	myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \
 			fulltext.h ftdefs.h ft_test1.h ft_eval.h \
 			ha_myisam.h
-mi_test1_DEPENDENCIES=	$(LIBRARIES)
-mi_test1_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-mi_test2_DEPENDENCIES=	$(LIBRARIES)
-mi_test2_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-mi_test3_DEPENDENCIES=	$(LIBRARIES)
-mi_test3_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-#ft_test1_DEPENDENCIES=	$(LIBRARIES)
-#ft_eval_DEPENDENCIES=	$(LIBRARIES)
-myisam_ftdump_DEPENDENCIES=	$(LIBRARIES)
-myisam_ftdump_LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-rt_test_DEPENDENCIES=	$(LIBRARIES)
-rt_test_LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-sp_test_DEPENDENCIES=	$(LIBRARIES)
-sp_test_LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
-			$(top_builddir)/mysys/libmysys.a \
-			$(top_builddir)/dbug/libdbug.a \
-			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libmyisam_a_SOURCES =	mi_open.c mi_extra.c mi_info.c mi_rkey.c \
+mi_test1_DEPENDENCIES=	$(LTLIBRARIES)
+mi_test2_DEPENDENCIES=	$(LTLIBRARIES)
+mi_test3_DEPENDENCIES=	$(LTLIBRARIES)
+#ft_test1_DEPENDENCIES=	$(LTLIBRARIES)
+#ft_eval_DEPENDENCIES=	$(LTLIBRARIES)
+myisam_ftdump_DEPENDENCIES=	$(LTLIBRARIES)
+rt_test_DEPENDENCIES=	$(LTLIBRARIES)
+sp_test_DEPENDENCIES=	$(LTLIBRARIES)
+libmyisam_la_SOURCES =	mi_open.c mi_extra.c mi_info.c mi_rkey.c \
 			mi_rnext.c mi_rnext_same.c \
 			mi_search.c mi_page.c mi_key.c mi_locking.c \
 			mi_rrnd.c mi_scan.c mi_cache.c \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/myisam/plug.in mysql/storage/myisam/plug.in
--- mysql.orig/storage/myisam/plug.in	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/myisam/plug.in	2010-09-02 20:43:04.276997427 +0000
@@ -1,7 +1,5 @@
 MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
         [Traditional non-transactional MySQL tables])
 MYSQL_PLUGIN_DIRECTORY(myisam,  [storage/myisam])
-MYSQL_PLUGIN_STATIC(myisam,     [libmyisam.a])
-MYSQL_PLUGIN_MANDATORY(myisam)  dnl Default
+MYSQL_PLUGIN_STATIC(myisam,     [libmyisam.la])
 MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
-
diff -Nuarp --exclude '*.orig' mysql.orig/storage/myisammrg/Makefile.am mysql/storage/myisammrg/Makefile.am
--- mysql.orig/storage/myisammrg/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/myisammrg/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -20,16 +20,16 @@ MYSQLLIBdir=            $(pkglibdir)
 INCLUDES =              -I$(top_srcdir)/include -I$(top_builddir)/include \
 			-I$(top_srcdir)/regex \
 			-I$(top_srcdir)/sql \
-                        -I$(srcdir)
+			-I$(srcdir)
 WRAPLIBS=
 
 LDADD =
+LDFLAGS = --whole-archive
 
 DEFS =                  @DEFS@
-pkglib_LIBRARIES =	libmyisammrg.a
+noinst_LTLIBRARIES =	libmyisammrg.la
 noinst_HEADERS =	myrg_def.h ha_myisammrg.h
-noinst_LIBRARIES =	libmyisammrg.a
-libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
+libmyisammrg_la_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
 			myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \
 			myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \
 			myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/myisammrg/plug.in mysql/storage/myisammrg/plug.in
--- mysql.orig/storage/myisammrg/plug.in	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/myisammrg/plug.in	2010-09-02 20:43:04.276997427 +0000
@@ -1,6 +1,5 @@
 MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
         [Merge multiple MySQL tables into one])
 MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
-MYSQL_PLUGIN_STATIC(myisammrg,  [libmyisammrg.a])
-MYSQL_PLUGIN_MANDATORY(myisammrg)
+MYSQL_PLUGIN_DYNAMIC(myisammrg,  [libmyisammrg.la])
 MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisammrg, [ha_myisammrg.cc])
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/config/type_ndbapitest.mk.am mysql/storage/ndb/config/type_ndbapitest.mk.am
--- mysql.orig/storage/ndb/config/type_ndbapitest.mk.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/config/type_ndbapitest.mk.am	2010-09-02 20:43:04.276997427 +0000
@@ -15,9 +15,9 @@
 
 LDADD += $(top_builddir)/storage/ndb/test/src/libNDBT.a \
          $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la @NDB_SCI_LIBS@
 
 INCLUDES += -I$(top_srcdir) \
 	-I$(top_builddir)/include \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/config/type_ndbapitools.mk.am mysql/storage/ndb/config/type_ndbapitools.mk.am
--- mysql.orig/storage/ndb/config/type_ndbapitools.mk.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/config/type_ndbapitools.mk.am	2010-09-02 20:43:04.276997427 +0000
@@ -15,9 +15,9 @@
 
 LDADD += \
          $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ @ZLIB_LIBS@
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la @NDB_SCI_LIBS@ @ZLIB_LIBS@
 
 INCLUDES += -I$(srcdir) \
 	-I$(top_builddir)/include \
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/config/win-libraries mysql/storage/ndb/config/win-libraries
--- mysql.orig/storage/ndb/config/win-libraries	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/config/win-libraries	2010-09-02 20:43:04.276997427 +0000
@@ -21,7 +21,7 @@ do
 # the same goes for mysys and strings
   lib=$i
   case $i in
-  *libdbug.a | *libmysys.a | *libmystrings.a) 
+  *libdbug.la | *libmysys.la | *libmystrings.la) 
   lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'`
   echo "Changing from $i to $lib"
   ;;
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/common/util/Makefile.am mysql/storage/ndb/src/common/util/Makefile.am
--- mysql.orig/storage/ndb/src/common/util/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/common/util/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -31,9 +31,9 @@ EXTRA_PROGRAMS = testBitmask
 testBitmask_SOURCES =  testBitmask.cpp
 testBitmask_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 testBitmask.cpp : Bitmask.cpp
 	rm -f testBitmask.cpp
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/cw/cpcd/Makefile.am mysql/storage/ndb/src/cw/cpcd/Makefile.am
--- mysql.orig/storage/ndb/src/cw/cpcd/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/cw/cpcd/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -19,9 +19,9 @@ ndb_cpcd_SOURCES = main.cpp CPCD.cpp Pro
 
 LDADD_LOC = \
             $(top_builddir)/storage/ndb/src/libndbclient.la      \
-            $(top_builddir)/dbug/libdbug.a \
-            $(top_builddir)/mysys/libmysys.a \
-            $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@
+            $(top_builddir)/dbug/libdbug.la \
+            $(top_builddir)/mysys/libmysys.la \
+            $(top_builddir)/strings/libmystrings.la @NDB_SCI_LIBS@
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
 include $(top_srcdir)/storage/ndb/config/type_util.mk.am
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/backup/Makefile.am mysql/storage/ndb/src/kernel/blocks/backup/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/backup/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/backup/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -17,9 +17,9 @@ ndbtools_PROGRAMS = ndb_print_backup_fil
 ndb_print_backup_file_SOURCES = read.cpp
 ndb_print_backup_file_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/strings/libmystrings.la
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
 include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/dbdict/Makefile.am mysql/storage/ndb/src/kernel/blocks/dbdict/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/dbdict/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/dbdict/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -19,17 +19,17 @@ include $(top_srcdir)/storage/ndb/config
 LDADD +=  \
          $(top_builddir)/storage/ndb/src/common/util/libgeneral.la \
          $(top_builddir)/storage/ndb/src/common/portlib/libportlib.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 ndbtools_PROGRAMS = ndb_print_schema_file
 ndb_print_schema_file_SOURCES = printSchemaFile.cpp
 ndb_print_schema_file_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/dbdih/Makefile.am mysql/storage/ndb/src/kernel/blocks/dbdih/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/dbdih/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/dbdih/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -17,9 +17,9 @@ ndbtools_PROGRAMS = ndb_print_sys_file
 ndb_print_sys_file_SOURCES = printSysfile.cpp
 ndb_print_sys_file_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/dblqh/Makefile.am mysql/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/dblqh/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/dblqh/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -23,9 +23,9 @@ include $(top_srcdir)/storage/ndb/config
 
 ndbd_redo_log_reader_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/dbtup/Makefile.am mysql/storage/ndb/src/kernel/blocks/dbtup/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/dbtup/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/dbtup/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -20,9 +20,9 @@ EXTRA_PROGRAMS = test_varpage
 test_varpage_SOURCES = test_varpage.cpp tuppage.cpp
 test_varpage_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-  $(top_builddir)/mysys/libmysys.a \
-  $(top_builddir)/dbug/libdbug.a \
-  $(top_builddir)/strings/libmystrings.a
+  $(top_builddir)/mysys/libmysys.la \
+  $(top_builddir)/dbug/libdbug.la \
+  $(top_builddir)/strings/libmystrings.la
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/blocks/Makefile.am mysql/storage/ndb/src/kernel/blocks/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/blocks/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/blocks/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -57,9 +57,9 @@ EXTRA_PROGRAMS = ndb_print_file
 ndb_print_file_SOURCES = print_file.cpp diskpage.cpp dbtup/tuppage.cpp
 ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
 include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/Makefile.am mysql/storage/ndb/src/kernel/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/Makefile.am	2010-09-02 20:38:44.067672494 +0000
+++ mysql/storage/ndb/src/kernel/Makefile.am	2010-09-02 20:43:04.276997427 +0000
@@ -53,9 +53,9 @@ LDADD +=  \
               $(top_builddir)/storage/ndb/src/mgmapi/libmgmapi.la \
               $(top_builddir)/storage/ndb/src/common/portlib/libportlib.la      \
               $(top_builddir)/storage/ndb/src/common/util/libgeneral.la  \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la @NDB_SCI_LIBS@
 
 windoze-dsp: ndbd.dsp
 
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/kernel/vm/Makefile.am mysql/storage/ndb/src/kernel/vm/Makefile.am
--- mysql.orig/storage/ndb/src/kernel/vm/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/storage/ndb/src/kernel/vm/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -65,24 +65,24 @@ ndbd_malloc_impl_test_CXXFLAGS = -DUNIT_
 ndbd_malloc_impl_test_SOURCES = ndbd_malloc_impl.cpp
 ndbd_malloc_impl_test_LDFLAGS = @ndb_bin_am_ldflags@ \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-  $(top_builddir)/mysys/libmysys.a \
-  $(top_builddir)/dbug/libdbug.a \
-  $(top_builddir)/strings/libmystrings.a
+  $(top_builddir)/mysys/libmysys.la \
+  $(top_builddir)/dbug/libdbug.la \
+  $(top_builddir)/strings/libmystrings.la
 
 bench_pool_SOURCES = bench_pool.cpp
 bench_pool_LDFLAGS = @ndb_bin_am_ldflags@\
   libkernel.a ../error/liberror.a \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-  $(top_builddir)/mysys/libmysys.a \
-  $(top_builddir)/dbug/libdbug.a \
-  $(top_builddir)/strings/libmystrings.a
+  $(top_builddir)/mysys/libmysys.la \
+  $(top_builddir)/dbug/libdbug.la \
+  $(top_builddir)/strings/libmystrings.la
 
 testDynArr256_CXXFLAGS = -DUNIT_TEST
 testDynArr256_SOURCES = DynArr256.cpp
 testDynArr256_LDFLAGS = @ndb_bin_am_ldflags@ \
   libkernel.a ../error/liberror.a \
   $(top_builddir)/storage/ndb/src/libndbclient.la \
-  $(top_builddir)/mysys/libmysys.a \
-  $(top_builddir)/dbug/libdbug.a \
-  $(top_builddir)/strings/libmystrings.a
+  $(top_builddir)/mysys/libmysys.la \
+  $(top_builddir)/dbug/libdbug.la \
+  $(top_builddir)/strings/libmystrings.la
 
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/mgmclient/Makefile.am mysql/storage/ndb/src/mgmclient/Makefile.am
--- mysql.orig/storage/ndb/src/mgmclient/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/storage/ndb/src/mgmclient/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -37,9 +37,9 @@ LDADD_LOC = $(noinst_LTLIBRARIES) \
 	    ../common/portlib/libportlib.la \
             @readline_link@ \
             $(top_builddir)/storage/ndb/src/libndbclient.la \
-            $(top_builddir)/dbug/libdbug.a \
-            $(top_builddir)/mysys/libmysys.a \
-            $(top_builddir)/strings/libmystrings.a \
+            $(top_builddir)/dbug/libdbug.la \
+            $(top_builddir)/mysys/libmysys.la \
+            $(top_builddir)/strings/libmystrings.la \
             @TERMCAP_LIB@ @NDB_SCI_LIBS@
 
 ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/mgmsrv/Makefile.am mysql/storage/ndb/src/mgmsrv/Makefile.am
--- mysql.orig/storage/ndb/src/mgmsrv/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/storage/ndb/src/mgmsrv/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -40,9 +40,9 @@ INCLUDES_LOC = -I$(top_srcdir)/storage/n
 
 LDADD_LOC = $(top_builddir)/storage/ndb/src/mgmclient/CommandInterpreter.lo \
             $(top_builddir)/storage/ndb/src/libndbclient.la \
-            $(top_builddir)/dbug/libdbug.a \
-            $(top_builddir)/mysys/libmysys.a \
-            $(top_builddir)/strings/libmystrings.a \
+            $(top_builddir)/dbug/libdbug.la \
+            $(top_builddir)/mysys/libmysys.la \
+            $(top_builddir)/strings/libmystrings.la \
             @readline_link@ \
             @NDB_SCI_LIBS@ \
 	    @TERMCAP_LIB@
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/src/ndbapi/Makefile.am mysql/storage/ndb/src/ndbapi/Makefile.am
--- mysql.orig/storage/ndb/src/ndbapi/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/storage/ndb/src/ndbapi/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -67,9 +67,9 @@ include $(top_srcdir)/storage/ndb/config
 include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
 
 ndberror_check_LDFLAGS = \
-         $(top_builddir)/dbug/libdbug.a \
-         $(top_builddir)/mysys/libmysys.a \
-         $(top_builddir)/strings/libmystrings.a
+         $(top_builddir)/dbug/libdbug.la \
+         $(top_builddir)/mysys/libmysys.la \
+         $(top_builddir)/strings/libmystrings.la
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%
diff -Nuarp --exclude '*.orig' mysql.orig/storage/ndb/test/run-test/Makefile.am mysql/storage/ndb/test/run-test/Makefile.am
--- mysql.orig/storage/ndb/test/run-test/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/storage/ndb/test/run-test/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -34,9 +34,9 @@ atrt_SOURCES = main.cpp setup.cpp files.
 INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/test/include
 LDADD_LOC = $(top_builddir)/storage/ndb/test/src/libNDBT.a \
 	    $(top_builddir)/storage/ndb/src/libndbclient.la \
-            $(top_builddir)/dbug/libdbug.a \
-            $(top_builddir)/mysys/libmysys.a \
-            $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@
+            $(top_builddir)/dbug/libdbug.la \
+            $(top_builddir)/mysys/libmysys.la \
+            $(top_builddir)/strings/libmystrings.la @NDB_SCI_LIBS@
 
 atrt_CXXFLAGS = -I$(top_srcdir)/ndb/src/mgmapi \
                       -I$(top_srcdir)/ndb/src/mgmsrv \
diff -Nuarp --exclude '*.orig' mysql.orig/strings/Makefile.am mysql/strings/Makefile.am
--- mysql.orig/strings/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/strings/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -16,7 +16,7 @@
 # This file is public domain and comes with NO WARRANTY of any kind
 
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include
-pkglib_LIBRARIES =	libmystrings.a
+pkglib_LTLIBRARIES =	libmystrings.la
 
 # Exact one of ASSEMBLER_X
 if ASSEMBLER_x86
@@ -37,7 +37,7 @@ CSRCS		= strxmov.c bmove_upp.c strappend
 endif
 endif
 
-libmystrings_a_SOURCES = $(ASRCS) $(CSRCS)
+libmystrings_la_SOURCES = $(ASRCS) $(CSRCS)
 noinst_PROGRAMS = conf_to_src
 CLEANFILES = str_test uctypedump test_decimal
 # Default charset definitions
@@ -56,28 +56,27 @@ EXTRA_DIST =		ctype-big5.c ctype-cp932.c
 			t_ctype.h my_strchr.c CMakeLists.txt \
 			CHARSET_INFO.txt
 
-libmystrings_a_LIBADD=
-conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c
-conf_to_src_LDADD=
+libmystrings_la_LIBADD =
+conf_to_src_SOURCES = conf_to_src.c
+conf_to_src_LDADD = libmystrings.la
 #force static linking of conf_to_src - essential when linking against
 #custom installation of libc
-conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
 
 # This is because the dependency tracking misses @FOO@ vars in sources.
 #strtoull.o:		@CHARSET_OBJS@
 
 
-FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
+FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 
-str_test: str_test.c $(pkglib_LIBRARIES)
-	$(LINK) $(FLAGS) -DMAIN $(INCLUDES) $(srcdir)/str_test.c $(LDADD) $(pkglib_LIBRARIES)
+str_test: str_test.c $(pkglib_LTLIBRARIES)
+	$(LINK) $(FLAGS) -DMAIN $(INCLUDES) $(srcdir)/str_test.c $(LDADD) $(pkglib_LTLIBRARIES)
 
 uctypedump: uctypedump.c
 	$(LINK) $(INCLUDES) $(srcdir)/uctypedump.c
 
-test_decimal$(EXEEXT): decimal.c $(pkglib_LIBRARIES)
+test_decimal$(EXEEXT): decimal.c $(pkglib_LTLIBRARIES)
 	$(CP) $(srcdir)/decimal.c ./test_decimal.c
-	$(LINK) $(FLAGS) -DMAIN  ./test_decimal.c $(LDADD) $(pkglib_LIBRARIES)
+	$(LINK) $(FLAGS) -DMAIN  ./test_decimal.c $(LDADD) $(pkglib_LTLIBRARIES)
 	$(RM) -f ./test_decimal.c
 
 # Don't update the files from bitkeeper
diff -Nuarp --exclude '*.orig' mysql.orig/strings/strings-x86.s mysql/strings/strings-x86.s
--- mysql.orig/strings/strings-x86.s	2010-09-02 20:38:44.071005946 +0000
+++ mysql/strings/strings-x86.s	2010-09-02 20:43:04.280330881 +0000
@@ -293,7 +293,7 @@ strinstr:
 	movl	%esp,%ebp
 	pushl	12(%ebp)		#  search
 	pushl	8(%ebp)			#  str
-	call	strstr
+	call	strstr@plt
 	add	$8,%esp
 	or	%eax,%eax
 	jz	si_99			#  Not found, return NULL
diff -Nuarp --exclude '*.orig' mysql.orig/tests/Makefile.am mysql/tests/Makefile.am
--- mysql.orig/tests/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/tests/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -49,11 +49,11 @@ mysql_client_test_SOURCES= mysql_client_
 
 insert_test_SOURCES=       insert_test.c
 select_test_SOURCES=       select_test.c
-insert_test_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
-select_test_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+insert_test_DEPENDENCIES=	$(LTLIBRARIES) $(pkglib_LTLIBRARIES)
+select_test_DEPENDENCIES=	$(LTLIBRARIES) $(pkglib_LTLIBRARIES)
 
 bug25714_SOURCES=          bug25714.c
-bug25714_DEPENDENCIES=     $(LIBRARIES) $(pkglib_LTLIBRARIES)
+bug25714_DEPENDENCIES=     $(LTLIBRARIES) $(pkglib_LTLIBRARIES)
 
 # Fix for mit-threads
 DEFS =			-DMYSQL_CLIENT_NO_THREADS
diff -Nuarp --exclude '*.orig' mysql.orig/unittest/examples/Makefile.am mysql/unittest/examples/Makefile.am
--- mysql.orig/unittest/examples/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/unittest/examples/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -16,9 +16,7 @@
 AM_CPPFLAGS        = -I$(srcdir) -I$(top_builddir)/include \
 		     -I$(top_srcdir)/unittest/mytap -I$(top_srcdir)/include
 
-AM_LDFLAGS         = -L$(top_builddir)/unittest/mytap
-
-LDADD              = -lmytap
+LDADD              = $(top_builddir)/unittest/mytap/libmytap.la
 
 # We omit core-t here, since it will always fail.
 noinst_PROGRAMS    = simple-t skip-t todo-t skip_all-t no_plan-t
diff -Nuarp --exclude '*.orig' mysql.orig/unittest/mysys/Makefile.am mysql/unittest/mysys/Makefile.am
--- mysql.orig/unittest/mysys/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/unittest/mysys/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -16,10 +16,10 @@
 AM_CPPFLAGS      = @ZLIB_INCLUDES@ -I$(top_builddir)/include 
 AM_CPPFLAGS     += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
 
-LDADD 		= $(top_builddir)/unittest/mytap/libmytap.a \
-		  $(top_builddir)/mysys/libmysys.a \
-		  $(top_builddir)/dbug/libdbug.a \
-		  $(top_builddir)/strings/libmystrings.a
+LDADD 		= $(top_builddir)/unittest/mytap/libmytap.la \
+		  $(top_builddir)/mysys/libmysys.la \
+		  $(top_builddir)/dbug/libdbug.la \
+		  $(top_builddir)/strings/libmystrings.la
 
 noinst_PROGRAMS  = bitmap-t base64-t
 
diff -Nuarp --exclude '*.orig' mysql.orig/unittest/mytap/Makefile.am mysql/unittest/mytap/Makefile.am
--- mysql.orig/unittest/mytap/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/unittest/mytap/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -15,10 +15,10 @@
 
 AM_CPPFLAGS  = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
 
-noinst_LIBRARIES   = libmytap.a
+noinst_LTLIBRARIES   = libmytap.la
 noinst_HEADERS     = tap.h
 
-libmytap_a_SOURCES = tap.c
+libmytap_la_SOURCES = tap.c
 
 SUBDIRS            = . t
 
diff -Nuarp --exclude '*.orig' mysql.orig/unittest/mytap/t/Makefile.am mysql/unittest/mytap/t/Makefile.am
--- mysql.orig/unittest/mytap/t/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/unittest/mytap/t/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -15,9 +15,7 @@
 
 AM_CPPFLAGS     = -I$(srcdir) -I$(top_builddir)/include -I$(srcdir)/.. -I$(top_srcdir)/include
 
-AM_LDFLAGS      = -L$(top_builddir)/unittest/mytap
-
-LDADD           = -lmytap
+LDADD           = $(top_builddir)/unittest/mytap/libmytap.la
 
 noinst_PROGRAMS = basic-t
 
diff -Nuarp --exclude '*.orig' mysql.orig/unittest/strings/Makefile.am mysql/unittest/strings/Makefile.am
--- mysql.orig/unittest/strings/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/unittest/strings/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -16,10 +16,10 @@
 AM_CPPFLAGS      = @ZLIB_INCLUDES@ -I$(top_builddir)/include 
 AM_CPPFLAGS     += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
 
-LDADD 		= $(top_builddir)/unittest/mytap/libmytap.a \
-		  $(top_builddir)/mysys/libmysys.a \
-		  $(top_builddir)/dbug/libdbug.a \
-		  $(top_builddir)/strings/libmystrings.a
+LDADD 		= $(top_builddir)/unittest/mytap/libmytap.la \
+		  $(top_builddir)/mysys/libmysys.la \
+		  $(top_builddir)/dbug/libdbug.la \
+		  $(top_builddir)/strings/libmystrings.la
 
 noinst_PROGRAMS  = strings-t
 
diff -Nuarp --exclude '*.orig' mysql.orig/vio/Makefile.am mysql/vio/Makefile.am
--- mysql.orig/vio/Makefile.am	2010-09-02 20:38:44.071005946 +0000
+++ mysql/vio/Makefile.am	2010-09-02 20:43:04.280330881 +0000
@@ -16,11 +16,12 @@
 INCLUDES =		-I$(top_builddir)/include -I$(top_srcdir)/include \
 			$(openssl_includes)
 LDADD =			@CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs)
-pkglib_LIBRARIES =	libvio.a
+pkglib_LTLIBRARIES =	libvio.la
 
 noinst_HEADERS =	vio_priv.h
 
-libvio_a_SOURCES =	vio.c viosocket.c viossl.c viosslfactories.c
+libvio_la_LIBADD = -lssl
+libvio_la_SOURCES =	vio.c viosocket.c viossl.c viosslfactories.c
 
 EXTRA_DIST=		CMakeLists.txt