File: configure

package info (click to toggle)
ocamlnet 2.2.9-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,724 kB
  • ctags: 10,053
  • sloc: ml: 63,928; ansic: 1,973; makefile: 800; sh: 651
file content (826 lines) | stat: -rwxr-xr-x 18,871 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
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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
#! /bin/sh

# $Id: configure 1149 2007-11-01 22:09:25Z gerd $

#######################################################################
# Helpers:

# Split $PATH into words:
oldifs="$IFS"
IFS="   :"
spacepath=`echo $PATH`
IFS="$oldifs"


in_path () {
    # Does $1 exist in $PATH?
    for d in $spacepath; do
        if test -x "$d/$1"; then
            return 0
        fi
    done
    return 1
}


get_path () {
    for d in $spacepath; do
        if test -x "$d/$1"; then
            echo "$d/$1"
            return
        fi
    done
}

#######################################################################
# Defaults

#--- Options ---
# value 0: off
# value 1: on
# defaults:

set_defaults () {
    enable_gtk=0
    enable_gtk2=0
    enable_tcl=0
    enable_ssl=0
    enable_apache=0
    with_nethttpd=0
    with_rpc_auth_dh=0
    prefer_netcgi2=0
    bindir=`dirname $ocamlc`
    tcl_defs=""
    tcl_libs=""
    adh_style=""
    disable_core=0
    apxs=""
    apache=""
}

ocamlc=`get_path ocamlc`
set_defaults

version="2.2.9"
exec_suffix=""

#######################################################################
# Option parsing

ehelp_gtk="Enable/disable parts that depend on lablgtk"
ehelp_gtk2="Enable/disable parts that depend on lablgtk2"
ehelp_tcl="Enable/disable parts that depend on tcl/tk"
ehelp_ssl="Enable/disable parts that depend on SSL"
ehelp_apache="Enable/disable Apache mod connector (EXPERIMENTAL)"
whelp_nethttpd="Enable/disable nethttpd web server component (GPL!)"
whelp_rpc_auth_dh="Enable/disable support for SecureRPC (Diffie-Hellman auth)"

# Which options exist? eoptions for enable/disable, woptions for with/without:
eoptions="gtk gtk2 tcl ssl apache"
woptions="nethttpd rpc_auth_dh"

# Packages to include anyway:
requires="unix pcre"

# Directory where to install data files:
net_db_dir="<library directory>"
net_db_dir_set=0

check_library () {
    # $1: the name of the library (findlib)
#   # $2: a typical file in $incdirs
#    if [ "$enable_findlib" -gt 0 ]; then
	ocamlfind query "$1" >/dev/null 2>/dev/null
	return
#    else
#	stdlib=`ocamlc -where`
#	for dir in $incdirs; do
#	    case "$dir" in
#		+*)
#		    dir=`echo "$dir" | sed -e "s|^\+|$stdlib/|"` ;;
#	    esac
#	    if [ -f "$dir/$2" ]; then
#		return 0
#	    fi 
#	done
	return 1   # not found
#    fi
}


print_options () {
	for opt in $eoptions; do
		e="o=\$enable_$opt"
		eval "$e"
		uopt=`echo $opt | sed -e 's/_/-/g'`
		if [ $o -gt 0 ]; then
			echo "    -enable-$uopt"
		else
			echo "    -disable-$uopt"
		fi
	done
	for opt in $woptions; do
		e="o=\$with_$opt"
		eval "$e"
		uopt=`echo $opt | sed -e 's/_/-/g'`
		if [ $o -gt 0 ]; then
			echo "    -with-$uopt"
		else
			echo "    -without-$uopt"
		fi
	done
	echo "    -bindir $bindir"
	echo "    -datadir $net_db_dir"
	if [ $enable_tcl -gt 0 ]; then
            echo "    -equeue-tcl-defs \"$tcl_defs\""
            echo "    -equeue-tcl-libs \"$tcl_libs\""
	fi
	if [ $with_rpc_auth_dh -gt 0 ]; then
	    if [ -n "$adh_style" ]; then
		echo "    -auth-dh-style $adh_style"
	    fi
	fi
	if [ -n "$apxs" ]; then
	    echo "    -apxs $apxs"
	fi
	if [ -n "$apache" ]; then
	    echo "    -apache $apache"
	fi
	if [ $prefer_netcgi2 -gt 0 ]; then
	    echo "    -prefer-netcgi2"
	fi
}


usage () {
	set_defaults
	cat <<_EOF_ >&2
usage: ./configure [ options ]

_EOF_
	for opt in $eoptions; do
		e="help=\$ehelp_$opt"
		eval "$e"
		uopt=`echo $opt | sed -e 's/_/-/g'`
		echo "-enable-$uopt:" >&2
		echo "-disable-$uopt:" >&2
		echo "        $help" >&2
	done
	for opt in $woptions; do
		e="help=\$whelp_$opt"
		eval "$e"
		uopt=`echo $opt | sed -e 's/_/-/g'`
		echo "-with-$uopt:" >&2
		echo "-without-$uopt:" >&2
		echo "        $help" >&2
	done
	cat <<_EOF_ >&2
-bindir dir
        Install binaries into this directory

-datadir dir
        Install the run-time data file into this directory

-equeue-tcl-defs <opts>
        Set C compiler options to find tcl.h (for -enable-tcl)

-equeue-tcl-libs <opts>
        Set C compiler options to link against libtcl (for -enable-tcl)

-auth-dh-style (keyenvoy|unixdomain|tirpc)
        Set style of keyserv connector (see README.authdh)

-apxs /path/to/apxs
        Set which apxs to use for -enable-apache

-apache /path/to/apache
        Set which apache executable to use for -enable-apache

-prefer-netcgi2
        Use netcgi2 as default CGI implementation instead of netcgi1.
        This affects nethttpd.

Defaults are:

_EOF_
	print_options >&2
	exit 1
}


check_eopt () {
	for x in $eoptions; do
		if [ "$x" = "$1" ]; then
			return 0
		fi
	done
	echo "Unknown option: $1" >&2
	exit 1
}


check_wopt () {
	for x in $woptions; do
		if [ "$x" = "$1" ]; then
			return 0
		fi
	done
	echo "Unknown option: $1" >&2
	exit 1
}


echo "Welcome to Ocamlnet version $version" >&2

while [ "$#" -gt 0 ]; do
	case "$1" in
		-enable-*)
			opt=`echo "$1" | sed -e 's/-enable-//' -e 's/-/_/g'`
			check_eopt "$opt"
			eval "enable_$opt=2"
			shift
			;;
	        -disable-core)
		        # Intentionally undocumented.
		        disable_core=1
			shift
			;;
		-disable-*)
			opt=`echo "$1" | sed -e 's/-disable-//' -e 's/-/_/g'`
			check_eopt "$opt"
			eval "enable_$opt=-1"
			shift
			;;
		-with-*)
			opt=`echo "$1" | sed -e 's/-with-//' -e 's/-/_/g'`
			check_wopt "$opt"
			eval "with_$opt=2"
			shift
			;;
		-without-*)
			opt=`echo "$1" | sed -e 's/-without-//' -e 's/-/_/g'`
			check_wopt "$opt"
			eval "with_$opt=-1"
			shift
			;;
                -bindir)
                        bindir="$2"
                        shift
                        shift
                        ;;
	        -datadir)
		        net_db_dir="$2"
			net_db_dir_set=1
			shift; shift
			;;
                -equeue-tcl-defs)
                        tcl_defs="$tcl_defs $2"
                        shift
                        shift
                        ;;
                -equeue-tcl-libs)
                        tcl_libs="$tcl_libs $2"
                        shift
                        shift
                        ;;
                -auth-dh-style)
                        adh_style="$2"
                        shift
                        shift
                        ;;
                -apxs)
                        apxs="$2"
                        shift
                        shift
                        ;;
                -apache)
                        apache="$2"
                        shift
                        shift
                        ;;
	        -prefer-netcgi2)
		        prefer_netcgi2=1
			shift ;;
		-version)
			echo "$version"
			exit 0
			;;
		*)
			usage
	esac
done

######################################################################
# Check ocamlfind

printf "%s" "Checking for findlib... "
if ocamlfind query stdlib >/dev/null 2>/dev/null; then
    echo "found"
    if [ "$net_db_dir_set" -eq 0 ]; then
	net_db_dir=`ocamlfind printconf destdir`/netstring
	net_db_dir_set=1
    fi
else
    echo "not found"
    echo "Make sure that ocamlfind is in your PATH, or download findlib"
    echo "from www.ocaml-programming.de"
    exit 1
fi

if [ "$net_db_dir_set" -eq 0 ]; then
    net_db_dir="$libdir"
    net_db_dir_set=1
fi


######################################################################
# Does ocamlopt support multi-threading?

printf "%s" "Checking multi-threading support... "
mt_type=vm
mt_switch="-vmthread"
mt_comment="(unsupported)"
mkdir -p tmp
cat <<_EOF_ >tmp/t.ml
let _ = Mutex.create();;
_EOF_
if ocamlopt -thread -o tmp/t threads.cmxa tmp/t.ml 2>/dev/null; then
    if tmp/t 2>/dev/null; then
	mt_type=posix
	mt_switch="-thread"
	mt_comment="(ok)"
    fi
fi
echo "$mt_type $mt_comment"

######################################################################
# Check that pcre is available:

printf "%s" "Checking for PCRE... "
if check_library pcre pcre.cmi; then
    echo "found"
else
    echo "not found"
    echo "Sorry, installation is not possible without PCRE."
    echo "Get the PCRE-OCaml library from:"
    echo "http://www.ocaml.info/home/ocaml_sources.html"
    exit 1
fi

######################################################################
# Check OS

with_rpc_auth_local=0
with_rpc_xti=0

printf "%s" "Checking operating system... "
u=`uname`
case "$u" in
	CYGWIN*)
		echo "Cygwin"
		exec_suffix=".exe" ;;
        Linux)
	        echo "Linux"
		with_rpc_auth_local=1
		[ -n "$adh_style" ] || adh_style=unixdomain
		;;
        *FreeBSD)
	        echo "FreeBSD"
		[ -n "$adh_style" ] || adh_style=unixdomain
		;;
        NetBSD)
	        echo "NetBSD"
		[ -n "$adh_style" ] || adh_style=unixdomain
		;;
        SunOS)
	        case `uname -r` in
		    [1234]*)
		        echo "SunOS" ;;
		    *)
			echo "Solaris"
			with_rpc_xti=1
			[ -n "$adh_style" ] || adh_style=tirpc
			;;
		esac ;;
	*)
		echo "Generic" ;;
esac

if [ $with_rpc_auth_local -gt 0 ]; then
    echo "    This OS supports passing credentials over Unix domain sockets"
    echo "    Building rpc-auth-local"
fi

if [ $with_rpc_xti -gt 0 ]; then
    echo "    This OS supports XTI networking"
    echo "    Building rpc-xti"
fi

######################################################################
# Netsys

( cd src/netsys; ./configure )

######################################################################
# TCL

with_equeue_tcl=0

if [ $enable_tcl -gt 0 ]; then
    printf "%s" "Checking switches for tcl.h... "

    tcl_defs_1=""
    for d in $tcl_defs; do
        tcl_defs_1="$tcl_defs_1 -ccopt '$d'"
    done

    rm -rf tmp
    mkdir -p tmp

    cat <<EOF >tmp/t.c
#include "tcl.h"

main () {
}
EOF

    if ( cd tmp; ocamlc $tcl_defs_1 -c t.c >/dev/null 2>/dev/null ) then
        echo "ok"
    else
        echo "not ok"
        echo
        echo "Please check -equeue-tcl-defs!"
        exit 1
    fi

    printf "%s" "Checking switches to link libtcl... "

    cat <<EOF >tmp/t.c
#include <stdlib.h>
#include <stdio.h>
#include "tcl.h"

do_something () {
    void (*x)(int);
    x = Tcl_Exit;
    exit(0);
}
EOF

    cat <<EOF >tmp/t.ml
exit 0
EOF

    if ( cd tmp
         ocamlc $tcl_defs_1 -c t.c >/dev/null 2>/dev/null &&
         ocamlc -c t.ml >/dev/null 2>/dev/null &&
         ocamlc -o t -custom t.o t.cmo -cclib "$tcl_libs"
       )
    then
        if tmp/t; then
            echo "ok"
        else
            echo "not ok (check ldd output of tmp/t)"
            echo
            echo "Please check -equeue-tcl-libs!"
            exit 1
        fi
    else
        echo "not ok"
        echo
        echo "Please check -equeue-tcl-libs!"
        exit 1
    fi

    with_equeue_tcl=1
fi

######################################################################
# Check lablgtk

with_equeue_gtk1=0

if [ $enable_gtk -gt 0 ]; then
    printf "%s" "Checking for lablgtk... "
    if ocamlfind query lablgtk >/dev/null 2>/dev/null; then
        echo "found"
	with_equeue_gtk1=1
    else
        echo "not found"
	echo "Required library lablgtk not found!"
	exit 1
    fi
fi

######################################################################
# Check lablgtk2

with_equeue_gtk2=0
gtk2_io_add_watch_supports_lists=""

if [ $enable_gtk2 -gt 0 ]; then
    printf "%s" "Checking for lablgtk2... "
    if ocamlfind query lablgtk2 >/dev/null 2>/dev/null; then
        echo "found"
    else
        echo "not found"
	echo "Required library lablgtk2 not found!"
	exit 1
    fi

    printf "%s" "Checking whether lablgtk2 has GMain.Io.remove... "
    mkdir -p tmp
    cat <<EOF >tmp/gtk.ml
let _ = GMain.Io.remove;;
EOF

    if ocamlfind ocamlc -package lablgtk2 -c tmp/gtk.ml >/dev/null 2>/dev/null;
    then
        echo "yes"
    else
        echo "no"
        echo "Your version of lablgtk2 is too old!"
	exit 1
    fi
    
    printf "%s" "Checking whether lablgtk2 has GMain.Io.add_watch with list support... "
    mkdir -p tmp
    cat <<'EOF' >tmp/gtk.ml
open GMain.Io
let _ = (add_watch : cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id);;
exit 0
EOF
    # Note: this newer API is never broken in the sense checked below, i.e.
    # such lablgtk2 versions do not exist.
    if ocamlfind ocamlc -package unix,lablgtk2 -linkpkg -o tmp/gtk tmp/gtk.ml >/dev/null 2>/dev/null && tmp/gtk; then
        echo "yes"
        gtk2_io_add_watch_supports_lists="-ppopt -DGTK2_IO_ADD_WATCH_SUPPORTS_LISTS"
    else
        echo "no"
        printf "%s" "Checking whether lablgtk2's GMain.Io.add_watch is broken... "
        mkdir -p tmp
        cat <<'EOF' >tmp/gtk.ml
GMain.Main.init();;
let ch = GMain.Io.channel_of_descr (Unix.stdout) in
let w = GMain.Io.add_watch
          ~cond:`OUT ~callback:(fun () -> true) ch in
(* add_watch is broken when it just returns Val_unit, and ok when it
 * returns a positive int
 *)
if (Obj.magic w : int) > 0 then
  exit 0
else
  exit 1
EOF
	if ocamlfind ocamlc -package unix,lablgtk2 -linkpkg -o tmp/gtk tmp/gtk.ml >/dev/null 2>/dev/null && tmp/gtk; then
            echo "no"
        else
            echo "yes"
            echo "You should apply the patch-ab-ml_glib.c to lablgtk2 to fix this!"
	    exit 1
        fi
    fi

    for f in Makefile uq_gtk.ml uq_gtk.mli; do
	rm -f src/equeue-gtk2/$f
	ln -s ../equeue-gtk1/$f src/equeue-gtk2
    done
    
    with_equeue_gtk2=1
fi

######################################################################
# Check SSL

with_equeue_ssl=0
with_rpc_ssl=0

if [ $enable_ssl -gt 0 ]; then
    printf "%s" "Checking for ssl... "
    if ocamlfind query ssl >/dev/null 2>/dev/null; then
        echo "found"
	with_equeue_ssl=1
	with_rpc_ssl=1
    else
        echo "not found"
	echo "Required library ssl not found!"
	exit 1
    fi
fi

######################################################################
# Check SecureRPC

adh_reqs=""

if [ $with_rpc_auth_dh -gt 0 ]; then
    echo  "Checking SecureRPC"
    printf "    %s" "Checking for cryptgps... "
    if ocamlfind query cryptgps >/dev/null 2>/dev/null; then
        echo "found"
    else
        echo "not found"
	echo "Required library cryptgps not found!"
	exit 1
    fi

    if [ -z "$adh_style" ]; then
	echo "    No -auth-dh-style passed and no OS default known. Falling back to keyenvoy"
	adh_style="keyenvoy"
    fi

    if [ "$adh_style" = "tirpc" ]; then
	if [ $with_rpc_xti -eq 0 ]; then
	    echo "-auth-dh-style tirpc needs rpc-xti which is missing"
	    exit 1
	fi
	adh_reqs="rpc-xti"
    fi

    echo "    SecureRPC is supported"
fi

######################################################################
# Check Apache

if [ $enable_apache -gt 0 ]; then
    printf "Apache mod connector... "

#     echo "CURRENTLY BROKEN - disabling for now"
#     enable_apache=0

    if [ -z "$apxs" ]; then
	# guess
	apxs=`get_path apxs`
    fi
    if [ -z "$apache" ]; then
	# guess
	apache=`get_path apache`
    fi

    if [ -x "$apxs" ] ; then
	apache_major=2
	apache_libdir="`$apxs -q LIBEXECDIR`"
	apache_incdir="`$apxs -q INCLUDEDIR`"
	apache_confdir="`$apxs -q SYSCONFDIR`"
	apache_ldflags_shlib="`$apxs -q LDFLAGS_SHLIB`"
	apache_cc="`$apxs -q CC`"
	apache_cflags="-I \$(APACHE_INCDIR) \
	  `$apxs -q CFLAGS` `$apxs -q CFLAGS_SHLIB`"
	# This is to allow modules residing in the standard  ocaml library 
	# directory to be loaded with relative paths.
	#apache_ocamllibdir=`ocamlfind printconf destdir`
	apache_ocamllibdir=`ocamlc -where`
	echo "enabled (Apache $apache_major)"
    else
	apache_major=
	enable_apache=0
	echo "apxs or apache not found"
	echo "    Maybe you need to use the -apache option?"
	exit 1
    fi

    case `ocamlc -version` in
        3.12*)
            str_stubs=-lcamlstr
            ;;
        *)
            str_stubs=-lstr
            ;;
    esac

fi

######################################################################
# NETCGI1 or NETCGI2

preferred_cgi_pkg=netcgi1
inc_netcgi1or2='$(INC_NETCGI1)'

if [ $prefer_netcgi2 -gt 0 ]; then
    preferred_cgi_pkg=netcgi2
    inc_netcgi1or2='$(INC_NETCGI2)'
fi

######################################################################
# Summary

echo
echo "Effective options:"
print_options
echo

pkglist="netsys netshm equeue shell netstring rpc-generator rpc pop smtp netclient netcgi1 netcgi2 cgi netplex netcgi2-plex"

if [ $enable_apache -gt 0 ]; then
    pkglist="$pkglist netcgi2-apache"
fi

full_pkglist="$pkglist rpc-auth-local rpc-xti equeue-tcl equeue-gtk1 equeue-gtk2 equeue-ssl rpc-ssl rpc-auth-dh nethttpd nethttpd-for-netcgi1 nethttpd-for-netcgi2"

if [ $disable_core -gt 0 ]; then
    # Omit the core packages:
    pkglist=""
    with_rpc_auth_local=0
    with_rpc_xti=0
fi

if [ $with_nethttpd -gt 0 ]; then
    pkglist="$pkglist nethttpd-for-netcgi1 nethttpd-for-netcgi2"
fi

for opt in $woptions rpc_auth_local rpc_xti equeue_tcl equeue_gtk1 equeue_gtk2 equeue_ssl rpc_ssl; do
	e="o=\$with_$opt"
	eval "$e"
	if [ $o -gt 0 ]; then
		uopt=`echo "$opt" | sed -e 's/_/-/g'`
		pkglist="$pkglist $uopt"
	fi
done

######################################################################
# Write Makefile.conf

echo "Writing Makefile.conf"
cat <<_EOF_ >Makefile.conf
# Makefike.conf written by configure
# The Ocamlnet version
VERSION = $version

# The packages to build in the right order:
PKGLIST = $pkglist

# All packages:
FULL_PKGLIST = $full_pkglist

# Whether the OS needs an .exe suffix for executables:
EXEC_SUFFIX = $exec_suffix

# Required packages (findlib):
REQUIRES = $requires

# Additional options only for ocamlc:
OCAMLC_OPTIONS =

# Additional options only for ocamlopt:
OCAMLOPT_OPTIONS =

# Where the ocamlnet lookup tables are to be installed (both findlib
# and non-findlib):
NET_DB_DIR = $net_db_dir

# Where binaries are installed:
BINDIR = $bindir

# Method of installation:
INSTMETHOD = findlib

# Multi-threading type:
MT_TYPE = $mt_type

# Compiler switch to enable multi-threading:
THREAD = $mt_switch

# For -enable-tcl:
EQUEUE_TCL_DEFS = $tcl_defs_1
EQUEUE_TCL_LIBS = $tcl_libs

# For -enable-gtk2:
GTK_EXTRA_DEFINES = $gtk2_io_add_watch_supports_lists

# For -with-auth-dh:
RPC_AUTH_DH_CONNECTOR = $adh_style
AUTHDHREQS = $adh_reqs

# For -enable-apache
APACHE_MAJOR = $apache_major
APACHE_LIBDIR = $apache_libdir
APACHE_OCAMLLIBS = -lcamlrun -ltermcap -lunix $str_stubs
APACHE_INCDIR = $apache_incdir
APACHE_CONFDIR = $apache_confdir
APACHE_LDFLAGS_SHLIB = $apache_ldflags_shlib
APACHE_CC = $apache_cc
APACHE_CFLAGS = $apache_cflags
APACHE_OCAMLLIBDIR = $apache_ocamllibdir
APXS = $apxs

# Preferred CGI implementation
PREFERRED_CGI_PKG=$preferred_cgi_pkg
INC_NETCGI1OR2=$inc_netcgi1or2

_EOF_

######################################################################
# Finish

echo
echo "Please check Makefile.conf."
echo
echo "You can now compile Ocamlnet by invoking"
echo "   make all"
echo "for the bytecode compiler, and optionally by invoking"
echo "   make opt"
echo "for the native-code compiler (if supported on your architecture)."
echo "Finally, a"
echo "   make install"
echo "will install the package(s)."