]> matita.cs.unibo.it Git - helm.git/blob - helm/configuration/configure.in
added magic numbers
[helm.git] / helm / configuration / configure.in
1 AC_INIT(etc/configuration.xml.in)
2
3 PACKAGE=helm_configuration
4
5 HELM_MAJOR_VERSION=0
6 HELM_MINOR_VERSION=0
7 HELM_MICRO_VERSION=2
8 HELM_VERSION=$HELM_MAJOR_VERSION.$HELM_MINOR_VERSION.$HELM_MICRO_VERSION
9 VERSION=$HELM_VERSION
10
11 DEFAULT_HELM_VAR_DIR=/var/local/helm
12 DEFAULT_HELM_TMP_DIR=/tmp
13
14 AC_ARG_ENABLE(
15         defaults,
16         [  --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
17         USE_DEFAULTS=$enableval,
18         USE_DEFAULTS=auto
19 )
20
21 if test "x$prefix" != xNONE; then
22   RESOLVED_PREFIX=$prefix
23 else
24   RESOLVED_PREFIX=$ac_default_prefix
25 fi
26
27 if test "x$exec_prefix" != xNONE; then
28   RESOLVED_EXEC_PREFIX=$exec_prefix
29 else
30   RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
31 fi
32
33 dnl General
34 HELM_BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
35 HELM_LIB_DIR=$RESOLVED_EXEC_PREFIX/lib/helm
36 HELM_ETC_DIR=$RESOLVED_PREFIX/etc/helm
37 HELM_SHARE_DIR=$RESOLVED_PREFIX/share/helm
38
39 dnl Checking for the variable directory
40 if test $USE_DEFAULTS != yes; then
41         echo
42         echo "Now you have to choose a suitable directory for variable files."
43         echo "Normally, this directory would be something like /var/local/helm, you"
44         echo "have to be sure that the directory (and the subdirectories in it)"
45         echo "is world-writable."
46         echo
47         echo -n "[[$DEFAULT_HELM_VAR_DIR]] ? "
48         read HELM_VAR_DIR
49         echo
50         if test x$HELM_VAR_DIR = x; then
51                 HELM_VAR_DIR="/var/local/helm"
52         fi
53 else
54         HELM_VAR_DIR=$DEFAULT_HELM_VAR_DIR
55 fi
56
57 AC_MSG_CHECKING(for HELM variable dir)
58 AC_MSG_RESULT($HELM_VAR_DIR)
59
60 dnl Checking for the /tmp directory
61 DEFAULTS=$USE_DEFAULTS
62 if test $DEFAULTS = auto; then
63         if test -d $DEFAULT_HELM_TMP_DIR ; then
64                 HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
65         else
66                 DEFAULTS=no
67         fi
68 fi
69
70 if test $DEFAULTS = no; then
71         echo
72         echo "Please, tell me the name of a directory which can be used to store"
73         echo "temporary files (normally it is something like /tmp)"
74         echo
75         echo -n "[[$DEFAULT_HELM_TMP_DIR]]"
76         read HELM_TMP_DIR
77         echo
78         if test x$HELM_TMP_DIR = x; then
79                 HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
80         fi
81 else
82         HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
83 fi
84
85 AC_MSG_CHECKING(for $HELM_TMP_DIR)
86 if test ! -d $HELM_TMP_DIR; then
87         AC_MSG_RESULT(no)
88         AC_MSG_ERROR(please check your installation)
89 fi
90 AC_MSG_RESULT(ok)
91
92 dnl Checks for GtkMathView
93 AC_CHECK_PROG(HAVE_GTKMATHVIEW_CONFIG, gtkmathview-config, yes, no)
94 if test $HAVE_GTKMATHVIEW_CONFIG = no; then
95    AC_MSG_ERROR(Could not find gtkmathview-config)
96 fi
97 GTKMATHVIEW_PREFIX=`gtkmathview-config --prefix`
98
99 AC_CACHE_CHECK(
100   for dictionary.xml,
101   helm_cv_GTKMATHVIEW_DICTIONARY_PATH,
102   helm_cv_GTKMATHVIEW_DICTIONARY_PATH=$GTKMATHVIEW_PREFIX/share/gtkmathview/dictionary.xml
103   if test ! -f $helm_cv_GTKMATHVIEW_DICTIONARY_PATH; then
104     read helm_cv_GTKMATHVIEW_DICTIONARY_PATH
105   fi
106 )
107 GTKMATHVIEW_DICTIONARY_PATH=$helm_cv_GTKMATHVIEW_DICTIONARY_PATH
108
109 AC_CACHE_CHECK(
110   for font-configuration.xml,
111   helm_cv_GTKMATHVIEW_FONT_CONFIGURATION_PATH,
112   helm_cv_GTKMATHVIEW_FONT_CONFIGURATION_PATH=$GTKMATHVIEW_PREFIX/share/gtkmathview/font-configuration.xml
113   if test ! -f $helm_cv_GTKMATHVIEW_FONT_CONFIGURATION_PATH; then
114     read helm_cv_GTKMATHVIEW_FONT_CONFIGURATION_PATH
115   fi
116 )
117 GTKMATHVIEW_FONT_CONFIGURATION_PATH=$helm_cv_GTKMATHVIEW_FONT_CONFIGURATION_PATH
118
119 AC_CACHE_CHECK(
120   for t1lib configuration file,
121     helm_cv_GTKMATHVIEW_T1_CONFIG_FILE,
122     helm_cv_GTKMATHVIEW_T1_CONFIG_FILE=$GTKMATHVIEW_PREFIX/share/gtkmathview/t1.config
123     if test ! -f $helm_cv_GTKMATHVIEW_T1_CONFIG_FILE; then
124       read GTKMATHVIEW_T1_CONFIG_FILE
125     fi
126 )
127 GTKMATHVIEW_T1_CONFIG_FILE=$helm_cv_GTKMATHVIEW_T1_CONFIG_FILE
128
129 HELM_DICTIONARY_PATH=$HELM_ETC_DIR/helm-dictionary.xml
130 HELM_FONT_CONFIGURATION_PATH=$HELM_ETC_DIR/helm-font-configuration.xml
131
132 dnl Only for HELM XML configuration
133 HELM_LIBRARY_DIR=$HELM_VAR_DIR/library
134 HELM_SERVERS_FILE=$HELM_VAR_DIR/servers.txt
135 HELM_URIS_DBM=$HELM_VAR_DIR/urls_of_uris.db
136
137 dnl CSC: FIXME: getters should download the DTDs
138 HELM_DTD_DIR=$HELM_SHARE_DIR/dtd
139 HELM_STYLE_DIR=$HELM_SHARE_DIR/style
140
141 dnl HELM prefixes
142 AC_SUBST(RESOLVED_PREFIX)
143 AC_SUBST(RESOLVED_EXEC_PREFIX)
144
145 dnl HELM version
146 AC_SUBST(PACKAGE)
147 AC_SUBST(VERSION)
148
149 dnl HELM directories
150 AC_SUBST(HELM_BIN_DIR)
151 AC_SUBST(HELM_LIB_DIR)
152 AC_SUBST(HELM_ETC_DIR)
153 AC_SUBST(HELM_SHARE_DIR)
154 AC_SUBST(HELM_VAR_DIR)
155 AC_SUBST(HELM_TMP_DIR)
156
157 dnl HELM download directory
158 AC_SUBST(HELM_LIBRARY_DIR)
159
160 dnl HELM servers
161 AC_SUBST(HELM_SERVERS_FILE)
162
163 dnl HELM URIS data-base
164 AC_SUBST(HELM_URIS_DBM)
165
166 dnl HELM DTDs
167 AC_SUBST(HELM_DTD_DIR)
168
169 dnl HELM stylesheets
170 AC_SUBST(HELM_STYLE_DIR)
171
172 dnl HELM customized GtkMathView configuration
173 AC_SUBST(HELM_DICTIONARY_PATH)
174 AC_SUBST(HELM_FONT_CONFIGURATION_PATH)
175 AC_SUBST(GTKMATHVIEW_DICTIONARY_PATH)
176 AC_SUBST(GTKMATHVIEW_FONT_CONFIGURATION_PATH)
177 AC_SUBST(GTKMATHVIEW_T1_CONFIG_FILE)
178
179 AC_OUTPUT(
180 [ Makefile
181   helm-config
182   lib/configuration.pl
183   etc/helm-math-engine-configuration.xml
184   etc/configuration.xml
185   helm_configuration.spec
186 ], chmod +x helm-config)