aboutsummaryrefslogtreecommitdiff
path: root/gtk/configure.ac
blob: 67889e51a9dcddcece54ecccc7503ca4157e7655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
AC_INIT([fmplayer], [0.1.0])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CC_C99
AC_PROG_RANLIB
AM_PROG_AR
AM_PROG_AS

AC_ARG_WITH([jack],
  [AS_HELP_STRING([--without-jack], [disable support for JACK audio])])
AC_ARG_WITH([pulse],
  [AS_HELP_STRING([--without-pulse], [disable support for pulseaudio])])
AC_ARG_WITH([alsa],
  [AS_HELP_STRING([--without-alsa], [disable support for alsa])])

AS_IF([test "x$with_jack" = "xyes"], [
  PKG_CHECK_MODULES([JACK], [jack soxr])
  jack_found=yes
], [test "x$with_jack" != "xno"], [
  PKG_CHECK_MODULES([JACK], [jack soxr], [jack_found=yes], [jack_found=no])
], [
  jack_found=no
])

AS_IF([test "x$with_pulse" = "xyes"], [
  PKG_CHECK_MODULES([PULSE], [libpulse])
  pulse_found=yes
], [test "x$with_pulse" != "xno"], [
  PKG_CHECK_MODULES([PULSE], [libpulse], [pulse_found=yes], [pulse_found=no])
], [
  pulse_found=no
])

AS_IF([test "x$with_alsa" = "xyes"], [
  PKG_CHECK_MODULES([ALSA], [alsa])
  alsa_found=yes
], [test "x$with_alsa" != "xno"], [
  PKG_CHECK_MODULES([ALSA], [alsa], [alsa_found=yes], [alsa_found=no])
], [
  alsa_found=no
])

PKG_CHECK_MODULES([GTK3], [gtk+-3.0 cairo])
PKG_CHECK_MODULES([SNDFILE], [sndfile])

AS_IF([test "x$jack_found" = "xno" -a "x$pulse_found" = "xno" -a "x$alsa_found" = "xno"], [
  AC_MSG_ERROR([No audio output backend found or enabled])
])

AM_CONDITIONAL([ENABLE_JACK], [test "x$jack_found" = "xyes"])
AS_IF([test "x$jack_found" = "xyes"], [
  AC_DEFINE([ENABLE_JACK])
])
AM_CONDITIONAL([ENABLE_PULSE], [test "x$pulse_found" = "xyes"])
AS_IF([test "x$pulse_found" = "xyes"], [
  AC_DEFINE([ENABLE_PULSE])
])
AM_CONDITIONAL([ENABLE_ALSA], [test "x$alsa_found" = "xyes"])
AS_IF([test "x$alsa_found" = "xyes"], [
  AC_DEFINE([ENABLE_ALSA])
])

AC_ARG_ENABLE([neon], AS_HELP_STRING([--enable-neon], [Enable NEON optimized functions for SSG sinc filtering and fmdsp palette lookup. Tested on Cortex-A53 (Raspberry PI 3)]))
AM_CONDITIONAL([ENABLE_NEON], [test "x$enable_neon" = "xyes"])
AS_IF([test "x$enable_neon" = "xyes"], [
  AC_DEFINE([ENABLE_NEON])
])

AC_CHECK_HEADER([emmintrin.h], [emmintrin_found=yes])
AM_CONDITIONAL([ENABLE_SSE], [test "x$emmintrin_found" = "xyes"])
AS_IF([test "x$emmintrin_found" = "xyes"], [
  AC_DEFINE([ENABLE_SSE])
])

AC_ARG_ENABLE([opengl], AS_HELP_STRING([--enable-opengl], [Enable OpenGL rendering for Oscilloscope view (default: enable if found)]))
AS_IF([test "x$enable_opengl" != "xno"], [
  AC_CHECK_LIB([GL], [glGetString], [opengl_found=yes])
  AC_CHECK_HEADER([GL/glcorearb.h], , [opengl_found=])
  AS_IF([test "x$enable_opengl" = "x" -a "x$opengl_found" = "xyes"], [
    enable_opengl=yes
  ])
  AS_IF([test "x$enable_opengl" = "xyes" -a "x$opengl_found" != "xyes"], [
    AC_MSG_ERROR([OpenGL header/library not found (-lGL, GL/glcorearb.h)], [1])
  ])
])
AM_CONDITIONAL([ENABLE_OPENGL], [test "x$enable_opengl" = "xyes"])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT