aboutsummaryrefslogtreecommitdiffstats
path: root/package/keynote/patches/001-build.patch
blob: b2258d472094b69bb9196b0bf99ba9e156ec8d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
diff -ru keynote-2.3/configure.in keynote-2.3.new/configure.in
--- keynote-2.3/configure.in	2000-09-27 01:16:28.000000000 +0200
+++ keynote-2.3.new/configure.in	2004-01-16 11:34:03.991537404 +0100
@@ -21,19 +21,13 @@
 AC_PATH_PROG(ECHO, echo, /bin/echo)
 AC_PATH_PROG(SED, sed, /usr/bin/sed)
 
-dnl Checks for libraries.
-LIBS="-L/usr/lib -L/usr/local/lib -L/usr/ssl/lib -L/usr/openssl/lib\
- -L/usr/local/ssl/lib -L/usr/local/openssl/lib -L/usr/pkg/lib -L/pkg/lib"
-
 AC_CHECK_LIB(m, floor, LIBS="$LIBS -lm")
 AC_CHECK_LIB(rsaref, RSAPrivateDecrypt, LIBS="$LIBS -lrsaref")
 AC_CHECK_LIB(crypto, i2a_ASN1_STRING, LIBS="$LIBS -lcrypto")
 AC_CHECK_LIB(RSAglue, RSA_ref_private_encrypt, LIBS="$LIBS -lRSAglue")
 
 dnl Checks for header files.
-CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/ssl/include\
- -I/usr/local/ssl/include -I/usr/openssl/include -I/usr/pkg/include\
- -I/usr/local/openssl/include -I/pkg/include"
+CPPFLAGS="-I/usr/include/openssl"
 
 AC_HEADER_STDC
 AC_HEADER_TIME
diff -ru keynote-2.3/keynote-keygen.c keynote-2.3.new/keynote-keygen.c
--- keynote-2.3/keynote-keygen.c	2000-09-27 02:09:13.000000000 +0200
+++ keynote-2.3.new/keynote-keygen.c	2004-01-16 11:32:06.652242269 +0100
@@ -161,7 +161,7 @@
     if (strlen(algname) + 2 > prlen)
     {
 	fprintf(stderr, "Parameter ``print-length'' should be larger "
-		"than the length of AlgorithmName (%d)\n", strlen(algname));
+		"than the length of AlgorithmName (%lu)\n", strlen(algname));
 	exit(-1);
     }
 
diff -ru keynote-2.3/keynote.l keynote-2.3.new/keynote.l
--- keynote-2.3/keynote.l	2000-08-11 22:49:13.000000000 +0200
+++ keynote-2.3.new/keynote.l	2004-01-16 11:17:29.910430978 +0100
@@ -61,7 +61,8 @@ struct lex_list
 static struct lex_list *keynote_lex_list = (struct lex_list *) NULL;
 static int    keynote_max_lex_list = 32;
 static int    keynote_lex_counter = 0;
-static int    first_tok = 0;
+extern int    first_tok;
+int    first_tok = 0;
 %}
 digit		[0-9]
 specnumber      [1-9][0-9]*
@@ -766,7 +767,7 @@
     if (0)
     {
 	yyunput(0, NULL);
-	yy_flex_realloc(0, NULL);
+	yy_flex_realloc(NULL, 0);
     }
 
     return en;
diff -ru keynote-2.3/keynote-ver.l keynote-2.3.new/keynote-ver.l
--- keynote-2.3/keynote-ver.l	2000-08-11 22:49:13.000000000 +0200
+++ keynote-2.3.new/keynote-ver.l	2004-01-16 11:31:14.667107044 +0100
@@ -267,7 +267,7 @@
     if (0)
     {
 	yyunput(0, NULL);
-	yy_flex_realloc(0, NULL);
+	yy_flex_realloc(NULL, 0);
     }
 }
 
diff -ru keynote-2.3/keynote-ver.y keynote-2.3.new/keynote-ver.y
--- keynote-2.3/keynote-ver.y	1999-10-12 00:34:29.000000000 +0200
+++ keynote-2.3.new/keynote-ver.y	2004-01-16 11:07:19.709634736 +0100
@@ -49,7 +49,7 @@
 				 return keynote_errno;
                                free($1);
                              }
-
+		;
 expr: VSTRING EQ STRING      { int i = kn_add_action(sessid, $1, $3, 0);
 
                                if (i != 0)
@@ -64,6 +64,7 @@
 			       free($1);
 			       free($3);
                              } expr 
+		;
 %%
 void
 kverror(char *s)
diff -ru keynote-2.3/keynote.y keynote-2.3.new/keynote.y
--- keynote-2.3/keynote.y	2000-06-14 08:28:23.000000000 +0200
+++ keynote-2.3.new/keynote.y	2004-01-16 11:14:55.365898229 +0100
@@ -73,8 +73,7 @@
 %}
 %%
 
-grammarswitch: LOCINI { keynote_exceptionflag = keynote_donteval = 0; }
-                localinit
+grammarswitch: LOCINI { keynote_exceptionflag = keynote_donteval = 0; } localinit
              | ACTSTR { keynote_exceptionflag = keynote_donteval = 0; } program
    	     | KEYPRE { keynote_exceptionflag = keynote_donteval = 0; }
                 keypredicate
@@ -91,17 +90,17 @@
                         STRING { keynote_lex_remove($3);
 			         keynote_privkey = $3;
 			       }
-    
+    		;
 keypredicate: /* Nothing */   { keynote_returnvalue = 0;
                                 return 0; 
                               }
        | notemptykeypredicate { keynote_returnvalue = $1;
 				return 0;
                               }
-
+		;
 notemptykeypredicate:  key     { $$ = $1; }
        		     | keyexp  { $$ = $1; }
-
+		;
 keyexp: notemptykeypredicate AND { if (($1 == 0) && !keynote_justrecord)
                                      keynote_donteval = 1;
                                  } notemptykeypredicate 
@@ -138,7 +137,7 @@
 			    else
 			      $$ = 0;
 			  }  /* K-th */
-
+			;
 keylist: key
 	    { /* Don't do anything if we're just recording */ 
               if (!keynote_justrecord && !keynote_donteval)
@@ -155,7 +154,7 @@
 
 	      keylistcount++;
             }
-
+		;
 key: str        {
 		   if (keynote_donteval)
 		     $$ = 0;
@@ -193,10 +192,10 @@
 			 }
 		   }
                  }
-
+		;
 localinit: /* Nothing */
          | localconstants
-
+		;
 localconstants: VARIABLE EQQ STRING 
 	  {
             int i;
@@ -265,12 +264,12 @@
 	    if (i != RESULT_TRUE)
 	      return -1;
 	  } localconstants
-
+		;
 program: prog { 
 	        keynote_returnvalue = $1;
 		return 0;
 	      }
-
+		;
 prog:   /* Nada */ { $$ = 0; }
        | notemptyprog {
 			  /* 
@@ -285,7 +284,7 @@
 		      else
 			$$ = $4;
                     } 
-
+		;
 notemptyprog: expr HINT afterhint
               {
 		if (checkexception($1))
@@ -300,7 +299,7 @@
 		else
 		  $$ = 0;
 	      }
-
+		;
 afterhint: str {  if (keynote_exceptionflag || keynote_donteval)
 		    $$ = 0;
 		  else
@@ -315,7 +314,7 @@
 		  }
                 }
          | OPENBLOCK prog CLOSEBLOCK { $$ = $2; }
-
+		;
 
 expr:     OPENPAREN expr CLOSEPAREN 	{ $$ = $2; }
 	| expr AND { if ($1 == 0)
@@ -334,19 +333,19 @@
 	| stringexp 			{ $$ = $1; }
         | TRUE	  		        { $$ = 1; }
         | FALSE	  		        { $$ = 0; }
-
+		;
 numexp:	  numex LT numex { $$ = $1 < $3; }
 	| numex GT numex { $$ = $1 > $3; }
 	| numex EQ numex { $$ = $1 == $3; }
 	| numex LE numex { $$ = $1 <= $3; }
 	| numex GE numex { $$ = $1 >= $3; }
 	| numex NE numex { $$ = $1 != $3; }
-
+		;
 floatexp: floatex LT floatex { $$ = $1 < $3; }
 	| floatex GT floatex { $$ = $1 > $3; }
 	| floatex LE floatex { $$ = $1 <= $3; }
 	| floatex GE floatex { $$ = $1 >= $3; }
-
+		;
 numex:	  numex PLUS numex  { $$ = $1 + $3; }
 	| numex MINUS numex { $$ = $1 - $3; }
 	| numex MULT numex  { $$ = $1 * $3; }
@@ -384,7 +383,7 @@
 					      free($2);
 					  }
 					}
-
+		;
 floatex:  floatex PLUS floatex  	{ $$ = ($1 + $3); }
 	| floatex MINUS floatex 	{ $$ = ($1 - $3); }
 	| floatex MULT floatex          { $$ = ($1 * $3); }
@@ -418,7 +417,7 @@
 					      free($2);
 					  }
 	                                }
-
+		;
 stringexp: str EQ str {
                         if (keynote_exceptionflag || keynote_donteval)
 			  $$ = 0;
@@ -529,9 +528,9 @@
 		      if (i == 0)
 		      {
 #if !defined(HAVE_SNPRINTF)
-			  sprintf(grp, "%d", preg.re_nsub);
+			  sprintf(grp, "%d", (int)preg.re_nsub);
 #else /* !HAVE_SNPRINTF */
-			  snprintf(grp, 3, "%d", preg.re_nsub);
+			  snprintf(grp, 3, "%d", (int)preg.re_nsub);
 #endif /* !HAVE_SNPRINTF */
 			  if (keynote_env_add("_0", grp, &keynote_temp_list,
 					      1, 0) != RESULT_TRUE)
@@ -579,7 +578,7 @@
 		  }
 	      }
 	    }
-
+		;
 str: str DOTT str    {  if (keynote_exceptionflag || keynote_donteval)
 			  $$ = (char *) NULL;
 			else
@@ -605,7 +604,7 @@
 			}
 		      }
 	| strnotconcat { $$ = $1; }
-
+		;
 strnotconcat: STRING 	                { $$ = $1; }
         | OPENPAREN str CLOSEPAREN 	{ $$ = $2; }
         | VARIABLE      {  if (keynote_exceptionflag || keynote_donteval)
@@ -660,6 +659,7 @@
 				  return -1;
 			    }
 			 }
+		;
 %%
 
 /*
diff -ru keynote-2.3/Makefile.in keynote-2.3.new/Makefile.in
--- keynote-2.3/Makefile.in	2000-09-27 01:16:27.000000000 +0200
+++ keynote-2.3.new/Makefile.in	2004-01-16 11:35:38.841528129 +0100
@@ -41,7 +41,8 @@
 YACCFLAGS = -d -p kn -b k
 LEXFLAGS2 = -Pkv -s -i
 LEXFLAGS = -Cr -Pkn -s -i
-CFLAGS = -O2 -Wall # -g
+CFLAGS = -O2 -Wall -fno-strict-aliasing # -g
+LDFLAGS = @LDFLAGS@
 RMFLAGS2 = -rf
 RMFLAGS = -f
 NROFFFLAGS = -mandoc
@@ -83,7 +84,7 @@
 	$(RANLIB) $(TARGET)
 
 $(TARGET2): $(TARGET) $(OBJS2)
-	$(CC) $(CFLAGS) -o $(TARGET2) $(OBJS2) $(LIBS)
+	$(CC) $(CFLAGS) -o $(TARGET2) $(OBJS2) $(LDFLAGS) $(LIBS)
 
 k.tab.c: keynote.y header.h keynote.h assertion.h config.h
 	$(YACC) $(YACCFLAGS) keynote.y
diff -ru keynote-2.3/signature.c keynote-2.3.new/signature.c
--- keynote-2.3/signature.c	1999-10-12 00:34:31.000000000 +0200
+++ keynote-2.3.new/signature.c	2004-01-16 11:30:48.062084986 +0100
@@ -515,7 +515,7 @@
 	kk = dc->dec_key;
 	if (keytype == KEYNOTE_PRIVATE_KEY)
 	{
-	    if (d2i_DSAPrivateKey((DSA **) &kk, &decoded, len) == (DSA *) NULL)
+	    if (d2i_DSAPrivateKey((DSA **) &kk, (const unsigned char **) &decoded, len) == (DSA *) NULL)
 	    {
 		if (ptr != (unsigned char *) NULL)
 		  free(ptr);
@@ -526,7 +526,7 @@
 	}
 	else
 	{
-	    if (d2i_DSAPublicKey((DSA **) &kk, &decoded, len) == (DSA *) NULL)
+	    if (d2i_DSAPublicKey((DSA **) &kk, (const unsigned char **) &decoded, len) == (DSA *) NULL)
 	    {
 		if (ptr != (unsigned char *) NULL)
 		  free(ptr);
@@ -556,7 +556,7 @@
         kk = dc->dec_key;
         if (keytype == KEYNOTE_PRIVATE_KEY)
         {
-            if (d2i_RSAPrivateKey((RSA **) &kk, &decoded, len) == (RSA *) NULL)
+            if (d2i_RSAPrivateKey((RSA **) &kk, (const unsigned char **) &decoded, len) == (RSA *) NULL)
             {
                 if (ptr != (unsigned char *) NULL)
                   free(ptr);
@@ -567,7 +567,7 @@
         }
         else
         {
-            if (d2i_RSAPublicKey((RSA **) &kk, &decoded, len) == (RSA *) NULL)
+            if (d2i_RSAPublicKey((RSA **) &kk, (const unsigned char **) &decoded, len) == (RSA *) NULL)
             {
                 if (ptr != (unsigned char *) NULL)
                   free(ptr);