~ubuntu-branches/debian/wheezy/couchdb/wheezy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Noah Slater
  • Date: 2008-02-06 17:03:38 UTC
  • Revision ID: james.westby@ubuntu.com-20080206170338-y411anylx3oplqid
Tags: upstream-0.7.3~svn684
ImportĀ upstreamĀ versionĀ 0.7.3~svn684

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Copyright (C) 2007, 2008 Noah Slater <nslater@bytesexual.org>.
 
2
 
 
3
dnl Licensed under the Apache License, Version 2.0 (the "License"); you may not
 
4
dnl use this file except in compliance with the License.  dnl You may obtain a
 
5
dnl copy of the License at
 
6
dnl
 
7
dnl   http://www.apache.org/licenses/LICENSE-2.0
 
8
dnl
 
9
dnl Unless required by applicable law or agreed to in writing, software
 
10
dnl distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
11
dnl WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
12
dnl License for the specific language governing permissions and limitations
 
13
dnl under the License.
 
14
 
 
15
m4_include([m4/ac_check_icu.m4])
 
16
 
 
17
AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [LOCAL_LIST_ADDRESS],
 
18
    [LOCAL_PACKAGE_IDENTIFIER])
 
19
 
 
20
AC_PREREQ([2.59])
 
21
 
 
22
AC_CONFIG_SRCDIR([ChangeLog])
 
23
AC_CONFIG_AUX_DIR([build-aux])
 
24
 
 
25
AM_CONFIG_HEADER([config.h])
 
26
 
 
27
AM_INIT_AUTOMAKE([1.6.3 gnu check-news])
 
28
 
 
29
AC_GNU_SOURCE
 
30
AC_ENABLE_SHARED
 
31
AC_DISABLE_STATIC
 
32
 
 
33
AC_PROG_CC
 
34
AC_PROG_LIBTOOL
 
35
AC_PROG_LN_S
 
36
 
 
37
AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH],
 
38
        [set PATH to the Erlang include directory])], [
 
39
    ERLANG_DIRECTORY=$withval
 
40
], [
 
41
    ERLANG_DIRECTORY=${libdir}/erlang/usr/include
 
42
])
 
43
 
 
44
 
 
45
FLAG_USR="-I/usr/lib/erlang/usr/include"
 
46
FLAG_USR_LOCAL="-I/usr/local/lib/erlang/usr/include"
 
47
FLAG_OPT_LOCAL="-I/opt/local/lib/erlang/usr/include"
 
48
FLAGS="$FLAG_USR $FLAG_USR_LOCAL $FLAG_OPT_LOCAL -I${ERLANG_DIRECTORY}"
 
49
CPPFLAGS="$FLAGS"
 
50
LDFLAGS="$FLAGS"
 
51
CFLAGS="-fPIC"
 
52
 
 
53
AC_CHECK_ICU([3])
 
54
 
 
55
ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath`
 
56
ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath`
 
57
 
 
58
AC_SUBST(ICU_CONFIG)
 
59
AC_SUBST(ICU_LOCAL_CFLAGS)
 
60
AC_SUBST(ICU_LOCAL_LDFLAGS)
 
61
 
 
62
AC_PATH_PROG([ERL], [erl])
 
63
 
 
64
if test x${ERL} = x; then
 
65
    AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?])
 
66
fi
 
67
 
 
68
AC_PATH_PROG([ERLC], [erlc])
 
69
 
 
70
if test x${ERLC} = x; then
 
71
    AC_MSG_ERROR([Could not find the `erlc' executable. Is Erlang installed?])
 
72
fi
 
73
 
 
74
AC_CHECK_HEADER([erl_driver.h], [], [
 
75
    AC_MSG_ERROR([Could not find the `erl_driver.h' header.
 
76
 
 
77
Are the Erlang headers installed? Use the `--with-erlang' option to specify the
 
78
path to the Erlang include directory.])])
 
79
 
 
80
AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man])
 
81
if test x${HELP2MAN_EXECUTABLE} = x; then
 
82
    AC_MSG_WARN([You will be unable to regenerate any man pages.])
 
83
fi
 
84
 
 
85
use_init=yes
 
86
use_launchd=yes
 
87
 
 
88
AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init],
 
89
    [don't install init script where applicable])], [
 
90
    use_init=$enableval
 
91
], [])
 
92
 
 
93
AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd],
 
94
    [don't install launchd configuration where applicable])], [
 
95
    use_launchd=$enableval
 
96
], [])
 
97
 
 
98
init_enabled=false
 
99
launchd_enabled=false
 
100
 
 
101
if test "$use_init" = "yes"; then
 
102
   AC_MSG_CHECKING(location of init directory)
 
103
   if test -d /etc/rc.d; then
 
104
       init_enabled=true
 
105
       AC_SUBST([initdir], ['${sysconfdir}/rc.d'])
 
106
       AC_MSG_RESULT(${initdir})
 
107
   else
 
108
       if test -d /etc/init.d; then
 
109
           init_enabled=true
 
110
           AC_SUBST([initdir], ['${sysconfdir}/init.d'])
 
111
           AC_MSG_RESULT(${initdir})
 
112
       else
 
113
           AC_MSG_RESULT(not found)
 
114
       fi
 
115
    fi
 
116
fi
 
117
 
 
118
if test "$use_launchd" = "yes"; then
 
119
    AC_MSG_CHECKING(location of launchd directory)
 
120
    if test -d /Library/LaunchDaemons; then
 
121
        init_enabled=false
 
122
        launchd_enabled=true
 
123
        AC_SUBST([launchddir], ['${prefix}/Library/LaunchDaemons'])
 
124
        AC_MSG_RESULT(${launchddir})
 
125
    else
 
126
        AC_MSG_RESULT(not found)
 
127
    fi
 
128
fi
 
129
 
 
130
AC_ARG_VAR([ERL_EXECUTABLE], [path to the `erl' executable])
 
131
AC_ARG_VAR([ERLC_EXECUTABLE], [path to the `erlc' executable])
 
132
AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program])
 
133
 
 
134
if test -n "$HELP2MAN_EXECUTABLE"; then
 
135
    help2man_enabled=true
 
136
else
 
137
    if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/bin/couchjs.1"; then
 
138
        help2man_enabled=true
 
139
    else
 
140
        help2man_enabled=false
 
141
    fi
 
142
fi
 
143
 
 
144
AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
 
145
AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
 
146
AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue])
 
147
 
 
148
AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
 
149
AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
 
150
AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
 
151
AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
 
152
 
 
153
AC_SUBST([version], ["LOCAL_VERSION"])
 
154
AC_SUBST([version_major], ["LOCAL_VERSION_MAJOR"])
 
155
AC_SUBST([version_minor], ["LOCAL_VERSION_MINOR"])
 
156
AC_SUBST([version_revision], ["LOCAL_VERSION_REVISION"])
 
157
AC_SUBST([version_stage], ["LOCAL_VERSION_STAGE"])
 
158
AC_SUBST([version_release], ["LOCAL_VERSION_RELEASE"])
 
159
 
 
160
AC_SUBST([list_address], ["LOCAL_LIST_ADDRESS"])
 
161
AC_SUBST([list_uri], ["LOCAL_LIST_URI"])
 
162
 
 
163
AC_SUBST([pkgconfdir], [${sysconfdir}/${PACKAGE_TARNAME}])
 
164
AC_SUBST([pkgdatadir], [${datadir}/${PACKAGE_TARNAME}])
 
165
AC_SUBST([pkgdocdir], [${datadir}/doc/${PACKAGE_TARNAME}])
 
166
AC_SUBST([pkglibdir], [${libdir}/${PACKAGE_TARNAME}])
 
167
AC_SUBST([pkgstatelibdir], [${localstatedir}/lib/${PACKAGE_TARNAME}])
 
168
AC_SUBST([pkgstatelogdir], [${localstatedir}/log/${PACKAGE_TARNAME}])
 
169
AC_SUBST([libbindir], [${pkglibdir}/bin])
 
170
AC_SUBST([erlangbindir], [${pkglibdir}/erlang/bin])
 
171
AC_SUBST([erlanglibdir], [${pkglibdir}/erlang/lib])
 
172
 
 
173
AC_REVISION([LOCAL_VERSION])
 
174
 
 
175
AC_CONFIG_FILES([Makefile])
 
176
AC_CONFIG_FILES([bin/couchjs.tpl])
 
177
AC_CONFIG_FILES([bin/couchdb.tpl])
 
178
AC_CONFIG_FILES([bin/Makefile])
 
179
AC_CONFIG_FILES([etc/couch_httpd.conf.tpl])
 
180
AC_CONFIG_FILES([etc/couch.ini.tpl])
 
181
AC_CONFIG_FILES([etc/default/couchdb.tpl])
 
182
AC_CONFIG_FILES([etc/default/Makefile])
 
183
AC_CONFIG_FILES([etc/init/couchdb.tpl])
 
184
AC_CONFIG_FILES([etc/init/Makefile])
 
185
AC_CONFIG_FILES([etc/launchd/org.couchdb.couchdb.plist.tpl])
 
186
AC_CONFIG_FILES([etc/launchd/Makefile])
 
187
AC_CONFIG_FILES([etc/logrotate.d/couchdb.tpl])
 
188
AC_CONFIG_FILES([etc/logrotate.d/Makefile])
 
189
AC_CONFIG_FILES([etc/Makefile])
 
190
AC_CONFIG_FILES([share/Makefile])
 
191
AC_CONFIG_FILES([src/build_couch.erl])
 
192
AC_CONFIG_FILES([src/CouchDB/Makefile])
 
193
AC_CONFIG_FILES([src/Emakefile])
 
194
AC_CONFIG_FILES([src/Makefile])
 
195
AC_CONFIG_FILES([var/Makefile])
 
196
 
 
197
AC_OUTPUT
 
198
 
 
199
echo
 
200
echo "You have configured CouchDB. Time to relax."
 
201
echo
 
202
echo "Run \`make && make install' to install."