From 5f2ed6f1efe6d776631ccb62e56e1717a2bd00e1 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Thu, 2 May 2002 15:45:55 +0000 Subject: [PATCH] - Created acinclude.m4 with checks for VA_COPY and VA_LIST_IS_ARRAY. Currently not needed, but I suspect we may need them as we gain functionality; cf. dstring.c in quakeforge. - Updated configure.in to check for above tests. - Updated TODO list noting the va_list audit. --- TODO | 5 ++++- acinclude.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 3 +++ 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 acinclude.m4 diff --git a/TODO b/TODO index 3ac0edb..9504f65 100644 --- a/TODO +++ b/TODO @@ -13,7 +13,10 @@ - the video refresher loader code in src/vid_menu.c needs cleaning up, it's utter bollocks at the moment. all the structs are very fragile, depending on specific ordering of each element. -- fix va_list as per http://gozer.quakeforge.net/list-archives/quakeforge-cvs/2002-April/000151.html, http://www.quakeforge.net/cgi-bin/viewcvs.cgi/quakeforge/libs/util/dstring.c.diff?r1=1.8&r2=1.9 +- do va_list audit -- check that argptr isn't used twice (as per +http://gozer.quakeforge.net/list-archives/quakeforge-cvs/2002-April/000151.html + Everything seems to be fine, someone with a PPC machine will probably want + to double check this. - investigate the possibility of savegames not being tied to a particular build - fix software assembler when building without --disable-asm on i386 - split out assembler per arch/os (we currently have gas i386 and win i386) diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..360d58d --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,60 @@ +dnl $Id$ +dnl +dnl Copyright (c) 2002 The Quakeforge Project. + +dnl Checks if function/macro va_copy() is available +dnl Defines HAVE_VA_COPY on success. +AC_DEFUN(AC_FUNC_VA_COPY, + [AC_CACHE_CHECK([for va_copy], ac_cv_func_va_copy, + [AC_TRY_LINK([ +#ifdef HAVE_STDARG_H +# include +#else +# include +#endif], + [ + va_list a, b; + va_copy(a, b);], + [ac_cv_func_va_copy=yes], + [ac_cv_func_va_copy=no])]) +if test $ac_cv_func_va_copy = yes; then + AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy is available]) +fi]) + +dnl Checks if function/macro __va_copy() is available +dnl Defines HAVE__VA_COPY on success. +AC_DEFUN(AC_FUNC__VA_COPY, + [AC_CACHE_CHECK([for __va_copy], ac_cv_func__va_copy, + [AC_TRY_LINK([ +#ifdef HAVE_STDARG_H +# include +#else +# include +#endif], + [ + va_list a,b; + __va_copy(a, b);], + [ac_cv_func__va_copy=yes], + [ac_cv_func__va_copy=no])]) +if test $ac_cv_func__va_copy = yes; then + AC_DEFINE(HAVE__VA_COPY, 1, [Define if __va_copy is available]) +fi]) + +dnl Checks if va_list is an array +dnl Devines VA_LIST_IS_ARRAY on success +AC_DEFUN(AC_TYPE_VA_LIST, + [AC_CACHE_CHECK([if va_list is an array], ac_cv_type_va_list_array, + [AC_TRY_LINK([ +#ifdef HAVE_STDARG_H +# include +#else +# include +#endif], + [ + va_list a, b; + a = b;], + [ac_cv_type_va_list_array=no], + [ac_cv_type_va_list_array=yes])]) +if test $ac_cv_type_va_list_array = yes; then + AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if va_list is an array]) +fi]) diff --git a/configure.in b/configure.in index 88682ae..f4defd4 100644 --- a/configure.in +++ b/configure.in @@ -71,6 +71,7 @@ AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T +AC_TYPE_VA_LIST AC_MSG_CHECKING(for underscore prefix in names) AC_TRY_LINK( @@ -111,6 +112,8 @@ dnl ----------------------------- #AC_FUNC_STAT #AC_FUNC_VPRINTF #AC_CHECK_FUNCS([bzero floor getcwd gethostbyname getmntent getpagesize gettimeofday memmove memset mkdir munmap pow putenv select socket sqrt strcasecmp strchr strdup strerror strrchr strstr]) +AC_FUNC_VA_COPY +AC_FUNC__VA_COPY AC_CHECK_FUNCS(dlopen) DL_LIBS=""