File: configure.ac

package info (click to toggle)
xtrace 1.4.0-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 900 kB
  • sloc: ansic: 5,808; sh: 1,241; makefile: 65
file content (62 lines) | stat: -rw-r--r-- 2,092 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
dnl
dnl Process this file with autoconf to produce a configure script
dnl

AC_INIT(xtrace, 1.4.0)
AC_CONFIG_SRCDIR(main.c)
AC_CONFIG_AUX_DIR(ac)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([-Wall -Werror dist-xz no-dist-gzip])

AM_MAINTAINER_MODE([enable])
AC_GNU_SOURCE

if test "${CFLAGS:+set}" != set ; then
	CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow"
fi

AC_LANG(C)
AC_PROG_CC_C99
AC_PROG_INSTALL

AC_CACHE_CHECK([Checking for _POSIX_TIMERS and _POSIX_MONOTONIC_CLOCK],[ac_cv_monotonic_clock],
[AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#include <time.h>
]],[[
#ifdef _POSIX_TIMERS
#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
1
#else
#error _POSIX_MONOTONIC_CLOCK not defined, or not positive, not using clock_gettime
#endif
#else
#error _POSIX_TIMERS not defined, not using clock_gettime
#endif
]])], [ac_cv_monotonic_clock=yes], [ac_cv_monotonic_clock=no])])

if test $ac_cv_monotonic_clock = yes ; then
	AC_DEFINE([HAVE_MONOTONIC_CLOCK], 1, [Define if clock_gettime(CLOCK_MONOTONIC) should work])
	AC_CHECK_FUNC([clock_gettime],[],[
	AC_CHECK_LIB(rt, clock_gettime, [], [AC_MSG_ERROR([_POSIX_TIMERS suggests clock_gettime should work but it seems not to work, though])])
	])
fi

AC_CHECK_FUNCS([strndup asprintf socket tdestroy])
if test $ac_cv_func_socket = no; then
	AC_CHECK_LIB(socket, socket, [AC_DEFINE(HAVE_SOCKET)
LIBS="$LIBS -lsocket -lnsl"; break],[AC_MSG_ERROR([Could not find socket library function])])
fi
AC_CHECK_FUNC([getaddrinfo],,[AC_MSG_ERROR([Could not find getaddrinfo library function])])
AC_SEARCH_LIBS(sendmsg, socket, [have_sendmsg="yes"], [have_sendmsg="no"])
case x$have_sendmsg in
xyes)
        AC_DEFINE([HAVE_SENDMSG],1,[Define if your platform supports sendmsg])
        ;;
esac

dnl AC_CHECK_HEADER(X11/X.h,[],[AC_MSG_ERROR([Could not find X11/X.h])])
dnl AC_CHECK_HEADER(X11/Xlib.h,[],[AC_MSG_ERROR([Could not find X11/Xlib.h])])
dnl AC_CHECK_HEADER(X11/extensions/security.h,[],[AC_MSG_ERROR([Could not find X11/extensions/secruity.h])],[#include <X11/Xlib.h>])

AC_OUTPUT(Makefile)