File: configure.ac

package info (click to toggle)
darcs 2.0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,400 kB
  • ctags: 1,048
  • sloc: haskell: 24,937; perl: 9,736; sh: 3,369; ansic: 1,913; makefile: 17; xml: 14
file content (607 lines) | stat: -rw-r--r-- 18,128 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
dnl This file is in the public domain.

dnl Process this file with Autoconf to produce a configure script.

dnl Remove the datarootdir/docdir tests below if this is increased:
AC_PREREQ([2.59])
AC_INIT([darcs], [2.0.2], [bugs@darcs.net])
AC_CONFIG_SRCDIR([src/darcs.lhs])

dnl Write our invocation date/time and flags into a file so that
dnl Darcs knows how it was built.

ac_cmdline_args="$*"
AC_CONFIG_COMMANDS([config.command],
                   [ echo > config.command "# configured $date"
                     echo >>config.command "./configure $args"
		     chmod +x config.command
                   ],
                   [date="`date`"; args="$ac_cmdline_args"])

dnl The following is now the authoritative location of the version
dnl number. All references to the darcs version number should
dnl originate here. From Haskell this is easily done by importing
dnl the module "Autoconf ( darcs_version )".
dnl
dnl The version string must not contain any spaces. The version
dnl state will automatically be set to any of:
dnl
dnl    "prerelease #n"
dnl    "release candidate #n"
dnl    "release"
dnl    "unstable branch"
dnl    "stable branch"
dnl    "unknown branch"
dnl
dnl The new darcs custom is to increase the version number
dnl directly after a release, since the checking for a tag
dnl indicates whether the number is really correct.

DARCS_VERSION=$PACKAGE_VERSION
AC_SUBST(DARCS_VERSION)

dnl See if we are in a darcs repo and also have darcs available,
dnl and whether we're in a repository...

AC_CHECK_PROG(DARCS, darcs, darcs)
AC_MSG_CHECKING([if we're in a darcs repository])
if test ! -z "$DARCS" && test -e "_darcs/hashed_inventory"; then
  I_AM_IN_REPO=yes
else
  I_AM_IN_REPO=no
fi
AC_MSG_RESULT($I_AM_IN_REPO)
AC_SUBST(I_AM_IN_REPO)

dnl Get rid of the lousy '-g -O2' defaults

CFLAGS=$CFLAGS

dnl Find gcc

dnl AC_PROG_CC
dnl AC_PROG_CPP

dnl Make sure a decent "install" is installed.

AC_PROG_INSTALL

dnl Check to see if we are compiling under Windows

AC_CHECK_HEADER(windows.h, [SYS=windows], [SYS=other])
AC_SUBST(SYS)

dnl Find ghc

AC_CHECK_PROG(GHC, ghc, ghc)
if test -z "$GHC"; then
    AC_MSG_ERROR([Cannot find ghc in your path; please set the GHC environment variable!!])
fi
AC_SUBST(GHCFLAGS)
echo found `$GHC --version`

dnl Make sure compiler actually works:

TRY_COMPILE_GHC([main = putStr "Hello world!\n"],,
                AC_MSG_ERROR(Compile failed.))

dnl Before anything else, we need to decide what core compiler features to
dnl use, becaues this affects all the tests below (e.g. some packages may
dnl not be available with profiling)

dnl Make default to not profile...

AC_MSG_CHECKING([whether to profile])
AC_ARG_ENABLE(profile,
              AS_HELP_STRING([--enable-profile],[enable profiling]),
              profile=$enableval,profile=no)
AC_MSG_RESULT($profile)

if test "$profile" = yes; then
   GHCFLAGS="$GHCFLAGS -prof -auto-all"
fi

dnl See if we want to use -threaded to get more responsive progress reporting.
AC_MSG_CHECKING([whether to use the threaded runtime])
AC_ARG_ENABLE(threaded,AS_HELP_STRING([--disable-threaded],
              [don't compile with threaded runtime]),[AC_MSG_RESULT([no])],
              [MYOLDGHCFLAGS=$GHCFLAGS
               GHCFLAGS="$GHCFLAGS -threaded"
               TRY_COMPILE_GHC([main = putStr "Hello world!\n"],
                [AC_MSG_RESULT([yes])],
                [AC_MSG_RESULT([failed, threaded runtime disabled])
                 AC_MSG_WARN([Unable to compile with threaded runtime!])
                 GHCFLAGS=$MYOLDGHCFLAGS])])

INIT_WORKAROUND

dnl Figure out how to convert a file descriptor to a Handle

WORKAROUND_openFd

dnl Handle posix signals nicely:

WORKAROUND_POSIXSIGNALS([installHandler, raiseSignal, Handler(..), Signal,
                         sigINT, sigHUP, sigABRT, sigALRM, sigTERM, sigPIPE,])

AC_CHECK_HEADERS([siginfo.h])

dnl Look for Text.Regex

GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), text, mkRegex undefined,,
  GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), regex-compat, mkRegex undefined,,
    AC_MSG_ERROR(Cannot find Test.Regex; try installing the package text or regex-compat?)
  )
)

dnl Look for native http library

GHC_CHECK_MODULE(Network.HTTP( urlEncode ), HTTP, urlEncode undefined,
                 [HAVE_HTTP=True
                  AC_DEFINE([HAVE_HTTP])],[HAVE_HTTP=False])

AC_SUBST(HAVE_HTTP)

dnl See if we need a package for QuickCheck

GHC_CHECK_MODULE(Test.QuickCheck( quickCheck ), QuickCheck, quickCheck True,,
                 AC_MSG_ERROR(Cannot find Test.QuickCheck; try installing package quickcheck?))

dnl See if we have an adequate version of bytestring
GHC_CHECK_MODULE(Data.ByteString.Internal( fromForeignPtr ),
                 bytestring,
                 fromForeignPtr,
                 [bytestringfound=yes],
                 [bytestringfound=no])
if test $bytestringfound = "yes"; then
  AC_MSG_CHECKING([whether to use ByteString])
  AC_ARG_ENABLE(bytestring,
                AS_HELP_STRING([--disable-bytestring], [do not use bytestring, even if it is present]),
                bytestring=$enableval,
                bytestring=yes)
  AC_MSG_RESULT($bytestring)
  # If we aren't instructed to avoid bytestring, and we did successfully find bytestring...
  if test $bytestring = "yes"; then
     CPPFLAGS="$CPPFLAGS -DHAVE_BYTESTRING"
  fi
fi

dnl See if we need the util or mtl packages for Control.Monad

GHC_CHECK_MODULE(Control.Monad.Error, mtl, strMsg "foo" :: String,,
                 AC_MSG_ERROR(Cannot find Control.Monad.Error; try installing package mtl?))

dnl See if we need a package for parsec...

GHC_CHECK_MODULE(Text.ParserCombinators.Parsec, parsec, errorPos undefined,,
                 AC_MSG_ERROR(Cannot find Text.ParserCombinators.Parsec; try installing package parsec?))

dnl Check if we need package html

GHC_CHECK_MODULE(Text.Html, html, text "foo",,
                 AC_MSG_ERROR(Cannot find Text.Html; try installing package html?))

dnl Check if we need package containers

GHC_CHECK_MODULE(Data.Map, containers, empty,,
                 AC_MSG_ERROR(Cannot find Data.Map; try installing package containers?))

dnl Deal with systems on which getCurrentDirectory uses '\\' rather than '/':

WORKAROUND_getCurrentDirectory
AC_SUBST(GHC_SEPARATOR)

dnl Deal with systems without createLink

WORKAROUND_createLink

dnl Deal with GHCs without createDirectoryIfMissing

WORKAROUND_createDirectoryIfMissing

dnl Handle systems with a buggy renameFile

WORKAROUND_renameFile

dnl Deal with systems without bracketWithError

WORKAROUND_bracketOnError

dnl Handle systems that don't do POSIX file modes

WORKAROUND_fileModes

WORKAROUND_executable

dnl Make default to have optimizations on...

AC_MSG_CHECKING([whether to optimize])
AC_ARG_ENABLE(optimize,
              AS_HELP_STRING([--disable-optimize],[disable optimization]),
              optimize=$enableval, optimize=yes)
AC_MSG_RESULT($optimize)

if test "$optimize" = yes; then
   GHCFLAGS="$GHCFLAGS -O2 -funbox-strict-fields"
   if test "$CFLAGS" = ""; then
      CFLAGS="$CFLAGS -O2"
   fi
fi

dnl Make default to not use hpc

AC_MSG_CHECKING([whether to use Haskell Program Coverage])
AC_ARG_ENABLE(hpc,
              AS_HELP_STRING([--enable-hpc],[enable Haskell Program Coverage]),
              hpc=$enableval,hpc=no)
AC_MSG_RESULT($hpc)

if test "$hpc" = yes; then
   GHCFLAGS="$GHCFLAGS -fhpc"
fi

dnl See if we want to use mmap... defaults to yes, except under
dnl Windows, where this is always disabled.

AC_MSG_CHECKING([whether to use mmap])
AC_ARG_ENABLE(mmap, AS_HELP_STRING([--disable-mmap],
              [do not use mmap (use this flag if you get bus errors)]),
              enable_mmap=$enableval,enable_mmap=yes)
if test "$SYS" = "windows"; then
  AC_MSG_RESULT(no (Windows))
else
  AC_MSG_RESULT($enable_mmap)
fi
USE_MMAP="True"
if test "$enable_mmap" = "no" || test "$SYS" = "windows" ; then
    USE_MMAP="False"
fi
AC_SUBST(USE_MMAP)

TARGETS="darcs doc/darcs.1"
INSTALLWHAT="installbin"
BUILDDOC="no"

dnl Check whether to generate the AUTHORS and ChangeLog files...
if test -d "_darcs"; then
  TARGETS="$TARGETS AUTHORS ChangeLog"
fi

dnl Check whether to use crazy PackedString debugging...

AC_MSG_CHECKING([whether to do PackedString debugging])
AC_ARG_ENABLE(debug-ps,
              [  --enable-debug-ps       enable PackedString debug mode],
               debugps=$enableval, debugps=no)
AC_MSG_RESULT($debugps)


if test "$debugps" = yes; then
   GHCFLAGS="$GHCFLAGS -DDEBUG_PS"
fi

dnl Find latex and friends

AC_MSG_CHECKING([whether to build docs])
AC_ARG_WITH(docs,
	AS_HELP_STRING([--without-docs],
                           [do not try to build docs]),
           ,with_docs=yes)
AC_MSG_RESULT($with_docs)

if test "$with_docs" = "yes"; then
	AC_CHECK_PROG(LATEX, latex, latex)
	if test -z "$LATEX"; then
	AC_MSG_WARN([Cannot find latex in your path!])
	fi
	AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex)
	if test -z "$PDFLATEX"; then
	AC_MSG_WARN([Cannot find pdflatex in your path!])
	fi
	AC_CHECK_PROG(DVIPS, dvips, dvips)
	if test -z "$DVIPS"; then
	AC_MSG_WARN([Cannot find dvips in your path!])
	fi
	if test ! '(' '(' -z "$LATEX" ')' -o '(' -z "$DVIPS" ')' ')'; then
	TARGETS="$TARGETS doc/manual/darcs.ps"
	INSTALLWHAT="$INSTALLWHAT installdocs"
	BUILDDOC="yes"
	fi
	if test ! '(' -z "$PDFLATEX" ')'; then
	TARGETS="$TARGETS doc/manual/darcs.pdf doc/manual/patch-theory.pdf"
	fi
	AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
	if test -z "$LATEX2HTML"; then
	AC_MSG_WARN([Cannot find latex2html in your path!])
	PREPROCHTML=""
	AC_CHECK_PROG(HTLATEX, htlatex, htlatex)
	if test -z "$HTLATEX"; then
		AC_MSG_WARN([Cannot find htlatex in your path either!])
		AC_CHECK_PROG(HEVEA, hevea, hevea)
		if test -z "$HEVEA"; then
		AC_MSG_WARN([Cannot find hevea in your path either!])
		MAKEMANUAL="touch doc/manual/index.html; echo Cannot make manual!"
		else
		TARGETS="$TARGETS doc/manual/index.html"
		MAKEMANUAL="$HEVEA -o doc/manual/index.html src/darcs.tex"
		fi
	else
		TARGETS="$TARGETS doc/manual/index.html"
		MAKEMANUAL="cd doc/manual && $HTLATEX ../../src/darcs.tex && ln -sf darcs.html index.html"
	fi
	else
	TARGETS="$TARGETS doc/manual/index.html"
	MAKEMANUAL="$LATEX2HTML -split +1 -dir doc/manual src/darcs.tex"
	dnl the following tells "preproc" to generate "rawhtml" sections for latex2html.
	PREPROCHTML="--html"
	fi
else
	BUILDDOC="no"
fi

AC_SUBST(TARGETS)
AC_SUBST(MAKEMANUAL)
AC_SUBST(INSTALLWHAT)
AC_SUBST(PREPROCHTML)

dnl Look for sendmail...

AC_ARG_WITH(sendmail, [  --with-sendmail=PATHTOSENDMAIL],
[
SENDMAIL=$with_sendmail
HAVE_SENDMAIL="True"
],[
STUPID_PATH=/usr/sbin:/usr/lib
AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:$STUPID_PATH)
if test -z "$SENDMAIL"; then
    SENDMAIL=""
    HAVE_SENDMAIL="False"
else
    HAVE_SENDMAIL="True"
fi
])
AC_SUBST(SENDMAIL)
AC_SUBST(HAVE_SENDMAIL)

dnl Look for MAPISendMail

AC_CHECK_LIB(mapi32, MAPISendMail, HAVE_MAPI="True", HAVE_MAPI="False")
AC_SUBST(HAVE_MAPI)

if test "$HAVE_SENDMAIL" = "False" -a "$HAVE_MAPI" = "False"; then
    AC_MSG_WARN([Can't find sendmail or mapi so you won't be able to push by email!])
fi

dnl Allow use of color in output to be disabled

AC_ARG_ENABLE(color, AS_HELP_STRING([--disable-color],[do not use ansi color escapes]))

dnl export color flag
USE_COLOR="True"
if test "$enable_color" = "no"; then
    USE_COLOR="False"
fi
AC_SUBST(USE_COLOR)

dnl Try to link with static versions of libraries.

AC_ARG_WITH(static-libs, [  --with-static-libs      link with static versions of libraries])
if test "x$with_static_libs" = "xyes"; then
    LDFLAGS="-static $LDFLAGS"
fi

dnl Check whether to use existential type witnesses

AC_MSG_CHECKING([for gadt type witnesses])
AC_ARG_WITH(type-witnesses,
            AS_HELP_STRING([--with-type-witnesses],
                           [use GADT type witnesses (EXPERIMENTAL!)])
            ,with_typew=yes
            ,with_typew=no)

if test "$with_typew" = "yes"; then
 GHCFLAGS="$GHCFLAGS -fglasgow-exts"
 AC_DEFINE([GADT_WITNESSES])
 AC_MSG_RESULT([yes])
else
 AC_MSG_RESULT([no])
fi

dnl look for zlib library and header.
dnl Use GHC_CHECK_LIBRARY and not AC_CHECK_HEADER / AC_CHECK_LIB because GHC may
dnl use a different library and header than the system GCC (on Windows, issue 813)

GHC_CHECK_LIBRARY([z],[zlib.h deflate],[Int -> Int -> Int],[],
   [AC_MSG_ERROR(Cannot find system's zlib library; please set the LDFLAGS environment variable!)])

dnl Find libcurl and other libraries needed by hscurl.c

AC_ARG_WITH(libcurl,
            AS_HELP_STRING([--without-libcurl],[do not use libcurl]))

AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl=<DIR>],[use curl installed in directory <DIR>]))

CURLLIBS=
CURL_CONFIG="curl-config"

if test "$with_libcurl" != "no"; then
 if test "$with_curl" != ""; then
   CURL_CONFIG="$with_curl/bin/curl-config"
 fi

 AC_MSG_CHECKING([for libcurl])
 if eval $CURL_CONFIG --version 2>/dev/null >/dev/null; then
   ver=`$CURL_CONFIG --version | sed -e "s/libcurl //g"`
   opt="--libs"
   CURLCFLAGS=`$CURL_CONFIG --cflags`
   if test "x$with_static_libs" = "xyes"; then
       CURLCFLAGS="$CURLFLAGS -DCURL_STATICLIB"
       opt="--static-libs"
   fi
   CURLLIBS=`$CURL_CONFIG $opt | sed "s_-arch @<:@^ @:>@@<:@^ @:>@*__"`
   AC_MSG_RESULT($ver)
 else
   AC_MSG_RESULT(FAILED)
   AC_MSG_WARN([curl-config was not found])
 fi
fi

if test "$CURLLIBS" != ""; then
    # we enable curl
    CPPFLAGS="$CPPFLAGS -DHAVE_CURL"

    CFLAGS="$CFLAGS $CURLCFLAGS"
    LIBS="$LIBS $CURLLIBS"
    old_LIBS="$LIBS"
    AC_CHECK_LIB(curl, curl_global_init,
                 [],
                 AC_MSG_ERROR(Cannot actually use libcurl; try specifying --without-libcurl.))
    AC_CHECK_LIB(curl, curl_multi_timeout,
                 CPPFLAGS="$CPPFLAGS -DCURL_MULTI_TIMEOUT")
    LIBS="$old_LIBS"

    # Check if we want pipelining enabled...
    AC_ARG_WITH(curl_pipelining,
            AS_HELP_STRING([--with-curl-pipelining],[use curl pipelining (requires libcurl >= 7.18.0)]))

    if test "$with_curl_pipelining" == "yes"; then
      AC_MSG_CHECKING([for libcurl pipelining])
      let vernum=0x0`$CURL_CONFIG --vernum`
      let minver=0x071200
      if test $vernum -ge $minver; then
        CPPFLAGS="$CPPFLAGS -DCURL_PIPELINING"
        CURL_PIPELINING=True
        AC_MSG_RESULT([yes])
      else
        AC_MSG_RESULT([no])
        AC_MSG_WARN([Requires libcurl version >= 7.18.0])
      fi
    fi

    # Check if we want curl debug enabled...
    AC_MSG_CHECKING([whether to do libcurl debugging])
    AC_ARG_ENABLE(curl-debug,
                  AS_HELP_STRING([--enable-curl-debug],[enable libcurl debug mode]),
                  curl_debug=$enableval, curl_debug=no)
    AC_MSG_RESULT($curl_debug)
    if test "$curl_debug" = "yes"; then
      CPPFLAGS="$CPPFLAGS -DCURL_DEBUG"
    fi
fi

dnl Find libwww and other libraries needed by hswww.c

AC_ARG_WITH(libwww,
            AS_HELP_STRING([--with-libwww],[use libwww]))

if test "$with_libwww" == "yes"; then
 AC_MSG_CHECKING([for libwww])
 if eval libwww-config --version 2>/dev/null >/dev/null; then
   CPPFLAGS="$CPPFLAGS -DHAVE_LIBWWW"
   WWWVERSION=`libwww-config --version`
   LIBS="$LIBS `libwww-config --libs`"
   CFLAGS="$CFLAGS `libwww-config --cflags`"
   AC_MSG_RESULT($WWWVERSION)

   # Check if we want libwww debug enabled...
   AC_MSG_CHECKING([whether to do libwww debugging])
   AC_ARG_ENABLE(libwww-debug,
                 AS_HELP_STRING([--enable-libwww-debug],[enable libwww debug mode]),
                 libwww_debug=$enableval, libwww_debug=no)
   AC_MSG_RESULT($libwww_debug)
   if test "$libwww_debug" = "yes"; then
     CPPFLAGS="$CPPFLAGS -DLIBWWW_DEBUG"
   fi
 else
   AC_MSG_RESULT(FAILED)
   AC_MSG_WARN([libwww-config was not found])
 fi
fi

dnl Check for libcurses...

AC_ARG_ENABLE(libcurses, [  --without-curses        do not use libcurses])

HAVE_CURSES=False
if test "$with_libcurses" != "no"; then
  # term.h is documented to require curses.h and actually needs it on
  # Solaris, for instance, though not on GNU/Linux.
  AC_CHECK_HEADER(term.h,
      [AC_SEARCH_LIBS(tgetent, [curses ncurses], [HAVE_CURSES=True])], ,
      [#include <curses.h>
      ])
  if test "$HAVE_CURSES" != "True"; then
    AC_MSG_WARN([Cannot find term.h, disabling color.])
  else
    # The precondition for this is: we both have curses available and not disabled
    CPPFLAGS="$CPPFLAGS -DHAVE_CURSES"
  fi
fi
AC_SUBST(HAVE_CURSES)

dnl Look for a suitable diff command

AC_CHECK_PROGS(DIFF, [gdiff gnudiff diff])

dnl Look for NullSoft Installer System

AC_PATH_PROGS(MAKENSIS, [makensis.exe])

dnl Check endianness

AC_C_BIGENDIAN([BIGENDIAN="True"],[BIGENDIAN="False"])
AC_SUBST(BIGENDIAN)

dnl Check for a haddock 2.0.0 or more recent

AC_CHECK_PROG(HADDOCK, haddock, haddock)
AC_MSG_CHECKING([haddock version])
if test "$HADDOCK" = ""; then
   HADDOCK_VERSION=0
else
   HADDOCK_VERSION=`haddock --version | head -n 1 | sed 's/^.* \(@<:@0-9@:>@@<:@0-9@:>@*\)\..*/\1/g'`
fi
AC_SUBST(HADDOCK_VERSION)
AC_MSG_RESULT(version $HADDOCK_VERSION)
if test "$HADDOCK_VERSION" -lt 2; then
   AC_MSG_WARN([You need haddock 2.0.0 or later to build API docs])
fi

dnl Write results

dnl Remove these two tests when autoconf >2.59 can be required.
if test -z "${datarootdir}"; then
   datarootdir=${datarootdir:-'${prefix}/share'}
   AC_SUBST(datarootdir)
fi
if test -z "${docdir}"; then
   docdir=${docdir:-'${datarootdir}/doc/${PACKAGE_TARNAME}'}
   AC_SUBST(docdir)
fi

AC_DEFUN([AC_DATAROOTDIR_CHECKED])
OUTPUT_WORKAROUND
AC_CONFIG_FILES([autoconf.mk src/Autoconf.lhs
           tools/cgi/darcs.cgi tools/cgi/README tools/cgi/cgi.conf
	   release/darcs.spec])
AC_OUTPUT

cat <<[EOF]

The build is configured as follows:

    bindir          = $bindir
    sbindir         = $sbindir
    mandir          = $mandir
    datadir         = $datadir
    sysconfdir      = $sysconfdir
    libexecdir      = $libexecdir

    Build Manual    = $BUILDDOC

If you want to adjust any of these values, edit autoconf.mk and
src/Autoconf.lhs -- or run configure with appropriate settings.

[EOF]

dnl Responsibility shifts to the user after this point.