openwrt/package/keynote/patches/001-build.patch

338 lines
9.5 KiB
Diff
Raw Normal View History

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);