File: configure.ac

package info (click to toggle)
quilt 0.39-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,008 kB
  • ctags: 60
  • sloc: sh: 3,580; perl: 1,003; ansic: 352; makefile: 264
file content (270 lines) | stat: -rw-r--r-- 7,991 bytes parent folder | download
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
dnl Process this file with autoconf to produce a configure script.
AC_INIT([quilt],[0.39],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
AC_REVISION ($Revision: 1.34 $)

PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)

dnl Setup for backup-files compilation
AC_HEADER_STDC
AC_CHECK_FUNCS([mkdir])
AC_CHECK_FUNCS([rmdir])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strrchr])
AC_C_CONST
AC_FUNC_STAT

AC_PROG_INSTALL

AC_SYS_INTERPRETER
if test "$interpval" != yes ; then
	AC_MSG_WARN([no

bash/perl scripts may not be invoked correctly due to problems with your 
systems implementation of #! being either broken or non-existant.
])
fi

dnl Check for Bourne-Again Shell
unset BASH  # bash sets this itself!
AC_ARG_WITH(bash, AC_HELP_STRING(
    [--with-bash], [name of the bash executable to use]),
    [
	BASH="$withval"
	AC_SUBST(BASH)
	AC_MSG_NOTICE([Using bash executable $BASH])
    ],[
	AC_PATH_PROG(BASH, bash)
    ])
if test -z "$BASH" ; then
    AC_MSG_ERROR([Please specify the location of bash with the option '--with-bash'])
fi

# It would be nice not to have to use backticks, but too many retarded sh
# implementations still don't support $( )
# BEWARE:  There is a distinct possibility that we are currently running under
# bash in this configure script (/bin/sh being a symlink to /bin/bash).  Even
# though the result /could/ be available to us directly as $BASH_VERSION we
# don't want to use, or trust it, incase the user is specifying a different
# bash executable.
if `$BASH -c '[[ "$BASH_VERSION" \< "2.04" ]]'` ; then
    AC_MSG_ERROR([
$PACKAGE_NAME requires at least version 2.04 of bash, you can download a current
version of bash from ftp.gnu.org
])
fi

dnl Check for Perl
AC_ARG_WITH(perl, AC_HELP_STRING(
    [--with-perl], [name of the Perl executable to use]),
    [
	PERL="$withval"
	AC_SUBST(PERL)
	AC_MSG_NOTICE([Using Perl executable $PERL])
    ],[
	AC_PATH_PROGS(PERL, [perl perl5])
    ])
if test -z "$PERL" ; then
    AC_MSG_ERROR([Please specify the location of Perl with the option '--with-perl'])
fi

dnl Check for sed
AC_ARG_WITH(sed, AC_HELP_STRING(
    [--with-sed], [name of the sed executable to use]),
    [
	SED="$withval"
	AC_SUBST(SED)
	AC_MSG_NOTICE([Using sed executable $SED])
    ],[
	SED="sed"
	AC_SUBST(SED)
    ])

dnl Check for awk
AC_ARG_WITH(awk, AC_HELP_STRING(
    [--with-awk], [name of the awk executable to use]),
    [
	AWK="$withval"
	AC_SUBST(AWK)
	AC_MSG_NOTICE([Using awk executable $AWK])
    ],[
	AC_PATH_PROGS(AWK, [gawk awk])
    ])

dnl Test for awk features that may be mising?

if test -z "$PERL" ; then
    AC_MSG_ERROR([Please specify the location of Perl with the option '--with-perl'])
fi

dnl Checks for mktemp (for creating temporary files and directories)
AC_ARG_WITH(mktemp, AC_HELP_STRING(
    [--with-mktemp], [name of the mktemp executable to use (or 'none'
		      to use a quilt internal mechanism)]),
    [
	MKTEMP="$withval"
	AC_SUBST(MKTEMP)
	AC_MSG_NOTICE([Using mktemp executable $MKTEMP])
    ],[
	AC_PATH_PROG(MKTEMP, mktemp)
    ])
if test -z "$MKTEMP" -o "$MKTEMP" = "none" ; then
    MKTEMP=internal_mktemp
else
    AC_MSG_CHECKING(whether $MKTEMP -d works)
    if tempdir=`$MKTEMP -d /tmp/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
       rmdir "$tempdir" ; then
	AC_MSG_RESULT(yes)
    else
	AC_MSG_RESULT(no)
	AC_MSG_ERROR([
'$MKTEMP -d' does not create temporary directories.
If you don't have a version of mktemp that can create directories, you
can specify '--with-mktemp=none' and $PACKAGE_NAME will use its own
internal tempfile generation mechanism.
])
    fi
fi

dnl Check for diff
AC_ARG_WITH(diff, AC_HELP_STRING(
    [--with-diff], [name of the diff executable to use]),
    [
	DIFF="$withval"
	AC_SUBST(DIFF)
	AC_MSG_NOTICE([Using diff executable $DIFF])
    ],[
	AC_PATH_PROG(DIFF, diff)
    ])
if test -z "$DIFF"; then
    AC_MSG_ERROR([Please specify the location of diff with the option '--with-diff'])
fi

dnl Check for patch
AC_ARG_WITH(patch, AC_HELP_STRING(
    [--with-patch], [name of the patch executable to use]),
    [
	PATCH="$withval"
	AC_SUBST(PATCH)
	AC_MSG_NOTICE([Using patch executable $PATCH])
    ],[
	AC_PATH_PROG(PATCH, patch)
    ])
if test -z "$PATCH"; then
    AC_MSG_ERROR([Please specify the location of patch with the option '--with-patch'])
fi

# Sun's patch is a mess, issue a warning.  But we are going to continue with
# the build because you might just be lucky.
AC_MSG_CHECKING([whether $PATCH will work])
if $PATCH -v 2>&1 | grep -q "Sun" >/dev/null 2>&1; then
	AC_MSG_RESULT(no)
	AC_MSG_WARN([
Sorry, you have a Sun version of patch which is notoriously buggy.  $PACKAGE_NAME
may function correctly, or minor errors may occur due to Sun's patch tool.
Please consider upgrading to GNU patch, if you already have GNU patch then you
can supply its path with the '--with-patch=' option.
])
elif $PATCH --version 2>&1 | grep -q "patch 2.0" >/dev/null 2>&1; then
	AC_MSG_RESULT(no)
	AC_MSG_WARN([
Sorry, the version of patch you are using can cause severe problems when a patch
creates a directory.  $PACKAGE_NAME may well function correctly with this version
of patch or small problems could creep in.
Please consider upgrading your patch to a more recent version, if you already 
have a more recent version of patch then you can supply its path with the 
'--with-patch=' option.
])
else
	AC_MSG_RESULT(yes)
fi

dnl Check for diffstat
AC_ARG_WITH(diffstat, AC_HELP_STRING(
    [--with-diffstat], [name of the diffstat executable to use]),
    [
       DIFFSTAT="$withval"
       AC_SUBST(DIFFSTAT)
       AC_MSG_NOTICE([Using diffstat executable $DIFFSTAT])
    ],[
       AC_PATH_PROG(DIFFSTAT, diffstat)
    ])
if test -z "$DIFFSTAT"; then
    AC_MSG_WARN([
diffstat utility not found; the --diffstat option of the refresh command
will not work correctly until diffstat is installed. If you have diffstat
in a directory that is not in the search path you can specify its location
using the '--with-diffstat' option.
])
    DIFFSTAT="diffstat"
fi

dnl Check for sendmail
AC_ARG_WITH(mta, AC_HELP_STRING(
    [--with-mta], [mail transfer agent to use]),
    [
	MTA="$withval"
	AC_SUBST(MTA)
	AC_MSG_NOTICE([Using mail transfer executable $MTA])
    ],[
	AC_PATH_PROG(MTA, sendmail, [], [$PATH:/usr/sbin])
    ])
if test -z "$MTA"; then
    AC_MSG_WARN([
Mail transfer executable not found; the --send option of the mail command
will not work correctly. If you have a mail transfer agent in a directory
that is not in the search path you can specify its location using the
'--with-mta' option.
])
    MTA="sendmail"
fi

dnl Check for NLS
AC_ARG_ENABLE(nls, AC_HELP_STRING(
    [--enable-nls], [include natural language support]))
if test "$enableval" != "no"; then
    AC_PATH_PROG(MSGFMT, msgfmt)
fi
if test "$enableval" = "yes" -a -z "$MSGFMT" ; then
    AC_MSG_ERROR([
You do not appear to have msgfmt, which is part of the GNU Gettext package.  It
is a required package as you chose the '--enable-nls' option to configure.
You can download GNU Gettext from ftp.gnu.org
])
fi
if test -z "$MSGFMT" ; then
    AC_MSG_NOTICE([Building without natural language support])
fi

dnl Determine where package documentation is supposed to go
if test -n "$RPM_DOC_DIR" ; then
    docdir="$RPM_DOC_DIR"
else
    docdir='$(datadir)/doc'
fi
AC_SUBST(docdir)

dnl Check for rpmbuild (v4) vs. rpm (v3)
AC_PATH_PROGS(RPMBUILD, [rpmbuild rpm])
AC_SUBST(RPMBUILD)

AC_CONFIG_FILES(Makefile)
AC_OUTPUT

dnl Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE_NAME version $PACKAGE_VERSION configured.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$prefix' for installation prefix.])

# we don't need to see this just for the backup-files command
# but we may as well spec it for the future
#AC_MSG_RESULT([Using '$CC' for C compiler.])
#AC_MSG_RESULT([Building with '$CFLAGS' for C compiler flags.])
#AC_MSG_RESULT([Building with '$LIBS' for linker flags.])

AC_MSG_RESULT([])
AC_MSG_RESULT([Report bugs to $PACKAGE_BUGREPORT])