aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-22 16:43:48 +0100
committerThomas White <taw@physics.org>2010-02-22 17:38:16 +0100
commit32f52f0821802aecb1d00dd1054acf25325b8599 (patch)
treeca015d81b2643c84f9d6aa974aed609c3b814b1f /src
parent39319d29e02fe2491ead6cbceb72ac93c71a54c1 (diff)
Compile without GLib (without pain)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am12
-rw-r--r--src/dirax.h11
-rw-r--r--src/image.h5
3 files changed, 26 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4142c40f..963c5373 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,11 +21,15 @@ process_hkl_SOURCES = process_hkl.c sfac.c statistics.c cell.c utils.c \
reflections.c
process_hkl_LDADD = @LIBS@
-indexamajig_SOURCES = indexamajig.c hdf5-file.c utils.c dirax.c cell.c image.c \
+indexamajig_SOURCES = indexamajig.c hdf5-file.c utils.c cell.c image.c \
intensities.c peaks.c index.c filters.c \
diffraction.c detector.c sfac.c
indexamajig_LDADD = @LIBS@
+if HAVE_GLIB
+indexamajig_SOURCES += dirax.c
+endif
+
if HAVE_GTK
hdfsee_SOURCES = hdfsee.c displaywindow.c render.c hdf5-file.c utils.c image.c \
filters.c
@@ -39,7 +43,11 @@ compare_hkl_SOURCES = compare_hkl.c sfac.c cell.c utils.c reflections.c
compare_hkl_LDADD = @LIBS@
powder_plot_SOURCES = powder_plot.c cell.c utils.c image.c hdf5-file.c \
- detector.c index.c diffraction.c sfac.c dirax.c
+ detector.c index.c diffraction.c sfac.c
powder_plot_LDADD = @LIBS@
+if HAVE_GLIB
+powder_plot_SOURCES += dirax.c
+endif
+
INCLUDES = "-I$(top_srcdir)/data"
diff --git a/src/dirax.h b/src/dirax.h
index b6b80488..530d2696 100644
--- a/src/dirax.h
+++ b/src/dirax.h
@@ -17,8 +17,19 @@
#include <config.h>
#endif
+#include "utils.h"
+
+#if HAVE_GLIB
extern void run_dirax(struct image *image);
+#else
+
+static void run_dirax(struct image *image)
+{
+ ERROR("Can't run DirAx without GLib.\n");
+}
+
+#endif
#endif /* DIRAX_H */
diff --git a/src/image.h b/src/image.h
index 326e70b7..1c3d2a89 100644
--- a/src/image.h
+++ b/src/image.h
@@ -19,7 +19,10 @@
#include <stdint.h>
#include <complex.h>
+
+#if HAVE_GLIB
#include <glib.h>
+#endif
#include "utils.h"
#include "cell.h"
@@ -86,6 +89,7 @@ struct image {
ImageFeatureList *rflist; /* "Predicted" features */
/* DirAx auto-indexing low-level stuff */
+#if HAVE_GLIB
GIOChannel *dirax;
int dirax_pty;
pid_t dirax_pid;
@@ -97,6 +101,7 @@ struct image {
/* DirAx auto-indexing high-level stuff */
int dirax_step;
int dirax_read_cell;
+#endif
};
/* An opaque type representing a list of images */