annotate acinclude.m4 @ 676:60782f6c2bc8

Cleaned up the libSIDPlay-related Autoconf test m4 macros.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 10 May 2008 01:19:49 +0300
parents 06820523d770
children 6843b69895d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
52
66f8d711cb95 Cleanups in docs
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
1 dnl *** These m4-macros are ripped from XSIDPLAY v1.6.5's acinclude.m4
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
2 dnl *** (C) Copyright 2002 Michael Schwendt, licensed under GNU GPL v2.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
3 dnl ***
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
4 dnl *** Updated for new automake/autoconf plus namespace, added portability
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
5 dnl *** fixes and other minor changes by Matti 'ccr' Hamalainen
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
6
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
7 AC_DEFUN([XS_FIND_FILE],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
8 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
9 $3=""
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
10 for i in $2; do
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
11 for j in $1; do
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
12 if test -r "$i/$j"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
13 $3="$i"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
14 break 2
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
15 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
16 done
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
17 done
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
18 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
19
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
20
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
21 AC_DEFUN([XS_TRY_LIBRARY],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
22 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
23 # xs_try_library ( $1:$2:$3:$4:$5:$6 )
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
24 AC_LANG_ASSERT([C++])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
25 m4_ifvaln([$2], [xs_cxxflags_save="$CXXFLAGS"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
26 CXXFLAGS="$CXXFLAGS $2"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
27 m4_ifvaln([$3], [xs_ldflags_save="$LDFLAGS"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
28 LDFLAGS="$LDFLAGS $3"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
29 m4_ifvaln([$4], [xs_libs_save="$LIBS"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
30 LIBS="$LIBS -l$4"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
31 AC_LINK_IFELSE(
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
32 [
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
33 AC_LANG_PROGRAM(
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
34 [#include <$5>],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
35 [$6]
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
36 )],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
37 [xs_$1_works="yes"],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
38 [xs_$1_works="no"]
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
39 )
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
40 m4_ifvaln([$2], [CXXFLAGS="$xs_cxxflags_save"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
41 m4_ifvaln([$3], [LDFLAGS="$xs_ldflags_save"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
42 m4_ifvaln([$4], [LIBS="$xs_libs_save"])dnl
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
43 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
44
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
45
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
46 AC_DEFUN([XS_LIB_RESULT],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
47 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
48 # xs_lib_result ( $1:$2:$3 )
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
49 define([Name], [translit([$1], [a-z], [A-Z])])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
50 if test "x$xs_have_$1" = "xyes"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
51 if test "x$xs_$1_cxxflags" != "x" || test "x$xs_$1_ldflags" != "x"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
52 AC_MSG_RESULT([$xs_$1_cxxflags $2 $xs_$1_ldflags $3])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
53 else
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
54 AC_MSG_RESULT([yes])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
55 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
56
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
57 Name[]_LIBS="$xs_$1_ldflags $2"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
58 Name[]_CFLAGS="$xs_$1_cxxflags $3"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
59 AC_SUBST(Name[]_LIBS)dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
60 AC_SUBST(Name[]_CFLAGS)dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
61 else
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
62 AC_MSG_RESULT([no])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
63 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
64 ])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
65
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
66
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
67 AC_DEFUN([XS_PROG_PKGCONFIG],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
68 [
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
69 AC_PATH_PROG([PKG_CONFIG], [pkg-config])dnl
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
70 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
71
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
72
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
73 AC_DEFUN([XS_ARG_WITH], [dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
74 # xs_arg_with ( $1:$2:$3 )
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
75 define([Name], [translit([$1], [a-z], [A-Z])])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
76 AH_TEMPLATE(HAVE_[]Name, [Define if you have and want to use $2])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
77 AC_ARG_WITH([$1],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
78 [ --with-$1=PREFIX Enable $2 with install-PREFIX], [dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
79 if test "x$withval" = "xyes"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
80 xs_use_$1="yes"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
81 xs_$1_library=""
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
82 xs_$1_includes=""
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
83 else
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
84 if test "x$withval" = "xno"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
85 xs_use_$1="no"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
86 else
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
87 xs_use_$1="yes"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
88 xs_$1_includes="$withval/include"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
89 xs_$1_library="$withval/lib"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
90 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
91 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
92 ],[dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
93 xs_use_$1="try"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
94 xs_$1_library=""
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
95 xs_$1_includes=""
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
96 ])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
97 AC_ARG_WITH([$1-inc],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
98 [ --with-$1-inc=DIR Where the $2 headers are located],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
99 [xs_$1_includes="$withval"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
100 AC_ARG_WITH([$1-lib],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
101 [ --with-$1-lib=DIR Where the $2 library is installed],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
102 [xs_$1_library="$withval"])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
103
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
104 dnl Okay, handle this
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
105 xs_have_$1="no"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
106 if test "x$xs_use_$1" = "xtry"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
107 $3
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
108 elif test "x$xs_use_$1" = "xyes"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
109 $3
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
110 if test "x$xs_have_$1" = "xno"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
111 AC_MSG_ERROR([$2 library and/or headers were not found!])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
112 fi
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
113 fi
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
114 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
115
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
116
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
117 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
118 dnl Try to find SIDPLAY library and header files.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
119 dnl $xs_have_sidplay1 will be "yes" or "no"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
120 dnl @SIDPLAY1_LIBS@ will be substituted with linker parameters
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
121 dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
122 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
123
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
124 AC_DEFUN([XS_PATH_LIBSIDPLAY1],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
125 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
126 AC_MSG_CHECKING([for working SIDPlay1 library and headers])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
127
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
128 AC_LANG_PUSH([C++])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
129
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
130 dnl Use include path given by user (if any).
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
131 if test "x$xs_sidplay1_includes" != "x"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
132 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
133 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
134 xs_sidplay1_cxxflags=""
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
135 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
136
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
137 dnl Use library path given by user (if any).
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
138 if test "x$xs_sidplay1_library" != "x"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
139 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
140 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
141 xs_sidplay1_ldflags=""
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
142 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
143
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
144 AC_CACHE_VAL([xs_cv_have_sidplay1],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
145 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
146 dnl Run test compilation with either standard search path
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
147 dnl or user-defined paths.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
148 XS_TRY_LIBSIDPLAY1
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
149 if test "x$xs_sidplay1_works" = "xyes"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
150 xs_cv_have_sidplay1="xs_have_sidplay1=yes \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
151 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
152 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
153 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
154 XS_FIND_LIBSIDPLAY1
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
155 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
156 ])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
157 eval "$xs_cv_have_sidplay1"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
158 XS_LIB_RESULT([sidplay1], [-lsidplay], [])
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
159 AC_LANG_POP([C++])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
160 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
161
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
162 dnl Functions used by XS_PATH_LIBSIDPLAY1.
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
163
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
164 AC_DEFUN([XS_FIND_LIBSIDPLAY1],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
165 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
166 dnl Search common locations where header files might be stored.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
167 XS_FIND_FILE([xs_sidplay1_includes], [sidplay/sidtune.h],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
168 [$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
169
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
170 dnl Search common locations where library might be stored.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
171 XS_FIND_FILE([xs_sidplay1_library],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
172 [libsidplay.a libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
173 [$xs_sidplay1_library /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay /opt/sfw/lib /opt/csw/lib])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
174
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
175 if test "x$xs_sidplay1_includes" = "x" || test "x$xs_sidplay1_library" = "x"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
176 xs_cv_have_sidplay1="xs_have_sidplay1=no \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
177 xs_sidplay1_ldflags=\"\" xs_sidplay1_cxxflags=\"\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
178 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
179 dnl Test compilation with found paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
180 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
181 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
182 XS_TRY_LIBSIDPLAY1
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
183 xs_cv_have_sidplay1="xs_have_sidplay1=$xs_sidplay1_works \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
184 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
185 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
186 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
189 AC_DEFUN([XS_TRY_LIBSIDPLAY1],[
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
190 XS_TRY_LIBRARY([sidplay1], [$xs_sidplay1_cxxflags], [$xs_sidplay1_ldflags],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
191 [sidplay], [sidplay/sidtune.h], [sidTune* myTest = new sidTune(0);])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
192 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
194
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
195 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
196 dnl Try to find SIDPLAY2 library and header files.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
197 dnl $xs_have_sidplay2 will be "yes" or "no"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
198 dnl @SIDPLAY_LIBS@ will be substituted with linker parameters
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
199 dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
200 dnl -------------------------------------------------------------------------
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
201 AC_DEFUN([XS_PATH_LIBSIDPLAY2],
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
202 [
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
203 AC_MSG_CHECKING([for working SIDPlay2 library and headers])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
205 AC_LANG_PUSH([C++])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
206
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
207 AC_REQUIRE([XS_PROG_PKGCONFIG])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
208 if test "x$PKG_CONFIG" != "x" && $PKG_CONFIG --atleast-version m4_ifval([$1], [$1], [2.1.0]) libsidplay2; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
209 xs_pkgcfg_knows="yes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
210 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
211 xs_pkgcfg_knows="no"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
212 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
214 dnl Derive sidbuilders path from libsidplay2 root.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
215 if test "x$xs_sidplay2_library" != "x"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
216 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
217 elif test "x$xs_pkgcfg_knows" = "xyes" ; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
218 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
219 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
221 AC_CACHE_VAL([xs_cv_have_sidplay2],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
222 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
223 dnl Run test compilation with either standard search path
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
224 dnl or user-defined paths.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
225 xs_sidplay2_ldflags="-lsidplay2"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
226 XS_TRY_LIBSIDPLAY2
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
227 if test "x$xs_sidplay2_works" = "xyes"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
228 xs_cv_have_sidplay2="xs_have_sidplay2=yes \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
229 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
230 xs_sidplay2_ldflags=\"$xs_sidplay2_ldflags\" \
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
231 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
232 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
233 XS_FIND_LIBSIDPLAY2
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
234 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
235 ])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
236 eval "$xs_cv_have_sidplay2"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
237 XS_LIB_RESULT([sidplay2], [], [])
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
238 AC_LANG_POP([C++])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
239 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
241
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
242 dnl Functions used by XS_PATH_LIBSIDPLAY2.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
243 AC_DEFUN([XS_FIND_LIBSIDPLAY2],
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
244 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
245 dnl See whether user didn't provide paths.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
246 if test "x$xs_sidplay2_includes" = "x"; then
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
247 if test "x$xs_pkgcfg_knows" = "xyes" ; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
248 xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2`
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
249 xs_sidplay2_cxxflags=`$PKG_CONFIG --cflags libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
250 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
251 dnl Search common locations where header files might be stored.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
252 XS_FIND_FILE([xs_sidplay2_includes], [sidplay/sidplay2.h],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
253 [$xs_sidplay2_includes $xs_sidplay2_includes/include /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
254 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
255 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
256 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
257 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
258 fi
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
259 if test "x$xs_sidplay2_library" = "x"; then
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
260 if test "x$xs_pkgcfg_knows" = "xyes" ; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
261 xs_sidplay2_library=`$PKG_CONFIG --variable=libdir libsidplay2`
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
262 xs_sidplay2_ldflags=`$PKG_CONFIG --libs libsidplay2`
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
263 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
264 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
265 dnl Search common locations where library might be stored.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
266 XS_FIND_FILE([xs_sidplay2_library], [libsidplay2.la],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
267 [$xs_sidplay2_library $xs_sidplay2_library/lib $xs_sidplay2_library/src /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay /opt/sfw/lib /opt/csw/lib])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
268 xs_sidplay2_ldflags="-L$xs_sidplay2_library -lsidplay2"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
269 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
270 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
271 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
272 xs_sidplay2_ldflags="-L$xs_sidplay2_library -lsidplay2"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
273 fi
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
274 if test "x$xs_sidplay2_includes" = "x" || test "x$xs_sidplay2_library" = "x"; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
275 xs_cv_have_sidplay2="xs_have_sidplay2=no \
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
276 xs_sidplay2_ldflags=\"\" xs_sidplay2_cxxflags=\"\" \
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
277 xs_sidplay2_builders=\"\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
278 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
279 dnl Test compilation with found paths.
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
280 xs_sidplay2_ldflags="-L$xs_sidplay2_library -lsidplay2"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
281 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
282 XS_TRY_LIBSIDPLAY2
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
283 xs_cv_have_sidplay2="xs_have_sidplay2=$xs_sidplay2_works \
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
284 xs_sidplay2_ldflags=\"$xs_sidplay2_ldflags\" \
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
285 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
286 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
287 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
288 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
289
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
290
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
291 AC_DEFUN([XS_TRY_LIBSIDPLAY2],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
292 [
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
293 XS_TRY_LIBRARY([sidplay2],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
294 [$xs_sidplay2_cxxflags -DHAVE_UNIX], [$xs_sidplay2_ldflags],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
295 [sidplay2], [sidplay/sidplay2.h], [sidplay2 *myEngine;])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
296 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
298
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
299 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
300 dnl Find libsidplay2 builders (sidbuilders) dir.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
301 dnl @BUILDERS_CFLAGS@
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
302 dnl @BUILDERS_LDFLAGS@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
303 dnl -------------------------------------------------------------------------
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
304 AC_DEFUN([XS_BUILDERS_CHECK],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
305 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
306 AC_MSG_CHECKING([for SIDPlay2 builders directory])
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
307 AC_LANG_ASSERT([C++])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
308 AC_REQUIRE([XS_PATH_LIBSIDPLAY2])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
309
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
310 dnl Be pessimistic.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
311 builders_available="no"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
312
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
313 dnl Sidbuilder headers are included with "builders" prefix.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
314 builders_includedir="$xs_sidplay2_includes"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
315 builders_libdir="$xs_sidplay2_builders"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
316
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
317 dnl If libsidplay2 is in standard library search path, we need
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
318 dnl to get an argument whether /usr, /usr/local, etc. Else we
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
319 dnl can only use ${libdir}/sidplay/builders, but then are
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
320 dnl unable to check whether files exist as long as ${exec_prefix}
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
321 dnl is not defined in the configure script. So, this is a bit
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
322 dnl ugly, but a satisfactory fallback default for those who
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
323 dnl define ${prefix} and ${exec_prefix}.
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
324 if test "x$builders_libdir" = "x"; then
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
325 eval "builders_libdir=$libdir/sidplay/builders"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
326 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
327
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
328 AC_ARG_WITH([sidbuilders],
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
329 [ --with-sidbuilders=DIR what the SIDPlay2 builders install PREFIX is],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
330 [builders_includedir="$withval/include"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
331 builders_libdir="$withval/lib/sidplay/builders"])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
332
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
333 AC_ARG_WITH([builders-inc],
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
334 [ --with-builders-inc=DIR where the SIDPlay2 builders headers are located],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
335 [builders_includedir="$withval"])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
336
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
337 AC_ARG_WITH([builders-lib],
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
338 [ --with-builders-lib=DIR where the SIDPlay2 builders libraries are installed],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
339 [builders_libdir="$withval"])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
340
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
341 if test "x$builders_includedir" != "x"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
342 BUILDERS_CFLAGS="-I$builders_includedir"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
343 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
344
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
345 if test "x$builders_libdir" != "x"; then
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
346 BUILDERS_LDFLAGS="-L$builders_libdir"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
347 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
348
386
3cda19cf5181 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 248
diff changeset
349 if test -d "$builders_libdir"; then
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
350 xs_have_sidbuilders_dir="yes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
351 AC_MSG_RESULT([$builders_libdir])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
352 else
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
353 xs_have_sidbuilders_dir="no"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
354 AC_MSG_RESULT([$xs_have_sidbuilders_dir])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
355 AC_MSG_ERROR([$builders_libdir not found!
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
356 Check --help on how to specify SIDPlay2 and/or builders library and
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
357 header path, or set --exec-prefix to the same prefix as your installation
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
358 of libsidplay2.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
359 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
360 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
361
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
362 AC_SUBST([BUILDERS_CFLAGS])
248
a66c634b222a Macro quotation cleanup to satisfy Automake 1.8 and friends.
Matti Hamalainen <ccr@tnsp.org>
parents: 200
diff changeset
363 AC_SUBST([BUILDERS_LDFLAGS])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
364 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
365
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
366
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
367 dnl -------------------------------------------------------------------------
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
368 dnl Test for working builders
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
369 dnl -------------------------------------------------------------------------
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
370 AC_DEFUN([XS_BUILDERS_FIND], [dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
371 define([Name], [translit([$1], [a-z], [A-Z])])dnl
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
372 AH_TEMPLATE(HAVE_[]Name[]_BUILDER, [Define if you have $1 for libSIDPlay 2])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
373 AC_MSG_CHECKING([for $1 builder module])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
374 XS_TRY_LIBRARY([builders], [$BUILDERS_CFLAGS], [$BUILDERS_LDFLAGS],
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
375 [$2], [sidplay/builders/$3], [$4 *sid;])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
376 if test "x$xs_builders_works" = "xyes"; then
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
377 xs_builders_available="yes"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
378 xs_builders="$1 $xs_builders"
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
379 AC_DEFINE(HAVE_[]Name[]_BUILDER)
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
380 BUILDERS_LIBS="$BUILDERS_LIBS -l$2"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
381 fi
676
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
382 AC_MSG_RESULT([$xs_builders_works])
60782f6c2bc8 Cleaned up the libSIDPlay-related Autoconf test m4 macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
383 AC_SUBST([BUILDERS_LIBS])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
384 ])