-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
165 lines (133 loc) · 4.55 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
dnl
dnl Copyright © 2015, Hewlett Packard Enterprise Development LP
dnl
dnl Author: Keith Packard <[email protected]>
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License
dnl as published by the Free Software Foundation, either version 3 of
dnl the License, or (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl
dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.61)
dnl ==========================================================================
dnl Versioning
dnl ==========================================================================
dnl This is the package version number, not the shared library
dnl version.
AC_INIT([fam_atomic], [2.2], [http://hlinux-home.us.rdlabs.hpecorp.net/bugzilla/enter_bug.cgi?product=Userspace])
AM_INIT_AUTOMAKE([1.11 parallel-tests])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
dnl ==========================================================================
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
AC_MSG_CHECKING([for RM macro])
_predefined_rm=`make -p -f /dev/null 2>/dev/null|grep '^RM ='|sed -e 's/^RM = //'`
if test "x$_predefined_rm" = "x"; then
AC_MSG_RESULT([no predefined RM])
AC_CHECK_PROG(RM, rm, [rm -f])
else
AC_MSG_RESULT($_predefined_rm)
fi
dnl Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
dnl libtool versioning
dnl bump revision when fixing bugs
dnl bump current and age, reset revision to zero when adding APIs
dnl bump current, leave age, reset revision to zero when changing/removing APIS
LIBT_CURRENT=2
LIBT_REVISION=0
AC_SUBST(LIBT_CURRENT)
AC_SUBST(LIBT_REVISION)
LIBT_AGE=0
LIBT_VERSION_INFO="$LIBT_CURRENT:$LIBT_REVISION:$LIBT_AGE"
AC_SUBST(LIBT_VERSION_INFO)
LIBT_CURRENT_MINUS_AGE=`expr $LIBT_CURRENT - $LIBT_AGE`
AC_SUBST(LIBT_CURRENT_MINUS_AGE)
PKGCONFIG_REQUIRES=
PKGCONFIG_REQUIRES_PRIVATELY=
dnl ==========================================================================
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
esac
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
if test "$os_win32" = "yes"; then
AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
WARN_CFLAGS=""
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
[Can use #warning in C files])
fi
AC_SUBST(WARN_CFLAGS)
dnl ==========================================================================
AX_CC_FOR_BUILD()
AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
dnl ==========================================================================
AC_ARG_WITH(arch,
[AC_HELP_STRING([--with-arch=ARCH],
[Force architecture to ARCH])],
arch="$withval", arch=auto)
if test "x$arch" != xauto; then
AC_DEFINE_UNQUOTED([FC_ARCHITECTURE], "$arch", [Architecture prefix to use for cache file names])
fi
dnl ==========================================================================
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h stdbool.h sys/ioctl.h sys/types.h stdlib.h stdio.h assert.h signal.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_FLEXIBLE_ARRAY_MEMBER
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
AC_CHECK_FUNCS([mmap])
have_pthread=false
AX_PTHREAD([have_pthread=true])
if $have_pthread; then
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads])
fi
AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread)
dnl ===========================================================================
AC_SUBST(PKGCONFIG_REQUIRES)
AC_SUBST(PKGCONFIG_REQUIRES_PRIVATELY)
dnl
AC_CONFIG_FILES([
Makefile
tests/Makefile
rcu-rbtree/Makefile
doc/Makefile
fam_atomic.pc
])
AC_OUTPUT