annotate m4/sidplay.m4 @ 484:fc968772e096 trunk

[svn] Remove ALL Xlib stuff from the skinning engine and use GDK where applicable instead.
author nenolod
date Mon, 23 Jan 2006 12:24:48 -0800
parents b4d1f48817df
children aa6d333a0dd7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
271
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
1 # Configure paths for SID support
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
3 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
4 dnl Try to find a file (or one of more files in a list of dirs).
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
5 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
6
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
7 AC_DEFUN([SIDPLAY_FIND_FILE],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
8 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
9 $3=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
10 for i in $2; do
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
11 for j in $1; do
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
12 if test -r "$i/$j"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
13 $3=$i
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
14 break 2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
15 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
16 done
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
17 done
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
18 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
19
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
20 AC_DEFUN([SIDPLAY_TRY_LINK_SAVE],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
21 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
22 xs_cxx_save="$CXX"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
23 xs_cxxflags_save="$CXXFLAGS"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
24 xs_ldflags_save="$LDFLAGS"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
25 xs_libs_save="$LIBS"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
26 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
27
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
28
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
29 AC_DEFUN([SIDPLAY_TRY_LINK_RESTORE],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
30 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
31 CXX="$xs_cxx_save"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
32 CXXFLAGS="$xs_cxxflags_save"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
33 LDFLAGS="$xs_ldflags_save"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
34 LIBS="$xs_libs_save"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
35 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
36
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
37
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
38 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
39 dnl Try to find SIDPLAY library and header files.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
40 dnl $xs_have_sidplay1 will be "yes" or "no"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
41 dnl @SIDPLAY1_LDADD@ will be substituted with linker parameters
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
42 dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
43 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
44
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
45 AC_DEFUN([XS_PATH_LIBSIDPLAY1],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
46 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
47 AC_MSG_CHECKING([for working SIDPlay1 library and headers])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
48
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
49 AC_LANG_PUSH([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
50
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
51 # Use include path given by user (if any).
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
52 if test -n "$xs_sidplay1_includes"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
53 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
54 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
55 xs_sidplay1_cxxflags=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
56 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
57
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
58 # Use library path given by user (if any).
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
59 if test -n "$xs_sidplay1_library"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
60 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
61 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
62 xs_sidplay1_ldflags=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
63 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
64
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
65 AC_CACHE_VAL(xs_cv_have_sidplay1,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
66 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
67 # Run test compilation with either standard search path
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
68 # or user-defined paths.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
69 SIDPLAY_TRY_LIBSIDPLAY1
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
70 if test "$xs_sidplay1_works" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
71 xs_cv_have_sidplay1="xs_have_sidplay1=yes \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
72 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
73 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
74 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
75 SIDPLAY_FIND_LIBSIDPLAY1
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
76 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
77 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
78
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
79 eval "$xs_cv_have_sidplay1"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
80
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
81 if test "$xs_have_sidplay1" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
82 if test -n "$xs_sidplay1_cxxflags" || test -n "$xs_sidplay1_ldflags"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
83 AC_MSG_RESULT([$xs_sidplay1_cxxflags $xs_sidplay1_ldflags])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
84 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
85 AC_MSG_RESULT([yes])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
86 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
87
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
88 SIDPLAY1_LDADD="$xs_sidplay1_ldflags -lsidplay"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
89 SIDPLAY1_INCLUDES="$xs_sidplay1_cxxflags"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
90 AC_SUBST([SIDPLAY1_LDADD])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
91 AC_SUBST([SIDPLAY1_INCLUDES])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
92 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
93 AC_MSG_RESULT([no])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
94 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
95
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
96 AC_LANG_POP([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
97 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
98
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
99 dnl Functions used by XS_PATH_LIBSIDPLAY1.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
100
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
101 AC_DEFUN([SIDPLAY_FIND_LIBSIDPLAY1],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
102 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
103 # Search common locations where header files might be stored.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
104 xs_sidplay1_incdirs="$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include /opt/sfw/include /opt/csw/include"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
105 SIDPLAY_FIND_FILE(sidplay/sidtune.h, $xs_sidplay1_incdirs, xs_sidplay1_includes)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
106
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
107 # Search common locations where library might be stored.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
108 xs_sidplay1_libdirs="$xs_sidplay1_library /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay /opt/sfw/lib /opt/csw/lib"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
109 SIDPLAY_FIND_FILE(libsidplay.a libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
110 $xs_sidplay1_libdirs, xs_sidplay1_library)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
111
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
112 if test -z "$xs_sidplay1_includes" || test -z "$xs_sidplay1_library"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
113 xs_cv_have_sidplay1="xs_have_sidplay1=no \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
114 xs_sidplay1_ldflags=\"\" xs_sidplay1_cxxflags=\"\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
115 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
116 # Test compilation with found paths.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
117 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
118 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
119 SIDPLAY_TRY_LIBSIDPLAY1
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
120 xs_cv_have_sidplay1="xs_have_sidplay1=$xs_sidplay1_works \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
121 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
122 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
123 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
124 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
125
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
126 AC_DEFUN([SIDPLAY_TRY_LIBSIDPLAY1],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
127 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
128 SIDPLAY_TRY_LINK_SAVE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
129
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
130 CXXFLAGS="$CXXFLAGS $xs_sidplay1_cxxflags"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
131 LDFLAGS="$LDFLAGS $xs_sidplay1_ldflags"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
132 LIBS="$LIBS -lsidplay"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
133
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
134 AC_LINK_IFELSE([AC_LANG_PROGRAM(
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
135 [[#include <sidplay/sidtune.h>]],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
136 [[sidTune* myTest = new sidTune(0);]])],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
137 [xs_sidplay1_works=yes],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
138 [xs_sidplay1_works=no]
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
139 )
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
140
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
141 SIDPLAY_TRY_LINK_RESTORE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
142 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
143
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
144
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
145
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
146
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
147
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
148 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
149 dnl Try to find SIDPLAY2 library and header files.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
150 dnl $xs_have_sidplay2 will be "yes" or "no"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
151 dnl @SIDPLAY_LDADD@ will be substituted with linker parameters
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
152 dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
153 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
154 AC_DEFUN([XS_PATH_LIBSIDPLAY2],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
155 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
156 AC_MSG_CHECKING([for working SIDPlay2 library and headers])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
157
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
158 AC_LANG_PUSH([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
159
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
160 AC_PATH_PROG([PKG_CONFIG], [pkg-config])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
161 if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
162 xs_pkgcfg_knows=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
163 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
164 xs_pkgcfg_knows=no
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
165 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
166
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
167 # Derive sidbuilders path from libsidplay2 root.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
168 if test -n "$xs_sidplay2_library"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
169 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
170 elif test "$xs_pkgcfg_knows" = yes ; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
171 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
172 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
173
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
174 AC_CACHE_VAL(xs_cv_have_sidplay2,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
175 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
176 # Run test compilation with either standard search path
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
177 # or user-defined paths.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
178 xs_sidplay2_ldadd="-lsidplay2"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
179 SIDPLAY_TRY_LIBSIDPLAY2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
180 if test "$xs_sidplay2_works" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
181 xs_cv_have_sidplay2="xs_have_sidplay2=yes \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
182 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
183 xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
184 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
185 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
186 SIDPLAY_FIND_LIBSIDPLAY2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
187 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
188 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
189 eval "$xs_cv_have_sidplay2"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
190 if test "$xs_have_sidplay2" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
191 if test -n "$xs_sidplay2_cxxflags" || test -n "$xs_sidplay2_ldadd"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
192 AC_MSG_RESULT([$xs_sidplay2_cxxflags $xs_sidplay2_ldadd])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
193 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
194 AC_MSG_RESULT([yes])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
195 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
196
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
197 SIDPLAY2_LDADD="$xs_sidplay2_ldadd"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
198 SIDPLAY2_INCLUDES="$xs_sidplay2_cxxflags"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
199 AC_SUBST([SIDPLAY2_LDADD])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
200 AC_SUBST([SIDPLAY2_INCLUDES])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
201 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
202 AC_MSG_RESULT([no])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
203 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
204
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
205 AC_LANG_POP([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
206 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
207
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
208
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
209 dnl Functions used by XS_PATH_LIBSIDPLAY2.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
210 AC_DEFUN([SIDPLAY_FIND_LIBSIDPLAY2],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
211 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
212 # See whether user didn't provide paths.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
213 if test -z "$xs_sidplay2_includes"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
214 if test "$xs_pkgcfg_knows" = yes ; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
215 xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
216 xs_sidplay2_cxxflags=`$PKG_CONFIG --cflags libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
217 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
218 # Search common locations where header files might be stored.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
219 xs_sidplay2_incdirs="$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"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
220 SIDPLAY_FIND_FILE(sidplay/sidplay2.h,$xs_sidplay2_incdirs,xs_sidplay2_includes)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
221 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
222 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
223 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
224 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
225 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
226 if test -z "$xs_sidplay2_library"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
227 if test "$xs_pkgcfg_knows" = yes ; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
228 xs_sidplay2_library=`$PKG_CONFIG --variable=libdir libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
229 xs_sidplay2_ldadd=`$PKG_CONFIG --libs libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
230 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
231 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
232 # Search common locations where library might be stored.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
233 xs_sidplay2_libdirs="$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"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
234 SIDPLAY_FIND_FILE(libsidplay2.la,$xs_sidplay2_libdirs,xs_sidplay2_library)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
235 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
236 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
237 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
238 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
239 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
240 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
241 if test -z "$xs_sidplay2_includes" || test -z "$xs_sidplay2_library"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
242 xs_cv_have_sidplay2="xs_have_sidplay2=no \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
243 xs_sidplay2_ldadd=\"\" xs_sidplay2_cxxflags=\"\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
244 xs_sidplay2_builders=\"\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
245 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
246 # Test compilation with found paths.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
247 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
248 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
249 SIDPLAY_TRY_LIBSIDPLAY2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
250 xs_cv_have_sidplay2="xs_have_sidplay2=$xs_sidplay2_works \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
251 xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
252 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
253 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
254 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
255 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
256
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
257
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
258 AC_DEFUN([SIDPLAY_TRY_LIBSIDPLAY2],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
259 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
260 SIDPLAY_TRY_LINK_SAVE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
261
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
262 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
263 CXXFLAGS="$CXXFLAGS $xs_sidplay2_cxxflags -DHAVE_UNIX"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
264 LDFLAGS="$LDFLAGS $xs_sidplay2_ldadd"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
265
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
266 AC_LINK_IFELSE([AC_LANG_PROGRAM(
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
267 [[#include <sidplay/sidplay2.h>]],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
268 [[sidplay2 *myEngine;]])],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
269 [xs_sidplay2_works=yes],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
270 [xs_sidplay2_works=no]
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
271 )
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
272
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
273 SIDPLAY_TRY_LINK_RESTORE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
274 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
275
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
276
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
277 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
278 dnl Find libsidplay2 builders (sidbuilders) dir.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
279 dnl @BUILDERS_INCLUDES@
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
280 dnl @BUILDERS_LDFLAGS@
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
281 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
282 AC_DEFUN([BUILDERS_FIND],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
283 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
284 AC_MSG_CHECKING([for SIDPlay2 builders directory])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
285
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
286 AC_LANG_PUSH([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
287
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
288 AC_REQUIRE([XS_PATH_LIBSIDPLAY2])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
289
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
290 dnl Be pessimistic.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
291 builders_available=no
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
292
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
293 dnl Sidbuilder headers are included with "builders" prefix.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
294 builders_includedir=$xs_sidplay2_includes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
295 builders_libdir=$xs_sidplay2_builders
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
296
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
297 dnl If libsidplay2 is in standard library search path, we need
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
298 dnl to get an argument whether /usr, /usr/local, etc. Else we
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
299 dnl can only use ${libdir}/sidplay/builders, but then are
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
300 dnl unable to check whether files exist as long as ${exec_prefix}
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
301 dnl is not defined in the configure script. So, this is a bit
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
302 dnl ugly, but a satisfactory fallback default for those who
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
303 dnl define ${prefix} and ${exec_prefix}.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
304 if test -z $builders_libdir; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
305 eval "builders_libdir=$libdir/sidplay/builders"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
306 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
307
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
308 AC_ARG_WITH(sidbuilders,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
309 [ --with-sidbuilders=DIR what the SIDPlay2 builders install PREFIX is],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
310 [builders_includedir="$withval/include"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
311 builders_libdir="$withval/lib/sidplay/builders"])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
312
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
313 AC_ARG_WITH(builders-inc,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
314 [ --with-builders-inc=DIR where the SIDPlay2 builders headers are located],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
315 [builders_includedir="$withval"])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
316
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
317 AC_ARG_WITH(builders-lib,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
318 [ --with-builders-lib=DIR where the SIDPlay2 builders libraries are installed],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
319 [builders_libdir="$withval"])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
320
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
321 if test -n "$builders_includedir"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
322 BUILDERS_INCLUDES="-I$builders_includedir"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
323 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
324
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
325 if test -n "$builders_libdir"; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
326 BUILDERS_LDFLAGS="-L$builders_libdir"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
327 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
328
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
329 if test -d $builders_libdir; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
330 xs_have_sidbuilders_dir=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
331 AC_MSG_RESULT([$builders_libdir])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
332 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
333 xs_have_sidbuilders_dir=no
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
334 AC_MSG_RESULT([$xs_have_sidbuilders_dir])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
335 AC_MSG_ERROR([$builders_libdir not found!
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
336 Check --help on how to specify SIDPlay2 and/or builders library and
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
337 header path, or set --exec-prefix to the same prefix as your installation
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
338 of libsidplay2.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
339 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
340 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
341
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
342 AC_SUBST([BUILDERS_INCLUDES])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
343 AC_SUBST([BUILDERS_LDFLAGS])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
344
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
345 AC_LANG_POP([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
346 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
347
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
348
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
349 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
350 dnl Test for working reSID builder.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
351 dnl sets $(RESID_LDADD), substitutes @RESID_LDADD@
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
352 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
353 AC_DEFUN([BUILDERS_FIND_RESID],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
354 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
355 AC_MSG_CHECKING([for reSID builder module])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
356 AC_LANG_PUSH([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
357 SIDPLAY_TRY_LINK_SAVE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
358
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
359 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
360 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
361 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
362 LIBS="$LIBS -lresid-builder"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
363
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
364 AC_LINK_IFELSE([AC_LANG_PROGRAM(
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
365 [[#include <sidplay/builders/resid.h>]],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
366 [[ReSIDBuilder *sid;]])],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
367 [builders_work=yes],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
368 [builders_work=no]
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
369 )
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
370
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
371 SIDPLAY_TRY_LINK_RESTORE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
372
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
373 if test "$builders_work" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
374 builders_available=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
375 xs_builders="reSID $xs_builders"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
376 AC_DEFINE([HAVE_RESID_BUILDER], [], [resid builder])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
377 RESID_LDADD="-lresid-builder"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
378 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
379 AC_MSG_RESULT($builders_work)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
380 AC_SUBST([RESID_LDADD])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
381 AC_LANG_POP([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
382 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
383
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
384
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
385 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
386 dnl Test for working HardSID builder.
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
387 dnl sets $(HARDSID_LDADD), substitutes @HARDSID_LDADD@
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
388 dnl -------------------------------------------------------------------------
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
389 AC_DEFUN([BUILDERS_FIND_HARDSID],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
390 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
391 AC_MSG_CHECKING([for HardSID builder module])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
392 AC_LANG_PUSH([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
393 SIDPLAY_TRY_LINK_SAVE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
394
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
395 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
396 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
397 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
398 LIBS="$LIBS -lhardsid-builder"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
399
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
400 AC_LINK_IFELSE([AC_LANG_PROGRAM(
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
401 [[#include <sidplay/builders/hardsid.h>]],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
402 [[HardSID *sid;]])],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
403 [builders_work=yes],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
404 [builders_work=no]
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
405 )
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
406
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
407 SIDPLAY_TRY_LINK_RESTORE
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
408
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
409 if test "$builders_work" = yes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
410 builders_available=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
411 xs_builders="HardSID $xs_builders"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
412 AC_DEFINE([HAVE_HARDSID_BUILDER], [], [harsid builder])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
413 HARDSID_LDADD="-lhardsid-builder"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
414 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
415 AC_MSG_RESULT($builders_work)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
416 AC_SUBST([HARDSID_LDADD])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
417 AC_LANG_POP([C++])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
418 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
419
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
420
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
421 dnl AM_PATH_SIDPLAY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
422 dnl Test for SID libraries, and define SIDPLAY_CFLAGS and SIDPLAY_LIBS
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
423 dnl
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
424 AC_DEFUN([AM_PATH_SIDPLAY],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
425 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
426 dnl
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
427 dnl Get the cflags and libraries
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
428 dnl
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
429
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
430 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
431 dnl *** libSIDPlay 1 options
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
432 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
433 AC_ARG_WITH(sidplay1,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
434 [ --with-sidplay1=PREFIX Enable SIDPlay1 with install-PREFIX],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
435 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
436 if test "x$withval" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
437 xs_sidplay1=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
438 xs_sidplay1_library=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
439 xs_sidplay1_includes=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
440 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
441 if test "x$withval" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
442 xs_sidplay1=no
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
443 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
444 xs_sidplay1=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
445 xs_sidplay1_includes="$withval/include"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
446 xs_sidplay1_library="$withval/lib"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
447 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
448 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
449 ],[
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
450 xs_sidplay1=try
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
451 xs_sidplay1_library=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
452 xs_sidplay1_includes=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
453 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
454
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
455 AC_ARG_WITH(sidplay1-inc,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
456 [ --with-sidplay1-inc=DIR Where the SIDPlay1 headers are located],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
457 [xs_sidplay1_includes="$withval"],)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
458
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
459 AC_ARG_WITH(sidplay1-lib,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
460 [ --with-sidplay1-lib=DIR Where the SIDPlay1 library is installed],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
461 [xs_sidplay1_library="$withval"],)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
462
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
463 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
464 dnl *** libSIDPlay 2 options
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
465 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
466 AC_ARG_WITH(sidplay2,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
467 [ --with-sidplay2=PREFIX Enable SIDPlay2 with install-PREFIX],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
468 [
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
469 if test "x$withval" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
470 xs_sidplay2=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
471 xs_sidplay2_library=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
472 xs_sidplay2_includes=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
473 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
474 if test "x$withval" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
475 xs_sidplay2=no
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
476 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
477 xs_sidplay2=yes
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
478 xs_sidplay2_includes="$withval/include"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
479 xs_sidplay2_library="$withval/lib"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
480 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
481 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
482 ],[
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
483 xs_sidplay2=try
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
484 xs_sidplay2_library=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
485 xs_sidplay2_includes=""
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
486 ])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
487
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
488 AC_ARG_WITH(sidplay2-inc,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
489 [ --with-sidplay2-inc=DIR Where the SIDPlay2 headers are located],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
490 [xs_sidplay2_includes="$withval"],)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
491
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
492
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
493 AC_ARG_WITH(sidplay2-lib,
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
494 [ --with-sidplay2-lib=DIR Where the SIDPlay2 library is installed],
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
495 [xs_sidplay2_library="$withval"],)
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
496
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
497 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
498 dnl *** Determine if libraries are wanted and available
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
499 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
500 OPT_SIDPLAY1="no"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
501 if test "x$xs_sidplay1" = xtry; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
502 XS_PATH_LIBSIDPLAY1
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
503 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
504 if test "x$xs_sidplay1" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
505 XS_PATH_LIBSIDPLAY1
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
506 if test "x$xs_have_sidplay1" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
507 AC_MSG_WARN([libSIDPlay1 library and/or headers were not found!])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
508 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
509 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
510 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
511 if test "x$xs_have_sidplay1" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
512 AC_DEFINE([HAVE_SIDPLAY1],[],[sidplay1 available])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
513 OPT_SIDPLAY1="yes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
514 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
515
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
516 OPT_SIDPLAY2="no"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
517 LIBSIDPLAY2_REQUIRED_VERSION="2.1.0"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
518 if test "x$xs_sidplay2" = xtry; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
519 XS_PATH_LIBSIDPLAY2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
520 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
521 if test "x$xs_sidplay2" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
522 XS_PATH_LIBSIDPLAY2
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
523 if test "x$xs_have_sidplay2" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
524 AC_MSG_WARN([libSIDPlay2 library and/or headers were not found!])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
525 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
526 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
527 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
528 if test "x$xs_have_sidplay2" = xyes; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
529 AC_DEFINE([HAVE_SIDPLAY2],[],[sidplay2 available])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
530 OPT_SIDPLAY2="yes"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
531 BUILDERS_FIND
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
532 BUILDERS_FIND_RESID
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
533 BUILDERS_FIND_HARDSID
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
534 if test "x$builders_available" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
535 AC_MSG_WARN([No builder modules were found in the sidbuilders directory!]);
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
536 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
537 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
538
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
539
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
540 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
541 dnl *** Check if we have some emulator library available?
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
542 dnl ***
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
543 if test "x$OPT_SIDPLAY1" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
544 if test "x$OPT_SIDPLAY2" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
545 SIDPLAY_HAVESOMETHING="no"
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
546 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
547 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
548
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
549 if test "x$SIDPLAY_HAVESOMETHING" = xno; then
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
550 ifelse([$2], , :, [$2])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
551 else
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
552 ifelse([$1], , :, [$1])
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
553 fi
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
554
b4d1f48817df [svn] - Remove generated files
nenolod
parents:
diff changeset
555 ])