Advertisement
Guest User

Untitled

a guest
May 28th, 2017
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.77 KB | None | 0 0
  1. # This is a shell script that calls functions and scripts from
  2. # tml@iki.fi's personal work environment. It is not expected to be
  3. # usable unmodified by others, and is included only for reference.
  4.  
  5. MOD=gettext
  6. VER=0.17
  7. REV=3
  8. ARCH=win64
  9.  
  10. THIS=${MOD}_${VER}-${REV}_${ARCH}
  11.  
  12. # Note that this build script is different from most of my build
  13. # scripts, as it produces two sets of packages: "gettext-runtime" and
  14. # "gettext-tools", and no packages called just "gettext".
  15.  
  16. RUNTIMERUNZIP=${MOD}-runtime_${VER}-${REV}_${ARCH}.zip
  17. RUNTIMEDEVZIP=${MOD}-runtime-dev_${VER}-${REV}_${ARCH}.zip
  18.  
  19. TOOLSRUNZIP=${MOD}-tools_${VER}-${REV}_${ARCH}.zip
  20. TOOLSDEVZIP=${MOD}-tools-dev_${VER}-${REV}_${ARCH}.zip
  21.  
  22. HEX=`echo $THIS | md5sum | cut -d' ' -f1`
  23. TARGET=c:/devel/target/$HEX
  24.  
  25. usemingw64
  26. usemsvs9x64
  27.  
  28. (
  29.  
  30. set -x
  31.  
  32. WIN_ICONV=`latest --arch=${ARCH} win-iconv`
  33.  
  34. # Verify this from gettext-runtime/intl/Makefile.in
  35. LTV_CURRENT_MINUS_AGE=8
  36.  
  37. patch -p0 <<'EOF'
  38. --- /dev/null
  39. +++ gettext-runtime/intl/intl.def
  40. @@ -0,0 +1,29 @@
  41. +EXPORTS
  42. +_nl_msg_cat_cntr DATA
  43. +bind_textdomain_codeset
  44. +bindtextdomain
  45. +dcgettext
  46. +dcngettext
  47. +dgettext
  48. +dngettext
  49. +gettext
  50. +libintl_bind_textdomain_codeset
  51. +libintl_bindtextdomain
  52. +libintl_dcgettext
  53. +libintl_dcngettext
  54. +libintl_dgettext
  55. +libintl_dngettext
  56. +libintl_fprintf
  57. +libintl_gettext
  58. +libintl_ngettext
  59. +libintl_printf
  60. +libintl_set_relocation_prefix
  61. +libintl_snprintf
  62. +libintl_sprintf
  63. +libintl_textdomain
  64. +libintl_vfprintf
  65. +libintl_vprintf
  66. +libintl_vsprintf
  67. +libintl_vsnprintf
  68. +ngettext
  69. +textdomain
  70. --- gettext-runtime/intl/printf.c
  71. +++ gettext-runtime/intl/printf.c
  72. @@ -69,7 +69,7 @@
  73. #define STATIC static
  74.  
  75. /* This needs to be consistent with libgnuintl.h.in. */
  76. -#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
  77. +#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
  78. /* Don't break __attribute__((format(printf,M,N))).
  79. This redefinition is only possible because the libc in NetBSD, Cygwin,
  80. mingw does not have a function __printf__. */
  81. --- gettext-runtime/intl/libgnuintl.h.in
  82. +++ gettext-runtime/intl/libgnuintl.h.in
  83. @@ -330,7 +330,7 @@
  84. extern int vfprintf (FILE *, const char *, va_list);
  85.  
  86. #undef printf
  87. -#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
  88. +#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
  89. /* Don't break __attribute__((format(printf,M,N))).
  90. This redefinition is only possible because the libc in NetBSD, Cygwin,
  91. mingw does not have a function __printf__. */
  92. diff -ru C:/DOCUME~1/tml/LOCALS~1/Temp/gettext-0.17/gettext-runtime/intl/Makefile.in ./gettext-runtime/intl/Makefile.in
  93. --- C:/DOCUME~1/tml/LOCALS~1/Temp/gettext-0.17/gettext-runtime/intl/Makefile.in 2007-11-04 23:21:12.000000000 +0200
  94. +++ gettext-runtime/intl/Makefile.in 2007-11-26 01:59:34.599000000 +0200
  95. @@ -85,7 +85,7 @@
  96. CPPFLAGS = @CPPFLAGS@
  97. CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
  98. LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
  99. -LDFLAGS_yes = -Wl,--export-all-symbols
  100. +LDFLAGS_yes = intl.def
  101. LDFLAGS_no =
  102. LIBS = @LIBS@
  103.  
  104. --- gettext-tools/gnulib-lib/clean-temp.c
  105. +++ gettext-tools/gnulib-lib/clean-temp.c
  106. @@ -66,9 +66,11 @@
  107. # endif
  108. #endif
  109.  
  110. +#ifndef _WIN64
  111. #ifndef uintptr_t
  112. # define uintptr_t unsigned long
  113. #endif
  114. +#endif
  115.  
  116. #if !GNULIB_FCNTL_SAFER
  117. /* The results of open() in this file are not used with fchdir,
  118. --- gettext-tools/gnulib-lib/fstrcmp.c
  119. +++ gettext-tools/gnulib-lib/fstrcmp.c
  120. @@ -55,9 +55,11 @@
  121. #include "minmax.h"
  122. #include "xalloc.h"
  123.  
  124. +#ifndef _WIN64
  125. #ifndef uintptr_t
  126. # define uintptr_t unsigned long
  127. #endif
  128. +#endif
  129.  
  130.  
  131. #define ELEMENT char
  132. --- gettext-tools/gnulib-lib/gl_array_list.c
  133. +++ gettext-tools/gnulib-lib/gl_array_list.c
  134. @@ -55,9 +55,11 @@
  135. /* Checked size_t computations. */
  136. #include "xsize.h"
  137.  
  138. +#ifndef _WIN64
  139. #ifndef uintptr_t
  140. # define uintptr_t unsigned long
  141. #endif
  142. +#endif
  143.  
  144. /* -------------------------- gl_list_t Data Type -------------------------- */
  145.  
  146. --- gettext-tools/gnulib-lib/gl_linkedhash_list.c
  147. +++ gettext-tools/gnulib-lib/gl_linkedhash_list.c
  148. @@ -55,9 +55,11 @@
  149. #include "xalloc.h"
  150. #include "xsize.h"
  151.  
  152. +#ifndef _WIN64
  153. #ifndef uintptr_t
  154. # define uintptr_t unsigned long
  155. #endif
  156. +#endif
  157.  
  158. #define WITH_HASHTABLE 1
  159.  
  160. --- gettext-tools/gnulib-lib/tempname.c
  161. +++ gettext-tools/gnulib-lib/tempname.c
  162. @@ -54,6 +54,10 @@
  163. #include <stdint.h>
  164. #include <unistd.h>
  165.  
  166. +#ifdef _WIN32
  167. +# include <direct.h>
  168. +#endif
  169. +
  170. #include <sys/stat.h>
  171.  
  172. #if _LIBC
  173. @@ -73,6 +73,10 @@
  174. # define __xstat64(version, file, buf) stat (file, buf)
  175. #endif
  176.  
  177. +#ifdef _WIN32
  178. +# define mkdir(path,mode) _mkdir(path)
  179. +#endif
  180. +
  181. #if ! (HAVE___SECURE_GETENV || _LIBC)
  182. # define __secure_getenv getenv
  183. #endif
  184. --- gettext-tools/gnulib-lib/w32spawn.h
  185. +++ gettext-tools/gnulib-lib/w32spawn.h
  186. @@ -22,6 +22,7 @@
  187. /* Get _get_osfhandle() and _open_osfhandle(). */
  188. #include <io.h>
  189.  
  190. +#include <stdint.h>
  191. #include <stdbool.h>
  192. #include <string.h>
  193. #include <errno.h>
  194. @@ -47,7 +47,7 @@
  195. error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 0x%08x"),
  196. GetLastError ());
  197.  
  198. - nfd = _open_osfhandle ((long) new_handle, O_BINARY);
  199. + nfd = _open_osfhandle ((intptr_t) new_handle, O_BINARY);
  200. if (nfd < 0)
  201. error (EXIT_FAILURE, errno, _("_open_osfhandle failed"));
  202.  
  203. --- gettext-tools/src/write-java.c
  204. +++ gettext-tools/src/write-java.c
  205. @@ -30,6 +30,10 @@
  206. #include <stdio.h>
  207. #include <string.h>
  208.  
  209. +#ifdef _WIN32
  210. +# include <direct.h>
  211. +#endif
  212. +
  213. #include <sys/stat.h>
  214. #if !defined S_ISDIR && defined S_IFDIR
  215. # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
  216. @@ -53,6 +53,10 @@
  217. # define S_IXUSR 00100
  218. #endif
  219.  
  220. +#ifdef _WIN32
  221. +# define mkdir(path,mode) _mkdir(path)
  222. +#endif
  223. +
  224. #include "c-ctype.h"
  225. #include "error.h"
  226. #include "xerror.h"
  227. --- gettext-tools/src/write-csharp.c
  228. +++ gettext-tools/src/write-csharp.c
  229. @@ -29,6 +29,10 @@
  230. #include <stdio.h>
  231. #include <string.h>
  232.  
  233. +#ifdef _WIN32
  234. +# include <direct.h>
  235. +#endif
  236. +
  237. #include <sys/stat.h>
  238. #if !defined S_ISDIR && defined S_IFDIR
  239. # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
  240. @@ -70,6 +70,10 @@
  241. # define S_IXOTH (S_IXUSR >> 6)
  242. #endif
  243.  
  244. +#ifdef _WIN32
  245. +# define mkdir(path,mode) _mkdir(path)
  246. +#endif
  247. +
  248. #include "c-ctype.h"
  249. #include "relocatable.h"
  250. #include "error.h"
  251. EOF
  252.  
  253. lt_cv_deplibs_check_method='pass_all' \
  254. CC='x86_64-w64-mingw32-gcc' \
  255. CFLAGS=-O2 \
  256. ./configure --host=x86_64-w64-mingw32 \
  257. --disable-static \
  258. --disable-java \
  259. --enable-relocatable \
  260. --disable-openmp \
  261. --disable-largefile \
  262. --with-libiconv-prefix=/devel/dist/${ARCH}/${WIN_ICONV} \
  263. --prefix=c:/devel/target/$HEX &&
  264.  
  265. sed -e 's/need_relink=yes/need_relink=no/' <gettext-tools/libtool >gettext-tools/libtool.temp && mv gettext-tools/libtool.temp gettext-tools/libtool &&
  266. PATH=/devel/target/$HEX/bin:$PATH make install &&
  267.  
  268. (cd /devel/target/$HEX &&
  269. echo 'LIBRARY libintl-'${LTV_CURRENT_MINUS_AGE}'.dll
  270. EXPORTS
  271. _nl_msg_cat_cntr DATA
  272. bind_textdomain_codeset
  273. bindtextdomain
  274. dcgettext
  275. dcngettext
  276. dgettext
  277. dngettext
  278. gettext
  279. libintl_bind_textdomain_codeset
  280. libintl_bindtextdomain
  281. libintl_dcgettext
  282. libintl_dcngettext
  283. libintl_dgettext
  284. libintl_dngettext
  285. libintl_fprintf
  286. libintl_gettext
  287. libintl_ngettext
  288. libintl_printf
  289. libintl_set_relocation_prefix
  290. libintl_snprintf
  291. libintl_sprintf
  292. libintl_textdomain
  293. libintl_vfprintf
  294. libintl_vprintf
  295. libintl_vsnprintf
  296. libintl_vsprintf
  297. ngettext
  298. textdomain' >lib/libintl.def &&
  299.  
  300. # Split into gettext-runtime and gettext-tools as suggested in the
  301. # PACKAGING file. Additionally split gettext-runtime into "real
  302. # runtime" and "developer" packages. For gettext-tools the "runtime"
  303. # package is empty, as tools by definition are for developers.
  304.  
  305. rm -f /tmp/$RUNTIMERUNZIP /tmp/$RUNTIMEDEVZIP &&
  306.  
  307. zip /tmp/$RUNTIMERUNZIP bin/libintl-${LTV_CURRENT_MINUS_AGE}.dll &&
  308. zip /tmp/$RUNTIMERUNZIP lib/charset.alias &&
  309. zip /tmp/$RUNTIMERUNZIP share/locale/locale.alias &&
  310.  
  311. zip /tmp/$RUNTIMEDEVZIP lib/libintl.dll.a &&
  312. (cd lib && lib.exe -machine:x64 -def:libintl.def -out:intl.lib) &&
  313. zip /tmp/$RUNTIMEDEVZIP lib/libintl.def lib/intl.lib &&
  314. zip /tmp/$RUNTIMEDEVZIP include/libintl.h &&
  315. zip /tmp/$RUNTIMEDEVZIP bin/{{,n}gettext,envsubst}.exe &&
  316. zip /tmp/$RUNTIMEDEVZIP bin/gettext.sh &&
  317. zip -r -D /tmp/$RUNTIMEDEVZIP share/man/man1/{{,n}gettext,envsubst}.1 &&
  318. zip -r -D /tmp/$RUNTIMEDEVZIP share/doc/gettext/{{,n}gettext,envsubst}.1.html &&
  319. zip /tmp/$RUNTIMEDEVZIP share/locale/*/LC_MESSAGES/gettext-runtime.mo &&
  320. zip /tmp/$RUNTIMEDEVZIP share/doc/gettext/*.3.html &&
  321. zip /tmp/$RUNTIMEDEVZIP lib/GNU.Gettext.dll &&
  322. zip -r -D /tmp/$RUNTIMEDEVZIP share/doc/gettext/csharpdoc &&
  323. zip /tmp/$RUNTIMEDEVZIP bin/libasprintf*.dll &&
  324. (cd /opt/mingw64 && zip /tmp/$RUNTIMEDEVZIP bin/libgcc_s_sjlj-1.dll) &&
  325. zip /tmp/$RUNTIMEDEVZIP lib/libasprintf.dll.a &&
  326. zip /tmp/$RUNTIMEDEVZIP include/autosprintf.h &&
  327. zip -r -D /tmp/$RUNTIMEDEVZIP share/doc/libasprintf &&
  328. # zip /tmp/$RUNTIMEDEVZIP info/autosprintf.info &&
  329.  
  330. rm -f /tmp/$TOOLSRUNZIP /tmp/$TOOLSDEVZIP &&
  331.  
  332. # the TOOLSRUNZIP is empty. created only because some of my scripts
  333. # want both a foo and foo-dev zipfile.
  334. zip /tmp/$TOOLSRUNZIP nul &&
  335. zip -d /tmp/$TOOLSRUNZIP nul &&
  336.  
  337. # Now the problem is to put everything else into the TOOLSDEVZIP...
  338.  
  339. zip /tmp/$TOOLSDEVZIP bin/{autopoint,gettextize,msg*,recode,xgettext} &&
  340. (cd /opt/mingw64 && zip /tmp/$TOOLSDEVZIP bin/libgcc_s_sjlj-1.dll) &&
  341. zip /tmp/$TOOLSDEVZIP share/man/man1/msg*.1 &&
  342. zip /tmp/$TOOLSDEVZIP share/man/man1/xgettext.1
  343. zip /tmp/$TOOLSDEVZIP share/man/man1/gettextize.1 &&
  344. zip /tmp/$TOOLSDEVZIP share/man/man1/autopoint.1 &&
  345. zip /tmp/$TOOLSDEVZIP share/doc/gettext/msg*.1.html &&
  346. zip /tmp/$TOOLSDEVZIP share/doc/gettext/xgettext.1.html &&
  347. zip /tmp/$TOOLSDEVZIP share/doc/gettext/gettextize.1.html &&
  348. zip /tmp/$TOOLSDEVZIP share/doc/gettext/autopoint.1.html &&
  349. zip /tmp/$TOOLSDEVZIP share/doc/gettext/gettext_*.html &&
  350. zip /tmp/$TOOLSDEVZIP share/doc/gettext/FAQ.html &&
  351. zip /tmp/$TOOLSDEVZIP share/doc/gettext/examples/* &&
  352. # zip /tmp/$TOOLSDEVZIP info/gettext.info* &&
  353. zip /tmp/$TOOLSDEVZIP include/gettext-po.h &&
  354. zip /tmp/$TOOLSDEVZIP bin/libgettextlib*.dll &&
  355. zip /tmp/$TOOLSDEVZIP bin/libgettextsrc*.dll &&
  356. zip /tmp/$TOOLSDEVZIP bin/libgettextpo*.dll &&
  357. zip /tmp/$TOOLSDEVZIP lib/gettext/* &&
  358. zip /tmp/$TOOLSDEVZIP share/locale/*/LC_MESSAGES/gettext-tools.mo &&
  359. zip /tmp/$TOOLSDEVZIP share/gettext/config.rpath &&
  360. zip /tmp/$TOOLSDEVZIP share/gettext/intl/* &&
  361. zip /tmp/$TOOLSDEVZIP share/gettext/po/* &&
  362. zip /tmp/$TOOLSDEVZIP share/gettext/projects/* &&
  363. zip /tmp/$TOOLSDEVZIP share/gettext/gettext.h &&
  364. zip /tmp/$TOOLSDEVZIP share/gettext/archive.tar.gz &&
  365. zip /tmp/$TOOLSDEVZIP share/aclocal/codeset.m4 &&
  366. zip /tmp/$TOOLSDEVZIP share/aclocal/gettext.m4 &&
  367. zip /tmp/$TOOLSDEVZIP share/aclocal/glibc2.m4 &&
  368. zip /tmp/$TOOLSDEVZIP share/aclocal/glibc21.m4 &&
  369. zip /tmp/$TOOLSDEVZIP share/aclocal/iconv.m4 &&
  370. zip /tmp/$TOOLSDEVZIP share/aclocal/intdiv0.m4 &&
  371. zip /tmp/$TOOLSDEVZIP share/aclocal/intl.m4 &&
  372. zip /tmp/$TOOLSDEVZIP share/aclocal/intldir.m4 &&
  373. zip /tmp/$TOOLSDEVZIP share/aclocal/intlmacosx.m4 &&
  374. zip /tmp/$TOOLSDEVZIP share/aclocal/intmax.m4 &&
  375. zip /tmp/$TOOLSDEVZIP share/aclocal/inttypes_h.m4 &&
  376. zip /tmp/$TOOLSDEVZIP share/aclocal/inttypes-pri.m4 &&
  377. zip /tmp/$TOOLSDEVZIP share/aclocal/lcmessage.m4 &&
  378. zip /tmp/$TOOLSDEVZIP share/aclocal/lib-ld.m4 &&
  379. zip /tmp/$TOOLSDEVZIP share/aclocal/lib-link.m4 &&
  380. zip /tmp/$TOOLSDEVZIP share/aclocal/lib-prefix.m4 &&
  381. zip /tmp/$TOOLSDEVZIP share/aclocal/lock.m4 &&
  382. zip /tmp/$TOOLSDEVZIP share/aclocal/longlong.m4 &&
  383. zip /tmp/$TOOLSDEVZIP share/aclocal/nls.m4 &&
  384. zip /tmp/$TOOLSDEVZIP share/aclocal/po.m4 &&
  385. zip /tmp/$TOOLSDEVZIP share/aclocal/printf-posix.m4 &&
  386. zip /tmp/$TOOLSDEVZIP share/aclocal/progtest.m4 &&
  387. zip /tmp/$TOOLSDEVZIP share/aclocal/size_max.m4 &&
  388. zip /tmp/$TOOLSDEVZIP share/aclocal/stdint_h.m4 &&
  389. zip /tmp/$TOOLSDEVZIP share/aclocal/uintmax_t.m4 &&
  390. zip /tmp/$TOOLSDEVZIP share/aclocal/visibility.m4 &&
  391. zip /tmp/$TOOLSDEVZIP share/aclocal/wchar_t.m4 &&
  392. zip /tmp/$TOOLSDEVZIP share/aclocal/wint_t.m4 &&
  393. zip /tmp/$TOOLSDEVZIP share/aclocal/xsize.m4 &&
  394. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/po-compat.el &&
  395. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/po-compat.elc &&
  396. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/po-mode.el &&
  397. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/po-mode.elc &&
  398. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/start-po.el &&
  399. zip /tmp/$TOOLSDEVZIP share/emacs/site-lisp/start-po.elc &&
  400.  
  401. : )
  402.  
  403. ) 2>&1 | tee /devel/src/tml/packaging/$THIS.log
  404.  
  405. # Put this script and the log file in both dev packages
  406. (cd /devel && zip /tmp/$RUNTIMEDEVZIP src/tml/packaging/$THIS.{sh,log}) &&
  407. (cd /devel && zip /tmp/$TOOLSDEVZIP src/tml/packaging/$THIS.{sh,log}) &&
  408.  
  409. manifestify /tmp/$RUNTIMERUNZIP /tmp/$RUNTIMEDEVZIP &&
  410. manifestify /tmp/$TOOLSRUNZIP /tmp/$TOOLSDEVZIP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement