-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
114 lines (78 loc) · 2.65 KB
/
configure.ac
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#========== Initialisation ==========
AC_INIT([log2mem], [1.1], [log2mem@darrenjs.net], [log2mem], [ ] )
AC_PREREQ([2.59])
# This macro causes the environment variables, $host, $build and $target to be
# defined.
AC_CANONICAL_SYSTEM
# Not: the -Wall here is for automake errors; is unrelated to gcc errors
AM_INIT_AUTOMAKE([1.10 no-define -Wall])
AM_PROG_AR
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_CONFIG_MACRO_DIR([m4])
# initialise libtool support
LT_PREREQ([2.4.2]) # not 'technically' required, but good practice.
# Note: we initialise libtool with shared-libraries disabled. This makes it
# easier to quickly use log2mem; the user doesn't need to worry about altering
# the LD_LIBRARY_PATH at runtime to pick up liblog2mem.so
LT_INIT([disable-shared])
#========== Checks for programs ==========
AC_PROG_CXX
AC_PROG_CC
AM_PROG_LIBTOOL
AC_PROG_INSTALL
#========== Check for third party libraries ==========
dnl PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [
dnl AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
dnl AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
dnl AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
dnl ], [
dnl AC_MSG_ERROR([Qt 4 library not found])
dnl ])
dnl PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D
dnl ], [
dnl ])
#========== Checks for header files ==========
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h stdint.h stdio.h stdlib.h string.h time.h unistd.h sys/time.h sys/stat.h sys/syscall.h sys/mman.h sys/stat.h sys/types.h ])
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
#========== Check functions ==========
AC_LINK_IFELSE([AC_LANG_SOURCE([
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return __sync_add_and_fetch(c, 1);
}])],[has___sync_add_and_fetch=yes])
if test "x$has___sync_add_and_fetch" = xyes; then
AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you have the __sync_add_and_fetch gcc builtin function])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
#========== User options ==========
export DIRS="liblog2mem util examples/interact"
extrabuild=
dnl QT option
AC_ARG_ENABLE([gui],
AS_HELP_STRING([--enable-gui], [Enable QT gui]))
AS_IF([test "x$enable_gui" = "xyes"], [
DIRS="$DIRS qtgui"
])
#========== Generation ==========
AC_SUBST(DIRS)
# List the files that will be generated. These are mainly makefiles, which
# automake will generate from the corresponding Makefile.am
AC_CONFIG_FILES([
Makefile
liblog2mem/Makefile
util/Makefile
examples/interact/Makefile
qtgui/Makefile
])
# Trigger the generation of our makefiles
AC_OUTPUT