README.Linden 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. 0. Pre-Checkin Checklist
  2. Performed from top of repo, default branch, head:
  3. [ ] Is tag 'current' at or near head of 'vendor'?
  4. hg heads
  5. hg tags
  6. [ ] Expected differences between vendor and default? Very
  7. little of the original source should be modified.
  8. hg diff -rcurrent libpng
  9. [ ] Are the 'vendor' and 'default' branch source directories
  10. 'libpng' and not 'libpng-<version>'?
  11. [ ] Have you reverted/blocked checkin of files modified by
  12. configure such as Makefile, config.*, libpng-config,
  13. libpng.pc, libpng.vers, libtool, etc.?
  14. [ ] Built PIC on *nix platforms?
  15. [ ] Examined pngfix and libraries for correct building.
  16. * 'stage/bin/pngfix' shows no dynamic linkage to libz:
  17. $ ldd stage/bin/pngfix
  18. linux-gate.so.1 => (0xf7713000)
  19. libm.so.6 => /lib32/libm.so.6 (0xf76d7000)
  20. libc.so.6 => /lib32/libc.so.6 (0xf7590000)
  21. /lib/ld-linux.so.2 (0xf7714000)
  22. * 'strings stage/bin/pngfix | egrep 1\\.2\\.' shows correct
  23. libz and libpng:
  24. $ strings stage/bin/pngfix | grep 1\\.[0-9]\\.
  25. 1.6.8
  26. 1.2.8
  27. libpng version 1.6.8 - December 19, 2013
  28. libpng version 1.6.8 - December 19, 2013
  29. deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler
  30. inflate 1.2.8 Copyright 1995-2013 Mark Adler
  31. * Libraries have correct versions:
  32. $ strings stage/lib/release/libpng.a | grep 1\\.[0-9]\\.
  33. 1.6.8
  34. libpng version 1.6.8 - December 19, 2013
  35. libpng version 1.6.8 - December 19, 2013
  36. 1.6.8
  37. 1.2.8
  38. 1.6.8
  39. 1.2.8
  40. 1. Introduction
  41. Simple build of libpng library from libpng.org.
  42. Repo structure *now* mostly follows standard conventions (see
  43. section at end).
  44. Prior to 1.6.7, repo didn't follow standard convention and each
  45. release was disconnected from previous releases. Modifications
  46. to branch 'default' were re-implemented on every update.
  47. The version jump from 1.5.1 to 1.6.7 included a good number of
  48. security and reliability fixes. Version number is also reflected
  49. in the library name everywhere (libpng15 -> libpng16).
  50. There are PNG files in the distribution which Mercurial does not
  51. know how to merge. Add the following to .hg/hgrc in the repo so
  52. that PNG files are take from the other branch:
  53. [merge-patterns]
  54. **.png = internal:other
  55. 2. Modifications
  56. Essential modifications to libpng distribution.
  57. 2.1 Windows Project Files
  58. * libpng.vcxproj:
  59. o /Zc:wchar_t- already established
  60. o Debug|Win32:
  61. . WholeProgramOptimization => false
  62. . LinkTimeCodeGeneration => Default
  63. . ProgramDatabaseFileName => $(OutDir)$(TargetName).pdb
  64. o Debug Library|Win32:
  65. . WholeProgramOptimization => false
  66. . ProgramDatabaseFileName => $(OutDir)$(TargetName).pdb
  67. o Release|Win32
  68. . WholeProgramOptimization => false
  69. . LinkTimeCodeGeneration => Default
  70. . ProgramDatabaseFileName => $(OutDir)$(TargetName).pdb
  71. o Release Library|Win32:
  72. . WholeProgramOptimization => false
  73. . ProgramDatabaseFileName => $(OutDir)$(TargetName).pdb
  74. * pnglibconf.vcxproj:
  75. o Release|Win32
  76. . LinkTimeCodeGeneration => Default
  77. * pngtest.vcxproj:
  78. o Release|Win32
  79. . LinkTimeCodeGeneration => Default
  80. o Release Library|Win32:
  81. . LinkTimeCodeGeneration => Default
  82. * pngvalid.vcxproj:
  83. o Debug|Win32:
  84. . LinkTimeCodeGeneration => Default
  85. o Debug Library|Win32:
  86. . LinkTimeCodeGeneration => Default
  87. o Release|Win32
  88. . LinkTimeCodeGeneration => Default
  89. o Release Library|Win32:
  90. . LinkTimeCodeGeneration => Default
  91. * vstudio.sln:
  92. o Delete zlib project references
  93. * zlib.props:
  94. o ZLibSrcDir points to package area where zlib is installed.
  95. 2.2 DLLs and Unit Tests
  96. Linux and Mac unit tests are functional. Windows will require
  97. some more work. That will include finding the correct zlib.lib,
  98. build options for wchar_t, and other things. Not difficult, but
  99. it will require some iteration.
  100. 2.3 Creaky Mac OSX 10.5
  101. Mac is still building old llqtwebkit (based on the
  102. http://bitbucket.org/lindenlab/3p-llqtwebit repo) on 10.5. To use
  103. this library with a 10.5 build of llqtwebkit, the
  104. -mmacosx-version-min must be kept at 10.5 or __bzero() will be
  105. used for memset operations. We'll take the optimistic path for
  106. now based on the reborn repo
  107. (http://bitbucket.org/monty_linden/llqtwebkit2) which builds on
  108. more modern releases.
  109. 3. Source Origin
  110. 1.6.7:
  111. http://prdownloads.sourceforge.net/libpng/libpng-1.6.7.tar.gz?download
  112. MD5: ab48db8c1acf75472a48c22649a6d13b
  113. 1.6.8:
  114. http://downloads.sourceforge.net/project/libpng/libpng16/1.6.8/libpng-1.6.8.tar.gz
  115. MD5: 29b7065906e2551508a0d7eacd19174e
  116. 4. Products
  117. Common:
  118. * include/libpng16/png.h
  119. * include/libpng16/pngconf.h
  120. * include/libpng16/pnglibconf.h
  121. Windows:
  122. * lib/debug/libpng16.lib
  123. * lib/debug/libpng16.idb
  124. * lib/debug/libpng16.pdb
  125. * lib/release/libpng16.lib
  126. * lib/release/libpng16.idb
  127. * lib/release/libpng16.pdb
  128. Mac OS X:
  129. * lib/release/libpng16.a (archive)
  130. * lib/release/libpng.a (symlink)
  131. * lib/debug/libpng16.a
  132. * lib/debug/libpng.a
  133. Dylib is possible with some work. Most is already done and
  134. waiting in build-cmd.sh.
  135. Linux:
  136. * lib/release/libpng16.a (archive)
  137. * lib/release/libpng.a (symlink)
  138. * lib/debug/libpng16.a
  139. * lib/debug/libpng.a
  140. 5. Consumers/Dependents
  141. Packages dependent on libpng which will need attention
  142. (autobuild.xml) after changes. This is not authoritative, use
  143. appropriate build tools to find all dependents.
  144. * SDL
  145. * openjpeg (*should* be a dependency)
  146. * llqtwebkit
  147. * viewer
  148. ===================================================================
  149. Third-Party Library Repo Structure
  150. Introduction
  151. We want to have a way to capture local modifications to a third-party
  152. open-source project, such as libcurl, without needing write access to
  153. their public repository. We want to be able to carry forward such
  154. modifications to newer versions of the public project. All this
  155. should be independent of the organizational decision as to whether
  156. it's even desirable to try to submit our local modifications upstream.
  157. Fortunately, the Subversion folks articulated a process years ago that
  158. addresses this very requirement. They call it "Vendor Branches." The
  159. same tactic, suitably adapted, works with Mercurial too.
  160. The essence of the idea is that we capture and tag a particular
  161. snapshot of the open-source project. We develop our local
  162. modifications to that, and the repository tip incorporates them. But
  163. when we want to update to a newer version of the public project, we
  164. bring it into the repository in such a way that we can discover the
  165. changes from the original snapshot and the new one -- and then have
  166. Mercurial apply those deltas to the ''combined'' source.
  167. The following material is adapted from
  168. http://svnbook.red-bean.com/en/1.1/ch07s05.html, the Red Bean
  169. Subversion book, but recast for Mercurial. The Linden source for this
  170. material is an internal wiki. There may be superceding documentation
  171. on the public wiki when you read this. We recommend searching there
  172. for updates to conventions below. And note that each particular
  173. library may implement variations of this scheme.
  174. General Vendor Branch Management Procedure
  175. Managing vendor branches generally works like this. You create a
  176. named branch ("vendor") to store the vendor source snapshots. Then
  177. you import the third party code into that branch. Your modified
  178. branch (named "default") is based on "vendor". You always make your
  179. local changes to the default branch. With each new release of the
  180. code you are tracking you bring it into the "vendor" branch and merge
  181. the changes into "default", resolving whatever conflicts occur between
  182. your local changes and the upstream changes.
  183. Perhaps an example will help to clarify this algorithm. We'll use a
  184. scenario where your development team is creating a calculator program
  185. that links against a third-party complex number arithmetic library,
  186. libcomplex. We'll construct a repository specifically for our
  187. locally-modified version of that library. To begin, we must
  188. initialize our repository and create at least one file in our
  189. "default" branch.
  190. $ hg init ourcomplex
  191. $ cd ourcomplex
  192. $ touch README.txt
  193. $ hg commit README.txt
  194. Now we can create the vendor branch and do the import of the first
  195. vendor drop. We'll call our vendor branch "vendor", and each
  196. successive code drop will be tagged "current".
  197. $ hg branch vendor
  198. $ tar -xjf ../libcomplex-1.0.tar.bz2
  199. $ mv libcomplex-1.0 libcomplex
  200. $ hg addremove
  201. $ hg commit -m "1.0 source drop"
  202. $ hg tag -r tip current
  203. $ hg tag -r current 1.0
  204. We now have the current version of the libcomplex source code in
  205. branch "vendor", tagged "current" and in a non-version-specific source
  206. code subdirectory ("libcomplex"). Next, we merge it into the default
  207. branch. It is in the default branch that we will make our
  208. customizations.
  209. $ hg update default
  210. $ hg merge vendor
  211. $ hg commit -m "initial: 1.0"
  212. We get to work customizing the libcomplex code. Before we know it,
  213. our modified version of libcomplex is now completely integrated into
  214. our calculator program.
  215. A few weeks later, the developers of libcomplex release a new version
  216. of their library, version 1.1, which contains some features and
  217. functionality that we really want. We'd like to upgrade to this new
  218. version, but without losing the customizations we made to the existing
  219. version. What we essentially would like to do is to replace our
  220. current baseline version of libcomplex 1.0 with a copy of libcomplex
  221. 1.1, and then have Mercurial re-apply the custom modifications we
  222. previously made to that library to the new version. But we actually
  223. approach the problem from the other direction, applying the changes
  224. made to libcomplex between versions 1.0 and 1.1 to our modified copy
  225. of it.
  226. To perform this upgrade, we update our repository to our vendor
  227. branch, and update the "current" tag with the new libcomplex 1.1
  228. source code. We quite literally replace the existing files with the
  229. new files, clearing out the whole tree and exploding the libcomplex
  230. 1.1 release tarball in its place. The goal here is to make the tip of
  231. our vendor branch contain only the libcomplex 1.1 code, and to ensure
  232. that all that code is under version control. Oh, and we want to do
  233. this with as little version control history disturbance as possible.
  234. $ hg update vendor
  235. $ rm -rf *
  236. $ tar -xjf ../libcomplex-1.1.tar.bz2
  237. $ mv libcomplex-1.1 libcomplex
  238. $ hg addremove -s 60
  239. $ # Additional 'hg add' and 'hg rm' commands if needed
  240. $ hg commit -m "1.1 source drop"
  241. After unpacking the 1.1 tarball, hg status will show files with local
  242. modifications as well as, perhaps, some unversioned or missing files.
  243. If we did what we were supposed to do, the unversioned files are only
  244. those new files introduced in the 1.1 release of libcomplex. The
  245. missing files are files that were in 1.0 but not in 1.1. The 'hg
  246. addremove' command deals with both, and more: the '-s 60' switch
  247. directs Mercurial to compare added files to deleted files, recognizing
  248. any file at least 60% similar as a move/rename.
  249. For simple or stable libraries, the 'hg addremove' command should be
  250. reliable. For more complicated libraries subject to refactoring or
  251. large gaps of time between updates (e.g. libcurl), it can get a little
  252. lost trying to match files in the old release with files in the new
  253. release. Pay attention to the output of the command or better still,
  254. do dry runs. Files erroneously moved can be excluded with the '-X'
  255. option and then dealt with individually with 'hg add' and 'hg rm'
  256. commands after 'hg addremove'. (The readme file in the curl library
  257. should document a particularly challenging case.)
  258. Finally, once our current working copy contains only the libcomplex
  259. 1.1 code, we commit the changes we made to get it looking that way.
  260. Our current vendor branch now contains the new vendor drop. We move
  261. the 'current' tag to the new version (in the same way we previously
  262. tagged the version 1.0 vendor drop), and then merge the differences
  263. between the version 1.0 and version 1.1 into our default branch.
  264. $ hg tag -f -r tip current
  265. $ hg tag -r current 1.1
  266. $ hg update default
  267. $ hg merge vendor
  268. # resolve all the conflicts between their changes and our changes
  269. # if you will have conflicts in .hgtags, simply take *all* lines
  270. ...
  271. $ hg commit -m "update with 1.1"
  272. Any additional work needed to get the merged library working can
  273. now be done on the default branch.
  274. Revision Tags
  275. We don't currently make use of Mercurial tags in the build and release
  276. process for 3rd-party libraries. But we would like to establish a
  277. convention to document update and release points. The tags we would
  278. like to establish are:
  279. * 'current' Points to a succession of vendor releases checked into
  280. the 'vendor' branch. Will almost always be at or close to branch
  281. head.
  282. * '<version>' Tag on the 'vendor' branch pointing to a verbatim
  283. checkin of a 3rd-party's <version> release. Example: '7.21.1' for
  284. a particular version of libcurl we have used.
  285. * Release-type tags on the default branch aren't as useful given how
  286. Mercurial handles tags and how autobuild works.
  287. Schematic of a Third-Party Repository
  288. Below is the output of the 'hg glog' command showing a library project
  289. going through an initial 1.0 release and an update from the vendor to
  290. 1.1. Significant revisions in the repository lifecycle are as
  291. follows:
  292. 0 Creation of the repo with an initial file.
  293. 1 1.0 code drop on branch 'vendor'
  294. 4 Merge of 1.0 code onto branch 'default'
  295. 5 Modifications to library we wish to keep over time. Released.
  296. 6 1.1 code drop on branch 'vendor'
  297. 9 Merge of 1.1 code onto branch 'default'
  298. 10 Fixes to merge yielding production 1.1 library. Released.
  299. @ changeset: 10:888229641f6e
  300. | tag: tip
  301. | user: Monty Brandenberg <[email protected]>
  302. | date: Wed Oct 30 13:35:51 2013 -0400
  303. | summary: Work to get 1.1 merge working. Release.
  304. |
  305. o changeset: 9:925ccdf09f50
  306. |\ parent: 5:83c5775c23dc
  307. | | parent: 8:977001a08e48
  308. | | user: Monty Brandenberg <[email protected]>
  309. | | date: Wed Oct 30 13:35:20 2013 -0400
  310. | | summary: update with 1.1
  311. | |
  312. | o changeset: 8:977001a08e48
  313. | | branch: vendor
  314. | | user: Monty Brandenberg <[email protected]>
  315. | | date: Wed Oct 30 13:33:49 2013 -0400
  316. | | summary: Added tag 1.1 for changeset 5f6cb89add91
  317. | |
  318. | o changeset: 7:59bce0f6d12f
  319. | | branch: vendor
  320. | | user: Monty Brandenberg <[email protected]>
  321. | | date: Wed Oct 30 13:33:41 2013 -0400
  322. | | summary: Added tag current for changeset 5f6cb89add91
  323. | |
  324. | o changeset: 6:5f6cb89add91
  325. | | branch: vendor
  326. | | tag: current
  327. | | tag: 1.1
  328. | | parent: 3:8525ad934ecd
  329. | | user: Monty Brandenberg <[email protected]>
  330. | | date: Wed Oct 30 13:33:29 2013 -0400
  331. | | summary: 1.1 source drop
  332. | |
  333. o | changeset: 5:83c5775c23dc
  334. | | tag: 1.0
  335. | | user: Monty Brandenberg <[email protected]>
  336. | | date: Wed Oct 30 13:32:31 2013 -0400
  337. | | summary: Linden-specific changes to the library. Release
  338. | |
  339. o | changeset: 4:bccb736585f4
  340. |\| parent: 0:400e4516c406
  341. | | parent: 3:8525ad934ecd
  342. | | user: Monty Brandenberg <[email protected]>
  343. | | date: Wed Oct 30 13:31:40 2013 -0400
  344. | | summary: initial: 1.0
  345. | |
  346. | o changeset: 3:8525ad934ecd
  347. | | branch: vendor
  348. | | user: Monty Brandenberg <[email protected]>
  349. | | date: Wed Oct 30 13:30:21 2013 -0400
  350. | | summary: Added tag 1.0 for changeset 8ac3828d03bb
  351. | |
  352. | o changeset: 2:7aa1a1cb62d9
  353. | | branch: vendor
  354. | | user: Monty Brandenberg <[email protected]>
  355. | | date: Wed Oct 30 13:30:14 2013 -0400
  356. | | summary: Added tag current for changeset 8ac3828d03bb
  357. | |
  358. | o changeset: 1:8ac3828d03bb
  359. |/ branch: vendor
  360. | tag: 1.0
  361. | user: Monty Brandenberg <[email protected]>
  362. | date: Wed Oct 30 13:30:09 2013 -0400
  363. | summary: 1.0 source drop
  364. |
  365. o changeset: 0:400e4516c406
  366. user: Monty Brandenberg <[email protected]>
  367. date: Wed Oct 30 13:29:16 2013 -0400
  368. summary: Created repo with initial readme file