File: configure.ac

package info (click to toggle)
theme-d 7.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,036 kB
  • sloc: lisp: 9,625; sh: 5,321; makefile: 715; ansic: 477
file content (401 lines) | stat: -rw-r--r-- 11,941 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
AC_INIT([Theme-D], [7.2.4], [tommi.hoynalanmaa at iki.fi], [theme-d], [http://www.iki.fi/tohoyn/theme-d/])

AM_INIT_AUTOMAKE

AC_PROG_CC

AC_CONFIG_MACRO_DIR([m4])

AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL

abs_top_dir=$(pwd)
maint_root_dir=$(pwd)
maint_translator_dir=$maint_root_dir/guile-code/theme-d/translator
maint_runtime_dir=$maint_root_dir/guile-code/theme-d/runtime
maint_lib_dir=$maint_root_dir/theme-d-code
maint_guile_lib_dir=$maint_root_dir/guile-code
maint_examples_dir=$maint_root_dir/theme-d-code/examples
maint_tests_dir=$maint_root_dir/theme-d-code/tests
maint_tools_dir=$maint_root_dir/tools
maint_bootstrap_dir=$maint_root_dir/theme-d-bootstrap
maint_compiler_path=$maint_translator_dir/theme-d-compile.scm
maint_linker_path=$maint_translator_dir/theme-d-link.scm
maint_run_path=$maint_runtime_dir/run-theme-d-program.scm
maint_run_split_path=$maint_runtime_dir/run-split-theme-d-program.scm
theme_d_native_classes_size=1000
theme_d_classes_size=1000

AC_SUBST(abs_top_dir)
AC_SUBST(maint_root_dir)
AC_SUBST(maint_translator_dir)
AC_SUBST(maint_runtime_dir)
AC_SUBST(maint_lib_dir)
AC_SUBST(maint_guile_lib_dir)
AC_SUBST(maint_examples_dir)
AC_SUBST(maint_tests_dir)
AC_SUBST(maint_tools_dir)
AC_SUBST(maint_bootstrap_dir)
AC_SUBST(maint_compiler_path)
AC_SUBST(maint_linker_path)
AC_SUBST(maint_run_path)
AC_SUBST(maint_run_split_path)
AC_SUBST(theme_d_native_classes_size)
AC_SUBST(theme_d_classes_size)

AC_ARG_WITH([guile],
  [AS_HELP_STRING([--with-guile],
    [Guile version to be used])],
  [guile_spec=$withval],
  [guile_spec=no])

CHECK_GUILE_VERSION

AC_SUBST(MY_GUILE_VERSION)

GUILE_PACKAGE=guile-$MY_GUILE_VERSION

AC_SUBST(LIBGUILE_CPPFLAGS, $($PKG_CONFIG --cflags $GUILE_PACKAGE))

AC_ARG_WITH([target-platform],
  [AS_HELP_STRING([--with-target-platform],
    [Target platform to be used])],
  [TARGET_PLATFORM=$withval],
  [TARGET_PLATFORM=$GUILE_PACKAGE])

if test "$TARGET_PLATFORM" != "guile-3.0" ; then
   echo "Invalid target platform." ;
   exit 1 ;
fi

AC_SUBST(TARGET_PLATFORM)

AC_ARG_WITH([guile-program],
  [AS_HELP_STRING([--with-guile-program],
    [Guile program to be used])],
    [THEME_D_GUILE=$withval],
    [THEME_D_GUILE=/usr/bin/guile-$MY_GUILE_VERSION])

AC_SUBST(THEME_D_GUILE)

AC_ARG_WITH([guile-header-dir],
  [AS_HELP_STRING([--with-guile-header-dir],
    [Directory for libguile.h])],
    [GUILE_HEADER_DIR=$withval],
    [GUILE_HEADER_DIR=])

AC_SUBST(GUILE_HEADER_DIR)

AM_CONDITIONAL(EXPLICIT_HEADER_DIR, [test "$GUILE_HEADER_DIR" != ""])

AC_ARG_WITH([guile-pc],
  [AS_HELP_STRING([--with-guile-pc],
    [Guile pc file to be used])],
    [GUILEPC=$withval],
    [GUILEPC=$GUILE_PACKAGE])

AC_ARG_WITH([support-library],
  [AS_HELP_STRING([--with-support-library],
    [Use the Theme-D support library (libthemedsupport)])],
  [support_lib_spec=$withval],
  [support_lib_spec=default])

if test "$support_lib_spec" = "yes" ; then
   support_lib=yes
elif test "$support_lib_spec" = "no" ; then
   support_lib=no
elif test "$support_lib_spec" = "default" ; then
    support_lib=yes
fi

dnl Having a # in SUPPORT_LIB caused problems in makefiles.
if test "$support_lib" = yes; then
  SUPPORT_LIB=t
else
  SUPPORT_LIB=f
fi

AC_SUBST(SUPPORT_LIB)

AM_CONDITIONAL([C_SUPPORT_LIB], [test "$support_lib" = yes])

platform_intf_link=$(pwd)/theme-d-code/standard-library/platform-specific-impl.thi
platform_body_link=$(pwd)/theme-d-code/standard-library/platform-specific-impl.thb

if test \( -e $platform_intf_link -o -h $platform_intf_link \) ; then
  rm $platform_intf_link ;
fi
if test \( -e $platform_body_link -o -h $platform_body_link \) ; then
  rm $platform_body_link ;
fi

if test "$TARGET_PLATFORM" = "guile-3.0" ; then
  platform_intf=$(pwd)/theme-d-code/standard-library/platform-specific-impl-guile-3.0.thi ;
  platform_body=$(pwd)/theme-d-code/standard-library/platform-specific-impl-guile-3.0.thb ;
else
  platform_intf=$(pwd)/theme-d-code/standard-library/platform-specific-impl-common.thi ;
  platform_body=$(pwd)/theme-d-code/standard-library/platform-specific-impl-common.thb ;
fi

#ln -s $platform_intf $platform_intf_link
#ln -s $platform_body $platform_body_link

AC_SUBST(PLATFORM_INTF,$platform_intf)
AC_SUBST(PLATFORM_BODY,$platform_body)

AM_CONDITIONAL([GUILE_3_0], [test "$TARGET_PLATFORM" = "guile-3.0"])

GUILE_LIB_DIR=$(${PKG_CONFIG} --variable=libdir $GUILEPC)

default_guile_module_dir=$(${PKG_CONFIG} --variable=sitedir $GUILEPC)

AC_ARG_WITH([guile-module-dir],
  [AS_HELP_STRING([--guile-module-dir],
    [The directory where to install Guile modules])],
  [MODULE_DIR=$withval],
  [MODULE_DIR=$default_guile_module_dir])

AC_SUBST(MODULE_DIR)

default_guile_comp_module_dir=$(${PKG_CONFIG} --variable=siteccachedir $GUILEPC)

AC_ARG_WITH([guile-comp-module-dir],
  [AS_HELP_STRING([--guile-comp-module-dir],
    [The directory where to install compiled Guile modules])],
  [COMP_MODULE_DIR=$withval],
  [COMP_MODULE_DIR=$default_guile_comp_module_dir])

AC_SUBST(COMP_MODULE_DIR)

AC_ARG_ENABLE([extra-math],
  [AS_HELP_STRING([--enable-extra-math],
    [Enable some mathematical functions specified by the C standard])],
  [extra_math_spec=$enableval],
  [extra_math_spec=default])

if test "$extra_math_spec" = "default" ; then
  extra_math=yes ;
elif test "$extra_math_spec" = "yes" -o "$extra_math_spec" = "no" ; then
  extra_math=$extra_math_spec
else
  echo "Syntax error with option extra-math" ;
  exit 1 ;
fi

if test \( "$extra_math" = "yes" \) -a \( "$support_lib" = "no" \) ; then
   echo "Error: Extra math procedures can't be used if the support library is not used." ;
   exit 1;
fi

AM_CONDITIONAL([EXTRA_MATH], [test "$extra_math" = "yes"])

if test "$extra_math" = "yes" ; then
   STANDARD_MATH_FLAG=-DSTANDARD_MATH=1
else
   STANDARD_MATH_FLAG=
fi

AC_SUBST(STANDARD_MATH_FLAG)

AC_ARG_ENABLE([posix-math],
  [AS_HELP_STRING([--enable-posix-math],
    [Enable some mathematical functions specified by the POSIX C standard])],
  [posix_math_spec=$enableval],
  [posix_math_spec=default])

if test "$posix_math_spec" = "default" ; then
  posix_math=yes
elif test "$posix_math_spec" = "yes" -o "$posix_math_spec" = "no" ; then
  posix_math=$posix_math_spec
else
  echo "Syntax error with option posix-math" ;
  exit 1 ;
fi

if test \( "$posix_math" = "yes" \) -a \( "$support_lib" = "no" \) ; then
   echo "Error: POSIX math procedures can't be used if the support library is not used." ;
   exit 1;
fi

AM_CONDITIONAL([POSIX_MATH], [test "$posix_math" = "yes"])

if test "$posix_math" = "yes" ; then
   POSIX_MATH_FLAG=-DPOSIX_MATH=1
else
   POSIX_MATH_FLAG=
fi

AC_SUBST(POSIX_MATH_FLAG)

AC_ARG_ENABLE([xlat-opt-compilation],
  [AS_HELP_STRING([--disable-xlat-opt-compilation],
    [Use the -O1 option for the translator guile compilation])],
  [opt_comp=$enableval],
  [opt_comp=yes])

AM_CONDITIONAL([NONOPT_COMP], [test "$opt_comp" = "no"])

AC_ARG_ENABLE([rte-opt-compilation],
  [AS_HELP_STRING([--disable-rte-opt-compilation],
    [Use the -O1 option for the runtime environment guile compilation])],
  [rte_opt_comp=$enableval],
  [rte_opt_comp=yes])

AM_CONDITIONAL([RTE_OPT_COMP], [test "$rte_opt_comp" = "yes"])

default_extension_dir=$($PKG_CONFIG --variable=extensiondir $GUILE_PACKAGE)

AC_ARG_WITH([extension-dir],
  [AS_HELP_STRING([--with-extension-dir],
    [The directory where to install the libthemedsupport extension])],
  [EXTENSION_DIR=$withval],
  [EXTENSION_DIR=$default_extension_dir])

if test "$EXTENSION_DIR" = "" ; then
  EXTENSION_DIR=$libdir
fi

AC_SUBST(EXTENSION_DIR)

if test "$support_lib" = "yes" ; then
   if test "$extra_math" = "yes" -a "$posix_math" = "yes" ; then
      support_module=theme-d-support-all.scm ;
   elif test "$extra_math" = "yes" -a "$posix_math" = "no" ; then
      support_module=theme-d-support-no-posix.scm ;
   elif test "$extra_math" = "no" -a "$posix_math" = "yes" ; then
      echo "Posix math cannot be used without extra math." ;
      exit 1 ;
   elif test "$extra_math" = "no" -a "$posix_math" = "no" ; then
     support_module=theme-d-support-no-extra.scm ;
   else
      echo "Error" ;
      exit 1 ;
   fi
else
   support_module=theme-d-alt-support.scm
fi

if test "$support_module" = "" ; then
   echo "Error"
   exit 1
fi

dnl support_link=$(pwd)/guile-code/theme-d/runtime/theme-d-support.scm

dnl if test -e ${support_link} ; then
dnl    rm ${support_link}
dnl fi

dnl ln -s $(pwd)/guile-code/theme-d/runtime/${support_module} ${support_link}

AC_SUBST(SUPPORT_MODULE, $support_module)

if test "$TARGET_PLATFORM" = "guile-3.0" ; then
   split_script=$(pwd)/guile-code/theme-d/runtime/run-split-theme-d-program-new.scm.in ;
   GUILD=guild-3.0
else
   split_script=""
   GUILD=guild
fi

split_script_link=$(pwd)/guile-code/theme-d/runtime/run-split-theme-d-program.scm.in

dnl if test -e ${split_script_link} ; then
dnl    rm ${split_script_link}
dnl fi

dnl if ! test "$split_script" = "" ; then
dnl    ln -s $split_script $split_script_link
dnl fi

AM_CONDITIONAL([HAS_RUN_SPLIT], [test "$split_script" != ""])
AC_SUBST(RUN_SPLIT_SCRIPT, $split_script)

AC_ARG_WITH([conf-dir],
  [AS_HELP_STRING([--with-conf-dir],
    [The directory where to install the global configuration file])],
  [CONFDIR=$withval],
  [CONFDIR=/etc])

AC_SUBST(CONFDIR)

THEME_D_TRANSLATOR_DIR=$COMP_MODULE_DIR/theme-d/translator
THEME_D_RUNTIME_DIR=$COMP_MODULE_DIR/theme-d/runtime
THEME_D_SCRIPT_DIR=$datadir/theme-d/scripts
THEME_D_LIB_DIR=$datadir/theme-d/lib
THEME_D_TARGET_LIB_DIR=$libdir/theme-d
THEME_D_EXAMPLES_DIR=$docdir/examples
THEME_D_TESTS_DIR=$datadir/theme-d/tests
THEME_D_TOOLS_DIR=$datadir/theme-d/tools
THEME_D_BOOTSTRAP_DIR=$datadir/theme-d/theme-d-bootstrap
THEME_D_COMPILER_PATH=$THEME_D_SCRIPT_DIR/theme-d-compile.scm
THEME_D_LINKER_PATH=$THEME_D_SCRIPT_DIR/theme-d-link.scm
THEME_D_RUN_PATH=$THEME_D_SCRIPT_DIR/run-theme-d-program.scm
THEME_D_RUN_SPLIT_PATH=$THEME_D_SCRIPT_DIR/run-split-theme-d-program.scm

AC_SUBST(THEME_D_TRANSLATOR_DIR)
AC_SUBST(THEME_D_RUNTIME_DIR)
AC_SUBST(THEME_D_SCRIPT_DIR)
AC_SUBST(THEME_D_LIB_DIR)
AC_SUBST(THEME_D_TARGET_LIB_DIR)
AC_SUBST(THEME_D_EXAMPLES_DIR)
AC_SUBST(THEME_D_TESTS_DIR)
AC_SUBST(THEME_D_TOOLS_DIR)
AC_SUBST(THEME_D_BOOTSTRAP_DIR)
AC_SUBST(THEME_D_COMPILER_PATH)
AC_SUBST(THEME_D_LINKER_PATH)
AC_SUBST(THEME_D_RUN_PATH)
AC_SUBST(THEME_D_RUN_SPLIT_PATH)
AC_SUBST(GUILD)

if test "$TARGET_PLATFORM" = "guile-3.0" ; then
   DECL_TRUE="#:declarative? #t"
   DECL_FALSE="#:declarative? #f"
else
   DECL_TRUE=""
   DECL_FALSE=""
fi

#DUPLICATES="#:duplicates (merge-generics warn warn-override-core replace last)"
#DUPLICATES="#:duplicates (replace last)"
DUPLICATES="#:duplicates (merge-generics replace last)"

AC_SUBST(DECL_TRUE)
AC_SUBST(DECL_FALSE)
AC_SUBST(DUPLICATES)

GUILE_EXT_PATH=${abs_top_dir}/libthemedsupport

AC_SUBST(GUILE_EXT_PATH)

AC_CONFIG_FILES([Makefile
        doc/Makefile
        libthemedsupport/Makefile
        guile-code/Makefile
        guile-code/th-scheme-utilities/Makefile
        guile-code/theme-d/Makefile
        guile-code/theme-d/common/Makefile
        guile-code/theme-d/translator/Makefile
        guile-code/theme-d/translator/subst.sed
        guile-code/theme-d/runtime/Makefile
        guile-code/theme-d/runtime/params.scm
        guile-code/theme-d/runtime/subst.sed
        guile-code/theme-d/testing/Makefile
        guile-code/theme-d/util/Makefile
        tools/Makefile
        meta/Makefile
        theme-d-code/Makefile
        theme-d-code/standard-library/Makefile
        theme-d-code/tests/Makefile
        theme-d-code/examples/Makefile
        theme-d-bootstrap/Makefile
        theme-d-bootstrap/src/Makefile
        theme-d-bootstrap/src/theme-d-in-theme-d/Makefile
        theme-d-bootstrap/build1/Makefile
        theme-d-bootstrap/build1/theme-d-in-theme-d/Makefile
        theme-d-bootstrap/bootstrap/Makefile
        theme-d-bootstrap/bootstrap/theme-d-in-theme-d/Makefile
        test-suite/Makefile
        theme-d-config-maint
])
AC_OUTPUT