summaryrefslogtreecommitdiff
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m4168
1 files changed, 168 insertions, 0 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index f23fbb68d35..b608971969f 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -600,3 +600,171 @@ dnl mismatched parentheses.
dnl checks for structures
dnl checks for system services
+
+
+dnl *********************** SPECIAL SECTION *******************************
+dnl
+dnl This section contains my own *re*implementation of the functionality
+dnl provided by some tests/macros found in GNU Autoconf since the ones found
+dnl in Autoconf don't appear to work as expected.
+dnl
+dnl dnl -Ossama Othman <ossama@debian.org>
+dnl dnl
+dnl dnl The copyright for the following macros is listed below.
+dnl dnl Note that all macros listed prior to this section are copyrighted
+dnl dnl by Ossama Othman, not the Free Software Foundation. Nevertheless,
+dnl dnl all software found in this file is free software. Please read the
+dnl dnl distribution terms found at the top of this file and the ones below.
+
+dnl dnl Parameterized macros.
+dnl dnl Requires GNU m4.
+dnl dnl This file is part of Autoconf.
+dnl dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+dnl dnl
+dnl dnl This program is free software; you can redistribute it and/or modify
+dnl dnl it under the terms of the GNU General Public License as published by
+dnl dnl the Free Software Foundation; either version 2, or (at your option)
+dnl dnl any later version.
+dnl dnl
+dnl dnl This program is distributed in the hope that it will be useful,
+dnl dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl dnl GNU General Public License for more details.
+dnl dnl
+dnl dnl You should have received a copy of the GNU General Public License
+dnl dnl along with this program; if not, write to the Free Software
+dnl dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl dnl 02111-1307, USA.
+dnl dnl
+dnl dnl As a special exception, the Free Software Foundation gives unlimited
+dnl dnl permission to copy, distribute and modify the configure scripts that
+dnl dnl are the output of Autoconf. You need not follow the terms of the GNU
+dnl dnl General Public License when using or distributing such scripts, even
+dnl dnl though portions of the text of Autoconf appear in them. The GNU
+dnl dnl General Public License (GPL) does govern all other use of the material
+dnl dnl that constitutes the Autoconf program.
+dnl dnl
+dnl dnl Certain portions of the Autoconf source text are designed to be copied
+dnl dnl (in certain cases, depending on the input) into the output of
+dnl dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
+dnl dnl source text consists of comments plus executable code that decides which
+dnl dnl of the data portions to output in any given case. We call these
+dnl dnl comments and executable code the "non-data" portions. Autoconf never
+dnl dnl copies any of the non-data portions into its output.
+dnl dnl
+dnl dnl This special exception to the GPL applies to versions of Autoconf
+dnl dnl released by the Free Software Foundation. When you make and
+dnl dnl distribute a modified version of Autoconf, you may extend this special
+dnl dnl exception to the GPL to apply to your modified version as well, *unless*
+dnl dnl your modified version has the potential to copy into its output some
+dnl dnl of the text that was the non-data portion of the version that you started
+dnl dnl with. (In other words, unless your change moves or copies text from
+dnl dnl the non-data portions to the data portions.) If your modification has
+dnl dnl such potential, you must delete any notice of this special exception
+dnl dnl to the GPL from your modified version.
+dnl dnl
+dnl dnl Written by David MacKenzie, with help from
+dnl dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+dnl dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+
+dnl dnl Usage: ACE_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND
+dnl dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
+dnl dnl Search for a library defining FUNCTION, if it's not already available.
+dnl AC_DEFUN([ACE_SEARCH_LIBS],
+dnl [
+dnl AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
+dnl [
+dnl ac_func_search_save_LIBS="$LIBS"
+
+dnl ac_cv_search_$1="no"
+
+dnl ACE_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
+
+dnl test "$ac_cv_search_$1" = "no" && for i in $2; do
+dnl LIBS="-l$i $5 $ac_func_search_save_LIBS"
+dnl ACE_TRY_LINK_FUNC([$1],
+dnl [
+dnl ac_cv_search_$1="-l$i"
+dnl break
+dnl ])
+dnl done
+
+dnl LIBS="$ac_func_search_save_LIBS"
+dnl ])
+
+dnl if test "$ac_cv_search_$1" != "no"; then
+dnl test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS"
+dnl $3
+dnl else :
+dnl $4
+dnl fi
+dnl ])
+
+dnl dnl Usage: ACE_TRY_LINK_FUNC(FUNCTION,[, ACTION-IF-FOUND
+dnl dnl [, ACTION-IF-NOT-FOUND])
+dnl dnl Search for a library defining FUNCTION, if it's not already available.
+dnl AC_DEFUN([ACE_TRY_LINK_FUNC],
+dnl [
+dnl AC_LINK_IFELSE([AC_LANG_PROGRAM([[dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
+dnl dnl which includes <sys/select.h> which contains a prototype for
+dnl dnl select. Similarly for bzero.
+dnl /* System header to define __stub macros and hopefully few prototypes,
+dnl which can conflict with char $1(); below. */
+dnl #include <assert.h>
+dnl /* Override any gcc2 internal prototype to avoid an error. */
+dnl ifelse(AC_LANG, C++, #ifdef __cplusplus
+dnl extern "C"
+dnl #endif
+dnl )dnl
+dnl /* We use char because int might match the return type of a gcc2
+dnl builtin and then its argument prototype would still apply. */
+dnl char $1();
+dnl ]], [[
+dnl /* The GNU C library defines this for functions which it implements
+dnl to always fail with ENOSYS. Some functions are actually named
+dnl something starting with __ and the normal name is an alias. */
+dnl #if defined (__stub_$1) || defined (__stub___$1)
+dnl choke me
+dnl #else
+dnl $1();
+dnl #endif
+dnl ]])],[$2],[$3])
+dnl ])
+
+dnl AC_DEFUN([ACE_SYS_RESTARTABLE_SYSCALLS],
+dnl [AC_REQUIRE([AC_HEADER_SYS_WAIT])
+dnl AC_CHECK_HEADERS([unistd.h])
+dnl AC_CACHE_CHECK([for restartable system calls, ac_cv_sys_restartable_syscalls],
+dnl [AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Exit 0 (true) if wait returns something other than -1,
+dnl i.e. the pid of the child, which means that wait was restarted
+dnl after getting the signal. */
+dnl #include <sys/types.h>
+dnl #include <signal.h>
+dnl #if HAVE_UNISTD_H
+dnl # include <unistd.h>
+dnl #endif
+dnl #if HAVE_SYS_WAIT_H
+dnl # include <sys/wait.h>
+dnl #endif
+
+dnl /* Some platforms explicitly require an extern "C" signal handler
+dnl when using C++. */
+dnl #ifdef __cplusplus
+dnl extern "C"
+dnl #endif
+dnl void ucatch (int) { }
+
+dnl main () {
+dnl int i = fork (), status;
+dnl if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
+dnl signal (SIGINT, ucatch);
+dnl status = wait(&i);
+dnl if (status == -1) wait(&i);
+dnl exit (status == -1);
+dnl }
+dnl ]])],[ac_cv_sys_restartable_syscalls=yes],[ac_cv_sys_restartable_syscalls=no],[])])
+dnl if test $ac_cv_sys_restartable_syscalls = yes; then
+dnl AC_DEFINE([HAVE_RESTARTABLE_SYSCALLS])
+dnl fi
+dnl ])