summaryrefslogtreecommitdiff
blob: bbf94b82d150bbc4ffdfa41fa948699751344d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
--- Csound5.16.6/SConstruct
+++ Csound5.16.6/SConstruct
@@ -89,6 +89,9 @@
 commandOptions.Add('usePortMIDI',
     'Build PortMidi plugin for real time MIDI input and output.',
     '1')
+commandOptions.Add('usePulseAudio',
+    'Set to 1 to use PulseAudio for real-time audio and MIDI input and output.',
+    '1')
 commandOptions.Add('useALSA',
     'Set to 1 to use ALSA for real-time audio and MIDI input and output.',
     '1')
@@ -180,6 +183,15 @@
     commandOptions.Add('dynamicCsoundLibrary',
         'Build dynamic Csound library instead of libcsound.a',
         '0')
+commandOptions.Add('buildChuaOpcodes',
+    'Set to 1 to build chua opcodes.',
+    '1')
+commandOptions.Add('buildLinearOpcodes',
+    'Set to 1 to build linear algebra opcodes.',
+    '1')
+commandOptions.Add('buildFluidOpcodes',
+    'Set to 1 to build Fluidsynth opcodes.',
+    '1')
 commandOptions.Add('buildStkOpcodes',
     "Build opcodes encapsulating Perry Cook's Synthesis Toolkit in C++ instruments and effects",
     '0')
@@ -469,14 +481,6 @@
 if commonEnvironment['buildRelease'] == '0':
     commonEnvironment.Prepend(CPPFLAGS = ['-DBETA'])
 
-if commonEnvironment['Lib64'] == '1':
-    if getPlatform() == 'sunos':
-        commonEnvironment.Prepend(LIBPATH = ['.', '#.', '/lib/64', '/usr/lib/64'])
-    else:
-        commonEnvironment.Prepend(LIBPATH = ['.', '#.', '/usr/local/lib64'])
-else:
-    commonEnvironment.Prepend(LIBPATH = ['.', '#.', '/usr/local/lib'])
-
 if commonEnvironment['Word64'] == '1':
     if compilerSun():
         commonEnvironment.Append(CCFLAGS = ['-xcode=pic32'])
@@ -494,10 +498,7 @@
 if getPlatform() == 'linux':
     commonEnvironment.Append(CCFLAGS = ["-DLINUX"])
     commonEnvironment.Append(CPPFLAGS = ['-DHAVE_SOCKETS'])
-    commonEnvironment.Append(CPPPATH = ['/usr/local/include'])
     commonEnvironment.Append(CPPPATH = ['/usr/include'])
-    commonEnvironment.Append(CPPPATH = ['/usr/include'])
-    commonEnvironment.Append(CPPPATH = ['/usr/X11R6/include'])
     commonEnvironment.Append(CCFLAGS = ["-DPIPES"])
     commonEnvironment.Append(LINKFLAGS = ['-Wl,-Bdynamic'])
 elif getPlatform() == 'sunos':
@@ -559,18 +560,17 @@
 
 if getPlatform() == 'linux':
     path1 = '/usr/include/python%s' % commonEnvironment['pythonVersion']
-    path2 = '/usr/local/include/python%s' % commonEnvironment['pythonVersion']
-    pythonIncludePath = [path1, path2]
+    pythonIncludePath = [path1]
     path1 = '/usr/include/tcl%s' % commonEnvironment['tclversion']
     path2 = '/usr/include/tk%s' % commonEnvironment['tclversion']
     tclIncludePath = [path1, path2]
     pythonLinkFlags = []
     if commonEnvironment['Lib64'] == '1':
         tmp = '/usr/lib64/python%s/config' % commonEnvironment['pythonVersion']
-        pythonLibraryPath = ['/usr/local/lib64', '/usr/lib64', tmp]
+        pythonLibraryPath = ['/usr/lib64', tmp]
     else:
         tmp = '/usr/lib/python%s/config' % commonEnvironment['pythonVersion']
-        pythonLibraryPath = ['/usr/local/lib', '/usr/lib', tmp]
+        pythonLibraryPath = ['/usr/lib', tmp]
     pythonLibs = ['python%s' % commonEnvironment['pythonVersion']]
 elif getPlatform() == 'sunos':
     path1 = '/usr/include/python%s' % commonEnvironment['pythonVersion']
@@ -777,6 +777,7 @@
 zlibhfound = configure.CheckHeader("zlib.h", language = "C")
 midiPluginSdkFound = configure.CheckHeader("funknown.h", language = "C++")
 luaFound = configure.CheckHeader("lua.h", language = "C")
+luajitFound = configure.CheckLibWithHeader("luajit-5.1", "luajit-2.0/lua.h", language = "C")
 #print 'LUA: %s' % (['no', 'yes'][int(luaFound)])
 swigFound = 'swig' in commonEnvironment['TOOLS']
 print 'Checking for SWIG... %s' % (['no', 'yes'][int(swigFound)])
@@ -1452,7 +1453,7 @@
     swigflags = csoundWrapperEnvironment['SWIGFLAGS']
     print 'swigflags:', swigflags
     luaWrapper = None
-    if not (luaFound and commonEnvironment['buildLuaWrapper'] != '0'):
+    if not (luajitFound and commonEnvironment['buildLuaWrapper'] != '0'):
         print 'CONFIGURATION DECISION: Not building Lua wrapper to Csound C++ interface library.'
     else:
         print 'CONFIGURATION DECISION: Building Lua wrapper to Csound C++ interface library.'
@@ -1510,6 +1511,9 @@
             javaWrapper = javaWrapperEnvironment.Program(
                 'lib_jcsound.jnilib', javaWrapperSources)
         else:
+            soname = 'lib_jcsound.so'
+            soflag = [ '-Wl,-soname=%s' % soname ]
+            javaWrapperEnvironment.Prepend(LINKFLAGS = [soflag])
             javaWrapper = javaWrapperEnvironment.SharedLibrary(
                 '_jcsound', javaWrapperSources)
         #Depends(javaWrapper, csoundLibrary)
@@ -1759,9 +1763,12 @@
 	jpluginEnvironment.Append(LINKFLAGS = ['-framework', 'Jackmp'])
     makePlugin(jpluginEnvironment, 'jackTransport', 'Opcodes/jackTransport.c')
     makePlugin(jpluginEnvironment, 'jacko', 'Opcodes/jacko.cpp')
-if boostFound:
+if commonEnvironment['buildChuaOpcodes'] == '1' and boostFound:
+    print 'CONFIGURATION DECISION: Building chua opcodes.'
     makePlugin(pluginEnvironment, 'chua', 'Opcodes/chua/ChuaOscillator.cpp')
-if gmmFound and commonEnvironment['useDouble'] != '0':
+else:
+    print 'CONFIGURATION DECISION: Not building chua opcodes.'
+if commonEnvironment['buildLinearOpcodes'] == '1' and gmmFound and commonEnvironment['useDouble'] != '0':
     makePlugin(pluginEnvironment, 'linear_algebra', 'Opcodes/linear_algebra.cpp')
     print 'CONFIGURATION DECISION: Building linear algebra opcodes.'
 else:
@@ -1893,11 +1900,13 @@
     alsaEnvironment.Append(LIBS = ['asound', 'pthread'])
     makePlugin(alsaEnvironment, 'rtalsa', ['InOut/rtalsa.c'])
 
-if pulseaudioFound and (getPlatform() == 'linux' or getPlatform() == 'sunos'):
+if commonEnvironment['usePulseAudio'] == '1' and pulseaudioFound and (getPlatform() == 'linux' or getPlatform() == 'sunos'):
    print "CONFIGURATION DECISION: Building PulseAudio plugin"
    pulseaudioEnv = pluginEnvironment.Clone()
    pulseaudioEnv.Append(LIBS = ['pulse-simple'])
    makePlugin(pulseaudioEnv, 'rtpulse', ['InOut/rtpulse.c'])
+else:
+   print "CONFIGURATION DECISION: Not building PulseAudio plugin."
 
 if getPlatform() == 'win32':
     winmmEnvironment = pluginEnvironment.Clone()
@@ -1963,9 +1972,7 @@
 
 # FLUIDSYNTH OPCODES
 
-if not configure.CheckHeader("fluidsynth.h", language = "C"):
-    print "CONFIGURATION DECISION: Not building fluid opcodes."
-else:
+if commonEnvironment['buildFluidOpcodes'] == '1' and configure.CheckHeader("fluidsynth.h", language = "C"):
 	print "CONFIGURATION DECISION: Building fluid opcodes."
 	fluidEnvironment = pluginEnvironment.Clone()
 	if getPlatform() == 'win32':
@@ -1981,6 +1988,8 @@
 		fluidEnvironment.Append(LIBS = ['pthread'])
 	makePlugin(fluidEnvironment, 'fluidOpcodes',
 			   ['Opcodes/fluidOpcodes/fluidOpcodes.cpp'])
+else:
+    print "CONFIGURATION DECISION: Not building fluid opcodes."
 
 # VST HOST OPCODES
 
@@ -2174,7 +2183,7 @@
     if getPlatform() == 'win32' and pythonLibs[0] < 'python24':
         Depends(pythonOpcodes, pythonImportLibrary)
 
-# Python opcodes
+# Lua opcodes
 
 if not (commonEnvironment['buildLuaOpcodes'] != '0'):
     print "CONFIGURATION DECISION: Not building Lua opcodes."
@@ -2183,10 +2192,10 @@
     luaEnvironment = pluginEnvironment.Clone()
     
     if getPlatform() == 'linux':
-       if(luaFound == 1):
+       if(luajitFound == 1):
          luaEnvironment.Append(LIBS = ['luajit-5.1'])
          luaEnvironment.Append(LIBS = ['util', 'dl', 'm'])
-         luaEnvironment.Append(CPPPATH = '/usr/local/include/luajit-2.0')
+         luaEnvironment.Append(CPPPATH = '/usr/include/luajit-2.0')
     elif getPlatform() == 'win32':
        if(luaFound == 1):
         luaEnvironment.Append(LIBS = ['lua51'])
@@ -2538,7 +2547,7 @@
     Depends(csoundAcPythonModule, pythonWrapper)
     Depends(csoundAcPythonModule, csoundac)
     Depends(csoundAcPythonModule, csnd)
-    if luaFound and commonEnvironment['buildLuaWrapper'] != '0':
+    if luajitFound and commonEnvironment['buildLuaWrapper'] != '0':
        luaCsoundACWrapperEnvironment = acWrapperEnvironment.Clone()
        if getPlatform() == 'win32':
        	  luaCsoundACWrapperEnvironment.Prepend(LIBS = Split('luaCsnd lua51 CsoundAC csnd fltk_images'))