pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/compat_headers/files If there is no va_copy()...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/878cf2bb5a74
branches:  trunk
changeset: 542702:878cf2bb5a74
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun May 25 18:32:28 2008 +0000

description:
If there is no va_copy(), provide one and just assume the compiler knows
how to copy va_lists by value.

diffstat:

 pkgtools/compat_headers/files/Makefile.in  |  10 +++-
 pkgtools/compat_headers/files/config.h.in  |   3 +
 pkgtools/compat_headers/files/configure    |  77 ++++++++++++++++++++++++++++++
 pkgtools/compat_headers/files/configure.in |  20 +++++++-
 pkgtools/compat_headers/files/stdarg.h.in  |   8 +++
 5 files changed, 116 insertions(+), 2 deletions(-)

diffs (222 lines):

diff -r 709d177ea622 -r 878cf2bb5a74 pkgtools/compat_headers/files/Makefile.in
--- a/pkgtools/compat_headers/files/Makefile.in Sun May 25 17:39:32 2008 +0000
+++ b/pkgtools/compat_headers/files/Makefile.in Sun May 25 18:32:28 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.2 2008/05/24 22:11:20 tnn Exp $
+# $NetBSD: Makefile.in,v 1.3 2008/05/25 18:32:28 tnn Exp $
 
 REPLACE_stdint=                @REPLACE_stdint@
 REPLACE_inttypes=      @REPLACE_inttypes@
@@ -6,6 +6,7 @@
 REPLACE_sys_select=    @REPLACE_sys_select@
 REPLACE_math=          @REPLACE_math@
 REPLACE_stdlib=                @REPLACE_stdlib@
+REPLACE_stdarg=                @REPLACE_stdarg@
 
 PREFIX=         @prefix@
 DESTDIR?=
@@ -30,6 +31,9 @@
 .if ${REPLACE_stdlib} == "yes"
        ./mkhdr.sh stdlib.h < stdlib.h.in > stdlib.h
 .endif
+.if ${REPLACE_stdarg} == "yes"
+       ./mkhdr.sh stdarg.h < stdarg.h.in > stdarg.h
+.endif
 
 install: .PHONY
        printf "" > PLIST
@@ -59,3 +63,7 @@
        ${INSTALL} -m 644 stdlib.h ${DESTDIR}${PREFIX}/include
        echo include/stdlib.h >> PLIST
 .endif
+.if ${REPLACE_stdarg} == "yes"
+       ${INSTALL} -m 644 stdarg.h ${DESTDIR}${PREFIX}/include
+       echo include/stdarg.h >> PLIST
+.endif
diff -r 709d177ea622 -r 878cf2bb5a74 pkgtools/compat_headers/files/config.h.in
--- a/pkgtools/compat_headers/files/config.h.in Sun May 25 17:39:32 2008 +0000
+++ b/pkgtools/compat_headers/files/config.h.in Sun May 25 18:32:28 2008 +0000
@@ -22,6 +22,9 @@
 #undef CH_FLOORF
 
 /* descr */
+#undef CH_HAVE_VA_COPY
+
+/* descr */
 #undef CH_HPUX
 
 /* descr */
diff -r 709d177ea622 -r 878cf2bb5a74 pkgtools/compat_headers/files/configure
--- a/pkgtools/compat_headers/files/configure   Sun May 25 17:39:32 2008 +0000
+++ b/pkgtools/compat_headers/files/configure   Sun May 25 18:32:28 2008 +0000
@@ -688,6 +688,7 @@
 REPLACE_resolv
 REPLACE_sys_select
 REPLACE_stdlib
+REPLACE_stdarg
 REPLACE_math
 CPP
 GREP
@@ -2861,6 +2862,8 @@
 REPLACE_sys_select=no
 REPLACE_stdlib=no
 REPLACE_math=no
+REPLACE_stdarg=no
+
 
 
 
@@ -2892,6 +2895,12 @@
 
 
 cat >>confdefs.h <<\_ACEOF
+#define CH_HAVE_VA_COPY 0
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
 #define CH_FLOORF 0
 _ACEOF
 
@@ -4381,6 +4390,74 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+
+#
+# Check for va_copy
+#
+
+# XXX needs to be TRY_RUN
+{ $as_echo "$as_me:$LINENO: checking if we have va_copy" >&5
+$as_echo_n "checking if we have va_copy... " >&6; }
+if test "$cross_compiling" = yes; then
+  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+void foo(va_list x, va_list y) {va_copy(x, y);}
+int main(void) {return 0;}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cat >>confdefs.h <<\_ACEOF
+#define CH_HAVE_VA_COPY 1
+_ACEOF
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+REPLACE_stdarg=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
 #
 # Make sure we have float math functions, provide macros otherwise.
 #
diff -r 709d177ea622 -r 878cf2bb5a74 pkgtools/compat_headers/files/configure.in
--- a/pkgtools/compat_headers/files/configure.in        Sun May 25 17:39:32 2008 +0000
+++ b/pkgtools/compat_headers/files/configure.in        Sun May 25 18:32:28 2008 +0000
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.in,v 1.1.1.1 2008/05/24 03:35:41 tnn Exp $
+dnl $NetBSD: configure.in,v 1.2 2008/05/25 18:32:28 tnn Exp $
 
 AC_PREREQ(2.62)
 AC_INIT([compat_headers],[20080523],[tnn%NetBSD.org@localhost])
@@ -15,12 +15,14 @@
 REPLACE_sys_select=no
 REPLACE_stdlib=no
 REPLACE_math=no
+REPLACE_stdarg=no
 
 AC_SUBST(REPLACE_stdint)
 AC_SUBST(REPLACE_inttypes)
 AC_SUBST(REPLACE_resolv)
 AC_SUBST(REPLACE_sys_select)
 AC_SUBST(REPLACE_stdlib)
+AC_SUBST(REPLACE_stdarg)
 AC_SUBST(REPLACE_math)
 
 AC_DEFINE([CH_LP64], [0], [descr])
@@ -28,6 +30,8 @@
 AC_DEFINE([CH_HPUX_MISSING_RES_PROTO], [0], [descr])
 AC_DEFINE([CH_HPUX___STRTOLL], [0], [descr])
 
+AC_DEFINE([CH_HAVE_VA_COPY], [0], [descr])
+
 AC_DEFINE([CH_FLOORF], [0], [descr])
 AC_DEFINE([CH_CEILF], [0], [descr])
 AC_DEFINE([CH_SINF], [0], [descr])
@@ -153,6 +157,20 @@
 , [AC_MSG_RESULT(no)])
 , [AC_MSG_RESULT(no)])
 
+
+#
+# Check for va_copy
+#
+
+# XXX needs to be TRY_RUN
+AC_MSG_CHECKING([if we have va_copy])
+AC_TRY_RUN([#include <stdarg.h>
+void foo(va_list x, va_list y) {va_copy(x, y);}
+int main(void) {return 0;}],
+[AC_DEFINE(CH_HAVE_VA_COPY) AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)
+REPLACE_stdarg=yes])
+
 #
 # Make sure we have float math functions, provide macros otherwise.
 #
diff -r 709d177ea622 -r 878cf2bb5a74 pkgtools/compat_headers/files/stdarg.h.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/compat_headers/files/stdarg.h.in Sun May 25 18:32:28 2008 +0000
@@ -0,0 +1,8 @@
+#include "config.h"
+@include "@real_header@"
+@ifndef _COMPAT_STDARG_H_
+@define _COMPAT_STDARG_H_
+#if CH_HAVE_VA_COPY < 1
+@define va_copy(dst,src) (dst=(src))
+#endif
+@endif /* _COMPAT_STDARG_H_ */



Home | Main Index | Thread Index | Old Index