annotate acinclude.m4 @ 125:532ec0ad5e59

Added support/detection for libNanoSID.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 14 Jan 2004 03:56:01 +0000
parents edec1818cf48
children 89844080b44b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
52
66f8d711cb95 Cleanups in docs
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
1 dnl *** These m4-macros are ripped from XSIDPLAY v1.6.5's acinclude.m4
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
2 dnl *** (C) Copyright 2002 Michael Schwendt, licensed under GNU GPL v2.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
3 dnl *** Updated for new automake/autoconf plus namespace and other
52
66f8d711cb95 Cleanups in docs
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
4 dnl *** minor fixes and changes by Matti 'ccr' Hämäläinen (C) 2003 TNSP
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
5
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 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
8 dnl -------------------------------------------------------------------------
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 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
11 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
12 $3=""
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
13 for i in $2; do
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
14 for j in $1; do
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
15 if test -r "$i/$j"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
16 $3=$i
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
17 break 2
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
18 fi
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
19 done
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
20 done
30
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 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
51 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
52
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
53 AC_DEFUN(MY_PROG_LIBTOOL,
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
55 xs_save_cc="$CC"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
56 xs_save_cflags="$CFLAGS"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
57 CC="$CXX"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
58 CFLAGS="$CXXFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
59 AM_PROG_LIBTOOL
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
60 CC="$xs_save_cc"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
61 CFLAGS="$xs_save_cflags"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
62 ])
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 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
65
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
66 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
67 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
68 xs_cxx_save="$CXX"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
69 xs_cxxflags_save="$CXXFLAGS"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
70 xs_ldflags_save="$LDFLAGS"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
71 xs_libs_save="$LIBS"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
72 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
73
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
74
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
75 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
76 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
77 CXX="$xs_cxx_save"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
78 CXXFLAGS="$xs_cxxflags_save"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
79 LDFLAGS="$xs_ldflags_save"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
80 LIBS="$xs_libs_save"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
81 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
82
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
83
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
84 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
85 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
86 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
87 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
88
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
89
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
90 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
91 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
92 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
93 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
94 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
95 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
96 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
97 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
98 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
99 ])
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 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
102 dnl Try to find SIDPLAY library and header files.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
103 dnl $xs_have_sidplay1 will be "yes" or "no"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
104 dnl @SIDPLAY1_LDADD@ will be substituted with linker parameters
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
105 dnl @SIDPLAY1_INCLUDES@ will be substituted with compiler parameters
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
106 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
107
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
108 AC_DEFUN(XS_PATH_LIBSIDPLAY1,
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
109 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
110 AC_MSG_CHECKING([for working SIDPlay1 library and headers])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
111
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
112 AC_LANG_PUSH(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
113
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
114 # Use include path given by user (if any).
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
115 if test -n "$xs_sidplay1_includes"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
116 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
117 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
118 xs_sidplay1_cxxflags=""
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
119 fi
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 # Use library path given by user (if any).
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
122 if test -n "$xs_sidplay1_library"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
123 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
124 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
125 xs_sidplay1_ldflags=""
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
126 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
127
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
128 AC_CACHE_VAL(xs_cv_have_sidplay1,
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
129 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
130 # 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
131 # or user-defined paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
132 MY_TRY_LIBSIDPLAY1
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
133 if test "$xs_sidplay1_works" = yes; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
134 xs_cv_have_sidplay1="xs_have_sidplay1=yes \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
135 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
136 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
137 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
138 MY_FIND_LIBSIDPLAY1
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
139 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
140 ])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
141
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
142 eval "$xs_cv_have_sidplay1"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
143
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
144 if test "$xs_have_sidplay1" = yes; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
145 if test -n "$xs_sidplay1_cxxflags" || test -n "$xs_sidplay1_ldflags"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
146 AC_MSG_RESULT([$xs_sidplay1_cxxflags $xs_sidplay1_ldflags])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
147 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
148 AC_MSG_RESULT([yes])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
149 fi
90
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
150
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
151 SIDPLAY1_LDADD="$xs_sidplay1_ldflags -lsidplay"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
152 SIDPLAY1_INCLUDES="$xs_sidplay1_cxxflags"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
153 AC_SUBST(SIDPLAY1_LDADD)
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
154 AC_SUBST(SIDPLAY1_INCLUDES)
90
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
155 else
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
156 AC_MSG_RESULT([no])
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
157 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
158
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
159 AC_LANG_POP(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
160 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
161
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
162 dnl Functions used by XS_PATH_LIBSIDPLAY1.
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
163
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
164 AC_DEFUN(MY_FIND_LIBSIDPLAY1,
30
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 # Search common locations where header files might be stored.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
167 xs_sidplay1_incdirs="$xs_sidplay1_includes /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
168 MY_FIND_FILE(sidplay/sidtune.h, $xs_sidplay1_incdirs, xs_sidplay1_includes)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
169
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
170 # Search common locations where library might be stored.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
171 xs_sidplay1_libdirs="$xs_sidplay1_library /usr/lib /usr/lib/sidplay /usr/local/lib/sidplay"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
172 MY_FIND_FILE(libsidplay.a libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37,
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
173 $xs_sidplay1_libdirs, xs_sidplay1_library)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
174
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
175 if test -z "$xs_sidplay1_includes" || test -z "$xs_sidplay1_library"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
176 xs_cv_have_sidplay1="xs_have_sidplay1=no \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
177 xs_sidplay1_ldflags=\"\" xs_sidplay1_cxxflags=\"\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
178 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
179 # Test compilation with found paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
180 xs_sidplay1_ldflags="-L$xs_sidplay1_library"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
181 xs_sidplay1_cxxflags="-I$xs_sidplay1_includes"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
182 MY_TRY_LIBSIDPLAY1
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
183 xs_cv_have_sidplay1="xs_have_sidplay1=$xs_sidplay1_works \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
184 xs_sidplay1_ldflags=\"$xs_sidplay1_ldflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
185 xs_sidplay1_cxxflags=\"$xs_sidplay1_cxxflags\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
186 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
189 AC_DEFUN(MY_TRY_LIBSIDPLAY1,
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
190 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
191 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
192
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
193 CXXFLAGS="$CXXFLAGS $xs_sidplay1_cxxflags"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
194 LDFLAGS="$LDFLAGS $xs_sidplay1_ldflags"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
195 LIBS="$LIBS -lsidplay"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
197 AC_LINK_IFELSE([AC_LANG_PROGRAM(
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
198 [[#include <sidplay/sidtune.h>]],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
199 [[sidTune* myTest = new sidTune(0);]])],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
200 [xs_sidplay1_works=yes],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
201 [xs_sidplay1_works=no]
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
202 )
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
203
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
204 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
205 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
207
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
208 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
209 dnl Try to find SIDPLAY2 library and header files.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
210 dnl $xs_have_sidplay2 will be "yes" or "no"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
211 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
212 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
213 dnl -------------------------------------------------------------------------
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
214 AC_DEFUN(XS_PATH_LIBSIDPLAY2,
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
215 [
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
216 AC_MSG_CHECKING([for working SIDPlay2 library and headers])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
218 AC_LANG_PUSH(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
219
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
220 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
221 if test -n "$PKG_CONFIG" && $PKG_CONFIG --atleast-version $LIBSIDPLAY2_REQUIRED_VERSION libsidplay2; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
222 xs_pkgcfg_knows=yes
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
223 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
224 xs_pkgcfg_knows=no
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
225 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
227 # Derive sidbuilders path from libsidplay2 root.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
228 if test -n "$xs_sidplay2_library"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
229 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
230 elif test "$xs_pkgcfg_knows" = yes ; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
231 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
232 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
234 AC_CACHE_VAL(xs_cv_have_sidplay2,
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
235 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
236 # 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
237 # or user-defined paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
238 xs_sidplay2_ldadd="-lsidplay2"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
239 MY_TRY_LIBSIDPLAY2
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
240 if test "$xs_sidplay2_works" = yes; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
241 xs_cv_have_sidplay2="xs_have_sidplay2=yes \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
242 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
243 xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
244 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
245 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
246 MY_FIND_LIBSIDPLAY2
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
247 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
248 ])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
249 eval "$xs_cv_have_sidplay2"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
250 if test "$xs_have_sidplay2" = yes; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
251 if test -n "$xs_sidplay2_cxxflags" || test -n "$xs_sidplay2_ldadd"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
252 AC_MSG_RESULT([$xs_sidplay2_cxxflags $xs_sidplay2_ldadd])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
253 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
254 AC_MSG_RESULT([yes])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
255 fi
90
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
256
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
257 SIDPLAY2_LDADD="$xs_sidplay2_ldadd"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
258 SIDPLAY2_INCLUDES="$xs_sidplay2_cxxflags"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
259 AC_SUBST(SIDPLAY2_LDADD)
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
260 AC_SUBST(SIDPLAY2_INCLUDES)
90
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
261 else
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
262 AC_MSG_RESULT([no])
edec1818cf48 Fixed build process for library detection
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
263 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
264
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
265 AC_LANG_POP(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
266 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
267
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
269 dnl Functions used by XS_PATH_LIBSIDPLAY2.
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
270 AC_DEFUN(MY_FIND_LIBSIDPLAY2,
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
271 [
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
272 # See whether user didn't provide paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
273 if test -z "$xs_sidplay2_includes"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
274 if test "$xs_pkgcfg_knows" = yes ; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
275 xs_sidplay2_includes=`$PKG_CONFIG --variable=includedir libsidplay2`
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
276 xs_sidplay2_cxxflags=`$PKG_CONFIG --cflags libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
277 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
278 # Search common locations where header files might be stored.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
279 xs_sidplay2_incdirs="$xs_sidplay2_includes $xs_sidplay2_includes/include"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
280 MY_FIND_FILE(sidplay/sidplay2.h,$xs_sidplay2_incdirs,xs_sidplay2_includes)
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
281 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
282 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
283 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
284 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
285 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
286 if test -z "$xs_sidplay2_library"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
287 if test "$xs_pkgcfg_knows" = yes ; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
288 xs_sidplay2_library=`$PKG_CONFIG --variable=libdir libsidplay2`
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
289 xs_sidplay2_ldadd=`$PKG_CONFIG --libs libsidplay2`
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
290 xs_sidplay2_builders=`$PKG_CONFIG --variable=builders libsidplay2`
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
291 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
292 # Search common locations where library might be stored.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
293 xs_sidplay2_libdirs="$xs_sidplay2_library $xs_sidplay2_library/lib $xs_sidplay2_library/src"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
294 MY_FIND_FILE(libsidplay2.la,$xs_sidplay2_libdirs,xs_sidplay2_library)
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
295 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
296 xs_sidplay2_builders="$xs_sidplay2_library/sidplay/builders"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
297 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
298 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
299 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
300 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
301 if test -z "$xs_sidplay2_includes" || test -z "$xs_sidplay2_library"; then
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
302 xs_cv_have_sidplay2="xs_have_sidplay2=no \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
303 xs_sidplay2_ldadd=\"\" xs_sidplay2_cxxflags=\"\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
304 xs_sidplay2_builders=\"\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
305 else
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
306 # Test compilation with found paths.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
307 xs_sidplay2_ldadd="-L$xs_sidplay2_library -lsidplay2"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
308 xs_sidplay2_cxxflags="-I$xs_sidplay2_includes"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
309 MY_TRY_LIBSIDPLAY2
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
310 xs_cv_have_sidplay2="xs_have_sidplay2=$xs_sidplay2_works \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
311 xs_sidplay2_ldadd=\"$xs_sidplay2_ldadd\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
312 xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
313 xs_sidplay2_builders=\"$xs_sidplay2_builders\" "
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
314 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
315 ])
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
316
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
317
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
318 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
319 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
320 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
321
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
322 CXX="${SHELL-/bin/sh} ${srcdir}/libtool $CXX"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
323 CXXFLAGS="$CXXFLAGS $xs_sidplay2_cxxflags -DHAVE_UNIX"
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
324 LDFLAGS="$LDFLAGS $xs_sidplay2_ldadd"
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
325
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
326 AC_LINK_IFELSE([AC_LANG_PROGRAM(
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
327 [[#include <sidplay/sidplay2.h>]],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
328 [[sidplay2 *myEngine;]])],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
329 [xs_sidplay2_works=yes],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
330 [xs_sidplay2_works=no]
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
331 )
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
332
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
333 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
334 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
335
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
336
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
337 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
338 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
339 dnl @BUILDERS_INCLUDES@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
340 dnl @BUILDERS_LDFLAGS@
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
341 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
342 AC_DEFUN(BUILDERS_FIND,
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
343 [
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
344 AC_MSG_CHECKING([for SIDPlay2 builders directory])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
345
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
346 AC_LANG_PUSH(C++)
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
347
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
348 AC_REQUIRE([XS_PATH_LIBSIDPLAY2])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
349
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
350 dnl Be pessimistic.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
351 builders_available=no
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
352
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
353 dnl Sidbuilder headers are included with "builders" prefix.
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
354 builders_includedir=$xs_sidplay2_includes
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
355 builders_libdir=$xs_sidplay2_builders
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
356
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
357 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
358 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
359 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
360 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
361 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
362 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
363 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
364 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
365 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
366 fi
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
367
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
368 AC_ARG_WITH(sidbuilders,
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
369 [ --with-sidbuilders=DIR what the SIDPlay2 builders install PREFIX is],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
370 [builders_includedir="$withval/include"
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
371 builders_libdir="$withval/lib/sidplay/builders"])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
372
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
373 AC_ARG_WITH(builders-inc,
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
374 [ --with-builders-inc=DIR where the SIDPlay2 builders headers are located],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
375 [builders_includedir="$withval"])
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
376
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
377 AC_ARG_WITH(builders-lib,
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
378 [ --with-builders-lib=DIR where the SIDPlay2 builders libraries are installed],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
379 [builders_libdir="$withval"])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
380
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
381 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
382 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
383 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
384
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
385 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
386 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
387 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
388
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
389 if test -d $builders_libdir; then
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
390 xs_have_sidbuilders_dir=yes
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
391 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
392 else
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
393 xs_have_sidbuilders_dir=no
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
394 AC_MSG_RESULT([$xs_have_sidbuilders_dir])
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
395 AC_MSG_ERROR([$builders_libdir not found!
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
396 Check --help on how to specify SIDPlay2 and/or builders library and
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
397 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
398 of libsidplay2.
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
399 ])
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
400 fi
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
401
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
402 AC_SUBST(BUILDERS_INCLUDES)
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
403 AC_SUBST(BUILDERS_LDFLAGS)
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
404
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
405 AC_LANG_POP(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
406 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
407
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
408
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
409 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
410 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
411 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
412 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
413 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
414 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
415 AC_MSG_CHECKING([for reSID builder module])
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
416 AC_LANG_PUSH(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
417 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
418
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
419 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
420 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
421 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
422 LIBS="$LIBS -lresid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
423
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
424 AC_LINK_IFELSE([AC_LANG_PROGRAM(
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
425 [[#include <sidplay/builders/resid.h>]],
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
426 [[ReSIDBuilder *sid;]])],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
427 [builders_work=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
428 [builders_work=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
429 )
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
430
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
431 MY_TRY_LINK_RESTORE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
432
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
433 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
434 builders_available=yes
35
3fcc147b253a Updates towards 0.8beta0
Matti Hamalainen <ccr@tnsp.org>
parents: 32
diff changeset
435 xs_builders="reSID $xs_builders"
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
436 AC_DEFINE(HAVE_RESID_BUILDER)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
437 RESID_LDADD="-lresid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
438 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
439 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
440 AC_SUBST(RESID_LDADD)
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
441 AC_LANG_POP(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
442 ])
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
443
31
ca6dab6c4ead Re-wrote configuration scripts and libsidplay 1/2 detection.
Matti Hamalainen <ccr@tnsp.org>
parents: 30
diff changeset
444
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
445 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
446 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
447 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
448 dnl -------------------------------------------------------------------------
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
449 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
450 [
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
451 AC_MSG_CHECKING([for HardSID builder module])
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
452 AC_LANG_PUSH(C++)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
453 MY_TRY_LINK_SAVE
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
454
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
455 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
456 CXXFLAGS="$CXXFLAGS $BUILDERS_INCLUDES"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
457 LDFLAGS="$LDFLAGS $BUILDERS_LDFLAGS"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
458 LIBS="$LIBS -lhardsid-builder"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
459
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
460 AC_LINK_IFELSE([AC_LANG_PROGRAM(
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
461 [[#include <sidplay/builders/hardsid.h>]],
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
462 [[HardSID *sid;]])],
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
463 [builders_work=yes],
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
464 [builders_work=no]
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
465 )
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
466
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
467 MY_TRY_LINK_RESTORE
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 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
470 builders_available=yes
35
3fcc147b253a Updates towards 0.8beta0
Matti Hamalainen <ccr@tnsp.org>
parents: 32
diff changeset
471 xs_builders="HardSID $xs_builders"
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
472 AC_DEFINE(HAVE_HARDSID_BUILDER)
30
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
473 HARDSID_LDADD="-lhardsid-builder"
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
474 fi
fde5167bb736 Updated to have macros for detecting libSIDPlay 1 and 2
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
475 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
476 AC_SUBST(HARDSID_LDADD)
32
13db37492b6d More fixes in the configuration system
Matti Hamalainen <ccr@tnsp.org>
parents: 31
diff changeset
477 AC_LANG_POP(C++)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
478 ])
125
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
479
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
480
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
481 dnl -------------------------------------------------------------------------
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
482 dnl Try to find NanoSID library and header files.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
483 dnl $xs_have_nanosid will be "yes" or "no"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
484 dnl @NANOSID_LDADD@ will be substituted with linker parameters
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
485 dnl @NANOSID_INCLUDES@ will be substituted with compiler parameters
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
486 dnl -------------------------------------------------------------------------
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
487
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
488 AC_DEFUN(XS_PATH_LIBNANOSID,
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
489 [
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
490 AC_MSG_CHECKING([for working NanoSID library and headers])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
491
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
492 AC_LANG_PUSH(C)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
493
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
494 # Use include path given by user (if any).
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
495 if test -n "$xs_nanosid_includes"; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
496 xs_nanosid_cflags="-I$xs_nanosid_includes"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
497 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
498 xs_nanosid_cflags=""
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
499 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
500
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
501 # Use library path given by user (if any).
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
502 if test -n "$xs_nanosid_library"; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
503 xs_nanosid_ldflags="-L$xs_nanosid_library"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
504 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
505 xs_nanosid_ldflags=""
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
506 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
507
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
508 AC_CACHE_VAL(xs_cv_have_nanosid,
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
509 [
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
510 # Run test compilation with either standard search path
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
511 # or user-defined paths.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
512 MY_TRY_LIBNANOSID
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
513 if test "$xs_nanosid_works" = yes; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
514 xs_cv_have_nanosid="xs_have_nanosid=yes \
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
515 xs_nanosid_cflags=\"$xs_nanosid_cflags\" \
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
516 xs_nanosid_ldflags=\"$xs_nanosid_ldflags\" "
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
517 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
518 MY_FIND_LIBNANOSID
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
519 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
520 ])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
521
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
522 eval "$xs_cv_have_nanosid"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
523
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
524 if test "$xs_have_nanosid" = yes; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
525 if test -n "$xs_nanosid_cflags" || test -n "$xs_nanosid_ldflags"; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
526 AC_MSG_RESULT([$xs_nanosid_cflags $xs_nanosid_ldflags])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
527 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
528 AC_MSG_RESULT([yes])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
529 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
530
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
531 NANOSID_LDADD="$xs_nanosid_ldflags -lNanoSID -lm -lz"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
532 NANOSID_INCLUDES="$xs_nanosid_cflags"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
533 AC_SUBST(NANOSID_LDADD)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
534 AC_SUBST(NANOSID_INCLUDES)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
535 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
536 AC_MSG_RESULT([no])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
537 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
538
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
539 AC_LANG_POP(C)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
540 ])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
541
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
542 dnl Functions used by XS_PATH_LIBNANOSID.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
543
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
544 AC_DEFUN(MY_FIND_LIBNANOSID,
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
545 [
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
546 # Search common locations where header files might be stored.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
547 xs_nanosid_incdirs="$xs_nanosid_includes /usr/include /usr/local/include"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
548 MY_FIND_FILE(libNanoSID.h, $xs_nanosid_incdirs, xs_nanosid_includes)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
549
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
550 # Search common locations where library might be stored.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
551 xs_nanosid_libdirs="$xs_nanosid_library /usr/lib /usr/local/lib"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
552 MY_FIND_FILE(libNanoSID.a, $xs_nanosid_libdirs, xs_nanosid_library)
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
553
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
554 if test -z "$xs_nanosid_includes" || test -z "$xs_nanosid_library"; then
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
555 xs_cv_have_nanosid="xs_have_nanosid=no \
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
556 xs_nanosid_ldflags=\"\" xs_nanosid_cflags=\"\" "
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
557 else
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
558 # Test compilation with found paths.
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
559 xs_nanosid_ldflags="-L$xs_nanosid_library"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
560 xs_nanosid_cflags="-I$xs_nanosid_includes"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
561 MY_TRY_LIBNANOSID
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
562 xs_cv_have_nanosid="xs_have_nanosid=$xs_nanosid_works \
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
563 xs_nanosid_ldflags=\"$xs_nanosid_ldflags\" \
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
564 xs_nanosid_cflags=\"$xs_nanosid_cflags\" "
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
565 fi
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
566 ])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
567
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
568 AC_DEFUN(MY_TRY_LIBNANOSID,
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
569 [
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
570 MY_TRY_LINK_SAVE
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
571
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
572 CFLAGS="$CFLAGS $xs_nanosid_cflags"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
573 LDFLAGS="$LDFLAGS $xs_nanosid_ldflags"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
574 LIBS="$LIBS -lNanoSID -lm -lz"
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
575
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
576 AC_LINK_IFELSE([AC_LANG_PROGRAM(
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
577 [[#include <libNanoSID.h>]],
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
578 [[libNanoSID_Init();libNanoSID_GetSamplingRate();libNanoSID_GetANewSIDChip();]])],
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
579 [xs_nanosid_works=yes],
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
580 [xs_nanosid_works=no]
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
581 )
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
582
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
583 MY_TRY_LINK_RESTORE
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
584 ])
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
585
532ec0ad5e59 Added support/detection for libNanoSID.
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
586