This isn't the right fix imho.
js/src needs to build standalone, not include config.h.
Otherwise, JS is gonna become MANDATORY INTERNAL to rpm.
73 de Jeff
On Jul 23, 2009, at 3:19 PM, Per Øyvind Karlsen wrote:
RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
Server: rpm5.org Name: Per Øyvind Karlsen
Root: /v/rpm/cvs Email: pkarl...@rpm5.org
Module: rpm js Date: 23-Jul-2009 21:19:08
Branch: rpm-5_2 Handle: 2009072319190800
Modified files: (Branch: rpm-5_2)
js/src jsprf.c jsstddef.h
rpm configure.ac
Log:
fix va_list autofoo stuff breaking libjs build
Summary:
RevisionChanges Path
1.1.1.1.2.1 +1 -13 js/src/jsprf.c
1.1.1.1.2.1 +1 -0 js/src/jsstddef.h
2.372.2.6 +28 -0 rpm/configure.ac
patch -p0 '@@ .'
Index: js/src/jsprf.c
=
=
=
=
=
=
==
$ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 jsprf.c
--- js/src/jsprf.c 20 Apr 2009 18:27:13 - 1.1.1.1
+++ js/src/jsprf.c 23 Jul 2009 19:19:08 - 1.1.1.1.2.1
@@ -53,18 +53,6 @@
#include jsstr.h
/*
-** Note: on some platforms va_list is defined as an array,
-** and requires array notation.
-*/
-#ifdef HAVE_VA_COPY
-#define VARARGS_ASSIGN(foo, bar)VA_COPY(foo,bar)
-#elif defined(HAVE_VA_LIST_AS_ARRAY)
-#define VARARGS_ASSIGN(foo, bar)foo[0] = bar[0]
-#else
-#define VARARGS_ASSIGN(foo, bar)(foo) = (bar)
-#endif
-
-/*
** WARNING: This code may *NOT* call JS_LOG (because JS_LOG calls
it)
*/
@@ -641,7 +629,7 @@
continue;
}
-VARARGS_ASSIGN(nas[cn].ap, ap);
+va_copy(nas[cn].ap, ap);
switch( nas[cn].type ){
case TYPE_INT16:
@@ .
patch -p0 '@@ .'
Index: js/src/jsstddef.h
=
=
=
=
=
=
==
$ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 jsstddef.h
--- js/src/jsstddef.h 20 Apr 2009 18:27:12 - 1.1.1.1
+++ js/src/jsstddef.h 23 Jul 2009 19:19:08 - 1.1.1.1.2.1
@@ -79,5 +79,6 @@
#endif
#include stddef.h
+#include config.h
@@ .
patch -p0 '@@ .'
Index: rpm/configure.ac
=
=
=
=
=
=
==
$ cvs diff -u -r2.372.2.5 -r2.372.2.6 configure.ac
--- rpm/configure.ac 21 May 2009 14:49:50 - 2.372.2.5
+++ rpm/configure.ac 23 Jul 2009 19:19:08 - 2.372.2.6
@@ -566,6 +566,34 @@
dnl # specific features
AC_SYS_LARGEFILE
+
+dnl Does this platform require array notation to assign to a
va_list?
+dnl If cross-compiling, we assume va_list is normal. If this
breaks
+dnl you, set ac_cv_valistisarray=true and maybe define
HAVE_VA_LIST_AS_ARRAY
+dnl also just to be sure.
+AC_MSG_CHECKING(whether va_list assignments need array notation)
+AC_CACHE_VAL(ac_cv_valistisarray,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include stdlib.h
+#include stdarg.h
+ void foo(int i, ...) {
+ va_list ap1, ap2;
+ va_start(ap1, i);
+ ap2 = ap1;
+ if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123)
+ { exit(1); }
+ va_end(ap1); va_end(ap2);
+ }
+ int main() { foo(0, 123); return(0); }]])],
[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],
[ac_cv_valistisarray=false])])
+
+if test $ac_cv_valistisarray = true ; then
+ AC_DEFINE(HAVE_VA_LIST_AS_ARRAY, 1,
+ [Define as 1 if your va_list type is an array])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_CHECK_VA_COPY
AC_CHECK_STATFS
@@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-...@rpm5.org
__
RPM Package Managerhttp://rpm5.org
Developer Communication Listrpm-devel@rpm5.org