-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigure.in
151 lines (118 loc) · 3.02 KB
/
configure.in
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
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Process this file with autoconf to produce a configure script.
AC_INIT()
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(super-smack, 1.1)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
# Checks for programs.
AC_CHECK_PROG(SHELL, sh)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LEX
AC_PROG_YACC
# get super-smack datadir
AC_ARG_WITH(datadir,
[ --with-datadir=DIR Specify default smack datadir],
[
DATADIR="${withval}"
],
[
DATADIR=/var/smack-data
])
AC_ARG_WITH(smacks-dir,
[ --with-smacks-dir=DIR Directory to install example smacks],
[
SMACKS_DIR="${withval}"
],
[
SMACKS_DIR=/usr/share/smacks
])
AC_SUBST(SMACKS_DIR)
AC_DEFINE_UNQUOTED(SMACK_DATADIR, "$DATADIR")
AC_SUBST(DATADIR)
# Various APIs we support
# MySQL
want_mysql="no"
AC_ARG_WITH(mysql,
[ --with-mysql Build with MySQL support],
[
AC_DEFINE(HAVE_MYSQL)
want_mysql="yes"
])
# PostgreSQL
want_pgsql="no"
AC_ARG_WITH(pgsql,
[ --with-pgsql Build with PostgreSQL support],
[
AC_DEFINE(HAVE_PGSQL)
want_pgsql="yes"
])
# Oracle
want_oracle="no"
AC_ARG_WITH(oracle,
[ --with-oracle Build with Oracle support],
[
AC_DEFINE(HAVE_ORACLE)
want_oracle="yes"
])
# Checks for libraries.
AC_LIB_Z
# Checks for functions.
AC_FUNC_CRYPT
# Checks for APIs
# MySQL
AC_LIB_MYSQL
AC_HEADER_MYSQL
# PostgreSQL
AC_LIB_PGSQL
AC_HEADER_PGSQL
# Oracle
AC_LIB_ORACLE
AC_HEADER_ORACLE
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday strerror)
# Check to see if we are building with any support...
if test "x$want_mysql" != "xyes" \
-a "x$want_pgsql" != "xyes" \
-a "x$want_oracle" != "xyes"
then
AC_MSG_ERROR([
You should include support for at least one database!
Reconfigure with one or more of:
--with-mysql
--with-pgsql
--with-oracle
])
fi
AC_OUTPUT(Makefile src/Makefile)
cat <<EOS
Building with the following options:
MySQL Support..................... $want_mysql
PostgreSQL Support................ $want_pgsql
Oracle Support.................... $want_oracle
If this is not what you intended, please re-run configure.
Thanks for using super-smack!
EOS