smock: add --overwrite option
[fedora-mingw.git] / popt / popt-win.patch
1 diff -urN --exclude CVS popt/autogen.sh popt.win/autogen.sh
2 --- popt/autogen.sh     2008-02-11 16:48:11.000000000 +0000
3 +++ popt.win/autogen.sh 2008-10-25 14:54:06.000000000 +0100
4 @@ -5,6 +5,8 @@
5  
6  THEDIR="`pwd`"
7  
8 +../gnulib/gnulib-tool --update
9 +
10  libtoolize=`which glibtoolize 2>/dev/null`
11  case $libtoolize in
12  /*) ;;
13 diff -urN --exclude CVS popt/configure.ac popt.win/configure.ac
14 --- popt/configure.ac   2008-10-04 20:23:50.000000000 +0100
15 +++ popt.win/configure.ac       2008-10-25 14:57:59.000000000 +0100
16 @@ -1,4 +1,4 @@
17 -AC_PREREQ(2.57)
18 +AC_PREREQ([2.59])
19  AC_INIT(popt, 1.15, popt-devel@rpm5.org)
20  AC_CANONICAL_TARGET
21  AC_CONFIG_SRCDIR([popt.h])
22 @@ -17,6 +17,7 @@
23  ALL_LINGUAS="cs da de eo es fi fr ga gl hu id is it ja ko nb nl pl pt ro ru sk sl sv th tr uk vi wa zh_TW zh_CN"
24  
25  AC_PROG_CC
26 +gl_EARLY
27  AC_PROG_INSTALL
28  AC_PROG_LIBTOOL
29  
30 @@ -44,7 +45,10 @@
31  AC_ISC_POSIX
32  AM_C_PROTOTYPES
33  
34 -AC_CHECK_HEADERS(float.h glob.h langinfo.h libintl.h mcheck.h unistd.h)
35 +dnl Gnulib tests.
36 +gl_INIT
37 +
38 +AC_CHECK_HEADERS(float.h glob.h langinfo.h libintl.h mcheck.h unistd.h sys/ioctl.h)
39  
40  # For some systems we know that we have ld_version scripts.
41  # Use it then as default.
42 @@ -68,7 +72,7 @@
43  AC_CHECK_FUNC(setreuid, [], [
44      AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
45  ])
46 -AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf)
47 +AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf random srandom)
48  
49  AM_GNU_GETTEXT([external])
50  AM_ICONV_LINK
51 @@ -82,4 +86,4 @@
52         [Full path to popt top_srcdir.])
53  AC_SUBST(POPT_SOURCE_PATH)
54  
55 -AC_OUTPUT([Doxyfile Makefile po/Makefile.in])
56 +AC_OUTPUT([Doxyfile Makefile lib/Makefile])
57 diff -urN --exclude CVS popt/.cvsignore popt.win/.cvsignore
58 --- popt/.cvsignore     2008-05-05 20:27:31.000000000 +0100
59 +++ popt.win/.cvsignore 2008-10-25 14:27:02.000000000 +0100
60 @@ -41,3 +41,4 @@
61  *.lo
62  *.swp
63  popt-*.tar.gz
64 +link-warning.h
65 diff -urN --exclude CVS popt/m4/gnulib-cache.m4 popt.win/m4/gnulib-cache.m4
66 --- popt/m4/gnulib-cache.m4     1970-01-01 01:00:00.000000000 +0100
67 +++ popt.win/m4/gnulib-cache.m4 2008-10-25 14:27:02.000000000 +0100
68 @@ -0,0 +1,35 @@
69 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
70 +#
71 +# This file is free software, distributed under the terms of the GNU
72 +# General Public License.  As a special exception to the GNU General
73 +# Public License, this file may be distributed as part of a program
74 +# that contains a configuration script generated by Autoconf, under
75 +# the same distribution terms as the rest of that program.
76 +#
77 +# Generated by gnulib-tool.
78 +#
79 +# This file represents the specification of how gnulib-tool is used.
80 +# It acts as a cache: It is written and read by gnulib-tool.
81 +# In projects using CVS, this file is meant to be stored in CVS,
82 +# like the configure.ac and various Makefile.am files.
83 +
84 +
85 +# Specification in the form of a command-line invocation:
86 +#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --libtool --macro-prefix=gl glob
87 +
88 +# Specification in the form of a few gnulib-tool.m4 macro invocations:
89 +gl_LOCAL_DIR([])
90 +gl_MODULES([
91 +  glob
92 +])
93 +gl_AVOID([])
94 +gl_SOURCE_BASE([lib])
95 +gl_M4_BASE([m4])
96 +gl_PO_BASE([])
97 +gl_DOC_BASE([doc])
98 +gl_TESTS_BASE([tests])
99 +gl_LIB([libgnu])
100 +gl_MAKEFILE_NAME([])
101 +gl_LIBTOOL
102 +gl_MACRO_PREFIX([gl])
103 +gl_PO_DOMAIN([])
104 diff -urN --exclude CVS popt/Makefile.am popt.win/Makefile.am
105 --- popt/Makefile.am    2008-09-18 19:08:58.000000000 +0100
106 +++ popt.win/Makefile.am        2008-10-25 14:56:28.000000000 +0100
107 @@ -8,9 +8,10 @@
108         footer_no_timestamp.html libpopt.vers \
109         testit.sh test-poptrc test3-data/0* \
110         po/*.in po/*.po po/popt.pot \
111 -       popt.ps
112 +       popt.ps \
113 +       m4/gnulib-cache.m4
114  
115 -SUBDIRS = po
116 +SUBDIRS = lib po
117  
118  INCLUDES = -I. -I$(top_srcdir)
119  
120 diff -urN --exclude CVS popt/popt.c popt.win/popt.c
121 --- popt/popt.c 2008-05-05 18:38:33.000000000 +0100
122 +++ popt.win/popt.c     2008-10-25 14:38:29.000000000 +0100
123 @@ -725,6 +725,21 @@
124  /*@=unqualifiedtrans =nullstate@*/
125  }
126  
127 +/* Win32 typically lacks random/srandom, but has rand/srand which
128 + * produces frankly rubbish random numbers and has RAND_MAX = 0x7FFF.
129 + */
130 +#ifndef HAVE_RANDOM
131 +static int
132 +random ()
133 +{
134 +  return rand () << 15 | rand ();
135 +}
136 +#endif
137 +
138 +#ifndef HAVE_SRANDOM
139 +#define srandom srand
140 +#endif
141 +
142  /*@unchecked@*/
143  static unsigned int seed = 0;
144  
145 diff -urN --exclude CVS popt/popthelp.c popt.win/popthelp.c
146 --- popt/popthelp.c     2008-04-26 22:57:32.000000000 +0100
147 +++ popt.win/popthelp.c 2008-10-25 14:35:01.000000000 +0100
148 @@ -12,8 +12,10 @@
149  
150  #define        POPT_USE_TIOCGWINSZ
151  #ifdef POPT_USE_TIOCGWINSZ
152 +#ifdef HAVE_SYS_IOCTL_H
153  #include <sys/ioctl.h>
154  #endif
155 +#endif
156  
157  #define        POPT_WCHAR_HACK
158  #ifdef         POPT_WCHAR_HACK