diff --git a/bgpq3.h b/bgpq3.h index f49ff5e..3039a3a 100644 --- a/bgpq3.h +++ b/bgpq3.h @@ -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 -#ifndef STAILQ_ENTRY -#include "sys_queue.h" -#endif #else #include "sys_queue.h" #endif diff --git a/config.h.in b/config.h.in index 954904b..e747665 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* sys/queue.h have STAILQ_ */ +#undef HAVE_STAILQ_IN_SYS_QUEUE + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/configure b/configure index 4c02f84..37d1bcf 100755 --- a/configure +++ b/configure @@ -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 . # @@ -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 +#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\\" diff --git a/configure.in b/configure.in index 6d5e99c..b44a4d9 100644 --- a/configure.in +++ b/configure.in @@ -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 +#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) diff --git a/sx_slentry.h b/sx_slentry.h index 1619c2e..ddbe5e3 100644 --- a/sx_slentry.h +++ b/sx_slentry.h @@ -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 -/* 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