File: configure.ac

package info (click to toggle)
aiscm 0.20.1-1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 7,084 kB
  • sloc: lisp: 7,406; sh: 4,184; ansic: 3,613; makefile: 266
file content (226 lines) | stat: -rw-r--r-- 7,529 bytes parent folder | download
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
dnl Run `./autogen.sh` to generate a configure script.
dnl Then run `./configure` to generate a Makefile.
dnl Finally run `make` to build the project.
AC_PREREQ([2.69])
AC_INIT([aiscm], [0.20.1], [jan@wedesoft.de])
DATE=2019-12-28
AC_SUBST(DATE)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([--warnings=no-portability foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_REQUIRE_AUX_FILE([test-driver.scm])
AM_EXTRA_RECURSIVE_TARGETS([bench recheck integration reintegration])
LT_INIT
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_LANG(C)
PKG_PROG_PKG_CONFIG
AM_CONFIG_HEADER(config.h)
AC_CHECK_PROG(TOUCH,touch,touch,touch)
AC_CHECK_PROG(PANDOC,pandoc,pandoc,no)
if test "x$PANDOC" = xno; then
  AC_MSG_ERROR([Could not find 'pandoc' in path.])
fi
AC_CHECK_PROG(CONVERT,convert,convert,no)
if test "x$CONVERT" = xno; then
  AC_MSG_ERROR([Could not find 'convert' in path.])
fi
AC_MSG_CHECKING([wether C compiler works])
AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([Failed to compile and link C program.])])
AC_CHECK_HEADERS([assert.h stdio.h stdlib.h string.h])
AC_FUNC_MALLOC
AC_CHECK_FUNCS([strcmp])

AX_LLVMC([orcjit])

AX_PTHREAD([],[AC_MSG_ERROR([Could not find pthread library])])
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)

PKG_CHECK_MODULES(SWSCALE, libswscale >= 2.1.0)
AC_SUBST(SWSCALE_CFLAGS)
AC_SUBST(SWSCALE_LIBS)

PKG_CHECK_MODULES(SWRESAMPLE, libswresample >= 1.1.100,
  [AC_DEFINE([HAVE_SWRESAMPLE], 1, [libswresample is present])],
  [PKG_CHECK_MODULES(AVRESAMPLE, libavresample >= 1.0.1)])
AC_SUBST(SWRESAMPLE_CFLAGS)
AC_SUBST(SWRESAMPLE_LIBS)
AC_SUBST(AVRESAMPLE_CFLAGS)
AC_SUBST(AVRESAMPLE_LIBS)

PKG_CHECK_MODULES(MJPEG, mjpegtools >= 1.9.0)
AC_SUBST(MJPEG_CFLAGS)
AC_SUBST(MJPEG_LIBS)

PKG_CHECK_MODULES(MAGICK, ImageMagick >= 6.7.7)
AC_SUBST(MAGICK_CFLAGS)
AC_SUBST(MAGICK_LIBS)

PKG_CHECK_MODULES(PULSE, libpulse-simple >= 1.1)
AC_SUBST(PULSE_CFLAGS)
AC_SUBST(PULSE_LIBS)

PKG_CHECK_MODULES(AVUTIL, libavutil >= 52.3.0)
AC_SUBST(AVUTIL_CFLAGS)
AC_SUBST(AVUTIL_LIBS)

PKG_CHECK_MODULES(AVCODEC, libavcodec >= 54.35.0)
AC_SUBST(AVCODEC_CFLAGS)
AC_SUBST(AVCODEC_LIBS)

PKG_CHECK_MODULES(AVFORMAT, libavformat >= 54.20.4)
AC_SUBST(AVFORMAT_CFLAGS)
AC_SUBST(AVFORMAT_LIBS)

old_LIBS="$LIBS"
LIBS="$LIBS $AVFORMAT_LIBS $AVCODEC_LIBS $AVUTIL_LIBS"
AC_MSG_CHECKING([for av_frame_alloc])
AC_TRY_LINK([#include <libavutil/frame.h>],
            [av_frame_alloc()],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_FRAME_ALLOC,1,[av_frame_alloc is supported])],
            [AC_MSG_RESULT([no])
             AC_MSG_CHECKING([for avcodec_alloc_frame])
             AC_TRY_LINK([#include <libavcodec/avcodec.h>],
                         [avcodec_alloc_frame()],
                         [AC_MSG_RESULT([yes])],
                         [AC_MSG_RESULT([no])
                          AC_MSG_ERROR([No support for av_frame_alloc or avcodec_alloc_frame])])])
AC_MSG_CHECKING([for av_image_get_buffer_size])
AC_TRY_LINK([#include <libavutil/imgutils.h>],
            [av_image_get_buffer_size(0, 320, 240, 32)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_IMAGE_BUFFER_SIZE,1,[use av_image_get_buffer_size to get buffer size])],
            [AC_MSG_RESULT([no])
             AC_MSG_CHECKING([for avpicture_get_size])
             AC_TRY_LINK([#include <libavutil/imgutils.h>],
                         [avpicture_get_size(0, 320, 240)],
                         [AC_MSG_RESULT([yes])],
                         [AC_MSG_RESULT([no])
                          AC_MSG_ERROR([No support for av_image_get_buffer_size or avpicture_get_size])])])
AC_MSG_CHECKING([for avformat_alloc_output_context2])
AC_TRY_LINK([#include <libavformat/avformat.h>],
            [avformat_alloc_output_context2(0, 0, 0, 0)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AVFORMAT_ALLOC_OUTPUT_CONTEXT2,1,[use avformat_alloc_output_context2 to initialise output context])],
            [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for av_frame_get_buffer])
AC_TRY_LINK([#include <libavutil/frame.h>],
            [av_frame_get_buffer(0, 32)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AV_FRAME_GET_BUFFER,1,[use av_frame_get_buffer to initialise output frames])],
            [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for av_frame_make_writable])
AC_TRY_LINK([#include <libavutil/frame.h>],
            [av_frame_make_writable(0)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AV_FRAME_MAKE_WRITABLE,1,[call to av_frame_make_writable required])],
            [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([AVFrame has pts])
AC_TRY_LINK([#include <libavutil/frame.h>],
            [AVFrame *frame; frame->pts],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AV_FRAME_PTS,1,[AVFrame has pts])],
            [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for av_packet_rescale_ts])
AC_TRY_LINK([#include <libavcodec/avcodec.h>],
            [AVRational rational; av_packet_rescale_ts(0, rational, rational)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AV_PACKET_RESCALE_TS,1,[av_packet_rescale_ts available])],
            [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for av_packet_unref])
AC_TRY_LINK([#include <libavcodec/avcodec.h>],
            [av_packet_unref(NULL)],
            [AC_MSG_RESULT([yes])
             AC_DEFINE(HAVE_AV_PACKET_UNREF,1,[av_packet_unref available])],
            [AC_MSG_RESULT([no])])
LIBS="$old_LIBS"

old_LIBS="$LIBS"
LIBS="$LIBS -lXpm"
AC_MSG_CHECKING([for XpmCreatePixmapFromData])
AC_TRY_LINK([#include <X11/xpm.h>],
            [XpmCreatePixmapFromData(0, 0, 0, 0, 0, 0)],
            [AC_MSG_RESULT([yes])],
            [AC_MSG_RESULT([no])]
            [AC_MSG_ERROR([Could not locate Xpm library])])
LIBS="$old_LIBS"

old_LIBS="$LIBS"
LIBS="$LIBS -lgc"
AC_MSG_CHECKING([for Boehm Garbage Collector library])
AC_TRY_LINK([#include <gc.h>],
            [GC_INIT()],
            [AC_MSG_RESULT([yes])],
            [AC_MSG_RESULT([no])]
            [AC_MSG_ERROR([Could not locate Boehm Garbage Collector library])])
LIBS="$old_LIBS"

AC_PATH_XTRA
if test "x$no_x" = xyes; then
  AC_MSG_ERROR([Could not find X11 libraries.])
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)

AX_HAVE_OPENGL
AC_MSG_CHECKING([for GL])
if test "x$have_GL" != "xyes"; then
  AC_MSG_RESULT([no])
  AC_MSG_ERROR([Could not find GL])
else
  AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([for GLU])
if test "x$have_GLU" != "xyes"; then
  AC_MSG_RESULT([no])
  AC_MSG_ERROR([Could not find GLU])
else
  AC_MSG_RESULT([yes])
fi

AC_MSG_CHECKING([for Xvideo])
LIBS="$LIBS -lXv"
AC_TRY_LINK([#include <X11/extensions/Xv.h>],
   [XvQueryPortAttributes(0, 0, 0)],
   [AC_MSG_RESULT([yes])],
   [AC_MSG_RESULT([no])]
   [AC_MSG_ERROR([Could not locate Xvideo extension])])
old_LIBS="$LIBS"

GUILE_PROGS
GUILE_FLAGS
GUILE_SITE_DIR
GUILE_EXT_DIR
GUILE_CACHE_DIR

dnl Switch for debug or release mode.
AC_ARG_ENABLE(debug,
  [  --enable-debug=DEBUG    compile with debugging assertions (default=no)],
  enable_debug=$enableval, enable_debug=no)
if test "x$enable_debug" == "xyes"; then
  AM_CFLAGS='-Wall'
else
  AM_CFLAGS='-Wall -DNDEBUG'
fi
AC_SUBST(AM_CFLAGS)

info="$info

prefix                               : $prefix
debug mode                           : $enable_debug"

AC_OUTPUT(Makefile
          aiscm/Makefile
          tests/Makefile
          tests/integration/Makefile
          tests/fixtures/Makefile
          bench/Makefile
          doc/Makefile
          doc/index.md,
          echo "$info",
          info="$info")