4 # This file is part of the OpenPTS project.
6 # The Initial Developer of the Original Code is International
7 # Business Machines Corporation. Portions created by IBM
8 # Corporation are Copyright (C) 2010 International Business
9 # Machines Corporation. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the Common Public License as published by
13 # IBM Corporation; either version 1 of the License, or (at your option)
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # Common Public License for more details.
21 # You should have received a copy of the Common Public License
22 # along with this program; if not, a copy can be viewed at
23 # http://www.opensource.org/licenses/cpl1.0.php.
26 AC_INIT(openpts, 0.2.6, openpts-users@lists.sourceforge.jp)
29 # check /usr/lib64/pkgconfig/
37 # set PCR index used by OpenPTS
41 # check /usr/lib64/pkgconfig/
44 AC_CONFIG_AUX_DIR([.])
46 AC_CONFIG_MACRO_DIR([m4])
48 AM_INIT_AUTOMAKE([foreign 1.6])
54 AC_MSG_CHECKING([for debug-enabled build])
55 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [create a debug build that outputs debug messages]),
56 [if test "$enableval" = "yes"; then
66 # If the user has not set CFLAGS, do something appropriate
67 test_CFLAGS=${CFLAGS+set}
68 if test "$test_CFLAGS" != set; then
69 if test "$DEBUG" == "yes"; then
70 CFLAGS="-O0 -g -DDEBUG"
74 elif test "$DEBUG" == "yes"; then
75 CFLAGS="$CFLAGS -O0 -g -DDEBUG"
78 # TNC support (default off)
81 AC_HELP_STRING([--enable-tnc], [create a IMC/IMV libraries for TNC]),
84 AM_CONDITIONAL(OPENPTS_BUILD_LIBTNC, [test "x$TNC" == "xyes"])
92 -DPTS_VER_MAJOR=${PTS_VER_MAJOR} -DPTS_VER_MINOR=${PTS_VER_MINOR} \
93 -DPTS_SPEC_MAJOR=${PTS_SPEC_MAJOR} -DPTS_SPEC_MINOR=${PTS_SPEC_MINOR} \
94 -DOPENPTS_PCR_INDEX=${OPENPTS_PCR_INDEX}"
97 AC_CHECK_PROGS(COPY, cp)
98 AC_CHECK_PROGS(ECHO, echo)
99 AC_CHECK_PROGS(MKDIR, mkdir)
100 AC_CHECK_PROGS(RM, rm)
103 # /usr/share/aclocal/gettext.m4
104 AM_GNU_GETTEXT_VERSION([0.17])
105 AM_GNU_GETTEXT([external])
107 # Arch specific stuff
108 # set -m64 CFLAG option for 64bit platforms
110 *ppc64* | *powerpc64* | *x86_64* | *s390x*)
111 CFLAGS="$CFLAGS -m64"
122 AC_DEFINE(HAVE_DAEMON, [1], [have daemon()])
123 AC_DEFINE(HAVE_VSYSLOG, [1], [have vsyslog()])
124 AC_DEFINE(HAVE_SENDFILE, [1], [have vsyslog()])
135 AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
136 AM_CONDITIONAL(AIX, [test "x$aix" = xyes])
137 AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
140 # PKG_CHECK_MODULES(prefix, list-of-modules, action-if-found, action-if-not-found)
142 # OpenSSL, libcrypto-0.9.X
143 # RHRL6, this set -L/usr/lib6464 :-(
145 # /usr/lib64/pkgconfig/openssl.pc
146 # /usr/lib64/pkgconfig/libcrypto.pc
147 # /usr/lib64/pkgconfig/libssl.pc
148 # https://bugzilla.redhat.com/show_bug.cgi?id=605585
149 # Solaris 11 express pkg-config - NA
153 [AC_DEFINE(HAVE_LIBCRYPTO, [1], [Use LIBCRYPTO])],
154 [AC_MSG_ERROR([libcrypto not found.])]
156 AC_SUBST(LIBCRYPTO_CFLAGS)
157 AC_SUBST(LIBCRYPTO_LIBS)
162 [libxml-2.0 >= 2.6.0],
163 [AC_DEFINE(HAVE_LIBXML2, [1], [Use LIBXML2])],
164 [AC_MSG_ERROR([libxml-2.0 not found.])]
166 AC_SUBST(LIBXML2_CFLAGS)
167 AC_SUBST(LIBXML2_LIBS)
169 # libuuid or libc uuid
173 [AM_CONDITIONAL([HAVE_LIBUUID], [true])],
174 [AC_MSG_WARN([libuuid not found. use libc uuid and wrapper])
175 AM_CONDITIONAL([HAVE_LIBUUID], [false])]
177 AC_SUBST(LIBUUID_CFLAGS)
178 AC_SUBST(LIBUUID_LIBS)
182 # AC_ARG_WITH ( package , help-string , [ action-if-given ], [ action-if-not-given ]):
184 # TSS support (default off, verifier does not requires TSS library?)
185 # RHEL6 missing by pkg-config, use AC_CHECK_LIB
188 # /usr/include/trousers
191 [AC_HELP_STRING([--with-tss], [use TSS])],
197 AC_DEFINE(HAVE_TSS, [1], [Use TSS])
201 AC_MSG_WARN([libtspi(trousers) not found by pkg-config.])
202 AC_CHECK_LIB(tspi, Tspi_Context_Create,
204 if test "x$aix" = xyes; then
205 TSS_CFLAGS=-I/usr/include/tss
207 TSS_CFLAGS="-I/usr/include/trousers -I/usr/include/tss"
213 AC_MSG_ERROR([libtspi(trousers) not found])
217 AC_CHECK_HEADER(trousers/tss.h, [],
218 [AC_MSG_ERROR([trousers(tss) header not found: trousers/tss.h])]
221 # set CFLAGS for build - TODO depend TSS or not
222 if test "x$aix" = xyes; then
223 TSS_CFLAGS=-I/usr/include/tss
225 TSS_CFLAGS="-I/usr/include/trousers -I/usr/include/tss"
230 AM_CONDITIONAL(OPENPTS_BUILD_TSS, [test "x$with_tss" == "xyes"])
233 # AIDE support (default off, option)
236 [AC_HELP_STRING([--with-aide], [use AIDE])])
237 AM_CONDITIONAL(OPENPTS_BUILD_AIDE, [test "x$with_aide" == "xyes"])
240 # SQLite support for AIDE
241 # RHEL6 supports pkg-config
242 AC_ARG_WITH([sqlite],
243 [AC_HELP_STRING([--with-sqlite], [use SQLite])],
249 AC_DEFINE(HAVE_SQLITE, [1], [Use SQLITE])
250 AC_SUBST(SQLITE_CFLAGS)
251 AC_SUBST(SQLITE_LIBS)
253 AC_MSG_ERROR([sqlite2 not found by pkg-config.])
257 AM_CONDITIONAL(OPENPTS_BUILD_SQLITE, [test "x$with_sqlite" == "xyes"])
260 # PostgreSQL support for AIDE
261 # RHEL6, missing by pkg-config
263 [AC_HELP_STRING([--with-pq], [use PostgreSQL])],
268 AM_CONDITIONAL(OPENPTS_BUILD_PQ, [test "x$with_pq" == "xyes"])
271 # Auto RM Update (default off, option)
272 AC_ARG_WITH([aru],[AC_HELP_STRING([--with-aru], [use Auto RM Update])])
273 AM_CONDITIONAL(OPENPTS_BUILD_AUTO_RM_UPDATE, [test "x$with_aru" == "xyes"])
276 # tboot(Intel TXT) support (default off, option)
279 [AC_HELP_STRING([--with-tboot], [support tboot])])
280 AM_CONDITIONAL(OPENPTS_BUILD_TBOOT, [test "x$with_tboot" == "xyes"])
284 AC_ARG_WITH([catgets],
285 [AC_HELP_STRING([--with-catgets], [use catgets for NLS])],
287 AC_CHECK_HEADER(nl_types.h,
288 [AC_DEFINE(HAVE_CATGETS, [1], [Use CATGETS])],
289 [AC_MSG_ERROR([catgets header not found: nl_types.h])])
292 AM_CONDITIONAL(OPENPTS_BUILD_CATGETS, [test "x$with_catgets" == "xyes"])
301 AC_SYS_LONG_FILE_NAMES
314 AM_CONDITIONAL(BUILD_DOCS, test "x$build_doc" = "xyes")
317 if test "$CC" = "xlc"; then
318 CFLAGS="$CFLAGS -qcpluscmt"
320 CFLAGS="$CFLAGS -Wall -Werror -Wreturn-type -Wsign-compare"
323 AC_CONFIG_FILES(Makefile \