OSDN Git Service

Exclude conflicted property
[openpts/openpts.git] / configure.in
1 #
2 # Makefile.am
3 #
4 # This file is part of the OpenPTS project.
5 #
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.
10 #
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)
14 # any later version.
15 #
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.
20 #
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.
24 #
25
26 AC_INIT(openpts, 0.2.6, openpts-users@lists.sourceforge.jp)
27
28 # use pkg-config
29 # check /usr/lib64/pkgconfig/
30 # PKG_PROG_PKG_CONFIG
31
32 PTS_SPEC_MAJOR=0
33 PTS_SPEC_MINOR=0
34 PTS_VER_MAJOR=2
35 PTS_VER_MINOR=6
36
37 # set PCR index used by OpenPTS
38 OPENPTS_PCR_INDEX=11
39
40 # use pkg-config
41 # check /usr/lib64/pkgconfig/
42 PKG_PROG_PKG_CONFIG
43
44 AC_CONFIG_AUX_DIR([.])
45
46 AC_CONFIG_MACRO_DIR([m4])
47 AC_CANONICAL_TARGET
48 AM_INIT_AUTOMAKE([foreign 1.6])
49
50 AC_CANONICAL_HOST
51 #AM_GNU_SOURCE
52
53 DEBUG=""
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
57     DEBUG="yes"
58     AC_MSG_RESULT([yes])
59   else
60     DEBUG="no"
61     AC_MSG_RESULT([no])
62   fi],
63  [DEBUG="no"
64   AC_MSG_RESULT([no])])
65
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"
71     else
72         CFLAGS="-g -O2"
73     fi
74 elif test "$DEBUG" == "yes"; then
75     CFLAGS="$CFLAGS -O0 -g -DDEBUG"
76 fi
77
78 # TNC support (default off)
79 AC_ARG_ENABLE(
80   tnc,
81   AC_HELP_STRING([--enable-tnc], [create a IMC/IMV libraries for TNC]),
82   TNC="yes")
83
84 AM_CONDITIONAL(OPENPTS_BUILD_LIBTNC, [test "x$TNC" == "xyes"])
85
86
87 AC_PROG_CC
88 AC_PROG_INSTALL
89 AC_PROG_LIBTOOL
90
91 CFLAGS="$CFLAGS \
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}"
95
96
97 AC_CHECK_PROGS(COPY, cp)
98 AC_CHECK_PROGS(ECHO, echo)
99 AC_CHECK_PROGS(MKDIR, mkdir)
100 AC_CHECK_PROGS(RM, rm)
101
102 # NLS
103 # /usr/share/aclocal/gettext.m4
104 AM_GNU_GETTEXT_VERSION([0.17])
105 AM_GNU_GETTEXT([external])
106
107 # Arch specific stuff
108 # set -m64 CFLAG option for 64bit platforms
109 case $target in
110     *ppc64* | *powerpc64* | *x86_64* | *s390x*)
111         CFLAGS="$CFLAGS -m64"
112         ;;
113     *)
114         ;;
115 esac
116
117 # set OS def
118 # TODO add other OSs
119 case $target in
120     *linux*)
121         linux=yes
122         AC_DEFINE(HAVE_DAEMON, [1], [have daemon()])
123         AC_DEFINE(HAVE_VSYSLOG, [1], [have vsyslog()])
124         AC_DEFINE(HAVE_SENDFILE, [1], [have vsyslog()])
125         ;;
126     *aix*)
127         aix=yes
128         ;;
129     *solaris*)
130         solaris=yes
131         ;;
132     *)
133         ;;
134 esac
135 AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
136 AM_CONDITIONAL(AIX, [test "x$aix" = xyes])
137 AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
138
139
140 # PKG_CHECK_MODULES(prefix, list-of-modules, action-if-found, action-if-not-found)
141
142 # OpenSSL, libcrypto-0.9.X
143 #   RHRL6, this set -L/usr/lib6464 :-(
144 #     Fix 
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
150 PKG_CHECK_MODULES(
151     [LIBCRYPTO],
152     [libcrypto >= 0.9],
153     [AC_DEFINE(HAVE_LIBCRYPTO, [1], [Use LIBCRYPTO])],
154     [AC_MSG_ERROR([libcrypto not found.])]
155 )
156 AC_SUBST(LIBCRYPTO_CFLAGS)
157 AC_SUBST(LIBCRYPTO_LIBS)
158
159 # libxml2
160 PKG_CHECK_MODULES(
161     [LIBXML2],
162     [libxml-2.0 >= 2.6.0],
163     [AC_DEFINE(HAVE_LIBXML2, [1], [Use LIBXML2])],
164     [AC_MSG_ERROR([libxml-2.0 not found.])]
165 )
166 AC_SUBST(LIBXML2_CFLAGS)
167 AC_SUBST(LIBXML2_LIBS)
168
169 # libuuid or libc uuid 
170 PKG_CHECK_MODULES(
171     [LIBUUID],
172     [uuid >= 2.0.0],
173     [AM_CONDITIONAL([HAVE_LIBUUID], [true])],
174     [AC_MSG_WARN([libuuid not found. use libc uuid and wrapper])
175      AM_CONDITIONAL([HAVE_LIBUUID], [false])]
176 )
177 AC_SUBST(LIBUUID_CFLAGS)
178 AC_SUBST(LIBUUID_LIBS)
179
180 # libtspi
181
182 # AC_ARG_WITH ( package , help-string , [ action-if-given ], [ action-if-not-given ]):
183
184 # TSS support  (default off, verifier does not requires TSS library?)
185 #   RHEL6 missing by pkg-config, use AC_CHECK_LIB
186 #        /usr/include/tss
187 #   AIX
188 #        /usr/include/trousers
189 #
190 AC_ARG_WITH([tss],
191     [AC_HELP_STRING([--with-tss], [use TSS])],
192     [
193         PKG_CHECK_MODULES(
194             [LIBTSPI],
195             [trousers >= 0.3.4],
196             [
197                 AC_DEFINE(HAVE_TSS, [1], [Use TSS])
198                 AC_SUBST(TSS_CFLAGS)
199                 AC_SUBST(TSS_LIBS)
200             ], [
201                 AC_MSG_WARN([libtspi(trousers) not found by pkg-config.])
202                 AC_CHECK_LIB(tspi, Tspi_Context_Create,
203                 [
204                     if test "x$aix" = xyes; then
205                         TSS_CFLAGS=-I/usr/include/tss
206                     else
207                         TSS_CFLAGS="-I/usr/include/trousers -I/usr/include/tss"
208                     fi
209                     TSS_LIBS=-ltspi
210                     AC_SUBST(TSS_CFLAGS)
211                     AC_SUBST(TSS_LIBS)
212                 ], [
213                     AC_MSG_ERROR([libtspi(trousers) not found])
214                 ])
215             ]
216         )
217         AC_CHECK_HEADER(trousers/tss.h, [],
218             [AC_MSG_ERROR([trousers(tss) header not found: trousers/tss.h])]
219         )
220     ], [
221         # set CFLAGS for build - TODO depend TSS or not
222         if test "x$aix" = xyes; then
223             TSS_CFLAGS=-I/usr/include/tss
224         else
225             TSS_CFLAGS="-I/usr/include/trousers -I/usr/include/tss"
226         fi
227         AC_SUBST(TSS_CFLAGS)
228     ]
229 )
230 AM_CONDITIONAL(OPENPTS_BUILD_TSS, [test "x$with_tss" == "xyes"])
231
232
233 # AIDE support  (default off, option)
234 #   Linux Only?
235 AC_ARG_WITH([aide],
236     [AC_HELP_STRING([--with-aide], [use AIDE])])
237 AM_CONDITIONAL(OPENPTS_BUILD_AIDE, [test "x$with_aide" == "xyes"])
238
239
240 # SQLite support for AIDE
241 #   RHEL6 supports pkg-config
242 AC_ARG_WITH([sqlite],
243     [AC_HELP_STRING([--with-sqlite], [use SQLite])],
244     [
245         PKG_CHECK_MODULES(
246             [SQLITE],
247             [sqlite3 >= 3.6.0],
248             [
249                 AC_DEFINE(HAVE_SQLITE, [1], [Use SQLITE])
250                 AC_SUBST(SQLITE_CFLAGS)
251                 AC_SUBST(SQLITE_LIBS)
252             ], [
253                 AC_MSG_ERROR([sqlite2 not found by pkg-config.])
254             ]
255         )
256     ])
257 AM_CONDITIONAL(OPENPTS_BUILD_SQLITE, [test "x$with_sqlite" == "xyes"])
258
259
260 # PostgreSQL support for AIDE
261 #   RHEL6, missing by pkg-config
262 AC_ARG_WITH([pq],
263     [AC_HELP_STRING([--with-pq], [use PostgreSQL])],
264     [
265         LIBPQ_LIBS=-lpq
266         AC_SUBST(LIBPQ_LIBS)
267     ])
268 AM_CONDITIONAL(OPENPTS_BUILD_PQ, [test "x$with_pq" == "xyes"])
269
270
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"])
274
275
276 # tboot(Intel TXT) support  (default off, option)
277 #   Linux Only?
278 AC_ARG_WITH([tboot],
279     [AC_HELP_STRING([--with-tboot], [support tboot])])
280 AM_CONDITIONAL(OPENPTS_BUILD_TBOOT, [test "x$with_tboot" == "xyes"])
281
282
283 # NLS use catgets
284 AC_ARG_WITH([catgets],
285     [AC_HELP_STRING([--with-catgets], [use catgets for NLS])],
286     [
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])])
290     ]
291 )
292 AM_CONDITIONAL(OPENPTS_BUILD_CATGETS, [test "x$with_catgets" == "xyes"])
293
294
295
296 AC_HEADER_STDC
297
298 AC_C_CONST
299 AC_C_INLINE
300
301 AC_SYS_LONG_FILE_NAMES
302
303 AC_TYPE_MODE_T
304 AC_TYPE_OFF_T
305 AC_TYPE_PID_T
306 AC_TYPE_SIZE_T
307 AC_TYPE_SIGNAL
308 AC_TYPE_UID_T
309
310
311
312
313 # Doc 
314 AM_CONDITIONAL(BUILD_DOCS, test "x$build_doc" = "xyes")
315
316
317 if test "$CC" = "xlc"; then
318     CFLAGS="$CFLAGS -qcpluscmt"
319 else
320     CFLAGS="$CFLAGS -Wall -Werror -Wreturn-type -Wsign-compare"
321 fi
322
323 AC_CONFIG_FILES(Makefile  \
324         po/Makefile.in    \
325         m4/Makefile       \
326         include/Makefile  \
327         src/Makefile      \
328         doc/Makefile      \
329         doc/doxygen.conf  \
330         models/Makefile   \
331         dist/openpts.spec \
332         dist/ptsc.conf    \
333         dist/ptsv.conf    \
334         man/Makefile      \
335         man/man1/Makefile \
336         man/man3/Makefile \
337         man/man5/Makefile \
338         man/man8/Makefile)
339
340 AC_OUTPUT
341