aboutsummaryrefslogtreecommitdiff
path: root/devel/godot2/files/patch-platform_x11_detect.py
blob: 748b31f4ca16415d2b283e6f5d446fe6c8823941 (plain) (blame)
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
--- platform/x11/detect.py.orig	2019-07-08 12:01:42 UTC
+++ platform/x11/detect.py
@@ -56,7 +56,9 @@ def get_opts():
         ('use_sanitizer', 'Use llvm compiler sanitize address', 'no'),
         ('use_leak_sanitizer', 'Use llvm compiler sanitize memory leaks', 'no'),
         ('use_lto', 'Use link time optimization', 'no'),
-        ('pulseaudio', 'Detect & Use pulseaudio', 'yes'),
+        ('alsa','Detect & Use alsa audio','no'),
+        ('oss','Detect & Use OSS audio','no'),
+        ('pulseaudio', 'Detect & Use pulseaudio', 'no'),
         ('udev', 'Use udev for gamepad connection callbacks', 'no'),
         ('debug_release', 'Add debug symbols to release version', 'no'),
         ('touch', 'Enable touch events', 'yes'),
@@ -80,10 +82,6 @@ def configure(env):
 
     env.Append(CPPPATH=['#platform/x11'])
     if (env["use_llvm"] == "yes"):
-        if 'clang++' not in env['CXX']:
-            env["CC"] = "clang"
-            env["CXX"] = "clang++"
-            env["LD"] = "clang++"
         env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
         env.extra_suffix = ".llvm"
     elif (os.system("gcc --version > /dev/null 2>&1") == 0): # GCC
@@ -121,19 +119,14 @@ def configure(env):
     env.Append(LINKFLAGS=['-pipe'])
 
     if (env["target"] == "release"):
-        env.Prepend(CCFLAGS=['-Ofast'])
-        if (env["debug_release"] == "yes"):
-            env.Prepend(CCFLAGS=['-g2'])
+        pass
 
     elif (env["target"] == "release_debug"):
-
-        env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
-        if (env["debug_release"] == "yes"):
-            env.Prepend(CCFLAGS=['-g2'])
-
+        env.Prepend(CCFLAGS=['-DDEBUG_ENABLED'])
+        
     elif (env["target"] == "debug"):
 
-        env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+        env.Prepend(CCFLAGS=['-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
         env.Append(LINKFLAGS=['-rdynamic'])
 
     env.ParseConfig('pkg-config x11 --cflags --libs')
@@ -150,7 +143,12 @@ def configure(env):
         env.Append(CPPFLAGS=['-DTOUCH_ENABLED'])
 
     if (env['builtin_openssl'] == 'no'):
-        env.ParseConfig('pkg-config openssl --cflags --libs')
+        try:
+            # try to find a port installed openssl
+            env.ParseConfig('pkg-config openssl --cflags --libs')
+        except:
+            # if none found use base system openssl
+            env.ParseConfig('echo -lssl -lcrypto')
 
     if (env['builtin_libwebp'] == 'no'):
         env.ParseConfig('pkg-config libwebp --cflags --libs')
@@ -195,12 +193,13 @@ def configure(env):
     if (env['builtin_glew'] == 'no'):
         env.ParseConfig('pkg-config glew --cflags --libs')
 
-    if os.system("pkg-config --exists alsa") == 0:
-        print("Enabling ALSA")
-        env.Append(CPPFLAGS=["-DALSA_ENABLED"])
-        env.ParseConfig('pkg-config alsa --cflags --libs')
-    else:
-        print("ALSA libraries not found, disabling driver")
+    if (env["alsa"]=="yes"):
+        if os.system("pkg-config --exists alsa")==0:
+            print("Enabling ALSA")
+            env.Append(CPPFLAGS=["-DALSA_ENABLED"])
+            env.Append(LIBS=['asound'])
+        else:
+            print("ALSA libraries not found, disabling driver")
 
     if (platform.system() == "Linux"):
         env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
@@ -214,6 +213,11 @@ def configure(env):
             env.ParseConfig('pkg-config libudev --cflags --libs')
         else:
             print("libudev development libraries not found, disabling udev support")
+
+    if (env["oss"]=="yes"):
+        print("Enabling OSS Audio")
+        env.Append(CPPFLAGS=["-DOSS_ENABLED"])
+        env.Append(CCFLAGS=['-Ithirdparty/rtaudio'])
 
     if (env["pulseaudio"] == "yes"):
         if not os.system("pkg-config --exists libpulse-simple"):