aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2018-02-16 15:53:48 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2018-02-16 15:53:48 +0100
commita57a5c01229f0035b6ad1e566f9d5dde39650be7 (patch)
treeaaed0ee9c17add0100b9e5c588a5439b001c4f6c
parent56f07a473d403a84afcf1e639d499eeacda0952a (diff)
Improving and cleaning configure script
-rw-r--r--configure.ac42
-rw-r--r--src/libimage/Makefile.am6
-rwxr-xr-xsrc/libimage/img.c4
-rw-r--r--src/tv/Makefile.am4
4 files changed, 14 insertions, 42 deletions
diff --git a/configure.ac b/configure.ac
index 0ae3f5f..8f729d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([abcnetz],
m4_esyscmd([./git-version-gen .tarball-version]),
- [authors@their.domains])
+ [jolly@eversberg.eu])
AM_INIT_AUTOMAKE([dist-bzip2])
@@ -27,54 +27,26 @@ AC_CANONICAL_HOST
AC_CHECK_LIB([m], [main])
AC_CHECK_LIB([pthread], [main])
-# disabled due to problems with api compatibilty with imagemagick
-#AC_ARG_ENABLE(graphicsmagick,
-# [AS_HELP_STRING(
-# [--disable-graphicsmagick],
-# [Disable building graphicsmagick]
-# )],
-# [enable_graphicsmagick=$enableval], [enable_graphicsmagick="yes"])
-#if test x"$enable_graphicsmagick" = x"yes"
-#then
-# PKG_CHECK_MODULES(GRAPHICSMAGICK, GraphicsMagick >= 1.3.16, , enable_graphicsmagick=no)
-#fi
-#if test x"$enable_graphicsmagick" = x"yes"
-#then
-# somethingmagick=yes
-#fi
-
-AC_ARG_ENABLE(imagemagick,
- [AS_HELP_STRING(
- [--disable-imagemagick],
- [Disable building imagemagick]
- )],
- [enable_imagemagick=$enableval], [enable_imagemagick="yes"])
-if test x"$enable_imagemagick" = x"yes"
-then
- PKG_CHECK_MODULES(IMAGEMAGICK, ImageMagick >= 6.0.0, , enable_imagemagick=no)
-fi
-if test x"$enable_imagemagick" = x"yes"
-then
- somethingmagick=yes
-fi
-
-AM_CONDITIONAL(ENABLE_MAGICK, test x"$somethingmagick" = x"yes")
-
with_sdr=no
AC_ARG_WITH([alsa], [AS_HELP_STRING([--with-alsa], [compile with Alsa driver @<:@default=check@:>@]) ], [], [with_alsa="check"])
AC_ARG_WITH([uhd], [AS_HELP_STRING([--with-uhd], [compile with UHD driver @<:@default=check@:>@]) ], [], [with_uhd="check"])
AC_ARG_WITH([soapy], [AS_HELP_STRING([--with-soapy], [compile with SoapySDR driver @<:@default=check@:>@]) ], [], [with_soapy="check"])
+AC_ARG_WITH([imagemagick], [AS_HELP_STRING([--with-imagemagick], [compile with ImageMagick support @<:@default=check@:>@]) ], [], [with_imagemagick="check"])
AS_IF([test "x$with_alsa" != xno], [PKG_CHECK_MODULES(ALSA, alsa >= 1.0, with_alsa=yes, with_alsa=no)])
AS_IF([test "x$with_uhd" != xno], [PKG_CHECK_MODULES(UHD, uhd >= 3.0.0, with_sdr=yes with_uhd=yes, with_uhd=no)])
AS_IF([test "x$with_soapy" != xno], [PKG_CHECK_MODULES(SOAPY, SoapySDR >= 0.6.0, with_sdr=yes with_soapy=yes, with_soapy=no)])
+AS_IF([test "x$with_imagemagick" != xno], [PKG_CHECK_MODULES(IMAGEMAGICK, ImageMagick >= 6.0.0, with_imagemagick=yes, with_imagemagick=no)])
AM_CONDITIONAL(HAVE_ALSA, test "x$with_alsa" == "xyes" )
AM_CONDITIONAL(HAVE_UHD, test "x$with_uhd" == "xyes" )
AM_CONDITIONAL(HAVE_SOAPY, test "x$with_soapy" == "xyes" )
AM_CONDITIONAL(HAVE_SDR, test "x$with_sdr" == "xyes" )
+AM_CONDITIONAL(HAVE_MAGICK, test "x$with_imagemagick" == "xyes" )
AS_IF([test "x$with_alsa" == "xyes"],[AC_MSG_NOTICE( Compiling with Alsa support )], [AC_MSG_NOTICE( Alsa sound card not supported. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. )])
AS_IF([test "x$with_uhd" == "xyes"],[AC_MSG_NOTICE( Compiling with UHD SDR support )], [AC_MSG_NOTICE( UHD SDR not supported. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. )])
AS_IF([test "x$with_soapy" == "xyes"],[AC_MSG_NOTICE( Compiling with SoapySDR support )], [AC_MSG_NOTICE( SoapySDR not supported. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. )])
-AS_IF([test "x$somethingmagick" == "xyes"],[AC_MSG_NOTICE( Compiling with ImageMagick )],[AC_MSG_NOTICE( ImageMagick not supported )])
+AS_IF([test "x$with_imagemagick" == "xyes"],[AC_MSG_NOTICE( Compiling with ImageMagick )],[AC_MSG_NOTICE( ImageMagick not supported. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. )])
+
+AS_IF([test "x$with_alsa" != "xyes" -a "x$with_sdr" != "xyes"],[AC_MSG_FAILURE( Without sound nor SDR support this project does not make sense. Please support sound card for analog transceivers or better SDR!" )],[])
AC_OUTPUT(
src/libdebug/Makefile
diff --git a/src/libimage/Makefile.am b/src/libimage/Makefile.am
index ed9041c..0d36ccd 100644
--- a/src/libimage/Makefile.am
+++ b/src/libimage/Makefile.am
@@ -1,11 +1,11 @@
-AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(GRAPHICSMAGICK_CFLAGS) $(IMAGEMAGICK_CFLAGS)
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(IMAGEMAGICK_CFLAGS)
noinst_LIBRARIES = libimage.a
libimage_a_SOURCES = \
img.c
-if ENABLE_MAGICK
-AM_CPPFLAGS += -DWITH_MAGICK
+if HAVE_MAGICK
+AM_CPPFLAGS += -DHAVE_MAGICK
endif
diff --git a/src/libimage/img.c b/src/libimage/img.c
index 8a7f5a4..ccc79bb 100755
--- a/src/libimage/img.c
+++ b/src/libimage/img.c
@@ -5,7 +5,7 @@
int save_depth = 16;
-#ifdef WITH_MAGICK
+#ifdef HAVE_MAGICK
#include <magick/api.h>
/* load given image to memory. return short RGB values */
@@ -256,7 +256,7 @@ int save_img_array(double *array, int width, int height, int alpha, const char *
unsigned short *img = NULL;
int components;
-#ifndef WITH_MAGICK
+#ifndef HAVE_MAGICK
if (alpha) {
printf("%s:warning, cannot save alpha component with PPM support only\n", __func__);
alpha = 0;
diff --git a/src/tv/Makefile.am b/src/tv/Makefile.am
index e812342..733541a 100644
--- a/src/tv/Makefile.am
+++ b/src/tv/Makefile.am
@@ -44,7 +44,7 @@ if HAVE_SDR
AM_CPPFLAGS += -DHAVE_SDR
endif
-if ENABLE_MAGICK
-AM_CPPFLAGS += -DWITH_MAGICK
+if HAVE_MAGICK
+AM_CPPFLAGS += -DHAVE_MAGICK
endif