comparison acinclude.m4 @ 248:a66c634b222a

Macro quotation cleanup to satisfy Automake 1.8 and friends.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Dec 2004 17:32:02 +0000
parents ec8b735f5418
children 3cda19cf5181
comparison
equal deleted inserted replaced
247:98279d92a78b 248:a66c634b222a
5 5
6 dnl ------------------------------------------------------------------------- 6 dnl -------------------------------------------------------------------------
7 dnl Try to find a file (or one of more files in a list of dirs). 7 dnl Try to find a file (or one of more files in a list of dirs).
8 dnl ------------------------------------------------------------------------- 8 dnl -------------------------------------------------------------------------
9 9
10 AC_DEFUN(MY_FIND_FILE, 10 AC_DEFUN([MY_FIND_FILE],
11 [ 11 [
12 $3="" 12 $3=""
13 for i in $2; do 13 for i in $2; do
14 for j in $1; do 14 for j in $1; do
15 if test -r "$i/$j"; then 15 if test -r "$i/$j"; then
20 done 20 done
21 ]) 21 ])
22 22
23 dnl ------------------------------------------------------------------------- 23 dnl -------------------------------------------------------------------------
24 24
25 AC_DEFUN(MY_SUBST, 25 AC_DEFUN([MY_SUBST],
26 dnl Substitute an instance of @$1@ with value "$2". 26 dnl Substitute an instance of @$1@ with value "$2".
27 dnl Example: MY_SUBST(FOO,BAR) <-> @FOO@ => BAR 27 dnl Example: MY_SUBST(FOO,BAR) <-> @FOO@ => BAR
28 [ 28 [
29 eval "$1=$2" 29 eval "$1=$2"
30 AC_SUBST($1) 30 AC_SUBST($1)
31 ]) 31 ])
32 32
33 AC_DEFUN(MY_SUBST_DEF, 33 AC_DEFUN([MY_SUBST_DEF],
34 dnl Substitute an instance of @$1@ with value "#define $1". 34 dnl Substitute an instance of @$1@ with value "#define $1".
35 dnl Example: MY_SUBST_DEF(FOO) <-> @FOO@ => #define FOO 35 dnl Example: MY_SUBST_DEF(FOO) <-> @FOO@ => #define FOO
36 [ 36 [
37 eval "$1=\"#define $1\"" 37 eval "$1=\"#define $1\""
38 AC_SUBST($1) 38 AC_SUBST($1)
39 ]) 39 ])
40 40
41 AC_DEFUN(MY_SUBST_UNDEF, 41 AC_DEFUN([MY_SUBST_UNDEF],
42 dnl Substitute an instance of @$1@ with value "#undef $1". 42 dnl Substitute an instance of @$1@ with value "#undef $1".
43 dnl Example: MY_SUBST_UNDEF(FOO) <-> @FOO@ => #undef FOO 43 dnl Example: MY_SUBST_UNDEF(FOO) <-> @FOO@ => #undef FOO
44 [ 44 [
45 eval "$1=\"#undef $1\"" 45 eval "$1=\"#undef $1\""
46 AC_SUBST($1) 46 AC_SUBST($1)
48 48
49 dnl ------------------------------------------------------------------------- 49 dnl -------------------------------------------------------------------------
50 dnl Pass C++ compiler options to libtool which supports C only. 50 dnl Pass C++ compiler options to libtool which supports C only.
51 dnl ------------------------------------------------------------------------- 51 dnl -------------------------------------------------------------------------
52 52
53 AC_DEFUN(MY_PROG_LIBTOOL, 53 AC_DEFUN([MY_PROG_LIBTOOL],
54 [ 54 [
55 xs_save_cc="$CC" 55 xs_save_cc="$CC"
56 xs_save_cflags="$CFLAGS" 56 xs_save_cflags="$CFLAGS"
57 CC="$CXX" 57 CC="$CXX"
58 CFLAGS="$CXXFLAGS" 58 CFLAGS="$CXXFLAGS"
61 CFLAGS="$xs_save_cflags" 61 CFLAGS="$xs_save_cflags"
62 ]) 62 ])
63 63
64 dnl ------------------------------------------------------------------------- 64 dnl -------------------------------------------------------------------------
65 65
66 AC_DEFUN(MY_TRY_LINK_SAVE, 66 AC_DEFUN([MY_TRY_LINK_SAVE],
67 [ 67 [
68 xs_cxx_save="$CXX" 68 xs_cxx_save="$CXX"
69 xs_cxxflags_save="$CXXFLAGS" 69 xs_cxxflags_save="$CXXFLAGS"
70 xs_ldflags_save="$LDFLAGS" 70 xs_ldflags_save="$LDFLAGS"
71 xs_libs_save="$LIBS" 71 xs_libs_save="$LIBS"
72 ]) 72 ])
73 73
74 74
75 AC_DEFUN(MY_TRY_LINK_RESTORE, 75 AC_DEFUN([MY_TRY_LINK_RESTORE],
76 [ 76 [
77 CXX="$xs_cxx_save" 77 CXX="$xs_cxx_save"
78 CXXFLAGS="$xs_cxxflags_save" 78 CXXFLAGS="$xs_cxxflags_save"
79 LDFLAGS="$xs_ldflags_save" 79 LDFLAGS="$xs_ldflags_save"
80 LIBS="$xs_libs_save" 80 LIBS="$xs_libs_save"
81 ]) 81 ])
82 82
83 83
84 AC_DEFUN(MY_PROG_PKGCONFIG, 84 AC_DEFUN([MY_PROG_PKGCONFIG],
85 [ 85 [
86 AC_PATH_PROG(PKG_CONFIG, pkg-config, "") 86 AC_PATH_PROG([PKG_CONFIG], [pkg-config])
87 ]) 87 ])
88 88
89 89
90 AC_DEFUN(MY_NEED_PKGCONFIG, 90 AC_DEFUN([MY_NEED_PKGCONFIG],
91 [ 91 [
92 AC_REQUIRE([MY_PROG_PKGCONFIG]) 92 AC_REQUIRE([MY_PROG_PKGCONFIG])
93 if test -z "$PKG_CONFIG"; then 93 if test -z "$PKG_CONFIG"; then
94 AC_MSG_ERROR([pkg-config not found. See http://pkgconfig.sourceforge.net]) 94 AC_MSG_ERROR([[pkg-config not found. See http://pkgconfig.sourceforge.net]])
95 fi 95 fi
96 if ! $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then 96 if ! $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then
97 AC_MSG_ERROR([pkg-config too old; version 0.5 or better required.]) 97 AC_MSG_ERROR([[pkg-config too old; version 0.5 or better required.]])
98 fi 98 fi
99 ]) 99 ])
100 100
101 dnl ------------------------------------------------------------------------- 101 dnl -------------------------------------------------------------------------
102 dnl Try to find SIDPLAY library and header files. 102 dnl Try to find SIDPLAY library and header files.
103 dnl $xs_have_sidplay1 will be "yes" or "no" 103 dnl $xs_have_sidplay1 will be "yes" or "no"
104 dnl @SIDPLAY1_LDADD@ will be substituted with linker parameters 104 dnl @SIDPLAY1_LDADD@ will be substituted with linker parameters
105 dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters 105 dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters
106 dnl ------------------------------------------------------------------------- 106 dnl -------------------------------------------------------------------------
107 107
108 AC_DEFUN(XS_PATH_LIBSIDPLAY1, 108 AC_DEFUN([XS_PATH_LIBSIDPLAY1],
109 [ 109 [
110 AC_MSG_CHECKING([for working SIDPlay1 library and headers]) 110 AC_MSG_CHECKING([for working SIDPlay1 library and headers])
111 111
112 AC_LANG_PUSH(C++) 112 AC_LANG_PUSH([C++])
113 113
114 # Use include path given by user (if any). 114 # Use include path given by user (if any).
115 if test -n "$xs_sidplay1_includes"; then 115 if test -n "$xs_sidplay1_includes"; then
116 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes" 116 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
117 else 117 else
148 AC_MSG_RESULT([yes]) 148 AC_MSG_RESULT([yes])
149 fi 149 fi
150 150
151 SIDPLAY1_LDADD="$xs_sidplay1_ldflags -lsidplay" 151 SIDPLAY1_LDADD="$xs_sidplay1_ldflags -lsidplay"
152 SIDPLAY1_INCLUDES="$xs_sidplay1_cxxflags" 152 SIDPLAY1_INCLUDES="$xs_sidplay1_cxxflags"
153 AC_SUBST(SIDPLAY1_LDADD) 153 AC_SUBST([SIDPLAY1_LDADD])
154 AC_SUBST(SIDPLAY1_INCLUDES) 154 AC_SUBST([SIDPLAY1_INCLUDES])
155 else 155 else
156 AC_MSG_RESULT([no]) 156 AC_MSG_RESULT([no])
157 fi 157 fi
158 158
159 AC_LANG_POP(C++) 159 AC_LANG_POP([C++])
160 ]) 160 ])
161 161
162 dnl Functions used by XS_PATH_LIBSIDPLAY1. 162 dnl Functions used by XS_PATH_LIBSIDPLAY1.
163 163
164 AC_DEFUN(MY_FIND_LIBSIDPLAY1, 164 AC_DEFUN([MY_FIND_LIBSIDPLAY1],
165 [ 165 [
166 # Search common locations where header files might be stored. 166 # Search common locations where header files might be stored.
167 xs_sidplay1_incdirs="$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include" 167 xs_sidplay1_incdirs="$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include"
168 MY_FIND_FILE(sidplay/sidtune.h, $xs_sidplay1_incdirs, xs_sidplay1_includes) 168 MY_FIND_FILE(sidplay/sidtune.h, $xs_sidplay1_incdirs, xs_sidplay1_includes)
169 169
184 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \ 184 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \
185 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" " 185 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" "
186 fi 186 fi
187 ]) 187 ])
188 188
189 AC_DEFUN(MY_TRY_LIBSIDPLAY1, 189 AC_DEFUN([MY_TRY_LIBSIDPLAY1],
190 [ 190 [
191 MY_TRY_LINK_SAVE 191 MY_TRY_LINK_SAVE
192 192
193 CXXFLAGS="$CXXFLAGS $xs_sidplay1_cxxflags" 193 CXXFLAGS="$CXXFLAGS $xs_sidplay1_cxxflags"
194 LDFLAGS="$LDFLAGS $xs_sidplay1_ldflags" 194 LDFLAGS="$LDFLAGS $xs_sidplay1_ldflags"
209 dnl Try to find SIDPLAY2 library and header files. 209 dnl Try to find SIDPLAY2 library and header files.
210 dnl $xs_have_sidplay2 will be "yes" or "no" 210 dnl $xs_have_sidplay2 will be "yes" or "no"
211 dnl @SIDPLAY_LDADD@ will be substituted with linker parameters 211 dnl @SIDPLAY_LDADD@ will be substituted with linker parameters
212 dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters 212 dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters
213 dnl ------------------------------------------------------------------------- 213 dnl -------------------------------------------------------------------------
214 AC_DEFUN(XS_PATH_LIBSIDPLAY2, 214 AC_DEFUN([XS_PATH_LIBSIDPLAY2],
215 [ 215 [
216 AC_MSG_CHECKING([for working SIDPlay2 library and headers]) 216 AC_MSG_CHECKING([for working SIDPlay2 library and headers])
217 217
218 AC_LANG_PUSH(C++) 218 AC_LANG_PUSH([C++])
219 219
220 AC_REQUIRE([MY_PROG_PKGCONFIG]) 220 AC_REQUIRE([MY_PROG_PKGCONFIG])
221 if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then 221 if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then
222 xs_pkgcfg_knows=yes 222 xs_pkgcfg_knows=yes
223 else 223 else
254 AC_MSG_RESULT([yes]) 254 AC_MSG_RESULT([yes])
255 fi 255 fi
256 256
257 SIDPLAY2_LDADD="$xs_sidplay2_ldadd" 257 SIDPLAY2_LDADD="$xs_sidplay2_ldadd"
258 SIDPLAY2_INCLUDES="$xs_sidplay2_cxxflags" 258 SIDPLAY2_INCLUDES="$xs_sidplay2_cxxflags"
259 AC_SUBST(SIDPLAY2_LDADD) 259 AC_SUBST([SIDPLAY2_LDADD])
260 AC_SUBST(SIDPLAY2_INCLUDES) 260 AC_SUBST([SIDPLAY2_INCLUDES])
261 else 261 else
262 AC_MSG_RESULT([no]) 262 AC_MSG_RESULT([no])
263 fi 263 fi
264 264
265 AC_LANG_POP(C++) 265 AC_LANG_POP([C++])
266 ]) 266 ])
267 267
268 268
269 dnl Functions used by XS_PATH_LIBSIDPLAY2. 269 dnl Functions used by XS_PATH_LIBSIDPLAY2.
270 AC_DEFUN(MY_FIND_LIBSIDPLAY2, 270 AC_DEFUN([MY_FIND_LIBSIDPLAY2],
271 [ 271 [
272 # See whether user didn't provide paths. 272 # See whether user didn't provide paths.
273 if test -z "$xs_sidplay2_includes"; then 273 if test -z "$xs_sidplay2_includes"; then
274 if test "$xs_pkgcfg_knows" = yes ; then 274 if test "$xs_pkgcfg_knows" = yes ; then
275 xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2` 275 xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2`
313 xs_sidplay2_builders=\"$xs_sidplay2_builders\" " 313 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
314 fi 314 fi
315 ]) 315 ])
316 316
317 317
318 AC_DEFUN(MY_TRY_LIBSIDPLAY2, 318 AC_DEFUN([MY_TRY_LIBSIDPLAY2],
319 [ 319 [
320 MY_TRY_LINK_SAVE 320 MY_TRY_LINK_SAVE
321 321
322 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX" 322 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
323 CXXFLAGS="$CXXFLAGS $xs_sidplay2_cxxflags -DHAVE_UNIX" 323 CXXFLAGS="$CXXFLAGS $xs_sidplay2_cxxflags -DHAVE_UNIX"
337 dnl ------------------------------------------------------------------------- 337 dnl -------------------------------------------------------------------------
338 dnl Find libsidplay2 builders (sidbuilders) dir. 338 dnl Find libsidplay2 builders (sidbuilders) dir.
339 dnl @BUILDERS_INCLUDES@ 339 dnl @BUILDERS_INCLUDES@
340 dnl @BUILDERS_LDFLAGS@ 340 dnl @BUILDERS_LDFLAGS@
341 dnl ------------------------------------------------------------------------- 341 dnl -------------------------------------------------------------------------
342 AC_DEFUN(BUILDERS_FIND, 342 AC_DEFUN([BUILDERS_FIND],
343 [ 343 [
344 AC_MSG_CHECKING([for SIDPlay2 builders directory]) 344 AC_MSG_CHECKING([for SIDPlay2 builders directory])
345 345
346 AC_LANG_PUSH(C++) 346 AC_LANG_PUSH([C++])
347 347
348 AC_REQUIRE([XS_PATH_LIBSIDPLAY2]) 348 AC_REQUIRE([XS_PATH_LIBSIDPLAY2])
349 349
350 dnl Be pessimistic. 350 dnl Be pessimistic.
351 builders_available=no 351 builders_available=no
397 header path, or set --exec-prefix to the same prefix as your installation 397 header path, or set --exec-prefix to the same prefix as your installation
398 of libsidplay2. 398 of libsidplay2.
399 ]) 399 ])
400 fi 400 fi
401 401
402 AC_SUBST(BUILDERS_INCLUDES) 402 AC_SUBST([BUILDERS_INCLUDES])
403 AC_SUBST(BUILDERS_LDFLAGS) 403 AC_SUBST([BUILDERS_LDFLAGS])
404 404
405 AC_LANG_POP(C++) 405 AC_LANG_POP([C++])
406 ]) 406 ])
407 407
408 408
409 dnl ------------------------------------------------------------------------- 409 dnl -------------------------------------------------------------------------
410 dnl Test for working reSID builder. 410 dnl Test for working reSID builder.
411 dnl sets $(RESID_LDADD), substitutes @RESID_LDADD@ 411 dnl sets $(RESID_LDADD), substitutes @RESID_LDADD@
412 dnl ------------------------------------------------------------------------- 412 dnl -------------------------------------------------------------------------
413 AC_DEFUN(BUILDERS_FIND_RESID, 413 AC_DEFUN([BUILDERS_FIND_RESID],
414 [ 414 [
415 AC_MSG_CHECKING([for reSID builder module]) 415 AC_MSG_CHECKING([for reSID builder module])
416 AC_LANG_PUSH(C++) 416 AC_LANG_PUSH([C++])
417 MY_TRY_LINK_SAVE 417 MY_TRY_LINK_SAVE
418 418
419 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX" 419 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
420 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES" 420 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
421 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS" 421 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
435 xs_builders="reSID $xs_builders" 435 xs_builders="reSID $xs_builders"
436 AC_DEFINE(HAVE_RESID_BUILDER) 436 AC_DEFINE(HAVE_RESID_BUILDER)
437 RESID_LDADD="-lresid-builder" 437 RESID_LDADD="-lresid-builder"
438 fi 438 fi
439 AC_MSG_RESULT($builders_work) 439 AC_MSG_RESULT($builders_work)
440 AC_SUBST(RESID_LDADD) 440 AC_SUBST([RESID_LDADD])
441 AC_LANG_POP(C++) 441 AC_LANG_POP([C++])
442 ]) 442 ])
443 443
444 444
445 dnl ------------------------------------------------------------------------- 445 dnl -------------------------------------------------------------------------
446 dnl Test for working HardSID builder. 446 dnl Test for working HardSID builder.
447 dnl sets $(HARDSID_LDADD), substitutes @HARDSID_LDADD@ 447 dnl sets $(HARDSID_LDADD), substitutes @HARDSID_LDADD@
448 dnl ------------------------------------------------------------------------- 448 dnl -------------------------------------------------------------------------
449 AC_DEFUN(BUILDERS_FIND_HARDSID, 449 AC_DEFUN([BUILDERS_FIND_HARDSID],
450 [ 450 [
451 AC_MSG_CHECKING([for HardSID builder module]) 451 AC_MSG_CHECKING([for HardSID builder module])
452 AC_LANG_PUSH(C++) 452 AC_LANG_PUSH([C++])
453 MY_TRY_LINK_SAVE 453 MY_TRY_LINK_SAVE
454 454
455 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX" 455 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
456 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES" 456 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
457 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS" 457 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
471 xs_builders="HardSID $xs_builders" 471 xs_builders="HardSID $xs_builders"
472 AC_DEFINE(HAVE_HARDSID_BUILDER) 472 AC_DEFINE(HAVE_HARDSID_BUILDER)
473 HARDSID_LDADD="-lhardsid-builder" 473 HARDSID_LDADD="-lhardsid-builder"
474 fi 474 fi
475 AC_MSG_RESULT($builders_work) 475 AC_MSG_RESULT($builders_work)
476 AC_SUBST(HARDSID_LDADD) 476 AC_SUBST([HARDSID_LDADD])
477 AC_LANG_POP(C++) 477 AC_LANG_POP([C++])
478 ]) 478 ])
479 479
480 480