Index: /anuga_work/development/anugavis/Makefile.am
===================================================================
--- /anuga_work/development/anugavis/Makefile.am	(revision 5254)
+++ /anuga_work/development/anugavis/Makefile.am	(revision 5255)
@@ -1,2 +1,3 @@
+## Process this file with automake to generate Makefile.in
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = m4 src
Index: /anuga_work/development/anugavis/configure.ac
===================================================================
--- /anuga_work/development/anugavis/configure.ac	(revision 5254)
+++ /anuga_work/development/anugavis/configure.ac	(revision 5255)
@@ -10,6 +10,4 @@
 # Checks for programs.
 AC_PROG_CC
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
 
 # Checks for libraries.
Index: /anuga_work/development/anugavis/m4/Makefile.am
===================================================================
--- /anuga_work/development/anugavis/m4/Makefile.am	(revision 5254)
+++ /anuga_work/development/anugavis/m4/Makefile.am	(revision 5255)
@@ -1,2 +1,3 @@
+## Process this file with automake to generate Makefile.in
 EXTRA_DIST = acx_pthread.m4 \
              ax_check_gl.m4 \
Index: /anuga_work/development/anugavis/src/Makefile.am
===================================================================
--- /anuga_work/development/anugavis/src/Makefile.am	(revision 5254)
+++ /anuga_work/development/anugavis/src/Makefile.am	(revision 5255)
@@ -1,1 +1,17 @@
-SUBDIRS = libanugavis anugavis_simple
+## Process this file with automake to generate Makefile.in
+
+# Convenience library for the core visualiser code.
+noinst_LIBRARIES = libanugavis.a
+libanugavis_a_SOURCES = anugavis.h \
+                        error.c \
+                        error.h \
+                        globals.c \
+                        globals.h \
+                        height_quantity.c \
+                        height_quantity.h \
+                        init.c
+
+bin_PROGRAMS = anugavis_simple
+anugavis_simple_SOURCES = anugavis_simple.c
+anugavis_simple_CFLAGS = @SDL_CFLAGS@ @GLU_CFLAGS@
+anugavis_simple_LDADD = @SDL_LIBS@ @GLU_LIBS@
Index: /anuga_work/development/anugavis/src/anugavis.h
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.h	(revision 5255)
+++ /anuga_work/development/anugavis/src/anugavis.h	(revision 5255)
@@ -0,0 +1,25 @@
+#ifndef ANUGAVIS_H
+#define ANUGAVIS_H
+
+/* Start and stop the visualiser. AnugaVis_Init() returns -1 on
+ * error. To get detailed error information, use AnugaVis_GetError().
+ */
+extern int AnugaVis_Init(int width, int height, const char *swwFilePath);
+extern void AnugaVis_DeInit(void);
+
+/* Define (or redefine if already defined a simple height quantity with the 
+ * given offset, scale, and color. Returns 0 on success, -1 on error.
+ */
+extern int AnugaVis_DefineHeightQuantity(const char *name,
+					 double offset, double scale,
+					 int red, int green, int blue);
+/* Undefine a given simple height quantity.
+ */
+extern void AnugaVis_UndefineHeightQuantity(char *name);
+
+/* Get detailed error information. The returned string should not be
+ * freed by the caller.
+ */
+extern char* AnugaVis_GetError(void);
+
+#endif
Index: /anuga_work/development/anugavis/src/anugavis_simple.c
===================================================================
--- /anuga_work/development/anugavis/src/anugavis_simple.c	(revision 5255)
+++ /anuga_work/development/anugavis/src/anugavis_simple.c	(revision 5255)
@@ -0,0 +1,24 @@
+#include <anugavis.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[]){
+  if(argc != 2){
+    printf("Usage: anugavis_simple sww_file_name\n");
+    return 1;
+  }
+  if(AnugaVis_Init(640, 480, argv[1]) == -1){
+    printf("AnugaVis_Init() Error: %s\n", AnugaVis_GetError());
+    return 1;
+  }
+  if(AnugaVis_DefineHeightQuantity("elevation", 0, 1, 128, 128, 128) == -1){
+    printf("AnugaVis_DefineHeightQuantity() Error: %s\n", AnugaVis_GetError());
+    return 1;
+  }
+  if(AnugaVis_DefineHeightQuantity("stage", 0, 1, 0, 0, 128) == -1){
+    printf("AnugaVis_DefineHeightQuantity() Error: %s\n", AnugaVis_GetError());
+    return 1;
+  }
+
+  AnugaVis_DeInit();
+  return 0;
+}
Index: uga_work/development/anugavis/src/anugavis_simple/anugavis_simple.c
===================================================================
--- /anuga_work/development/anugavis/src/anugavis_simple/anugavis_simple.c	(revision 5254)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#include <anugavis.h>
-#include <stdio.h>
-
-int main(int argc, char *argv[]){
-  if(argc != 2){
-    printf("Usage: anugavis_simple sww_file_name\n");
-    return 1;
-  }
-  if(AnugaVis_Init(640, 480, argv[1]) == -1){
-    printf("AnugaVis_Init() Error: %s\n", AnugaVis_GetError());
-    return 1;
-  }
-  if(AnugaVis_DefineHeightQuantity("elevation", 0, 1, 128, 128, 128) == -1){
-    printf("AnugaVis_DefineHeightQuantity() Error: %s\n", AnugaVis_GetError());
-    return 1;
-  }
-  if(AnugaVis_DefineHeightQuantity("stage", 0, 1, 0, 0, 128) == -1){
-    printf("AnugaVis_DefineHeightQuantity() Error: %s\n", AnugaVis_GetError());
-    return 1;
-  }
-
-  AnugaVis_DeInit();
-  return 0;
-}
Index: /anuga_work/development/anugavis/src/error.c
===================================================================
--- /anuga_work/development/anugavis/src/error.c	(revision 5255)
+++ /anuga_work/development/anugavis/src/error.c	(revision 5255)
@@ -0,0 +1,29 @@
+#include <stdarg.h>
+#include <netcdf.h>
+#include <SDL.h>
+#include "anugavis.h"
+#include "error.h"
+
+#define MAX_ERROR_LEN 100
+
+static char error[MAX_ERROR_LEN];
+
+char* AnugaVis_GetError(void){
+  return error;
+}
+
+void AnugaVis_SetError(const char *format, ...){
+  va_list args;
+  va_start(args, format);
+  vsnprintf(error, MAX_ERROR_LEN, format, args);
+  va_end(args);
+}
+
+void AnugaVis_SDLError(void){
+  AnugaVis_SetError("SDL Error: %s", SDL_GetError());
+  SDL_ClearError();
+}
+
+void AnugaVis_NetCDFError(int ncerr){
+  AnugaVis_SetError("NetCDF Error: %s", nc_strerror(ncerr));
+}
Index: /anuga_work/development/anugavis/src/error.h
===================================================================
--- /anuga_work/development/anugavis/src/error.h	(revision 5255)
+++ /anuga_work/development/anugavis/src/error.h	(revision 5255)
@@ -0,0 +1,16 @@
+#ifndef ANUGAVIS_ERROR_H
+#define ANUGAVIS_ERROR_H
+
+/* Set the error message with a printf-style format string.
+ */
+void AnugaVis_SetError(const char *format, ...);
+
+/* Report a SDL error.
+ */
+void AnugaVis_SDLError(void);
+
+/* Report a NetCDF error.
+ */
+void AnugaVis_NetCDFError(int ncerr);
+
+#endif
Index: /anuga_work/development/anugavis/src/globals.c
===================================================================
--- /anuga_work/development/anugavis/src/globals.c	(revision 5255)
+++ /anuga_work/development/anugavis/src/globals.c	(revision 5255)
@@ -0,0 +1,4 @@
+#include <SDL.h>
+#include "globals.h"
+
+ANUGAVIS anugavis;
Index: /anuga_work/development/anugavis/src/globals.h
===================================================================
--- /anuga_work/development/anugavis/src/globals.h	(revision 5255)
+++ /anuga_work/development/anugavis/src/globals.h	(revision 5255)
@@ -0,0 +1,15 @@
+#ifndef GLOBALS_H
+#define GLOBALS_H
+
+#include <SDL.h>
+#include "height_quantity.h"
+
+typedef struct{
+  SDL_Surface *screen;
+  int netcdfId;
+  struct height_quantity_simple *heights;
+} ANUGAVIS;
+
+extern ANUGAVIS anugavis;
+
+#endif
Index: /anuga_work/development/anugavis/src/height_quantity.c
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.c	(revision 5255)
+++ /anuga_work/development/anugavis/src/height_quantity.c	(revision 5255)
@@ -0,0 +1,68 @@
+#include <stdlib.h>
+#include <string.h>
+#include <netcdf.h>
+#include <SDL.h>
+#include "anugavis.h"
+#include "error.h"
+#include "globals.h"
+#include "height_quantity.h"
+
+int AnugaVis_DefineHeightQuantity(const char *name,
+				  double offset, double scale,
+				  int red, int green, int blue){
+  struct height_quantity_simple *height;
+  int ncstatus;
+  int ncvarid;
+  int numdims;
+  /* Check that it's actually in the NetCDF file */
+  if((ncstatus = nc_inq_varid(anugavis.netcdfId, name, &ncvarid)) != NC_NOERR){
+    AnugaVis_NetCDFError(ncstatus);
+    return -1;
+  }     
+
+  /* Redefining a quantity? */
+  for(height = anugavis.heights ; height != NULL ; height = height->next)
+    if(!strcmp(name, height->name)) break;
+
+  if(height == NULL){ /* Make a new entry. */
+    if((height = malloc(sizeof(struct height_quantity_simple))) == NULL){
+      AnugaVis_SetError("Failed to malloc %d bytes in "
+			"AnugaVis_DefineHeightQuantity()",
+			sizeof(struct height_quantity_simple));
+      return -1;
+    }
+    height->next = anugavis.heights;
+    anugavis.heights = height;
+  }
+  
+  /* If the NetCDF variable is 2-dimensional, then it's dynamic. */
+  if((ncstatus = nc_inq_varndims(anugavis.netcdfId,
+				 ncvarid, &numdims)) != NC_NOERR){
+    AnugaVis_NetCDFError(ncstatus);
+    return -1;
+  }
+  height->dynamic = (numdims == 2);
+  height->offset = offset;
+  height->scale = scale;
+  height->color = SDL_MapRGB(anugavis.screen->format, red, green, blue);
+  return 0;
+}
+
+void AnugaVis_UndefineHeightQuantity(char *name){
+  struct height_quantity_simple *height = anugavis.heights;
+  struct height_quantity_simple *nextHeight;
+  if(height == NULL) return;
+  if(!strcmp(name, height->name)){
+    anugavis.heights = height->next;
+    free(height);
+    return;
+  }
+  for(; height != NULL ; height = height->next)
+    if(height->next == NULL) return;
+    if(!strcmp(name, height->next->name)){
+      nextHeight = height->next;
+      height->next = height->next->next;
+      free(nextHeight);
+      return;
+    }
+}
Index: /anuga_work/development/anugavis/src/height_quantity.h
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.h	(revision 5255)
+++ /anuga_work/development/anugavis/src/height_quantity.h	(revision 5255)
@@ -0,0 +1,15 @@
+#ifndef HEIGHT_QUANTITY_H
+#define HEIGHT_QUANTITY_H
+
+#include <SDL.h>
+
+struct height_quantity_simple{
+  char *name;
+  uint8_t dynamic;
+  double offset;
+  double scale;
+  Uint32 color;
+  struct height_quantity_simple *next;
+};
+
+#endif
Index: /anuga_work/development/anugavis/src/init.c
===================================================================
--- /anuga_work/development/anugavis/src/init.c	(revision 5255)
+++ /anuga_work/development/anugavis/src/init.c	(revision 5255)
@@ -0,0 +1,58 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef HAVE_GL_GL_H
+#  include <GL/gl.h>
+#elif HAVE_OPENGL_GL_H
+#  include <OpenGL/gl.h>
+#endif
+#ifdef HAVE_GL_GLU_H
+#  include <GL/glu.h>
+#elif HAVE_OPENGL_GLU_H
+#  include <OpenGL/glu.h>
+#endif
+#include <netcdf.h>
+#include <SDL.h>
+#include "anugavis.h"
+#include "error.h"
+#include "globals.h"
+
+int AnugaVis_Init(int width, int height, const char *swwFilePath){
+  int ncstatus;
+  if((SDL_Init(SDL_INIT_VIDEO) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) ||
+     ((anugavis.screen = 
+       SDL_SetVideoMode(width, height, 16, SDL_OPENGL)) == NULL)){
+    AnugaVis_SDLError();
+    return -1;
+  }
+
+  glEnable(GL_DEPTH_TEST);
+  glShadeModel(GL_FLAT);
+  glEnable(GL_NORMALIZE);
+  glMatrixMode(GL_PROJECTION);
+  gluPerspective(45.0, ((GLdouble)width)/((GLdouble)height), 0.1, 1000);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+
+  if((ncstatus = nc_open(swwFilePath, NC_SHARE,
+			 &anugavis.netcdfId)) != NC_NOERR){
+    AnugaVis_NetCDFError(ncstatus);
+    SDL_Quit();
+    return -1;
+  }
+  anugavis.heights = NULL;
+  return 0;
+}
+
+void AnugaVis_DeInit(void){
+  while(anugavis.heights != NULL)
+    AnugaVis_UndefineHeightQuantity(anugavis.heights->name);
+  nc_close(anugavis.netcdfId);
+  SDL_Quit();
+}
Index: uga_work/development/anugavis/src/libanugavis/anugavis.h
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/anugavis.h	(revision 5254)
+++ 	(revision )
@@ -1,25 +1,0 @@
-#ifndef ANUGAVIS_H
-#define ANUGAVIS_H
-
-/* Start and stop the visualiser. AnugaVis_Init() returns -1 on
- * error. To get detailed error information, use AnugaVis_GetError().
- */
-extern int AnugaVis_Init(int width, int height, const char *swwFilePath);
-extern void AnugaVis_DeInit(void);
-
-/* Define (or redefine if already defined a simple height quantity with the 
- * given offset, scale, and color. Returns 0 on success, -1 on error.
- */
-extern int AnugaVis_DefineHeightQuantity(const char *name,
-					 double offset, double scale,
-					 int red, int green, int blue);
-/* Undefine a given simple height quantity.
- */
-extern void AnugaVis_UndefineHeightQuantity(char *name);
-
-/* Get detailed error information. The returned string should not be
- * freed by the caller.
- */
-extern char* AnugaVis_GetError(void);
-
-#endif
Index: uga_work/development/anugavis/src/libanugavis/error.c
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/error.c	(revision 5254)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#include <stdarg.h>
-#include <netcdf.h>
-#include <SDL.h>
-#include "anugavis.h"
-#include "error.h"
-
-#define MAX_ERROR_LEN 100
-
-static char error[MAX_ERROR_LEN];
-
-char* AnugaVis_GetError(void){
-  return error;
-}
-
-void AnugaVis_SetError(const char *format, ...){
-  va_list args;
-  va_start(args, format);
-  vsnprintf(error, MAX_ERROR_LEN, format, args);
-  va_end(args);
-}
-
-void AnugaVis_SDLError(void){
-  AnugaVis_SetError("SDL Error: %s", SDL_GetError());
-  SDL_ClearError();
-}
-
-void AnugaVis_NetCDFError(int ncerr){
-  AnugaVis_SetError("NetCDF Error: %s", nc_strerror(ncerr));
-}
Index: uga_work/development/anugavis/src/libanugavis/error.h
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/error.h	(revision 5254)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#ifndef ANUGAVIS_ERROR_H
-#define ANUGAVIS_ERROR_H
-
-/* Set the error message with a printf-style format string.
- */
-void AnugaVis_SetError(const char *format, ...);
-
-/* Report a SDL error.
- */
-void AnugaVis_SDLError(void);
-
-/* Report a NetCDF error.
- */
-void AnugaVis_NetCDFError(int ncerr);
-
-#endif
Index: uga_work/development/anugavis/src/libanugavis/globals.c
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/globals.c	(revision 5254)
+++ 	(revision )
@@ -1,4 +1,0 @@
-#include <SDL.h>
-#include "globals.h"
-
-ANUGAVIS anugavis;
Index: uga_work/development/anugavis/src/libanugavis/globals.h
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/globals.h	(revision 5254)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#ifndef GLOBALS_H
-#define GLOBALS_H
-
-#include <SDL.h>
-#include "height_quantity.h"
-
-typedef struct{
-  SDL_Surface *screen;
-  int netcdfId;
-  struct height_quantity_simple *heights;
-} ANUGAVIS;
-
-extern ANUGAVIS anugavis;
-
-#endif
Index: uga_work/development/anugavis/src/libanugavis/height_quantity.c
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/height_quantity.c	(revision 5254)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <netcdf.h>
-#include <SDL.h>
-#include "anugavis.h"
-#include "error.h"
-#include "globals.h"
-#include "height_quantity.h"
-
-int AnugaVis_DefineHeightQuantity(const char *name,
-				  double offset, double scale,
-				  int red, int green, int blue){
-  struct height_quantity_simple *height;
-  int ncstatus;
-  int ncvarid;
-  int numdims;
-  /* Check that it's actually in the NetCDF file */
-  if((ncstatus = nc_inq_varid(anugavis.netcdfId, name, &ncvarid)) != NC_NOERR){
-    AnugaVis_NetCDFError(ncstatus);
-    return -1;
-  }     
-
-  /* Redefining a quantity? */
-  for(height = anugavis.heights ; height != NULL ; height = height->next)
-    if(!strcmp(name, height->name)) break;
-
-  if(height == NULL){ /* Make a new entry. */
-    if((height = malloc(sizeof(struct height_quantity_simple))) == NULL){
-      AnugaVis_SetError("Failed to malloc %d bytes in "
-			"AnugaVis_DefineHeightQuantity()",
-			sizeof(struct height_quantity_simple));
-      return -1;
-    }
-    height->next = anugavis.heights;
-    anugavis.heights = height;
-  }
-  
-  /* If the NetCDF variable is 2-dimensional, then it's dynamic. */
-  if((ncstatus = nc_inq_varndims(anugavis.netcdfId,
-				 ncvarid, &numdims)) != NC_NOERR){
-    AnugaVis_NetCDFError(ncstatus);
-    return -1;
-  }
-  height->dynamic = (numdims == 2);
-  height->offset = offset;
-  height->scale = scale;
-  height->color = SDL_MapRGB(anugavis.screen->format, red, green, blue);
-  return 0;
-}
-
-void AnugaVis_UndefineHeightQuantity(char *name){
-  struct height_quantity_simple *height = anugavis.heights;
-  struct height_quantity_simple *nextHeight;
-  if(height == NULL) return;
-  if(!strcmp(name, height->name)){
-    anugavis.heights = height->next;
-    free(height);
-    return;
-  }
-  for(; height != NULL ; height = height->next)
-    if(height->next == NULL) return;
-    if(!strcmp(name, height->next->name)){
-      nextHeight = height->next;
-      height->next = height->next->next;
-      free(nextHeight);
-      return;
-    }
-}
Index: uga_work/development/anugavis/src/libanugavis/height_quantity.h
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/height_quantity.h	(revision 5254)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#ifndef HEIGHT_QUANTITY_H
-#define HEIGHT_QUANTITY_H
-
-#include <SDL.h>
-
-struct height_quantity_simple{
-  char *name;
-  uint8_t dynamic;
-  double offset;
-  double scale;
-  Uint32 color;
-  struct height_quantity_simple *next;
-};
-
-#endif
Index: uga_work/development/anugavis/src/libanugavis/init.c
===================================================================
--- /anuga_work/development/anugavis/src/libanugavis/init.c	(revision 5254)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#ifdef HAVE_GL_GL_H
-#  include <GL/gl.h>
-#elif HAVE_OPENGL_GL_H
-#  include <OpenGL/gl.h>
-#endif
-#ifdef HAVE_GL_GLU_H
-#  include <GL/glu.h>
-#elif HAVE_OPENGL_GLU_H
-#  include <OpenGL/glu.h>
-#endif
-#include <netcdf.h>
-#include <SDL.h>
-#include "anugavis.h"
-#include "error.h"
-#include "globals.h"
-
-int AnugaVis_Init(int width, int height, const char *swwFilePath){
-  int ncstatus;
-  if((SDL_Init(SDL_INIT_VIDEO) == -1) ||
-     (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) ||
-     (SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5) == -1) ||
-     (SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5) == -1) ||
-     (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) ||
-     (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) ||
-     ((anugavis.screen = 
-       SDL_SetVideoMode(width, height, 16, SDL_OPENGL)) == NULL)){
-    AnugaVis_SDLError();
-    return -1;
-  }
-
-  glEnable(GL_DEPTH_TEST);
-  glShadeModel(GL_FLAT);
-  glEnable(GL_NORMALIZE);
-  glMatrixMode(GL_PROJECTION);
-  gluPerspective(45.0, ((GLdouble)width)/((GLdouble)height), 0.1, 1000);
-  glMatrixMode(GL_MODELVIEW);
-  glLoadIdentity();
-
-  if((ncstatus = nc_open(swwFilePath, NC_SHARE,
-			 &anugavis.netcdfId)) != NC_NOERR){
-    AnugaVis_NetCDFError(ncstatus);
-    SDL_Quit();
-    return -1;
-  }
-  anugavis.heights = NULL;
-  return 0;
-}
-
-void AnugaVis_DeInit(void){
-  while(anugavis.heights != NULL)
-    AnugaVis_UndefineHeightQuantity(anugavis.heights->name);
-  nc_close(anugavis.netcdfId);
-  SDL_Quit();
-}
