Merge lp:~timo-jyrinki/ubuntu/trusty/libimobiledevice/git20140313.bafe6a9e into lp:ubuntu/trusty/libimobiledevice
- Trusty (14.04)
- git20140313.bafe6a9e
- Merge into trusty
Status: | Merged |
---|---|
Approved by: | Sebastien Bacher |
Approved revision: | 25 |
Merged at revision: | 17 |
Proposed branch: | lp:~timo-jyrinki/ubuntu/trusty/libimobiledevice/git20140313.bafe6a9e |
Merge into: | lp:ubuntu/trusty/libimobiledevice |
Diff against target: |
82651 lines (+5526/-73448) 223 files modified
.gitignore (+62/-0) .pc/01-libs.private.patch/libimobiledevice-1.0.pc.in (+0/-12) .pc/02-fix-link-errors.patch/src/Makefile.am (+0/-35) .pc/02-fix-link-errors.patch/tools/Makefile.am (+0/-73) .pc/09_use_python_config.patch/m4/ac_python_devel.m4 (+0/-265) .pc/CVE-2013-2142.patch/src/Makefile.am (+0/-35) .pc/CVE-2013-2142.patch/src/userpref.c (+0/-1161) .pc/applied-patches (+0/-5) .pc/git_explicitly_cast_ssl_enabled.patch/cython/lockdown.pxi (+0/-297) Makefile.am (+1/-1) Makefile.in (+0/-918) NEWS (+20/-0) README (+10/-3) aclocal.m4 (+0/-1454) autogen.sh (+15/-0) common/Makefile.am (+18/-0) common/debug.c (+169/-0) common/debug.h (+59/-0) common/socket.c (+392/-0) common/socket.h (+65/-0) common/thread.c (+83/-0) common/thread.h (+45/-0) common/userpref.c (+1196/-0) common/userpref.h (+95/-0) common/utils.c (+194/-0) common/utils.h (+52/-0) compile (+0/-342) config.guess (+0/-1540) config.h.in (+0/-167) config.sub (+0/-1779) configure (+0/-20637) configure.ac (+16/-16) cython/Makefile.in (+0/-698) cython/afc.pxi (+59/-8) cython/house_arrest.pxi (+2/-2) cython/imobiledevice.pxd (+1/-1) cython/lockdown.pxi (+1/-1) debian/changelog (+21/-0) debian/control (+2/-11) debian/libimobiledevice-doc.doc-base (+0/-9) debian/libimobiledevice-doc.install (+0/-1) debian/libimobiledevice-doc.links (+0/-2) debian/libimobiledevice-utils.manpages (+2/-1) debian/libimobiledevice4.symbols (+58/-3) debian/patches/01-libs.private.patch (+2/-2) debian/patches/02-fix-link-errors.patch (+9/-9) debian/patches/09_use_python_config.patch (+0/-22) debian/patches/CVE-2013-2142.patch (+0/-308) debian/patches/git_explicitly_cast_ssl_enabled.patch (+0/-20) debian/patches/series (+0/-3) depcomp (+0/-707) dev/Makefile.in (+0/-771) dev/afccheck.c (+5/-5) dev/filerelaytest.c (+18/-4) docs/Makefile (+0/-535) docs/Makefile.am (+1/-1) docs/Makefile.in (+0/-535) docs/html/annotated.html (+0/-89) docs/html/classes.html (+0/-86) docs/html/dir_0839347dbfd1d6806a2d090799a179ba.html (+0/-94) docs/html/dir_beb3b87d681f7237804f4f09a166e5a0.html (+0/-105) docs/html/doxygen.css (+0/-1133) docs/html/dynsections.js (+0/-78) docs/html/files.html (+0/-80) docs/html/functions.html (+0/-81) docs/html/functions_vars.html (+0/-81) docs/html/globals.html (+0/-186) docs/html/globals_0x64.html (+0/-105) docs/html/globals_0x66.html (+0/-96) docs/html/globals_0x68.html (+0/-126) docs/html/globals_0x69.html (+0/-186) docs/html/globals_0x6c.html (+0/-162) docs/html/globals_0x6d.html (+0/-279) docs/html/globals_0x6e.html (+0/-111) docs/html/globals_0x72.html (+0/-120) docs/html/globals_0x73.html (+0/-123) docs/html/globals_0x77.html (+0/-105) docs/html/globals_defs.html (+0/-67) docs/html/globals_enum.html (+0/-79) docs/html/globals_eval.html (+0/-100) docs/html/globals_func.html (+0/-652) docs/html/globals_type.html (+0/-244) docs/html/include_2libimobiledevice_2afc_8h.html (+0/-1172) docs/html/include_2libimobiledevice_2diagnostics__relay_8h.html (+0/-353) docs/html/include_2libimobiledevice_2file__relay_8h.html (+0/-254) docs/html/include_2libimobiledevice_2heartbeat_8h.html (+0/-368) docs/html/include_2libimobiledevice_2house__arrest_8h.html (+0/-363) docs/html/include_2libimobiledevice_2installation__proxy_8h.html (+0/-743) docs/html/include_2libimobiledevice_2lockdown_8h.html (+0/-1129) docs/html/include_2libimobiledevice_2misagent_8h.html (+0/-340) docs/html/include_2libimobiledevice_2mobile__image__mounter_8h.html (+0/-336) docs/html/include_2libimobiledevice_2mobilebackup2_8h.html (+0/-559) docs/html/include_2libimobiledevice_2mobilebackup_8h.html (+0/-561) docs/html/include_2libimobiledevice_2mobilesync_8h.html (+0/-993) docs/html/include_2libimobiledevice_2notification__proxy_8h.html (+0/-434) docs/html/include_2libimobiledevice_2restore_8h.html (+0/-552) docs/html/include_2libimobiledevice_2sbservices_8h.html (+0/-427) docs/html/include_2libimobiledevice_2screenshotr_8h.html (+0/-244) docs/html/include_2libimobiledevice_2webinspector_8h.html (+0/-369) docs/html/index.html (+0/-50) docs/html/jquery.js (+0/-8) docs/html/libimobiledevice_8h.html (+0/-663) docs/html/struct_a_f_c_file_packet.html (+0/-69) docs/html/struct_a_f_c_packet.html (+0/-75) docs/html/structafc__client__private.html (+0/-77) docs/html/structdevice__link__service__client__private.html (+0/-67) docs/html/structdiagnostics__relay__client__private.html (+0/-67) docs/html/structfile__relay__client__private.html (+0/-67) docs/html/structheartbeat__client__private.html (+0/-67) docs/html/structhouse__arrest__client__private.html (+0/-69) docs/html/structidevice__connection__private.html (+0/-71) docs/html/structidevice__event__t.html (+0/-120) docs/html/structidevice__private.html (+0/-71) docs/html/structinstproxy__client__private.html (+0/-71) docs/html/structlockdownd__client__private.html (+0/-75) docs/html/structlockdownd__pair__record.html (+0/-82) docs/html/structlockdownd__service__descriptor.html (+0/-69) docs/html/structmisagent__client__private.html (+0/-69) docs/html/structmobile__image__mounter__client__private.html (+0/-69) docs/html/structmobilebackup2__client__private.html (+0/-67) docs/html/structmobilebackup__client__private.html (+0/-67) docs/html/structmobilesync__anchors.html (+0/-69) docs/html/structmobilesync__client__private.html (+0/-71) docs/html/structnp__client__private.html (+0/-71) docs/html/structproperty__list__service__client__private.html (+0/-67) docs/html/structrestored__client__private.html (+0/-73) docs/html/structsbservices__client__private.html (+0/-69) docs/html/structscreenshotr__client__private.html (+0/-67) docs/html/structservice__client__private.html (+0/-67) docs/html/structssl__data__private.html (+0/-77) docs/html/structwebinspector__client__private.html (+0/-67) docs/html/tabs.css (+0/-59) docs/idevicecrashreport.1 (+36/-0) docs/idevicename.1 (+28/-0) docs/idevicescreenshot.1 (+6/-2) include/Makefile.am (+3/-1) include/Makefile.in (+0/-578) include/libimobiledevice/afc.h (+5/-0) include/libimobiledevice/diagnostics_relay.h (+3/-0) include/libimobiledevice/file_relay.h (+4/-0) include/libimobiledevice/house_arrest.h (+3/-0) include/libimobiledevice/installation_proxy.h (+6/-0) include/libimobiledevice/libimobiledevice.h (+2/-0) include/libimobiledevice/lockdown.h (+4/-1) include/libimobiledevice/misagent.h (+3/-0) include/libimobiledevice/mobile_image_mounter.h (+9/-0) include/libimobiledevice/mobilebackup.h (+4/-0) include/libimobiledevice/mobilebackup2.h (+4/-0) include/libimobiledevice/mobilesync.h (+3/-0) include/libimobiledevice/notification_proxy.h (+4/-0) include/libimobiledevice/sbservices.h (+4/-0) include/libimobiledevice/screenshotr.h (+4/-0) include/libimobiledevice/service.h (+67/-0) include/libimobiledevice/syslog_relay.h (+69/-0) install-sh (+0/-527) libimobiledevice-1.0.pc.in (+1/-1) ltmain.sh (+0/-9655) m4/ac_python_devel.m4 (+19/-16) m4/ax_swig_enable_cxx.m4 (+53/-0) m4/libtool.m4 (+0/-7982) m4/ltoptions.m4 (+0/-384) m4/ltsugar.m4 (+0/-123) m4/ltversion.m4 (+0/-23) m4/lt~obsolete.m4 (+0/-98) missing (+0/-330) src/Makefile.am (+6/-7) src/Makefile.in (+0/-696) src/afc.c (+44/-26) src/afc.h (+2/-10) src/debug.c (+0/-169) src/debug.h (+0/-59) src/device_link_service.c (+1/-1) src/diagnostics_relay.c (+21/-1) src/file_relay.c (+60/-3) src/heartbeat.c (+5/-5) src/house_arrest.c (+47/-27) src/idevice.c (+51/-33) src/idevice.h (+2/-5) src/installation_proxy.c (+149/-54) src/installation_proxy.h (+3/-13) src/lockdown.c (+245/-92) src/lockdown.h (+4/-2) src/misagent.c (+46/-26) src/mobile_image_mounter.c (+147/-21) src/mobile_image_mounter.h (+2/-11) src/mobilebackup.c (+21/-1) src/mobilebackup2.c (+33/-1) src/mobilesync.c (+21/-1) src/notification_proxy.c (+48/-53) src/notification_proxy.h (+3/-13) src/property_list_service.c (+27/-4) src/property_list_service.h (+1/-0) src/restore.c (+15/-12) src/sbservices.c (+38/-34) src/sbservices.h (+2/-11) src/screenshotr.c (+21/-1) src/service.c (+4/-1) src/service.h (+1/-30) src/syslog_relay.c (+301/-0) src/syslog_relay.h (+36/-0) src/userpref.c (+0/-1208) src/userpref.h (+0/-73) src/utils.c (+0/-85) src/utils.h (+0/-27) src/webinspector.c (+133/-52) src/webinspector.h (+2/-0) tools/Makefile.am (+19/-8) tools/Makefile.in (+0/-1043) tools/idevicebackup2.c (+107/-25) tools/idevicecrashreport.c (+456/-0) tools/idevicedate.c (+66/-33) tools/idevicedebugserverproxy.c (+2/-2) tools/idevicediagnostics.c (+2/-2) tools/ideviceimagemounter.c (+99/-68) tools/ideviceinfo.c (+3/-1) tools/idevicename.c (+126/-0) tools/idevicepair.c (+35/-20) tools/idevicescreenshot.c (+24/-14) tools/idevicesyslog.c (+28/-70) tools/socket.c (+0/-392) tools/socket.h (+0/-65) tools/thread.c (+0/-47) tools/thread.h (+0/-38) |
To merge this branch: | bzr merge lp:~timo-jyrinki/ubuntu/trusty/libimobiledevice/git20140313.bafe6a9e |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sebastien Bacher | Approve | ||
Review via email: mp+210753@code.launchpad.net |
Commit message
[ Matthias Niess ]
* Replace a duplicate 'backup' util man page with the one for 'crashreport'
[ Timo Jyrinki ]
* New upstream snapshot. (LP: #1207812)
* Drop patches included in the upstream snapshot:
- debian/
- debian/
* Drop the python patch, new upstream method seems to work:
- debian/
* Refreshed remaining patches:
- debian/
- debian/
* Drop libimobiledevic
* Updated libimobiledevic
* Add missing man page for the 'idevicename' util
Description of the change
Matthias Niess (mniess) wrote : | # |
Matthias Niess (mniess) wrote : | # |
You need to update the .manpages file. There is a duplicate entry of idevicebackup and idevicecrashreport is missing.
- 23. By Timo Jyrinki
-
[ Matthias Niess ]
Replace a duplicate 'backup' util man page with the one for 'crashreport' - 24. By Timo Jyrinki
-
Add missing man page for the 'idevicename' util
- 25. By Timo Jyrinki
-
s/UNRELEASED/
trusty/ for being able to be directly sponsored from the branch.
Sebastien Bacher (seb128) wrote : | # |
thanks, uploaded to trusty
Preview Diff
1 | === added file '.gitignore' | |||
2 | --- .gitignore 1970-01-01 00:00:00 +0000 | |||
3 | +++ .gitignore 2014-03-14 06:45:31 +0000 | |||
4 | @@ -0,0 +1,62 @@ | |||
5 | 1 | # git-ls-files --others --exclude-from=.git/info/exclude | ||
6 | 2 | # Lines that start with '#' are comments. | ||
7 | 3 | # For a project mostly in C, the following would be a good set of | ||
8 | 4 | # exclude patterns (uncomment them if you want to use them): | ||
9 | 5 | *.[oa] | ||
10 | 6 | *~ | ||
11 | 7 | *.po | ||
12 | 8 | *.lo | ||
13 | 9 | *.la | ||
14 | 10 | autom4te.cache/* | ||
15 | 11 | *.in | ||
16 | 12 | */.deps/* | ||
17 | 13 | m4/* | ||
18 | 14 | swig/* | ||
19 | 15 | *.swp | ||
20 | 16 | *.patch | ||
21 | 17 | aclocal.m4 | ||
22 | 18 | config.h | ||
23 | 19 | config.log | ||
24 | 20 | config.sub | ||
25 | 21 | config.guess | ||
26 | 22 | config.status | ||
27 | 23 | configure | ||
28 | 24 | depcomp | ||
29 | 25 | install-sh | ||
30 | 26 | compile | ||
31 | 27 | main | ||
32 | 28 | ltmain.sh | ||
33 | 29 | missing | ||
34 | 30 | mkinstalldirs | ||
35 | 31 | libtool | ||
36 | 32 | *Makefile | ||
37 | 33 | py-compile | ||
38 | 34 | stamp-h1 | ||
39 | 35 | src/.libs | ||
40 | 36 | docs/html | ||
41 | 37 | libimobiledevice-1.0.pc | ||
42 | 38 | dev/.libs/* | ||
43 | 39 | dev/afccheck | ||
44 | 40 | dev/ideviceclient | ||
45 | 41 | dev/idevicesyslog | ||
46 | 42 | dev/lckd-client | ||
47 | 43 | dev/msyncclient | ||
48 | 44 | dev/ideviceenterrecovery | ||
49 | 45 | tools/.libs/* | ||
50 | 46 | tools/idevice_id | ||
51 | 47 | tools/ideviceinfo | ||
52 | 48 | tools/idevicesyslog | ||
53 | 49 | tools/idevicebackup | ||
54 | 50 | tools/ideviceimagemounter | ||
55 | 51 | tools/idevicescreenshot | ||
56 | 52 | tools/idevicebackup2 | ||
57 | 53 | tools/idevicedate | ||
58 | 54 | tools/idevicedebugserverproxy | ||
59 | 55 | tools/idevicediagnostics | ||
60 | 56 | tools/ideviceenterrecovery | ||
61 | 57 | tools/idevicename | ||
62 | 58 | tools/idevicepair | ||
63 | 59 | tools/ideviceprovision | ||
64 | 60 | cython/.libs/* | ||
65 | 61 | cython/*.c | ||
66 | 62 | doxygen.cfg | ||
67 | 0 | 63 | ||
68 | === removed directory '.pc/01-libs.private.patch' | |||
69 | === removed file '.pc/01-libs.private.patch/libimobiledevice-1.0.pc.in' | |||
70 | --- .pc/01-libs.private.patch/libimobiledevice-1.0.pc.in 2012-07-29 11:31:31 +0000 | |||
71 | +++ .pc/01-libs.private.patch/libimobiledevice-1.0.pc.in 1970-01-01 00:00:00 +0000 | |||
72 | @@ -1,12 +0,0 @@ | |||
73 | 1 | prefix=@prefix@ | ||
74 | 2 | exec_prefix=@exec_prefix@ | ||
75 | 3 | libdir=@libdir@ | ||
76 | 4 | includedir=@includedir@ | ||
77 | 5 | |||
78 | 6 | Name: libimobiledevice | ||
79 | 7 | Description: A library to communicate with services running on Apple iPhone/iPod Touch devices. | ||
80 | 8 | Version: @VERSION@ | ||
81 | 9 | Requires: libplist >= 0.12 libusbmuxd >= 0.1.0 @ssl_requires@ | ||
82 | 10 | Libs: -L${libdir} -limobiledevice | ||
83 | 11 | Cflags: -I${includedir} | ||
84 | 12 | |||
85 | 13 | 0 | ||
86 | === removed directory '.pc/02-fix-link-errors.patch' | |||
87 | === removed directory '.pc/02-fix-link-errors.patch/src' | |||
88 | === removed file '.pc/02-fix-link-errors.patch/src/Makefile.am' | |||
89 | --- .pc/02-fix-link-errors.patch/src/Makefile.am 2013-10-28 23:01:08 +0000 | |||
90 | +++ .pc/02-fix-link-errors.patch/src/Makefile.am 1970-01-01 00:00:00 +0000 | |||
91 | @@ -1,35 +0,0 @@ | |||
92 | 1 | AM_CPPFLAGS = -I$(top_srcdir)/include | ||
93 | 2 | |||
94 | 3 | AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusbmuxd_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libplist_CFLAGS) $(LFS_CFLAGS) $(openssl_CFLAGS) | ||
95 | 4 | AM_LDFLAGS = $(libgnutls_LIBS) $(libtasn1_LIBS) $(libplist_LIBS) $(libusbmuxd_LIBS) $(libgcrypt_LIBS) ${libpthread_LIBS} $(openssl_LIBS) | ||
96 | 5 | |||
97 | 6 | lib_LTLIBRARIES = libimobiledevice.la | ||
98 | 7 | libimobiledevice_la_LIBADD = | ||
99 | 8 | libimobiledevice_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBIMOBILEDEVICE_SO_VERSION) -no-undefined | ||
100 | 9 | libimobiledevice_la_SOURCES = idevice.c idevice.h \ | ||
101 | 10 | debug.c debug.h\ | ||
102 | 11 | userpref.c userpref.h\ | ||
103 | 12 | service.c service.h\ | ||
104 | 13 | property_list_service.c property_list_service.h\ | ||
105 | 14 | device_link_service.c device_link_service.h\ | ||
106 | 15 | lockdown.c lockdown.h\ | ||
107 | 16 | afc.c afc.h\ | ||
108 | 17 | file_relay.c file_relay.h\ | ||
109 | 18 | notification_proxy.c notification_proxy.h\ | ||
110 | 19 | installation_proxy.c installation_proxy.h\ | ||
111 | 20 | sbservices.c sbservices.h\ | ||
112 | 21 | mobile_image_mounter.c mobile_image_mounter.h\ | ||
113 | 22 | screenshotr.c screenshotr.h\ | ||
114 | 23 | mobilesync.c mobilesync.h\ | ||
115 | 24 | mobilebackup.c mobilebackup.h\ | ||
116 | 25 | house_arrest.c house_arrest.h\ | ||
117 | 26 | mobilebackup2.c mobilebackup2.h\ | ||
118 | 27 | misagent.c misagent.h\ | ||
119 | 28 | restore.c restore.h\ | ||
120 | 29 | diagnostics_relay.c diagnostics_relay.h\ | ||
121 | 30 | heartbeat.c heartbeat.h\ | ||
122 | 31 | webinspector.c webinspector.h | ||
123 | 32 | |||
124 | 33 | if WIN32 | ||
125 | 34 | libimobiledevice_la_LIBADD += -lole32 | ||
126 | 35 | endif | ||
127 | 36 | 0 | ||
128 | === removed directory '.pc/02-fix-link-errors.patch/tools' | |||
129 | === removed file '.pc/02-fix-link-errors.patch/tools/Makefile.am' | |||
130 | --- .pc/02-fix-link-errors.patch/tools/Makefile.am 2013-10-28 23:01:08 +0000 | |||
131 | +++ .pc/02-fix-link-errors.patch/tools/Makefile.am 1970-01-01 00:00:00 +0000 | |||
132 | @@ -1,73 +0,0 @@ | |||
133 | 1 | AM_CPPFLAGS = -I$(top_srcdir)/include | ||
134 | 2 | |||
135 | 3 | AM_CFLAGS = $(GLOBAL_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(openssl_CFLAGS) $(libplist_CFLAGS) $(LFS_CFLAGS) | ||
136 | 4 | AM_LDFLAGS = $(libgnutls_LIBS) $(libtasn1_LIBS) $(openssl_LIBS) $(libplist_LIBS) | ||
137 | 5 | |||
138 | 6 | bin_PROGRAMS = idevice_id ideviceinfo idevicepair idevicesyslog ideviceimagemounter idevicescreenshot ideviceenterrecovery idevicedate idevicebackup idevicebackup2 ideviceprovision idevicedebugserverproxy idevicediagnostics | ||
139 | 7 | |||
140 | 8 | ideviceinfo_SOURCES = ideviceinfo.c | ||
141 | 9 | ideviceinfo_CFLAGS = $(AM_CFLAGS) | ||
142 | 10 | ideviceinfo_LDFLAGS = $(AM_LDFLAGS) | ||
143 | 11 | ideviceinfo_LDADD = ../src/libimobiledevice.la | ||
144 | 12 | |||
145 | 13 | idevicepair_SOURCES = idevicepair.c | ||
146 | 14 | idevicepair_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/src | ||
147 | 15 | idevicepair_LDFLAGS = $(AM_LDFLAGS) | ||
148 | 16 | idevicepair_LDADD = ../src/libimobiledevice.la | ||
149 | 17 | |||
150 | 18 | idevicesyslog_SOURCES = idevicesyslog.c | ||
151 | 19 | idevicesyslog_CFLAGS = $(AM_CFLAGS) | ||
152 | 20 | idevicesyslog_LDFLAGS = $(AM_LDFLAGS) | ||
153 | 21 | idevicesyslog_LDADD = ../src/libimobiledevice.la | ||
154 | 22 | |||
155 | 23 | idevice_id_SOURCES = idevice_id.c | ||
156 | 24 | idevice_id_CFLAGS = $(AM_CFLAGS) | ||
157 | 25 | idevice_id_LDFLAGS = $(AM_LDFLAGS) | ||
158 | 26 | idevice_id_LDADD = ../src/libimobiledevice.la | ||
159 | 27 | |||
160 | 28 | idevicebackup_SOURCES = idevicebackup.c | ||
161 | 29 | idevicebackup_CFLAGS = $(AM_CFLAGS) | ||
162 | 30 | idevicebackup_LDFLAGS = $(AM_LDFLAGS) | ||
163 | 31 | idevicebackup_LDADD = ../src/libimobiledevice.la | ||
164 | 32 | |||
165 | 33 | idevicebackup2_SOURCES = idevicebackup2.c | ||
166 | 34 | idevicebackup2_CFLAGS = $(AM_CFLAGS) | ||
167 | 35 | idevicebackup2_LDFLAGS = $(AM_LDFLAGS) | ||
168 | 36 | idevicebackup2_LDADD = ../src/libimobiledevice.la | ||
169 | 37 | |||
170 | 38 | ideviceimagemounter_SOURCES = ideviceimagemounter.c | ||
171 | 39 | ideviceimagemounter_CFLAGS = $(AM_CFLAGS) | ||
172 | 40 | ideviceimagemounter_LDFLAGS = $(AM_LDFLAGS) | ||
173 | 41 | ideviceimagemounter_LDADD = ../src/libimobiledevice.la | ||
174 | 42 | |||
175 | 43 | idevicescreenshot_SOURCES = idevicescreenshot.c | ||
176 | 44 | idevicescreenshot_CFLAGS = $(AM_CFLAGS) | ||
177 | 45 | idevicescreenshot_LDFLAGS = $(AM_LDFLAGS) | ||
178 | 46 | idevicescreenshot_LDADD = ../src/libimobiledevice.la | ||
179 | 47 | |||
180 | 48 | ideviceenterrecovery_SOURCES = ideviceenterrecovery.c | ||
181 | 49 | ideviceenterrecovery_CFLAGS = $(AM_CFLAGS) | ||
182 | 50 | ideviceenterrecovery_LDFLAGS = $(AM_LDFLAGS) | ||
183 | 51 | ideviceenterrecovery_LDADD = ../src/libimobiledevice.la | ||
184 | 52 | |||
185 | 53 | idevicedate_SOURCES = idevicedate.c | ||
186 | 54 | idevicedate_CFLAGS = $(AM_CFLAGS) | ||
187 | 55 | idevicedate_LDFLAGS = $(AM_LDFLAGS) | ||
188 | 56 | idevicedate_LDADD = ../src/libimobiledevice.la | ||
189 | 57 | |||
190 | 58 | ideviceprovision_SOURCES = ideviceprovision.c | ||
191 | 59 | ideviceprovision_CFLAGS = $(AM_CFLAGS) | ||
192 | 60 | ideviceprovision_LDFLAGS = $(AM_LDFLAGS) | ||
193 | 61 | ideviceprovision_LDADD = ../src/libimobiledevice.la | ||
194 | 62 | |||
195 | 63 | idevicedebugserverproxy_SOURCES = idevicedebugserverproxy.c socket.c thread.c | ||
196 | 64 | idevicedebugserverproxy_CFLAGS = $(AM_CFLAGS) | ||
197 | 65 | idevicedebugserverproxy_LDFLAGS = $(AM_LDFLAGS) | ||
198 | 66 | idevicedebugserverproxy_LDADD = ../src/libimobiledevice.la | ||
199 | 67 | |||
200 | 68 | idevicediagnostics_SOURCES = idevicediagnostics.c | ||
201 | 69 | idevicediagnostics_CFLAGS = $(AM_CFLAGS) | ||
202 | 70 | idevicediagnostics_LDFLAGS = $(AM_LDFLAGS) | ||
203 | 71 | idevicediagnostics_LDADD = ../src/libimobiledevice.la | ||
204 | 72 | |||
205 | 73 | EXTRA_DIST = socket.h thread.h | ||
206 | 74 | 0 | ||
207 | === removed directory '.pc/09_use_python_config.patch' | |||
208 | === removed directory '.pc/09_use_python_config.patch/m4' | |||
209 | === removed file '.pc/09_use_python_config.patch/m4/ac_python_devel.m4' | |||
210 | --- .pc/09_use_python_config.patch/m4/ac_python_devel.m4 2013-01-19 06:11:28 +0000 | |||
211 | +++ .pc/09_use_python_config.patch/m4/ac_python_devel.m4 1970-01-01 00:00:00 +0000 | |||
212 | @@ -1,265 +0,0 @@ | |||
213 | 1 | # =========================================================================== | ||
214 | 2 | # http://autoconf-archive.cryp.to/ac_python_devel.html | ||
215 | 3 | # =========================================================================== | ||
216 | 4 | # | ||
217 | 5 | # SYNOPSIS | ||
218 | 6 | # | ||
219 | 7 | # AC_PYTHON_DEVEL([version]) | ||
220 | 8 | # | ||
221 | 9 | # DESCRIPTION | ||
222 | 10 | # | ||
223 | 11 | # Note: Defines as a precious variable "PYTHON_VERSION". Don't override it | ||
224 | 12 | # in your configure.ac. | ||
225 | 13 | # | ||
226 | 14 | # This macro checks for Python and tries to get the include path to | ||
227 | 15 | # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) | ||
228 | 16 | # output variables. It also exports $(PYTHON_EXTRA_LIBS) and | ||
229 | 17 | # $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. | ||
230 | 18 | # | ||
231 | 19 | # You can search for some particular version of Python by passing a | ||
232 | 20 | # parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please | ||
233 | 21 | # note that you *have* to pass also an operator along with the version to | ||
234 | 22 | # match, and pay special attention to the single quotes surrounding the | ||
235 | 23 | # version number. Don't use "PYTHON_VERSION" for this: that environment | ||
236 | 24 | # variable is declared as precious and thus reserved for the end-user. | ||
237 | 25 | # | ||
238 | 26 | # This macro should work for all versions of Python >= 2.1.0. As an end | ||
239 | 27 | # user, you can disable the check for the python version by setting the | ||
240 | 28 | # PYTHON_NOVERSIONCHECK environment variable to something else than the | ||
241 | 29 | # empty string. | ||
242 | 30 | # | ||
243 | 31 | # If you need to use this macro for an older Python version, please | ||
244 | 32 | # contact the authors. We're always open for feedback. | ||
245 | 33 | # | ||
246 | 34 | # LAST MODIFICATION | ||
247 | 35 | # | ||
248 | 36 | # 2008-04-12 | ||
249 | 37 | # | ||
250 | 38 | # COPYLEFT | ||
251 | 39 | # | ||
252 | 40 | # Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de> | ||
253 | 41 | # Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca> | ||
254 | 42 | # Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net> | ||
255 | 43 | # Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> | ||
256 | 44 | # Copyright (c) 2008 Matteo Settenvini <matteo@member.fsf.org> | ||
257 | 45 | # Copyright (c) 2008 Horst Knorr <hk_classes@knoda.org> | ||
258 | 46 | # | ||
259 | 47 | # This program is free software: you can redistribute it and/or modify it | ||
260 | 48 | # under the terms of the GNU General Public License as published by the | ||
261 | 49 | # Free Software Foundation, either version 3 of the License, or (at your | ||
262 | 50 | # option) any later version. | ||
263 | 51 | # | ||
264 | 52 | # This program is distributed in the hope that it will be useful, but | ||
265 | 53 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
266 | 54 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
267 | 55 | # Public License for more details. | ||
268 | 56 | # | ||
269 | 57 | # You should have received a copy of the GNU General Public License along | ||
270 | 58 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
271 | 59 | # | ||
272 | 60 | # As a special exception, the respective Autoconf Macro's copyright owner | ||
273 | 61 | # gives unlimited permission to copy, distribute and modify the configure | ||
274 | 62 | # scripts that are the output of Autoconf when processing the Macro. You | ||
275 | 63 | # need not follow the terms of the GNU General Public License when using | ||
276 | 64 | # or distributing such scripts, even though portions of the text of the | ||
277 | 65 | # Macro appear in them. The GNU General Public License (GPL) does govern | ||
278 | 66 | # all other use of the material that constitutes the Autoconf Macro. | ||
279 | 67 | # | ||
280 | 68 | # This special exception to the GPL applies to versions of the Autoconf | ||
281 | 69 | # Macro released by the Autoconf Macro Archive. When you make and | ||
282 | 70 | # distribute a modified version of the Autoconf Macro, you may extend this | ||
283 | 71 | # special exception to the GPL to apply to your modified version as well. | ||
284 | 72 | |||
285 | 73 | AC_DEFUN([AC_PYTHON_DEVEL],[ | ||
286 | 74 | # | ||
287 | 75 | # Allow the use of a (user set) custom python version | ||
288 | 76 | # | ||
289 | 77 | AC_ARG_VAR([PYTHON_VERSION],[The installed Python | ||
290 | 78 | version to use, for example '2.3'. This string | ||
291 | 79 | will be appended to the Python interpreter | ||
292 | 80 | canonical name.]) | ||
293 | 81 | |||
294 | 82 | AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) | ||
295 | 83 | if test -z "$PYTHON"; then | ||
296 | 84 | AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) | ||
297 | 85 | PYTHON_VERSION="" | ||
298 | 86 | fi | ||
299 | 87 | |||
300 | 88 | # | ||
301 | 89 | # Check for a version of Python >= 2.1.0 | ||
302 | 90 | # | ||
303 | 91 | AC_MSG_CHECKING([for a version of Python >= '2.1.0']) | ||
304 | 92 | ac_supports_python_ver=`$PYTHON -c "import sys, string; \ | ||
305 | 93 | ver = string.split(sys.version)[[0]]; \ | ||
306 | 94 | print ver >= '2.1.0'"` | ||
307 | 95 | if test "$ac_supports_python_ver" != "True"; then | ||
308 | 96 | if test -z "$PYTHON_NOVERSIONCHECK"; then | ||
309 | 97 | AC_MSG_RESULT([no]) | ||
310 | 98 | AC_MSG_FAILURE([ | ||
311 | 99 | This version of the AC@&t@_PYTHON_DEVEL macro | ||
312 | 100 | doesn't work properly with versions of Python before | ||
313 | 101 | 2.1.0. You may need to re-run configure, setting the | ||
314 | 102 | variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, | ||
315 | 103 | PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. | ||
316 | 104 | Moreover, to disable this check, set PYTHON_NOVERSIONCHECK | ||
317 | 105 | to something else than an empty string. | ||
318 | 106 | ]) | ||
319 | 107 | else | ||
320 | 108 | AC_MSG_RESULT([skip at user request]) | ||
321 | 109 | fi | ||
322 | 110 | else | ||
323 | 111 | AC_MSG_RESULT([yes]) | ||
324 | 112 | fi | ||
325 | 113 | |||
326 | 114 | # | ||
327 | 115 | # if the macro parameter ``version'' is set, honour it | ||
328 | 116 | # | ||
329 | 117 | if test -n "$1"; then | ||
330 | 118 | AC_MSG_CHECKING([for a version of Python $1]) | ||
331 | 119 | ac_supports_python_ver=`$PYTHON -c "import sys, string; \ | ||
332 | 120 | ver = string.split(sys.version)[[0]]; \ | ||
333 | 121 | print ver $1"` | ||
334 | 122 | if test "$ac_supports_python_ver" = "True"; then | ||
335 | 123 | AC_MSG_RESULT([yes]) | ||
336 | 124 | else | ||
337 | 125 | AC_MSG_RESULT([no]) | ||
338 | 126 | AC_MSG_ERROR([this package requires Python $1. | ||
339 | 127 | If you have it installed, but it isn't the default Python | ||
340 | 128 | interpreter in your system path, please pass the PYTHON_VERSION | ||
341 | 129 | variable to configure. See ``configure --help'' for reference. | ||
342 | 130 | ]) | ||
343 | 131 | PYTHON_VERSION="" | ||
344 | 132 | fi | ||
345 | 133 | fi | ||
346 | 134 | |||
347 | 135 | # | ||
348 | 136 | # Check if you have distutils, else fail | ||
349 | 137 | # | ||
350 | 138 | AC_MSG_CHECKING([for the distutils Python package]) | ||
351 | 139 | ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` | ||
352 | 140 | if test -z "$ac_distutils_result"; then | ||
353 | 141 | AC_MSG_RESULT([yes]) | ||
354 | 142 | else | ||
355 | 143 | AC_MSG_RESULT([no]) | ||
356 | 144 | AC_MSG_ERROR([cannot import Python module "distutils". | ||
357 | 145 | Please check your Python installation. The error was: | ||
358 | 146 | $ac_distutils_result]) | ||
359 | 147 | PYTHON_VERSION="" | ||
360 | 148 | fi | ||
361 | 149 | |||
362 | 150 | # | ||
363 | 151 | # Check for Python include path | ||
364 | 152 | # | ||
365 | 153 | AC_MSG_CHECKING([for Python include path]) | ||
366 | 154 | if test -z "$PYTHON_CPPFLAGS"; then | ||
367 | 155 | python_path=`$PYTHON -c "import distutils.sysconfig; \ | ||
368 | 156 | print distutils.sysconfig.get_python_inc();"` | ||
369 | 157 | if test -n "${python_path}"; then | ||
370 | 158 | python_path="-I$python_path" | ||
371 | 159 | fi | ||
372 | 160 | PYTHON_CPPFLAGS=$python_path | ||
373 | 161 | fi | ||
374 | 162 | AC_MSG_RESULT([$PYTHON_CPPFLAGS]) | ||
375 | 163 | AC_SUBST([PYTHON_CPPFLAGS]) | ||
376 | 164 | |||
377 | 165 | # | ||
378 | 166 | # Check for Python library path | ||
379 | 167 | # | ||
380 | 168 | AC_MSG_CHECKING([for Python library path]) | ||
381 | 169 | if test -z "$PYTHON_LDFLAGS"; then | ||
382 | 170 | # (makes two attempts to ensure we've got a version number | ||
383 | 171 | # from the interpreter) | ||
384 | 172 | py_version=`$PYTHON -c "from distutils.sysconfig import *; \ | ||
385 | 173 | from string import join; \ | ||
386 | 174 | print join(get_config_vars('VERSION'))"` | ||
387 | 175 | if test "$py_version" = "[None]"; then | ||
388 | 176 | if test -n "$PYTHON_VERSION"; then | ||
389 | 177 | py_version=$PYTHON_VERSION | ||
390 | 178 | else | ||
391 | 179 | py_version=`$PYTHON -c "import sys; \ | ||
392 | 180 | print sys.version[[:3]]"` | ||
393 | 181 | fi | ||
394 | 182 | fi | ||
395 | 183 | |||
396 | 184 | PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ | ||
397 | 185 | from string import join; \ | ||
398 | 186 | print '-L' + get_python_lib(0,1), \ | ||
399 | 187 | '-lpython';"`$py_version | ||
400 | 188 | fi | ||
401 | 189 | AC_MSG_RESULT([$PYTHON_LDFLAGS]) | ||
402 | 190 | AC_SUBST([PYTHON_LDFLAGS]) | ||
403 | 191 | |||
404 | 192 | # | ||
405 | 193 | # Check for site packages | ||
406 | 194 | # | ||
407 | 195 | AC_MSG_CHECKING([for Python site-packages path]) | ||
408 | 196 | if test -z "$PYTHON_SITE_PKG"; then | ||
409 | 197 | PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ | ||
410 | 198 | print distutils.sysconfig.get_python_lib(0,0);"` | ||
411 | 199 | fi | ||
412 | 200 | AC_MSG_RESULT([$PYTHON_SITE_PKG]) | ||
413 | 201 | AC_SUBST([PYTHON_SITE_PKG]) | ||
414 | 202 | |||
415 | 203 | # | ||
416 | 204 | # libraries which must be linked in when embedding | ||
417 | 205 | # | ||
418 | 206 | AC_MSG_CHECKING(python extra libraries) | ||
419 | 207 | if test -z "$PYTHON_EXTRA_LIBS"; then | ||
420 | 208 | PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ | ||
421 | 209 | conf = distutils.sysconfig.get_config_var; \ | ||
422 | 210 | print conf('LOCALMODLIBS'), conf('LIBS')"` | ||
423 | 211 | fi | ||
424 | 212 | AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) | ||
425 | 213 | AC_SUBST(PYTHON_EXTRA_LIBS) | ||
426 | 214 | |||
427 | 215 | # | ||
428 | 216 | # linking flags needed when embedding | ||
429 | 217 | # | ||
430 | 218 | AC_MSG_CHECKING(python extra linking flags) | ||
431 | 219 | if test -z "$PYTHON_EXTRA_LDFLAGS"; then | ||
432 | 220 | PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ | ||
433 | 221 | conf = distutils.sysconfig.get_config_var; \ | ||
434 | 222 | print conf('LINKFORSHARED')"` | ||
435 | 223 | fi | ||
436 | 224 | AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) | ||
437 | 225 | AC_SUBST(PYTHON_EXTRA_LDFLAGS) | ||
438 | 226 | |||
439 | 227 | # | ||
440 | 228 | # final check to see if everything compiles alright | ||
441 | 229 | # | ||
442 | 230 | AC_MSG_CHECKING([consistency of all components of python development environment]) | ||
443 | 231 | AC_LANG_PUSH([C]) | ||
444 | 232 | # save current global flags | ||
445 | 233 | LIBS="$ac_save_LIBS $PYTHON_LDFLAGS" | ||
446 | 234 | CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" | ||
447 | 235 | AC_TRY_LINK([ | ||
448 | 236 | #include <Python.h> | ||
449 | 237 | ],[ | ||
450 | 238 | Py_Initialize(); | ||
451 | 239 | ],[pythonexists=yes],[pythonexists=no]) | ||
452 | 240 | |||
453 | 241 | AC_MSG_RESULT([$pythonexists]) | ||
454 | 242 | |||
455 | 243 | if test ! "$pythonexists" = "yes"; then | ||
456 | 244 | AC_MSG_ERROR([ | ||
457 | 245 | Could not link test program to Python. Maybe the main Python library has been | ||
458 | 246 | installed in some non-standard library path. If so, pass it to configure, | ||
459 | 247 | via the LDFLAGS environment variable. | ||
460 | 248 | Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" | ||
461 | 249 | ============================================================================ | ||
462 | 250 | ERROR! | ||
463 | 251 | You probably have to install the development version of the Python package | ||
464 | 252 | for your distribution. The exact name of this package varies among them. | ||
465 | 253 | ============================================================================ | ||
466 | 254 | ]) | ||
467 | 255 | PYTHON_VERSION="" | ||
468 | 256 | fi | ||
469 | 257 | AC_LANG_POP | ||
470 | 258 | # turn back to default flags | ||
471 | 259 | CPPFLAGS="$ac_save_CPPFLAGS" | ||
472 | 260 | LIBS="$ac_save_LIBS" | ||
473 | 261 | |||
474 | 262 | # | ||
475 | 263 | # all done! | ||
476 | 264 | # | ||
477 | 265 | ]) | ||
478 | 266 | 0 | ||
479 | === removed directory '.pc/CVE-2013-2142.patch' | |||
480 | === removed directory '.pc/CVE-2013-2142.patch/src' | |||
481 | === removed file '.pc/CVE-2013-2142.patch/src/Makefile.am' | |||
482 | --- .pc/CVE-2013-2142.patch/src/Makefile.am 2013-10-28 23:01:08 +0000 | |||
483 | +++ .pc/CVE-2013-2142.patch/src/Makefile.am 1970-01-01 00:00:00 +0000 | |||
484 | @@ -1,35 +0,0 @@ | |||
485 | 1 | AM_CPPFLAGS = -I$(top_srcdir)/include | ||
486 | 2 | |||
487 | 3 | AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusbmuxd_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libplist_CFLAGS) $(LFS_CFLAGS) $(openssl_CFLAGS) | ||
488 | 4 | AM_LDFLAGS = $(libgnutls_LIBS) $(libtasn1_LIBS) $(libplist_LIBS) $(libusbmuxd_LIBS) $(libgcrypt_LIBS) ${libpthread_LIBS} $(openssl_LIBS) -pthread | ||
489 | 5 | |||
490 | 6 | lib_LTLIBRARIES = libimobiledevice.la | ||
491 | 7 | libimobiledevice_la_LIBADD = | ||
492 | 8 | libimobiledevice_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBIMOBILEDEVICE_SO_VERSION) -no-undefined | ||
493 | 9 | libimobiledevice_la_SOURCES = idevice.c idevice.h \ | ||
494 | 10 | debug.c debug.h\ | ||
495 | 11 | userpref.c userpref.h\ | ||
496 | 12 | service.c service.h\ | ||
497 | 13 | property_list_service.c property_list_service.h\ | ||
498 | 14 | device_link_service.c device_link_service.h\ | ||
499 | 15 | lockdown.c lockdown.h\ | ||
500 | 16 | afc.c afc.h\ | ||
501 | 17 | file_relay.c file_relay.h\ | ||
502 | 18 | notification_proxy.c notification_proxy.h\ | ||
503 | 19 | installation_proxy.c installation_proxy.h\ | ||
504 | 20 | sbservices.c sbservices.h\ | ||
505 | 21 | mobile_image_mounter.c mobile_image_mounter.h\ | ||
506 | 22 | screenshotr.c screenshotr.h\ | ||
507 | 23 | mobilesync.c mobilesync.h\ | ||
508 | 24 | mobilebackup.c mobilebackup.h\ | ||
509 | 25 | house_arrest.c house_arrest.h\ | ||
510 | 26 | mobilebackup2.c mobilebackup2.h\ | ||
511 | 27 | misagent.c misagent.h\ | ||
512 | 28 | restore.c restore.h\ | ||
513 | 29 | diagnostics_relay.c diagnostics_relay.h\ | ||
514 | 30 | heartbeat.c heartbeat.h\ | ||
515 | 31 | webinspector.c webinspector.h | ||
516 | 32 | |||
517 | 33 | if WIN32 | ||
518 | 34 | libimobiledevice_la_LIBADD += -lole32 | ||
519 | 35 | endif | ||
520 | 36 | 0 | ||
521 | === removed file '.pc/CVE-2013-2142.patch/src/userpref.c' | |||
522 | --- .pc/CVE-2013-2142.patch/src/userpref.c 2013-08-14 12:43:31 +0000 | |||
523 | +++ .pc/CVE-2013-2142.patch/src/userpref.c 1970-01-01 00:00:00 +0000 | |||
524 | @@ -1,1161 +0,0 @@ | |||
525 | 1 | /* | ||
526 | 2 | * userpref.c | ||
527 | 3 | * contains methods to access user specific certificates IDs and more. | ||
528 | 4 | * | ||
529 | 5 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. | ||
530 | 6 | * | ||
531 | 7 | * This library is free software; you can redistribute it and/or | ||
532 | 8 | * modify it under the terms of the GNU Lesser General Public | ||
533 | 9 | * License as published by the Free Software Foundation; either | ||
534 | 10 | * version 2.1 of the License, or (at your option) any later version. | ||
535 | 11 | * | ||
536 | 12 | * This library is distributed in the hope that it will be useful, | ||
537 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
538 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
539 | 15 | * Lesser General Public License for more details. | ||
540 | 16 | * | ||
541 | 17 | * You should have received a copy of the GNU Lesser General Public | ||
542 | 18 | * License along with this library; if not, write to the Free Software | ||
543 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
544 | 20 | */ | ||
545 | 21 | |||
546 | 22 | #ifdef HAVE_CONFIG_H | ||
547 | 23 | #include <config.h> | ||
548 | 24 | #endif | ||
549 | 25 | #include <stdio.h> | ||
550 | 26 | #include <stdint.h> | ||
551 | 27 | #include <stdlib.h> | ||
552 | 28 | #include <string.h> | ||
553 | 29 | #ifdef HAVE_OPENSSL | ||
554 | 30 | #include <openssl/pem.h> | ||
555 | 31 | #include <openssl/rsa.h> | ||
556 | 32 | #include <openssl/x509.h> | ||
557 | 33 | #include <openssl/x509v3.h> | ||
558 | 34 | #else | ||
559 | 35 | #include <gnutls/gnutls.h> | ||
560 | 36 | #include <gnutls/x509.h> | ||
561 | 37 | #include <gcrypt.h> | ||
562 | 38 | #endif | ||
563 | 39 | |||
564 | 40 | #include <dirent.h> | ||
565 | 41 | #include <libgen.h> | ||
566 | 42 | #include <sys/stat.h> | ||
567 | 43 | #include <errno.h> | ||
568 | 44 | |||
569 | 45 | #ifdef WIN32 | ||
570 | 46 | #include <shlobj.h> | ||
571 | 47 | #endif | ||
572 | 48 | |||
573 | 49 | #include "userpref.h" | ||
574 | 50 | #include "debug.h" | ||
575 | 51 | |||
576 | 52 | #define LIBIMOBILEDEVICE_CONF_DIR "libimobiledevice" | ||
577 | 53 | #define LIBIMOBILEDEVICE_CONF_FILE "libimobiledevicerc" | ||
578 | 54 | |||
579 | 55 | #define LIBIMOBILEDEVICE_ROOT_PRIVKEY "RootPrivateKey.pem" | ||
580 | 56 | #define LIBIMOBILEDEVICE_HOST_PRIVKEY "HostPrivateKey.pem" | ||
581 | 57 | #define LIBIMOBILEDEVICE_ROOT_CERTIF "RootCertificate.pem" | ||
582 | 58 | #define LIBIMOBILEDEVICE_HOST_CERTIF "HostCertificate.pem" | ||
583 | 59 | |||
584 | 60 | #ifdef WIN32 | ||
585 | 61 | #define DIR_SEP '\\' | ||
586 | 62 | #define DIR_SEP_S "\\" | ||
587 | 63 | #else | ||
588 | 64 | #define DIR_SEP '/' | ||
589 | 65 | #define DIR_SEP_S "/" | ||
590 | 66 | #endif | ||
591 | 67 | |||
592 | 68 | static char __config_dir[512] = {0, }; | ||
593 | 69 | |||
594 | 70 | #ifdef WIN32 | ||
595 | 71 | static char *userpref_utf16_to_utf8(wchar_t *unistr, long len, long *items_read, long *items_written) | ||
596 | 72 | { | ||
597 | 73 | if (!unistr || (len <= 0)) return NULL; | ||
598 | 74 | char *outbuf = (char*)malloc(3*(len+1)); | ||
599 | 75 | int p = 0; | ||
600 | 76 | int i = 0; | ||
601 | 77 | |||
602 | 78 | wchar_t wc; | ||
603 | 79 | |||
604 | 80 | while (i < len) { | ||
605 | 81 | wc = unistr[i++]; | ||
606 | 82 | if (wc >= 0x800) { | ||
607 | 83 | outbuf[p++] = (char)(0xE0 + ((wc >> 12) & 0xF)); | ||
608 | 84 | outbuf[p++] = (char)(0x80 + ((wc >> 6) & 0x3F)); | ||
609 | 85 | outbuf[p++] = (char)(0x80 + (wc & 0x3F)); | ||
610 | 86 | } else if (wc >= 0x80) { | ||
611 | 87 | outbuf[p++] = (char)(0xC0 + ((wc >> 6) & 0x1F)); | ||
612 | 88 | outbuf[p++] = (char)(0x80 + (wc & 0x3F)); | ||
613 | 89 | } else { | ||
614 | 90 | outbuf[p++] = (char)(wc & 0x7F); | ||
615 | 91 | } | ||
616 | 92 | } | ||
617 | 93 | if (items_read) { | ||
618 | 94 | *items_read = i; | ||
619 | 95 | } | ||
620 | 96 | if (items_written) { | ||
621 | 97 | *items_written = p; | ||
622 | 98 | } | ||
623 | 99 | outbuf[p] = 0; | ||
624 | 100 | |||
625 | 101 | return outbuf; | ||
626 | 102 | } | ||
627 | 103 | #endif | ||
628 | 104 | |||
629 | 105 | static const char *userpref_get_tmp_dir() | ||
630 | 106 | { | ||
631 | 107 | const char *cdir = getenv("TMPDIR"); | ||
632 | 108 | if (cdir && cdir[0]) | ||
633 | 109 | return cdir; | ||
634 | 110 | cdir = getenv("TMP"); | ||
635 | 111 | if (cdir && cdir[0]) | ||
636 | 112 | return cdir; | ||
637 | 113 | cdir = getenv("TEMP"); | ||
638 | 114 | if (cdir && cdir[0]) | ||
639 | 115 | return cdir; | ||
640 | 116 | return "/tmp"; | ||
641 | 117 | } | ||
642 | 118 | |||
643 | 119 | static const char *userpref_get_config_dir() | ||
644 | 120 | { | ||
645 | 121 | if (__config_dir[0]) return __config_dir; | ||
646 | 122 | #ifdef WIN32 | ||
647 | 123 | wchar_t path[MAX_PATH+1]; | ||
648 | 124 | HRESULT hr; | ||
649 | 125 | LPITEMIDLIST pidl = NULL; | ||
650 | 126 | BOOL b = FALSE; | ||
651 | 127 | |||
652 | 128 | hr = SHGetSpecialFolderLocation (NULL, CSIDL_LOCAL_APPDATA, &pidl); | ||
653 | 129 | if (hr == S_OK) { | ||
654 | 130 | b = SHGetPathFromIDListW (pidl, path); | ||
655 | 131 | if (b) { | ||
656 | 132 | char *cdir = userpref_utf16_to_utf8 (path, wcslen(path), NULL, NULL); | ||
657 | 133 | strcpy(__config_dir, cdir); | ||
658 | 134 | free(cdir); | ||
659 | 135 | CoTaskMemFree (pidl); | ||
660 | 136 | } | ||
661 | 137 | } | ||
662 | 138 | #else | ||
663 | 139 | const char *cdir = getenv("XDG_CONFIG_HOME"); | ||
664 | 140 | if (!cdir) { | ||
665 | 141 | cdir = getenv("HOME"); | ||
666 | 142 | if (!cdir || !cdir[0]) { | ||
667 | 143 | const char *tdir = userpref_get_tmp_dir(); | ||
668 | 144 | strcpy(__config_dir, tdir); | ||
669 | 145 | strcat(__config_dir, DIR_SEP_S); | ||
670 | 146 | strcat(__config_dir, "root"); | ||
671 | 147 | } else { | ||
672 | 148 | strcpy(__config_dir, cdir); | ||
673 | 149 | } | ||
674 | 150 | strcat(__config_dir, DIR_SEP_S); | ||
675 | 151 | strcat(__config_dir, ".config"); | ||
676 | 152 | } else { | ||
677 | 153 | strcpy(__config_dir, cdir); | ||
678 | 154 | } | ||
679 | 155 | #endif | ||
680 | 156 | strcat(__config_dir, DIR_SEP_S); | ||
681 | 157 | strcat(__config_dir, LIBIMOBILEDEVICE_CONF_DIR); | ||
682 | 158 | |||
683 | 159 | int i = strlen(__config_dir)-1; | ||
684 | 160 | while ((i > 0) && (__config_dir[i] == DIR_SEP)) { | ||
685 | 161 | __config_dir[i--] = '\0'; | ||
686 | 162 | } | ||
687 | 163 | |||
688 | 164 | return __config_dir; | ||
689 | 165 | } | ||
690 | 166 | |||
691 | 167 | static int __mkdir(const char *dir, int mode) | ||
692 | 168 | { | ||
693 | 169 | #ifdef WIN32 | ||
694 | 170 | return mkdir(dir); | ||
695 | 171 | #else | ||
696 | 172 | return mkdir(dir, mode); | ||
697 | 173 | #endif | ||
698 | 174 | } | ||
699 | 175 | |||
700 | 176 | static int mkdir_with_parents(const char *dir, int mode) | ||
701 | 177 | { | ||
702 | 178 | if (!dir) return -1; | ||
703 | 179 | if (__mkdir(dir, mode) == 0) { | ||
704 | 180 | return 0; | ||
705 | 181 | } else { | ||
706 | 182 | if (errno == EEXIST) return 0; | ||
707 | 183 | } | ||
708 | 184 | int res; | ||
709 | 185 | char *parent = strdup(dir); | ||
710 | 186 | parent = dirname(parent); | ||
711 | 187 | if (parent) { | ||
712 | 188 | res = mkdir_with_parents(parent, mode); | ||
713 | 189 | } else { | ||
714 | 190 | res = -1; | ||
715 | 191 | } | ||
716 | 192 | free(parent); | ||
717 | 193 | if (res == 0) { | ||
718 | 194 | mkdir_with_parents(dir, mode); | ||
719 | 195 | } | ||
720 | 196 | return res; | ||
721 | 197 | } | ||
722 | 198 | |||
723 | 199 | static int config_write(const char *cfgfile, plist_t dict) | ||
724 | 200 | { | ||
725 | 201 | if (!cfgfile || !dict || (plist_get_node_type(dict) != PLIST_DICT)) { | ||
726 | 202 | return -1; | ||
727 | 203 | } | ||
728 | 204 | int res = -1; | ||
729 | 205 | |||
730 | 206 | #if 1 // old style config | ||
731 | 207 | plist_t hostid = plist_dict_get_item(dict, "HostID"); | ||
732 | 208 | if (hostid && (plist_get_node_type(hostid) == PLIST_STRING)) { | ||
733 | 209 | char *hostidstr = NULL; | ||
734 | 210 | plist_get_string_val(hostid, &hostidstr); | ||
735 | 211 | if (hostidstr) { | ||
736 | 212 | FILE *fd = fopen(cfgfile, "wb"); | ||
737 | 213 | if (fd) { | ||
738 | 214 | fprintf(fd, "\n[Global]\nHostID=%s\n", hostidstr); | ||
739 | 215 | fclose(fd); | ||
740 | 216 | res = 0; | ||
741 | 217 | } else { | ||
742 | 218 | debug_info("could not open '%s' for writing: %s", cfgfile, strerror(errno)); | ||
743 | 219 | } | ||
744 | 220 | free(hostidstr); | ||
745 | 221 | } | ||
746 | 222 | } | ||
747 | 223 | #endif | ||
748 | 224 | #if 0 | ||
749 | 225 | char *xml = NULL; | ||
750 | 226 | uint32_t length = 0; | ||
751 | 227 | |||
752 | 228 | plist_to_xml(dict, &xml, &length); | ||
753 | 229 | if (!xml) { | ||
754 | 230 | return res; | ||
755 | 231 | } | ||
756 | 232 | |||
757 | 233 | FILE *fd = fopen(cfgfile, "wb"); | ||
758 | 234 | if (!fd) { | ||
759 | 235 | free(xml); | ||
760 | 236 | return res; | ||
761 | 237 | } | ||
762 | 238 | |||
763 | 239 | if (fwrite(xml, 1, length, fd) == length) { | ||
764 | 240 | res = 0; | ||
765 | 241 | } else { | ||
766 | 242 | fprintf(stderr, "%s: ERROR: failed to write configuration to '%s'\n", __func__, cfgfile); | ||
767 | 243 | } | ||
768 | 244 | fclose(fd); | ||
769 | 245 | |||
770 | 246 | free(xml); | ||
771 | 247 | #endif | ||
772 | 248 | return res; | ||
773 | 249 | } | ||
774 | 250 | |||
775 | 251 | static int config_read(const char *cfgfile, plist_t *dict) | ||
776 | 252 | { | ||
777 | 253 | if (!cfgfile || !dict) { | ||
778 | 254 | return -1; | ||
779 | 255 | } | ||
780 | 256 | |||
781 | 257 | int res = -1; | ||
782 | 258 | FILE *fd = fopen(cfgfile, "rb"); | ||
783 | 259 | if (!fd) { | ||
784 | 260 | debug_info("could not open '%s' for reading: %s", cfgfile, strerror(errno)); | ||
785 | 261 | return -1; | ||
786 | 262 | } | ||
787 | 263 | |||
788 | 264 | fseek(fd, 0, SEEK_END); | ||
789 | 265 | unsigned long int size = ftell(fd); | ||
790 | 266 | fseek(fd, 0, SEEK_SET); | ||
791 | 267 | unsigned char *contents = NULL; | ||
792 | 268 | |||
793 | 269 | contents = malloc(size); | ||
794 | 270 | if (fread(contents, 1, size, fd) != size) { | ||
795 | 271 | free(contents); | ||
796 | 272 | fclose(fd); | ||
797 | 273 | return -1; | ||
798 | 274 | } | ||
799 | 275 | plist_t plist = NULL; | ||
800 | 276 | |||
801 | 277 | if (!memcmp(contents, "bplist00", 8)) { | ||
802 | 278 | plist_from_bin((const char*)contents, (uint32_t)size, &plist); | ||
803 | 279 | fclose(fd); | ||
804 | 280 | } else { | ||
805 | 281 | if (memchr(contents, '<', size)) { | ||
806 | 282 | plist_from_xml((const char*)contents, (uint32_t)size, &plist); | ||
807 | 283 | } | ||
808 | 284 | if (plist) { | ||
809 | 285 | fclose(fd); | ||
810 | 286 | } else { | ||
811 | 287 | // try parsing old format config file | ||
812 | 288 | char line[256]; | ||
813 | 289 | fseek(fd, 0, SEEK_SET); | ||
814 | 290 | while (fgets(line, 256, fd)) { | ||
815 | 291 | char *p = &line[0]; | ||
816 | 292 | size_t llen = strlen(p)-1; | ||
817 | 293 | while ((llen > 0) && ((p[llen] == '\n') || (p[llen] == '\r'))) { | ||
818 | 294 | p[llen] = '\0'; | ||
819 | 295 | llen--; | ||
820 | 296 | } | ||
821 | 297 | if (llen == 0) continue; | ||
822 | 298 | while ((p[0] == '\n') || (p[0] == '\r')) { | ||
823 | 299 | p++; | ||
824 | 300 | } | ||
825 | 301 | if (!strncmp(p, "HostID=", 7)) { | ||
826 | 302 | plist = plist_new_dict(); | ||
827 | 303 | plist_dict_insert_item(plist, "HostID", plist_new_string(p+7)); | ||
828 | 304 | break; | ||
829 | 305 | } | ||
830 | 306 | } | ||
831 | 307 | fclose(fd); | ||
832 | 308 | #if 0 | ||
833 | 309 | if (plist) { | ||
834 | 310 | // write new format config | ||
835 | 311 | config_write(cfgfile, plist); | ||
836 | 312 | } | ||
837 | 313 | #endif | ||
838 | 314 | } | ||
839 | 315 | } | ||
840 | 316 | free(contents); | ||
841 | 317 | if (plist) { | ||
842 | 318 | *dict = plist; | ||
843 | 319 | res = 0; | ||
844 | 320 | } | ||
845 | 321 | return res; | ||
846 | 322 | } | ||
847 | 323 | |||
848 | 324 | /** | ||
849 | 325 | * Creates a freedesktop compatible configuration directory. | ||
850 | 326 | */ | ||
851 | 327 | static void userpref_create_config_dir(void) | ||
852 | 328 | { | ||
853 | 329 | const char *config_path = userpref_get_config_dir(); | ||
854 | 330 | struct stat st; | ||
855 | 331 | if (stat(config_path, &st) != 0) { | ||
856 | 332 | mkdir_with_parents(config_path, 0755); | ||
857 | 333 | } | ||
858 | 334 | } | ||
859 | 335 | |||
860 | 336 | static int get_rand(int min, int max) | ||
861 | 337 | { | ||
862 | 338 | int retval = (rand() % (max - min)) + min; | ||
863 | 339 | return retval; | ||
864 | 340 | } | ||
865 | 341 | |||
866 | 342 | /** | ||
867 | 343 | * Generates a valid HostID (which is actually a UUID). | ||
868 | 344 | * | ||
869 | 345 | * @return A null terminated string containing a valid HostID. | ||
870 | 346 | */ | ||
871 | 347 | static char *userpref_generate_host_id() | ||
872 | 348 | { | ||
873 | 349 | /* HostID's are just UUID's, and UUID's are 36 characters long */ | ||
874 | 350 | char *hostid = (char *) malloc(sizeof(char) * 37); | ||
875 | 351 | const char *chars = "ABCDEF0123456789"; | ||
876 | 352 | srand(time(NULL)); | ||
877 | 353 | int i = 0; | ||
878 | 354 | |||
879 | 355 | for (i = 0; i < 36; i++) { | ||
880 | 356 | if (i == 8 || i == 13 || i == 18 || i == 23) { | ||
881 | 357 | hostid[i] = '-'; | ||
882 | 358 | continue; | ||
883 | 359 | } else { | ||
884 | 360 | hostid[i] = chars[get_rand(0, 16)]; | ||
885 | 361 | } | ||
886 | 362 | } | ||
887 | 363 | /* make it a real string */ | ||
888 | 364 | hostid[36] = '\0'; | ||
889 | 365 | return hostid; | ||
890 | 366 | } | ||
891 | 367 | |||
892 | 368 | /** | ||
893 | 369 | * Store HostID in config file. | ||
894 | 370 | * | ||
895 | 371 | * @param host_id A null terminated string containing a valid HostID. | ||
896 | 372 | */ | ||
897 | 373 | static int userpref_set_host_id(const char *host_id) | ||
898 | 374 | { | ||
899 | 375 | const char *config_path; | ||
900 | 376 | char *config_file; | ||
901 | 377 | |||
902 | 378 | if (!host_id) | ||
903 | 379 | return 0; | ||
904 | 380 | |||
905 | 381 | /* Make sure config directory exists */ | ||
906 | 382 | userpref_create_config_dir(); | ||
907 | 383 | |||
908 | 384 | config_path = userpref_get_config_dir(); | ||
909 | 385 | config_file = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_CONF_FILE)+1); | ||
910 | 386 | strcpy(config_file, config_path); | ||
911 | 387 | strcat(config_file, DIR_SEP_S); | ||
912 | 388 | strcat(config_file, LIBIMOBILEDEVICE_CONF_FILE); | ||
913 | 389 | |||
914 | 390 | /* Now parse file to get the HostID */ | ||
915 | 391 | plist_t config = NULL; | ||
916 | 392 | config_read(config_file, &config); | ||
917 | 393 | if (!config) { | ||
918 | 394 | config = plist_new_dict(); | ||
919 | 395 | plist_dict_insert_item(config, "HostID", plist_new_string(host_id)); | ||
920 | 396 | } else { | ||
921 | 397 | plist_t n = plist_dict_get_item(config, "HostID"); | ||
922 | 398 | if (n) { | ||
923 | 399 | plist_set_string_val(n, host_id); | ||
924 | 400 | } else { | ||
925 | 401 | plist_dict_insert_item(config, "HostID", plist_new_string(host_id)); | ||
926 | 402 | } | ||
927 | 403 | } | ||
928 | 404 | |||
929 | 405 | /* Store in config file */ | ||
930 | 406 | debug_info("setting hostID to %s", host_id); | ||
931 | 407 | |||
932 | 408 | config_write(config_file, config); | ||
933 | 409 | plist_free(config); | ||
934 | 410 | |||
935 | 411 | free(config_file); | ||
936 | 412 | return 1; | ||
937 | 413 | } | ||
938 | 414 | |||
939 | 415 | /** | ||
940 | 416 | * Reads the HostID from a previously generated configuration file. | ||
941 | 417 | * | ||
942 | 418 | * @note It is the responsibility of the calling function to free the returned host_id | ||
943 | 419 | * | ||
944 | 420 | * @return The string containing the HostID or NULL | ||
945 | 421 | */ | ||
946 | 422 | void userpref_get_host_id(char **host_id) | ||
947 | 423 | { | ||
948 | 424 | const char *config_path; | ||
949 | 425 | char *config_file; | ||
950 | 426 | |||
951 | 427 | config_path = userpref_get_config_dir(); | ||
952 | 428 | config_file = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_CONF_FILE)+1); | ||
953 | 429 | strcpy(config_file, config_path); | ||
954 | 430 | strcat(config_file, DIR_SEP_S); | ||
955 | 431 | strcat(config_file, LIBIMOBILEDEVICE_CONF_FILE); | ||
956 | 432 | |||
957 | 433 | /* now parse file to get the HostID */ | ||
958 | 434 | plist_t config = NULL; | ||
959 | 435 | if (config_read(config_file, &config) == 0) { | ||
960 | 436 | plist_t n_host_id = plist_dict_get_item(config, "HostID"); | ||
961 | 437 | if (n_host_id && (plist_get_node_type(n_host_id) == PLIST_STRING)) { | ||
962 | 438 | plist_get_string_val(n_host_id, host_id); | ||
963 | 439 | } | ||
964 | 440 | } | ||
965 | 441 | plist_free(config); | ||
966 | 442 | free(config_file); | ||
967 | 443 | |||
968 | 444 | if (!*host_id) { | ||
969 | 445 | /* no config, generate host_id */ | ||
970 | 446 | *host_id = userpref_generate_host_id(); | ||
971 | 447 | userpref_set_host_id(*host_id); | ||
972 | 448 | } | ||
973 | 449 | |||
974 | 450 | debug_info("Using %s as HostID", *host_id); | ||
975 | 451 | } | ||
976 | 452 | |||
977 | 453 | /** | ||
978 | 454 | * Determines whether this device has been connected to this system before. | ||
979 | 455 | * | ||
980 | 456 | * @param udid The device UDID as given by the device. | ||
981 | 457 | * | ||
982 | 458 | * @return 1 if the device has been connected previously to this configuration | ||
983 | 459 | * or 0 otherwise. | ||
984 | 460 | */ | ||
985 | 461 | int userpref_has_device_public_key(const char *udid) | ||
986 | 462 | { | ||
987 | 463 | int ret = 0; | ||
988 | 464 | const char *config_path; | ||
989 | 465 | char *config_file; | ||
990 | 466 | struct stat st; | ||
991 | 467 | |||
992 | 468 | if (!udid) return 0; | ||
993 | 469 | |||
994 | 470 | /* first get config file */ | ||
995 | 471 | config_path = userpref_get_config_dir(); | ||
996 | 472 | config_file = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); | ||
997 | 473 | strcpy(config_file, config_path); | ||
998 | 474 | strcat(config_file, DIR_SEP_S); | ||
999 | 475 | strcat(config_file, udid); | ||
1000 | 476 | strcat(config_file, ".pem"); | ||
1001 | 477 | |||
1002 | 478 | if ((stat(config_file, &st) == 0) && S_ISREG(st.st_mode)) | ||
1003 | 479 | ret = 1; | ||
1004 | 480 | free(config_file); | ||
1005 | 481 | return ret; | ||
1006 | 482 | } | ||
1007 | 483 | |||
1008 | 484 | /** | ||
1009 | 485 | * Fills a list with UDIDs of devices that have been connected to this | ||
1010 | 486 | * system before, i.e. for which a public key file exists. | ||
1011 | 487 | * | ||
1012 | 488 | * @param list A pointer to a char** initially pointing to NULL that will | ||
1013 | 489 | * hold a newly allocated list of UDIDs upon successful return. | ||
1014 | 490 | * The caller is responsible for freeing the memory. Note that if | ||
1015 | 491 | * no public key file was found the list has to be freed too as it | ||
1016 | 492 | * points to a terminating NULL element. | ||
1017 | 493 | * @param count The number of UDIDs found. This parameter can be NULL if it | ||
1018 | 494 | * is not required. | ||
1019 | 495 | * | ||
1020 | 496 | * @return USERPREF_E_SUCCESS on success, or USERPREF_E_INVALID_ARG if the | ||
1021 | 497 | * list parameter is not pointing to NULL. | ||
1022 | 498 | */ | ||
1023 | 499 | userpref_error_t userpref_get_paired_udids(char ***list, unsigned int *count) | ||
1024 | 500 | { | ||
1025 | 501 | struct slist_t { | ||
1026 | 502 | char *name; | ||
1027 | 503 | void *next; | ||
1028 | 504 | }; | ||
1029 | 505 | DIR *config_dir; | ||
1030 | 506 | const char *config_path; | ||
1031 | 507 | struct slist_t *udids = NULL; | ||
1032 | 508 | unsigned int i; | ||
1033 | 509 | unsigned int found = 0; | ||
1034 | 510 | |||
1035 | 511 | if (!list || (list && *list)) { | ||
1036 | 512 | debug_info("ERROR: The list parameter needs to point to NULL!"); | ||
1037 | 513 | return USERPREF_E_INVALID_ARG; | ||
1038 | 514 | } | ||
1039 | 515 | |||
1040 | 516 | if (count) { | ||
1041 | 517 | *count = 0; | ||
1042 | 518 | } | ||
1043 | 519 | |||
1044 | 520 | config_path = userpref_get_config_dir(); | ||
1045 | 521 | config_dir = opendir(config_path); | ||
1046 | 522 | if (config_dir) { | ||
1047 | 523 | struct dirent *entry; | ||
1048 | 524 | struct slist_t *listp = udids; | ||
1049 | 525 | while ((entry = readdir(config_dir))) { | ||
1050 | 526 | char *ext = strstr(entry->d_name, ".pem"); | ||
1051 | 527 | if (ext && ((ext - entry->d_name) == 40) && (strlen(entry->d_name) == 44)) { | ||
1052 | 528 | struct slist_t *ne = (struct slist_t*)malloc(sizeof(struct slist_t)); | ||
1053 | 529 | ne->name = (char*)malloc(41); | ||
1054 | 530 | strncpy(ne->name, entry->d_name, 40); | ||
1055 | 531 | ne->name[40] = 0; | ||
1056 | 532 | ne->next = NULL; | ||
1057 | 533 | if (!listp) { | ||
1058 | 534 | listp = ne; | ||
1059 | 535 | udids = listp; | ||
1060 | 536 | } else { | ||
1061 | 537 | listp->next = ne; | ||
1062 | 538 | listp = listp->next; | ||
1063 | 539 | } | ||
1064 | 540 | found++; | ||
1065 | 541 | } | ||
1066 | 542 | } | ||
1067 | 543 | closedir(config_dir); | ||
1068 | 544 | } | ||
1069 | 545 | *list = (char**)malloc(sizeof(char*) * (found+1)); | ||
1070 | 546 | i = 0; | ||
1071 | 547 | while (udids) { | ||
1072 | 548 | (*list)[i++] = udids->name; | ||
1073 | 549 | struct slist_t *old = udids; | ||
1074 | 550 | udids = udids->next; | ||
1075 | 551 | free(old); | ||
1076 | 552 | } | ||
1077 | 553 | (*list)[i] = NULL; | ||
1078 | 554 | |||
1079 | 555 | if (count) { | ||
1080 | 556 | *count = found; | ||
1081 | 557 | } | ||
1082 | 558 | |||
1083 | 559 | return USERPREF_E_SUCCESS; | ||
1084 | 560 | } | ||
1085 | 561 | |||
1086 | 562 | /** | ||
1087 | 563 | * Mark the device (as represented by the key) as having connected to this | ||
1088 | 564 | * configuration. | ||
1089 | 565 | * | ||
1090 | 566 | * @param udid The device UDID as given by the device | ||
1091 | 567 | * @param public_key The public key given by the device | ||
1092 | 568 | * | ||
1093 | 569 | * @return 1 on success and 0 if no public key is given or if it has already | ||
1094 | 570 | * been marked as connected previously. | ||
1095 | 571 | */ | ||
1096 | 572 | userpref_error_t userpref_set_device_public_key(const char *udid, key_data_t public_key) | ||
1097 | 573 | { | ||
1098 | 574 | if (NULL == public_key.data) | ||
1099 | 575 | return USERPREF_E_INVALID_ARG; | ||
1100 | 576 | |||
1101 | 577 | if (userpref_has_device_public_key(udid)) | ||
1102 | 578 | return USERPREF_E_SUCCESS; | ||
1103 | 579 | |||
1104 | 580 | /* ensure config directory exists */ | ||
1105 | 581 | userpref_create_config_dir(); | ||
1106 | 582 | |||
1107 | 583 | /* build file path */ | ||
1108 | 584 | const char *config_path = userpref_get_config_dir(); | ||
1109 | 585 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); | ||
1110 | 586 | strcpy(pem, config_path); | ||
1111 | 587 | strcat(pem, DIR_SEP_S); | ||
1112 | 588 | strcat(pem, udid); | ||
1113 | 589 | strcat(pem, ".pem"); | ||
1114 | 590 | |||
1115 | 591 | /* store file */ | ||
1116 | 592 | FILE *pFile = fopen(pem, "wb"); | ||
1117 | 593 | if (pFile) { | ||
1118 | 594 | fwrite(public_key.data, 1, public_key.size, pFile); | ||
1119 | 595 | fclose(pFile); | ||
1120 | 596 | } else { | ||
1121 | 597 | debug_info("could not open '%s' for writing: %s", pem, strerror(errno)); | ||
1122 | 598 | } | ||
1123 | 599 | free(pem); | ||
1124 | 600 | |||
1125 | 601 | return USERPREF_E_SUCCESS; | ||
1126 | 602 | } | ||
1127 | 603 | |||
1128 | 604 | /** | ||
1129 | 605 | * Remove the public key stored for the device with udid from this host. | ||
1130 | 606 | * | ||
1131 | 607 | * @param udid The udid of the device | ||
1132 | 608 | * | ||
1133 | 609 | * @return USERPREF_E_SUCCESS on success. | ||
1134 | 610 | */ | ||
1135 | 611 | userpref_error_t userpref_remove_device_public_key(const char *udid) | ||
1136 | 612 | { | ||
1137 | 613 | if (!userpref_has_device_public_key(udid)) | ||
1138 | 614 | return USERPREF_E_SUCCESS; | ||
1139 | 615 | |||
1140 | 616 | /* build file path */ | ||
1141 | 617 | const char *config_path = userpref_get_config_dir(); | ||
1142 | 618 | char *pem = (char*)malloc(strlen(config_path)+1+strlen(udid)+4+1); | ||
1143 | 619 | strcpy(pem, config_path); | ||
1144 | 620 | strcat(pem, DIR_SEP_S); | ||
1145 | 621 | strcat(pem, udid); | ||
1146 | 622 | strcat(pem, ".pem"); | ||
1147 | 623 | |||
1148 | 624 | /* remove file */ | ||
1149 | 625 | remove(pem); | ||
1150 | 626 | |||
1151 | 627 | free(pem); | ||
1152 | 628 | |||
1153 | 629 | return USERPREF_E_SUCCESS; | ||
1154 | 630 | } | ||
1155 | 631 | |||
1156 | 632 | /** | ||
1157 | 633 | * Private function which reads the given file into a key_data_t structure. | ||
1158 | 634 | * | ||
1159 | 635 | * @param file The filename of the file to read | ||
1160 | 636 | * @param data The pointer at which to store the data. | ||
1161 | 637 | * | ||
1162 | 638 | * @return 1 if the file contents where read successfully and 0 otherwise. | ||
1163 | 639 | */ | ||
1164 | 640 | static int userpref_get_file_contents(const char *file, key_data_t * data) | ||
1165 | 641 | { | ||
1166 | 642 | int success = 0; | ||
1167 | 643 | unsigned long int size = 0; | ||
1168 | 644 | unsigned char *content = NULL; | ||
1169 | 645 | const char *config_path; | ||
1170 | 646 | char *filepath; | ||
1171 | 647 | FILE *fd; | ||
1172 | 648 | |||
1173 | 649 | if (NULL == file || NULL == data) | ||
1174 | 650 | return 0; | ||
1175 | 651 | |||
1176 | 652 | /* Read file */ | ||
1177 | 653 | config_path = userpref_get_config_dir(); | ||
1178 | 654 | filepath = (char*)malloc(strlen(config_path)+1+strlen(file)+1); | ||
1179 | 655 | strcpy(filepath, config_path); | ||
1180 | 656 | strcat(filepath, DIR_SEP_S); | ||
1181 | 657 | strcat(filepath, file); | ||
1182 | 658 | |||
1183 | 659 | fd = fopen(filepath, "rb"); | ||
1184 | 660 | if (fd) { | ||
1185 | 661 | fseek(fd, 0, SEEK_END); | ||
1186 | 662 | size = ftell(fd); | ||
1187 | 663 | fseek(fd, 0, SEEK_SET); | ||
1188 | 664 | |||
1189 | 665 | // prevent huge files | ||
1190 | 666 | if (size > 0xFFFFFF) { | ||
1191 | 667 | fprintf(stderr, "%s: file is too big (> 16MB). Refusing to read the contents to memory!", __func__); | ||
1192 | 668 | } else { | ||
1193 | 669 | size_t p = 0; | ||
1194 | 670 | content = (unsigned char*)malloc(size); | ||
1195 | 671 | while (!feof(fd)) { | ||
1196 | 672 | p += fread(content+p, 1, size-p, fd); | ||
1197 | 673 | if (ferror(fd) != 0) { | ||
1198 | 674 | break; | ||
1199 | 675 | } | ||
1200 | 676 | if (p >= size) { | ||
1201 | 677 | success = 1; | ||
1202 | 678 | break; | ||
1203 | 679 | } | ||
1204 | 680 | } | ||
1205 | 681 | } | ||
1206 | 682 | fclose(fd); | ||
1207 | 683 | } | ||
1208 | 684 | |||
1209 | 685 | free(filepath); | ||
1210 | 686 | |||
1211 | 687 | /* Add it to the key_data_t structure */ | ||
1212 | 688 | if (success) { | ||
1213 | 689 | data->data = (uint8_t*) content; | ||
1214 | 690 | data->size = size; | ||
1215 | 691 | } | ||
1216 | 692 | |||
1217 | 693 | return success; | ||
1218 | 694 | } | ||
1219 | 695 | |||
1220 | 696 | /** | ||
1221 | 697 | * Private function which generate private keys and certificates. | ||
1222 | 698 | * | ||
1223 | 699 | * @return 1 if keys were successfully generated, 0 otherwise | ||
1224 | 700 | */ | ||
1225 | 701 | static userpref_error_t userpref_gen_keys_and_cert(void) | ||
1226 | 702 | { | ||
1227 | 703 | userpref_error_t ret = USERPREF_E_SSL_ERROR; | ||
1228 | 704 | |||
1229 | 705 | key_data_t root_key_pem = { NULL, 0 }; | ||
1230 | 706 | key_data_t root_cert_pem = { NULL, 0 }; | ||
1231 | 707 | key_data_t host_key_pem = { NULL, 0 }; | ||
1232 | 708 | key_data_t host_cert_pem = { NULL, 0 }; | ||
1233 | 709 | |||
1234 | 710 | debug_info("Generating keys and certificates"); | ||
1235 | 711 | #ifdef HAVE_OPENSSL | ||
1236 | 712 | RSA* root_keypair = RSA_generate_key(2048, 65537, NULL, NULL); | ||
1237 | 713 | RSA* host_keypair = RSA_generate_key(2048, 65537, NULL, NULL); | ||
1238 | 714 | |||
1239 | 715 | EVP_PKEY* root_pkey = EVP_PKEY_new(); | ||
1240 | 716 | EVP_PKEY_assign_RSA(root_pkey, root_keypair); | ||
1241 | 717 | |||
1242 | 718 | EVP_PKEY* host_pkey = EVP_PKEY_new(); | ||
1243 | 719 | EVP_PKEY_assign_RSA(host_pkey, host_keypair); | ||
1244 | 720 | |||
1245 | 721 | /* generate root certificate */ | ||
1246 | 722 | X509* root_cert = X509_new(); | ||
1247 | 723 | { | ||
1248 | 724 | /* set serial number */ | ||
1249 | 725 | ASN1_INTEGER* sn = ASN1_INTEGER_new(); | ||
1250 | 726 | ASN1_INTEGER_set(sn, 0); | ||
1251 | 727 | X509_set_serialNumber(root_cert, sn); | ||
1252 | 728 | ASN1_INTEGER_free(sn); | ||
1253 | 729 | |||
1254 | 730 | /* set version */ | ||
1255 | 731 | X509_set_version(root_cert, 2); | ||
1256 | 732 | |||
1257 | 733 | /* set x509v3 basic constraints */ | ||
1258 | 734 | X509_EXTENSION* ext; | ||
1259 | 735 | if (!(ext = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints, (char*)"critical,CA:TRUE"))) { | ||
1260 | 736 | debug_info("ERROR: X509V3_EXT_conf_nid failed"); | ||
1261 | 737 | } | ||
1262 | 738 | X509_add_ext(root_cert, ext, -1); | ||
1263 | 739 | |||
1264 | 740 | /* set key validity */ | ||
1265 | 741 | ASN1_TIME* asn1time = ASN1_TIME_new(); | ||
1266 | 742 | ASN1_TIME_set(asn1time, time(NULL)); | ||
1267 | 743 | X509_set_notBefore(root_cert, asn1time); | ||
1268 | 744 | ASN1_TIME_set(asn1time, time(NULL) + (60 * 60 * 24 * 365 * 10)); | ||
1269 | 745 | X509_set_notAfter(root_cert, asn1time); | ||
1270 | 746 | ASN1_TIME_free(asn1time); | ||
1271 | 747 | |||
1272 | 748 | /* use root public key for root cert */ | ||
1273 | 749 | X509_set_pubkey(root_cert, root_pkey); | ||
1274 | 750 | /* sign root cert with root private key */ | ||
1275 | 751 | X509_sign(root_cert, root_pkey, EVP_sha1()); | ||
1276 | 752 | } | ||
1277 | 753 | |||
1278 | 754 | /* create host certificate */ | ||
1279 | 755 | X509* host_cert = X509_new(); | ||
1280 | 756 | { | ||
1281 | 757 | /* set serial number */ | ||
1282 | 758 | ASN1_INTEGER* sn = ASN1_INTEGER_new(); | ||
1283 | 759 | ASN1_INTEGER_set(sn, 0); | ||
1284 | 760 | X509_set_serialNumber(host_cert, sn); | ||
1285 | 761 | ASN1_INTEGER_free(sn); | ||
1286 | 762 | |||
1287 | 763 | /* set version */ | ||
1288 | 764 | X509_set_version(host_cert, 2); | ||
1289 | 765 | |||
1290 | 766 | /* set x509v3 basic constraints */ | ||
1291 | 767 | X509_EXTENSION* ext; | ||
1292 | 768 | if (!(ext = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints, (char*)"critical,CA:FALSE"))) { | ||
1293 | 769 | debug_info("ERROR: X509V3_EXT_conf_nid failed"); | ||
1294 | 770 | } | ||
1295 | 771 | X509_add_ext(host_cert, ext, -1); | ||
1296 | 772 | |||
1297 | 773 | /* set x509v3 key usage */ | ||
1298 | 774 | if (!(ext = X509V3_EXT_conf_nid(NULL, NULL, NID_key_usage, (char*)"digitalSignature,keyEncipherment"))) { | ||
1299 | 775 | debug_info("ERROR: X509V3_EXT_conf_nid failed"); | ||
1300 | 776 | } | ||
1301 | 777 | X509_add_ext(host_cert, ext, -1); | ||
1302 | 778 | |||
1303 | 779 | /* set key validity */ | ||
1304 | 780 | ASN1_TIME* asn1time = ASN1_TIME_new(); | ||
1305 | 781 | ASN1_TIME_set(asn1time, time(NULL)); | ||
1306 | 782 | X509_set_notBefore(host_cert, asn1time); | ||
1307 | 783 | ASN1_TIME_set(asn1time, time(NULL) + (60 * 60 * 24 * 365 * 10)); | ||
1308 | 784 | X509_set_notAfter(host_cert, asn1time); | ||
1309 | 785 | ASN1_TIME_free(asn1time); | ||
1310 | 786 | |||
1311 | 787 | /* use host public key for host cert */ | ||
1312 | 788 | X509_set_pubkey(host_cert, host_pkey); | ||
1313 | 789 | |||
1314 | 790 | /* sign host cert with root private key */ | ||
1315 | 791 | X509_sign(host_cert, root_pkey, EVP_sha1()); | ||
1316 | 792 | } | ||
1317 | 793 | |||
1318 | 794 | if (root_cert && root_pkey && host_cert && host_pkey) { | ||
1319 | 795 | BIO* membp; | ||
1320 | 796 | |||
1321 | 797 | membp = BIO_new(BIO_s_mem()); | ||
1322 | 798 | if (PEM_write_bio_X509(membp, root_cert) > 0) { | ||
1323 | 799 | root_cert_pem.size = BIO_get_mem_data(membp, &root_cert_pem.data); | ||
1324 | 800 | } | ||
1325 | 801 | membp = BIO_new(BIO_s_mem()); | ||
1326 | 802 | if (PEM_write_bio_PrivateKey(membp, root_pkey, NULL, NULL, 0, 0, NULL) > 0) { | ||
1327 | 803 | root_key_pem.size = BIO_get_mem_data(membp, &root_key_pem.data); | ||
1328 | 804 | } | ||
1329 | 805 | membp = BIO_new(BIO_s_mem()); | ||
1330 | 806 | if (PEM_write_bio_X509(membp, host_cert) > 0) { | ||
1331 | 807 | host_cert_pem.size = BIO_get_mem_data(membp, &host_cert_pem.data); | ||
1332 | 808 | } | ||
1333 | 809 | membp = BIO_new(BIO_s_mem()); | ||
1334 | 810 | if (PEM_write_bio_PrivateKey(membp, host_pkey, NULL, NULL, 0, 0, NULL) > 0) { | ||
1335 | 811 | host_key_pem.size = BIO_get_mem_data(membp, &host_key_pem.data); | ||
1336 | 812 | } | ||
1337 | 813 | } | ||
1338 | 814 | |||
1339 | 815 | EVP_PKEY_free(root_pkey); | ||
1340 | 816 | EVP_PKEY_free(host_pkey); | ||
1341 | 817 | |||
1342 | 818 | X509_free(host_cert); | ||
1343 | 819 | X509_free(root_cert); | ||
1344 | 820 | #else | ||
1345 | 821 | gnutls_x509_privkey_t root_privkey; | ||
1346 | 822 | gnutls_x509_crt_t root_cert; | ||
1347 | 823 | gnutls_x509_privkey_t host_privkey; | ||
1348 | 824 | gnutls_x509_crt_t host_cert; | ||
1349 | 825 | |||
1350 | 826 | gnutls_global_deinit(); | ||
1351 | 827 | gnutls_global_init(); | ||
1352 | 828 | |||
1353 | 829 | //use less secure random to speed up key generation | ||
1354 | 830 | gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM); | ||
1355 | 831 | |||
1356 | 832 | gnutls_x509_privkey_init(&root_privkey); | ||
1357 | 833 | gnutls_x509_privkey_init(&host_privkey); | ||
1358 | 834 | |||
1359 | 835 | gnutls_x509_crt_init(&root_cert); | ||
1360 | 836 | gnutls_x509_crt_init(&host_cert); | ||
1361 | 837 | |||
1362 | 838 | /* generate root key */ | ||
1363 | 839 | gnutls_x509_privkey_generate(root_privkey, GNUTLS_PK_RSA, 2048, 0); | ||
1364 | 840 | gnutls_x509_privkey_generate(host_privkey, GNUTLS_PK_RSA, 2048, 0); | ||
1365 | 841 | |||
1366 | 842 | /* generate certificates */ | ||
1367 | 843 | gnutls_x509_crt_set_key(root_cert, root_privkey); | ||
1368 | 844 | gnutls_x509_crt_set_serial(root_cert, "\x00", 1); | ||
1369 | 845 | gnutls_x509_crt_set_version(root_cert, 3); | ||
1370 | 846 | gnutls_x509_crt_set_ca_status(root_cert, 1); | ||
1371 | 847 | gnutls_x509_crt_set_activation_time(root_cert, time(NULL)); | ||
1372 | 848 | gnutls_x509_crt_set_expiration_time(root_cert, time(NULL) + (60 * 60 * 24 * 365 * 10)); | ||
1373 | 849 | gnutls_x509_crt_sign(root_cert, root_cert, root_privkey); | ||
1374 | 850 | |||
1375 | 851 | gnutls_x509_crt_set_key(host_cert, host_privkey); | ||
1376 | 852 | gnutls_x509_crt_set_serial(host_cert, "\x00", 1); | ||
1377 | 853 | gnutls_x509_crt_set_version(host_cert, 3); | ||
1378 | 854 | gnutls_x509_crt_set_ca_status(host_cert, 0); | ||
1379 | 855 | gnutls_x509_crt_set_key_usage(host_cert, GNUTLS_KEY_KEY_ENCIPHERMENT | GNUTLS_KEY_DIGITAL_SIGNATURE); | ||
1380 | 856 | gnutls_x509_crt_set_activation_time(host_cert, time(NULL)); | ||
1381 | 857 | gnutls_x509_crt_set_expiration_time(host_cert, time(NULL) + (60 * 60 * 24 * 365 * 10)); | ||
1382 | 858 | gnutls_x509_crt_sign(host_cert, root_cert, root_privkey); | ||
1383 | 859 | |||
1384 | 860 | /* export to PEM format */ | ||
1385 | 861 | size_t root_key_export_size = 0; | ||
1386 | 862 | size_t host_key_export_size = 0; | ||
1387 | 863 | |||
1388 | 864 | gnutls_x509_privkey_export(root_privkey, GNUTLS_X509_FMT_PEM, NULL, &root_key_export_size); | ||
1389 | 865 | gnutls_x509_privkey_export(host_privkey, GNUTLS_X509_FMT_PEM, NULL, &host_key_export_size); | ||
1390 | 866 | |||
1391 | 867 | root_key_pem.data = gnutls_malloc(root_key_export_size); | ||
1392 | 868 | host_key_pem.data = gnutls_malloc(host_key_export_size); | ||
1393 | 869 | |||
1394 | 870 | gnutls_x509_privkey_export(root_privkey, GNUTLS_X509_FMT_PEM, root_key_pem.data, &root_key_export_size); | ||
1395 | 871 | root_key_pem.size = root_key_export_size; | ||
1396 | 872 | gnutls_x509_privkey_export(host_privkey, GNUTLS_X509_FMT_PEM, host_key_pem.data, &host_key_export_size); | ||
1397 | 873 | host_key_pem.size = host_key_export_size; | ||
1398 | 874 | |||
1399 | 875 | size_t root_cert_export_size = 0; | ||
1400 | 876 | size_t host_cert_export_size = 0; | ||
1401 | 877 | |||
1402 | 878 | gnutls_x509_crt_export(root_cert, GNUTLS_X509_FMT_PEM, NULL, &root_cert_export_size); | ||
1403 | 879 | gnutls_x509_crt_export(host_cert, GNUTLS_X509_FMT_PEM, NULL, &host_cert_export_size); | ||
1404 | 880 | |||
1405 | 881 | root_cert_pem.data = gnutls_malloc(root_cert_export_size); | ||
1406 | 882 | host_cert_pem.data = gnutls_malloc(host_cert_export_size); | ||
1407 | 883 | |||
1408 | 884 | gnutls_x509_crt_export(root_cert, GNUTLS_X509_FMT_PEM, root_cert_pem.data, &root_cert_export_size); | ||
1409 | 885 | root_cert_pem.size = root_cert_export_size; | ||
1410 | 886 | gnutls_x509_crt_export(host_cert, GNUTLS_X509_FMT_PEM, host_cert_pem.data, &host_cert_export_size); | ||
1411 | 887 | host_cert_pem.size = host_cert_export_size; | ||
1412 | 888 | |||
1413 | 889 | //restore gnutls env | ||
1414 | 890 | gnutls_global_deinit(); | ||
1415 | 891 | gnutls_global_init(); | ||
1416 | 892 | #endif | ||
1417 | 893 | if (NULL != root_cert_pem.data && 0 != root_cert_pem.size && | ||
1418 | 894 | NULL != host_cert_pem.data && 0 != host_cert_pem.size) | ||
1419 | 895 | ret = USERPREF_E_SUCCESS; | ||
1420 | 896 | |||
1421 | 897 | /* store values in config file */ | ||
1422 | 898 | userpref_set_keys_and_certs( &root_key_pem, &root_cert_pem, &host_key_pem, &host_cert_pem); | ||
1423 | 899 | |||
1424 | 900 | if (root_key_pem.data) | ||
1425 | 901 | free(root_key_pem.data); | ||
1426 | 902 | if (root_cert_pem.data) | ||
1427 | 903 | free(root_cert_pem.data); | ||
1428 | 904 | if (host_key_pem.data) | ||
1429 | 905 | free(host_key_pem.data); | ||
1430 | 906 | if (host_cert_pem.data) | ||
1431 | 907 | free(host_cert_pem.data); | ||
1432 | 908 | |||
1433 | 909 | return ret; | ||
1434 | 910 | } | ||
1435 | 911 | |||
1436 | 912 | /** | ||
1437 | 913 | * Private function which import the given key into a gnutls structure. | ||
1438 | 914 | * | ||
1439 | 915 | * @param key_name The filename of the private key to import. | ||
1440 | 916 | * @param key the gnutls key structure. | ||
1441 | 917 | * | ||
1442 | 918 | * @return 1 if the key was successfully imported. | ||
1443 | 919 | */ | ||
1444 | 920 | #ifdef HAVE_OPENSSL | ||
1445 | 921 | static userpref_error_t userpref_import_key(const char* key_name, key_data_t* key) | ||
1446 | 922 | #else | ||
1447 | 923 | static userpref_error_t userpref_import_key(const char* key_name, gnutls_x509_privkey_t key) | ||
1448 | 924 | #endif | ||
1449 | 925 | { | ||
1450 | 926 | #ifdef HAVE_OPENSSL | ||
1451 | 927 | if (!key) | ||
1452 | 928 | return USERPREF_E_SUCCESS; | ||
1453 | 929 | #endif | ||
1454 | 930 | userpref_error_t ret = USERPREF_E_INVALID_CONF; | ||
1455 | 931 | key_data_t pem_key = { NULL, 0 }; | ||
1456 | 932 | if (userpref_get_file_contents(key_name, &pem_key)) { | ||
1457 | 933 | #ifdef HAVE_OPENSSL | ||
1458 | 934 | key->data = (unsigned char*)malloc(pem_key.size); | ||
1459 | 935 | memcpy(key->data, pem_key.data, pem_key.size); | ||
1460 | 936 | key->size = pem_key.size; | ||
1461 | 937 | ret = USERPREF_E_SUCCESS; | ||
1462 | 938 | #else | ||
1463 | 939 | if (GNUTLS_E_SUCCESS == gnutls_x509_privkey_import(key, &pem_key, GNUTLS_X509_FMT_PEM)) | ||
1464 | 940 | ret = USERPREF_E_SUCCESS; | ||
1465 | 941 | else | ||
1466 | 942 | ret = USERPREF_E_SSL_ERROR; | ||
1467 | 943 | #endif | ||
1468 | 944 | } | ||
1469 | 945 | if (pem_key.data) | ||
1470 | 946 | free(pem_key.data); | ||
1471 | 947 | return ret; | ||
1472 | 948 | } | ||
1473 | 949 | |||
1474 | 950 | /** | ||
1475 | 951 | * Private function which import the given certificate into a gnutls structure. | ||
1476 | 952 | * | ||
1477 | 953 | * @param crt_name The filename of the certificate to import. | ||
1478 | 954 | * @param cert the gnutls certificate structure. | ||
1479 | 955 | * | ||
1480 | 956 | * @return IDEVICE_E_SUCCESS if the certificate was successfully imported. | ||
1481 | 957 | */ | ||
1482 | 958 | #ifdef HAVE_OPENSSL | ||
1483 | 959 | static userpref_error_t userpref_import_crt(const char* crt_name, key_data_t* cert) | ||
1484 | 960 | #else | ||
1485 | 961 | static userpref_error_t userpref_import_crt(const char* crt_name, gnutls_x509_crt_t cert) | ||
1486 | 962 | #endif | ||
1487 | 963 | { | ||
1488 | 964 | #ifdef HAVE_OPENSSL | ||
1489 | 965 | if (!cert) | ||
1490 | 966 | return USERPREF_E_SUCCESS; | ||
1491 | 967 | #endif | ||
1492 | 968 | userpref_error_t ret = USERPREF_E_INVALID_CONF; | ||
1493 | 969 | key_data_t pem_cert = { NULL, 0 }; | ||
1494 | 970 | |||
1495 | 971 | if (userpref_get_file_contents(crt_name, &pem_cert)) { | ||
1496 | 972 | #ifdef HAVE_OPENSSL | ||
1497 | 973 | cert->data = (unsigned char*)malloc(pem_cert.size); | ||
1498 | 974 | memcpy(cert->data, pem_cert.data, pem_cert.size); | ||
1499 | 975 | cert->size = pem_cert.size; | ||
1500 | 976 | ret = USERPREF_E_SUCCESS; | ||
1501 | 977 | #else | ||
1502 | 978 | if (GNUTLS_E_SUCCESS == gnutls_x509_crt_import(cert, &pem_cert, GNUTLS_X509_FMT_PEM)) | ||
1503 | 979 | ret = USERPREF_E_SUCCESS; | ||
1504 | 980 | else | ||
1505 | 981 | ret = USERPREF_E_SSL_ERROR; | ||
1506 | 982 | #endif | ||
1507 | 983 | } | ||
1508 | 984 | if (pem_cert.data) | ||
1509 | 985 | free(pem_cert.data); | ||
1510 | 986 | return ret; | ||
1511 | 987 | } | ||
1512 | 988 | |||
1513 | 989 | /** | ||
1514 | 990 | * Function to retrieve host keys and certificates. | ||
1515 | 991 | * This function trigger key generation if they do not exists yet or are invalid. | ||
1516 | 992 | * | ||
1517 | 993 | * @note This function can take few seconds to complete (typically 5 seconds) | ||
1518 | 994 | * | ||
1519 | 995 | * @param root_privkey The root private key. | ||
1520 | 996 | * @param root_crt The root certificate. | ||
1521 | 997 | * @param host_privkey The host private key. | ||
1522 | 998 | * @param host_crt The host certificate. | ||
1523 | 999 | * | ||
1524 | 1000 | * @return 1 if the keys and certificates were successfully retrieved, 0 otherwise | ||
1525 | 1001 | */ | ||
1526 | 1002 | #ifdef HAVE_OPENSSL | ||
1527 | 1003 | userpref_error_t userpref_get_keys_and_certs(key_data_t* root_privkey, key_data_t* root_crt, key_data_t* host_privkey, key_data_t* host_crt) | ||
1528 | 1004 | #else | ||
1529 | 1005 | userpref_error_t userpref_get_keys_and_certs(gnutls_x509_privkey_t root_privkey, gnutls_x509_crt_t root_crt, gnutls_x509_privkey_t host_privkey, gnutls_x509_crt_t host_crt) | ||
1530 | 1006 | #endif | ||
1531 | 1007 | { | ||
1532 | 1008 | userpref_error_t ret = USERPREF_E_SUCCESS; | ||
1533 | 1009 | |||
1534 | 1010 | if (ret == USERPREF_E_SUCCESS) | ||
1535 | 1011 | ret = userpref_import_key(LIBIMOBILEDEVICE_ROOT_PRIVKEY, root_privkey); | ||
1536 | 1012 | |||
1537 | 1013 | if (ret == USERPREF_E_SUCCESS) | ||
1538 | 1014 | ret = userpref_import_key(LIBIMOBILEDEVICE_HOST_PRIVKEY, host_privkey); | ||
1539 | 1015 | |||
1540 | 1016 | if (ret == USERPREF_E_SUCCESS) | ||
1541 | 1017 | ret = userpref_import_crt(LIBIMOBILEDEVICE_ROOT_CERTIF, root_crt); | ||
1542 | 1018 | |||
1543 | 1019 | if (ret == USERPREF_E_SUCCESS) | ||
1544 | 1020 | ret = userpref_import_crt(LIBIMOBILEDEVICE_HOST_CERTIF, host_crt); | ||
1545 | 1021 | |||
1546 | 1022 | if (USERPREF_E_SUCCESS != ret) { | ||
1547 | 1023 | //we had problem reading or importing root cert | ||
1548 | 1024 | //try with a new ones. | ||
1549 | 1025 | ret = userpref_gen_keys_and_cert(); | ||
1550 | 1026 | |||
1551 | 1027 | if (ret == USERPREF_E_SUCCESS) | ||
1552 | 1028 | ret = userpref_import_key(LIBIMOBILEDEVICE_ROOT_PRIVKEY, root_privkey); | ||
1553 | 1029 | |||
1554 | 1030 | if (ret == USERPREF_E_SUCCESS) | ||
1555 | 1031 | ret = userpref_import_key(LIBIMOBILEDEVICE_HOST_PRIVKEY, host_privkey); | ||
1556 | 1032 | |||
1557 | 1033 | if (ret == USERPREF_E_SUCCESS) | ||
1558 | 1034 | ret = userpref_import_crt(LIBIMOBILEDEVICE_ROOT_CERTIF, root_crt); | ||
1559 | 1035 | |||
1560 | 1036 | if (ret == USERPREF_E_SUCCESS) | ||
1561 | 1037 | ret = userpref_import_crt(LIBIMOBILEDEVICE_HOST_CERTIF, host_crt); | ||
1562 | 1038 | } | ||
1563 | 1039 | |||
1564 | 1040 | return ret; | ||
1565 | 1041 | } | ||
1566 | 1042 | |||
1567 | 1043 | /** | ||
1568 | 1044 | * Function to retrieve certificates encoded in PEM format. | ||
1569 | 1045 | * | ||
1570 | 1046 | * @param pem_root_cert The root certificate. | ||
1571 | 1047 | * @param pem_host_cert The host certificate. | ||
1572 | 1048 | * | ||
1573 | 1049 | * @return 1 if the certificates were successfully retrieved, 0 otherwise | ||
1574 | 1050 | */ | ||
1575 | 1051 | userpref_error_t userpref_get_certs_as_pem(key_data_t *pem_root_cert, key_data_t *pem_host_cert) | ||
1576 | 1052 | { | ||
1577 | 1053 | if (!pem_root_cert || !pem_host_cert) | ||
1578 | 1054 | return USERPREF_E_INVALID_ARG; | ||
1579 | 1055 | |||
1580 | 1056 | if (userpref_get_file_contents(LIBIMOBILEDEVICE_ROOT_CERTIF, pem_root_cert) && userpref_get_file_contents(LIBIMOBILEDEVICE_HOST_CERTIF, pem_host_cert)) | ||
1581 | 1057 | return USERPREF_E_SUCCESS; | ||
1582 | 1058 | else { | ||
1583 | 1059 | if (pem_root_cert->data) { | ||
1584 | 1060 | free(pem_root_cert->data); | ||
1585 | 1061 | pem_root_cert->size = 0; | ||
1586 | 1062 | } | ||
1587 | 1063 | if (pem_host_cert->data) { | ||
1588 | 1064 | free(pem_host_cert->data); | ||
1589 | 1065 | pem_host_cert->size = 0; | ||
1590 | 1066 | } | ||
1591 | 1067 | } | ||
1592 | 1068 | debug_info("configuration invalid"); | ||
1593 | 1069 | return USERPREF_E_INVALID_CONF; | ||
1594 | 1070 | } | ||
1595 | 1071 | |||
1596 | 1072 | /** | ||
1597 | 1073 | * Create and save a configuration file containing the given data. | ||
1598 | 1074 | * | ||
1599 | 1075 | * @note: All fields must specified and be non-null | ||
1600 | 1076 | * | ||
1601 | 1077 | * @param root_key The root key | ||
1602 | 1078 | * @param root_cert The root certificate | ||
1603 | 1079 | * @param host_key The host key | ||
1604 | 1080 | * @param host_cert The host certificate | ||
1605 | 1081 | * | ||
1606 | 1082 | * @return 1 on success and 0 otherwise. | ||
1607 | 1083 | */ | ||
1608 | 1084 | userpref_error_t userpref_set_keys_and_certs(key_data_t * root_key, key_data_t * root_cert, key_data_t * host_key, key_data_t * host_cert) | ||
1609 | 1085 | { | ||
1610 | 1086 | FILE *pFile; | ||
1611 | 1087 | char *pem; | ||
1612 | 1088 | const char *config_path; | ||
1613 | 1089 | userpref_error_t ret = USERPREF_E_SUCCESS; | ||
1614 | 1090 | |||
1615 | 1091 | debug_info("saving keys and certs"); | ||
1616 | 1092 | |||
1617 | 1093 | if (!root_key || !host_key || !root_cert || !host_cert) { | ||
1618 | 1094 | debug_info("missing key or cert (root_key=%p, host_key=%p, root=cert=%p, host_cert=%p", root_key, host_key, root_cert, host_cert); | ||
1619 | 1095 | return USERPREF_E_INVALID_ARG; | ||
1620 | 1096 | } | ||
1621 | 1097 | |||
1622 | 1098 | /* Make sure config directory exists */ | ||
1623 | 1099 | userpref_create_config_dir(); | ||
1624 | 1100 | |||
1625 | 1101 | config_path = userpref_get_config_dir(); | ||
1626 | 1102 | |||
1627 | 1103 | /* Now write keys and certificates to disk */ | ||
1628 | 1104 | pem = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_ROOT_PRIVKEY)+1); | ||
1629 | 1105 | strcpy(pem, config_path); | ||
1630 | 1106 | strcat(pem, DIR_SEP_S); | ||
1631 | 1107 | strcat(pem, LIBIMOBILEDEVICE_ROOT_PRIVKEY); | ||
1632 | 1108 | pFile = fopen(pem, "wb"); | ||
1633 | 1109 | if (pFile) { | ||
1634 | 1110 | fwrite(root_key->data, 1, root_key->size, pFile); | ||
1635 | 1111 | fclose(pFile); | ||
1636 | 1112 | } else { | ||
1637 | 1113 | debug_info("could not open '%s' for writing: %s", pem, strerror(errno)); | ||
1638 | 1114 | ret = USERPREF_E_WRITE_ERROR; | ||
1639 | 1115 | } | ||
1640 | 1116 | free(pem); | ||
1641 | 1117 | |||
1642 | 1118 | pem = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_HOST_PRIVKEY)+1); | ||
1643 | 1119 | strcpy(pem, config_path); | ||
1644 | 1120 | strcat(pem, DIR_SEP_S); | ||
1645 | 1121 | strcat(pem, LIBIMOBILEDEVICE_HOST_PRIVKEY); | ||
1646 | 1122 | pFile = fopen(pem, "wb"); | ||
1647 | 1123 | if (pFile) { | ||
1648 | 1124 | fwrite(host_key->data, 1, host_key->size, pFile); | ||
1649 | 1125 | fclose(pFile); | ||
1650 | 1126 | } else { | ||
1651 | 1127 | debug_info("could not open '%s' for writing: %s", pem, strerror(errno)); | ||
1652 | 1128 | ret = USERPREF_E_WRITE_ERROR; | ||
1653 | 1129 | } | ||
1654 | 1130 | free(pem); | ||
1655 | 1131 | |||
1656 | 1132 | pem = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_ROOT_CERTIF)+1); | ||
1657 | 1133 | strcpy(pem, config_path); | ||
1658 | 1134 | strcat(pem, DIR_SEP_S); | ||
1659 | 1135 | strcat(pem, LIBIMOBILEDEVICE_ROOT_CERTIF); | ||
1660 | 1136 | pFile = fopen(pem, "wb"); | ||
1661 | 1137 | if (pFile) { | ||
1662 | 1138 | fwrite(root_cert->data, 1, root_cert->size, pFile); | ||
1663 | 1139 | fclose(pFile); | ||
1664 | 1140 | } else { | ||
1665 | 1141 | debug_info("could not open '%s' for writing: %s", pem, strerror(errno)); | ||
1666 | 1142 | ret = USERPREF_E_WRITE_ERROR; | ||
1667 | 1143 | } | ||
1668 | 1144 | free(pem); | ||
1669 | 1145 | |||
1670 | 1146 | pem = (char*)malloc(strlen(config_path)+1+strlen(LIBIMOBILEDEVICE_HOST_CERTIF)+1); | ||
1671 | 1147 | strcpy(pem, config_path); | ||
1672 | 1148 | strcat(pem, DIR_SEP_S); | ||
1673 | 1149 | strcat(pem, LIBIMOBILEDEVICE_HOST_CERTIF); | ||
1674 | 1150 | pFile = fopen(pem, "wb"); | ||
1675 | 1151 | if (pFile) { | ||
1676 | 1152 | fwrite(host_cert->data, 1, host_cert->size, pFile); | ||
1677 | 1153 | fclose(pFile); | ||
1678 | 1154 | } else { | ||
1679 | 1155 | debug_info("could not open '%s' for writing: %s", pem, strerror(errno)); | ||
1680 | 1156 | ret = USERPREF_E_WRITE_ERROR; | ||
1681 | 1157 | } | ||
1682 | 1158 | free(pem); | ||
1683 | 1159 | |||
1684 | 1160 | return ret; | ||
1685 | 1161 | } | ||
1686 | 1162 | 0 | ||
1687 | === removed file '.pc/CVE-2013-2142.patch/src/utils.c' | |||
1688 | === removed file '.pc/CVE-2013-2142.patch/src/utils.h' | |||
1689 | === removed file '.pc/applied-patches' | |||
1690 | --- .pc/applied-patches 2013-10-28 23:01:08 +0000 | |||
1691 | +++ .pc/applied-patches 1970-01-01 00:00:00 +0000 | |||
1692 | @@ -1,5 +0,0 @@ | |||
1693 | 1 | 01-libs.private.patch | ||
1694 | 2 | 02-fix-link-errors.patch | ||
1695 | 3 | CVE-2013-2142.patch | ||
1696 | 4 | 09_use_python_config.patch | ||
1697 | 5 | git_explicitly_cast_ssl_enabled.patch | ||
1698 | 6 | 0 | ||
1699 | === removed directory '.pc/git_explicitly_cast_ssl_enabled.patch' | |||
1700 | === removed directory '.pc/git_explicitly_cast_ssl_enabled.patch/cython' | |||
1701 | === removed file '.pc/git_explicitly_cast_ssl_enabled.patch/cython/lockdown.pxi' | |||
1702 | --- .pc/git_explicitly_cast_ssl_enabled.patch/cython/lockdown.pxi 2013-07-31 15:34:39 +0000 | |||
1703 | +++ .pc/git_explicitly_cast_ssl_enabled.patch/cython/lockdown.pxi 1970-01-01 00:00:00 +0000 | |||
1704 | @@ -1,297 +0,0 @@ | |||
1705 | 1 | cdef extern from "libimobiledevice/lockdown.h": | ||
1706 | 2 | ctypedef enum lockdownd_error_t: | ||
1707 | 3 | LOCKDOWN_E_SUCCESS = 0 | ||
1708 | 4 | LOCKDOWN_E_INVALID_ARG = -1 | ||
1709 | 5 | LOCKDOWN_E_INVALID_CONF = -2 | ||
1710 | 6 | LOCKDOWN_E_PLIST_ERROR = -3 | ||
1711 | 7 | LOCKDOWN_E_PAIRING_FAILED = -4 | ||
1712 | 8 | LOCKDOWN_E_SSL_ERROR = -5 | ||
1713 | 9 | LOCKDOWN_E_DICT_ERROR = -6 | ||
1714 | 10 | LOCKDOWN_E_START_SERVICE_FAILED = -7 | ||
1715 | 11 | LOCKDOWN_E_NOT_ENOUGH_DATA = -8 | ||
1716 | 12 | LOCKDOWN_E_SET_VALUE_PROHIBITED = -9 | ||
1717 | 13 | LOCKDOWN_E_GET_VALUE_PROHIBITED = -10 | ||
1718 | 14 | LOCKDOWN_E_REMOVE_VALUE_PROHIBITED = -11 | ||
1719 | 15 | LOCKDOWN_E_MUX_ERROR = -12 | ||
1720 | 16 | LOCKDOWN_E_ACTIVATION_FAILED = -13 | ||
1721 | 17 | LOCKDOWN_E_PASSWORD_PROTECTED = -14 | ||
1722 | 18 | LOCKDOWN_E_NO_RUNNING_SESSION = -15 | ||
1723 | 19 | LOCKDOWN_E_INVALID_HOST_ID = -16 | ||
1724 | 20 | LOCKDOWN_E_INVALID_SERVICE = -17 | ||
1725 | 21 | LOCKDOWN_E_INVALID_ACTIVATION_RECORD = -18 | ||
1726 | 22 | LOCKDOWN_E_UNKNOWN_ERROR = -256 | ||
1727 | 23 | |||
1728 | 24 | lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, char *label) | ||
1729 | 25 | lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdownd_client_t *client, char *label) | ||
1730 | 26 | lockdownd_error_t lockdownd_client_free(lockdownd_client_t client) | ||
1731 | 27 | |||
1732 | 28 | lockdownd_error_t lockdownd_query_type(lockdownd_client_t client, char **tp) | ||
1733 | 29 | lockdownd_error_t lockdownd_get_value(lockdownd_client_t client, char *domain, char *key, plist.plist_t *value) | ||
1734 | 30 | lockdownd_error_t lockdownd_set_value(lockdownd_client_t client, char *domain, char *key, plist.plist_t value) | ||
1735 | 31 | lockdownd_error_t lockdownd_remove_value(lockdownd_client_t client, char *domain, char *key) | ||
1736 | 32 | lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, char *identifier, lockdownd_service_descriptor_t *service) | ||
1737 | 33 | lockdownd_error_t lockdownd_start_session(lockdownd_client_t client, char *host_id, char **session_id, int *ssl_enabled) | ||
1738 | 34 | lockdownd_error_t lockdownd_stop_session(lockdownd_client_t client, char *session_id) | ||
1739 | 35 | lockdownd_error_t lockdownd_send(lockdownd_client_t client, plist.plist_t plist) | ||
1740 | 36 | lockdownd_error_t lockdownd_receive(lockdownd_client_t client, plist.plist_t *plist) | ||
1741 | 37 | lockdownd_error_t lockdownd_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | ||
1742 | 38 | lockdownd_error_t lockdownd_validate_pair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | ||
1743 | 39 | lockdownd_error_t lockdownd_unpair(lockdownd_client_t client, lockdownd_pair_record_t pair_record) | ||
1744 | 40 | lockdownd_error_t lockdownd_activate(lockdownd_client_t client, plist.plist_t activation_record) | ||
1745 | 41 | lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client) | ||
1746 | 42 | lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client) | ||
1747 | 43 | lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client) | ||
1748 | 44 | lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count) | ||
1749 | 45 | lockdownd_error_t lockdownd_data_classes_free(char **classes) | ||
1750 | 46 | lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service) | ||
1751 | 47 | |||
1752 | 48 | cdef class LockdownError(BaseError): | ||
1753 | 49 | def __init__(self, *args, **kwargs): | ||
1754 | 50 | self._lookup_table = { | ||
1755 | 51 | LOCKDOWN_E_SUCCESS: "Success", | ||
1756 | 52 | LOCKDOWN_E_INVALID_ARG: "Invalid argument", | ||
1757 | 53 | LOCKDOWN_E_INVALID_CONF: "Invalid configuration", | ||
1758 | 54 | LOCKDOWN_E_PLIST_ERROR: "Property list error", | ||
1759 | 55 | LOCKDOWN_E_PAIRING_FAILED: "Pairing failed", | ||
1760 | 56 | LOCKDOWN_E_SSL_ERROR: "SSL error", | ||
1761 | 57 | LOCKDOWN_E_DICT_ERROR: "Dict error", | ||
1762 | 58 | LOCKDOWN_E_START_SERVICE_FAILED: "Start service failed", | ||
1763 | 59 | LOCKDOWN_E_NOT_ENOUGH_DATA: "Not enough data", | ||
1764 | 60 | LOCKDOWN_E_SET_VALUE_PROHIBITED: "Set value prohibited", | ||
1765 | 61 | LOCKDOWN_E_GET_VALUE_PROHIBITED: "Get value prohibited", | ||
1766 | 62 | LOCKDOWN_E_REMOVE_VALUE_PROHIBITED: "Remove value prohibited", | ||
1767 | 63 | LOCKDOWN_E_MUX_ERROR: "MUX Error", | ||
1768 | 64 | LOCKDOWN_E_ACTIVATION_FAILED: "Activation failed", | ||
1769 | 65 | LOCKDOWN_E_PASSWORD_PROTECTED: "Password protected", | ||
1770 | 66 | LOCKDOWN_E_NO_RUNNING_SESSION: "No running session", | ||
1771 | 67 | LOCKDOWN_E_INVALID_HOST_ID: "Invalid host ID", | ||
1772 | 68 | LOCKDOWN_E_INVALID_SERVICE: "Invalid service", | ||
1773 | 69 | LOCKDOWN_E_INVALID_ACTIVATION_RECORD: "Invalid activation record", | ||
1774 | 70 | LOCKDOWN_E_UNKNOWN_ERROR: "Unknown error" | ||
1775 | 71 | } | ||
1776 | 72 | BaseError.__init__(self, *args, **kwargs) | ||
1777 | 73 | |||
1778 | 74 | cdef class LockdownPairRecord: | ||
1779 | 75 | #def __cinit__(self, bytes device_certificate, bytes host_certificate, bytes host_id, bytes root_certificate, *args, **kwargs): | ||
1780 | 76 | property device_certificate: | ||
1781 | 77 | def __get__(self): | ||
1782 | 78 | cdef bytes result = self._c_record.device_certificate | ||
1783 | 79 | return result | ||
1784 | 80 | property host_certificate: | ||
1785 | 81 | def __get__(self): | ||
1786 | 82 | cdef bytes result = self._c_record.host_certificate | ||
1787 | 83 | return result | ||
1788 | 84 | property host_id: | ||
1789 | 85 | def __get__(self): | ||
1790 | 86 | cdef bytes result = self._c_record.host_id | ||
1791 | 87 | return result | ||
1792 | 88 | property root_certificate: | ||
1793 | 89 | def __get__(self): | ||
1794 | 90 | cdef bytes result = self._c_record.root_certificate | ||
1795 | 91 | return result | ||
1796 | 92 | |||
1797 | 93 | cdef class LockdownServiceDescriptor: | ||
1798 | 94 | #def __cinit__(self, uint16_t port, uint8_t ssl_enabled, *args, **kwargs): | ||
1799 | 95 | def __dealloc__(self): | ||
1800 | 96 | cdef lockdownd_error_t err | ||
1801 | 97 | if self._c_service_descriptor is not NULL: | ||
1802 | 98 | err = lockdownd_service_descriptor_free(self._c_service_descriptor) | ||
1803 | 99 | self._c_service_descriptor = NULL | ||
1804 | 100 | self.handle_error(err) | ||
1805 | 101 | property port: | ||
1806 | 102 | def __get__(self): | ||
1807 | 103 | return self._c_service_descriptor.port | ||
1808 | 104 | property ssl_enabled: | ||
1809 | 105 | def __get__(self): | ||
1810 | 106 | return self._c_service_descriptor.ssl_enabled | ||
1811 | 107 | |||
1812 | 108 | cdef class LockdownClient(PropertyListService): | ||
1813 | 109 | def __cinit__(self, iDevice device not None, bytes label=b'', bint handshake=True, *args, **kwargs): | ||
1814 | 110 | cdef: | ||
1815 | 111 | lockdownd_error_t err | ||
1816 | 112 | char* c_label = NULL | ||
1817 | 113 | if label: | ||
1818 | 114 | c_label = label | ||
1819 | 115 | if handshake: | ||
1820 | 116 | err = lockdownd_client_new_with_handshake(device._c_dev, &self._c_client, c_label) | ||
1821 | 117 | else: | ||
1822 | 118 | err = lockdownd_client_new(device._c_dev, &self._c_client, c_label) | ||
1823 | 119 | self.handle_error(err) | ||
1824 | 120 | |||
1825 | 121 | self.device = device | ||
1826 | 122 | |||
1827 | 123 | def __dealloc__(self): | ||
1828 | 124 | cdef lockdownd_error_t err | ||
1829 | 125 | if self._c_client is not NULL: | ||
1830 | 126 | err = lockdownd_client_free(self._c_client) | ||
1831 | 127 | self.handle_error(err) | ||
1832 | 128 | |||
1833 | 129 | cpdef bytes query_type(self): | ||
1834 | 130 | cdef: | ||
1835 | 131 | lockdownd_error_t err | ||
1836 | 132 | char* c_type = NULL | ||
1837 | 133 | bytes result | ||
1838 | 134 | err = lockdownd_query_type(self._c_client, &c_type) | ||
1839 | 135 | try: | ||
1840 | 136 | self.handle_error(err) | ||
1841 | 137 | result = c_type | ||
1842 | 138 | |||
1843 | 139 | return result | ||
1844 | 140 | except BaseError, e: | ||
1845 | 141 | raise | ||
1846 | 142 | finally: | ||
1847 | 143 | if c_type != NULL: | ||
1848 | 144 | free(c_type) | ||
1849 | 145 | |||
1850 | 146 | cpdef plist.Node get_value(self, bytes domain=None, bytes key=None): | ||
1851 | 147 | cdef: | ||
1852 | 148 | lockdownd_error_t err | ||
1853 | 149 | plist.plist_t c_node = NULL | ||
1854 | 150 | char* c_domain = NULL | ||
1855 | 151 | char* c_key = NULL | ||
1856 | 152 | if domain is not None: | ||
1857 | 153 | c_domain = domain | ||
1858 | 154 | if key is not None: | ||
1859 | 155 | c_key = key | ||
1860 | 156 | |||
1861 | 157 | err = lockdownd_get_value(self._c_client, c_domain, c_key, &c_node) | ||
1862 | 158 | |||
1863 | 159 | try: | ||
1864 | 160 | self.handle_error(err) | ||
1865 | 161 | |||
1866 | 162 | return plist.plist_t_to_node(c_node) | ||
1867 | 163 | except BaseError, e: | ||
1868 | 164 | if c_node != NULL: | ||
1869 | 165 | plist.plist_free(c_node) | ||
1870 | 166 | raise | ||
1871 | 167 | |||
1872 | 168 | cpdef set_value(self, bytes domain, bytes key, object value): | ||
1873 | 169 | cdef plist.plist_t c_node = plist.native_to_plist_t(value) | ||
1874 | 170 | try: | ||
1875 | 171 | self.handle_error(lockdownd_set_value(self._c_client, domain, key, c_node)) | ||
1876 | 172 | except BaseError, e: | ||
1877 | 173 | raise | ||
1878 | 174 | finally: | ||
1879 | 175 | if c_node != NULL: | ||
1880 | 176 | plist.plist_free(c_node) | ||
1881 | 177 | |||
1882 | 178 | cpdef remove_value(self, bytes domain, bytes key): | ||
1883 | 179 | self.handle_error(lockdownd_remove_value(self._c_client, domain, key)) | ||
1884 | 180 | |||
1885 | 181 | cpdef object start_service(self, object service): | ||
1886 | 182 | cdef: | ||
1887 | 183 | char* c_service_name = NULL | ||
1888 | 184 | lockdownd_service_descriptor_t c_descriptor = NULL | ||
1889 | 185 | LockdownServiceDescriptor result | ||
1890 | 186 | |||
1891 | 187 | if issubclass(service, BaseService) and \ | ||
1892 | 188 | service.__service_name__ is not None \ | ||
1893 | 189 | and isinstance(service.__service_name__, basestring): | ||
1894 | 190 | c_service_name = <bytes>service.__service_name__ | ||
1895 | 191 | elif isinstance(service, basestring): | ||
1896 | 192 | c_service_name = <bytes>service | ||
1897 | 193 | else: | ||
1898 | 194 | raise TypeError("LockdownClient.start_service() takes a BaseService or string as its first argument") | ||
1899 | 195 | |||
1900 | 196 | try: | ||
1901 | 197 | self.handle_error(lockdownd_start_service(self._c_client, c_service_name, &c_descriptor)) | ||
1902 | 198 | |||
1903 | 199 | result = LockdownServiceDescriptor.__new__(LockdownServiceDescriptor) | ||
1904 | 200 | result._c_service_descriptor = c_descriptor | ||
1905 | 201 | |||
1906 | 202 | return result | ||
1907 | 203 | except BaseError, e: | ||
1908 | 204 | raise | ||
1909 | 205 | |||
1910 | 206 | cpdef object get_service_client(self, object service_class): | ||
1911 | 207 | cdef: | ||
1912 | 208 | LockdownServiceDescriptor descriptor | ||
1913 | 209 | |||
1914 | 210 | if not hasattr(service_class, '__service_name__') and \ | ||
1915 | 211 | not service_class.__service_name__ is not None \ | ||
1916 | 212 | and not isinstance(service_class.__service_name__, basestring): | ||
1917 | 213 | raise TypeError("LockdownClient.get_service_client() takes a BaseService as its first argument") | ||
1918 | 214 | |||
1919 | 215 | descriptor = self.start_service(service_class) | ||
1920 | 216 | return service_class(self.device, descriptor) | ||
1921 | 217 | |||
1922 | 218 | cpdef tuple start_session(self, bytes host_id): | ||
1923 | 219 | cdef: | ||
1924 | 220 | lockdownd_error_t err | ||
1925 | 221 | char* c_session_id = NULL | ||
1926 | 222 | bint ssl_enabled | ||
1927 | 223 | bytes session_id | ||
1928 | 224 | err = lockdownd_start_session(self._c_client, host_id, &c_session_id, &ssl_enabled) | ||
1929 | 225 | try: | ||
1930 | 226 | self.handle_error(err) | ||
1931 | 227 | |||
1932 | 228 | session_id = c_session_id | ||
1933 | 229 | return (session_id, ssl_enabled) | ||
1934 | 230 | except BaseError, e: | ||
1935 | 231 | raise | ||
1936 | 232 | finally: | ||
1937 | 233 | if c_session_id != NULL: | ||
1938 | 234 | free(c_session_id) | ||
1939 | 235 | |||
1940 | 236 | cpdef stop_session(self, bytes session_id): | ||
1941 | 237 | self.handle_error(lockdownd_stop_session(self._c_client, session_id)) | ||
1942 | 238 | |||
1943 | 239 | cpdef pair(self, object pair_record=None): | ||
1944 | 240 | cdef lockdownd_pair_record_t c_pair_record = NULL | ||
1945 | 241 | if pair_record is not None: | ||
1946 | 242 | c_pair_record = (<LockdownPairRecord>pair_record)._c_record | ||
1947 | 243 | self.handle_error(lockdownd_pair(self._c_client, c_pair_record)) | ||
1948 | 244 | |||
1949 | 245 | cpdef validate_pair(self, object pair_record=None): | ||
1950 | 246 | cdef lockdownd_pair_record_t c_pair_record = NULL | ||
1951 | 247 | if pair_record is not None: | ||
1952 | 248 | c_pair_record = (<LockdownPairRecord>pair_record)._c_record | ||
1953 | 249 | self.handle_error(lockdownd_validate_pair(self._c_client, c_pair_record)) | ||
1954 | 250 | |||
1955 | 251 | cpdef unpair(self, object pair_record=None): | ||
1956 | 252 | cdef lockdownd_pair_record_t c_pair_record = NULL | ||
1957 | 253 | if pair_record is not None: | ||
1958 | 254 | c_pair_record = (<LockdownPairRecord>pair_record)._c_record | ||
1959 | 255 | self.handle_error(lockdownd_unpair(self._c_client, c_pair_record)) | ||
1960 | 256 | |||
1961 | 257 | cpdef activate(self, plist.Node activation_record): | ||
1962 | 258 | self.handle_error(lockdownd_activate(self._c_client, activation_record._c_node)) | ||
1963 | 259 | |||
1964 | 260 | cpdef deactivate(self): | ||
1965 | 261 | self.handle_error(lockdownd_deactivate(self._c_client)) | ||
1966 | 262 | |||
1967 | 263 | cpdef enter_recovery(self): | ||
1968 | 264 | self.handle_error(lockdownd_enter_recovery(self._c_client)) | ||
1969 | 265 | |||
1970 | 266 | cpdef goodbye(self): | ||
1971 | 267 | self.handle_error(lockdownd_goodbye(self._c_client)) | ||
1972 | 268 | |||
1973 | 269 | cpdef list get_sync_data_classes(self): | ||
1974 | 270 | cdef: | ||
1975 | 271 | char **classes = NULL | ||
1976 | 272 | int count = 0 | ||
1977 | 273 | list result = [] | ||
1978 | 274 | bytes data_class | ||
1979 | 275 | |||
1980 | 276 | try: | ||
1981 | 277 | self.handle_error(lockdownd_get_sync_data_classes(self._c_client, &classes, &count)) | ||
1982 | 278 | |||
1983 | 279 | for i from 0 <= i < count: | ||
1984 | 280 | data_class = classes[i] | ||
1985 | 281 | result.append(data_class) | ||
1986 | 282 | |||
1987 | 283 | return result | ||
1988 | 284 | except Exception, e: | ||
1989 | 285 | raise | ||
1990 | 286 | finally: | ||
1991 | 287 | if classes != NULL: | ||
1992 | 288 | lockdownd_data_classes_free(classes) | ||
1993 | 289 | |||
1994 | 290 | cdef inline int16_t _send(self, plist.plist_t node): | ||
1995 | 291 | return lockdownd_send(self._c_client, node) | ||
1996 | 292 | |||
1997 | 293 | cdef inline int16_t _receive(self, plist.plist_t* node): | ||
1998 | 294 | return lockdownd_receive(self._c_client, node) | ||
1999 | 295 | |||
2000 | 296 | cdef inline BaseError _error(self, int16_t ret): | ||
2001 | 297 | return LockdownError(ret) | ||
2002 | 298 | 0 | ||
2003 | === modified file 'Makefile.am' | |||
2004 | --- Makefile.am 2012-07-29 11:31:31 +0000 | |||
2005 | +++ Makefile.am 2014-03-14 06:45:31 +0000 | |||
2006 | @@ -1,6 +1,6 @@ | |||
2007 | 1 | AUTOMAKE_OPTIONS = foreign | 1 | AUTOMAKE_OPTIONS = foreign |
2008 | 2 | ACLOCAL_AMFLAGS = -I m4 | 2 | ACLOCAL_AMFLAGS = -I m4 |
2010 | 3 | SUBDIRS = src include $(CYTHON_SUB) $(DEV_SUB) tools docs | 3 | SUBDIRS = common src include $(CYTHON_SUB) $(DEV_SUB) tools docs |
2011 | 4 | 4 | ||
2012 | 5 | DISTCHECK_CONFIGURE_FLAGS = --enable-dev-tools | 5 | DISTCHECK_CONFIGURE_FLAGS = --enable-dev-tools |
2013 | 6 | 6 | ||
2014 | 7 | 7 | ||
2015 | === removed file 'Makefile.in' | |||
2016 | --- Makefile.in 2013-10-28 23:01:08 +0000 | |||
2017 | +++ Makefile.in 1970-01-01 00:00:00 +0000 | |||
2018 | @@ -1,918 +0,0 @@ | |||
2019 | 1 | # Makefile.in generated by automake 1.12.1 from Makefile.am. | ||
2020 | 2 | # @configure_input@ | ||
2021 | 3 | |||
2022 | 4 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | ||
2023 | 5 | |||
2024 | 6 | # This Makefile.in is free software; the Free Software Foundation | ||
2025 | 7 | # gives unlimited permission to copy and/or distribute it, | ||
2026 | 8 | # with or without modifications, as long as this notice is preserved. | ||
2027 | 9 | |||
2028 | 10 | # This program is distributed in the hope that it will be useful, | ||
2029 | 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
2030 | 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
2031 | 13 | # PARTICULAR PURPOSE. | ||
2032 | 14 | |||
2033 | 15 | @SET_MAKE@ | ||
2034 | 16 | |||
2035 | 17 | VPATH = @srcdir@ | ||
2036 | 18 | am__make_dryrun = \ | ||
2037 | 19 | { \ | ||
2038 | 20 | am__dry=no; \ | ||
2039 | 21 | case $$MAKEFLAGS in \ | ||
2040 | 22 | *\\[\ \ ]*) \ | ||
2041 | 23 | echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | ||
2042 | 24 | | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ | ||
2043 | 25 | *) \ | ||
2044 | 26 | for am__flg in $$MAKEFLAGS; do \ | ||
2045 | 27 | case $$am__flg in \ | ||
2046 | 28 | *=*|--*) ;; \ | ||
2047 | 29 | *n*) am__dry=yes; break;; \ | ||
2048 | 30 | esac; \ | ||
2049 | 31 | done;; \ | ||
2050 | 32 | esac; \ | ||
2051 | 33 | test $$am__dry = yes; \ | ||
2052 | 34 | } | ||
2053 | 35 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
2054 | 36 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
2055 | 37 | pkglibdir = $(libdir)/@PACKAGE@ | ||
2056 | 38 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
2057 | 39 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
2058 | 40 | install_sh_DATA = $(install_sh) -c -m 644 | ||
2059 | 41 | install_sh_PROGRAM = $(install_sh) -c | ||
2060 | 42 | install_sh_SCRIPT = $(install_sh) -c | ||
2061 | 43 | INSTALL_HEADER = $(INSTALL_DATA) | ||
2062 | 44 | transform = $(program_transform_name) | ||
2063 | 45 | NORMAL_INSTALL = : | ||
2064 | 46 | PRE_INSTALL = : | ||
2065 | 47 | POST_INSTALL = : | ||
2066 | 48 | NORMAL_UNINSTALL = : | ||
2067 | 49 | PRE_UNINSTALL = : | ||
2068 | 50 | POST_UNINSTALL = : | ||
2069 | 51 | build_triplet = @build@ | ||
2070 | 52 | host_triplet = @host@ | ||
2071 | 53 | subdir = . | ||
2072 | 54 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ | ||
2073 | 55 | $(srcdir)/Makefile.in $(srcdir)/config.h.in \ | ||
2074 | 56 | $(srcdir)/doxygen.cfg.in $(srcdir)/libimobiledevice-1.0.pc.in \ | ||
2075 | 57 | $(top_srcdir)/configure AUTHORS COPYING COPYING.LESSER NEWS \ | ||
2076 | 58 | compile config.guess config.sub depcomp install-sh ltmain.sh \ | ||
2077 | 59 | missing | ||
2078 | 60 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
2079 | 61 | am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pkg_cython.m4 \ | ||
2080 | 62 | $(top_srcdir)/m4/ac_python_devel.m4 \ | ||
2081 | 63 | $(top_srcdir)/m4/as-compiler-flag.m4 \ | ||
2082 | 64 | $(top_srcdir)/m4/cython_python.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
2083 | 65 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
2084 | 66 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
2085 | 67 | $(top_srcdir)/configure.ac | ||
2086 | 68 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
2087 | 69 | $(ACLOCAL_M4) | ||
2088 | 70 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ | ||
2089 | 71 | configure.lineno config.status.lineno | ||
2090 | 72 | mkinstalldirs = $(install_sh) -d | ||
2091 | 73 | CONFIG_HEADER = config.h | ||
2092 | 74 | CONFIG_CLEAN_FILES = libimobiledevice-1.0.pc doxygen.cfg | ||
2093 | 75 | CONFIG_CLEAN_VPATH_FILES = | ||
2094 | 76 | AM_V_GEN = $(am__v_GEN_@AM_V@) | ||
2095 | 77 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | ||
2096 | 78 | am__v_GEN_0 = @echo " GEN " $@; | ||
2097 | 79 | AM_V_at = $(am__v_at_@AM_V@) | ||
2098 | 80 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | ||
2099 | 81 | am__v_at_0 = @ | ||
2100 | 82 | SOURCES = | ||
2101 | 83 | DIST_SOURCES = | ||
2102 | 84 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ | ||
2103 | 85 | html-recursive info-recursive install-data-recursive \ | ||
2104 | 86 | install-dvi-recursive install-exec-recursive \ | ||
2105 | 87 | install-html-recursive install-info-recursive \ | ||
2106 | 88 | install-pdf-recursive install-ps-recursive install-recursive \ | ||
2107 | 89 | installcheck-recursive installdirs-recursive pdf-recursive \ | ||
2108 | 90 | ps-recursive uninstall-recursive | ||
2109 | 91 | am__can_run_installinfo = \ | ||
2110 | 92 | case $$AM_UPDATE_INFO_DIR in \ | ||
2111 | 93 | n|no|NO) false;; \ | ||
2112 | 94 | *) (install-info --version) >/dev/null 2>&1;; \ | ||
2113 | 95 | esac | ||
2114 | 96 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
2115 | 97 | am__vpath_adj = case $$p in \ | ||
2116 | 98 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
2117 | 99 | *) f=$$p;; \ | ||
2118 | 100 | esac; | ||
2119 | 101 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
2120 | 102 | am__install_max = 40 | ||
2121 | 103 | am__nobase_strip_setup = \ | ||
2122 | 104 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
2123 | 105 | am__nobase_strip = \ | ||
2124 | 106 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
2125 | 107 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
2126 | 108 | for p in $$list; do echo "$$p $$p"; done | \ | ||
2127 | 109 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
2128 | 110 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
2129 | 111 | if (++n[$$2] == $(am__install_max)) \ | ||
2130 | 112 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
2131 | 113 | END { for (dir in files) print dir, files[dir] }' | ||
2132 | 114 | am__base_list = \ | ||
2133 | 115 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
2134 | 116 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
2135 | 117 | am__uninstall_files_from_dir = { \ | ||
2136 | 118 | test -z "$$files" \ | ||
2137 | 119 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ | ||
2138 | 120 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ | ||
2139 | 121 | $(am__cd) "$$dir" && rm -f $$files; }; \ | ||
2140 | 122 | } | ||
2141 | 123 | am__installdirs = "$(DESTDIR)$(pkgconfigdir)" | ||
2142 | 124 | DATA = $(pkgconfig_DATA) | ||
2143 | 125 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ | ||
2144 | 126 | distclean-recursive maintainer-clean-recursive | ||
2145 | 127 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ | ||
2146 | 128 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ | ||
2147 | 129 | cscope distdir dist dist-all distcheck | ||
2148 | 130 | ETAGS = etags | ||
2149 | 131 | CTAGS = ctags | ||
2150 | 132 | CSCOPE = cscope | ||
2151 | 133 | DIST_SUBDIRS = $(SUBDIRS) | ||
2152 | 134 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
2153 | 135 | distdir = $(PACKAGE)-$(VERSION) | ||
2154 | 136 | top_distdir = $(distdir) | ||
2155 | 137 | am__remove_distdir = \ | ||
2156 | 138 | if test -d "$(distdir)"; then \ | ||
2157 | 139 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ | ||
2158 | 140 | && rm -rf "$(distdir)" \ | ||
2159 | 141 | || { sleep 5 && rm -rf "$(distdir)"; }; \ | ||
2160 | 142 | else :; fi | ||
2161 | 143 | am__post_remove_distdir = $(am__remove_distdir) | ||
2162 | 144 | am__relativize = \ | ||
2163 | 145 | dir0=`pwd`; \ | ||
2164 | 146 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ | ||
2165 | 147 | sed_rest='s,^[^/]*/*,,'; \ | ||
2166 | 148 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ | ||
2167 | 149 | sed_butlast='s,/*[^/]*$$,,'; \ | ||
2168 | 150 | while test -n "$$dir1"; do \ | ||
2169 | 151 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ | ||
2170 | 152 | if test "$$first" != "."; then \ | ||
2171 | 153 | if test "$$first" = ".."; then \ | ||
2172 | 154 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ | ||
2173 | 155 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ | ||
2174 | 156 | else \ | ||
2175 | 157 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ | ||
2176 | 158 | if test "$$first2" = "$$first"; then \ | ||
2177 | 159 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ | ||
2178 | 160 | else \ | ||
2179 | 161 | dir2="../$$dir2"; \ | ||
2180 | 162 | fi; \ | ||
2181 | 163 | dir0="$$dir0"/"$$first"; \ | ||
2182 | 164 | fi; \ | ||
2183 | 165 | fi; \ | ||
2184 | 166 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ | ||
2185 | 167 | done; \ | ||
2186 | 168 | reldir="$$dir2" | ||
2187 | 169 | GZIP_ENV = --best | ||
2188 | 170 | DIST_ARCHIVES = $(distdir).tar.bz2 | ||
2189 | 171 | DIST_TARGETS = dist-bzip2 | ||
2190 | 172 | distuninstallcheck_listfiles = find . -type f -print | ||
2191 | 173 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | ||
2192 | 174 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' | ||
2193 | 175 | distcleancheck_listfiles = find . -type f -print | ||
2194 | 176 | ACLOCAL = @ACLOCAL@ | ||
2195 | 177 | AMTAR = @AMTAR@ | ||
2196 | 178 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
2197 | 179 | AR = @AR@ | ||
2198 | 180 | AUTOCONF = @AUTOCONF@ | ||
2199 | 181 | AUTOHEADER = @AUTOHEADER@ | ||
2200 | 182 | AUTOMAKE = @AUTOMAKE@ | ||
2201 | 183 | AWK = @AWK@ | ||
2202 | 184 | CC = @CC@ | ||
2203 | 185 | CCDEPMODE = @CCDEPMODE@ | ||
2204 | 186 | CFLAGS = @CFLAGS@ | ||
2205 | 187 | CPP = @CPP@ | ||
2206 | 188 | CPPFLAGS = @CPPFLAGS@ | ||
2207 | 189 | CXX = @CXX@ | ||
2208 | 190 | CXXCPP = @CXXCPP@ | ||
2209 | 191 | CXXDEPMODE = @CXXDEPMODE@ | ||
2210 | 192 | CXXFLAGS = @CXXFLAGS@ | ||
2211 | 193 | CYGPATH_W = @CYGPATH_W@ | ||
2212 | 194 | CYTHON = @CYTHON@ | ||
2213 | 195 | CYTHON_LIB = @CYTHON_LIB@ | ||
2214 | 196 | CYTHON_PLIST_INCLUDE_DIR = @CYTHON_PLIST_INCLUDE_DIR@ | ||
2215 | 197 | CYTHON_PYTHON_CPPFLAGS = @CYTHON_PYTHON_CPPFLAGS@ | ||
2216 | 198 | CYTHON_PYTHON_OPT = @CYTHON_PYTHON_OPT@ | ||
2217 | 199 | CYTHON_SUB = @CYTHON_SUB@ | ||
2218 | 200 | DEFS = @DEFS@ | ||
2219 | 201 | DEPDIR = @DEPDIR@ | ||
2220 | 202 | DEV_SUB = @DEV_SUB@ | ||
2221 | 203 | DLLTOOL = @DLLTOOL@ | ||
2222 | 204 | DSYMUTIL = @DSYMUTIL@ | ||
2223 | 205 | DUMPBIN = @DUMPBIN@ | ||
2224 | 206 | ECHO_C = @ECHO_C@ | ||
2225 | 207 | ECHO_N = @ECHO_N@ | ||
2226 | 208 | ECHO_T = @ECHO_T@ | ||
2227 | 209 | EGREP = @EGREP@ | ||
2228 | 210 | EXEEXT = @EXEEXT@ | ||
2229 | 211 | FGREP = @FGREP@ | ||
2230 | 212 | GLOBAL_CFLAGS = @GLOBAL_CFLAGS@ | ||
2231 | 213 | GREP = @GREP@ | ||
2232 | 214 | INSTALL = @INSTALL@ | ||
2233 | 215 | INSTALL_DATA = @INSTALL_DATA@ | ||
2234 | 216 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
2235 | 217 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
2236 | 218 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
2237 | 219 | LD = @LD@ | ||
2238 | 220 | LDFLAGS = @LDFLAGS@ | ||
2239 | 221 | LFS_CFLAGS = @LFS_CFLAGS@ | ||
2240 | 222 | LIBIMOBILEDEVICE_SO_VERSION = @LIBIMOBILEDEVICE_SO_VERSION@ | ||
2241 | 223 | LIBOBJS = @LIBOBJS@ | ||
2242 | 224 | LIBS = @LIBS@ | ||
2243 | 225 | LIBTOOL = @LIBTOOL@ | ||
2244 | 226 | LIPO = @LIPO@ | ||
2245 | 227 | LN_S = @LN_S@ | ||
2246 | 228 | LTLIBOBJS = @LTLIBOBJS@ | ||
2247 | 229 | MAKEINFO = @MAKEINFO@ | ||
2248 | 230 | MANIFEST_TOOL = @MANIFEST_TOOL@ | ||
2249 | 231 | MKDIR_P = @MKDIR_P@ | ||
2250 | 232 | NM = @NM@ | ||
2251 | 233 | NMEDIT = @NMEDIT@ | ||
2252 | 234 | OBJDUMP = @OBJDUMP@ | ||
2253 | 235 | OBJEXT = @OBJEXT@ | ||
2254 | 236 | OTOOL = @OTOOL@ | ||
2255 | 237 | OTOOL64 = @OTOOL64@ | ||
2256 | 238 | PACKAGE = @PACKAGE@ | ||
2257 | 239 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
2258 | 240 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
2259 | 241 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
2260 | 242 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
2261 | 243 | PACKAGE_URL = @PACKAGE_URL@ | ||
2262 | 244 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
2263 | 245 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
2264 | 246 | PKG_CONFIG = @PKG_CONFIG@ | ||
2265 | 247 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
2266 | 248 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
2267 | 249 | PYTHON = @PYTHON@ | ||
2268 | 250 | PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ | ||
2269 | 251 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | ||
2270 | 252 | PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ | ||
2271 | 253 | PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ | ||
2272 | 254 | PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ | ||
2273 | 255 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | ||
2274 | 256 | PYTHON_PREFIX = @PYTHON_PREFIX@ | ||
2275 | 257 | PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ | ||
2276 | 258 | PYTHON_VERSION = @PYTHON_VERSION@ | ||
2277 | 259 | RANLIB = @RANLIB@ | ||
2278 | 260 | SED = @SED@ | ||
2279 | 261 | SET_MAKE = @SET_MAKE@ | ||
2280 | 262 | SHELL = @SHELL@ | ||
2281 | 263 | STRIP = @STRIP@ | ||
2282 | 264 | VERSION = @VERSION@ | ||
2283 | 265 | WINDRES = @WINDRES@ | ||
2284 | 266 | abs_builddir = @abs_builddir@ | ||
2285 | 267 | abs_srcdir = @abs_srcdir@ | ||
2286 | 268 | abs_top_builddir = @abs_top_builddir@ | ||
2287 | 269 | abs_top_srcdir = @abs_top_srcdir@ | ||
2288 | 270 | ac_ct_AR = @ac_ct_AR@ | ||
2289 | 271 | ac_ct_CC = @ac_ct_CC@ | ||
2290 | 272 | ac_ct_CXX = @ac_ct_CXX@ | ||
2291 | 273 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
2292 | 274 | am__include = @am__include@ | ||
2293 | 275 | am__leading_dot = @am__leading_dot@ | ||
2294 | 276 | am__quote = @am__quote@ | ||
2295 | 277 | am__tar = @am__tar@ | ||
2296 | 278 | am__untar = @am__untar@ | ||
2297 | 279 | bindir = @bindir@ | ||
2298 | 280 | build = @build@ | ||
2299 | 281 | build_alias = @build_alias@ | ||
2300 | 282 | build_cpu = @build_cpu@ | ||
2301 | 283 | build_os = @build_os@ | ||
2302 | 284 | build_vendor = @build_vendor@ | ||
2303 | 285 | builddir = @builddir@ | ||
2304 | 286 | datadir = @datadir@ | ||
2305 | 287 | datarootdir = @datarootdir@ | ||
2306 | 288 | docdir = @docdir@ | ||
2307 | 289 | dvidir = @dvidir@ | ||
2308 | 290 | exec_prefix = @exec_prefix@ | ||
2309 | 291 | host = @host@ | ||
2310 | 292 | host_alias = @host_alias@ | ||
2311 | 293 | host_cpu = @host_cpu@ | ||
2312 | 294 | host_os = @host_os@ | ||
2313 | 295 | host_vendor = @host_vendor@ | ||
2314 | 296 | htmldir = @htmldir@ | ||
2315 | 297 | includedir = @includedir@ | ||
2316 | 298 | infodir = @infodir@ | ||
2317 | 299 | install_sh = @install_sh@ | ||
2318 | 300 | libdir = @libdir@ | ||
2319 | 301 | libexecdir = @libexecdir@ | ||
2320 | 302 | libgcrypt_LIBS = @libgcrypt_LIBS@ | ||
2321 | 303 | libgnutls_CFLAGS = @libgnutls_CFLAGS@ | ||
2322 | 304 | libgnutls_LIBS = @libgnutls_LIBS@ | ||
2323 | 305 | libplist_CFLAGS = @libplist_CFLAGS@ | ||
2324 | 306 | libplist_LIBS = @libplist_LIBS@ | ||
2325 | 307 | libplistmm_CFLAGS = @libplistmm_CFLAGS@ | ||
2326 | 308 | libplistmm_LIBS = @libplistmm_LIBS@ | ||
2327 | 309 | libpthread_LIBS = @libpthread_LIBS@ | ||
2328 | 310 | libtasn1_CFLAGS = @libtasn1_CFLAGS@ | ||
2329 | 311 | libtasn1_LIBS = @libtasn1_LIBS@ | ||
2330 | 312 | libusbmuxd_CFLAGS = @libusbmuxd_CFLAGS@ | ||
2331 | 313 | libusbmuxd_LIBS = @libusbmuxd_LIBS@ | ||
2332 | 314 | localedir = @localedir@ | ||
2333 | 315 | localstatedir = @localstatedir@ | ||
2334 | 316 | mandir = @mandir@ | ||
2335 | 317 | mkdir_p = @mkdir_p@ | ||
2336 | 318 | oldincludedir = @oldincludedir@ | ||
2337 | 319 | openssl_CFLAGS = @openssl_CFLAGS@ | ||
2338 | 320 | openssl_LIBS = @openssl_LIBS@ | ||
2339 | 321 | pdfdir = @pdfdir@ | ||
2340 | 322 | pkgpyexecdir = @pkgpyexecdir@ | ||
2341 | 323 | pkgpythondir = @pkgpythondir@ | ||
2342 | 324 | prefix = @prefix@ | ||
2343 | 325 | program_transform_name = @program_transform_name@ | ||
2344 | 326 | psdir = @psdir@ | ||
2345 | 327 | pyexecdir = @pyexecdir@ | ||
2346 | 328 | pythondir = @pythondir@ | ||
2347 | 329 | sbindir = @sbindir@ | ||
2348 | 330 | sharedstatedir = @sharedstatedir@ | ||
2349 | 331 | srcdir = @srcdir@ | ||
2350 | 332 | ssl_requires = @ssl_requires@ | ||
2351 | 333 | sysconfdir = @sysconfdir@ | ||
2352 | 334 | target_alias = @target_alias@ | ||
2353 | 335 | top_build_prefix = @top_build_prefix@ | ||
2354 | 336 | top_builddir = @top_builddir@ | ||
2355 | 337 | top_srcdir = @top_srcdir@ | ||
2356 | 338 | AUTOMAKE_OPTIONS = foreign | ||
2357 | 339 | ACLOCAL_AMFLAGS = -I m4 | ||
2358 | 340 | SUBDIRS = src include $(CYTHON_SUB) $(DEV_SUB) tools docs | ||
2359 | 341 | DISTCHECK_CONFIGURE_FLAGS = --enable-dev-tools | ||
2360 | 342 | pkgconfigdir = $(libdir)/pkgconfig | ||
2361 | 343 | pkgconfig_DATA = libimobiledevice-1.0.pc | ||
2362 | 344 | EXTRA_DIST = docs | ||
2363 | 345 | all: config.h | ||
2364 | 346 | $(MAKE) $(AM_MAKEFLAGS) all-recursive | ||
2365 | 347 | |||
2366 | 348 | .SUFFIXES: | ||
2367 | 349 | am--refresh: Makefile | ||
2368 | 350 | @: | ||
2369 | 351 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
2370 | 352 | @for dep in $?; do \ | ||
2371 | 353 | case '$(am__configure_deps)' in \ | ||
2372 | 354 | *$$dep*) \ | ||
2373 | 355 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ | ||
2374 | 356 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ | ||
2375 | 357 | && exit 0; \ | ||
2376 | 358 | exit 1;; \ | ||
2377 | 359 | esac; \ | ||
2378 | 360 | done; \ | ||
2379 | 361 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ | ||
2380 | 362 | $(am__cd) $(top_srcdir) && \ | ||
2381 | 363 | $(AUTOMAKE) --foreign Makefile | ||
2382 | 364 | .PRECIOUS: Makefile | ||
2383 | 365 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
2384 | 366 | @case '$?' in \ | ||
2385 | 367 | *config.status*) \ | ||
2386 | 368 | echo ' $(SHELL) ./config.status'; \ | ||
2387 | 369 | $(SHELL) ./config.status;; \ | ||
2388 | 370 | *) \ | ||
2389 | 371 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ | ||
2390 | 372 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ | ||
2391 | 373 | esac; | ||
2392 | 374 | |||
2393 | 375 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
2394 | 376 | $(SHELL) ./config.status --recheck | ||
2395 | 377 | |||
2396 | 378 | $(top_srcdir)/configure: $(am__configure_deps) | ||
2397 | 379 | $(am__cd) $(srcdir) && $(AUTOCONF) | ||
2398 | 380 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
2399 | 381 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) | ||
2400 | 382 | $(am__aclocal_m4_deps): | ||
2401 | 383 | |||
2402 | 384 | config.h: stamp-h1 | ||
2403 | 385 | @if test ! -f $@; then rm -f stamp-h1; else :; fi | ||
2404 | 386 | @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi | ||
2405 | 387 | |||
2406 | 388 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status | ||
2407 | 389 | @rm -f stamp-h1 | ||
2408 | 390 | cd $(top_builddir) && $(SHELL) ./config.status config.h | ||
2409 | 391 | $(srcdir)/config.h.in: $(am__configure_deps) | ||
2410 | 392 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) | ||
2411 | 393 | rm -f stamp-h1 | ||
2412 | 394 | touch $@ | ||
2413 | 395 | |||
2414 | 396 | distclean-hdr: | ||
2415 | 397 | -rm -f config.h stamp-h1 | ||
2416 | 398 | libimobiledevice-1.0.pc: $(top_builddir)/config.status $(srcdir)/libimobiledevice-1.0.pc.in | ||
2417 | 399 | cd $(top_builddir) && $(SHELL) ./config.status $@ | ||
2418 | 400 | doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in | ||
2419 | 401 | cd $(top_builddir) && $(SHELL) ./config.status $@ | ||
2420 | 402 | |||
2421 | 403 | mostlyclean-libtool: | ||
2422 | 404 | -rm -f *.lo | ||
2423 | 405 | |||
2424 | 406 | clean-libtool: | ||
2425 | 407 | -rm -rf .libs _libs | ||
2426 | 408 | |||
2427 | 409 | distclean-libtool: | ||
2428 | 410 | -rm -f libtool config.lt | ||
2429 | 411 | install-pkgconfigDATA: $(pkgconfig_DATA) | ||
2430 | 412 | @$(NORMAL_INSTALL) | ||
2431 | 413 | @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ | ||
2432 | 414 | if test -n "$$list"; then \ | ||
2433 | 415 | echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ | ||
2434 | 416 | $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ | ||
2435 | 417 | fi; \ | ||
2436 | 418 | for p in $$list; do \ | ||
2437 | 419 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
2438 | 420 | echo "$$d$$p"; \ | ||
2439 | 421 | done | $(am__base_list) | \ | ||
2440 | 422 | while read files; do \ | ||
2441 | 423 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ | ||
2442 | 424 | $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ | ||
2443 | 425 | done | ||
2444 | 426 | |||
2445 | 427 | uninstall-pkgconfigDATA: | ||
2446 | 428 | @$(NORMAL_UNINSTALL) | ||
2447 | 429 | @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ | ||
2448 | 430 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
2449 | 431 | dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) | ||
2450 | 432 | |||
2451 | 433 | # This directory's subdirectories are mostly independent; you can cd | ||
2452 | 434 | # into them and run 'make' without going through this Makefile. | ||
2453 | 435 | # To change the values of 'make' variables: instead of editing Makefiles, | ||
2454 | 436 | # (1) if the variable is set in 'config.status', edit 'config.status' | ||
2455 | 437 | # (which will cause the Makefiles to be regenerated when you run 'make'); | ||
2456 | 438 | # (2) otherwise, pass the desired values on the 'make' command line. | ||
2457 | 439 | $(RECURSIVE_TARGETS): | ||
2458 | 440 | @fail= failcom='exit 1'; \ | ||
2459 | 441 | for f in x $$MAKEFLAGS; do \ | ||
2460 | 442 | case $$f in \ | ||
2461 | 443 | *=* | --[!k]*);; \ | ||
2462 | 444 | *k*) failcom='fail=yes';; \ | ||
2463 | 445 | esac; \ | ||
2464 | 446 | done; \ | ||
2465 | 447 | dot_seen=no; \ | ||
2466 | 448 | target=`echo $@ | sed s/-recursive//`; \ | ||
2467 | 449 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
2468 | 450 | echo "Making $$target in $$subdir"; \ | ||
2469 | 451 | if test "$$subdir" = "."; then \ | ||
2470 | 452 | dot_seen=yes; \ | ||
2471 | 453 | local_target="$$target-am"; \ | ||
2472 | 454 | else \ | ||
2473 | 455 | local_target="$$target"; \ | ||
2474 | 456 | fi; \ | ||
2475 | 457 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ | ||
2476 | 458 | || eval $$failcom; \ | ||
2477 | 459 | done; \ | ||
2478 | 460 | if test "$$dot_seen" = "no"; then \ | ||
2479 | 461 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ | ||
2480 | 462 | fi; test -z "$$fail" | ||
2481 | 463 | |||
2482 | 464 | $(RECURSIVE_CLEAN_TARGETS): | ||
2483 | 465 | @fail= failcom='exit 1'; \ | ||
2484 | 466 | for f in x $$MAKEFLAGS; do \ | ||
2485 | 467 | case $$f in \ | ||
2486 | 468 | *=* | --[!k]*);; \ | ||
2487 | 469 | *k*) failcom='fail=yes';; \ | ||
2488 | 470 | esac; \ | ||
2489 | 471 | done; \ | ||
2490 | 472 | dot_seen=no; \ | ||
2491 | 473 | case "$@" in \ | ||
2492 | 474 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ | ||
2493 | 475 | *) list='$(SUBDIRS)' ;; \ | ||
2494 | 476 | esac; \ | ||
2495 | 477 | rev=''; for subdir in $$list; do \ | ||
2496 | 478 | if test "$$subdir" = "."; then :; else \ | ||
2497 | 479 | rev="$$subdir $$rev"; \ | ||
2498 | 480 | fi; \ | ||
2499 | 481 | done; \ | ||
2500 | 482 | rev="$$rev ."; \ | ||
2501 | 483 | target=`echo $@ | sed s/-recursive//`; \ | ||
2502 | 484 | for subdir in $$rev; do \ | ||
2503 | 485 | echo "Making $$target in $$subdir"; \ | ||
2504 | 486 | if test "$$subdir" = "."; then \ | ||
2505 | 487 | local_target="$$target-am"; \ | ||
2506 | 488 | else \ | ||
2507 | 489 | local_target="$$target"; \ | ||
2508 | 490 | fi; \ | ||
2509 | 491 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ | ||
2510 | 492 | || eval $$failcom; \ | ||
2511 | 493 | done && test -z "$$fail" | ||
2512 | 494 | tags-recursive: | ||
2513 | 495 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
2514 | 496 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ | ||
2515 | 497 | done | ||
2516 | 498 | ctags-recursive: | ||
2517 | 499 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
2518 | 500 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ | ||
2519 | 501 | done | ||
2520 | 502 | cscopelist-recursive: | ||
2521 | 503 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
2522 | 504 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ | ||
2523 | 505 | done | ||
2524 | 506 | |||
2525 | 507 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
2526 | 508 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
2527 | 509 | unique=`for i in $$list; do \ | ||
2528 | 510 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
2529 | 511 | done | \ | ||
2530 | 512 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
2531 | 513 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
2532 | 514 | mkid -fID $$unique | ||
2533 | 515 | tags: TAGS | ||
2534 | 516 | |||
2535 | 517 | TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
2536 | 518 | $(TAGS_FILES) $(LISP) | ||
2537 | 519 | set x; \ | ||
2538 | 520 | here=`pwd`; \ | ||
2539 | 521 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ | ||
2540 | 522 | include_option=--etags-include; \ | ||
2541 | 523 | empty_fix=.; \ | ||
2542 | 524 | else \ | ||
2543 | 525 | include_option=--include; \ | ||
2544 | 526 | empty_fix=; \ | ||
2545 | 527 | fi; \ | ||
2546 | 528 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
2547 | 529 | if test "$$subdir" = .; then :; else \ | ||
2548 | 530 | test ! -f $$subdir/TAGS || \ | ||
2549 | 531 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ | ||
2550 | 532 | fi; \ | ||
2551 | 533 | done; \ | ||
2552 | 534 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
2553 | 535 | unique=`for i in $$list; do \ | ||
2554 | 536 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
2555 | 537 | done | \ | ||
2556 | 538 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
2557 | 539 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
2558 | 540 | shift; \ | ||
2559 | 541 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
2560 | 542 | test -n "$$unique" || unique=$$empty_fix; \ | ||
2561 | 543 | if test $$# -gt 0; then \ | ||
2562 | 544 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
2563 | 545 | "$$@" $$unique; \ | ||
2564 | 546 | else \ | ||
2565 | 547 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
2566 | 548 | $$unique; \ | ||
2567 | 549 | fi; \ | ||
2568 | 550 | fi | ||
2569 | 551 | ctags: CTAGS | ||
2570 | 552 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
2571 | 553 | $(TAGS_FILES) $(LISP) | ||
2572 | 554 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
2573 | 555 | unique=`for i in $$list; do \ | ||
2574 | 556 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
2575 | 557 | done | \ | ||
2576 | 558 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
2577 | 559 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
2578 | 560 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
2579 | 561 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
2580 | 562 | $$unique | ||
2581 | 563 | |||
2582 | 564 | GTAGS: | ||
2583 | 565 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
2584 | 566 | && $(am__cd) $(top_srcdir) \ | ||
2585 | 567 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
2586 | 568 | |||
2587 | 569 | cscope: cscope.files | ||
2588 | 570 | test ! -s cscope.files \ | ||
2589 | 571 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) | ||
2590 | 572 | |||
2591 | 573 | clean-cscope: | ||
2592 | 574 | -rm -f cscope.files | ||
2593 | 575 | |||
2594 | 576 | cscope.files: clean-cscope cscopelist-recursive cscopelist | ||
2595 | 577 | |||
2596 | 578 | cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) | ||
2597 | 579 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | ||
2598 | 580 | case "$(srcdir)" in \ | ||
2599 | 581 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | ||
2600 | 582 | *) sdir=$(subdir)/$(srcdir) ;; \ | ||
2601 | 583 | esac; \ | ||
2602 | 584 | for i in $$list; do \ | ||
2603 | 585 | if test -f "$$i"; then \ | ||
2604 | 586 | echo "$(subdir)/$$i"; \ | ||
2605 | 587 | else \ | ||
2606 | 588 | echo "$$sdir/$$i"; \ | ||
2607 | 589 | fi; \ | ||
2608 | 590 | done >> $(top_builddir)/cscope.files | ||
2609 | 591 | |||
2610 | 592 | distclean-tags: | ||
2611 | 593 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
2612 | 594 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files | ||
2613 | 595 | |||
2614 | 596 | distdir: $(DISTFILES) | ||
2615 | 597 | $(am__remove_distdir) | ||
2616 | 598 | test -d "$(distdir)" || mkdir "$(distdir)" | ||
2617 | 599 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
2618 | 600 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
2619 | 601 | list='$(DISTFILES)'; \ | ||
2620 | 602 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
2621 | 603 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
2622 | 604 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
2623 | 605 | case $$dist_files in \ | ||
2624 | 606 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
2625 | 607 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
2626 | 608 | sort -u` ;; \ | ||
2627 | 609 | esac; \ | ||
2628 | 610 | for file in $$dist_files; do \ | ||
2629 | 611 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
2630 | 612 | if test -d $$d/$$file; then \ | ||
2631 | 613 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
2632 | 614 | if test -d "$(distdir)/$$file"; then \ | ||
2633 | 615 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
2634 | 616 | fi; \ | ||
2635 | 617 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
2636 | 618 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
2637 | 619 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
2638 | 620 | fi; \ | ||
2639 | 621 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
2640 | 622 | else \ | ||
2641 | 623 | test -f "$(distdir)/$$file" \ | ||
2642 | 624 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
2643 | 625 | || exit 1; \ | ||
2644 | 626 | fi; \ | ||
2645 | 627 | done | ||
2646 | 628 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ | ||
2647 | 629 | if test "$$subdir" = .; then :; else \ | ||
2648 | 630 | $(am__make_dryrun) \ | ||
2649 | 631 | || test -d "$(distdir)/$$subdir" \ | ||
2650 | 632 | || $(MKDIR_P) "$(distdir)/$$subdir" \ | ||
2651 | 633 | || exit 1; \ | ||
2652 | 634 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ | ||
2653 | 635 | $(am__relativize); \ | ||
2654 | 636 | new_distdir=$$reldir; \ | ||
2655 | 637 | dir1=$$subdir; dir2="$(top_distdir)"; \ | ||
2656 | 638 | $(am__relativize); \ | ||
2657 | 639 | new_top_distdir=$$reldir; \ | ||
2658 | 640 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ | ||
2659 | 641 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ | ||
2660 | 642 | ($(am__cd) $$subdir && \ | ||
2661 | 643 | $(MAKE) $(AM_MAKEFLAGS) \ | ||
2662 | 644 | top_distdir="$$new_top_distdir" \ | ||
2663 | 645 | distdir="$$new_distdir" \ | ||
2664 | 646 | am__remove_distdir=: \ | ||
2665 | 647 | am__skip_length_check=: \ | ||
2666 | 648 | am__skip_mode_fix=: \ | ||
2667 | 649 | distdir) \ | ||
2668 | 650 | || exit 1; \ | ||
2669 | 651 | fi; \ | ||
2670 | 652 | done | ||
2671 | 653 | -test -n "$(am__skip_mode_fix)" \ | ||
2672 | 654 | || find "$(distdir)" -type d ! -perm -755 \ | ||
2673 | 655 | -exec chmod u+rwx,go+rx {} \; -o \ | ||
2674 | 656 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ | ||
2675 | 657 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ | ||
2676 | 658 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ | ||
2677 | 659 | || chmod -R a+r "$(distdir)" | ||
2678 | 660 | dist-gzip: distdir | ||
2679 | 661 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | ||
2680 | 662 | $(am__post_remove_distdir) | ||
2681 | 663 | dist-bzip2: distdir | ||
2682 | 664 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 | ||
2683 | 665 | $(am__post_remove_distdir) | ||
2684 | 666 | |||
2685 | 667 | dist-lzip: distdir | ||
2686 | 668 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz | ||
2687 | 669 | $(am__post_remove_distdir) | ||
2688 | 670 | |||
2689 | 671 | dist-xz: distdir | ||
2690 | 672 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz | ||
2691 | 673 | $(am__post_remove_distdir) | ||
2692 | 674 | |||
2693 | 675 | dist-tarZ: distdir | ||
2694 | 676 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z | ||
2695 | 677 | $(am__post_remove_distdir) | ||
2696 | 678 | |||
2697 | 679 | dist-shar: distdir | ||
2698 | 680 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz | ||
2699 | 681 | $(am__post_remove_distdir) | ||
2700 | 682 | |||
2701 | 683 | dist-zip: distdir | ||
2702 | 684 | -rm -f $(distdir).zip | ||
2703 | 685 | zip -rq $(distdir).zip $(distdir) | ||
2704 | 686 | $(am__post_remove_distdir) | ||
2705 | 687 | |||
2706 | 688 | dist dist-all: | ||
2707 | 689 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' | ||
2708 | 690 | $(am__post_remove_distdir) | ||
2709 | 691 | |||
2710 | 692 | # This target untars the dist file and tries a VPATH configuration. Then | ||
2711 | 693 | # it guarantees that the distribution is self-contained by making another | ||
2712 | 694 | # tarfile. | ||
2713 | 695 | distcheck: dist | ||
2714 | 696 | case '$(DIST_ARCHIVES)' in \ | ||
2715 | 697 | *.tar.gz*) \ | ||
2716 | 698 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ | ||
2717 | 699 | *.tar.bz2*) \ | ||
2718 | 700 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ | ||
2719 | 701 | *.tar.lz*) \ | ||
2720 | 702 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ | ||
2721 | 703 | *.tar.xz*) \ | ||
2722 | 704 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ | ||
2723 | 705 | *.tar.Z*) \ | ||
2724 | 706 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ | ||
2725 | 707 | *.shar.gz*) \ | ||
2726 | 708 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ | ||
2727 | 709 | *.zip*) \ | ||
2728 | 710 | unzip $(distdir).zip ;;\ | ||
2729 | 711 | esac | ||
2730 | 712 | chmod -R a-w $(distdir); chmod u+w $(distdir) | ||
2731 | 713 | mkdir $(distdir)/_build | ||
2732 | 714 | mkdir $(distdir)/_inst | ||
2733 | 715 | chmod a-w $(distdir) | ||
2734 | 716 | test -d $(distdir)/_build || exit 0; \ | ||
2735 | 717 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ | ||
2736 | 718 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ | ||
2737 | 719 | && am__cwd=`pwd` \ | ||
2738 | 720 | && $(am__cd) $(distdir)/_build \ | ||
2739 | 721 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ | ||
2740 | 722 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ | ||
2741 | 723 | $(DISTCHECK_CONFIGURE_FLAGS) \ | ||
2742 | 724 | && $(MAKE) $(AM_MAKEFLAGS) \ | ||
2743 | 725 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ | ||
2744 | 726 | && $(MAKE) $(AM_MAKEFLAGS) check \ | ||
2745 | 727 | && $(MAKE) $(AM_MAKEFLAGS) install \ | ||
2746 | 728 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ | ||
2747 | 729 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ | ||
2748 | 730 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ | ||
2749 | 731 | distuninstallcheck \ | ||
2750 | 732 | && chmod -R a-w "$$dc_install_base" \ | ||
2751 | 733 | && ({ \ | ||
2752 | 734 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ | ||
2753 | 735 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ | ||
2754 | 736 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ | ||
2755 | 737 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ | ||
2756 | 738 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ | ||
2757 | 739 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ | ||
2758 | 740 | && rm -rf "$$dc_destdir" \ | ||
2759 | 741 | && $(MAKE) $(AM_MAKEFLAGS) dist \ | ||
2760 | 742 | && rm -rf $(DIST_ARCHIVES) \ | ||
2761 | 743 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ | ||
2762 | 744 | && cd "$$am__cwd" \ | ||
2763 | 745 | || exit 1 | ||
2764 | 746 | $(am__post_remove_distdir) | ||
2765 | 747 | @(echo "$(distdir) archives ready for distribution: "; \ | ||
2766 | 748 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ | ||
2767 | 749 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' | ||
2768 | 750 | distuninstallcheck: | ||
2769 | 751 | @test -n '$(distuninstallcheck_dir)' || { \ | ||
2770 | 752 | echo 'ERROR: trying to run $@ with an empty' \ | ||
2771 | 753 | '$$(distuninstallcheck_dir)' >&2; \ | ||
2772 | 754 | exit 1; \ | ||
2773 | 755 | }; \ | ||
2774 | 756 | $(am__cd) '$(distuninstallcheck_dir)' || { \ | ||
2775 | 757 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ | ||
2776 | 758 | exit 1; \ | ||
2777 | 759 | }; \ | ||
2778 | 760 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ | ||
2779 | 761 | || { echo "ERROR: files left after uninstall:" ; \ | ||
2780 | 762 | if test -n "$(DESTDIR)"; then \ | ||
2781 | 763 | echo " (check DESTDIR support)"; \ | ||
2782 | 764 | fi ; \ | ||
2783 | 765 | $(distuninstallcheck_listfiles) ; \ | ||
2784 | 766 | exit 1; } >&2 | ||
2785 | 767 | distcleancheck: distclean | ||
2786 | 768 | @if test '$(srcdir)' = . ; then \ | ||
2787 | 769 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ | ||
2788 | 770 | exit 1 ; \ | ||
2789 | 771 | fi | ||
2790 | 772 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ | ||
2791 | 773 | || { echo "ERROR: files left in build directory after distclean:" ; \ | ||
2792 | 774 | $(distcleancheck_listfiles) ; \ | ||
2793 | 775 | exit 1; } >&2 | ||
2794 | 776 | check-am: all-am | ||
2795 | 777 | check: check-recursive | ||
2796 | 778 | all-am: Makefile $(DATA) config.h | ||
2797 | 779 | installdirs: installdirs-recursive | ||
2798 | 780 | installdirs-am: | ||
2799 | 781 | for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ | ||
2800 | 782 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
2801 | 783 | done | ||
2802 | 784 | install: install-recursive | ||
2803 | 785 | install-exec: install-exec-recursive | ||
2804 | 786 | install-data: install-data-recursive | ||
2805 | 787 | uninstall: uninstall-recursive | ||
2806 | 788 | |||
2807 | 789 | install-am: all-am | ||
2808 | 790 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
2809 | 791 | |||
2810 | 792 | installcheck: installcheck-recursive | ||
2811 | 793 | install-strip: | ||
2812 | 794 | if test -z '$(STRIP)'; then \ | ||
2813 | 795 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
2814 | 796 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
2815 | 797 | install; \ | ||
2816 | 798 | else \ | ||
2817 | 799 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
2818 | 800 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
2819 | 801 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ | ||
2820 | 802 | fi | ||
2821 | 803 | mostlyclean-generic: | ||
2822 | 804 | |||
2823 | 805 | clean-generic: | ||
2824 | 806 | |||
2825 | 807 | distclean-generic: | ||
2826 | 808 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
2827 | 809 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
2828 | 810 | |||
2829 | 811 | maintainer-clean-generic: | ||
2830 | 812 | @echo "This command is intended for maintainers to use" | ||
2831 | 813 | @echo "it deletes files that may require special tools to rebuild." | ||
2832 | 814 | clean: clean-recursive | ||
2833 | 815 | |||
2834 | 816 | clean-am: clean-generic clean-libtool mostlyclean-am | ||
2835 | 817 | |||
2836 | 818 | distclean: distclean-recursive | ||
2837 | 819 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) | ||
2838 | 820 | -rm -f Makefile | ||
2839 | 821 | distclean-am: clean-am distclean-generic distclean-hdr \ | ||
2840 | 822 | distclean-libtool distclean-tags | ||
2841 | 823 | |||
2842 | 824 | dvi: dvi-recursive | ||
2843 | 825 | |||
2844 | 826 | dvi-am: | ||
2845 | 827 | |||
2846 | 828 | html: html-recursive | ||
2847 | 829 | |||
2848 | 830 | html-am: | ||
2849 | 831 | |||
2850 | 832 | info: info-recursive | ||
2851 | 833 | |||
2852 | 834 | info-am: | ||
2853 | 835 | |||
2854 | 836 | install-data-am: install-pkgconfigDATA | ||
2855 | 837 | |||
2856 | 838 | install-dvi: install-dvi-recursive | ||
2857 | 839 | |||
2858 | 840 | install-dvi-am: | ||
2859 | 841 | |||
2860 | 842 | install-exec-am: | ||
2861 | 843 | |||
2862 | 844 | install-html: install-html-recursive | ||
2863 | 845 | |||
2864 | 846 | install-html-am: | ||
2865 | 847 | |||
2866 | 848 | install-info: install-info-recursive | ||
2867 | 849 | |||
2868 | 850 | install-info-am: | ||
2869 | 851 | |||
2870 | 852 | install-man: | ||
2871 | 853 | |||
2872 | 854 | install-pdf: install-pdf-recursive | ||
2873 | 855 | |||
2874 | 856 | install-pdf-am: | ||
2875 | 857 | |||
2876 | 858 | install-ps: install-ps-recursive | ||
2877 | 859 | |||
2878 | 860 | install-ps-am: | ||
2879 | 861 | |||
2880 | 862 | installcheck-am: | ||
2881 | 863 | |||
2882 | 864 | maintainer-clean: maintainer-clean-recursive | ||
2883 | 865 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) | ||
2884 | 866 | -rm -rf $(top_srcdir)/autom4te.cache | ||
2885 | 867 | -rm -f Makefile | ||
2886 | 868 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
2887 | 869 | |||
2888 | 870 | mostlyclean: mostlyclean-recursive | ||
2889 | 871 | |||
2890 | 872 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool | ||
2891 | 873 | |||
2892 | 874 | pdf: pdf-recursive | ||
2893 | 875 | |||
2894 | 876 | pdf-am: | ||
2895 | 877 | |||
2896 | 878 | ps: ps-recursive | ||
2897 | 879 | |||
2898 | 880 | ps-am: | ||
2899 | 881 | |||
2900 | 882 | uninstall-am: uninstall-pkgconfigDATA | ||
2901 | 883 | |||
2902 | 884 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ | ||
2903 | 885 | cscopelist-recursive ctags-recursive install-am install-strip \ | ||
2904 | 886 | tags-recursive | ||
2905 | 887 | |||
2906 | 888 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ | ||
2907 | 889 | all all-am am--refresh check check-am clean clean-cscope \ | ||
2908 | 890 | clean-generic clean-libtool cscope cscopelist \ | ||
2909 | 891 | cscopelist-recursive ctags ctags-recursive dist dist-all \ | ||
2910 | 892 | dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ | ||
2911 | 893 | dist-zip distcheck distclean distclean-generic distclean-hdr \ | ||
2912 | 894 | distclean-libtool distclean-tags distcleancheck distdir \ | ||
2913 | 895 | distuninstallcheck dvi dvi-am html html-am info info-am \ | ||
2914 | 896 | install install-am install-data install-data-am install-dvi \ | ||
2915 | 897 | install-dvi-am install-exec install-exec-am install-html \ | ||
2916 | 898 | install-html-am install-info install-info-am install-man \ | ||
2917 | 899 | install-pdf install-pdf-am install-pkgconfigDATA install-ps \ | ||
2918 | 900 | install-ps-am install-strip installcheck installcheck-am \ | ||
2919 | 901 | installdirs installdirs-am maintainer-clean \ | ||
2920 | 902 | maintainer-clean-generic mostlyclean mostlyclean-generic \ | ||
2921 | 903 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ | ||
2922 | 904 | uninstall uninstall-am uninstall-pkgconfigDATA | ||
2923 | 905 | |||
2924 | 906 | |||
2925 | 907 | docs/html: $(top_builddir)/doxygen.cfg $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h $(top_srcdir)/include/libimobiledevice/*.h | ||
2926 | 908 | rm -rf docs/html | ||
2927 | 909 | doxygen doxygen.cfg | ||
2928 | 910 | |||
2929 | 911 | docs: doxygen.cfg docs/html | ||
2930 | 912 | |||
2931 | 913 | indent: | ||
2932 | 914 | indent -kr -ut -ts4 -l120 src/*.c src/*.h dev/*.c | ||
2933 | 915 | |||
2934 | 916 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
2935 | 917 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
2936 | 918 | .NOEXPORT: | ||
2937 | 919 | 0 | ||
2938 | === modified file 'NEWS' | |||
2939 | --- NEWS 2013-10-28 23:01:08 +0000 | |||
2940 | +++ NEWS 2014-03-14 06:45:31 +0000 | |||
2941 | @@ -1,3 +1,23 @@ | |||
2942 | 1 | Version 1.1.6 | ||
2943 | 2 | ~~~~~~~~~~~~~ | ||
2944 | 3 | |||
2945 | 4 | * Development release | ||
2946 | 5 | * Changes: | ||
2947 | 6 | - Security: Fix insecure use of the /tmp directory (CVE-2013-2142) | ||
2948 | 7 | - A bunch of memory leak fixes | ||
2949 | 8 | - Python: Various fixes and support for "with" statement for AfcFile class | ||
2950 | 9 | - Python: Add Afc2Client class to allow jailbroken filesystem access | ||
2951 | 10 | - Fix linking issue with newer libtool as reported for Ubuntu | ||
2952 | 11 | - Fix stuck thread in idevicesyslog which broke quit from within the tool | ||
2953 | 12 | - Add syslog_relay service implementation and use it in idevicesyslog | ||
2954 | 13 | - API: Add instproxy_client_get_path_for_bundle_identifier() helper | ||
2955 | 14 | - API: Add afc_dictionary_free() helper | ||
2956 | 15 | - Move thread, socket, debug and userpref code to "common" source directory | ||
2957 | 16 | in order to improve code reuse | ||
2958 | 17 | - Fix broken byte order detection in configure.ac which could lead to broken | ||
2959 | 18 | AFC protocol communication on platforms without endian.h (Raspberry PI) | ||
2960 | 19 | * API is UNSTABLE | ||
2961 | 20 | |||
2962 | 1 | Version 1.1.5 | 21 | Version 1.1.5 |
2963 | 2 | ~~~~~~~~~~~~~ | 22 | ~~~~~~~~~~~~~ |
2964 | 3 | 23 | ||
2965 | 4 | 24 | ||
2966 | === modified file 'README' | |||
2967 | --- README 2013-07-31 15:34:39 +0000 | |||
2968 | +++ README 2014-03-14 06:45:31 +0000 | |||
2969 | @@ -19,6 +19,7 @@ | |||
2970 | 19 | automake | 19 | automake |
2971 | 20 | autoconf | 20 | autoconf |
2972 | 21 | libtool | 21 | libtool |
2973 | 22 | pkg-config | ||
2974 | 22 | gcc | 23 | gcc |
2975 | 23 | 24 | ||
2976 | 24 | Optional: | 25 | Optional: |
2977 | @@ -29,7 +30,7 @@ | |||
2978 | 29 | ============ | 30 | ============ |
2979 | 30 | 31 | ||
2980 | 31 | To compile run: | 32 | To compile run: |
2982 | 32 | ./configure | 33 | ./autogen.sh |
2983 | 33 | make | 34 | make |
2984 | 34 | sudo make install | 35 | sudo make install |
2985 | 35 | 36 | ||
2986 | @@ -42,12 +43,18 @@ | |||
2987 | 42 | Code: | 43 | Code: |
2988 | 43 | git clone http://git.sukimashita.com/libimobiledevice.git | 44 | git clone http://git.sukimashita.com/libimobiledevice.git |
2989 | 44 | 45 | ||
2990 | 46 | Code (Mirror): | ||
2991 | 47 | git clone https://github.com/libimobiledevice/libimobiledevice.git | ||
2992 | 48 | |||
2993 | 45 | Tickets: | 49 | Tickets: |
2995 | 46 | http://libiphone.lighthouseapp.com/ | 50 | http://github.com/libimobiledevice/libimobiledevice/issues |
2996 | 47 | 51 | ||
2997 | 48 | Mailing List: | 52 | Mailing List: |
2998 | 49 | http://lists.libimobiledevice.org/mailman/listinfo/libimobiledevice-devel | 53 | http://lists.libimobiledevice.org/mailman/listinfo/libimobiledevice-devel |
2999 | 50 | 54 | ||
3000 | 55 | IRC: | ||
3001 | 56 | irc://irc.freenode.net#libimobiledevice | ||
3002 | 57 | |||
3003 | 51 | Credits | 58 | Credits |
3004 | 52 | ======= | 59 | ======= |
3005 | 53 | 60 | ||
3006 | @@ -56,4 +63,4 @@ | |||
3007 | 56 | authorized, sponsored, or otherwise approved by Apple Inc. | 63 | authorized, sponsored, or otherwise approved by Apple Inc. |
3008 | 57 | 64 | ||
3009 | 58 | README Updated on: | 65 | README Updated on: |
3011 | 59 | 2013-03-18 | 66 | 2014-02-02 |
3012 | 60 | 67 | ||
3013 | === removed file 'aclocal.m4' | |||
3014 | --- aclocal.m4 2013-10-28 23:01:08 +0000 | |||
3015 | +++ aclocal.m4 1970-01-01 00:00:00 +0000 | |||
3016 | @@ -1,1454 +0,0 @@ | |||
3017 | 1 | # generated automatically by aclocal 1.12.1 -*- Autoconf -*- | ||
3018 | 2 | |||
3019 | 3 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | ||
3020 | 4 | |||
3021 | 5 | # This file is free software; the Free Software Foundation | ||
3022 | 6 | # gives unlimited permission to copy and/or distribute it, | ||
3023 | 7 | # with or without modifications, as long as this notice is preserved. | ||
3024 | 8 | |||
3025 | 9 | # This program is distributed in the hope that it will be useful, | ||
3026 | 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
3027 | 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
3028 | 12 | # PARTICULAR PURPOSE. | ||
3029 | 13 | |||
3030 | 14 | m4_ifndef([AC_AUTOCONF_VERSION], | ||
3031 | 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl | ||
3032 | 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, | ||
3033 | 17 | [m4_warning([this file was generated for autoconf 2.69. | ||
3034 | 18 | You have another version of autoconf. It may work, but is not guaranteed to. | ||
3035 | 19 | If you have problems, you may need to regenerate the build system entirely. | ||
3036 | 20 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) | ||
3037 | 21 | |||
3038 | 22 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | ||
3039 | 23 | # serial 1 (pkg-config-0.24) | ||
3040 | 24 | # | ||
3041 | 25 | # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. | ||
3042 | 26 | # | ||
3043 | 27 | # This program is free software; you can redistribute it and/or modify | ||
3044 | 28 | # it under the terms of the GNU General Public License as published by | ||
3045 | 29 | # the Free Software Foundation; either version 2 of the License, or | ||
3046 | 30 | # (at your option) any later version. | ||
3047 | 31 | # | ||
3048 | 32 | # This program is distributed in the hope that it will be useful, but | ||
3049 | 33 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3050 | 34 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3051 | 35 | # General Public License for more details. | ||
3052 | 36 | # | ||
3053 | 37 | # You should have received a copy of the GNU General Public License | ||
3054 | 38 | # along with this program; if not, write to the Free Software | ||
3055 | 39 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
3056 | 40 | # | ||
3057 | 41 | # As a special exception to the GNU General Public License, if you | ||
3058 | 42 | # distribute this file as part of a program that contains a | ||
3059 | 43 | # configuration script generated by Autoconf, you may include it under | ||
3060 | 44 | # the same distribution terms that you use for the rest of that program. | ||
3061 | 45 | |||
3062 | 46 | # PKG_PROG_PKG_CONFIG([MIN-VERSION]) | ||
3063 | 47 | # ---------------------------------- | ||
3064 | 48 | AC_DEFUN([PKG_PROG_PKG_CONFIG], | ||
3065 | 49 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | ||
3066 | 50 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) | ||
3067 | 51 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) | ||
3068 | 52 | AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) | ||
3069 | 53 | AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) | ||
3070 | 54 | |||
3071 | 55 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | ||
3072 | 56 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | ||
3073 | 57 | fi | ||
3074 | 58 | if test -n "$PKG_CONFIG"; then | ||
3075 | 59 | _pkg_min_version=m4_default([$1], [0.9.0]) | ||
3076 | 60 | AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) | ||
3077 | 61 | if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then | ||
3078 | 62 | AC_MSG_RESULT([yes]) | ||
3079 | 63 | else | ||
3080 | 64 | AC_MSG_RESULT([no]) | ||
3081 | 65 | PKG_CONFIG="" | ||
3082 | 66 | fi | ||
3083 | 67 | fi[]dnl | ||
3084 | 68 | ])# PKG_PROG_PKG_CONFIG | ||
3085 | 69 | |||
3086 | 70 | # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | ||
3087 | 71 | # | ||
3088 | 72 | # Check to see whether a particular set of modules exists. Similar | ||
3089 | 73 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. | ||
3090 | 74 | # | ||
3091 | 75 | # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | ||
3092 | 76 | # only at the first occurence in configure.ac, so if the first place | ||
3093 | 77 | # it's called might be skipped (such as if it is within an "if", you | ||
3094 | 78 | # have to call PKG_CHECK_EXISTS manually | ||
3095 | 79 | # -------------------------------------------------------------- | ||
3096 | 80 | AC_DEFUN([PKG_CHECK_EXISTS], | ||
3097 | 81 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | ||
3098 | 82 | if test -n "$PKG_CONFIG" && \ | ||
3099 | 83 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | ||
3100 | 84 | m4_default([$2], [:]) | ||
3101 | 85 | m4_ifvaln([$3], [else | ||
3102 | 86 | $3])dnl | ||
3103 | 87 | fi]) | ||
3104 | 88 | |||
3105 | 89 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | ||
3106 | 90 | # --------------------------------------------- | ||
3107 | 91 | m4_define([_PKG_CONFIG], | ||
3108 | 92 | [if test -n "$$1"; then | ||
3109 | 93 | pkg_cv_[]$1="$$1" | ||
3110 | 94 | elif test -n "$PKG_CONFIG"; then | ||
3111 | 95 | PKG_CHECK_EXISTS([$3], | ||
3112 | 96 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], | ||
3113 | 97 | [pkg_failed=yes]) | ||
3114 | 98 | else | ||
3115 | 99 | pkg_failed=untried | ||
3116 | 100 | fi[]dnl | ||
3117 | 101 | ])# _PKG_CONFIG | ||
3118 | 102 | |||
3119 | 103 | # _PKG_SHORT_ERRORS_SUPPORTED | ||
3120 | 104 | # ----------------------------- | ||
3121 | 105 | AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], | ||
3122 | 106 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | ||
3123 | 107 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | ||
3124 | 108 | _pkg_short_errors_supported=yes | ||
3125 | 109 | else | ||
3126 | 110 | _pkg_short_errors_supported=no | ||
3127 | 111 | fi[]dnl | ||
3128 | 112 | ])# _PKG_SHORT_ERRORS_SUPPORTED | ||
3129 | 113 | |||
3130 | 114 | |||
3131 | 115 | # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], | ||
3132 | 116 | # [ACTION-IF-NOT-FOUND]) | ||
3133 | 117 | # | ||
3134 | 118 | # | ||
3135 | 119 | # Note that if there is a possibility the first call to | ||
3136 | 120 | # PKG_CHECK_MODULES might not happen, you should be sure to include an | ||
3137 | 121 | # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac | ||
3138 | 122 | # | ||
3139 | 123 | # | ||
3140 | 124 | # -------------------------------------------------------------- | ||
3141 | 125 | AC_DEFUN([PKG_CHECK_MODULES], | ||
3142 | 126 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | ||
3143 | 127 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl | ||
3144 | 128 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl | ||
3145 | 129 | |||
3146 | 130 | pkg_failed=no | ||
3147 | 131 | AC_MSG_CHECKING([for $1]) | ||
3148 | 132 | |||
3149 | 133 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) | ||
3150 | 134 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) | ||
3151 | 135 | |||
3152 | 136 | m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS | ||
3153 | 137 | and $1[]_LIBS to avoid the need to call pkg-config. | ||
3154 | 138 | See the pkg-config man page for more details.]) | ||
3155 | 139 | |||
3156 | 140 | if test $pkg_failed = yes; then | ||
3157 | 141 | AC_MSG_RESULT([no]) | ||
3158 | 142 | _PKG_SHORT_ERRORS_SUPPORTED | ||
3159 | 143 | if test $_pkg_short_errors_supported = yes; then | ||
3160 | 144 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` | ||
3161 | 145 | else | ||
3162 | 146 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` | ||
3163 | 147 | fi | ||
3164 | 148 | # Put the nasty error message in config.log where it belongs | ||
3165 | 149 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD | ||
3166 | 150 | |||
3167 | 151 | m4_default([$4], [AC_MSG_ERROR( | ||
3168 | 152 | [Package requirements ($2) were not met: | ||
3169 | 153 | |||
3170 | 154 | $$1_PKG_ERRORS | ||
3171 | 155 | |||
3172 | 156 | Consider adjusting the PKG_CONFIG_PATH environment variable if you | ||
3173 | 157 | installed software in a non-standard prefix. | ||
3174 | 158 | |||
3175 | 159 | _PKG_TEXT])[]dnl | ||
3176 | 160 | ]) | ||
3177 | 161 | elif test $pkg_failed = untried; then | ||
3178 | 162 | AC_MSG_RESULT([no]) | ||
3179 | 163 | m4_default([$4], [AC_MSG_FAILURE( | ||
3180 | 164 | [The pkg-config script could not be found or is too old. Make sure it | ||
3181 | 165 | is in your PATH or set the PKG_CONFIG environment variable to the full | ||
3182 | 166 | path to pkg-config. | ||
3183 | 167 | |||
3184 | 168 | _PKG_TEXT | ||
3185 | 169 | |||
3186 | 170 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl | ||
3187 | 171 | ]) | ||
3188 | 172 | else | ||
3189 | 173 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | ||
3190 | 174 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | ||
3191 | 175 | AC_MSG_RESULT([yes]) | ||
3192 | 176 | $3 | ||
3193 | 177 | fi[]dnl | ||
3194 | 178 | ])# PKG_CHECK_MODULES | ||
3195 | 179 | |||
3196 | 180 | # Copyright (C) 2002-2012 Free Software Foundation, Inc. | ||
3197 | 181 | # | ||
3198 | 182 | # This file is free software; the Free Software Foundation | ||
3199 | 183 | # gives unlimited permission to copy and/or distribute it, | ||
3200 | 184 | # with or without modifications, as long as this notice is preserved. | ||
3201 | 185 | |||
3202 | 186 | # serial 8 | ||
3203 | 187 | |||
3204 | 188 | # AM_AUTOMAKE_VERSION(VERSION) | ||
3205 | 189 | # ---------------------------- | ||
3206 | 190 | # Automake X.Y traces this macro to ensure aclocal.m4 has been | ||
3207 | 191 | # generated from the m4 files accompanying Automake X.Y. | ||
3208 | 192 | # (This private macro should not be called outside this file.) | ||
3209 | 193 | AC_DEFUN([AM_AUTOMAKE_VERSION], | ||
3210 | 194 | [am__api_version='1.12' | ||
3211 | 195 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to | ||
3212 | 196 | dnl require some minimum version. Point them to the right macro. | ||
3213 | 197 | m4_if([$1], [1.12.1], [], | ||
3214 | 198 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl | ||
3215 | 199 | ]) | ||
3216 | 200 | |||
3217 | 201 | # _AM_AUTOCONF_VERSION(VERSION) | ||
3218 | 202 | # ----------------------------- | ||
3219 | 203 | # aclocal traces this macro to find the Autoconf version. | ||
3220 | 204 | # This is a private macro too. Using m4_define simplifies | ||
3221 | 205 | # the logic in aclocal, which can simply ignore this definition. | ||
3222 | 206 | m4_define([_AM_AUTOCONF_VERSION], []) | ||
3223 | 207 | |||
3224 | 208 | # AM_SET_CURRENT_AUTOMAKE_VERSION | ||
3225 | 209 | # ------------------------------- | ||
3226 | 210 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. | ||
3227 | 211 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. | ||
3228 | 212 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], | ||
3229 | 213 | [AM_AUTOMAKE_VERSION([1.12.1])dnl | ||
3230 | 214 | m4_ifndef([AC_AUTOCONF_VERSION], | ||
3231 | 215 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl | ||
3232 | 216 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) | ||
3233 | 217 | |||
3234 | 218 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- | ||
3235 | 219 | |||
3236 | 220 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
3237 | 221 | # | ||
3238 | 222 | # This file is free software; the Free Software Foundation | ||
3239 | 223 | # gives unlimited permission to copy and/or distribute it, | ||
3240 | 224 | # with or without modifications, as long as this notice is preserved. | ||
3241 | 225 | |||
3242 | 226 | # serial 2 | ||
3243 | 227 | |||
3244 | 228 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets | ||
3245 | 229 | # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to | ||
3246 | 230 | # '$srcdir', '$srcdir/..', or '$srcdir/../..'. | ||
3247 | 231 | # | ||
3248 | 232 | # Of course, Automake must honor this variable whenever it calls a | ||
3249 | 233 | # tool from the auxiliary directory. The problem is that $srcdir (and | ||
3250 | 234 | # therefore $ac_aux_dir as well) can be either absolute or relative, | ||
3251 | 235 | # depending on how configure is run. This is pretty annoying, since | ||
3252 | 236 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top | ||
3253 | 237 | # source directory, any form will work fine, but in subdirectories a | ||
3254 | 238 | # relative path needs to be adjusted first. | ||
3255 | 239 | # | ||
3256 | 240 | # $ac_aux_dir/missing | ||
3257 | 241 | # fails when called from a subdirectory if $ac_aux_dir is relative | ||
3258 | 242 | # $top_srcdir/$ac_aux_dir/missing | ||
3259 | 243 | # fails if $ac_aux_dir is absolute, | ||
3260 | 244 | # fails when called from a subdirectory in a VPATH build with | ||
3261 | 245 | # a relative $ac_aux_dir | ||
3262 | 246 | # | ||
3263 | 247 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir | ||
3264 | 248 | # are both prefixed by $srcdir. In an in-source build this is usually | ||
3265 | 249 | # harmless because $srcdir is '.', but things will broke when you | ||
3266 | 250 | # start a VPATH build or use an absolute $srcdir. | ||
3267 | 251 | # | ||
3268 | 252 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, | ||
3269 | 253 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: | ||
3270 | 254 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` | ||
3271 | 255 | # and then we would define $MISSING as | ||
3272 | 256 | # MISSING="\${SHELL} $am_aux_dir/missing" | ||
3273 | 257 | # This will work as long as MISSING is not called from configure, because | ||
3274 | 258 | # unfortunately $(top_srcdir) has no meaning in configure. | ||
3275 | 259 | # However there are other variables, like CC, which are often used in | ||
3276 | 260 | # configure, and could therefore not use this "fixed" $ac_aux_dir. | ||
3277 | 261 | # | ||
3278 | 262 | # Another solution, used here, is to always expand $ac_aux_dir to an | ||
3279 | 263 | # absolute PATH. The drawback is that using absolute paths prevent a | ||
3280 | 264 | # configured tree to be moved without reconfiguration. | ||
3281 | 265 | |||
3282 | 266 | AC_DEFUN([AM_AUX_DIR_EXPAND], | ||
3283 | 267 | [dnl Rely on autoconf to set up CDPATH properly. | ||
3284 | 268 | AC_PREREQ([2.50])dnl | ||
3285 | 269 | # expand $ac_aux_dir to an absolute path | ||
3286 | 270 | am_aux_dir=`cd $ac_aux_dir && pwd` | ||
3287 | 271 | ]) | ||
3288 | 272 | |||
3289 | 273 | # AM_CONDITIONAL -*- Autoconf -*- | ||
3290 | 274 | |||
3291 | 275 | # Copyright (C) 1997-2012 Free Software Foundation, Inc. | ||
3292 | 276 | # | ||
3293 | 277 | # This file is free software; the Free Software Foundation | ||
3294 | 278 | # gives unlimited permission to copy and/or distribute it, | ||
3295 | 279 | # with or without modifications, as long as this notice is preserved. | ||
3296 | 280 | |||
3297 | 281 | # serial 10 | ||
3298 | 282 | |||
3299 | 283 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) | ||
3300 | 284 | # ------------------------------------- | ||
3301 | 285 | # Define a conditional. | ||
3302 | 286 | AC_DEFUN([AM_CONDITIONAL], | ||
3303 | 287 | [AC_PREREQ([2.52])dnl | ||
3304 | 288 | m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], | ||
3305 | 289 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl | ||
3306 | 290 | AC_SUBST([$1_TRUE])dnl | ||
3307 | 291 | AC_SUBST([$1_FALSE])dnl | ||
3308 | 292 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl | ||
3309 | 293 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl | ||
3310 | 294 | m4_define([_AM_COND_VALUE_$1], [$2])dnl | ||
3311 | 295 | if $2; then | ||
3312 | 296 | $1_TRUE= | ||
3313 | 297 | $1_FALSE='#' | ||
3314 | 298 | else | ||
3315 | 299 | $1_TRUE='#' | ||
3316 | 300 | $1_FALSE= | ||
3317 | 301 | fi | ||
3318 | 302 | AC_CONFIG_COMMANDS_PRE( | ||
3319 | 303 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then | ||
3320 | 304 | AC_MSG_ERROR([[conditional "$1" was never defined. | ||
3321 | 305 | Usually this means the macro was only invoked conditionally.]]) | ||
3322 | 306 | fi])]) | ||
3323 | 307 | |||
3324 | 308 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | ||
3325 | 309 | # | ||
3326 | 310 | # This file is free software; the Free Software Foundation | ||
3327 | 311 | # gives unlimited permission to copy and/or distribute it, | ||
3328 | 312 | # with or without modifications, as long as this notice is preserved. | ||
3329 | 313 | |||
3330 | 314 | # serial 17 | ||
3331 | 315 | |||
3332 | 316 | # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be | ||
3333 | 317 | # written in clear, in which case automake, when reading aclocal.m4, | ||
3334 | 318 | # will think it sees a *use*, and therefore will trigger all it's | ||
3335 | 319 | # C support machinery. Also note that it means that autoscan, seeing | ||
3336 | 320 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... | ||
3337 | 321 | |||
3338 | 322 | |||
3339 | 323 | # _AM_DEPENDENCIES(NAME) | ||
3340 | 324 | # ---------------------- | ||
3341 | 325 | # See how the compiler implements dependency checking. | ||
3342 | 326 | # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". | ||
3343 | 327 | # We try a few techniques and use that to set a single cache variable. | ||
3344 | 328 | # | ||
3345 | 329 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was | ||
3346 | 330 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular | ||
3347 | 331 | # dependency, and given that the user is not expected to run this macro, | ||
3348 | 332 | # just rely on AC_PROG_CC. | ||
3349 | 333 | AC_DEFUN([_AM_DEPENDENCIES], | ||
3350 | 334 | [AC_REQUIRE([AM_SET_DEPDIR])dnl | ||
3351 | 335 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl | ||
3352 | 336 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl | ||
3353 | 337 | AC_REQUIRE([AM_DEP_TRACK])dnl | ||
3354 | 338 | |||
3355 | 339 | m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], | ||
3356 | 340 | [$1], [CXX], [depcc="$CXX" am_compiler_list=], | ||
3357 | 341 | [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], | ||
3358 | 342 | [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], | ||
3359 | 343 | [$1], [UPC], [depcc="$UPC" am_compiler_list=], | ||
3360 | 344 | [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], | ||
3361 | 345 | [depcc="$$1" am_compiler_list=]) | ||
3362 | 346 | |||
3363 | 347 | AC_CACHE_CHECK([dependency style of $depcc], | ||
3364 | 348 | [am_cv_$1_dependencies_compiler_type], | ||
3365 | 349 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then | ||
3366 | 350 | # We make a subdir and do the tests there. Otherwise we can end up | ||
3367 | 351 | # making bogus files that we don't know about and never remove. For | ||
3368 | 352 | # instance it was reported that on HP-UX the gcc test will end up | ||
3369 | 353 | # making a dummy file named 'D' -- because '-MD' means "put the output | ||
3370 | 354 | # in D". | ||
3371 | 355 | rm -rf conftest.dir | ||
3372 | 356 | mkdir conftest.dir | ||
3373 | 357 | # Copy depcomp to subdir because otherwise we won't find it if we're | ||
3374 | 358 | # using a relative directory. | ||
3375 | 359 | cp "$am_depcomp" conftest.dir | ||
3376 | 360 | cd conftest.dir | ||
3377 | 361 | # We will build objects and dependencies in a subdirectory because | ||
3378 | 362 | # it helps to detect inapplicable dependency modes. For instance | ||
3379 | 363 | # both Tru64's cc and ICC support -MD to output dependencies as a | ||
3380 | 364 | # side effect of compilation, but ICC will put the dependencies in | ||
3381 | 365 | # the current directory while Tru64 will put them in the object | ||
3382 | 366 | # directory. | ||
3383 | 367 | mkdir sub | ||
3384 | 368 | |||
3385 | 369 | am_cv_$1_dependencies_compiler_type=none | ||
3386 | 370 | if test "$am_compiler_list" = ""; then | ||
3387 | 371 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` | ||
3388 | 372 | fi | ||
3389 | 373 | am__universal=false | ||
3390 | 374 | m4_case([$1], [CC], | ||
3391 | 375 | [case " $depcc " in #( | ||
3392 | 376 | *\ -arch\ *\ -arch\ *) am__universal=true ;; | ||
3393 | 377 | esac], | ||
3394 | 378 | [CXX], | ||
3395 | 379 | [case " $depcc " in #( | ||
3396 | 380 | *\ -arch\ *\ -arch\ *) am__universal=true ;; | ||
3397 | 381 | esac]) | ||
3398 | 382 | |||
3399 | 383 | for depmode in $am_compiler_list; do | ||
3400 | 384 | # Setup a source with many dependencies, because some compilers | ||
3401 | 385 | # like to wrap large dependency lists on column 80 (with \), and | ||
3402 | 386 | # we should not choose a depcomp mode which is confused by this. | ||
3403 | 387 | # | ||
3404 | 388 | # We need to recreate these files for each test, as the compiler may | ||
3405 | 389 | # overwrite some of them when testing with obscure command lines. | ||
3406 | 390 | # This happens at least with the AIX C compiler. | ||
3407 | 391 | : > sub/conftest.c | ||
3408 | 392 | for i in 1 2 3 4 5 6; do | ||
3409 | 393 | echo '#include "conftst'$i'.h"' >> sub/conftest.c | ||
3410 | 394 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with | ||
3411 | 395 | # Solaris 10 /bin/sh. | ||
3412 | 396 | echo '/* dummy */' > sub/conftst$i.h | ||
3413 | 397 | done | ||
3414 | 398 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf | ||
3415 | 399 | |||
3416 | 400 | # We check with '-c' and '-o' for the sake of the "dashmstdout" | ||
3417 | 401 | # mode. It turns out that the SunPro C++ compiler does not properly | ||
3418 | 402 | # handle '-M -o', and we need to detect this. Also, some Intel | ||
3419 | 403 | # versions had trouble with output in subdirs. | ||
3420 | 404 | am__obj=sub/conftest.${OBJEXT-o} | ||
3421 | 405 | am__minus_obj="-o $am__obj" | ||
3422 | 406 | case $depmode in | ||
3423 | 407 | gcc) | ||
3424 | 408 | # This depmode causes a compiler race in universal mode. | ||
3425 | 409 | test "$am__universal" = false || continue | ||
3426 | 410 | ;; | ||
3427 | 411 | nosideeffect) | ||
3428 | 412 | # After this tag, mechanisms are not by side-effect, so they'll | ||
3429 | 413 | # only be used when explicitly requested. | ||
3430 | 414 | if test "x$enable_dependency_tracking" = xyes; then | ||
3431 | 415 | continue | ||
3432 | 416 | else | ||
3433 | 417 | break | ||
3434 | 418 | fi | ||
3435 | 419 | ;; | ||
3436 | 420 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) | ||
3437 | 421 | # This compiler won't grok '-c -o', but also, the minuso test has | ||
3438 | 422 | # not run yet. These depmodes are late enough in the game, and | ||
3439 | 423 | # so weak that their functioning should not be impacted. | ||
3440 | 424 | am__obj=conftest.${OBJEXT-o} | ||
3441 | 425 | am__minus_obj= | ||
3442 | 426 | ;; | ||
3443 | 427 | none) break ;; | ||
3444 | 428 | esac | ||
3445 | 429 | if depmode=$depmode \ | ||
3446 | 430 | source=sub/conftest.c object=$am__obj \ | ||
3447 | 431 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ | ||
3448 | 432 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ | ||
3449 | 433 | >/dev/null 2>conftest.err && | ||
3450 | 434 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && | ||
3451 | 435 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && | ||
3452 | 436 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && | ||
3453 | 437 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then | ||
3454 | 438 | # icc doesn't choke on unknown options, it will just issue warnings | ||
3455 | 439 | # or remarks (even with -Werror). So we grep stderr for any message | ||
3456 | 440 | # that says an option was ignored or not supported. | ||
3457 | 441 | # When given -MP, icc 7.0 and 7.1 complain thusly: | ||
3458 | 442 | # icc: Command line warning: ignoring option '-M'; no argument required | ||
3459 | 443 | # The diagnosis changed in icc 8.0: | ||
3460 | 444 | # icc: Command line remark: option '-MP' not supported | ||
3461 | 445 | if (grep 'ignoring option' conftest.err || | ||
3462 | 446 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else | ||
3463 | 447 | am_cv_$1_dependencies_compiler_type=$depmode | ||
3464 | 448 | break | ||
3465 | 449 | fi | ||
3466 | 450 | fi | ||
3467 | 451 | done | ||
3468 | 452 | |||
3469 | 453 | cd .. | ||
3470 | 454 | rm -rf conftest.dir | ||
3471 | 455 | else | ||
3472 | 456 | am_cv_$1_dependencies_compiler_type=none | ||
3473 | 457 | fi | ||
3474 | 458 | ]) | ||
3475 | 459 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) | ||
3476 | 460 | AM_CONDITIONAL([am__fastdep$1], [ | ||
3477 | 461 | test "x$enable_dependency_tracking" != xno \ | ||
3478 | 462 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) | ||
3479 | 463 | ]) | ||
3480 | 464 | |||
3481 | 465 | |||
3482 | 466 | # AM_SET_DEPDIR | ||
3483 | 467 | # ------------- | ||
3484 | 468 | # Choose a directory name for dependency files. | ||
3485 | 469 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES. | ||
3486 | 470 | AC_DEFUN([AM_SET_DEPDIR], | ||
3487 | 471 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl | ||
3488 | 472 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl | ||
3489 | 473 | ]) | ||
3490 | 474 | |||
3491 | 475 | |||
3492 | 476 | # AM_DEP_TRACK | ||
3493 | 477 | # ------------ | ||
3494 | 478 | AC_DEFUN([AM_DEP_TRACK], | ||
3495 | 479 | [AC_ARG_ENABLE([dependency-tracking], [dnl | ||
3496 | 480 | AS_HELP_STRING( | ||
3497 | 481 | [--enable-dependency-tracking], | ||
3498 | 482 | [do not reject slow dependency extractors]) | ||
3499 | 483 | AS_HELP_STRING( | ||
3500 | 484 | [--disable-dependency-tracking], | ||
3501 | 485 | [speeds up one-time build])]) | ||
3502 | 486 | if test "x$enable_dependency_tracking" != xno; then | ||
3503 | 487 | am_depcomp="$ac_aux_dir/depcomp" | ||
3504 | 488 | AMDEPBACKSLASH='\' | ||
3505 | 489 | am__nodep='_no' | ||
3506 | 490 | fi | ||
3507 | 491 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) | ||
3508 | 492 | AC_SUBST([AMDEPBACKSLASH])dnl | ||
3509 | 493 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl | ||
3510 | 494 | AC_SUBST([am__nodep])dnl | ||
3511 | 495 | _AM_SUBST_NOTMAKE([am__nodep])dnl | ||
3512 | 496 | ]) | ||
3513 | 497 | |||
3514 | 498 | # Generate code to set up dependency tracking. -*- Autoconf -*- | ||
3515 | 499 | |||
3516 | 500 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | ||
3517 | 501 | # | ||
3518 | 502 | # This file is free software; the Free Software Foundation | ||
3519 | 503 | # gives unlimited permission to copy and/or distribute it, | ||
3520 | 504 | # with or without modifications, as long as this notice is preserved. | ||
3521 | 505 | |||
3522 | 506 | # serial 6 | ||
3523 | 507 | |||
3524 | 508 | # _AM_OUTPUT_DEPENDENCY_COMMANDS | ||
3525 | 509 | # ------------------------------ | ||
3526 | 510 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], | ||
3527 | 511 | [{ | ||
3528 | 512 | # Autoconf 2.62 quotes --file arguments for eval, but not when files | ||
3529 | 513 | # are listed without --file. Let's play safe and only enable the eval | ||
3530 | 514 | # if we detect the quoting. | ||
3531 | 515 | case $CONFIG_FILES in | ||
3532 | 516 | *\'*) eval set x "$CONFIG_FILES" ;; | ||
3533 | 517 | *) set x $CONFIG_FILES ;; | ||
3534 | 518 | esac | ||
3535 | 519 | shift | ||
3536 | 520 | for mf | ||
3537 | 521 | do | ||
3538 | 522 | # Strip MF so we end up with the name of the file. | ||
3539 | 523 | mf=`echo "$mf" | sed -e 's/:.*$//'` | ||
3540 | 524 | # Check whether this is an Automake generated Makefile or not. | ||
3541 | 525 | # We used to match only the files named 'Makefile.in', but | ||
3542 | 526 | # some people rename them; so instead we look at the file content. | ||
3543 | 527 | # Grep'ing the first line is not enough: some people post-process | ||
3544 | 528 | # each Makefile.in and add a new line on top of each file to say so. | ||
3545 | 529 | # Grep'ing the whole file is not good either: AIX grep has a line | ||
3546 | 530 | # limit of 2048, but all sed's we know have understand at least 4000. | ||
3547 | 531 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | ||
3548 | 532 | dirpart=`AS_DIRNAME("$mf")` | ||
3549 | 533 | else | ||
3550 | 534 | continue | ||
3551 | 535 | fi | ||
3552 | 536 | # Extract the definition of DEPDIR, am__include, and am__quote | ||
3553 | 537 | # from the Makefile without running 'make'. | ||
3554 | 538 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` | ||
3555 | 539 | test -z "$DEPDIR" && continue | ||
3556 | 540 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | ||
3557 | 541 | test -z "am__include" && continue | ||
3558 | 542 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` | ||
3559 | 543 | # Find all dependency output files, they are included files with | ||
3560 | 544 | # $(DEPDIR) in their names. We invoke sed twice because it is the | ||
3561 | 545 | # simplest approach to changing $(DEPDIR) to its actual value in the | ||
3562 | 546 | # expansion. | ||
3563 | 547 | for file in `sed -n " | ||
3564 | 548 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | ||
3565 | 549 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do | ||
3566 | 550 | # Make sure the directory exists. | ||
3567 | 551 | test -f "$dirpart/$file" && continue | ||
3568 | 552 | fdir=`AS_DIRNAME(["$file"])` | ||
3569 | 553 | AS_MKDIR_P([$dirpart/$fdir]) | ||
3570 | 554 | # echo "creating $dirpart/$file" | ||
3571 | 555 | echo '# dummy' > "$dirpart/$file" | ||
3572 | 556 | done | ||
3573 | 557 | done | ||
3574 | 558 | } | ||
3575 | 559 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS | ||
3576 | 560 | |||
3577 | 561 | |||
3578 | 562 | # AM_OUTPUT_DEPENDENCY_COMMANDS | ||
3579 | 563 | # ----------------------------- | ||
3580 | 564 | # This macro should only be invoked once -- use via AC_REQUIRE. | ||
3581 | 565 | # | ||
3582 | 566 | # This code is only required when automatic dependency tracking | ||
3583 | 567 | # is enabled. FIXME. This creates each '.P' file that we will | ||
3584 | 568 | # need in order to bootstrap the dependency handling code. | ||
3585 | 569 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], | ||
3586 | 570 | [AC_CONFIG_COMMANDS([depfiles], | ||
3587 | 571 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], | ||
3588 | 572 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) | ||
3589 | 573 | ]) | ||
3590 | 574 | |||
3591 | 575 | # Do all the work for Automake. -*- Autoconf -*- | ||
3592 | 576 | |||
3593 | 577 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | ||
3594 | 578 | # | ||
3595 | 579 | # This file is free software; the Free Software Foundation | ||
3596 | 580 | # gives unlimited permission to copy and/or distribute it, | ||
3597 | 581 | # with or without modifications, as long as this notice is preserved. | ||
3598 | 582 | |||
3599 | 583 | # serial 19 | ||
3600 | 584 | |||
3601 | 585 | # This macro actually does too much. Some checks are only needed if | ||
3602 | 586 | # your package does certain things. But this isn't really a big deal. | ||
3603 | 587 | |||
3604 | 588 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) | ||
3605 | 589 | # AM_INIT_AUTOMAKE([OPTIONS]) | ||
3606 | 590 | # ----------------------------------------------- | ||
3607 | 591 | # The call with PACKAGE and VERSION arguments is the old style | ||
3608 | 592 | # call (pre autoconf-2.50), which is being phased out. PACKAGE | ||
3609 | 593 | # and VERSION should now be passed to AC_INIT and removed from | ||
3610 | 594 | # the call to AM_INIT_AUTOMAKE. | ||
3611 | 595 | # We support both call styles for the transition. After | ||
3612 | 596 | # the next Automake release, Autoconf can make the AC_INIT | ||
3613 | 597 | # arguments mandatory, and then we can depend on a new Autoconf | ||
3614 | 598 | # release and drop the old call support. | ||
3615 | 599 | AC_DEFUN([AM_INIT_AUTOMAKE], | ||
3616 | 600 | [AC_PREREQ([2.62])dnl | ||
3617 | 601 | dnl Autoconf wants to disallow AM_ names. We explicitly allow | ||
3618 | 602 | dnl the ones we care about. | ||
3619 | 603 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl | ||
3620 | 604 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl | ||
3621 | 605 | AC_REQUIRE([AC_PROG_INSTALL])dnl | ||
3622 | 606 | if test "`cd $srcdir && pwd`" != "`pwd`"; then | ||
3623 | 607 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output | ||
3624 | 608 | # is not polluted with repeated "-I." | ||
3625 | 609 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl | ||
3626 | 610 | # test to see if srcdir already configured | ||
3627 | 611 | if test -f $srcdir/config.status; then | ||
3628 | 612 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | ||
3629 | 613 | fi | ||
3630 | 614 | fi | ||
3631 | 615 | |||
3632 | 616 | # test whether we have cygpath | ||
3633 | 617 | if test -z "$CYGPATH_W"; then | ||
3634 | 618 | if (cygpath --version) >/dev/null 2>/dev/null; then | ||
3635 | 619 | CYGPATH_W='cygpath -w' | ||
3636 | 620 | else | ||
3637 | 621 | CYGPATH_W=echo | ||
3638 | 622 | fi | ||
3639 | 623 | fi | ||
3640 | 624 | AC_SUBST([CYGPATH_W]) | ||
3641 | 625 | |||
3642 | 626 | # Define the identity of the package. | ||
3643 | 627 | dnl Distinguish between old-style and new-style calls. | ||
3644 | 628 | m4_ifval([$2], | ||
3645 | 629 | [AC_DIAGNOSE([obsolete], | ||
3646 | 630 | [$0: two- and three-arguments forms are deprecated. For more info, see: | ||
3647 | 631 | http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) | ||
3648 | 632 | m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl | ||
3649 | 633 | AC_SUBST([PACKAGE], [$1])dnl | ||
3650 | 634 | AC_SUBST([VERSION], [$2])], | ||
3651 | 635 | [_AM_SET_OPTIONS([$1])dnl | ||
3652 | 636 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. | ||
3653 | 637 | m4_if( | ||
3654 | 638 | m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), | ||
3655 | 639 | [ok:ok],, | ||
3656 | 640 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl | ||
3657 | 641 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl | ||
3658 | 642 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl | ||
3659 | 643 | |||
3660 | 644 | _AM_IF_OPTION([no-define],, | ||
3661 | 645 | [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) | ||
3662 | 646 | AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl | ||
3663 | 647 | |||
3664 | 648 | # Some tools Automake needs. | ||
3665 | 649 | AC_REQUIRE([AM_SANITY_CHECK])dnl | ||
3666 | 650 | AC_REQUIRE([AC_ARG_PROGRAM])dnl | ||
3667 | 651 | AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) | ||
3668 | 652 | AM_MISSING_PROG([AUTOCONF], [autoconf]) | ||
3669 | 653 | AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) | ||
3670 | 654 | AM_MISSING_PROG([AUTOHEADER], [autoheader]) | ||
3671 | 655 | AM_MISSING_PROG([MAKEINFO], [makeinfo]) | ||
3672 | 656 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl | ||
3673 | 657 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl | ||
3674 | 658 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl | ||
3675 | 659 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl | ||
3676 | 660 | # We need awk for the "check" target. The system "awk" is bad on | ||
3677 | 661 | # some platforms. | ||
3678 | 662 | AC_REQUIRE([AC_PROG_AWK])dnl | ||
3679 | 663 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl | ||
3680 | 664 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl | ||
3681 | 665 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], | ||
3682 | 666 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], | ||
3683 | 667 | [_AM_PROG_TAR([v7])])]) | ||
3684 | 668 | _AM_IF_OPTION([no-dependencies],, | ||
3685 | 669 | [AC_PROVIDE_IFELSE([AC_PROG_CC], | ||
3686 | 670 | [_AM_DEPENDENCIES([CC])], | ||
3687 | 671 | [m4_define([AC_PROG_CC], | ||
3688 | 672 | m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl | ||
3689 | 673 | AC_PROVIDE_IFELSE([AC_PROG_CXX], | ||
3690 | 674 | [_AM_DEPENDENCIES([CXX])], | ||
3691 | 675 | [m4_define([AC_PROG_CXX], | ||
3692 | 676 | m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl | ||
3693 | 677 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], | ||
3694 | 678 | [_AM_DEPENDENCIES([OBJC])], | ||
3695 | 679 | [m4_define([AC_PROG_OBJC], | ||
3696 | 680 | m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl | ||
3697 | 681 | dnl Support for Objective C++ was only introduced in Autoconf 2.65, | ||
3698 | 682 | dnl but we still cater to Autoconf 2.62. | ||
3699 | 683 | m4_ifdef([AC_PROG_OBJCXX], | ||
3700 | 684 | [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], | ||
3701 | 685 | [_AM_DEPENDENCIES([OBJCXX])], | ||
3702 | 686 | [m4_define([AC_PROG_OBJCXX], | ||
3703 | 687 | m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl | ||
3704 | 688 | ]) | ||
3705 | 689 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl | ||
3706 | 690 | dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the | ||
3707 | 691 | dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro | ||
3708 | 692 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. | ||
3709 | 693 | AC_CONFIG_COMMANDS_PRE(dnl | ||
3710 | 694 | [m4_provide_if([_AM_COMPILER_EXEEXT], | ||
3711 | 695 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl | ||
3712 | 696 | ]) | ||
3713 | 697 | |||
3714 | 698 | dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not | ||
3715 | 699 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further | ||
3716 | 700 | dnl mangled by Autoconf and run in a shell conditional statement. | ||
3717 | 701 | m4_define([_AC_COMPILER_EXEEXT], | ||
3718 | 702 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) | ||
3719 | 703 | |||
3720 | 704 | |||
3721 | 705 | # When config.status generates a header, we must update the stamp-h file. | ||
3722 | 706 | # This file resides in the same directory as the config header | ||
3723 | 707 | # that is generated. The stamp files are numbered to have different names. | ||
3724 | 708 | |||
3725 | 709 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the | ||
3726 | 710 | # loop where config.status creates the headers, so we can generate | ||
3727 | 711 | # our stamp files there. | ||
3728 | 712 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], | ||
3729 | 713 | [# Compute $1's index in $config_headers. | ||
3730 | 714 | _am_arg=$1 | ||
3731 | 715 | _am_stamp_count=1 | ||
3732 | 716 | for _am_header in $config_headers :; do | ||
3733 | 717 | case $_am_header in | ||
3734 | 718 | $_am_arg | $_am_arg:* ) | ||
3735 | 719 | break ;; | ||
3736 | 720 | * ) | ||
3737 | 721 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; | ||
3738 | 722 | esac | ||
3739 | 723 | done | ||
3740 | 724 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) | ||
3741 | 725 | |||
3742 | 726 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
3743 | 727 | # | ||
3744 | 728 | # This file is free software; the Free Software Foundation | ||
3745 | 729 | # gives unlimited permission to copy and/or distribute it, | ||
3746 | 730 | # with or without modifications, as long as this notice is preserved. | ||
3747 | 731 | |||
3748 | 732 | # serial 8 | ||
3749 | 733 | |||
3750 | 734 | # AM_PROG_INSTALL_SH | ||
3751 | 735 | # ------------------ | ||
3752 | 736 | # Define $install_sh. | ||
3753 | 737 | AC_DEFUN([AM_PROG_INSTALL_SH], | ||
3754 | 738 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl | ||
3755 | 739 | if test x"${install_sh}" != xset; then | ||
3756 | 740 | case $am_aux_dir in | ||
3757 | 741 | *\ * | *\ *) | ||
3758 | 742 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; | ||
3759 | 743 | *) | ||
3760 | 744 | install_sh="\${SHELL} $am_aux_dir/install-sh" | ||
3761 | 745 | esac | ||
3762 | 746 | fi | ||
3763 | 747 | AC_SUBST([install_sh])]) | ||
3764 | 748 | |||
3765 | 749 | # Copyright (C) 2003-2012 Free Software Foundation, Inc. | ||
3766 | 750 | # | ||
3767 | 751 | # This file is free software; the Free Software Foundation | ||
3768 | 752 | # gives unlimited permission to copy and/or distribute it, | ||
3769 | 753 | # with or without modifications, as long as this notice is preserved. | ||
3770 | 754 | |||
3771 | 755 | # serial 2 | ||
3772 | 756 | |||
3773 | 757 | # Check whether the underlying file-system supports filenames | ||
3774 | 758 | # with a leading dot. For instance MS-DOS doesn't. | ||
3775 | 759 | AC_DEFUN([AM_SET_LEADING_DOT], | ||
3776 | 760 | [rm -rf .tst 2>/dev/null | ||
3777 | 761 | mkdir .tst 2>/dev/null | ||
3778 | 762 | if test -d .tst; then | ||
3779 | 763 | am__leading_dot=. | ||
3780 | 764 | else | ||
3781 | 765 | am__leading_dot=_ | ||
3782 | 766 | fi | ||
3783 | 767 | rmdir .tst 2>/dev/null | ||
3784 | 768 | AC_SUBST([am__leading_dot])]) | ||
3785 | 769 | |||
3786 | 770 | # Check to see how 'make' treats includes. -*- Autoconf -*- | ||
3787 | 771 | |||
3788 | 772 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
3789 | 773 | # | ||
3790 | 774 | # This file is free software; the Free Software Foundation | ||
3791 | 775 | # gives unlimited permission to copy and/or distribute it, | ||
3792 | 776 | # with or without modifications, as long as this notice is preserved. | ||
3793 | 777 | |||
3794 | 778 | # serial 5 | ||
3795 | 779 | |||
3796 | 780 | # AM_MAKE_INCLUDE() | ||
3797 | 781 | # ----------------- | ||
3798 | 782 | # Check to see how make treats includes. | ||
3799 | 783 | AC_DEFUN([AM_MAKE_INCLUDE], | ||
3800 | 784 | [am_make=${MAKE-make} | ||
3801 | 785 | cat > confinc << 'END' | ||
3802 | 786 | am__doit: | ||
3803 | 787 | @echo this is the am__doit target | ||
3804 | 788 | .PHONY: am__doit | ||
3805 | 789 | END | ||
3806 | 790 | # If we don't find an include directive, just comment out the code. | ||
3807 | 791 | AC_MSG_CHECKING([for style of include used by $am_make]) | ||
3808 | 792 | am__include="#" | ||
3809 | 793 | am__quote= | ||
3810 | 794 | _am_result=none | ||
3811 | 795 | # First try GNU make style include. | ||
3812 | 796 | echo "include confinc" > confmf | ||
3813 | 797 | # Ignore all kinds of additional output from 'make'. | ||
3814 | 798 | case `$am_make -s -f confmf 2> /dev/null` in #( | ||
3815 | 799 | *the\ am__doit\ target*) | ||
3816 | 800 | am__include=include | ||
3817 | 801 | am__quote= | ||
3818 | 802 | _am_result=GNU | ||
3819 | 803 | ;; | ||
3820 | 804 | esac | ||
3821 | 805 | # Now try BSD make style include. | ||
3822 | 806 | if test "$am__include" = "#"; then | ||
3823 | 807 | echo '.include "confinc"' > confmf | ||
3824 | 808 | case `$am_make -s -f confmf 2> /dev/null` in #( | ||
3825 | 809 | *the\ am__doit\ target*) | ||
3826 | 810 | am__include=.include | ||
3827 | 811 | am__quote="\"" | ||
3828 | 812 | _am_result=BSD | ||
3829 | 813 | ;; | ||
3830 | 814 | esac | ||
3831 | 815 | fi | ||
3832 | 816 | AC_SUBST([am__include]) | ||
3833 | 817 | AC_SUBST([am__quote]) | ||
3834 | 818 | AC_MSG_RESULT([$_am_result]) | ||
3835 | 819 | rm -f confinc confmf | ||
3836 | 820 | ]) | ||
3837 | 821 | |||
3838 | 822 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | ||
3839 | 823 | # | ||
3840 | 824 | # This file is free software; the Free Software Foundation | ||
3841 | 825 | # gives unlimited permission to copy and/or distribute it, | ||
3842 | 826 | # with or without modifications, as long as this notice is preserved. | ||
3843 | 827 | |||
3844 | 828 | # serial 6 | ||
3845 | 829 | |||
3846 | 830 | # AM_PROG_CC_C_O | ||
3847 | 831 | # -------------- | ||
3848 | 832 | # Like AC_PROG_CC_C_O, but changed for automake. | ||
3849 | 833 | AC_DEFUN([AM_PROG_CC_C_O], | ||
3850 | 834 | [AC_REQUIRE([AC_PROG_CC_C_O])dnl | ||
3851 | 835 | AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl | ||
3852 | 836 | AC_REQUIRE_AUX_FILE([compile])dnl | ||
3853 | 837 | # FIXME: we rely on the cache variable name because | ||
3854 | 838 | # there is no other way. | ||
3855 | 839 | set dummy $CC | ||
3856 | 840 | am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` | ||
3857 | 841 | eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o | ||
3858 | 842 | if test "$am_t" != yes; then | ||
3859 | 843 | # Losing compiler, so override with the script. | ||
3860 | 844 | # FIXME: It is wrong to rewrite CC. | ||
3861 | 845 | # But if we don't then we get into trouble of one sort or another. | ||
3862 | 846 | # A longer-term fix would be to have automake use am__CC in this case, | ||
3863 | 847 | # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" | ||
3864 | 848 | CC="$am_aux_dir/compile $CC" | ||
3865 | 849 | fi | ||
3866 | 850 | dnl Make sure AC_PROG_CC is never called again, or it will override our | ||
3867 | 851 | dnl setting of CC. | ||
3868 | 852 | m4_define([AC_PROG_CC], | ||
3869 | 853 | [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) | ||
3870 | 854 | ]) | ||
3871 | 855 | |||
3872 | 856 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- | ||
3873 | 857 | |||
3874 | 858 | # Copyright (C) 1997-2012 Free Software Foundation, Inc. | ||
3875 | 859 | # | ||
3876 | 860 | # This file is free software; the Free Software Foundation | ||
3877 | 861 | # gives unlimited permission to copy and/or distribute it, | ||
3878 | 862 | # with or without modifications, as long as this notice is preserved. | ||
3879 | 863 | |||
3880 | 864 | # serial 7 | ||
3881 | 865 | |||
3882 | 866 | # AM_MISSING_PROG(NAME, PROGRAM) | ||
3883 | 867 | # ------------------------------ | ||
3884 | 868 | AC_DEFUN([AM_MISSING_PROG], | ||
3885 | 869 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) | ||
3886 | 870 | $1=${$1-"${am_missing_run}$2"} | ||
3887 | 871 | AC_SUBST($1)]) | ||
3888 | 872 | |||
3889 | 873 | |||
3890 | 874 | # AM_MISSING_HAS_RUN | ||
3891 | 875 | # ------------------ | ||
3892 | 876 | # Define MISSING if not defined so far and test if it supports --run. | ||
3893 | 877 | # If it does, set am_missing_run to use it, otherwise, to nothing. | ||
3894 | 878 | AC_DEFUN([AM_MISSING_HAS_RUN], | ||
3895 | 879 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl | ||
3896 | 880 | AC_REQUIRE_AUX_FILE([missing])dnl | ||
3897 | 881 | if test x"${MISSING+set}" != xset; then | ||
3898 | 882 | case $am_aux_dir in | ||
3899 | 883 | *\ * | *\ *) | ||
3900 | 884 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | ||
3901 | 885 | *) | ||
3902 | 886 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | ||
3903 | 887 | esac | ||
3904 | 888 | fi | ||
3905 | 889 | # Use eval to expand $SHELL | ||
3906 | 890 | if eval "$MISSING --run true"; then | ||
3907 | 891 | am_missing_run="$MISSING --run " | ||
3908 | 892 | else | ||
3909 | 893 | am_missing_run= | ||
3910 | 894 | AC_MSG_WARN(['missing' script is too old or missing]) | ||
3911 | 895 | fi | ||
3912 | 896 | ]) | ||
3913 | 897 | |||
3914 | 898 | # Helper functions for option handling. -*- Autoconf -*- | ||
3915 | 899 | |||
3916 | 900 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
3917 | 901 | # | ||
3918 | 902 | # This file is free software; the Free Software Foundation | ||
3919 | 903 | # gives unlimited permission to copy and/or distribute it, | ||
3920 | 904 | # with or without modifications, as long as this notice is preserved. | ||
3921 | 905 | |||
3922 | 906 | # serial 6 | ||
3923 | 907 | |||
3924 | 908 | # _AM_MANGLE_OPTION(NAME) | ||
3925 | 909 | # ----------------------- | ||
3926 | 910 | AC_DEFUN([_AM_MANGLE_OPTION], | ||
3927 | 911 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) | ||
3928 | 912 | |||
3929 | 913 | # _AM_SET_OPTION(NAME) | ||
3930 | 914 | # -------------------- | ||
3931 | 915 | # Set option NAME. Presently that only means defining a flag for this option. | ||
3932 | 916 | AC_DEFUN([_AM_SET_OPTION], | ||
3933 | 917 | [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) | ||
3934 | 918 | |||
3935 | 919 | # _AM_SET_OPTIONS(OPTIONS) | ||
3936 | 920 | # ------------------------ | ||
3937 | 921 | # OPTIONS is a space-separated list of Automake options. | ||
3938 | 922 | AC_DEFUN([_AM_SET_OPTIONS], | ||
3939 | 923 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) | ||
3940 | 924 | |||
3941 | 925 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) | ||
3942 | 926 | # ------------------------------------------- | ||
3943 | 927 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. | ||
3944 | 928 | AC_DEFUN([_AM_IF_OPTION], | ||
3945 | 929 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) | ||
3946 | 930 | |||
3947 | 931 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | ||
3948 | 932 | # | ||
3949 | 933 | # This file is free software; the Free Software Foundation | ||
3950 | 934 | # gives unlimited permission to copy and/or distribute it, | ||
3951 | 935 | # with or without modifications, as long as this notice is preserved. | ||
3952 | 936 | |||
3953 | 937 | # serial 9 | ||
3954 | 938 | |||
3955 | 939 | # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | ||
3956 | 940 | # --------------------------------------------------------------------------- | ||
3957 | 941 | # Adds support for distributing Python modules and packages. To | ||
3958 | 942 | # install modules, copy them to $(pythondir), using the python_PYTHON | ||
3959 | 943 | # automake variable. To install a package with the same name as the | ||
3960 | 944 | # automake package, install to $(pkgpythondir), or use the | ||
3961 | 945 | # pkgpython_PYTHON automake variable. | ||
3962 | 946 | # | ||
3963 | 947 | # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as | ||
3964 | 948 | # locations to install python extension modules (shared libraries). | ||
3965 | 949 | # Another macro is required to find the appropriate flags to compile | ||
3966 | 950 | # extension modules. | ||
3967 | 951 | # | ||
3968 | 952 | # If your package is configured with a different prefix to python, | ||
3969 | 953 | # users will have to add the install directory to the PYTHONPATH | ||
3970 | 954 | # environment variable, or create a .pth file (see the python | ||
3971 | 955 | # documentation for details). | ||
3972 | 956 | # | ||
3973 | 957 | # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will | ||
3974 | 958 | # cause an error if the version of python installed on the system | ||
3975 | 959 | # doesn't meet the requirement. MINIMUM-VERSION should consist of | ||
3976 | 960 | # numbers and dots only. | ||
3977 | 961 | AC_DEFUN([AM_PATH_PYTHON], | ||
3978 | 962 | [ | ||
3979 | 963 | dnl Find a Python interpreter. Python versions prior to 2.0 are not | ||
3980 | 964 | dnl supported. (2.0 was released on October 16, 2000). | ||
3981 | 965 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST], | ||
3982 | 966 | [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl | ||
3983 | 967 | python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) | ||
3984 | 968 | |||
3985 | 969 | AC_ARG_VAR([PYTHON], [the Python interpreter]) | ||
3986 | 970 | |||
3987 | 971 | m4_if([$1],[],[ | ||
3988 | 972 | dnl No version check is needed. | ||
3989 | 973 | # Find any Python interpreter. | ||
3990 | 974 | if test -z "$PYTHON"; then | ||
3991 | 975 | AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) | ||
3992 | 976 | fi | ||
3993 | 977 | am_display_PYTHON=python | ||
3994 | 978 | ], [ | ||
3995 | 979 | dnl A version check is needed. | ||
3996 | 980 | if test -n "$PYTHON"; then | ||
3997 | 981 | # If the user set $PYTHON, use it and don't search something else. | ||
3998 | 982 | AC_MSG_CHECKING([whether $PYTHON version is >= $1]) | ||
3999 | 983 | AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], | ||
4000 | 984 | [AC_MSG_RESULT([yes])], | ||
4001 | 985 | [AC_MSG_RESULT([no]) | ||
4002 | 986 | AC_MSG_ERROR([Python interpreter is too old])]) | ||
4003 | 987 | am_display_PYTHON=$PYTHON | ||
4004 | 988 | else | ||
4005 | 989 | # Otherwise, try each interpreter until we find one that satisfies | ||
4006 | 990 | # VERSION. | ||
4007 | 991 | AC_CACHE_CHECK([for a Python interpreter with version >= $1], | ||
4008 | 992 | [am_cv_pathless_PYTHON],[ | ||
4009 | 993 | for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do | ||
4010 | 994 | test "$am_cv_pathless_PYTHON" = none && break | ||
4011 | 995 | AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) | ||
4012 | 996 | done]) | ||
4013 | 997 | # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. | ||
4014 | 998 | if test "$am_cv_pathless_PYTHON" = none; then | ||
4015 | 999 | PYTHON=: | ||
4016 | 1000 | else | ||
4017 | 1001 | AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) | ||
4018 | 1002 | fi | ||
4019 | 1003 | am_display_PYTHON=$am_cv_pathless_PYTHON | ||
4020 | 1004 | fi | ||
4021 | 1005 | ]) | ||
4022 | 1006 | |||
4023 | 1007 | if test "$PYTHON" = :; then | ||
4024 | 1008 | dnl Run any user-specified action, or abort. | ||
4025 | 1009 | m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) | ||
4026 | 1010 | else | ||
4027 | 1011 | |||
4028 | 1012 | dnl Query Python for its version number. Getting [:3] seems to be | ||
4029 | 1013 | dnl the best way to do this; it's what "site.py" does in the standard | ||
4030 | 1014 | dnl library. | ||
4031 | 1015 | |||
4032 | 1016 | AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], | ||
4033 | 1017 | [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) | ||
4034 | 1018 | AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) | ||
4035 | 1019 | |||
4036 | 1020 | dnl Use the values of $prefix and $exec_prefix for the corresponding | ||
4037 | 1021 | dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made | ||
4038 | 1022 | dnl distinct variables so they can be overridden if need be. However, | ||
4039 | 1023 | dnl general consensus is that you shouldn't need this ability. | ||
4040 | 1024 | |||
4041 | 1025 | AC_SUBST([PYTHON_PREFIX], ['${prefix}']) | ||
4042 | 1026 | AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) | ||
4043 | 1027 | |||
4044 | 1028 | dnl At times (like when building shared libraries) you may want | ||
4045 | 1029 | dnl to know which OS platform Python thinks this is. | ||
4046 | 1030 | |||
4047 | 1031 | AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], | ||
4048 | 1032 | [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) | ||
4049 | 1033 | AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) | ||
4050 | 1034 | |||
4051 | 1035 | |||
4052 | 1036 | dnl Set up 4 directories: | ||
4053 | 1037 | |||
4054 | 1038 | dnl pythondir -- where to install python scripts. This is the | ||
4055 | 1039 | dnl site-packages directory, not the python standard library | ||
4056 | 1040 | dnl directory like in previous automake betas. This behavior | ||
4057 | 1041 | dnl is more consistent with lispdir.m4 for example. | ||
4058 | 1042 | dnl Query distutils for this directory. | ||
4059 | 1043 | AC_CACHE_CHECK([for $am_display_PYTHON script directory], | ||
4060 | 1044 | [am_cv_python_pythondir], | ||
4061 | 1045 | [if test "x$prefix" = xNONE | ||
4062 | 1046 | then | ||
4063 | 1047 | am_py_prefix=$ac_default_prefix | ||
4064 | 1048 | else | ||
4065 | 1049 | am_py_prefix=$prefix | ||
4066 | 1050 | fi | ||
4067 | 1051 | am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` | ||
4068 | 1052 | case $am_cv_python_pythondir in | ||
4069 | 1053 | $am_py_prefix*) | ||
4070 | 1054 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` | ||
4071 | 1055 | am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` | ||
4072 | 1056 | ;; | ||
4073 | 1057 | *) | ||
4074 | 1058 | case $am_py_prefix in | ||
4075 | 1059 | /usr|/System*) ;; | ||
4076 | 1060 | *) | ||
4077 | 1061 | am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
4078 | 1062 | ;; | ||
4079 | 1063 | esac | ||
4080 | 1064 | ;; | ||
4081 | 1065 | esac | ||
4082 | 1066 | ]) | ||
4083 | 1067 | AC_SUBST([pythondir], [$am_cv_python_pythondir]) | ||
4084 | 1068 | |||
4085 | 1069 | dnl pkgpythondir -- $PACKAGE directory under pythondir. Was | ||
4086 | 1070 | dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is | ||
4087 | 1071 | dnl more consistent with the rest of automake. | ||
4088 | 1072 | |||
4089 | 1073 | AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) | ||
4090 | 1074 | |||
4091 | 1075 | dnl pyexecdir -- directory for installing python extension modules | ||
4092 | 1076 | dnl (shared libraries) | ||
4093 | 1077 | dnl Query distutils for this directory. | ||
4094 | 1078 | AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], | ||
4095 | 1079 | [am_cv_python_pyexecdir], | ||
4096 | 1080 | [if test "x$exec_prefix" = xNONE | ||
4097 | 1081 | then | ||
4098 | 1082 | am_py_exec_prefix=$am_py_prefix | ||
4099 | 1083 | else | ||
4100 | 1084 | am_py_exec_prefix=$exec_prefix | ||
4101 | 1085 | fi | ||
4102 | 1086 | am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` | ||
4103 | 1087 | case $am_cv_python_pyexecdir in | ||
4104 | 1088 | $am_py_exec_prefix*) | ||
4105 | 1089 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` | ||
4106 | 1090 | am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` | ||
4107 | 1091 | ;; | ||
4108 | 1092 | *) | ||
4109 | 1093 | case $am_py_exec_prefix in | ||
4110 | 1094 | /usr|/System*) ;; | ||
4111 | 1095 | *) | ||
4112 | 1096 | am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
4113 | 1097 | ;; | ||
4114 | 1098 | esac | ||
4115 | 1099 | ;; | ||
4116 | 1100 | esac | ||
4117 | 1101 | ]) | ||
4118 | 1102 | AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) | ||
4119 | 1103 | |||
4120 | 1104 | dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) | ||
4121 | 1105 | |||
4122 | 1106 | AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) | ||
4123 | 1107 | |||
4124 | 1108 | dnl Run any user-specified action. | ||
4125 | 1109 | $2 | ||
4126 | 1110 | fi | ||
4127 | 1111 | |||
4128 | 1112 | ]) | ||
4129 | 1113 | |||
4130 | 1114 | |||
4131 | 1115 | # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) | ||
4132 | 1116 | # --------------------------------------------------------------------------- | ||
4133 | 1117 | # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. | ||
4134 | 1118 | # Run ACTION-IF-FALSE otherwise. | ||
4135 | 1119 | # This test uses sys.hexversion instead of the string equivalent (first | ||
4136 | 1120 | # word of sys.version), in order to cope with versions such as 2.2c1. | ||
4137 | 1121 | # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). | ||
4138 | 1122 | AC_DEFUN([AM_PYTHON_CHECK_VERSION], | ||
4139 | 1123 | [prog="import sys | ||
4140 | 1124 | # split strings by '.' and convert to numeric. Append some zeros | ||
4141 | 1125 | # because we need at least 4 digits for the hex conversion. | ||
4142 | 1126 | # map returns an iterator in Python 3.0 and a list in 2.x | ||
4143 | 1127 | minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] | ||
4144 | 1128 | minverhex = 0 | ||
4145 | 1129 | # xrange is not present in Python 3.0 and range returns an iterator | ||
4146 | 1130 | for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] | ||
4147 | 1131 | sys.exit(sys.hexversion < minverhex)" | ||
4148 | 1132 | AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) | ||
4149 | 1133 | |||
4150 | 1134 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
4151 | 1135 | # | ||
4152 | 1136 | # This file is free software; the Free Software Foundation | ||
4153 | 1137 | # gives unlimited permission to copy and/or distribute it, | ||
4154 | 1138 | # with or without modifications, as long as this notice is preserved. | ||
4155 | 1139 | |||
4156 | 1140 | # serial 1 | ||
4157 | 1141 | |||
4158 | 1142 | # AM_RUN_LOG(COMMAND) | ||
4159 | 1143 | # ------------------- | ||
4160 | 1144 | # Run COMMAND, save the exit status in ac_status, and log it. | ||
4161 | 1145 | # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) | ||
4162 | 1146 | AC_DEFUN([AM_RUN_LOG], | ||
4163 | 1147 | [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD | ||
4164 | 1148 | ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD | ||
4165 | 1149 | ac_status=$? | ||
4166 | 1150 | echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD | ||
4167 | 1151 | (exit $ac_status); }]) | ||
4168 | 1152 | |||
4169 | 1153 | # Check to make sure that the build environment is sane. -*- Autoconf -*- | ||
4170 | 1154 | |||
4171 | 1155 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | ||
4172 | 1156 | # | ||
4173 | 1157 | # This file is free software; the Free Software Foundation | ||
4174 | 1158 | # gives unlimited permission to copy and/or distribute it, | ||
4175 | 1159 | # with or without modifications, as long as this notice is preserved. | ||
4176 | 1160 | |||
4177 | 1161 | # serial 9 | ||
4178 | 1162 | |||
4179 | 1163 | # AM_SANITY_CHECK | ||
4180 | 1164 | # --------------- | ||
4181 | 1165 | AC_DEFUN([AM_SANITY_CHECK], | ||
4182 | 1166 | [AC_MSG_CHECKING([whether build environment is sane]) | ||
4183 | 1167 | # Reject unsafe characters in $srcdir or the absolute working directory | ||
4184 | 1168 | # name. Accept space and tab only in the latter. | ||
4185 | 1169 | am_lf=' | ||
4186 | 1170 | ' | ||
4187 | 1171 | case `pwd` in | ||
4188 | 1172 | *[[\\\"\#\$\&\'\`$am_lf]]*) | ||
4189 | 1173 | AC_MSG_ERROR([unsafe absolute working directory name]);; | ||
4190 | 1174 | esac | ||
4191 | 1175 | case $srcdir in | ||
4192 | 1176 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) | ||
4193 | 1177 | AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; | ||
4194 | 1178 | esac | ||
4195 | 1179 | |||
4196 | 1180 | # Do 'set' in a subshell so we don't clobber the current shell's | ||
4197 | 1181 | # arguments. Must try -L first in case configure is actually a | ||
4198 | 1182 | # symlink; some systems play weird games with the mod time of symlinks | ||
4199 | 1183 | # (eg FreeBSD returns the mod time of the symlink's containing | ||
4200 | 1184 | # directory). | ||
4201 | 1185 | if ( | ||
4202 | 1186 | am_has_slept=no | ||
4203 | 1187 | for am_try in 1 2; do | ||
4204 | 1188 | echo "timestamp, slept: $am_has_slept" > conftest.file | ||
4205 | 1189 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | ||
4206 | 1190 | if test "$[*]" = "X"; then | ||
4207 | 1191 | # -L didn't work. | ||
4208 | 1192 | set X `ls -t "$srcdir/configure" conftest.file` | ||
4209 | 1193 | fi | ||
4210 | 1194 | if test "$[*]" != "X $srcdir/configure conftest.file" \ | ||
4211 | 1195 | && test "$[*]" != "X conftest.file $srcdir/configure"; then | ||
4212 | 1196 | |||
4213 | 1197 | # If neither matched, then we have a broken ls. This can happen | ||
4214 | 1198 | # if, for instance, CONFIG_SHELL is bash and it inherits a | ||
4215 | 1199 | # broken ls alias from the environment. This has actually | ||
4216 | 1200 | # happened. Such a system could not be considered "sane". | ||
4217 | 1201 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | ||
4218 | 1202 | alias in your environment]) | ||
4219 | 1203 | fi | ||
4220 | 1204 | if test "$[2]" = conftest.file || test $am_try -eq 2; then | ||
4221 | 1205 | break | ||
4222 | 1206 | fi | ||
4223 | 1207 | # Just in case. | ||
4224 | 1208 | sleep 1 | ||
4225 | 1209 | am_has_slept=yes | ||
4226 | 1210 | done | ||
4227 | 1211 | test "$[2]" = conftest.file | ||
4228 | 1212 | ) | ||
4229 | 1213 | then | ||
4230 | 1214 | # Ok. | ||
4231 | 1215 | : | ||
4232 | 1216 | else | ||
4233 | 1217 | AC_MSG_ERROR([newly created file is older than distributed files! | ||
4234 | 1218 | Check your system clock]) | ||
4235 | 1219 | fi | ||
4236 | 1220 | AC_MSG_RESULT([yes]) | ||
4237 | 1221 | # If we didn't sleep, we still need to ensure time stamps of config.status and | ||
4238 | 1222 | # generated files are strictly newer. | ||
4239 | 1223 | am_sleep_pid= | ||
4240 | 1224 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | ||
4241 | 1225 | ( sleep 1 ) & | ||
4242 | 1226 | am_sleep_pid=$! | ||
4243 | 1227 | fi | ||
4244 | 1228 | AC_CONFIG_COMMANDS_PRE( | ||
4245 | 1229 | [AC_MSG_CHECKING([that generated files are newer than configure]) | ||
4246 | 1230 | if test -n "$am_sleep_pid"; then | ||
4247 | 1231 | # Hide warnings about reused PIDs. | ||
4248 | 1232 | wait $am_sleep_pid 2>/dev/null | ||
4249 | 1233 | fi | ||
4250 | 1234 | AC_MSG_RESULT([done])]) | ||
4251 | 1235 | rm -f conftest.file | ||
4252 | 1236 | ]) | ||
4253 | 1237 | |||
4254 | 1238 | # Copyright (C) 2009-2012 Free Software Foundation, Inc. | ||
4255 | 1239 | # | ||
4256 | 1240 | # This file is free software; the Free Software Foundation | ||
4257 | 1241 | # gives unlimited permission to copy and/or distribute it, | ||
4258 | 1242 | # with or without modifications, as long as this notice is preserved. | ||
4259 | 1243 | |||
4260 | 1244 | # serial 3 | ||
4261 | 1245 | |||
4262 | 1246 | # AM_SILENT_RULES([DEFAULT]) | ||
4263 | 1247 | # -------------------------- | ||
4264 | 1248 | # Enable less verbose build rules; with the default set to DEFAULT | ||
4265 | 1249 | # ("yes" being less verbose, "no" or empty being verbose). | ||
4266 | 1250 | AC_DEFUN([AM_SILENT_RULES], | ||
4267 | 1251 | [AC_ARG_ENABLE([silent-rules], [dnl | ||
4268 | 1252 | AS_HELP_STRING( | ||
4269 | 1253 | [--enable-silent-rules], | ||
4270 | 1254 | [less verbose build output (undo: "make V=1")]) | ||
4271 | 1255 | AS_HELP_STRING( | ||
4272 | 1256 | [--disable-silent-rules], | ||
4273 | 1257 | [verbose build output (undo: "make V=0")])dnl | ||
4274 | 1258 | ]) | ||
4275 | 1259 | case $enable_silent_rules in @%:@ ((( | ||
4276 | 1260 | yes) AM_DEFAULT_VERBOSITY=0;; | ||
4277 | 1261 | no) AM_DEFAULT_VERBOSITY=1;; | ||
4278 | 1262 | *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; | ||
4279 | 1263 | esac | ||
4280 | 1264 | dnl | ||
4281 | 1265 | dnl A few 'make' implementations (e.g., NonStop OS and NextStep) | ||
4282 | 1266 | dnl do not support nested variable expansions. | ||
4283 | 1267 | dnl See automake bug#9928 and bug#10237. | ||
4284 | 1268 | am_make=${MAKE-make} | ||
4285 | 1269 | AC_CACHE_CHECK([whether $am_make supports nested variables], | ||
4286 | 1270 | [am_cv_make_support_nested_variables], | ||
4287 | 1271 | [if AS_ECHO([['TRUE=$(BAR$(V)) | ||
4288 | 1272 | BAR0=false | ||
4289 | 1273 | BAR1=true | ||
4290 | 1274 | V=1 | ||
4291 | 1275 | am__doit: | ||
4292 | 1276 | @$(TRUE) | ||
4293 | 1277 | .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then | ||
4294 | 1278 | am_cv_make_support_nested_variables=yes | ||
4295 | 1279 | else | ||
4296 | 1280 | am_cv_make_support_nested_variables=no | ||
4297 | 1281 | fi]) | ||
4298 | 1282 | if test $am_cv_make_support_nested_variables = yes; then | ||
4299 | 1283 | dnl Using '$V' instead of '$(V)' breaks IRIX make. | ||
4300 | 1284 | AM_V='$(V)' | ||
4301 | 1285 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | ||
4302 | 1286 | else | ||
4303 | 1287 | AM_V=$AM_DEFAULT_VERBOSITY | ||
4304 | 1288 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | ||
4305 | 1289 | fi | ||
4306 | 1290 | AC_SUBST([AM_V])dnl | ||
4307 | 1291 | AM_SUBST_NOTMAKE([AM_V])dnl | ||
4308 | 1292 | AC_SUBST([AM_DEFAULT_V])dnl | ||
4309 | 1293 | AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl | ||
4310 | 1294 | AC_SUBST([AM_DEFAULT_VERBOSITY])dnl | ||
4311 | 1295 | AM_BACKSLASH='\' | ||
4312 | 1296 | AC_SUBST([AM_BACKSLASH])dnl | ||
4313 | 1297 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl | ||
4314 | 1298 | ]) | ||
4315 | 1299 | |||
4316 | 1300 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | ||
4317 | 1301 | # | ||
4318 | 1302 | # This file is free software; the Free Software Foundation | ||
4319 | 1303 | # gives unlimited permission to copy and/or distribute it, | ||
4320 | 1304 | # with or without modifications, as long as this notice is preserved. | ||
4321 | 1305 | |||
4322 | 1306 | # serial 2 | ||
4323 | 1307 | |||
4324 | 1308 | # AM_PROG_INSTALL_STRIP | ||
4325 | 1309 | # --------------------- | ||
4326 | 1310 | # One issue with vendor 'install' (even GNU) is that you can't | ||
4327 | 1311 | # specify the program used to strip binaries. This is especially | ||
4328 | 1312 | # annoying in cross-compiling environments, where the build's strip | ||
4329 | 1313 | # is unlikely to handle the host's binaries. | ||
4330 | 1314 | # Fortunately install-sh will honor a STRIPPROG variable, so we | ||
4331 | 1315 | # always use install-sh in "make install-strip", and initialize | ||
4332 | 1316 | # STRIPPROG with the value of the STRIP variable (set by the user). | ||
4333 | 1317 | AC_DEFUN([AM_PROG_INSTALL_STRIP], | ||
4334 | 1318 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl | ||
4335 | 1319 | # Installed binaries are usually stripped using 'strip' when the user | ||
4336 | 1320 | # run "make install-strip". However 'strip' might not be the right | ||
4337 | 1321 | # tool to use in cross-compilation environments, therefore Automake | ||
4338 | 1322 | # will honor the 'STRIP' environment variable to overrule this program. | ||
4339 | 1323 | dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. | ||
4340 | 1324 | if test "$cross_compiling" != no; then | ||
4341 | 1325 | AC_CHECK_TOOL([STRIP], [strip], :) | ||
4342 | 1326 | fi | ||
4343 | 1327 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" | ||
4344 | 1328 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) | ||
4345 | 1329 | |||
4346 | 1330 | # Copyright (C) 2006-2012 Free Software Foundation, Inc. | ||
4347 | 1331 | # | ||
4348 | 1332 | # This file is free software; the Free Software Foundation | ||
4349 | 1333 | # gives unlimited permission to copy and/or distribute it, | ||
4350 | 1334 | # with or without modifications, as long as this notice is preserved. | ||
4351 | 1335 | |||
4352 | 1336 | # serial 3 | ||
4353 | 1337 | |||
4354 | 1338 | # _AM_SUBST_NOTMAKE(VARIABLE) | ||
4355 | 1339 | # --------------------------- | ||
4356 | 1340 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. | ||
4357 | 1341 | # This macro is traced by Automake. | ||
4358 | 1342 | AC_DEFUN([_AM_SUBST_NOTMAKE]) | ||
4359 | 1343 | |||
4360 | 1344 | # AM_SUBST_NOTMAKE(VARIABLE) | ||
4361 | 1345 | # -------------------------- | ||
4362 | 1346 | # Public sister of _AM_SUBST_NOTMAKE. | ||
4363 | 1347 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) | ||
4364 | 1348 | |||
4365 | 1349 | # Check how to create a tarball. -*- Autoconf -*- | ||
4366 | 1350 | |||
4367 | 1351 | # Copyright (C) 2004-2012 Free Software Foundation, Inc. | ||
4368 | 1352 | # | ||
4369 | 1353 | # This file is free software; the Free Software Foundation | ||
4370 | 1354 | # gives unlimited permission to copy and/or distribute it, | ||
4371 | 1355 | # with or without modifications, as long as this notice is preserved. | ||
4372 | 1356 | |||
4373 | 1357 | # serial 3 | ||
4374 | 1358 | |||
4375 | 1359 | # _AM_PROG_TAR(FORMAT) | ||
4376 | 1360 | # -------------------- | ||
4377 | 1361 | # Check how to create a tarball in format FORMAT. | ||
4378 | 1362 | # FORMAT should be one of 'v7', 'ustar', or 'pax'. | ||
4379 | 1363 | # | ||
4380 | 1364 | # Substitute a variable $(am__tar) that is a command | ||
4381 | 1365 | # writing to stdout a FORMAT-tarball containing the directory | ||
4382 | 1366 | # $tardir. | ||
4383 | 1367 | # tardir=directory && $(am__tar) > result.tar | ||
4384 | 1368 | # | ||
4385 | 1369 | # Substitute a variable $(am__untar) that extract such | ||
4386 | 1370 | # a tarball read from stdin. | ||
4387 | 1371 | # $(am__untar) < result.tar | ||
4388 | 1372 | AC_DEFUN([_AM_PROG_TAR], | ||
4389 | 1373 | [# Always define AMTAR for backward compatibility. Yes, it's still used | ||
4390 | 1374 | # in the wild :-( We should find a proper way to deprecate it ... | ||
4391 | 1375 | AC_SUBST([AMTAR], ['$${TAR-tar}']) | ||
4392 | 1376 | m4_if([$1], [v7], | ||
4393 | 1377 | [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], | ||
4394 | 1378 | [m4_case([$1], [ustar],, [pax],, | ||
4395 | 1379 | [m4_fatal([Unknown tar format])]) | ||
4396 | 1380 | AC_MSG_CHECKING([how to create a $1 tar archive]) | ||
4397 | 1381 | # Loop over all known methods to create a tar archive until one works. | ||
4398 | 1382 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' | ||
4399 | 1383 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} | ||
4400 | 1384 | # Do not fold the above two line into one, because Tru64 sh and | ||
4401 | 1385 | # Solaris sh will not grok spaces in the rhs of '-'. | ||
4402 | 1386 | for _am_tool in $_am_tools | ||
4403 | 1387 | do | ||
4404 | 1388 | case $_am_tool in | ||
4405 | 1389 | gnutar) | ||
4406 | 1390 | for _am_tar in tar gnutar gtar; | ||
4407 | 1391 | do | ||
4408 | 1392 | AM_RUN_LOG([$_am_tar --version]) && break | ||
4409 | 1393 | done | ||
4410 | 1394 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' | ||
4411 | 1395 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' | ||
4412 | 1396 | am__untar="$_am_tar -xf -" | ||
4413 | 1397 | ;; | ||
4414 | 1398 | plaintar) | ||
4415 | 1399 | # Must skip GNU tar: if it does not support --format= it doesn't create | ||
4416 | 1400 | # ustar tarball either. | ||
4417 | 1401 | (tar --version) >/dev/null 2>&1 && continue | ||
4418 | 1402 | am__tar='tar chf - "$$tardir"' | ||
4419 | 1403 | am__tar_='tar chf - "$tardir"' | ||
4420 | 1404 | am__untar='tar xf -' | ||
4421 | 1405 | ;; | ||
4422 | 1406 | pax) | ||
4423 | 1407 | am__tar='pax -L -x $1 -w "$$tardir"' | ||
4424 | 1408 | am__tar_='pax -L -x $1 -w "$tardir"' | ||
4425 | 1409 | am__untar='pax -r' | ||
4426 | 1410 | ;; | ||
4427 | 1411 | cpio) | ||
4428 | 1412 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' | ||
4429 | 1413 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' | ||
4430 | 1414 | am__untar='cpio -i -H $1 -d' | ||
4431 | 1415 | ;; | ||
4432 | 1416 | none) | ||
4433 | 1417 | am__tar=false | ||
4434 | 1418 | am__tar_=false | ||
4435 | 1419 | am__untar=false | ||
4436 | 1420 | ;; | ||
4437 | 1421 | esac | ||
4438 | 1422 | |||
4439 | 1423 | # If the value was cached, stop now. We just wanted to have am__tar | ||
4440 | 1424 | # and am__untar set. | ||
4441 | 1425 | test -n "${am_cv_prog_tar_$1}" && break | ||
4442 | 1426 | |||
4443 | 1427 | # tar/untar a dummy directory, and stop if the command works | ||
4444 | 1428 | rm -rf conftest.dir | ||
4445 | 1429 | mkdir conftest.dir | ||
4446 | 1430 | echo GrepMe > conftest.dir/file | ||
4447 | 1431 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) | ||
4448 | 1432 | rm -rf conftest.dir | ||
4449 | 1433 | if test -s conftest.tar; then | ||
4450 | 1434 | AM_RUN_LOG([$am__untar <conftest.tar]) | ||
4451 | 1435 | grep GrepMe conftest.dir/file >/dev/null 2>&1 && break | ||
4452 | 1436 | fi | ||
4453 | 1437 | done | ||
4454 | 1438 | rm -rf conftest.dir | ||
4455 | 1439 | |||
4456 | 1440 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) | ||
4457 | 1441 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) | ||
4458 | 1442 | AC_SUBST([am__tar]) | ||
4459 | 1443 | AC_SUBST([am__untar]) | ||
4460 | 1444 | ]) # _AM_PROG_TAR | ||
4461 | 1445 | |||
4462 | 1446 | m4_include([m4/ac_pkg_cython.m4]) | ||
4463 | 1447 | m4_include([m4/ac_python_devel.m4]) | ||
4464 | 1448 | m4_include([m4/as-compiler-flag.m4]) | ||
4465 | 1449 | m4_include([m4/cython_python.m4]) | ||
4466 | 1450 | m4_include([m4/libtool.m4]) | ||
4467 | 1451 | m4_include([m4/ltoptions.m4]) | ||
4468 | 1452 | m4_include([m4/ltsugar.m4]) | ||
4469 | 1453 | m4_include([m4/ltversion.m4]) | ||
4470 | 1454 | m4_include([m4/lt~obsolete.m4]) | ||
4471 | 1455 | 0 | ||
4472 | === added file 'autogen.sh' | |||
4473 | --- autogen.sh 1970-01-01 00:00:00 +0000 | |||
4474 | +++ autogen.sh 2014-03-14 06:45:31 +0000 | |||
4475 | @@ -0,0 +1,15 @@ | |||
4476 | 1 | #!/bin/sh | ||
4477 | 2 | gprefix=`which glibtoolize 2>&1 >/dev/null` | ||
4478 | 3 | if [ $? -eq 0 ]; then | ||
4479 | 4 | glibtoolize --force | ||
4480 | 5 | else | ||
4481 | 6 | libtoolize --force | ||
4482 | 7 | fi | ||
4483 | 8 | aclocal -I m4 | ||
4484 | 9 | autoheader | ||
4485 | 10 | automake --add-missing | ||
4486 | 11 | autoconf | ||
4487 | 12 | |||
4488 | 13 | if [ -z "$NOCONFIGURE" ]; then | ||
4489 | 14 | ./configure "$@" | ||
4490 | 15 | fi | ||
4491 | 0 | 16 | ||
4492 | === added directory 'common' | |||
4493 | === added file 'common/Makefile.am' | |||
4494 | --- common/Makefile.am 1970-01-01 00:00:00 +0000 | |||
4495 | +++ common/Makefile.am 2014-03-14 06:45:31 +0000 | |||
4496 | @@ -0,0 +1,18 @@ | |||
4497 | 1 | AM_CPPFLAGS = -I$(top_srcdir)/include | ||
4498 | 2 | |||
4499 | 3 | AM_CFLAGS = $(GLOBAL_CFLAGS) $(libplist_CFLAGS) $(LFS_CFLAGS) | ||
4500 | 4 | AM_LDFLAGS = $(libplist_LIBS) ${libpthread_LIBS} | ||
4501 | 5 | |||
4502 | 6 | noinst_LTLIBRARIES = libinternalcommon.la | ||
4503 | 7 | libinternalcommon_la_LIBADD = | ||
4504 | 8 | libinternalcommon_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined | ||
4505 | 9 | libinternalcommon_la_SOURCES = \ | ||
4506 | 10 | socket.c socket.h \ | ||
4507 | 11 | thread.c thread.h \ | ||
4508 | 12 | debug.c debug.h \ | ||
4509 | 13 | userpref.c userpref.h \ | ||
4510 | 14 | utils.c utils.h | ||
4511 | 15 | |||
4512 | 16 | if WIN32 | ||
4513 | 17 | libinternalcommon_la_LIBADD += -lole32 | ||
4514 | 18 | endif | ||
4515 | 0 | 19 | ||
4516 | === added file 'common/debug.c' | |||
4517 | --- common/debug.c 1970-01-01 00:00:00 +0000 | |||
4518 | +++ common/debug.c 2014-03-14 06:45:31 +0000 | |||
4519 | @@ -0,0 +1,169 @@ | |||
4520 | 1 | /* | ||
4521 | 2 | * debug.c | ||
4522 | 3 | * contains utilitary functions for debugging | ||
4523 | 4 | * | ||
4524 | 5 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. | ||
4525 | 6 | * Copyright (c) 2010 Martin S. All Rights Reserved. | ||
4526 | 7 | * | ||
4527 | 8 | * This library is free software; you can redistribute it and/or | ||
4528 | 9 | * modify it under the terms of the GNU Lesser General Public | ||
4529 | 10 | * License as published by the Free Software Foundation; either | ||
4530 | 11 | * version 2.1 of the License, or (at your option) any later version. | ||
4531 | 12 | * | ||
4532 | 13 | * This library is distributed in the hope that it will be useful, | ||
4533 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4534 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
4535 | 16 | * Lesser General Public License for more details. | ||
4536 | 17 | * | ||
4537 | 18 | * You should have received a copy of the GNU Lesser General Public | ||
4538 | 19 | * License along with this library; if not, write to the Free Software | ||
4539 | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
4540 | 21 | */ | ||
4541 | 22 | |||
4542 | 23 | #ifdef HAVE_CONFIG_H | ||
4543 | 24 | #include <config.h> | ||
4544 | 25 | #endif | ||
4545 | 26 | #include <stdarg.h> | ||
4546 | 27 | #define _GNU_SOURCE 1 | ||
4547 | 28 | #define __USE_GNU 1 | ||
4548 | 29 | #include <stdio.h> | ||
4549 | 30 | #include <stdint.h> | ||
4550 | 31 | #include <stdlib.h> | ||
4551 | 32 | #include <time.h> | ||
4552 | 33 | |||
4553 | 34 | #include "debug.h" | ||
4554 | 35 | #include "libimobiledevice/libimobiledevice.h" | ||
4555 | 36 | |||
4556 | 37 | #ifndef STRIP_DEBUG_CODE | ||
4557 | 38 | #include "asprintf.h" | ||
4558 | 39 | #endif | ||
4559 | 40 | |||
4560 | 41 | int debug_level = 0; | ||
4561 | 42 | |||
4562 | 43 | /** | ||
4563 | 44 | * Sets the level of debugging. Currently the only acceptable values are 0 and | ||
4564 | 45 | * 1. | ||
4565 | 46 | * | ||
4566 | 47 | * @param level Set to 0 for no debugging or 1 for debugging. | ||
4567 | 48 | */ | ||
4568 | 49 | void idevice_set_debug_level(int level) | ||
4569 | 50 | { | ||
4570 | 51 | debug_level = level; | ||
4571 | 52 | } | ||
4572 | 53 | |||
4573 | 54 | #ifndef STRIP_DEBUG_CODE | ||
4574 | 55 | static void debug_print_line(const char *func, const char *file, int line, const char *buffer) | ||
4575 | 56 | { | ||
4576 | 57 | char *str_time = NULL; | ||
4577 | 58 | char *header = NULL; | ||
4578 | 59 | time_t the_time; | ||
4579 | 60 | |||
4580 | 61 | time(&the_time); | ||
4581 | 62 | str_time = (char*)malloc(255); | ||
4582 | 63 | strftime(str_time, 254, "%H:%M:%S", localtime (&the_time)); | ||
4583 | 64 | |||
4584 | 65 | /* generate header text */ | ||
4585 | 66 | (void)asprintf(&header, "%s %s:%d %s()", str_time, file, line, func); | ||
4586 | 67 | free (str_time); | ||
4587 | 68 | |||
4588 | 69 | /* trim ending newlines */ | ||
4589 | 70 | |||
4590 | 71 | /* print header */ | ||
4591 | 72 | printf ("%s: ", header); | ||
4592 | 73 | |||
4593 | 74 | /* print actual debug content */ | ||
4594 | 75 | printf ("%s\n", buffer); | ||
4595 | 76 | |||
4596 | 77 | /* flush this output, as we need to debug */ | ||
4597 | 78 | fflush (stdout); | ||
4598 | 79 | |||
4599 | 80 | free (header); | ||
4600 | 81 | } | ||
4601 | 82 | #endif | ||
4602 | 83 | |||
4603 | 84 | void debug_info_real(const char *func, const char *file, int line, const char *format, ...) | ||
4604 | 85 | { | ||
4605 | 86 | #ifndef STRIP_DEBUG_CODE | ||
4606 | 87 | va_list args; | ||
4607 | 88 | char *buffer = NULL; | ||
4608 | 89 | |||
4609 | 90 | if (!debug_level) | ||
4610 | 91 | return; | ||
4611 | 92 | |||
4612 | 93 | /* run the real fprintf */ | ||
4613 | 94 | va_start(args, format); | ||
4614 | 95 | (void)vasprintf(&buffer, format, args); | ||
4615 | 96 | va_end(args); | ||
4616 | 97 | |||
4617 | 98 | debug_print_line(func, file, line, buffer); | ||
4618 | 99 | |||
4619 | 100 | free(buffer); | ||
4620 | 101 | #endif | ||
4621 | 102 | } | ||
4622 | 103 | |||
4623 | 104 | void debug_buffer(const char *data, const int length) | ||
4624 | 105 | { | ||
4625 | 106 | #ifndef STRIP_DEBUG_CODE | ||
4626 | 107 | int i; | ||
4627 | 108 | int j; | ||
4628 | 109 | unsigned char c; | ||
4629 | 110 | |||
4630 | 111 | if (debug_level) { | ||
4631 | 112 | for (i = 0; i < length; i += 16) { | ||
4632 | 113 | fprintf(stderr, "%04x: ", i); | ||
4633 | 114 | for (j = 0; j < 16; j++) { | ||
4634 | 115 | if (i + j >= length) { | ||
4635 | 116 | fprintf(stderr, " "); | ||
4636 | 117 | continue; | ||
4637 | 118 | } | ||
4638 | 119 | fprintf(stderr, "%02x ", *(data + i + j) & 0xff); | ||
4639 | 120 | } | ||
4640 | 121 | fprintf(stderr, " | "); | ||
4641 | 122 | for (j = 0; j < 16; j++) { | ||
4642 | 123 | if (i + j >= length) | ||
4643 | 124 | break; | ||
4644 | 125 | c = *(data + i + j); | ||
4645 | 126 | if ((c < 32) || (c > 127)) { | ||
4646 | 127 | fprintf(stderr, "."); | ||
4647 | 128 | continue; | ||
4648 | 129 | } | ||
4649 | 130 | fprintf(stderr, "%c", c); | ||
4650 | 131 | } | ||
4651 | 132 | fprintf(stderr, "\n"); | ||
4652 | 133 | } | ||
4653 | 134 | fprintf(stderr, "\n"); | ||
4654 | 135 | } | ||
4655 | 136 | #endif | ||
4656 | 137 | } | ||
4657 | 138 | |||
4658 | 139 | void debug_buffer_to_file(const char *file, const char *data, const int length) | ||
4659 | 140 | { | ||
4660 | 141 | #ifndef STRIP_DEBUG_CODE | ||
4661 | 142 | if (debug_level) { | ||
4662 | 143 | FILE *f = fopen(file, "wb"); | ||
4663 | 144 | fwrite(data, 1, length, f); | ||
4664 | 145 | fflush(f); | ||
4665 | 146 | fclose(f); | ||
4666 | 147 | } | ||
4667 | 148 | #endif | ||
4668 | 149 | } | ||
4669 | 150 | |||
4670 | 151 | void debug_plist_real(const char *func, const char *file, int line, plist_t plist) | ||
4671 | 152 | { | ||
4672 | 153 | #ifndef STRIP_DEBUG_CODE | ||
4673 | 154 | if (!plist) | ||
4674 | 155 | return; | ||
4675 | 156 | |||
4676 | 157 | char *buffer = NULL; | ||
4677 | 158 | uint32_t length = 0; | ||
4678 | 159 | plist_to_xml(plist, &buffer, &length); | ||
4679 | 160 | |||
4680 | 161 | /* get rid of ending newline as one is already added in the debug line */ | ||
4681 | 162 | if (buffer[length-1] == '\n') | ||
4682 | 163 | buffer[length-1] = '\0'; | ||
4683 | 164 | |||
4684 | 165 | debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer); | ||
4685 | 166 | free(buffer); | ||
4686 | 167 | #endif | ||
4687 | 168 | } | ||
4688 | 169 | |||
4689 | 0 | 170 | ||
4690 | === added file 'common/debug.h' | |||
4691 | --- common/debug.h 1970-01-01 00:00:00 +0000 | |||
4692 | +++ common/debug.h 2014-03-14 06:45:31 +0000 | |||
4693 | @@ -0,0 +1,59 @@ | |||
4694 | 1 | /* | ||
4695 | 2 | * debug.h | ||
4696 | 3 | * contains utilitary functions for debugging | ||
4697 | 4 | * | ||
4698 | 5 | * Copyright (c) 2008 Jonathan Beck All Rights Reserved. | ||
4699 | 6 | * Copyright (c) 2010 Martin S. All Rights Reserved. | ||
4700 | 7 | * | ||
4701 | 8 | * This library is free software; you can redistribute it and/or | ||
4702 | 9 | * modify it under the terms of the GNU Lesser General Public | ||
4703 | 10 | * License as published by the Free Software Foundation; either | ||
4704 | 11 | * version 2.1 of the License, or (at your option) any later version. | ||
4705 | 12 | * | ||
4706 | 13 | * This library is distributed in the hope that it will be useful, | ||
4707 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4708 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
4709 | 16 | * Lesser General Public License for more details. | ||
4710 | 17 | * | ||
4711 | 18 | * You should have received a copy of the GNU Lesser General Public | ||
4712 | 19 | * License along with this library; if not, write to the Free Software | ||
4713 | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
4714 | 21 | */ | ||
4715 | 22 | |||
4716 | 23 | #ifndef __DEBUG_H | ||
4717 | 24 | #define __DEBUG_H | ||
4718 | 25 | |||
4719 | 26 | #include <plist/plist.h> | ||
4720 | 27 | |||
4721 | 28 | #ifndef LIBIMOBILEDEVICE_INTERNAL | ||
4722 | 29 | #ifdef WIN32 | ||
4723 | 30 | #define LIBIMOBILEDEVICE_INTERNAL | ||
4724 | 31 | #else | ||
4725 | 32 | #define LIBIMOBILEDEVICE_INTERNAL __attribute__((visibility("hidden"))) | ||
4726 | 33 | #endif | ||
4727 | 34 | #endif | ||
4728 | 35 | |||
4729 | 36 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && !defined(STRIP_DEBUG_CODE) | ||
4730 | 37 | #define debug_info(...) debug_info_real (__func__, __FILE__, __LINE__, __VA_ARGS__) | ||
4731 | 38 | #define debug_plist(a) debug_plist_real (__func__, __FILE__, __LINE__, a) | ||
4732 | 39 | #elif defined(__GNUC__) && __GNUC__ >= 3 && !defined(STRIP_DEBUG_CODE) | ||
4733 | 40 | #define debug_info(...) debug_info_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) | ||
4734 | 41 | #define debug_plist(a) debug_plist_real (__FUNCTION__, __FILE__, __LINE__, a) | ||
4735 | 42 | #else | ||
4736 | 43 | #define debug_info(...) | ||
4737 | 44 | #define debug_plist(a) | ||
4738 | 45 | #endif | ||
4739 | 46 | |||
4740 | 47 | LIBIMOBILEDEVICE_INTERNAL void debug_info_real(const char *func, | ||
4741 | 48 | const char *file, | ||
4742 | 49 | int line, | ||
4743 | 50 | const char *format, ...); | ||
4744 | 51 | |||
4745 | 52 | LIBIMOBILEDEVICE_INTERNAL void debug_buffer(const char *data, const int length); | ||
4746 | 53 | LIBIMOBILEDEVICE_INTERNAL void debug_buffer_to_file(const char *file, const char *data, const int length); | ||
4747 | 54 | LIBIMOBILEDEVICE_INTERNAL void debug_plist_real(const char *func, | ||
4748 | 55 | const char *file, | ||
4749 | 56 | int line, | ||
4750 | 57 | plist_t plist); | ||
4751 | 58 | |||
4752 | 59 | #endif | ||
4753 | 0 | 60 | ||
4754 | === added file 'common/socket.c' | |||
4755 | --- common/socket.c 1970-01-01 00:00:00 +0000 | |||
4756 | +++ common/socket.c 2014-03-14 06:45:31 +0000 | |||
4757 | @@ -0,0 +1,392 @@ | |||
4758 | 1 | /* | ||
4759 | 2 | * socket.c | ||
4760 | 3 | * | ||
4761 | 4 | * Copyright (c) 2012 Martin Szulecki All Rights Reserved. | ||
4762 | 5 | * Copyright (c) 2012 Nikias Bassen All Rights Reserved. | ||
4763 | 6 | * | ||
4764 | 7 | * This library is free software; you can redistribute it and/or | ||
4765 | 8 | * modify it under the terms of the GNU Lesser General Public | ||
4766 | 9 | * License as published by the Free Software Foundation; either | ||
4767 | 10 | * version 2.1 of the License, or (at your option) any later version. | ||
4768 | 11 | * | ||
4769 | 12 | * This library is distributed in the hope that it will be useful, | ||
4770 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4771 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
4772 | 15 | * Lesser General Public License for more details. | ||
4773 | 16 | * | ||
4774 | 17 | * You should have received a copy of the GNU Lesser General Public | ||
4775 | 18 | * License along with this library; if not, write to the Free Software | ||
4776 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
4777 | 20 | */ | ||
4778 | 21 | |||
4779 | 22 | #include <stdio.h> | ||
4780 | 23 | #include <stddef.h> | ||
4781 | 24 | #include <stdlib.h> | ||
4782 | 25 | #include <string.h> | ||
4783 | 26 | #include <unistd.h> | ||
4784 | 27 | #include <errno.h> | ||
4785 | 28 | #include <sys/time.h> | ||
4786 | 29 | #include <sys/stat.h> | ||
4787 | 30 | #ifdef WIN32 | ||
4788 | 31 | #include <winsock2.h> | ||
4789 | 32 | #include <windows.h> | ||
4790 | 33 | static int wsa_init = 0; | ||
4791 | 34 | #else | ||
4792 | 35 | #include <sys/socket.h> | ||
4793 | 36 | #include <sys/un.h> | ||
4794 | 37 | #include <netinet/in.h> | ||
4795 | 38 | #include <netdb.h> | ||
4796 | 39 | #include <arpa/inet.h> | ||
4797 | 40 | #endif | ||
4798 | 41 | #include "socket.h" | ||
4799 | 42 | |||
4800 | 43 | #define RECV_TIMEOUT 20000 | ||
4801 | 44 | |||
4802 | 45 | static int verbose = 0; | ||
4803 | 46 | |||
4804 | 47 | void socket_set_verbose(int level) | ||
4805 | 48 | { | ||
4806 | 49 | verbose = level; | ||
4807 | 50 | } | ||
4808 | 51 | |||
4809 | 52 | #ifndef WIN32 | ||
4810 | 53 | int socket_create_unix(const char *filename) | ||
4811 | 54 | { | ||
4812 | 55 | struct sockaddr_un name; | ||
4813 | 56 | int sock; | ||
4814 | 57 | size_t size; | ||
4815 | 58 | |||
4816 | 59 | // remove if still present | ||
4817 | 60 | unlink(filename); | ||
4818 | 61 | |||
4819 | 62 | /* Create the socket. */ | ||
4820 | 63 | sock = socket(PF_LOCAL, SOCK_STREAM, 0); | ||
4821 | 64 | if (sock < 0) { | ||
4822 | 65 | perror("socket"); | ||
4823 | 66 | return -1; | ||
4824 | 67 | } | ||
4825 | 68 | |||
4826 | 69 | /* Bind a name to the socket. */ | ||
4827 | 70 | name.sun_family = AF_LOCAL; | ||
4828 | 71 | strncpy(name.sun_path, filename, sizeof(name.sun_path)); | ||
4829 | 72 | name.sun_path[sizeof(name.sun_path) - 1] = '\0'; | ||
4830 | 73 | |||
4831 | 74 | /* The size of the address is | ||
4832 | 75 | the offset of the start of the filename, | ||
4833 | 76 | plus its length, | ||
4834 | 77 | plus one for the terminating null byte. | ||
4835 | 78 | Alternatively you can just do: | ||
4836 | 79 | size = SUN_LEN (&name); | ||
4837 | 80 | */ | ||
4838 | 81 | size = (offsetof(struct sockaddr_un, sun_path) | ||
4839 | 82 | + strlen(name.sun_path) + 1); | ||
4840 | 83 | |||
4841 | 84 | if (bind(sock, (struct sockaddr *) &name, size) < 0) { | ||
4842 | 85 | perror("bind"); | ||
4843 | 86 | socket_close(sock); | ||
4844 | 87 | return -1; | ||
4845 | 88 | } | ||
4846 | 89 | |||
4847 | 90 | if (listen(sock, 10) < 0) { | ||
4848 | 91 | perror("listen"); | ||
4849 | 92 | socket_close(sock); | ||
4850 | 93 | return -1; | ||
4851 | 94 | } | ||
4852 | 95 | |||
4853 | 96 | return sock; | ||
4854 | 97 | } | ||
4855 | 98 | |||
4856 | 99 | int socket_connect_unix(const char *filename) | ||
4857 | 100 | { | ||
4858 | 101 | struct sockaddr_un name; | ||
4859 | 102 | int sfd = -1; | ||
4860 | 103 | size_t size; | ||
4861 | 104 | struct stat fst; | ||
4862 | 105 | |||
4863 | 106 | // check if socket file exists... | ||
4864 | 107 | if (stat(filename, &fst) != 0) { | ||
4865 | 108 | if (verbose >= 2) | ||
4866 | 109 | fprintf(stderr, "%s: stat '%s': %s\n", __func__, filename, | ||
4867 | 110 | strerror(errno)); | ||
4868 | 111 | return -1; | ||
4869 | 112 | } | ||
4870 | 113 | // ... and if it is a unix domain socket | ||
4871 | 114 | if (!S_ISSOCK(fst.st_mode)) { | ||
4872 | 115 | if (verbose >= 2) | ||
4873 | 116 | fprintf(stderr, "%s: File '%s' is not a socket!\n", __func__, | ||
4874 | 117 | filename); | ||
4875 | 118 | return -1; | ||
4876 | 119 | } | ||
4877 | 120 | // make a new socket | ||
4878 | 121 | if ((sfd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) { | ||
4879 | 122 | if (verbose >= 2) | ||
4880 | 123 | fprintf(stderr, "%s: socket: %s\n", __func__, strerror(errno)); | ||
4881 | 124 | return -1; | ||
4882 | 125 | } | ||
4883 | 126 | // and connect to 'filename' | ||
4884 | 127 | name.sun_family = AF_LOCAL; | ||
4885 | 128 | strncpy(name.sun_path, filename, sizeof(name.sun_path)); | ||
4886 | 129 | name.sun_path[sizeof(name.sun_path) - 1] = 0; | ||
4887 | 130 | |||
4888 | 131 | size = (offsetof(struct sockaddr_un, sun_path) | ||
4889 | 132 | + strlen(name.sun_path) + 1); | ||
4890 | 133 | |||
4891 | 134 | if (connect(sfd, (struct sockaddr *) &name, size) < 0) { | ||
4892 | 135 | socket_close(sfd); | ||
4893 | 136 | if (verbose >= 2) | ||
4894 | 137 | fprintf(stderr, "%s: connect: %s\n", __func__, | ||
4895 | 138 | strerror(errno)); | ||
4896 | 139 | return -1; | ||
4897 | 140 | } | ||
4898 | 141 | |||
4899 | 142 | return sfd; | ||
4900 | 143 | } | ||
4901 | 144 | #endif | ||
4902 | 145 | |||
4903 | 146 | int socket_create(uint16_t port) | ||
4904 | 147 | { | ||
4905 | 148 | int sfd = -1; | ||
4906 | 149 | int yes = 1; | ||
4907 | 150 | #ifdef WIN32 | ||
4908 | 151 | WSADATA wsa_data; | ||
4909 | 152 | if (!wsa_init) { | ||
4910 | 153 | if (WSAStartup(MAKEWORD(2,2), &wsa_data) != ERROR_SUCCESS) { | ||
4911 | 154 | fprintf(stderr, "WSAStartup failed!\n"); | ||
4912 | 155 | ExitProcess(-1); | ||
4913 | 156 | } | ||
4914 | 157 | wsa_init = 1; | ||
4915 | 158 | } | ||
4916 | 159 | #endif | ||
4917 | 160 | struct sockaddr_in saddr; | ||
4918 | 161 | |||
4919 | 162 | if (0 > (sfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP))) { | ||
4920 | 163 | perror("socket()"); | ||
4921 | 164 | return -1; | ||
4922 | 165 | } | ||
4923 | 166 | |||
4924 | 167 | if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void*)&yes, sizeof(int)) == -1) { | ||
4925 | 168 | perror("setsockopt()"); | ||
4926 | 169 | socket_close(sfd); | ||
4927 | 170 | return -1; | ||
4928 | 171 | } | ||
4929 | 172 | |||
4930 | 173 | memset((void *) &saddr, 0, sizeof(saddr)); | ||
4931 | 174 | saddr.sin_family = AF_INET; | ||
4932 | 175 | saddr.sin_addr.s_addr = htonl(INADDR_ANY); | ||
4933 | 176 | saddr.sin_port = htons(port); | ||
4934 | 177 | |||
4935 | 178 | if (0 > bind(sfd, (struct sockaddr *) &saddr, sizeof(saddr))) { | ||
4936 | 179 | perror("bind()"); | ||
4937 | 180 | socket_close(sfd); | ||
4938 | 181 | return -1; | ||
4939 | 182 | } | ||
4940 | 183 | |||
4941 | 184 | if (listen(sfd, 1) == -1) { | ||
4942 | 185 | perror("listen()"); | ||
4943 | 186 | socket_close(sfd); | ||
4944 | 187 | return -1; | ||
4945 | 188 | } | ||
4946 | 189 | |||
4947 | 190 | return sfd; | ||
4948 | 191 | } | ||
4949 | 192 | |||
4950 | 193 | int socket_connect(const char *addr, uint16_t port) | ||
4951 | 194 | { | ||
4952 | 195 | int sfd = -1; | ||
4953 | 196 | int yes = 1; | ||
4954 | 197 | struct hostent *hp; | ||
4955 | 198 | struct sockaddr_in saddr; | ||
4956 | 199 | #ifdef WIN32 | ||
4957 | 200 | WSADATA wsa_data; | ||
4958 | 201 | if (!wsa_init) { | ||
4959 | 202 | if (WSAStartup(MAKEWORD(2,2), &wsa_data) != ERROR_SUCCESS) { | ||
4960 | 203 | fprintf(stderr, "WSAStartup failed!\n"); | ||
4961 | 204 | ExitProcess(-1); | ||
4962 | 205 | } | ||
4963 | 206 | wsa_init = 1; | ||
4964 | 207 | } | ||
4965 | 208 | #endif | ||
4966 | 209 | |||
4967 | 210 | if (!addr) { | ||
4968 | 211 | errno = EINVAL; | ||
4969 | 212 | return -1; | ||
4970 | 213 | } | ||
4971 | 214 | |||
4972 | 215 | if ((hp = gethostbyname(addr)) == NULL) { | ||
4973 | 216 | if (verbose >= 2) | ||
4974 | 217 | fprintf(stderr, "%s: unknown host '%s'\n", __func__, addr); | ||
4975 | 218 | return -1; | ||
4976 | 219 | } | ||
4977 | 220 | |||
4978 | 221 | if (!hp->h_addr) { | ||
4979 | 222 | if (verbose >= 2) | ||
4980 | 223 | fprintf(stderr, "%s: gethostbyname returned NULL address!\n", | ||
4981 | 224 | __func__); | ||
4982 | 225 | return -1; | ||
4983 | 226 | } | ||
4984 | 227 | |||
4985 | 228 | if (0 > (sfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP))) { | ||
4986 | 229 | perror("socket()"); | ||
4987 | 230 | return -1; | ||
4988 | 231 | } | ||
4989 | 232 | |||
4990 | 233 | if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void*)&yes, sizeof(int)) == -1) { | ||
4991 | 234 | perror("setsockopt()"); | ||
4992 | 235 | socket_close(sfd); | ||
4993 | 236 | return -1; | ||
4994 | 237 | } | ||
4995 | 238 | |||
4996 | 239 | memset((void *) &saddr, 0, sizeof(saddr)); | ||
4997 | 240 | saddr.sin_family = AF_INET; | ||
4998 | 241 | saddr.sin_addr.s_addr = *(uint32_t *) hp->h_addr; | ||
4999 | 242 | saddr.sin_port = htons(port); | ||
5000 | 243 |
I can confirm that it works. Tested on an existing machine and a fresh install.