summaryrefslogtreecommitdiff
blob: 5e463744a739d0bdcdc1d3160ec8434678f2a5d7 (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
diff --git a/Makefile.am b/Makefile.am
index 4fe2ed1..7f3a95f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,21 @@ ACLOCAL_AMFLAGS = -I m4
 
 AUTOMAKE_OPTIONS = gnits
 
-SUBDIRS = plplot ajax nucleus emboss test doc jemboss
+if !ESYSTEMLIBS
+EXTRA_DIRS = plplot
+endif
+
+if GJEMBOSS
+JEMBOSS_DIR = jemboss
+endif
+
+SUBDIRS = $(EXTRA_DIRS) ajax nucleus emboss test doc $(JEMBOSS_DIR)
+DIST_SUBDIRS = $(EXTRA_DIRS) ajax nucleus emboss test doc $(JEMBOSS_DIR)
 
 # AJAX_FIXED_ROOT = \"`pwd`/emboss/acd\"
 
 # files with nonstandard names in this directory
-EXTRA_DIST = COMPAT LICENSE KNOWN_BUGS ONEWS PROBLEMS FAQ ChangeLog depcomp ltmain.sh
+EXTRA_DIST = COMPAT KNOWN_BUGS ONEWS PROBLEMS FAQ ChangeLog depcomp ltmain.sh
 
 # tar to pick up the other directories
 # then remove any CVS subdirectories
diff --git a/README.fixes b/README.fixes
new file mode 100644
index 0000000..3c56d79
--- /dev/null
+++ b/README.fixes
@@ -0,0 +1,9 @@
+The files in this directory are bugfix replacements for files in
+the EMBOSS-6.3.1 distribution. Just drop the replacement files in
+the location shown and redo the 'make install.'
+
+Fix 1. EMBOSS-6.3.1/configure
+       EMBOSS-6.3.1/m4/mysql.m4
+
+21 Jul 2010: Addresses a problem whereby, in some circumstances, inclusion of
+             hpdf support prevented inclusion of MySQL support.
diff --git a/ajax/Makefile.am b/ajax/Makefile.am
index 4a44f6f..cf27ff8 100644
--- a/ajax/Makefile.am
+++ b/ajax/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 if !ESYSTEMLIBS
-EXTRA_DIRS = expat zlib
+EXTRA_DIRS = pcre expat zlib
 endif
 
-SUBDIRS = pcre $(EXTRA_DIRS) core graphics ensembl ajaxdb acd
+SUBDIRS = $(EXTRA_DIRS) core graphics ensembl ajaxdb acd
diff --git a/ajax/acd/Makefile.am b/ajax/acd/Makefile.am
index 02bcaa7..368ddfe 100644
--- a/ajax/acd/Makefile.am
+++ b/ajax/acd/Makefile.am
@@ -13,10 +13,13 @@ CYGWIN_LDACD = -L../../plplot -L../pcre -L../expat -L../zlib -L../core \
 endif
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre
+else
+EXTRA_INCLUDES = $(PLPLOT_CFLAGS)
 endif
 
-INCLUDES = -I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre \
+INCLUDES =  \
 $(EXTRA_INCLUDES) \
 -I$(top_srcdir)/ajax/core \
 -I$(top_srcdir)/ajax/graphics \
@@ -38,3 +41,4 @@ LINKFLAGS = $(VERS_INF)
 endif
 
 libacd_la_LDFLAGS = $(LINKFLAGS)
+libacd_la_LIBADD = ../core/libajax.la ../graphics/libajaxg.la ../ajaxdb/libajaxdb.la
diff --git a/ajax/ajaxdb/Makefile.am b/ajax/ajaxdb/Makefile.am
index da57727..857ca5f 100644
--- a/ajax/ajaxdb/Makefile.am
+++ b/ajax/ajaxdb/Makefile.am
@@ -13,11 +13,12 @@ CYGWIN_LDAJAXDB = -L../../plplot -L../pcre -L../expat -L../zlib -L../core \
 endif
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre
 endif
 
 
-INCLUDES = -I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre \
+INCLUDES = \
 $(EXTRA_INCLUDES) \
 -I$(top_srcdir)/ajax/core -I$(top_srcdir)/ajax/ensembl
 
@@ -37,3 +38,4 @@ LINKFLAGS = $(VERS_INF)
 endif
 
 libajaxdb_la_LDFLAGS = $(LINKFLAGS)
+libajaxdb_la_LIBADD = ../core/libajax.la ../ensembl/libensembl.la
diff --git a/ajax/core/Makefile.am b/ajax/core/Makefile.am
index af27cb0..8fa4a3a 100644
--- a/ajax/core/Makefile.am
+++ b/ajax/core/Makefile.am
@@ -12,13 +12,18 @@ CYGWIN_LDAJAX = -L../../plplot -L../expat -L../pcre -L../zlib \
 endif
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre 
+else
+EXTRA_LIBS = -lexpat -lpcre
 endif
 
+EXTRA_DIST = ajax-pcre-config.h.in
+DISTCLEAN = ajax-pcre-config.h
 
 INCLUDES = -DAJAX_FIXED_ROOT=$(AJAX_FIXED_ROOT) \
 -DAJAX_SYSTEM="$(AJAX_SYSTEM)" -DPREFIX=\"$(prefix)\" \
--I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre $(EXTRA_INCLUDES)
+$(EXTRA_INCLUDES) $(POSTGRESQL_CFLAGS) $(MYSQL_CFLAGS)
 
 AJAXSRC = ajalign.c ajarr.c ajassert.c \
 ajbase.c ajcall.c ajcod.c \
@@ -44,7 +49,7 @@ ajindex.h ajjava.h ajlist.h \
 ajmath.h ajmatrices.h ajmem.h ajmess.h \
 ajnam.h ajnexus.h ajobo.h \
 ajpat.h ajpdb.h ajpdbio.h ajphylo.h \
-ajrange.h ajreg.h ajreport.h ajresource.h \
+ajrange.h ajreg.h ajax-pcre-config.h ajreport.h ajresource.h \
 ajseq.h ajseqabi.h ajseqbam.h ajseqdata.h ajseqread.h ajseqtype.h ajseqwrite.h \
 ajsort.h ajsql.h ajstr.h ajsys.h \
 ajtable.h ajtax.h ajtime.h ajtranslate.h ajtree.h ajutil.h ajvector.h
@@ -61,3 +66,4 @@ LINKFLAGS = $(VERS_INF)
 endif
 
 libajax_la_LDFLAGS = $(LINKFLAGS)
+libajax_la_LIBADD = $(EXTRA_LIBS) $(POSTGRESQL_LDFLAGS) $(MYSQL_LDFLAGS)
diff --git a/ajax/core/ajax-pcre-config.h.in b/ajax/core/ajax-pcre-config.h.in
new file mode 100644
index 0000000..b09e4e6
--- /dev/null
+++ b/ajax/core/ajax-pcre-config.h.in
@@ -0,0 +1 @@
+@DEFINE_USE_SYSTEM_PCRE@ AJAX_USE_SYSTEM_PCRE
diff --git a/ajax/core/ajreg.h b/ajax/core/ajreg.h
index 06793be..659f462 100644
--- a/ajax/core/ajreg.h
+++ b/ajax/core/ajreg.h
@@ -16,9 +16,14 @@ extern "C"
 #define ajreg_h
 
 #include "ajax.h"
+#include "ajax-pcre-config.h"
+#ifndef AJAX_USE_SYSTEM_PCRE
 #include "pcre_config.h"
 #include "pcre_internal.h"
 #include "pcreposix.h"
+#else
+#include <pcre.h>
+#endif
 
 #define AJREG_OVECSIZE 30
 
@@ -41,7 +46,11 @@ extern "C"
 ******************************************************************************/
 
 typedef struct AjSRegexp {
+#ifndef AJAX_USE_SYSTEM_PCRE
     real_pcre *pcre;
+#else
+    pcre *pcre;
+#endif
     pcre_extra *extra;
     int *ovector;
     const char* orig;
diff --git a/ajax/ensembl/Makefile.am b/ajax/ensembl/Makefile.am
index ca33a84..87e51bd 100644
--- a/ajax/ensembl/Makefile.am
+++ b/ajax/ensembl/Makefile.am
@@ -10,12 +10,13 @@ CYGWIN_LDENSEMBL = -L../../plplot -L../expat -L../pcre -L../core -lajax -leplplo
 endif
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre 
 endif
 
 
-INCLUDES = -I$(top_srcdir)/plplot $(EXTRA_INCLUDES) \
--I$(top_srcdir)/ajax/pcre -I$(top_srcdir)/ajax/core
+INCLUDES = $(EXTRA_INCLUDES) \
+-I$(top_srcdir)/ajax/core
 
 ENSEMBLSRC = ensanalysis.c ensassembly.c ensassemblyexception.c \
 ensassemblymapper.c ensattribute.c ensbaseadaptor.c enscache.c \
@@ -56,3 +57,4 @@ LINKFLAGS = $(VERS_INF)
 endif
 
 libensembl_la_LDFLAGS = $(LINKFLAGS)
+libensembl_la_LIBADD = ../core/libajax.la
diff --git a/ajax/graphics/Makefile.am b/ajax/graphics/Makefile.am
index ab45afc..f61c605 100644
--- a/ajax/graphics/Makefile.am
+++ b/ajax/graphics/Makefile.am
@@ -10,11 +10,15 @@ CYGWIN_LDAJAXG = -L../../plplot -L../expat -L../pcre -L../core -lajax -leplplot
 endif
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre
+else
+EXTRA_INCLUDES = $(PLPLOT_CFLAGS) -DUSE_PLXSFNAM_SHIM
+EXTRA_LIBS = $(PLPLOT_LIBS)
 endif
 
 
-INCLUDES = -I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre \
+INCLUDES = \
 $(EXTRA_INCLUDES) -I$(top_srcdir)/ajax/core
 
 AJAXGSRC = ajgraph.c ajhist.c
@@ -32,3 +36,4 @@ LINKFLAGS = $(VERS_INF)
 endif
 
 libajaxg_la_LDFLAGS = $(LINKFLAGS)
+libajaxg_la_LIBADD = ../core/libajax.la $(EXTRA_LIBS)
diff --git a/ajax/graphics/ajgraph.c b/ajax/graphics/ajgraph.c
index 25e75e4..60f2743 100644
--- a/ajax/graphics/ajgraph.c
+++ b/ajax/graphics/ajgraph.c
@@ -34,10 +34,8 @@
 #include <float.h>
 #define AZ 28
 
-
 #include "plplotP.h"
 
-
 static void     GraphArray(ajuint numofpoints,
 			   float *x, float *y);
 static void     GraphArrayGaps(ajuint numofpoints,
@@ -1049,13 +1047,26 @@ static void GraphDefCharSize(float size)
 ** @@
 ******************************************************************************/
 
+#define _GNU_SOURCE
+#include <stdio.h>
+
 static void GraphSetName(const AjPGraph thys,
 			 const AjPStr txt, const char *ext)
 {
     if(!thys->ready)
     {
+#ifdef USE_PLXSFNAM_SHIM
+        char *fullname;
+#endif
         ajDebug("=g= plxsfnam ('%S', '%s')\n", txt, ext);
+#ifdef USE_PLXSFNAM_SHIM
+        fullname = asprintf(fullname,"%s%s", ajStrGetPtr(txt), ext);
+        ajDebug("=g= plsfnam ('%S') instead\n", fullname);
+        plsfnam(fullname);
+        free(fullname);
+#else
         plxsfnam(ajStrGetPtr(txt), ext);
+#endif
         ajStrAssignS(&graphBasename, txt);
         ajStrAssignC(&graphExtension, ext);
         if(ajStrGetCharFirst(graphExtension) == '.')
diff --git a/configure.in b/configure.in
index ddb4f81..3f4fe5e 100644
--- a/configure.in
+++ b/configure.in
@@ -235,15 +235,6 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 
-dnl Intel MacOSX 10.6 puts X11 in a non-standard place
-if test "${with_x}" != "no" ; then
-if test "`uname -a | grep Darwin`"; then
-OSXX=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
-if test ${OSXX} '>' '10.4'; then
-CFLAGS="$CFLAGS -I/usr/X11/include -L/usr/X11/lib"
-fi
-fi
-fi
 
 # Checks for header files.
 #as# AC_PATH_X
@@ -292,9 +283,6 @@ AC_CHECK_FUNCS(memmove)
 #as# 		select socket sqrt strchr strcspn strdup strerror strpbrk \
 #as# 		strrchr strspn strstr strtol])
 
-if test "${with_x}" != "no" ; then
-LF_EMBOSS_PATH_XLIB
-fi
 
 dnl Library checks
 AC_CHECK_LIB(c, socket, LIBS="$LIBS" , LIBS="$LIBS -lsocket")
@@ -316,14 +304,16 @@ CHECK_PNGDRIVER
 CHECK_AUTH
 CHECK_AMD64
 
+AM_CONDITIONAL(GJEMBOSS, test "$JAVA_OK" = "yes")
+
 AX_LIB_MYSQL
 AX_LIB_POSTGRESQL
 
 CFLAGS="$CFLAGS $MYSQL_CFLAGS"
 LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
 
-CFLAGS="$CFLAGS $POSTGRESQL_CFLAGS"
-LDFLAGS="$LDFLAGS $POSTGRESQL_LDFLAGS"
+CFLAGS="$POSTGRESQL_CFLAGS $CFLAGS"
+LDFLAGS="$POSTGRESQL_LDFLAGS $LDFLAGS"
 
 
 dnl Check for 'ant' for packaging Jemboss and export result
@@ -443,13 +433,36 @@ fi
 
 dnl Test if --enable-systemlibs given
 have_systemlibs=no
+DEFINE_USE_SYSTEM_PCRE="#undef"
 AC_ARG_ENABLE(systemlibs,
    AS_HELP_STRING([--enable-systemlibs], [utility for RPM/dpkg bundles]))
+AC_MSG_CHECKING(for systemlib usage)
 if test "${enable_systemlibs}" = "yes" ; then
     have_systemlibs=yes
+    DEFINE_USE_SYSTEM_PCRE="#define"
+    PKG_CHECK_MODULES([PLPLOT], [plplotd])
+    PKG_CHECK_MODULES([ZLIB], [zlib])
+else
+    dnl X11 is only used by plplot
+    dnl Intel MacOSX 10.6 puts X11 in a non-standard place
+    if test "${with_x}" != "no" ; then
+    if test "`uname -a | grep Darwin`"; then
+    OSXX=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
+    if test ${OSXX} '>' '10.4'; then
+    CFLAGS="$CFLAGS -I/usr/X11/include -L/usr/X11/lib"
+    fi
+    fi
+    fi
+    if test "${with_x}" != "no" ; then
+    LF_EMBOSS_PATH_XLIB
+    fi
+     AC_MSG_NOTICE(USING bundled LIBS)
 fi          
 AM_CONDITIONAL(ESYSTEMLIBS, test "$have_systemlibs" = "yes")
 AC_SUBST(ESYSTEMLIBS)
+AC_SUBST(DEFINE_USE_SYSTEM_PCRE)
+AC_SUBST(PLPLOT_CFLAGS)
+AC_SUBST(PLPLOT_LIBS)
 
 
 
@@ -457,7 +470,6 @@ AC_SUBST(ESYSTEMLIBS)
 
 dnl Test if purify exists and if --enable-purify given if so
 dnl set "-g"
-
 AC_MSG_CHECKING(for purify)
 dnl if(purify -version) < /dev/null > /dev/null 2>&1; then
    AC_ARG_ENABLE(purify,
@@ -683,6 +695,7 @@ CHECK_THREADS
 
 
 AC_OUTPUT([plplot/Makefile plplot/lib/Makefile nucleus/Makefile ajax/Makefile
+ajax/core/ajax-pcre-config.h
 ajax/pcre/Makefile ajax/expat/Makefile ajax/zlib/Makefile ajax/core/Makefile
 ajax/graphics/Makefile ajax/ensembl/Makefile ajax/ajaxdb/Makefile
 ajax/acd/Makefile
diff --git a/emboss/Makefile.am b/emboss/Makefile.am
index 0820517..a0257b2 100644
--- a/emboss/Makefile.am
+++ b/emboss/Makefile.am
@@ -79,14 +79,17 @@ wordcount wordfinder wordmatch wossname \
 yank
 
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre
+else
+EXTRA_INCLUDES = $(PLPLOT_CFLAGS)
 endif
 
-INCLUDES = -I$(top_srcdir)/nucleus -I$(top_srcdir)/ajax/pcre \
+INCLUDES = -I$(top_srcdir)/nucleus \
 	$(EXTRA_INCLUDES) \
 	-I$(top_srcdir)/ajax/core -I$(top_srcdir)/ajax/graphics \
 	-I$(top_srcdir)/ajax/ensembl -I$(top_srcdir)/ajax/ajaxdb \
-	-I$(top_srcdir)/ajax/acd -I$(top_srcdir)/plplot
+	-I$(top_srcdir)/ajax/acd
 
 
 aaindexextract_SOURCES = aaindexextract.c
@@ -319,7 +322,7 @@ testplot_SOURCES = testplot.c
 treetypedisplay_SOURCES = treetypedisplay.c
 
 if !ESYSTEMLIBS
-EXTRA_LDS = ../ajax/zlib/libezlib.la ../ajax/expat/libeexpat.la
+EXTRA_LDS = ../ajax/zlib/libezlib.la ../ajax/expat/libeexpat.la ../plplot/libeplplot.la ../ajax/pcre/libepcre.la
 endif
 
 
@@ -327,7 +330,6 @@ LDADD = ../nucleus/libnucleus.la ../ajax/acd/libacd.la \
 	../ajax/ajaxdb/libajaxdb.la ../ajax/ensembl/libensembl.la \
 	../ajax/graphics/libajaxg.la ../ajax/core/libajax.la \
 	$(EXTRA_LDS) \
-	../ajax/pcre/libepcre.la ../plplot/libeplplot.la \
 	$(XLIB)
 
 pkgdata_DATA = emboss.default.template
diff --git a/m4/mysql.m4 b/m4/mysql.m4
index fe413af..ebea25c 100644
--- a/m4/mysql.m4
+++ b/m4/mysql.m4
@@ -1,4 +1,6 @@
-##### http://autoconf-archive.cryp.to/ax_lib_mysql.html
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_lib_mysql.html
+# ===========================================================================
 #
 # SYNOPSIS
 #
@@ -6,19 +8,18 @@
 #
 # DESCRIPTION
 #
-#   This macro provides tests of availability of MySQL client library
-#   of particular version or newer.
+#   This macro provides tests of availability of MySQL client library of
+#   particular version or newer.
 #
-#   AX_LIB_MYSQL macro takes only one argument which is optional. If
-#   there is no required version passed, then macro does not run
-#   version test.
+#   AX_LIB_MYSQL macro takes only one argument which is optional. If there
+#   is no required version passed, then macro does not run version test.
 #
 #   The --with-mysql option takes one of three possible values:
 #
 #   no - do not check for MySQL client library
 #
-#   yes - do check for MySQL library in standard locations
-#   (mysql_config should be in the PATH)
+#   yes - do check for MySQL library in standard locations (mysql_config
+#   should be in the PATH)
 #
 #   path - complete path to mysql_config utility, use this option if
 #   mysql_config can't be found in the PATH
@@ -33,27 +34,23 @@
 #
 #     HAVE_MYSQL
 #
-# LAST MODIFICATION
+# LICENSE
 #
-#   2006-07-16
-#   2007-01-09 MS: mysql_config --cflags may set gcc -fomit-frame-pointers,
-#                  which prevents gdb from displaying stack traces.
-#                  Changed mysql_config --cflags to mysql_config --include
+#   Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
 #
-# COPYLEFT
-#
-#   Copyright (c) 2006 Mateusz Loskot <mateusz@loskot.net>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 12
 
 AC_DEFUN([AX_LIB_MYSQL],
 [
     AC_ARG_WITH([mysql],
-        [AS_HELP_STRING([--with-mysql=@<:@ARG@:>@],
+        AS_HELP_STRING([--with-mysql=@<:@ARG@:>@],
             [use MySQL client library @<:@default=yes@:>@, optionally specify path to mysql_config]
-        )],
+        ),
         [
         if test "$withval" = "no"; then
             want_mysql="no"
@@ -66,19 +63,20 @@ AC_DEFUN([AX_LIB_MYSQL],
         ],
         [want_mysql="yes"]
     )
+    AC_ARG_VAR([MYSQL_CONFIG], [Full path to mysql_config program])
 
     MYSQL_CFLAGS=""
     MYSQL_LDFLAGS=""
     MYSQL_VERSION=""
 
     dnl
-    dnl Check MySQL libraries (libpq)
+    dnl Check MySQL libraries
     dnl
 
     if test "$want_mysql" = "yes"; then
 
-        if test -z "$MYSQL_CONFIG" -o test; then
-            AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], [no])
+        if test -z "$MYSQL_CONFIG" ; then
+            AC_PATH_PROGS([MYSQL_CONFIG], [mysql_config mysql_config5], [no])
         fi
 
         if test "$MYSQL_CONFIG" != "no"; then
@@ -90,35 +88,8 @@ dnl         MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
 
             MYSQL_VERSION=`$MYSQL_CONFIG --version`
 
-dnl It isn't enough to just test for mysql_config as Fedora
-dnl provides it in the mysql RPM even though mysql-devel may
-dnl not be installed
-
-    	    EMBCFLAGS=$CFLAGS
-	    EMBLDFLAGS=$LDFLAGS
-	    CFLAGS=$MYSQL_CFLAGS
-	    LDFLAGS=$MYSQL_LDFLAGS
-
-            AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
-                                              #include "mysql.h"]],
-					    [[mysql_info(NULL)]])],
-			   [havemysql=yes],
-			   [havemysql=no])
-
-	    CFLAGS=$EMBCFLAGS
-	    LDFLAGS=$EMBLDFLAGS
-
-            if test "$havemysql" = yes; then
-                AC_DEFINE([HAVE_MYSQL], [1],
-                    [Define to 1 if MySQL libraries are available])
-                found_mysql="yes"
-                AC_MSG_RESULT([yes])
-            else
-	        MYSQL_CFLAGS=""
-	        MYSQL_LDFLAGS=""
-                found_mysql="no"
-                AC_MSG_RESULT([no])
-            fi
+            found_mysql="yes"
+            AC_MSG_RESULT([yes])
         else
             found_mysql="no"
             AC_MSG_RESULT([no])
@@ -170,6 +141,11 @@ dnl not be installed
         fi
     fi
 
+    if test "$found_mysql" = "yes" ; then
+        AC_DEFINE([HAVE_MYSQL], [1],
+                  [Define to 1 if MySQL libraries are available])
+    fi
+
     AC_SUBST([MYSQL_VERSION])
     AC_SUBST([MYSQL_CFLAGS])
     AC_SUBST([MYSQL_LDFLAGS])
diff --git a/nucleus/Makefile.am b/nucleus/Makefile.am
index c244786..ff301b9 100644
--- a/nucleus/Makefile.am
+++ b/nucleus/Makefile.am
@@ -19,13 +19,16 @@ CYGWIN_LIBS = -L../plplot -L../ajax/pcre -L../ajax/expat -L../ajax/zlib \
 -lezlib -leplplot
 else
 if !ESYSTEMLIBS
-EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib
+EXTRA_INCLUDES = -I$(top_srcdir)/ajax/expat -I$(top_srcdir)/ajax/zlib \
+-I$(top_srcdir)/plplot -I$(top_srcdir)/ajax/pcre
+else
+EXTRA_INCLUDES = $(PLPLOT_CFLAGS)
 endif
 endif
 
 
-INCLUDES = -I$(top_srcdir)/plplot $(X_CFLAGS) -I$(srcdir)/ \
-	-I$(top_srcdir)/ajax -I$(top_srcdir)/ajax/pcre \
+INCLUDES = $(X_CFLAGS) -I$(srcdir)/ \
+	-I$(top_srcdir)/ajax \
 	$(EXTRA_INCLUDES) \
 	-I$(top_srcdir)/ajax/core -I$(top_srcdir)/ajax/graphics \
 	-I$(top_srcdir)/ajax/ensembl -I$(top_srcdir)/ajax/ajaxdb \
@@ -55,3 +58,4 @@ LINKFLAGS =  $(VERS_INF)
 endif
 
 libnucleus_la_LDFLAGS =  $(LINKFLAGS)
+libnucleus_la_LIBADD = ../ajax/core/libajax.la ../ajax/graphics/libajaxg.la ../ajax/acd/libacd.la