aboutsummaryrefslogtreecommitdiff
path: root/audio/cheesetracker/files/patch-detect.py
blob: 5663e472e51d524b64bdd2ea6563f19a10ee79bf (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
95
96
97
98
--- detect.py.orig	Mon Aug  6 21:04:11 2007
+++ detect.py	Mon Aug 20 16:41:41 2007
@@ -104,35 +104,11 @@
 
 def check_libdl(libdata):
 
-	print "Checking for libdl...";
-	dl_search_dirs=[ \
-		"/sw", \
-		"/usr", \
-		"/usr/local", \
-	];
-
-	# search for extra include dirs to add
-	for x in dl_search_dirs:
-		if (os.path.isfile(x + "/include/dlfcn.h")):
-			print "Found dlfcn.h in " + x + "/include";
-			libdata.dl_flags=["-I" + x + "/include"];
-			break;
-
-	f=open("test.cpp","w");
-	f.write("#include <dlfcn.h>\n#include <stdio.h>\nint main() { printf(\"Testing dlfcn.\"); return 0; }\n");
-	f.close();
-
-	for x in dl_search_dirs:
-		execline="c++ -L" + x + "/lib " + libdata.dl_flags[0] + " test.cpp -o test -ldl 2>>config_errors.log";
-		res=os.system(execline);
+	libdata.dl_libs=[''];
+	libdata.dl_flags=[''];
+	libdata.dl_link_flags=[''];
 
-		if (res == 0):
-			libdata.dl_libs=['dl'];
-			libdata.dl_link_flags=["-L" + x + "/lib"];
-			os.system("rm test.cpp");
-			os.system("rm test");
-			return 0;
-	return 1;
+	return 0;
 
 def check_need_gmp(libdata):
 	print "Checking if GMP is needed...",
@@ -152,7 +128,9 @@
 		print "Checking if GMP is available...",
 		res = check_cpp_compile(
 			"#include <gmp.h>\n" +
-			"int main() {return 0;}\n", "-lgmp");
+			"int main() {\n" +
+			"	return 0;\n" +
+			"}\n", "-I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib -lgmp");
 		if(res == 0):
 			print "No."
 			print "\n\n**** CANNOT FIND GMP LIBRARY ****\n\n";
@@ -213,7 +191,7 @@
 		"int main() {\n" +
 		"	afNewFileSetup();\n" +
 		"	return 0;\n" +
-		"}\n", "-laudiofile -lm");
+		"}\n", "-I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib -laudiofile -lm");
 	if(res == 0):
 		print " no. Access to lots of file formats is lost.";
 		libdata.have_libaudiofile=0;
@@ -401,6 +379,7 @@
 
 	#list of dirs I can test..
 	qt_unix_library_dirs = [\
+		"%%QT_PREFIX%%/lib",\
 		"",\
 		"/usr/lib",\
 		"/usr/X11R6/lib",\
@@ -411,6 +390,7 @@
 	];
 
 	qt_unix_bin_dirs = [\
+		"%%QT_PREFIX%%/bin",\
                 "",\
 		"/usr/bin",\
 		"/usr/X11R6/bin",\
@@ -421,6 +401,7 @@
 	];
 
 	qt_unix_include_dirs = [\
+		"%%QT_PREFIX%%/include",\
 		"/usr/include",\
 		"/usr/include/qt3",\
 		"/usr/X11R6/include",\
@@ -524,7 +505,10 @@
 
 	print "Looking for QT 3.x 'moc' Binary:";
 
-	qt_found=0;
+	qt_found=1;
+	libdata.qt_link_flags="-L%%QT_PREFIX%%/lib"
+	libdata.qt_libs=['qt-mt'];
+	libdata.moc_bin="%%QT_PREFIX%%/bin/moc"
 
         for x in qt_unix_bin_dirs:
 		if (not qt_lib_found):