Revision e5bd9de5

b/configure.ac
240 240
fi
241 241
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
242 242

  
243
# --enable-htools
244
HTOOLS=
245
AC_ARG_ENABLE([htools],
246
        [AS_HELP_STRING([--enable-htools],
247
        [enable use of htools (needs GHC and libraries, default: check)])],
248
        [],
249
        [enable_htools=check])
250

  
243 251
# --with-disk-separator=...
244 252
AC_ARG_WITH([disk-separator],
245 253
  [AS_HELP_STRING([--with-disk-separator=STRING],
......
293 301
  AC_MSG_ERROR([socat not found])
294 302
fi
295 303

  
304
if test "$enable_htools" != "no"; then
305

  
306
# Check for ghc
307
AC_ARG_VAR(GHC, [ghc path])
308
AC_PATH_PROG(GHC, [ghc], [])
309
if test -z "$GHC"; then
310
  if test "$enable_htools" != "check"; then
311
    AC_MSG_FAILURE([ghc not found, htools compilation will not possible])
312
  fi
313
fi
314

  
315
# Check for ghc-pkg
316
HTOOLS_MODULES=
317
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
318
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
319
if test -z "$GHC_PKG"; then
320
  if test "$enable_htools" != "check"; then
321
    AC_MSG_FAILURE([ghc-pkg not found, htools compilation will not be possible])
322
  fi
323
else
324
  # check for modules
325
  AC_MSG_NOTICE([checking for required haskell modules])
326
  AC_MSG_CHECKING([curl])
327
  GHC_PKG_CURL=$($GHC_PKG latest curl)
328
  if test -z "$GHC_PKG_CURL"; then
329
    AC_MSG_WARN([The curl library not found, htools will be compiled
330
                 without RAPI support])
331
    AC_SUBST(HTOOLS_NOCURL, [-DNO_CURL])
332
  fi
333
  AC_MSG_RESULT($GHC_PKG_CURL)
334
  AC_SUBST(GHC_PKG_CURL)
335
  AC_MSG_CHECKING([parallel])
336
  GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-2.*')
337
  if test -z "$GHC_PKG_PARALLEL"
338
  then
339
    GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-1.*')
340
  fi
341
  AC_SUBST(GHC_PKG_PARALLEL)
342
  AC_MSG_RESULT($GHC_PKG_PARALLEL)
343
  AC_MSG_CHECKING([json])
344
  GHC_PKG_JSON=$($GHC_PKG latest json)
345
  AC_MSG_RESULT($GHC_PKG_JSON)
346
  AC_MSG_CHECKING([network])
347
  GHC_PKG_NETWORK=$($GHC_PKG latest network)
348
  AC_MSG_RESULT($GHC_PKG_NETWORK)
349
  if test -z "$GHC_PKG_PARALLEL" || test -z "$GHC_PKG_JSON" || \
350
     test -z "$GHC_PKG_NETWORK"; then
351
    if test "$enable_htools" != "check"; then
352
      AC_MSG_FAILURE([Required Haskell modules not found, htools compilation
353
                      disabled])
354

  
355
    fi
356
  else
357
    # we leave the other modules to be auto-selected
358
    HTOOLS_MODULES="-package $GHC_PKG_PARALLEL"
359
  fi
360
fi
361
AC_SUBST(HTOOLS_MODULES)
362

  
363
if test "$enable_htools" != "no"; then
364
  if test -z "$GHC" || test -z "$HTOOLS_MODULES"; then
365
    AC_MSG_WARN([Haskell compiler/required libraries not found, htools
366
                 compilation disabled])
367
  else
368
    HTOOLS=yes
369
  fi
370
fi
371
AC_SUBST(HTOOLS)
372

  
373
# Check for HsColour
374
HTOOLS_APIDOC=no
375
AC_ARG_VAR(HSCOLOUR, [HsColour path])
376
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
377
if test -z "$HSCOLOUR"; then
378
  AC_MSG_WARN([HsColour not found, htools API documentation will not be
379
               generated])
380
fi
381

  
382
# Check for haddock
383
AC_ARG_VAR(HADDOCK, [haddock path])
384
AC_PATH_PROG(HADDOCK, [haddock], [])
385
if test -z "$HADDOCK"; then
386
  AC_MSG_WARN([haddock not found, htools API documentation will not be
387
               generated])
388
fi
389
if test "$HADDOCK" && test "$HSCOLOUR"; then
390
  HTOOLS_APIDOC=yes
391
fi
392
AC_SUBST(HTOOLS_APIDOC)
393

  
394
fi # end if enable_htools, define automake conditions
395

  
396
AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
397
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
398

  
399

  
296 400
SOCAT_USE_ESCAPE=
297 401
AC_ARG_ENABLE([socat-escape],
298 402
  [AS_HELP_STRING([--enable-socat-escape],

Also available in: Unified diff