summaryrefslogtreecommitdiff
blob: 8cd430adb9eb509ef8b8c395f8f374040ee8326b (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
static const char *compile_stubs =
"#!/bin/csh\n"
"\n"
"# Attempt to find the architecture.\n"
"# First look through the command line args.\n"
"set arch=unknown\n"
"set link_cmd=(`cat link_command`)\n"
"while ( $#link_cmd > 0 )\n"
"	if ( \"$link_cmd[1]\" == \"-arch\" ) then\n"
"		set arch=$link_cmd[2]\n"
"	endif\n"
"	shift link_cmd\n"
"end\n"
"\n"
"# look for an explicit arch file\n"
"if ( \"$arch\" == \"unknown\" ) then\n"
"	if ( -e arch ) then\n"
"		set arch=`cat arch`\n"
"	endif\n"
"endif\n"
"\n"
"if ( \"$arch\" == \"unknown\" ) then\n"
"echo \"***** Unable to determine architecture.\"\n"
"exit 1\n"
"endif \n"
"\n"
"# Create .dylibs for each file in the dylib_stubs directory.\n"
"if ( -e dylib_stubs ) then\n"
"	set files=`cd dylib_stubs ; echo *`\n"
"	mkdir -p dylibs\n"
"	foreach file ($files)\n"
"		if ( ! -e dylibs/$file ) then\n"
"			clang -arch $arch -c -fno-builtin -o tmp_object.o -x c dylib_stubs/$file\n"
"			ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o dylibs/$file tmp_object.o\n"
"		endif\n"
"	end\n"
"endif\n"
"\n"
"# Create .frameworks for each file in the framework_stubs directory.\n"
"if ( -e framework_stubs ) then\n"
"	set files=`cd framework_stubs ; echo *`\n"
"	foreach file ($files)\n"
"		if ( ! -e frameworks/$file.framework ) then\n"
"			clang -arch $arch -c -fno-builtin -o tmp_object.o -x c framework_stubs/$file\n"
"			mkdir -p frameworks/$file.framework\n"
"			ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o frameworks/$file.framework/$file tmp_object.o\n"
"		endif\n"
"	end\n"
"endif\n"
"\n"
"# Clean up.\n"
"rm -f tmp_object.o\n"
;