aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-12 12:06:06 +0100
committerThomas White <taw@physics.org>2009-11-12 12:06:06 +0100
commitc6b74b77b111c4e45b93ef9f02863dceafe0d047 (patch)
treed183f53a7e9aa6af3ccfa607eaac19dd3957f602
parentf09b0fc4da61d107dffc0d45489b769326fd8a08 (diff)
Sort out libraries and cflags
-rw-r--r--configure.ac9
-rw-r--r--src/Makefile.am4
2 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 8b746557..1eac1a93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,13 @@ AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([strdup])
-LIBS="$LIBS -lhdf5"
+AC_ARG_WITH(hdf5,
+[AS_HELP_STRING([--with-hdf5], [specify location of HDF5 library])],
+[HDF5_CFLAGS="-I$withval/include"
+ HDF5_LIBS="-L$withval/lib -lhdf5"],
+[])
+
+CFLAGS="$CFLAGS $HDF5_CFLAGS"
+LIBS="$LIBS $HDF5_LIBS -lm -lgsl -lgslcblas"
AC_OUTPUT(Makefile src/Makefile)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3ab2d7f8..eca48660 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,6 @@
bin_PROGRAMS = pattern_sim
+AM_CFLAGS = -Wall -g @CFLAGS@
+
pattern_sim_SOURCES = main.c diffraction.c utils.c image.c cell.c hdf5-file.c
-pattern_sim_LDADD = @LIBS@ -lm -lgsl -lgslcblas
+pattern_sim_LDADD = @LIBS@