automake: check for more headers

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2010-08-22 22:06:59 +10:00
parent a6285e6f14
commit 5221880227
16 changed files with 119 additions and 97 deletions

View File

@ -3,13 +3,13 @@
AC_PREREQ([2.61])
AC_INIT([libqb], [0.1.0], [quarterback-devel@fedorahosted.org])
AC_CONFIG_SRCDIR([lib/ringbuffer.c])
AC_CONFIG_HEADERS([include/config.h])
AM_INIT_AUTOMAKE([-Wno-portability])
LT_PREREQ([2.2.6])
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([lib/tsafe.c])
AC_CONFIG_HEADER([include/config.h])
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
@ -81,6 +81,7 @@ case $exec_prefix in
esac
# Checks for libraries.
AC_CHECK_LIB([rt], [mq_open])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([socket], [socket])
@ -92,10 +93,11 @@ AM_CONDITIONAL(HAVE_CHECK, test "${with_check}" = "yes")
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h \
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h locale.h netdb.h netinet/in.h nl_types.h stdint.h \
stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h \
sys/time.h syslog.h unistd.h sys/types.h getopt.h malloc.h \
sys/sockio.h utmpx.h])
time.h sys/time.h syslog.h unistd.h sys/types.h getopt.h malloc.h \
sys/sockio.h sys/un.h utmpx.h errno.h dlfcn.h dirent.h fnmatch.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@ -105,6 +107,7 @@ AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
@ -121,8 +124,10 @@ AC_REPLACE_FNMATCH
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
@ -130,11 +135,11 @@ AC_CHECK_FUNCS([alarm alphasort atexit bzero dup2 endgrent endpwent fcntl \
getcwd getpeerucred getpeereid gettimeofday inet_ntoa memmove \
memset mkdir scandir select socket strcasecmp strchr strdup \
strerror strrchr strspn strstr pthread_spin_lock \
clock_gettime localeconv localtime_r munmap pathconf putenv setenv \
pthread_spin_unlock pututxline lgammal setkey \
crypt encrypt getdate strsignal])
## local defines
PACKAGE_FEATURES=""

View File

@ -21,29 +21,66 @@
#ifndef QB_OS_BASE_H_DEFINED
#define QB_OS_BASE_H_DEFINED
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif /* _GNU_SOURCE */
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif /* HAVE_STDINT_H */
#include <assert.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif /* HAVE_STDLIB_H */
#include <stdio.h>
#include <stdint.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <errno.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif /*HAVE_ERRNO_H*/
#ifdef HAVE_TIME_H
#include <time.h>
#endif /* HAVE_TIME_H */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <sys/types.h>
#include <sys/un.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#include <assert.h>
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */
#endif /* QB_OS_BASE_H_DEFINED */

View File

@ -18,14 +18,11 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <qb/qbhdb.h>
#include <config.h>
#include "os_base.h"
#include "util_int.h"
#include <pthread.h>
#include "util_int.h"
#include <qb/qbhdb.h>
#include <qb/qbhdb.h>
#include <qb/qblist.h>
#include <qb/qbhash.h>

View File

@ -19,6 +19,7 @@
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os_base.h"
#include <qb/qbutil.h>
#include <qb/qbhdb.h>

View File

@ -18,12 +18,14 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "os_base.h"
#include <sys/shm.h>
#include <sys/mman.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif /* HAVE_SYS_UN_H */
#include <qb/qbipcc.h>
#include <qb/qbhdb.h>

View File

@ -18,21 +18,18 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include "os_base.h"
#include <sys/mman.h>
#include <sys/poll.h>
#include <pthread.h>
#if defined(HAVE_GETPEERUCRED)
#ifdef HAVE_GETPEERUCRED
#include <ucred.h>
#endif
#endif /* HAVE_GETPEERUCRED */
#include <sys/shm.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif /* HAVE_SYS_UN_H */
#include <qb/qblist.h>
#include <qb/qbhdb.h>

View File

@ -19,13 +19,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "os_base.h"
#include <ctype.h>
#include <sys/time.h>
#include <syslog.h>
#include <pthread.h>
#include <semaphore.h>

View File

@ -16,17 +16,17 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os_base.h"
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif /* HAVE_DLFCN_H */
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#endif /* HAVE_DIRENT_H */
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#endif /* HAVE_FNMATCH_H */
#ifdef QB_SOLARIS
#include <iso/limits_iso.h>
#endif

View File

@ -18,15 +18,10 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os_base.h"
#include <config.h>
#include <errno.h>
#include <pthread.h>
#include <sys/poll.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <qb/qbhdb.h>
#include <qb/qbpoll.h>

View File

@ -18,8 +18,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "ringbuffer_int.h"
//#define CRAZY_DEBUG_PRINTFS 1

View File

@ -18,8 +18,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "ringbuffer_int.h"
static int32_t my_null_fn(struct qb_ringbuffer_s *rb)

View File

@ -21,15 +21,8 @@
#ifndef _RINGBUFFER_H_
#define _RINGBUFFER_H_
#include <config.h>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include "os_base.h"
#include <limits.h>
#include <sys/mman.h>
#include <sys/sem.h>
#include <sys/ipc.h>

View File

@ -18,14 +18,10 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "os_base.h"
#include <poll.h>
#include <signal.h>
#include <time.h>
#include "tlist.h"

View File

@ -18,36 +18,35 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os_base.h"
#include <config.h>
#define _XOPEN_SOURCE 600
#define _GNU_SOURCE 1
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */
#include <grp.h>
#include <pwd.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif /* HAVE_NETDB_H */
#ifdef HAVE_NL_TYPES_H
#include <nl_types.h>
#endif /* HAVE_NL_TYPES_H */
#include <libgen.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif /* HAVE_DLFCN_H */
#ifdef HAVE_UTMPX_H
#include <utmpx.h>
#endif /* HAVE_UTMPX_H */
#include <search.h>
#include <locale.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif /* HAVE_DIRENT_H */
#include <pthread.h>
#include <qb/qbtsafe.h>
@ -389,14 +388,22 @@ double drand48(void)
}
#ifdef HAVE_ENCRYPT
void encrypt(char block[64], int edflag)
#ifdef QB_BSD
int encrypt(char *block, int edflag)
#else
void encrypt(char *block, int edflag)
#endif
{
#ifdef QB_BSD
static int (*real_encrypt) (char block[64], int edflag) = NULL;
#else
static void (*real_encrypt) (char block[64], int edflag) = NULL;
#endif
if (!tsafe_inited || tsafe_disabled) {
if (real_encrypt == NULL) {
real_encrypt = _get_real_func_("encrypt");
}
return real_encrypt(edflag);
return real_encrypt(block, edflag);
}
assert(0);
}
@ -924,7 +931,7 @@ struct dirent *readdir(DIR * dirp)
return NULL;
}
#ifdef COROSYNC_BSD
#ifdef QB_BSD
int setgrent(void)
{
static int (*real_setgrent) (void) = NULL;
@ -952,9 +959,17 @@ void setgrent(void)
#endif
#ifdef HAVE_SETKEY
#ifdef QB_BSD
int setkey(const char *key)
#else
void setkey(const char *key)
#endif
{
#ifdef QB_BSD
static int (*real_setkey) (const char *key) = NULL;
#else
static void (*real_setkey) (const char *key) = NULL;
#endif
if (!tsafe_inited || tsafe_disabled) {
if (real_setkey == NULL) {
real_setkey = _get_real_func_("setkey");

View File

@ -18,12 +18,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "os_base.h"
#include "util_int.h"
#include <syslog.h>
#include <stdarg.h>
#include <sys/shm.h>
#include <sys/mman.h>
#include <pthread.h>
@ -33,8 +30,6 @@
#include <sys/sem.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <limits.h>
#include <qb/qbutil.h>
struct qb_thread_lock_s {

View File

@ -18,20 +18,17 @@
* You should have received a copy of the GNU Lesser General Public License
* along with libqb. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os_base.h"
#include <pthread.h>
#include <qb/qbqueue.h>
#include <qb/qbwthread.h>
/*
* Add work to a work group and have threads process the work
* Provide blocking for all work to complete
*/
#include <config.h>
#include <stdint.h>
#include <stdlib.h>
#include <pthread.h>
#include <errno.h>
#include <qb/qbqueue.h>
#include <qb/qbwthread.h>
struct thread_data {
void *thread_state;