annotate acinclude.m4 @ 30:fde5167bb736

Updated to have macros for detecting libSIDPlay 1 and 2
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Jun 2003 23:54:00 +0000
parents 183e7cbc1036
children ca6dab6c4ead
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
1 dnl *** These m4-macros are directly ripped from XSIDPlay's acinclude.m4
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.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
3
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
4 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
5 dnl Try to find a file (or one of more files in a list of dirs).
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
6 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
7
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
8 AC_DEFUN(MY_FIND_FILE,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
9 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
10 $3=""
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
11 for i in $2;
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
12 do
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
13 for j in $1;
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
14 do
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
15 if test -r "$i/$j"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
16 $3=$i
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
17 break 2
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
18 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
19 done
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
20 done
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
21 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
22
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
23 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
24
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
25 AC_DEFUN(MY_SUBST,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
26 dnl Substitute an instance of @$1@ with value "$2".
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
27 dnl Example: MY_SUBST(FOO,BAR) <-> @FOO@ => BAR
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
28 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
29 eval "$1=$2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
30 AC_SUBST($1)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
31 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
32
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
33 AC_DEFUN(MY_SUBST_DEF,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
34 dnl Substitute an instance of @$1@ with value "#define $1".
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
35 dnl Example: MY_SUBST_DEF(FOO) <-> @FOO@ => #define FOO
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
36 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
37 eval "$1=\"#define $1\""
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
38 AC_SUBST($1)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
39 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
40
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
41 AC_DEFUN(MY_SUBST_UNDEF,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
42 dnl Substitute an instance of @$1@ with value "#undef $1".
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
43 dnl Example: MY_SUBST_UNDEF(FOO) <-> @FOO@ => #undef FOO
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
44 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
45 eval "$1=\"#undef $1\""
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
46 AC_SUBST($1)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
47 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
48
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
49 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
50 dnl Check whether compiler has a working ``bool'' type.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
51 dnl -------------------------------------------------------------------------
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
53 AC_DEFUN(MY_CHECK_BOOL,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
54 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
55 AC_MSG_CHECKING([for bool])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
56 AC_CACHE_VAL(my_cv_have_bool,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
57 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
58 AC_TRY_COMPILE(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
59 [],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
60 [bool aBool = true;],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
61 [my_cv_have_bool=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
62 [my_cv_have_bool=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
63 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
64 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
65 AC_MSG_RESULT($my_cv_have_bool)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
66 if test "$my_cv_have_bool" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
67 AC_DEFINE(XSID_HAVE_BOOL)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
68 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
69 ])
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 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
72 dnl Check whether C++ library has openmode ios::bin instead of ios::binary.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
73 dnl Will define XSID_HAVE_IOS_BIN if ios::binary is not available.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
74 dnl -------------------------------------------------------------------------
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
76 AC_DEFUN(MY_CHECK_IOS_BIN,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
77 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
78 AC_MSG_CHECKING(whether standard openmode ios::binary is available)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
79 AC_CACHE_VAL(my_cv_have_ios_binary,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
80 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
81 AC_TRY_COMPILE(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
82 [#include <fstream.h>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
83 [ifstream myTest("test",ios::in|ios::binary);],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
84 [my_cv_have_ios_binary=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
85 [my_cv_have_ios_binary=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
86 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
87 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
88 AC_MSG_RESULT($my_cv_have_ios_binary)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
89 if test "$my_cv_have_ios_binary" = no; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
90 AC_DEFINE(XSID_HAVE_IOS_BIN)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
91 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
92 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
93
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
94 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
95 dnl Check whether C++ compiler supports the "nothrow allocator".
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
96 dnl Will define XSID_HAVE_NOTHROW if test code compiles.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
97 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
98
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
99 AC_DEFUN(MY_CHECK_NOTHROW,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
100 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
101 AC_MSG_CHECKING(whether nothrow allocator is available)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
102 AC_CACHE_VAL(my_cv_have_nothrow,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
103 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
104 AC_TRY_COMPILE(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
105 [#include <new>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
106 [char* buf = new(std::nothrow) char[1024];],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
107 [my_cv_have_nothrow=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
108 [my_cv_have_nothrow=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
109 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
110 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
111 AC_MSG_RESULT($my_cv_have_nothrow)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
112 if test "$my_cv_have_nothrow" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
113 AC_DEFINE(XSID_HAVE_NOTHROW)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
114 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
115 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
116
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 Pass C++ compiler options to libtool which supports C only.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
119 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
120
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
121 AC_DEFUN(MY_PROG_LIBTOOL,
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 [
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
123 my_save_cc="$CC"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
124 my_save_cflags="$CFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
125 CC="$CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
126 CFLAGS="$CXXFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
127 AM_PROG_LIBTOOL
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
128 CC="$my_save_cc"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
129 CFLAGS="$my_save_cflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
130 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
131
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
132 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
133
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
134 AC_DEFUN(MY_TRY_LINK_SAVE,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
135 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
136 my_cxx_save="$CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
137 my_cxxflags_save="$CXXFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
138 my_ldflags_save="$LDFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
139 my_libs_save="$LIBS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
140 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
141
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
142 AC_DEFUN(MY_TRY_LINK_RESTORE,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
143 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
144 CXX="$my_cxx_save"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
145 CXXFLAGS="$my_cxxflags_save"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
146 LDFLAGS="$my_ldflags_save"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
147 LIBS="$my_libs_save"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
148 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
149
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
150 AC_DEFUN(MY_PROG_PKGCONFIG,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
151 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
152 AC_PATH_PROG(PKG_CONFIG, pkg-config, "")
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
153 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
154
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
155 AC_DEFUN(MY_NEED_PKGCONFIG,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
156 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
157 AC_REQUIRE([MY_PROG_PKGCONFIG])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
158 if test -z "$PKG_CONFIG"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
159 AC_MSG_ERROR([pkg-config not found. See http://pkgconfig.sourceforge.net])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
160 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
161 if ! $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
162 AC_MSG_ERROR([pkg-config too old; version 0.5 or better required.])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
163 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
164 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
165
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
166 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
167 dnl Try to find SIDPLAY library and header files.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
168 dnl $my_cv_have_sidplay will be "yes" or "no"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
169 dnl @SIDPLAY_LDADD@ will be substituted with linker parameters
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
170 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
171 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
172
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
173 AC_DEFUN(MY_PATH_LIBSIDPLAY,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
174 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
175 AC_MSG_CHECKING([for working SIDPLAY library and headers])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
176 AC_REQUIRE([MY_ARGS_LIBSIDPLAY])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
177
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
178 # Use include path given by user (if any).
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
179 if test -n "$my_sidplay_includes"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
180 my_sidplay_cxxflags="-I$my_sidplay_includes"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
181 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
182 my_sidplay_cxxflags=""
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
183 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
184
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
185 # Use library path given by user (if any).
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
186 if test -n "$my_sidplay_library"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
187 my_sidplay_ldflags="-L$my_sidplay_library"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
188 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
189 my_sidplay_ldflags=""
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
190 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
191
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
192 AC_CACHE_VAL(my_cv_have_sidplay,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
193 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
194 # Run test compilation with either standard search path
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
195 # or user-defined paths.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
196 MY_TRY_LIBSIDPLAY
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
197 if test "$my_sidplay_works" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
198 my_cv_have_sidplay="my_have_sidplay=yes \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
199 my_sidplay_cxxflags=\"$my_sidplay_cxxflags\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
200 my_sidplay_ldflags=\"$my_sidplay_ldflags\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
201 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
202 MY_FIND_LIBSIDPLAY
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
203 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
204 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
205 eval "$my_cv_have_sidplay"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
206 if test "$my_have_sidplay" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
207 if test -n "$my_sidplay_cxxflags" || test -n "$my_sidplay_ldflags"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
208 AC_MSG_RESULT([$my_sidplay_cxxflags $my_sidplay_ldflags])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
209 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
210 AC_MSG_RESULT([yes])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
211 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
212 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
213 AC_MSG_RESULT([no])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
214 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
215 SIDPLAY_LDADD="$my_sidplay_ldflags -lsidplay"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
216 SIDPLAY_INCLUDES="$my_sidplay_cxxflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
217 AC_SUBST(SIDPLAY_LDADD)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
218 AC_SUBST(SIDPLAY_INCLUDES)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
219 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
220
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
221 dnl Functions used by MY_PATH_LIBSIDPLAY.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
222
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
223 AC_DEFUN(MY_FIND_LIBSIDPLAY,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
224 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
225 # Search common locations where header files might be stored.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
226 my_sidplay_incdirs="$my_sidplay_includes /usr/include /usr/local/include \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
227 /usr/lib/sidplay/include /usr/local/lib/sidplay/include"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
228 MY_FIND_FILE(sidplay/sidtune.h, $my_sidplay_incdirs, \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
229 my_sidplay_includes)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
230
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
231 # Search common locations where library might be stored.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
232 my_sidplay_libdirs="$my_sidplay_library /usr/lib /usr/lib/sidplay \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
233 /usr/local/lib/sidplay"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
234 MY_FIND_FILE(libsidplay.a libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
235 $my_sidplaylibdirs, my_sidplay_library)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
236
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
237 if test -z "$my_sidplay_includes" || test -z "$my_sidplay_library"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
238 my_cv_have_sidplay="my_have_sidplay=no \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
239 my_sidplay_ldflags=\"\" my_sidplay_cxxflags=\"\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
240 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
241 # Test compilation with found paths.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
242 my_sidplay_ldflags="-L$my_sidplay_library"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
243 my_sidplay_cxxflags="-I$my_sidplay_includes"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
244 MY_TRY_LIBSIDPLAY
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
245 my_cv_have_sidplay="my_have_sidplay=$my_sidplay_works \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
246 my_sidplay_ldflags=\"$my_sidplay_ldflags\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
247 my_sidplay_cxxflags=\"$my_sidplay_cxxflags\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
248 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
250
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
251 AC_DEFUN(MY_TRY_LIBSIDPLAY,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
252 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
253 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
254
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
255 CXXFLAGS="$CXXFLAGS $my_sidplay_cxxflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
256 LDFLAGS="$LDFLAGS $my_sidplay_ldflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
257 LIBS="$LIBS -lsidplay"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
259 AC_TRY_LINK(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
260 [#include <sidplay/sidtune.h>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
261 [sidTune* myTest = new sidTune(0);],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
262 [my_sidplay_works=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
263 [my_sidplay_works=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
264 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
265 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
266 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
268 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
269 dnl Try to find SIDPLAY2 library and header files.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
270 dnl $my_cv_have_sidplay2 will be "yes" or "no"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
271 dnl @SIDPLAY_LDADD@ will be substituted with linker parameters
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
272 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
273 dnl -------------------------------------------------------------------------
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
274
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
275 AC_DEFUN(MY_PATH_LIBSIDPLAY2,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
276 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
277 AC_MSG_CHECKING([for working SIDPLAY2 library and headers])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
278
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
279 AC_REQUIRE([MY_PROG_PKGCONFIG])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
280 if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
281 my_pkgcfg_knows=yes
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
282 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
283 my_pkgcfg_knows=no
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
284 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
285 dnl echo "(" pkg-config knows = $my_pkgcfg_knows ")"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
286
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
287 AC_REQUIRE([MY_ARGS_LIBSIDPLAY])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
288 # Share --with-* args with libsidplay1.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
289 my_sidplay2_library="$my_sidplay_library"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
290 my_sidplay2_includes="$my_sidplay_includes"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
291
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
292 # Derive sidbuilders path from libsidplay2 root.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
293 if test -n "$my_sidplay2_library"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
294 my_sidplay2_builders="$my_sidplay2_library/sidplay/builders"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
295 elif test "$my_pkgcfg_knows" = yes ; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
296 my_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
297 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
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 AC_CACHE_VAL(my_cv_have_sidplay2,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
300 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
301 # Run test compilation with either standard search path
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
302 # or user-defined paths.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
303 my_sidplay2_ldadd="-lsidplay2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
304 MY_TRY_LIBSIDPLAY2
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
305 if test "$my_sidplay2_works" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
306 my_cv_have_sidplay2="my_have_sidplay2=yes \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
307 my_sidplay2_cxxflags=\"$my_sidplay2_cxxflags\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
308 my_sidplay2_ldadd=\"$my_sidplay2_ldadd\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
309 my_sidplay2_builders=\"$my_sidplay2_builders\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
310 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
311 MY_FIND_LIBSIDPLAY2
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
312 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
313 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
314 eval "$my_cv_have_sidplay2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
315 if test "$my_have_sidplay2" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
316 if test -n "$my_sidplay2_cxxflags" || test -n "$my_sidplay2_ldadd"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
317 AC_MSG_RESULT([$my_sidplay2_cxxflags $my_sidplay2_ldadd])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
318 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
319 AC_MSG_RESULT([yes])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
320 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
321 else
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
322 AC_MSG_RESULT([no])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
323 fi
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
324 SIDPLAY_LDADD="$my_sidplay2_ldadd"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
325 SIDPLAY_INCLUDES="$my_sidplay2_cxxflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
326 AC_SUBST(SIDPLAY_LDADD)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
327 AC_SUBST(SIDPLAY_INCLUDES)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
328 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
329
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
330 dnl Functions used by MY_PATH_LIBSIDPLAY.
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
331
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
332 AC_DEFUN(MY_FIND_LIBSIDPLAY2,
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
333 [
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
334 # See whether user didn't provide paths.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
335 if test -z "$my_sidplay2_includes"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
336 if test "$my_pkgcfg_knows" = yes ; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
337 my_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
338 my_sidplay2_cxxflags=`$PKG_CONFIG --cflags libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
339 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
340 # Search common locations where header files might be stored.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
341 my_sidplay2_incdirs="$my_sidplay2_includes $my_sidplay2_includes/include"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
342 MY_FIND_FILE(sidplay/sidplay2.h,$my_sidplay2_incdirs,my_sidplay2_includes)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
343 my_sidplay2_cxxflags="-I$my_sidplay2_includes"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
344 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
345 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
346 my_sidplay2_cxxflags="-I$my_sidplay2_includes"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
347 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
348 if test -z "$my_sidplay2_library"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
349 if test "$my_pkgcfg_knows" = yes ; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
350 my_sidplay2_library=`$PKG_CONFIG --variable=libdir libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
351 my_sidplay2_ldadd=`$PKG_CONFIG --libs libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
352 my_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
353 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
354 # Search common locations where library might be stored.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
355 my_sidplay2_libdirs="$my_sidplay2_library $my_sidplay2_library/lib \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
356 $my_sidplay2_library/src"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
357 MY_FIND_FILE(libsidplay2.la,$my_sidplay2_libdirs,my_sidplay2_library)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
358 my_sidplay2_ldadd="-L$my_sidplay2_library -lsidplay2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
359 my_sidplay2_builders="$my_sidplay2_library/sidplay/builders"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
360 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
361 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
362 my_sidplay2_ldadd="-L$my_sidplay2_library -lsidplay2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
363 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
364 if test -z "$my_sidplay2_includes" || test -z "$my_sidplay2_library"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
365 my_cv_have_sidplay2="my_have_sidplay2=no \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
366 my_sidplay2_ldadd=\"\" my_sidplay2_cxxflags=\"\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
367 my_sidplay2_builders=\"\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
368 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
369 # Test compilation with found paths.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
370 my_sidplay2_ldadd="-L$my_sidplay2_library -lsidplay2"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
371 my_sidplay2_cxxflags="-I$my_sidplay2_includes"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
372 MY_TRY_LIBSIDPLAY2
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
373 my_cv_have_sidplay2="my_have_sidplay2=$my_sidplay2_works \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
374 my_sidplay2_ldadd=\"$my_sidplay2_ldadd\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
375 my_sidplay2_cxxflags=\"$my_sidplay2_cxxflags\" \
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
376 my_sidplay2_builders=\"$my_sidplay2_builders\" "
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
377 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
378 echo "DEBUG: $my_sidplay2_cxxflags"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
379 echo "DEBUG: $my_sidplay2_ldadd"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
380 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
381
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
382 AC_DEFUN(MY_TRY_LIBSIDPLAY2,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
383 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
384 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
385
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
386 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
387 CXXFLAGS="$CXXFLAGS $my_sidplay2_cxxflags -DHAVE_UNIX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
388 LDFLAGS="$LDFLAGS $my_sidplay2_ldadd"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
389
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
390 AC_TRY_LINK(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
391 [#include <sidplay/sidplay2.h>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
392 [sidplay2 *myEngine;],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
393 [my_sidplay2_works=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
394 [my_sidplay2_works=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
395 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
396 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
397 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
398
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
399 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
400 dnl Find libsidplay2 builders (sidbuilders) dir.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
401 dnl @BUILDERS_INCLUDES@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
402 dnl @BUILDERS_LDFLAGS@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
403 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
404 AC_DEFUN(BUILDERS_FIND,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
405 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
406 AC_MSG_CHECKING([for SIDPLAY2 builders directory])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
407 AC_REQUIRE([MY_PATH_LIBSIDPLAY2])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
408
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
409 dnl Be pessimistic.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
410 builders_available=no
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
411
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
412 dnl Sidbuilder headers are included with "builders" prefix.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
413 builders_includedir=$my_sidplay2_includes
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
414 builders_libdir=$my_sidplay2_builders
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
415
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
416 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
417 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
418 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
419 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
420 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
421 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
422 dnl define ${prefix} and ${exec_prefix}.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
423 if test -z $builders_libdir; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
424 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
425 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
426
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
427 AC_ARG_WITH(sidbuilders,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
428 [ --with-sidbuilders=DIR what the SIDPLAY2 builders install PREFIX is],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
429 [builders_includedir="$withval/include"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
430 builders_libdir="$withval/lib/sidplay/builders"]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
431 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
432 AC_ARG_WITH(builders-inc,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
433 [ --with-builders-inc=DIR where the SIDPLAY2 builders headers are located],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
434 [builders_includedir="$withval"]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
435 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
436 AC_ARG_WITH(builders-lib,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
437 [ --with-builders-lib=DIR where the SIDPLAY2 builders libraries are installed],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
438 [builders_libdir="$withval"]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
439 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
440
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
441 if test -n "$builders_includedir"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
442 BUILDERS_INCLUDES="-I$builders_includedir"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
443 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
444 if test -n "$builders_libdir"; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
445 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
446 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
447 if test -d $builders_libdir; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
448 my_have_sidbuilders_dir=yes
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
449 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
450 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
451 my_have_sidbuilders_dir=no
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
452 AC_MSG_RESULT([$my_have_sidbuilders_dir])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
453 AC_MSG_ERROR([$builders_libdir not found!
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
454 Check --help on how to specify SIDPLAY2 and/or builders library and
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
455 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
456 of libsidplay2.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
457 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
458 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
459 AC_SUBST(BUILDERS_INCLUDES)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
460 AC_SUBST(BUILDERS_LDFLAGS)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
461 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
462
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
463 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
464 dnl Test for working reSID builder.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
465 dnl sets $(RESID_LDADD), substitutes @RESID_LDADD@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
466 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
467 AC_DEFUN(BUILDERS_FIND_RESID,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
468 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
469 AC_MSG_CHECKING([for reSID builder module])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
470 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
471
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
472 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
473 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
474 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
475 LIBS="$LIBS -lresid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
476
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
477 AC_TRY_LINK(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
478 [#include <sidplay/builders/resid.h>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
479 [ReSIDBuilder *sid;],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
480 [builders_work=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
481 [builders_work=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
482 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
483 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
484
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
485 if test "$builders_work" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
486 builders_available=yes
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
487 AC_DEFINE(XSID_HAVE_RESID_BUILDER)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
488 RESID_LDADD="-lresid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
489 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
490 AC_MSG_RESULT($builders_work)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
491 AC_SUBST(RESID_LDADD)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
492 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
493
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
494 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
495 dnl Test for working HardSID builder.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
496 dnl sets $(HARDSID_LDADD), substitutes @HARDSID_LDADD@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
497 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
498 AC_DEFUN(BUILDERS_FIND_HARDSID,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
499 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
500 AC_MSG_CHECKING([for HardSID builder module])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
501 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
502
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
503 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
504 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
505 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
506 LIBS="$LIBS -lhardsid-builder"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
507
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
508 AC_TRY_LINK(
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
509 [#include <sidplay/builders/hardsid.h>],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
510 [HardSID *sid;],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
511 [builders_work=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
512 [builders_work=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
513 )
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
514 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
515
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
516 if test "$builders_work" = yes; then
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
517 builders_available=yes
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
518 AC_DEFINE(XSID_HAVE_HARDSID_BUILDER)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
519 HARDSID_LDADD="-lhardsid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
520 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
521 AC_MSG_RESULT($builders_work)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
522 AC_SUBST(HARDSID_LDADD)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
523 ])