1
0
mirror of https://github.com/bgp/bgpq4.git synced 2024-05-11 05:55:05 +00:00

better checks for OpenBSD's queue.h incompatibilities.

This commit is contained in:
Alexandre Snarskii
2015-08-30 15:21:17 +03:00
parent 4ec8e2442b
commit aed1554fca
5 changed files with 65 additions and 18 deletions

View File

@@ -1,11 +1,8 @@
#ifndef BGPQ3_H_
#define BGPQ3_H_
#if HAVE_SYS_QUEUE_H
#if HAVE_SYS_QUEUE_H && HAVE_STAILQ_IN_SYS_QUEUE
#include <sys/queue.h>
#ifndef STAILQ_ENTRY
#include "sys_queue.h"
#endif
#else
#include "sys_queue.h"
#endif

View File

@@ -12,6 +12,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* sys/queue.h have STAILQ_ */
#undef HAVE_STAILQ_IN_SYS_QUEUE
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

53
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bgpq3 0.1.32-rc5.
# Generated by GNU Autoconf 2.69 for bgpq3 0.1.32-rc6.
#
# Report bugs to <snar@snar.spb.ru>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bgpq3'
PACKAGE_TARNAME='bgpq3'
PACKAGE_VERSION='0.1.32-rc5'
PACKAGE_STRING='bgpq3 0.1.32-rc5'
PACKAGE_VERSION='0.1.32-rc6'
PACKAGE_STRING='bgpq3 0.1.32-rc6'
PACKAGE_BUGREPORT='snar@snar.spb.ru'
PACKAGE_URL=''
@@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bgpq3 0.1.32-rc5 to adapt to many kinds of systems.
\`configure' configures bgpq3 0.1.32-rc6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1289,7 +1289,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bgpq3 0.1.32-rc5:";;
short | recursive ) echo "Configuration of bgpq3 0.1.32-rc6:";;
esac
cat <<\_ACEOF
@@ -1369,7 +1369,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bgpq3 configure 0.1.32-rc5
bgpq3 configure 0.1.32-rc6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1738,7 +1738,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bgpq3 $as_me 0.1.32-rc5, which was
It was created by bgpq3 $as_me 0.1.32-rc6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3412,6 +3412,41 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for STAILQ_ interface in queue.h" >&5
$as_echo_n "checking for STAILQ_ interface in queue.h... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "sys_queue.h"
#endif
struct blah {
STAILQ_ENTRY(blah) next;
};
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_STAILQ_IN_SYS_QUEUE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
for ac_prog in markdown_py markdown2 markdown
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -4067,7 +4102,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bgpq3 $as_me 0.1.32-rc5, which was
This file was extended by bgpq3 $as_me 0.1.32-rc6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4129,7 +4164,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bgpq3 config.status 0.1.32-rc5
bgpq3 config.status 0.1.32-rc6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@@ -5,6 +5,22 @@ AC_PROG_INSTALL
AC_CHECK_HEADERS([sys/queue.h sys/tree.h])
AC_MSG_CHECKING([for STAILQ_ interface in queue.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#else
#include "sys_queue.h"
#endif
struct blah {
STAILQ_ENTRY(blah) next;
};
])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_STAILQ_IN_SYS_QUEUE], [1], [sys/queue.h have STAILQ_])],
[AC_MSG_RESULT(no)])
AC_CHECK_PROGS([MARKDOWN], [markdown_py markdown2 markdown], [echo])
AC_CHECK_FUNCS(strlcpy)

View File

@@ -1,12 +1,8 @@
#ifndef SX_SLENTRY_H_
#define SX_SLENTRY_H_
#if HAVE_SYS_QUEUE_H
#if HAVE_SYS_QUEUE_H && HAVE_STAILQ_IN_SYS_QUEUE
#include <sys/queue.h>
/* OpenBSD-current as of 2015-08-30 does not define STAILQ_ENTRY anymore */
#ifndef STAILQ_ENTRY
#include "sys_queue.h"
#endif
#else
#include "sys_queue.h"
#endif