File: configure.ac

package info (click to toggle)
haskelldb 0.9.cvs.601-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 680 kB
  • ctags: 33
  • sloc: haskell: 4,392; sh: 1,900; makefile: 130
file content (666 lines) | stat: -rw-r--r-- 19,356 bytes parent folder | download | duplicates (2)
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
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
dnl Run autoconf to generate configure from this file
dnl Based on configure.ac from HSQL

AC_INIT([HaskellDB],[0.9],[haskelldb-users@lists.sourceforge.net],[haskelldb])

AC_PREREQ(2.53)

AC_REVISION($Revision: 1.42 $)

AC_CONFIG_FILES([config.mk haskelldb.pkg])

AC_CANONICAL_SYSTEM

dnl ***********************************************
dnl Some defaults
dnl ***********************************************

ghc_req_major_verison=6
ghc_req_minor_verison=2

GHCFLAGS="$GHCFLAGS -O2 -fglasgow-exts -fallow-overlapping-instances"

HUGSFLAGS="$HUGSFLAGS -98 +o"


dnl ***********************************************
dnl Enable/Disable verbose warnings
dnl ***********************************************

AC_ARG_ENABLE(verbose-warnings,
AC_HELP_STRING([--enable-verbose-warnings],
	       [Turn on lots of warnings in ghc. Mainly for 
		maintainer use. (default = no)]),
[if test "$enableval" = "yes"; then
	GHCFLAGS="$GHCFLAGS -W -fwarn-missing-signatures"
fi],
)

dnl ***********************************************
dnl Enable/Disable building Hugs libraries
dnl ***********************************************

AC_ARG_ENABLE(hugs,
AC_HELP_STRING([--enable-hugs],
	       [Enable builing Hugs libraries. 
	        (default = yes)]),
[ENABLE_HUGS="$enableval"],
[ENABLE_HUGS=yes]
)
AC_SUBST(ENABLE_HUGS)

dnl ***********************************************
dnl Enable/Disable building GHC libraries
dnl ***********************************************

AC_ARG_ENABLE(ghc,
AC_HELP_STRING([--enable-ghc],
	       [Enable builing GHC libraries. 
	        (default = yes)]),
[ENABLE_GHC="$enableval"],
[ENABLE_GHC=yes]
)
AC_SUBST(ENABLE_GHC)

dnl ***********************************************
dnl Enable/Disable HSQL
dnl ***********************************************

AC_ARG_ENABLE(hsql,
AC_HELP_STRING([--enable-hsql],
	       [Enable use of HSQL. (default = yes)]),
[WITH_HSQL="$enableval"],
[WITH_HSQL=yes]
)

dnl ***********************************************
dnl Enable/Disable HSQL for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-hsql,
AC_HELP_STRING([--enable-ghc-hsql],
	       [Enable use of HSQL with ghc. (default = yes)]),
[WITH_GHC_HSQL="$enableval"],
[WITH_GHC_HSQL="$WITH_HSQL"]
)
AC_SUBST(WITH_GHC_HSQL)

dnl ***********************************************
dnl Enable/Disable HSQL for hugs
dnl ***********************************************

AC_ARG_ENABLE(hugs-hsql,
AC_HELP_STRING([--enable-hugs-hsql],
	       [Enable use of HSQL for Hugs. (default = yes)]),
[WITH_HUGS_HSQL="$enableval"],
[WITH_HUGS_HSQL="$WITH_HSQL"]
)
AC_SUBST(WITH_HUGS_HSQL)

dnl ***********************************************
dnl Enable/Disable HSQL ODBC binding for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-hsql-odbc,
AC_HELP_STRING([--enable-ghc-hsql-odbc],
	       [Enable use of the HSQL ODBC driver
	       for ghc. (default = yes)]),
[WITH_GHC_HSQL_ODBC="$enableval"],
[WITH_GHC_HSQL_ODBC=yes]
)
AC_SUBST(WITH_GHC_HSQL_ODBC)

dnl ***********************************************
dnl Enable/Disable HSQL ODBC binding for Hugs
dnl ***********************************************

AC_ARG_ENABLE(hugs-hsql-odbc,
AC_HELP_STRING([--enable-hugs-hsql-odbc],
	       [Enable use of the HSQL ODBC driver
	        for Hugs. (default = yes)]),
[WITH_HUGS_HSQL_ODBC="$enableval"],
[WITH_HUGS_HSQL_ODBC=yes]
)
AC_SUBST(WITH_HUGS_HSQL_ODBC)

dnl ***********************************************
dnl Enable/Disable HSQL MySQL binding for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-hsql-mysql,
AC_HELP_STRING([--enable-ghc-hsql-mysql],
	       [Enable use of the HSQL MySQL driver  
	        for ghc. (default = yes)]),
[WITH_GHC_HSQL_MYSQL="$enableval"],
[WITH_GHC_HSQL_MYSQL=yes]
)
AC_SUBST(WITH_GHC_HSQL_MYSQL)

dnl ***********************************************
dnl Enable/Disable HSQL MySQL binding for Hugs
dnl ***********************************************

AC_ARG_ENABLE(hugs-hsql-mysql,
AC_HELP_STRING([--enable-hugs-hsql-mysql],
	       [Enable use of the HSQL MySQL driver  
	        for Hugs. (default = yes)]),
[WITH_HUGS_HSQL_MYSQL="$enableval"],
[WITH_HUGS_HSQL_MYSQL=yes]
)
AC_SUBST(WITH_HUGS_HSQL_MYSQL)

dnl ***********************************************
dnl Enable/Disable HSQL SQLite binding for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-hsql-sqlite,
AC_HELP_STRING([--enable-ghc-hsql-sqlite],
	       [Enable use of the HSQL SQLite driver  
	        for ghc. (default = yes)]),
[WITH_GHC_HSQL_SQLITE="$enableval"],
[WITH_GHC_HSQL_SQLITE=yes]
)
AC_SUBST(WITH_GHC_HSQL_SQLITE)

dnl ***********************************************
dnl Enable/Disable HSQL SQLite binding for Hugs
dnl ***********************************************

AC_ARG_ENABLE(hugs-hsql-sqlite,
AC_HELP_STRING([--enable-hugs-hsql-sqlite],
	       [Enable use of the HSQL SQLite driver
	        for Hugs. (default = yes)]),
[WITH_HUGS_HSQL_SQLITE="$enableval"],
[WITH_HUGS_HSQL_SQLITE=yes]
)
AC_SUBST(WITH_HUGS_HSQL_SQLITE)

dnl ***********************************************
dnl Enable/Disable HSQL PostgreSQL binding for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-hsql-postgresql,
AC_HELP_STRING([--enable-ghc-hsql-postgresql],
	       [Enable use of the HSQL PostgreSQL driver  
	        for ghc. (default = yes)]),
[WITH_GHC_HSQL_POSTGRESQL="$enableval"],
[WITH_GHC_HSQL_POSTGRESQL=yes]
)
AC_SUBST(WITH_GHC_HSQL_POSTGRESQL)

dnl ***********************************************
dnl Enable/Disable HSQL PostgreSQL binding for Hugs
dnl ***********************************************

AC_ARG_ENABLE(hugs-hsql-postgresql,
AC_HELP_STRING([--enable-hugs-hsql-postgresql],
	       [Enable use of the HSQL PostgreSQL driver
	        for Hugs. (default = yes)]),
[WITH_HUGS_HSQL_POSTGRESQL="$enableval"],
[WITH_HUGS_HSQL_POSTGRESQL=yes]
)
AC_SUBST(WITH_HUGS_HSQL_POSTGRESQL)

dnl ***********************************************
dnl Enable/Disable WxHaskell binding for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-wx,
AC_HELP_STRING([--enable-ghc-wx],
	       [Enable use of the WxHaskell driver
	       for ghc. (default = yes)]),
[WITH_GHC_WX="$enableval"],
[WITH_GHC_WX=yes]
)
AC_SUBST(WITH_GHC_WX)

dnl ***********************************************
dnl Enable/Disable WxHaskell binding for Hugs
dnl ***********************************************

WITH_HUGS_WX=no
AC_SUBST(WITH_HUGS_WX)

dnl ***********************************************
dnl Enable/Disable using hs-plugins for ghc
dnl ***********************************************

AC_ARG_ENABLE(ghc-plugins,
AC_HELP_STRING([--enable-ghc-plugins],
               [Enable use of hs-plugins
               for ghc. (default = yes)]),
[WITH_GHC_PLUGINS="$enableval"],
[WITH_GHC_PLUGINS=yes]
)
AC_SUBST(WITH_GHC_PLUGINS)


dnl ***********************************************
dnl C compiler
dnl ***********************************************

AC_PROG_CC
AC_SUBST(CC)

dnl ***********************************************
dnl GHC
dnl ***********************************************

if test "$ENABLE_GHC" = "yes"; then
  AC_ARG_WITH(ghc,
  AC_HELP_STRING([--with-ghc=<ghc command>],
               [Use a different command instead of 
                'ghc' for the Haskell compiler.]),
  [AC_CHECK_FILE("$withval",GHC="$withval",[AC_PATH_PROG(GHC,"$withval")])],
  [AC_PATH_PROG(GHC,ghc)])

  if test "$GHC" = "" || test ! -x "$GHC"; then
    AC_MSG_WARN([GHC not found. Not building GHC libraries.])
    GHC=""
    ENABLE_GHC=no
  else
    GHCI=$(dirname $GHC)/ghci
    
    AC_HS_CHECK_GHC_VERSION_IFELSE([$ghc_req_major_verison],
    [$ghc_req_minor_verison],,[
      AC_MSG_ERROR([ghc >= $ghc_req_major_verison.$ghc_req_minor_verison
	            is required to build HaskellDB.]) ])
  fi
fi

AC_SUBST(GHC)
AC_SUBST(GHCI)
AC_SUBST(GHC_VERSION)

dnl ***********************************************
dnl GHC flags
dnl ***********************************************

AC_ARG_WITH(ghc-flags,
AC_HELP_STRING([--with-ghc-flags=FLAGS],
               [Add the given flags when running ghc.]),
[GHCFLAGS="$GHCFLAGS $withval"],)

AC_SUBST(GHCFLAGS)


dnl ***********************************************
dnl GHC directory 
dnl ***********************************************

if test "$ENABLE_GHC" = "yes"; then
  AC_ARG_WITH(ghc-dir,
  AC_HELP_STRING([--with-ghc-dir=DIR],
               [Install GHC libraries in the given GHC directory 
                (default is "ghc --print-libdir")]),
  [GHC_DIR="$withval"],
  [GHC_DIR=`$GHC --print-libdir`])

	if test "$GHC_DIR" = "" || test ! -d $GHC_DIR; then
	   AC_MSG_ERROR([GHC_DIR $GHC_DIR does not exist])
	fi
fi

AC_SUBST(GHC_DIR)

dnl ***********************************************
dnl ghc-pkg
dnl ***********************************************

if test "$ENABLE_GHC" = "yes"; then
  AC_ARG_WITH(ghc-pkg,
  AC_HELP_STRING([--with-ghc-pkg=<ghc-pkg command>],
               [Use a different command instead of 'ghc-pkg']),
  [GHC_PKG="$withval"
   if test ! -x "$GHC_PKG"; then AC_PATH_PROG(GHC_PKG,"$withval") fi],
  [AC_CHECK_FILE("$(dirname $GHC)/ghc-pkg",
	       GHC_PKG="$(dirname $GHC)/ghc-pkg",
	       [AC_PATH_PROG(GHC_PKG,ghc-pkg)])])

	if test "$GHC_PKG" = "" || test ! -x "$GHC_PKG"; then
	   AC_MSG_ERROR([ghc-pkg is required for GHC support])
	fi
fi

AC_SUBST(GHC_PKG)

dnl ***********************************************
dnl HUGS
dnl ***********************************************

if test "$ENABLE_HUGS" = "yes"; then
  AC_ARG_WITH(hugs,
 AC_HELP_STRING([--with-hugs=<hugs command>],
               [Use a different command instead of 'hugs' 
	        for the Hugs interpreter.]),
  [AC_CHECK_FILE("$withval",HUGS="$withval",[AC_PATH_PROG(HUGS,"$withval")])],
  [AC_PATH_PROG(HUGS,hugs)])

  if test "$HUGS" = "" || test ! -x "$HUGS"; then
    AC_MSG_WARN([The build for HUGS will be skipped.])
    HUGS=""
    ENABLE_HUGS="no"
  else
    RUNHUGS=$(dirname $HUGS)/runhugs
  fi

fi

case $ac_cv_target_alias in
    i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
        SO_EXT=dll;;
    *)  SO_EXT=so;;
esac

AC_SUBST(HUGS)
AC_SUBST(RUNHUGS)
AC_SUBST(SO_EXT)

dnl ***********************************************
dnl HUGS flags
dnl ***********************************************

AC_ARG_WITH(hugs-flags,
AC_HELP_STRING([--with-hugs-flags=FLAGS],
               [Add the given flags when running Hugs.]),
[HUGSFLAGS="$HUGSFLAGS $withval"],)

AC_SUBST(HUGSFLAGS)

dnl ***********************************************
dnl HUGS directory
dnl ***********************************************

if test "$ENABLE_HUGS" = "yes"; then
  AC_ARG_WITH(hugs-dir,
  AC_HELP_STRING([--with-hugs-dir=DIR],
               [Install Hugs libraries in the given Hugs directory 
                (default is the Hugs libraries directory)]),
  [HUGS_DIR="$withval"],
  [case $ac_cv_target_alias in
      i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
          HUGS_DIR=$(dirname $HUGS);;
      *)  HUGS_DIR=$(dirname $HUGS)/../lib/hugs;;
   esac])

	if test "$HUGS_DIR" = "" || test ! -d "$HUGS_DIR"; then
	   AC_MSG_WARN([HUGS_DIR $HUGS_DIR does not exist,
                        skipping hugs build.])
           ENABLE_HUGS="no"
	fi
fi

AC_SUBST(HUGS_DIR)


dnl ***********************************************
dnl Check for HSQL for ghc
dnl ***********************************************

if test "$ENABLE_GHC" = "yes" && test "$WITH_GHC_HSQL" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([hsql],[Database.HSQL],[query],,
    [AC_MSG_WARN([HSQL for ghc not found, not 
                 building ghc HSQL support])
    WITH_GHC_HSQL="no"])
else
  WITH_GHC_HSQL="no"
fi

dnl ***********************************************
dnl Check for HSQL for Hugs
dnl ***********************************************

if test "$ENABLE_HUGS" = "yes" && test "$WITH_HUGS_HSQL" = "yes"; then

  if test "$prefix" != "NONE"; then
    HUGSFLAGS="$HUGSFLAGS -P:$prefix/lib/HSQL/Hugs/libraries"
  else
    HUGSFLAGS="$HUGSFLAGS -P:$ac_default_prefix/lib/HSQL/Hugs/libraries"
  fi

    AC_HS_HUGS_MODULE_IFELSE([Database.HSQL], [query],,
	 [AC_MSG_WARN([HSQL for Hugs not found.])
	 WITH_HUGS_HSQL="no"])
else
  WITH_HUGS_HSQL="no"
fi

dnl ***********************************************
dnl Check for wxHaskell for GHC
dnl ***********************************************

if test "$ENABLE_GHC" = "yes" && test "$WITH_GHC_WX" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([wxcore],[Graphics.UI.WXCore.Db],[dbQuery],,
                          [WITH_GHC_WX="no"])
else
  WITH_GHC_WX="no"
fi

dnl ***********************************************
dnl Check for hs-plugins for GHC
dnl ***********************************************

if test "$ENABLE_GHC" = "yes" && test "$WITH_GHC_PLUGINS" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([plugins],[Plugins],[load],,
                          [WITH_GHC_PLUGINS="no"])
else
  WITH_GHC_PLUGINS="no"
fi

dnl ***********************************************
dnl HADDOCK
dnl ***********************************************
AC_ARG_WITH(haddock,
AC_HELP_STRING([--with-haddock=<haddock command>],
               [Use a different command instead of 'haddock' 
                for the documentation builder.]),
[AC_CHECK_FILE("$withval",HADDOCK="$withval",
[AC_PATH_PROG(HADDOCK,"$withval")])],
[AC_PATH_PROG(HADDOCK,haddock)]
)

if test "$HADDOCK" = "" || test "$HADDOCK" = "no" || test ! -x "$HADDOCK"; then
  BUILD_DOC="no"
  AC_MSG_RESULT([HADDOCK is required to build the documentations])
else
  BUILD_DOC="yes"
fi

AC_SUBST(BUILD_DOC)
AC_SUBST(HADDOCK)

dnl ***********************************************
dnl other progs
dnl ***********************************************

AC_PROG_INSTALL

AC_PATH_PROG(AR,ar)
AC_SUBST(AR)

AC_PATH_PROG(LD,ld)
AC_SUBST(LD)

case $ac_cv_target_alias in
    i[[3456]]86-*-cygwin*|i[[3456]]86-*-mingw32*)
        WIN32=YES
        ;;
    *)  WIN32=NO
        ;;
esac

AC_SUBST(WIN32)

dnl ***********************************************
dnl check for ODBC module for ghc
dnl ***********************************************

if test "$WITH_GHC_HSQL" = "yes" && test "$WITH_GHC_HSQL_ODBC" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([hsql],[Database.HSQL.ODBC],[connect],,
    [AC_MSG_WARN([ODBC module for ghc not found, skipping ODBC])
    WITH_GHC_HSQL_ODBC=no])
else
    WITH_GHC_HSQL_ODBC="no"
fi

dnl ***********************************************
dnl check for ODBC module for hugs
dnl ***********************************************

if test "$WITH_HUGS_HSQL" = "yes" && test "$WITH_HUGS_HSQL_ODBC" = "yes"; then
  AC_HS_HUGS_MODULE_IFELSE([Database.HSQL.ODBC],[connect],,
    [AC_MSG_WARN([ODBC module for hugs not found, skipping ODBC])
    WITH_HUGS_HSQL_ODBC=no])
else
    WITH_HUGS_HSQL_ODBC="no"
fi

dnl ***********************************************
dnl check for PostgreSQL module for ghc
dnl ***********************************************

if test "$WITH_GHC_HSQL" = "yes" && test "$WITH_GHC_HSQL_POSTGRESQL" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([hsql],[Database.HSQL.PostgreSQL],[connect],,
    [AC_MSG_WARN([PostgreSQL module for ghc not found, 
	          not building PostgreSQL support])
    WITH_GHC_HSQL_POSTGRESQL=no])
else
    WITH_GHC_HSQL_POSTGRESQL="no"
fi

dnl ***********************************************
dnl check for PostgreSQL module for hugs
dnl ***********************************************

if test "$WITH_HUGS_HSQL" = "yes" && test "$WITH_HUGS_HSQL_POSTGRESQL" = "yes"; then
  AC_HS_HUGS_MODULE_IFELSE([Database.HSQL.PostgreSQL],[connect],,
    [AC_MSG_WARN([PostgreSQL module for hugs not found, 
	          not building PostgreSQL support])
    WITH_HUGS_HSQL_POSTGRESQL=no])
else
    WITH_HUGS_HSQL_POSTGRESQL="no"
fi

dnl ***********************************************
dnl check for MySQL module for ghc
dnl ***********************************************

if test "$WITH_GHC_HSQL" = "yes" && test "$WITH_GHC_HSQL_MYSQL" = "yes"; then
  AC_HS_GHC_MODULE_IFELSE([hsql],[Database.HSQL.MySQL],[connect],,
    [AC_MSG_WARN([MySQL module for ghc not found, 
	          not building MySQL support])
    WITH_GHC_HSQL_MYSQL=no])
else
    WITH_GHC_HSQL_MYSQL="no"
fi

dnl ***********************************************
dnl check for MySQL module for hugs
dnl ***********************************************

if test "$WITH_HUGS_HSQL" = "yes" && test "$WITH_HUGS_HSQL_MYSQL" = "yes"; then
  AC_HS_HUGS_MODULE_IFELSE([Database.HSQL.MySQL],[connect],,
    [AC_MSG_WARN([MySQL module for hugs not found, 
	          not building MySQL support])
    WITH_HUGS_HSQL_MYSQL=no])
else
    WITH_HUGS_HSQL_MYSQL="no"
fi

dnl ***********************************************
dnl check for SQLite module for ghc
dnl ***********************************************

if test "$WITH_GHC_HSQL" = "yes" && test $WITH_GHC_HSQL_SQLITE = yes; then
  AC_HS_GHC_MODULE_IFELSE([hsql],[Database.HSQL.SQLite],[connect],,
    [AC_MSG_WARN([SQLite module for ghc not found, 
	          not building SQLite support])
    WITH_GHC_HSQL_SQLITE=no])
else
    WITH_GHC_HSQL_SQLITE="no"
fi

dnl ***********************************************
dnl check for SQLite module for hugs
dnl ***********************************************

if test "$WITH_HUGS_HSQL" = "yes" && test $WITH_HUGS_HSQL_SQLITE = yes; then
  AC_HS_HUGS_MODULE_IFELSE([Database.HSQL.SQLite],[connect],,
    [AC_MSG_WARN([SQLite module for hugs not found, 
	          not building SQLite support])
    WITH_HUGS_HSQL_SQLITE=no])
else
    WITH_HUGS_HSQL_SQLITE="no"
fi

dnl ***********************************************
dnl subst
dnl ***********************************************

LDFLAGS="${LIBS} ${LDFLAGS}"
LIB_DIRS='"'${GHC_DIR}'"'

for lib_opt in ${LDFLAGS}
do
   case $lib_opt in
      -l*)
	   if test "$DEP_LIBS" = ""; then
		DEP_LIBS='"'`echo ${lib_opt} | sed s,-l,,`'"'
	   else
		DEP_LIBS=$DEP_LIBS,'"'`echo ${lib_opt} | sed s,-l,,`'"'
	   fi;;
      -L*)
	   LIB_DIRS=$LIB_DIRS,'"'`echo ${lib_opt} | sed s,-L,, | sed s,"'",, | sed s,"'",,`'"'
   esac
done

AC_SUBST(LDFLAGS)
AC_SUBST(DEP_LIBS)
AC_SUBST(LIB_DIRS)

dnl ***********************************************
dnl Package dependencies
dnl ***********************************************

if test "$WITH_GHC_HSQL" = "yes"; then
	PACKAGE_DEPS="$PACKAGE_DEPS,\"hsql\""
fi

if test "$WITH_GHC_WX" = "yes"; then
	PACKAGE_DEPS="$PACKAGE_DEPS,\"wxcore\""
fi

if test "$WITH_GHC_PLUGINS" = "yes"; then
	PACKAGE_DEPS="$PACKAGE_DEPS,\"plugins\""
fi

AC_SUBST(PACKAGE_DEPS)

dnl ***********************************************
dnl Create directories and output files
dnl ***********************************************

AC_OUTPUT

AC_MSG_NOTICE([Creating output directories])
mkdir -p build

echo
echo "HaskellDB will support:"
echo "-----------------------"
echo
echo "GHC:               $ENABLE_GHC"
echo "  HSQL:            $WITH_GHC_HSQL"
echo "    ODBC:          $WITH_GHC_HSQL_ODBC"
echo "    MySql:         $WITH_GHC_HSQL_MYSQL"
echo "    SQLite:        $WITH_GHC_HSQL_SQLITE"
echo "    PostgreSQL:    $WITH_GHC_HSQL_POSTGRESQL"
echo "  WxHaskell:       $WITH_GHC_WX"
echo "  hs-plugins:      $WITH_GHC_PLUGINS"
echo "Hugs:              $ENABLE_HUGS"
echo "  HSQL:            $WITH_HUGS_HSQL"
echo "    ODBC:          $WITH_HUGS_HSQL_ODBC"
echo "    MySql:         $WITH_HUGS_HSQL_MYSQL"
echo "    SQLite:        $WITH_HUGS_HSQL_SQLITE"
echo "    PostgreSQL:    $WITH_HUGS_HSQL_POSTGRESQL"
echo "  WxHaskell:       $WITH_HUGS_WX"