summaryrefslogtreecommitdiff
path: root/www/ocsigen/files/patch-configure
blob: 2fbf03161d4c6ca349cdfade8f63f888b6b3ce96 (plain) (blame)
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
--- configure.orig	Thu Mar 15 12:27:54 2007
+++ configure	Mon Apr 23 10:17:10 2007
@@ -51,10 +51,13 @@
     libdir="/usr/local/lib"
     mandir="/usr/local/share/man/man1/"
     docdir="/usr/share/doc"
+    sysconfdir="/etc"
     name="ocsigen"
     prefix="/"
     ocsigen_user="www-data"
     ocsigen_group="www-data"
+    staticpagesdir="/var/www/$name"
+    uploaddir="/tmp"
 }
 
 set_defaults
@@ -132,6 +135,9 @@
 	echo "    --libdir $libdir"
 	echo "    --mandir $mandir"
 	echo "    --docdir $docdir"
+	echo "    --sysconfdir $sysconfdir"
+	echo "    --staticpagesdir $staticpagesdir"
+	echo "    --uploaddir $uploaddir"
 	echo "    --name $name"
 }
 
@@ -174,6 +180,15 @@
 --docdir dir
 	Install documentation in this directory
 
+--sysconfdir dir
+	Install system configuration files in this directory
+
+--staticpagesdir dir
+	Serve static pages from this directory
+
+--uploaddir dir
+	Put uploaded files in this directory
+
 --name name
 	The name of the server (and directory for the modules)
 
@@ -266,6 +281,21 @@
 			shift
 			shift
 			;;
+		--sysconfdir)
+			sysconfdir="$2"
+			shift
+			shift
+			;;
+		--staticpagesdir)
+			staticpagesdir="$2"
+			shift
+			shift
+			;;
+		--uploaddir)
+			uploaddir="$2"
+			shift
+			shift
+			;;
 		--name)
 			name="$2"
 			shift
@@ -293,6 +323,17 @@
 
 
 ######################################################################
+# Check camlp4o
+printf "%s" "Finding out which camlp4o to use... "
+if which camlp4o.byte >/dev/null 2>/dev/null; then
+    echo "camlp4o.byte"
+    camlp4o="camlp4o.byte"
+else
+    echo "camlp4o"
+    camlp4o="camlp4o" 
+fi
+
+######################################################################
 # Check ocamlfind
 
 printf "%s" "Checking for findlib... "
@@ -322,9 +363,10 @@
 ######################################################################
 # Check whether OCaml version is > 3.9
 version=`ocamlc -version`
-ocamlversion=`n1=${version:0:1}; \
-              n2=${version:2:2}; \
-              n3=${version:5}; \
+ocamlversion=`n1=${version%%.[0-9][0-9].[0-9]}; \
+              tail=${version##[0-9].}; \
+              n2=${tail%%.[0-9]}; \
+              n3=${tail##[0-9][0-9].}; \
               if [ $n1 = "3" ] && [ $n2 -le 9 ]; then \
                 echo "OLD"; \
               else \
@@ -380,6 +422,7 @@
 # ocamlfind will choose automatically the compiler.
 OCAMLFIND=ocamlfind
 CAMLP4=camlp4
+CAMLP4O="$camlp4o"
 CAMLLEX=ocamllex
 CAMLYACC=ocamlyacc
 CAMLCNAME=ocamlc
@@ -429,13 +472,13 @@
 LOGDIR = /var/log/\$(OCSIGENNAME)
 
 # Config files:
-CONFIGDIR = /etc/\$(OCSIGENNAME)
+CONFIGDIR = $sysconfdir
 
 # Where to put static pages:
-STATICPAGESDIR = /var/www/\$(OCSIGENNAME)
+STATICPAGESDIR = $staticpagesdir
 
 # Default directory for file upload:
-UPLOADDIR = /tmp
+UPLOADDIR = $uploaddir
 
 # Where to put Ocsigen documentation:
 DOCDIR = $docdir/\$(OCSIGENNAME)