Commit 32f52f08 authored by Thomas White's avatar Thomas White
Browse files

Compile without GLib (without pain)

parent 39319d29
......@@ -40,14 +40,30 @@ AC_ARG_ENABLE(opencl,
have_opencl=true],
[AC_MSG_RESULT([no])])
haveglib=false
havegtk=false
AM_PATH_GTK_2_0(2.0.0, havegtk=true,
AC_MSG_WARN([GTK not found. hdfsee will not be built.]))
AC_MSG_CHECKING([whether to use GTK/GLib])
AC_ARG_ENABLE(gtk,
[AC_HELP_STRING([--disable-gtk], [Disable GTK+/GLib])],
[
AC_MSG_RESULT([yes])
AM_PATH_GTK_2_0(2.0.0,
[
havegtk=true
haveglib=true
AC_DEFINE([HAVE_GLIB], [1], [Define to 1 if GLib is available])
GTK_LIBS="$GTK_LIBS -lgthread-2.0 -lutil"
],
AC_MSG_WARN([GTK not found. hdfsee will not be built.]))
],
[AC_MSG_RESULT([no])]
)
AM_CONDITIONAL([HAVE_GTK], test x$havegtk = xtrue)
AM_CONDITIONAL([HAVE_GLIB], test x$haveglib = xtrue)
AM_CONDITIONAL([HAVE_OPENCL], test x$have_opencl = xtrue)
CFLAGS="$CFLAGS $HDF5_CFLAGS $GTK_CFLAGS $GSL_CFLAGS $OPENCL_CFLAGS"
LIBS="$LIBS $HDF5_LIBS -lm -lz $GSL_LIBS $GTK_LIBS $OPENCL_LIBS -lgthread-2.0 -lutil"
LIBS="$LIBS $HDF5_LIBS -lm -lz $GSL_LIBS $GTK_LIBS $OPENCL_LIBS"
AC_OUTPUT(Makefile src/Makefile data/Makefile)
......@@ -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"
......@@ -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 */
......@@ -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 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment