3
## Contact: xsb-contact@cs.sunysb.edu
5
## Copyright (C) The Research Foundation of SUNY, 1998
7
## XSB is free software; you can redistribute it and/or modify it under the
8
## terms of the GNU Library General Public License as published by the Free
9
## Software Foundation; either version 2 of the License, or (at your option)
12
## XSB is distributed in the hope that it will be useful, but WITHOUT ANY
13
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
## FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for
17
## You should have received a copy of the GNU Library General Public License
18
## along with XSB; if not, write to the Free Software Foundation,
19
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
## $Id: configure.in,v 1.187 2006/06/25 01:08:48 harpreet_singh Exp $
25
dnl Autoconf script for XSB
26
dnl To rebuild the `configure' script from this, execute the command
28
dnl in the directory containing this script.
35
AC_INIT(../emu/emuloop.c)
38
if test -f buildxsb.lock ; then
39
echo "***Build lock exists: another configure/makexsb is probably running.
40
***Wait until the previous build is complete.
41
***If this is a stale lock, remove ./buildxsb.lock and run configure again."
49
# strip the last directory and possibly trailing slashes
50
topdir=`echo "${build_dir}" | sed 's,/[[^/]][[^/]]*/*$,,'`
53
AC_CONFIG_AUX_DIR($build_dir)
55
# Needed by the xsb_config.h file
56
AC_DEFINE(CONFIG_INCLUDED)
57
AC_DEFINE(___ALWAYS_TRUE___)
61
[ --with-gcc use GCC to compile XSB])
63
[ --with-cc use CC to compile XSB])
65
[ --with-acc use ACC to compile XSB])
67
[ --with-os=wind build XSB for Windows NT/95/98])
69
[ --with-wind build XSB for Windows NT/95/98])
71
[ --with-libwww=DIR the libwww library used for Web access is at DIR])
73
[ --with-xpath=DIR the libxml2 library used for XPath is at DIR])
74
AC_ARG_WITH(dbdrivers,
75
[ --with-dbdrivers configure dbdrivers package])
77
[ --with-oracle compile with support of Oracle])
79
[ --with-odbc compile with support for ODBC])
81
[ --with-iodbc use iODBC driver manager])
82
AC_ARG_WITH(interprolog,
83
[ --with-interprolog compile with support for InterProlog.
84
It is possible you would need to use --site-includes
85
option to specify locations of jni.h and jni_md.h
88
[ --with-smodels=path use SMODELS for the XNMR module.
89
path is the path where smodels has
90
been installed and compiled])
92
[ --with-itkwish=DIR DIR where the itkwish shell is located])
95
AC_ARG_ENABLE(no-cygwin,
96
[ --enable-no-cygwin compiled with option -mno-cygwin (default: enabled)], ,
98
AC_ARG_ENABLE(general-tagging,
99
[ --enable-general-tagging When this option is enabled XSB will determine
100
which bits in the address to tag during
101
runtime. This option is required for Linux
102
kernels > 2.6], general_tagging=yes)
104
[ --enable-debug compile with debugging turned on])
105
AC_ARG_ENABLE(debug-verbose,
106
[ --enable-debug-verbose compile with verbose messages])
107
AC_ARG_ENABLE(debug-vm,
108
[ --enable-debug-vm compile with VM-level debugging])
109
AC_ARG_ENABLE(debug-assertions,
110
[ --enable-debug-assertions compile with debug assertions])
111
AC_ARG_ENABLE(dwarf-debug,
112
[ --enable-dwarf-debug compile with extra (macro) debugging turned on])
113
AC_ARG_ENABLE(oracle-debug,
114
[ --enable-oracle-debug compile with Oracle debugging turned on])
115
AC_ARG_ENABLE(profile,
116
[ --enable-profile compile with profiling turned on])
117
AC_ARG_ENABLE(optimization,
118
[ --disable-optimization compile with no optimization (default: enabled)],
119
disable_optimization=yes)
120
AC_ARG_ENABLE(batched-scheduling,
121
[ --enable-batched-scheduling compile using the batched scheduling strategy;
122
default is the local strategy])
123
dnl AC_ARG_ENABLE(local-scheduling,
124
dnl [ --enable-local-scheduling compile using the local scheduling strategy;
125
dnl default is the batched strategy])
126
dnl AC_ARG_ENABLE(local-scheduling,
127
dnl [ --with-local-scheduling compile using the local scheduling strategy;
128
dnl default is the batched strategy])
129
dnl Allow some slack in how local scheduling is specified
130
AC_ARG_ENABLE(gc-test,
131
[ --enable-gc-test stress-test the garbage collector (for developers)])
132
AC_ARG_ENABLE(demand,
133
[ --enable-demand compile with demand support])
134
AC_ARG_ENABLE(jumptable,
135
[ --disable-jumptable disables the jumptable-based emulator loop],
136
disable_jumptable=yes)
138
[ --enable-mt compile multithreaded engine])
139
AC_ARG_ENABLE(fast-floats,
140
[ --enable-fast-floats compile with single precision floats],
143
[ --enable-ccmpl compile mt engine with concurrent completion])
144
AC_ARG_ENABLE(profiling,
145
[ --enable-profiling force gcc to generate information for profiling])
146
AC_ARG_ENABLE(electric-fence,
147
[ --enable-electric-fence link with the electric fence malloc debugger])
149
if test "${fast_floats}" = "yes" ; then
150
AC_DEFINE(FAST_FLOATS)
153
if test "${with_debug}" = "yes" ; then
157
if test "${with_debugging}" = "yes" ; then
161
if test "${enable_dwarf_debug}" = "yes" ; then
165
if test "${with_dwarf_debug}" = "yes" ; then
167
enable_dwarf_debug=yes
170
if test "${with_wind+set}" = "set" ; then
172
# suppress config tag
176
if test "${enable_mt}" = "yes" -o "${enable_ccmpl}" = "yes" ; then
177
engine_mode="multi-threading"
179
engine_mode="slg-wam"
182
# make sure new files are readable
189
if test -n "$xsb_beta_version" ; then
190
xsb_version=$xsb_major_version.${xsb_minor_version}-b${xsb_beta_version}
192
xsb_version=$xsb_major_version.${xsb_minor_version}
195
xsb_full_version_name="${xsb_version} (${xsb_codename})"
197
AC_DEFINE_UNQUOTED(XSB_VERSION, "${xsb_full_version_name}")
199
release_year=`echo ${xsb_release_date} \
200
| sed 's,^\([[0-9]][[0-9]][[0-9]][[0-9]]\)[[-/.]].*$,\1,'`
201
release_month=`echo ${xsb_release_date} \
202
| sed 's,^[[0-9]]*[[-/.]]\([[0-9]][[0-9]]\)[[-/.]].*$,\1,'`
203
release_day=`echo ${xsb_release_date} \
204
| sed 's,^[[0-9]]*[[-/.]][[0-9]]*[[-/.]]\([[0-9]][[0-9]]\)$,\1,'`
206
if test "$release_year" = "${xsb_release_date}" ; then
207
echo "configure: error:"
208
echo " XSB release date in "$build_dir"/version.sh"
209
echo " is not Y2K compliant!"
210
echo " Please specify the date as yyyy/mm/dd or yyy-mm-dd."
214
elif test "$release_month" = "${xsb_release_date}" ; then
215
echo "configure: error:"
216
echo " XSB release date in "$build_dir"/version.sh"
217
echo " must have the form yyyy/mm/dd, yyyy-mm-dd, or yyyy.mm.dd"
221
elif test "$release_day" = "${xsb_release_date}" ; then
222
echo "configure: error:"
223
echo " XSB release date in "$build_dir"/version.sh must have the form"
224
echo " must have the form yyyy/mm/dd, yyyy-mm-dd, or yyyy.mm.dd"
230
release_month=`echo ${release_month} | sed 's/^0//'`
231
release_day=`echo ${release_day} | sed 's/^0//'`
233
# get the name of the month: is there an easier way in sh?
234
case ${release_month} in
235
1) release_monthname=January ;;
236
2) release_monthname=February ;;
237
3) release_monthname=March ;;
238
4) release_monthname=April ;;
239
5) release_monthname=May ;;
240
6) release_monthname=June ;;
241
7) release_monthname=July ;;
242
8) release_monthname=August ;;
243
9) release_monthname=September ;;
244
10) release_monthname=October ;;
245
11) release_monthname=November ;;
246
12) release_monthname=December ;;
250
AC_DEFINE_UNQUOTED(RELEASE_DATE, ${xsb_release_date})
251
AC_DEFINE_UNQUOTED(RELEASE_YEAR, ${release_year})
252
AC_DEFINE_UNQUOTED(RELEASE_MONTH, ${release_month})
253
AC_DEFINE_UNQUOTED(RELEASE_DAY, ${release_day})
256
# set architecture-dependent directories
257
dnl orig_prefix is used only for site-prefix. It contains the value of
258
dnl prefix given by the user. The prefix variable will later get
259
dnl the <xsb-version> subdirectory added in.
261
if test "$prefix" = "NONE" -o -z "$prefix" ; then
265
dnl strip any trailing slashes in prefix
266
prefix=`echo "${prefix}" | sed 's,\([[^/]]\)/*$,\1,'`
268
prefix="$prefix"/"$xsb_version"
271
if test -n "$enable_debugging" && test -n "$enable_debug" ; then
273
echo "***Both --en/disable-debug and --en/disable-debugging are specified."
274
echo "***Will use the --enable-debug setting."
277
if test -n "$enable_debugging" && test -z "$enable_debug" ; then
278
enable_debug=$enable_debugging
281
dnl Take care of the scheduling strategy
282
xsb_scheduling_strategy=local
283
enable_local_scheduling=yes
285
if test "${enable_batched_sched}" = "yes" || \
286
test "${enable_batched_schedule}" = "yes" || \
287
test "${enable_batched}" = "yes" || \
288
test "${enable_batched_scheduling}" = "yes" ; then
289
enable_local_scheduling=no
292
if test "${enable_local_scheduling}" = "yes"; then
293
AC_DEFINE(LOCAL_EVAL)
294
xsb_scheduling_strategy=local
296
xsb_scheduling_strategy=batched
303
dnl The following is to be used only by developers for GC debugging
306
if test "${with_gc_test}" = "yes" ; then
309
if test "${enable_gc_test}" = "yes" ; then
315
if test "${with_demand}" = "yes" ; then
318
if test "${enable_demand}" = "yes" ; then
323
config_prefix=${topdir}/config
324
install_config_prefix=${prefix}/config
326
if test "$config_tag" != "NONE" -a -n "$config_tag" ; then
327
config_tag="-$config_tag"
330
if test "${with_gcc+set}" = "set" ; then
331
# allow --with-gcc=gcc-name
333
if test "${with_gcc}" = "yes"; then
336
elif test "${with_cc+set}" = "set" ; then
337
# allow --with-cc=compiler on cmd line
339
if test "${with_cc}" = "yes"; then
342
elif test "${with_acc+set}" = "set" ; then
349
dnl If the user didn't specify --config-tag, check maybe -aout, -bits-64,
350
dnl or -dbg are appropriate
351
if test "${config_tag}" = "NONE" ; then
353
dnl add -bits64 to the config tag, if --force64 is set on command line
354
if test -n "$ac_force64" ; then
355
config_tag="${config_tag}-bits64"
357
dnl add -aout to the config tag, if --linuxaout is set on command line
358
if test -n "$ac_linuxaout" ; then
359
config_tag="${config_tag}-aout"
361
dnl add -ss to config tag if compiling for simplescalar
362
if test "${CC}" = "sslittle-na-sstrix-gcc"; then
363
config_tag="${config_tag}-ss"
365
if test "${CC}" = "arm-linux-gcc"; then
366
config_tag="${config_tag}-arm"
368
dnl If debugging, add -dbg
369
if test "${enable_debug}" ; then
370
config_tag="${config_tag}-dbg"
372
dnl If vm-debugging, add -vm
373
if test "${enable_debug_vm}" ; then
374
config_tag="${config_tag}-vm"
376
dnl If verbose debugging, add -vrb
377
if test "${enable_debug_verbose}" ; then
378
config_tag="${config_tag}-vrb"
380
dnl If compiled with assertions, add -asrt
381
if test "${enable_debug_assertions}" ; then
382
config_tag="${config_tag}-asrt"
384
dnl If gc stress test, add -gc
385
if test "${gc_test}" = "yes" ; then
386
config_tag="${config_tag}-gc"
388
dnl If batched scheduling, add -btc
389
if test "${xsb_scheduling_strategy}" = "batched" ; then
390
config_tag="${config_tag}-btc"
392
if test "${enable_mt}" = "yes" ; then
393
config_tag="${config_tag}-mt"
395
if test "${enable_ccmpl}" = "yes" ; then
396
config_tag="${config_tag}-ccmpl"
400
config_tag_sans_dash=`echo ${config_tag} | sed 's/^-//'`
404
echo "Building XSB Version ${xsb_version} (${xsb_codename}) of ${xsb_release_date}"
410
# check for NT configurations
412
win* | *nt*) dnl Windows
413
canonical=x86-pc-windows
419
configuration_templ=xsb_configuration_wind.in
420
config_dot_h_templ=def_config_wind.in
421
echo 'Configuring for host system type... Windows NT/95/98/2000'
424
*) dnl check for unknown OS
425
if test -n "$with_os" ; then
426
echo "OS \`$with_os' is not supported"
430
configuration_templ=xsb_configuration.in
431
config_dot_h_templ=def_config.in
433
dnl Check configuration for a Unix variant
434
if test "$configuration" = "NONE" ; then
436
- You did not tell me what kind of host system you want to configure.
437
- I will attempt to guess the kind of system this is.
441
configuration=$host_alias
443
canonical=`${CONFIG_SHELL-/bin/sh} ./config.sub $configuration 2>&1`
446
if test -n "`echo "$canonical" | sed -e [s/${configuration}//]`" ; then
452
AC_CHECKING(host system type... $canonical)
460
# arch-independent XSB directories
462
syslibdir=${topdir}/syslib
463
cmplibdir=${topdir}/cmplib
465
scriptdir=${topdir}/bin # where the xsb invocationscripts go
466
pkgdir=${topdir}/packages
469
src_prolog_includes=${topdir}/prolog_includes
471
# config-specific stuff
472
full_config_name=${canonical}${config_tag}
473
arch_config_prefix=${config_prefix}/${full_config_name}
475
cache_file="${arch_config_prefix}/config.cache"
477
dnl This is a redefined standard AC_CACHE_LOAD. The standard one is now no-op.
478
dnl We do this so we could place the cache file in the configuration directory.
479
if test -r "$cache_file" -a "$ac_caching" = "yes" ; then
480
echo "loading cache $cache_file"
482
elif test ! -r "$cache_file" ; then
483
echo "creating cache $cache_file"
484
dnl If this fails, the user'll see a msg later that cache file isn't found
485
(test -d $arch_config_prefix || mkdir -p ${arch_config_prefix}) 2> /dev/null
486
./touch.sh $cache_file
487
chmod 644 "$cache_file"
492
# where binary executables go (this is config-specific)
493
arch_bindir=${arch_config_prefix}/bin
495
# where object code goes (we need it only for the source tree)
496
arch_config_objlibdir=${arch_config_prefix}/saved.o
498
# where arch-specific XSB .{P,H,O} files go
499
arch_config_libdir=${arch_config_prefix}/lib
501
arch_config_file=${arch_config_libdir}/xsb_configuration.P
503
# site-specific directories
505
test "$site_prefix" = "NONE" && site_prefix=${orig_prefix}/site
506
# site-specific config-independent XSB libraries
507
site_libdir=${site_prefix}/lib
508
# site-specific config-dependent stuff goes
509
site_config_prefix=${site_prefix}/config/${canonical}
510
# site-specific config-dependent XSB libraries
511
site_config_libdir=${site_config_prefix}/lib
513
# Installation directories: We only check if they exist
514
install_libdir=${prefix}/lib
515
install_syslibdir=${prefix}/syslib
516
install_cmplibdir=${prefix}/cmplib
517
install_emudir=${prefix}/emu
518
install_scriptdir=${prefix}/bin # where the xsb invocation script goes
519
install_builddir=${prefix}/build # where the config detection scripts go
520
install_prolog_includes=${prefix}/prolog_includes
521
install_pkgdir=${prefix}/packages
522
install_pkgxmcdir=${prefix}/packages/xmc
523
install_examples=${prefix}/examples
524
install_etcdir=${prefix}/etc
526
arch_install_config_prefix=${install_config_prefix}/${full_config_name}
527
arch_install_bindir=${arch_install_config_prefix}/bin
528
arch_install_config_libdir=${arch_install_config_prefix}/lib
529
arch_install_objdir=${arch_install_config_prefix}/saved.o
532
dnl When running autoheader, uncoment these 2 lines and comment the next 2.
533
dnl Then move xsb_config.h.in to def_config.in.
534
dnl There probably will be no need to run autoheader any more!
535
dnl AC_CONFIG_HEADER(${arch_config_prefix}/xsb_config.h:def_config.in
536
dnl ${arch_config_prefix}/xsb_debug.h:def_debug.in])
538
AC_CONFIG_HEADER([${arch_config_prefix}/xsb_config.h:${config_dot_h_templ}
539
${arch_config_prefix}/xsb_debug.h:def_debug.in])
542
dnl Find the source directory.
544
if test ! -f "${emudir}/emuloop.h" -o ! -f "${syslibdir}/tables.P" ; then
546
echo " ******* I cannot find XSB sources!!! *******"
547
echo " You must run \`configure' in the directory \`srcDir/build' "
548
echo " where \`srcDir' is the top directory of the XSB source tree."
554
# Test if directories exist
555
echo "Checking installation directories..."
558
# clear out the dir for recording missing directories
559
rm -f .missingdirs.tmp
561
dnl The following must already exist; if not, it doesn't even make sense to try
562
AC_MSG_CHECKING($libdir) && \
563
(test -d $libdir && AC_MSG_RESULT(OK)) \
564
|| (AC_MSG_RESULT(FAILED); \
565
echo "+++Can't find $libdir" >> .missingdirs.tmp)
566
AC_MSG_CHECKING($syslibdir) && \
567
(test -d $syslibdir && AC_MSG_RESULT(OK)) \
568
|| (AC_MSG_RESULT(FAILED); \
569
echo "+++Can't find $syslibdir" >> .missingdirs.tmp)
570
AC_MSG_CHECKING($cmplibdir) && \
571
(test -d $cmplibdir && AC_MSG_RESULT(OK)) \
572
|| (AC_MSG_RESULT(FAILED); \
573
echo "+++Can't find $cmplibdir" >> .missingdirs.tmp)
575
# test if installation should fail
576
test -f .missingdirs.tmp && \
577
(cat .missingdirs.tmp; echo "***Installation failed") && exit 1
580
AC_MSG_CHECKING($scriptdir) && \
581
((test -d $scriptdir || mkdir -p $scriptdir) && AC_MSG_RESULT(OK)) \
582
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $scriptdir" >> .missingdirs.tmp)
584
AC_MSG_CHECKING($arch_bindir) && \
585
((test -d $arch_bindir || mkdir -p $arch_bindir) && AC_MSG_RESULT(OK)) \
586
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_bindir" >> .missingdirs.tmp)
588
AC_MSG_CHECKING($arch_config_libdir) && \
589
((test -d $arch_config_libdir || mkdir -p ${arch_config_libdir}) && AC_MSG_RESULT(OK)) \
590
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_config_libdir" >> .missingdirs.tmp)
592
AC_MSG_CHECKING(${arch_config_objlibdir}) && \
593
((test -d "${arch_config_objlibdir}" || mkdir -p ${arch_config_objlibdir}) && AC_MSG_RESULT(OK)) \
594
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_config_objlibdir" >> .missingdirs.tmp)
596
dnl Checking site directories
597
AC_MSG_CHECKING($site_libdir) && \
598
((test -d $site_libdir || mkdir -p $site_libdir) && AC_MSG_RESULT(OK)) \
599
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $site_libdir" >> .missingdirs.tmp)
601
AC_MSG_CHECKING($site_config_libdir) && \
602
((test -d $site_config_libdir || mkdir -p $site_config_libdir) && AC_MSG_RESULT(OK)) \
603
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $site_config_libdir" >> .missingdirs.tmp)
605
dnl Checking installation directories
606
AC_MSG_CHECKING($install_emudir) && \
607
((test -d $install_emudir || mkdir -p $install_emudir) && AC_MSG_RESULT(OK)) \
608
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_emudir" >> .missingdirs.tmp)
610
AC_MSG_CHECKING($install_libdir) && \
611
((test -d $install_libdir || mkdir -p $install_libdir) && AC_MSG_RESULT(OK)) \
612
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_libdir" >> .missingdirs.tmp)
614
AC_MSG_CHECKING($install_syslibdir) && \
615
((test -d $install_syslibdir || mkdir -p $install_syslibdir) && AC_MSG_RESULT(OK)) \
616
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_syslibdir" >> .missingdirs.tmp)
618
AC_MSG_CHECKING($install_cmplibdir) && \
619
((test -d $install_cmplibdir || mkdir -p $install_cmplibdir) && AC_MSG_RESULT(OK)) \
620
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_cmplibdir" >> .missingdirs.tmp)
622
AC_MSG_CHECKING($install_scriptdir) && \
623
((test -d $install_scriptdir || mkdir -p $install_scriptdir) && AC_MSG_RESULT(OK)) \
624
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_scriptdir" >> .missingdirs.tmp)
626
AC_MSG_CHECKING($install_builddir) && \
627
((test -d $install_builddir || mkdir -p $install_builddir) && AC_MSG_RESULT(OK)) \
628
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_builddir" >> .missingdirs.tmp)
630
AC_MSG_CHECKING($arch_install_bindir) && \
631
((test -d $arch_install_bindir || mkdir -p $arch_install_bindir) && AC_MSG_RESULT(OK)) \
632
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_install_bindir" >> .missingdirs.tmp)
634
AC_MSG_CHECKING($arch_install_config_libdir) && \
635
((test -d $arch_install_config_libdir || mkdir -p ${arch_install_config_libdir}) && AC_MSG_RESULT(OK)) \
636
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_install_config_libdir" >> .missingdirs.tmp)
638
AC_MSG_CHECKING($arch_install_objdir) && \
639
((test -d $arch_install_objdir || mkdir -p ${arch_install_objdir}) && AC_MSG_RESULT(OK)) \
640
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $arch_install_objdir" >> .missingdirs.tmp)
642
AC_MSG_CHECKING($install_etcdir) && \
643
((test -d $install_etcdir || mkdir -p ${install_etcdir}) && AC_MSG_RESULT(OK)) \
644
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_etcdir" >> .missingdirs.tmp)
646
AC_MSG_CHECKING($install_pkgdir) && \
647
((test -d $install_pkgdir || mkdir -p ${install_pkgdir}) && AC_MSG_RESULT(OK)) \
648
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_pkgdir" >> .missingdirs.tmp)
650
AC_MSG_CHECKING($install_pkgxmcdir) && \
651
((test -d $install_pkgxmcdir || mkdir ${install_pkgxmcdir}) && AC_MSG_RESULT(OK)) \
652
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_pkgxmcdir" >> .missingdirs.tmp)
654
AC_MSG_CHECKING($install_examples) && \
655
((test -d $install_examples || mkdir -p ${install_examples}) && AC_MSG_RESULT(OK)) \
656
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create: $install_examples" >> .missingdirs.tmp)
658
AC_MSG_CHECKING($install_prolog_includes) && \
659
((test -d $install_prolog_includes || mkdir -p ${install_prolog_includes}) && AC_MSG_RESULT(OK)) \
660
|| (AC_MSG_RESULT(FAILED); echo "+++Can't create $install_prolog_includes" >> .missingdirs.tmp)
662
test -f .missingdirs.tmp && \
663
(cat .missingdirs.tmp; \
664
echo "***Make the above directories manually and rerun configure") \
669
# installation failed
670
test -f .missingdirs.tmp && exit 1
672
echo "Checking installation directories ... Done"
678
dnl If on AIX, define _ALL_SOURCE, which allows the use of some BSD functions
679
dnl This must be AFTER AC_PROG_CC
682
AC_CHECK_PROG(has_gcc, gcc, "yes", "no")
684
AC_MSG_CHECKING(whether we are using SunPro C)
685
AC_TRY_COMPILE([],[#ifndef __SUNPRO_C
686
#error Not a SunPro compiler :-(
687
******* ======= ******** &&&&&&&&
689
], __sunpro_c=yes, __sunpro_c=no)
690
AC_MSG_RESULT($__sunpro_c)
693
dnl set some basic flags
694
# if --with-gcc, take it as a sign of trouble
695
# with gcc and lower optimization levels
696
if test -n "$with_gcc" ; then
697
if test "${CC}" = "sslittle-na-sstrix-gcc" ; then
698
emuloop_opt_level=-${optimization_level-"O1"}
699
trutils_opt_level=-${optimization_level-"O1"}
700
builtins_opt_level=-${optimization_level-"O1"}
701
loader_opt_level=-${optimization_level-"O1"}
705
emuloop_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
706
trutils_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
707
builtins_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
708
loader_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
710
CFLAGS="-Wall -pipe -ansi -pedantic"
714
gcc) emuloop_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
715
trutils_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
716
builtins_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
717
loader_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
719
CFLAGS="-Wall -pipe -ansi -pedantic"
721
cc) if test "$__sunpro_c" = "no"; then
722
emuloop_opt_level=-${optimization_level-"O4"}
723
trutils_opt_level=-${optimization_level-"O4"}
724
builtins_opt_level=-${optimization_level-"O4"}
725
loader_opt_level=-${optimization_level-"O4"}
727
# emuloop_opt_level is the optimization level for emuloop.c
728
# Using xO4 would take SunPro more than an hour, hence xO2.
729
emuloop_opt_level=-${optimization_level-"xO2"}
730
trutils_opt_level=-${optimization_level-"xO4"}
731
builtins_opt_level=-${optimization_level-"xO4"}
732
loader_opt_level=-${optimization_level-"xO4"}
738
acc) # acc also seems to choke on high optimization levels for emuloop.c
739
emuloop_opt_level=-${optimization_level-"O2"}
740
trutils_opt_level=-${optimization_level-"O4"}
741
builtins_opt_level=-${optimization_level-"O4"}
742
loader_opt_level=-${optimization_level-"O4"}
751
dnl In XSB, CC is the C compiler to be used with the C interface
752
dnl Could be different from C compiler with which XSB was compiled,
753
dnl if it was done with a cross-compiler.
754
AC_DEFINE_UNQUOTED(CC, "${CC}")
756
dnl Set up the additional libraries
760
dnl --site-static-libraries (multiple dirs)
761
if test -n "$site_static_libraries"; then
762
echo " Adding static libraries to loader flags:"
763
for arg in $site_static_libraries; do
765
dnl If it is a loader option, just pass it on, don't add -L
767
dnl strip trailing slashes
768
* ) arg=`echo "-L${arg}" | sed 's,\([[^/]]\)/*$,\1,'` ;;
770
ld_site_libraries="${ld_site_libraries} $arg"
775
dnl --site-includes (multiple dirs)
776
if test -n "$site_includes"; then
777
echo " Appending directories to the C include path:"
778
for arg in $site_includes; do
779
arg=`echo "-I${arg}" | sed 's,\([[^/]]\)/*$,\1,'`
780
c_site_includes="${c_site_includes} $arg"
785
dnl --with-libwww=DIR
786
if test -n "$with_libwww" && test -d $topdir/packages/libwww; then
787
cd $topdir/packages/libwww
788
echo "***Configuring Libwww"
789
./configure --with-config="$canonical" --with-libwww="$with_libwww" > /dev/null
793
if test -n "$with_xpath" && test -d $topdir/packages/xpath; then
794
cd $topdir/packages/xpath
795
echo "***Configuring XPath"
796
./configure --prefix="$with_xpath" > /dev/null
800
if test -n "${with_dbdrivers}" && test -d $topdir/packages/dbdrivers; then
801
cd $topdir/packages/dbdrivers
802
echo "***Configuring DB drivers"
803
./run_configure_scripts --with-odbc-libdir="$with_odbc_libdir" \
804
--with-odbc-incdir="$with_odbc_incdir" \
805
--with-mysql-libdir="$with_mysql_libdir" \
806
--with-mysql-incdir="$with_mysql_incdir" \
812
dnl check for Make feature
815
# Check if 64 bit machine
817
dnl We use 4 in AC_CHECK_SIZEOF, below, as the size for cross-compiling,
818
dnl even though we aren't cross-compiling.
819
dnl This is done in order to get rid of a warning:
820
dnl AC_TRY_RUN called without default to allow cross compiling
821
dnl This warning is really a buglet in the AC_CHECK_SIZEOF macro:
822
dnl it invokes AC_TRY_RUN without specifying an action for cross-compilation,
823
dnl if the second arg to AC_CHECK_SIZEOF is not given.
824
AC_CHECK_SIZEOF(long,4)
825
if test "${ac_cv_sizeof_long}" = 8 -o "$ac_force64" = "yes" ; then
829
echo " Configuring XSB for a 64 bit machine"
833
if test "${ac_cv_sizeof_long}" = 0; then
835
echo "*** PANIC!!! Configure tests are not working - compiler $CC is broken!"
836
echo "*** $CC says that sizeof(long)=0 !!!"
837
echo "*** Please check config.log for compilation errors and use a different compiler."
843
# A series of checks for essential libraries.
844
AC_CHECK_LIB(m, main,, have_errors=yes)
845
test -n "$have_errors" && AC_MSG_ERROR(Your system is missing library: \`m')
847
AC_CHECK_LIB(dl, main,, have_dl=no)
848
AC_CHECK_LIB(nsl, main, , have_nsl=no)
849
AC_CHECK_LIB(pthread, main, , have_pthread=no)
850
AC_CHECK_LIB(socket, main,, have_socket=no)
852
AC_CHECK_LIB(readline, readline, have_readline=yes)
853
if test "$have_readline" = yes ; then
854
AC_DEFINE(HAVE_READLINE)
858
AC_CHECK_HEADERS(stdarg.h, , have_errors=yes)
859
test "${have_errors}" = "yes" &&
860
AC_MSG_ERROR([Your C compiler is not ANSI compliant: stdarg.h is missing!])
862
# Checks for header files
864
dnl Note, under NT, we sould include time.h instead
865
AC_CHECK_HEADERS(sys/time.h)
867
dnl defines TIME_WITH_SYS_TIME if both allowed
870
AC_CHECK_HEADERS(sys/resource.h, , have_errors=yes)
871
test "${have_errors}" = "yes" &&
872
AC_MSG_ERROR([sys/resource.h is missing on your system])
874
AC_CHECK_FUNCS(malloc, have_malloc=yes,have_malloc=no)
875
test "${have_malloc}" = "no" &&
876
AC_MSG_ERROR([malloc() is missing on your system])
878
AC_CHECK_HEADERS(unistd.h string.h stdlib.h, , have_errors=yes)
879
test "${have_errors}" = "yes" &&
880
AC_MSG_ERROR([One of these header files is missing on your system:
884
# Checks for typedefs, structures, and compiler characteristics.
887
dnl Check for functions that are in standard libraries.
888
dnl Functions that aren't in standard libraries should be checked after
889
dnl their corresponding libraries are AC_CHECK_LIB'ed.
891
AC_CHECK_FUNCS(strdup mkdir, , have_errors="yes")
892
test "${have_errors}" = "yes" && \
893
AC_MSG_ERROR([One of these functions is missing on your system:
897
dnl defines HAVE_GETHOSTBYNAME, HAVE_GETTIMEOFDAY, HAVE_SOCKET,
898
dnl and HAVE_SNPRINTF if avail
899
AC_CHECK_FUNCS(gethostbyname gettimeofday socket snprintf)
901
AC_CHECK_FUNCS(regexec regerror regcomp, regmatch_support="yes", regmatch_support="no")
902
AC_CHECK_FUNCS(fnmatch glob globfree, wildmatch_support="yes", wildmatch_support="no")
905
AC_CHECK_FUNCS(execvp)
907
dnl Checking for libraries that are NOT in standard places,
908
dnl so they require --site-libraries
909
LIBS="${ld_site_libraries} ${LIBS}"
912
if test "${enable_oracle_debug+yes}" = "yes" || \
913
test "${enable_oracle_debugging+yes}" = "yes"; then
914
AC_DEFINE(ORACLE_DEBUG)
919
if test "${with_oracle+set}" = "set" ; then
924
#if test "${with_oracle+set}" = "set" ; then
925
# if test -n "$with_os" ; then
929
# Building for $with_os with Oracle support.
930
# You must ensure that all the necessary Oracle libraries
931
# are installed on the target machine.
938
# Checking whether XSB can be compiled with Oracle support.
939
# If this fails, you will have to use the --site-libraries option
940
# of \`configure' to specify the directory where Oracle libraries live.
944
# dnl If any library here is missing, set oracle_error
945
# dnl `thread' is a standard library. The others come from Oracle.
946
# dnl Therefore, must use --site-libraries
947
# AC_CHECK_LIB(thread, main, , oracle_error=yes)
949
# AC_CHECK_LIB(c3v6, main, , oracle_error=yes)
950
# AC_CHECK_LIB(client, main, , oracle_error=yes)
951
# AC_CHECK_LIB(clntsh, main, , oracle_error=yes)
952
# AC_CHECK_LIB(common, main, , oracle_error=yes)
953
# AC_CHECK_LIB(core, main, , oracle_error=yes)
954
# AC_CHECK_LIB(core3, main, , oracle_error=yes)
956
# AC_CHECK_LIB(epc, main, , oracle_error=yes)
957
# AC_CHECK_LIB(generic, main, , oracle_error=yes)
958
# AC_CHECK_LIB(nlsrtl, main, , oracle_error=yes)
959
# AC_CHECK_LIB(nlsrtl3, main, , oracle_error=yes)
961
# AC_CHECK_LIB(sql, main, , oracle_error=yes)
962
# AC_CHECK_LIB(sqlnet, main, , oracle_error=yes)
963
# AC_CHECK_LIB(cv6, main, , oracle_error=yes)
964
# AC_CHECK_LIB(ncr, main, , oracle_error=yes)
966
# dnl If oracle_error=yes, give up on oracle
967
# if test "$oracle_error" = "yes" ; then
969
# AC_MSG_WARN([ ****Your system is missing a library that Oracle needs
970
# ****XSB will be built WITHOUT the Oracle support])
978
# Building with support for Oracle
989
if test "${with_odbc+set}" = "set"; then
990
if test -n "$with_os" ; then
992
# AC_DEFINE(XSB_ODBC)
995
# Building for $with_os with support for ODBC.
996
# You must ensure that the requisite ODBC libraries
997
# are installed on the target machine.
1004
# Checking whether XSB can be built with ODBC support.
1005
# If this fails, you will have to use the --site-includes option
1006
# of \`configure' to tell where the ODBC .h files live and,
1007
# possibly, the --site-libraries option to specify the directory
1008
# where ODBC libraries live.
1011
# dnl Here we provide additional directories to check headers in
1012
# dnl AC_CHECK_HEADERS uses CPPFLAGS to find the include path.
1013
# dnl Since these aren't standard headers, we must use --site-includes
1014
# saved_cpp_flags="${CPPFLAGS}"
1015
# CPPFLAGS="${c_site_includes} ${CPPFLAGS}"
1016
# AC_CHECK_HEADERS(odbcinst.h SQL.H SQLEXT.H windows.h, \
1017
# with_odbc=yes, odbc_error=yes)
1018
# if test "$odbc_error" = "yes"; then
1020
# AC_MSG_WARN([ ****Your system is missing a .h file required for ODBC support
1021
# ****XSB will be built WITHOUT ODBC support])
1026
# AC_DEFINE(XSB_ODBC)
1029
Building with support for ODBC
1033
# dnl restore CPPFLAGS
1034
# CPPFLAGS="${saved_cpp_flags}"
1036
ODBCSRC="odbc_xsb.c"
1037
ODBCOBJ="odbc_xsb.o"
1042
if test "${with_odbc+set}" = "set"; then
1050
if test "${with_interprolog+set}" = "set"; then
1051
AC_DEFINE(XSB_INTERPROLOG)
1052
with_interprolog=yes
1053
INTERPROLOGSRC="interprolog_callback.c"
1054
INTERPROLOGOBJ="interprolog_callback.o"
1055
dnl also needed to pass jni include file locations
1056
dnl to windows make file through site-includes
1060
win_ld_site_libraries=
1062
if test "$with_os" = wind ; then
1063
dnl --site-includes (multiple dirs)
1065
if test -n "$site_includes"; then
1066
echo " Appending directories to the C library path:"
1067
for arg in $site_includes; do
1068
arg=`echo "/I\"${arg}\"" | sed 's,\([[^/]]\)/*$,\1,'`
1069
win_site_includes="${win_site_includes} $arg"
1074
dnl --site-static-libraries (multiple dirs)
1075
if test -n "$site_static_libraries"; then
1076
echo " Appending directories to the C include path:"
1077
for arg in $site_static_libraries; do
1078
arg=`echo "/LIBPATH:\"${arg}\"" | sed 's,\([[^/]]\)/*$,\1,'`
1079
win_ld_site_libraries="${win_ld_site_libraries} $arg"
1084
if test "${enable_mt}" = "yes" -o "${enable_ccmpl}" = "yes" ; then
1085
win_ld_site_libraries="pthreadVC1.lib ${win_ld_site_libraries}"
1089
AC_CHECK_PROG(perl_support, perl, "yes", "no")
1091
if test "${perl_support}" = "yes"; then
1092
#old versions of perl don't have Config module
1093
# so we check for this as well
1094
perl_archlib=`perl -MConfig -e 'print $Config{archlib}'` || perl_support=no
1097
if test "${perl_support}" = "yes"; then
1098
perl_cc_compiler=`perl -MConfig -e 'print $Config{cc}'`
1099
perl_ccflags=`perl -MConfig -e 'print $Config{ccflags}'`
1100
perl_libs=`perl -MConfig -e 'print $Config{libs}'`
1102
# Perl base revision comes out as 5.0, so we strip .0
1103
perl_baserev=`perl -MConfig -e 'print "$Config{baserev}\n"' | sed -e 's/\..*//'`
1104
perl_patchlevel=`perl -MConfig -e 'print $Config{patchlevel}'`
1106
# perl support doesn't work with perl < 5.004
1107
if test $[perl_baserev] -lt 5 ; then
1111
if test "$perl_baserev" = "5" -a $[perl_patchlevel] -lt 4 ; then
1116
if test "`echo $perl_libs | sed 's/-lgdbm//'`" != "$perl_libs"; then
1117
AC_CHECK_LIB(gdbm, main,, perl_support=no)
1120
if test "`echo $perl_libs | sed 's/-lndbm//'`" != "$perl_libs"; then
1121
AC_CHECK_LIB(ndbm, main,, perl_support=no)
1124
# Need to re-state the trap since configure resets it occasionally
1125
trap 'rm buildxsb.lock; exit 1' 1 2 3 15
1127
AC_SUBST(regmatch_support)
1128
AC_SUBST(wildmatch_support)
1130
AC_SUBST(perl_archlib)
1131
AC_SUBST(perl_cc_compiler)
1132
AC_SUBST(perl_ccflags)
1137
AC_CHECK_PROG(java_support, javac, "yes", "no")
1138
if test "${java_support}" = "yes"; then
1139
dnl after AC_CHECK_PROG, ac_dir holds the directory where javac is found
1140
javac="$ac_dir"/javac
1146
AC_SUBST(java_support)
1148
AC_PATH_PROG(java_path,javac,no)
1149
java_path=`dirname $java_path`
1150
java_path=`dirname $java_path`
1151
java_path=$java_path/include
1152
#java_path=`echo $java_path | sed 's,bin/javac,include,' `
1154
if test "${with_interprolog}" = "yes"; then
1155
if test "${java_support}" != "yes"; then
1156
echo "Interprolog not supported due to failure to find Java"
1159
JAVA_PLATFORM_HEADER_PATH=""
1161
JAVA_HEADER_PATH=${java_path}
1162
JAVA_PLATFORM_HEADER_PATH=`ls ${JAVA_HEADER_PATH}/*/jni_md.h`
1163
JAVA_PLATFORM_HEADER_PATH="${JAVA_PLATFORM_HEADER_PATH%jni_md.h}"
1164
echo "Obtaining Java header files form ${JAVA_HEADER_PATH} and ${JAVA_PLATFORM_HEADER_PATH}"
1171
AC_SUBST(JAVA_HEADER_PATH)
1172
AC_SUBST(JAVA_PLATFORM_HEADER_PATH)
1174
# profiling implies debug
1175
if test "${enable_profile}" = "yes"; then
1181
if test "${enable_debug}" = "yes"; then
1182
AC_DEFINE(NON_OPT_COMPILE)
1184
dnl AC_DEFINE(CP_DEBUG)
1188
if test "${enable_debug_verbose}" = "yes"; then
1189
AC_DEFINE(DEBUG_VERBOSE)
1192
if test "${enable_debug_vm}" = "yes"; then
1196
if test "${enable_debug_assertions}" = "yes"; then
1197
AC_DEFINE(DEBUG_ASSERTIONS)
1203
if test "${CC}" = "gcc" -o "${with_gcc+set}" = "set"; then
1204
if test "${disable_jumptable}" != "yes"; then
1205
AC_DEFINE(JUMPTABLE_EMULOOP)
1207
CFLAGS=`echo ${CFLAGS} | sed -e "s/-ansi//"`
1208
CFLAGS=`echo ${CFLAGS} | sed -e "s/-pedantic//"`
1212
AC_DEFINE(INSN_BLOCKS)
1214
#AC_ARG_ENABLE(insn-blocks,
1215
#[ --enable-insn-blocks Make temp variables local to wam insns])
1217
#if test "${enable_insn_blocks}" = "yes" ; then
1218
# AC_DEFINE(INSN_BLOCKS)
1222
if test "${enable_mt}" = "yes" -o "${enable_ccmpl}" = "yes" ; then
1223
AC_DEFINE(MULTI_THREAD)
1225
if test "${host_os}" = "cygwin"; then
1226
LDFLAGS="${LDFLAGS} -lpthreadVSE1"
1228
if test "$with_os" != wind ; then
1229
LDFLAGS="${LDFLAGS} -lpthread"
1233
CFLAGS="${CFLAGS} -D_GNU_SOURCE"
1236
if test "${enable_ccmpl}" = "yes" ; then
1237
AC_DEFINE(CONC_COMPL)
1240
if test "${enable_mt}" = "yes" ; then
1241
AC_DEFINE(SHARED_COMPL_TABLES)
1244
if test "${with_profiling}" = "yes" ; then
1245
enable_profiling=yes
1247
if test "${enable_profiling}" = "yes" ; then
1248
CFLAGS="-pg -ggdb -a ${CFLAGS}"
1249
LDFLAGS="-pg ${LDFLAGS}"
1252
if test "${with_electric_fence}" = "yes" ; then
1253
enable_electric_fence=yes
1255
if test "${enable_electric_fence}" = "yes" ; then
1256
echo "enabling electric fence..."
1257
LDFLAGS="${LDFLAGS} -lefence"
1258
AC_DEFINE(ELECTRIC_FENCE)
1261
dnl Check for Incr Tcl (used in the XMC gui)
1263
AC_PATH_PROG(itkwish_path, itkwish, no, $PATH:$with_itkwish)
1264
if test "${itkwish_path}" = "no"; then
1265
echo "XMC GUI not supported due to failure to find Incr Tcl/Tk"
1268
AC_SUBST(itkwish_path)
1270
dnl experimental: use bp register for lpcreg
1272
#AC_ARG_ENABLE(bp-lpcreg,
1273
#[ --enable-bp-lpcreg put local pcreg into BP register on x86s])
1275
#if test "${enable_bp_lpcreg}" = "yes" ; then
1276
# bp_free=`echo ${emuloop_opt_level} | \
1277
# sed 's/.*\(-fomit-frame-pointer\).*/yes/'`
1278
# if test "${bp_free}" = "yes" ; then
1279
# AC_DEFINE(USE_BP_LPCREG)
1281
# AC_MSG_ERROR(Cannot use BP without -fomit-frame-pointer)
1286
# Normally, the optimization level will be O4.
1287
# SGI64 must have O1 and 32 bit SGI's can have O2
1288
if test "$__sunpro_c" = "no"; then
1289
if test "$CC" = "gcc" ; then
1290
c_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
1292
c_opt_level=-${optimization_level-"O4"}
1295
c_opt_level=-${optimization_level-"xO4"}
1299
####### Test for -export-dynamic option of ld
1300
TEMP_LDFLAGS=$LDFLAGS
1301
LDFLAGS="-Wl,-export-dynamic"
1302
AC_MSG_CHECKING(whether loader understands -Wl,-export-dynamic)
1303
AC_TRY_LINK([],[], __export_dynamic=yes, __export_dynamic=no)
1304
AC_MSG_RESULT($__export_dynamic)
1305
LDFLAGS=$TEMP_LDFLAGS
1306
####### End of test for -export-dynamic option of ld
1308
if test "${enable_no_cygwin}" != "yes" -o \( "${host_os}" != "cygwin" -a "${host_os}" != "windows" \); then
1309
LDFLAGS="$LDFLAGS -lm"
1313
# these are used to set up the xsbdynmod parameters under Unixes and MacOS X
1314
DYNMOD_LINKFLAGS=-shared
1315
DYNMOD_SHAREDLIB_EXTENSION=so
1317
# Set OS-specific variables for XSB
1318
case "$canonical" in
1319
*alpha*) AC_DEFINE(FOREIGN_ELF)
1321
*hpux*) AC_DEFINE(HP700)
1322
AC_DEFINE(_HPUX_SOURCE)
1324
*linux*) AC_DEFINE(LINUX)
1325
AC_DEFINE(_GNU_SOURCE)
1327
if test "`uname -r | cut -d "." -f "1 2"`" = "2.6"; then
1328
echo "Guessing the tagging for this version of Linux"
1329
AC_DEFINE(GENERAL_TAGGING)
1332
case "${canonical}" in
1333
*ppc* | *powerpc* | *m68k* ) AC_DEFINE(MKLINUX_PPC)
1337
if test "${ac_linuxaout+set}" = "set" ; then
1338
AC_DEFINE(LINUX_AOUT)
1341
AC_DEFINE(LINUX_ELF)
1342
# if test "${CC}" = "gcc" -o "${with_gcc+set}" = "set"; then
1343
# CFLAGS="-m486 ${CFLAGS}"
1344
# AC_DEFINE(USE_BP_LPCREG)
1347
if test "${have_dl}" != "no" ; then
1348
AC_DEFINE(FOREIGN_ELF)
1349
LDFLAGS="${LDFLAGS} -ldl"
1351
if test "$__export_dynamic" = "yes" ; then
1352
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1356
if test "${have_pthread}" != "no" ; then
1357
LDFLAGS="${LDFLAGS} -lpthread"
1363
*freebsd* ) AC_DEFINE(FREEBSD)
1364
AC_DEFINE(FOREIGN_ELF)
1365
if test "$__export_dynamic" = "yes" ; then
1366
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1369
if test "${have_dl}" = yes ; then
1370
LDFLAGS="${LDFLAGS} -ldl"
1373
if test "${have_pthread}" != "no" ; then
1374
LDFLAGS="${LDFLAGS} -lpthread"
1377
*-rhapsody* | *-darwin* )
1378
CFLAGS="-faltivec -fPIC ${CFLAGS} "
1380
AC_DEFINE(FOREIGN_ELF)
1381
DYNMOD_LINKFLAGS="-dynamiclib -single_module -nostartfiles"
1382
DYNMOD_SHAREDLIB_EXTENSION=jnilib
1384
*sgi* ) AC_DEFINE(FOREIGN_ELF)
1385
if test "${machine64bit}" = yes ; then
1387
c_opt_level=-${optimization_level-"O1"}
1388
emuloop_opt_level=-${optimization_level-"O1"}
1389
trutils_opt_level=-${optimization_level-"O1"}
1390
builtins_opt_level=-${optimization_level-"O1"}
1391
loader_opt_level=-${optimization_level-"O1"}
1393
if test ! "$CC" = gcc ; then
1394
CFLAGS="${CFLAGS} -64 -OPT:Olimit=9500"
1401
c_opt_level=-${optimization_level-"O2"}
1402
emuloop_opt_level=-${optimization_level-"O2"}
1403
trutils_opt_level=-${optimization_level-"O2"}
1404
builtins_opt_level=-${optimization_level-"O2"}
1405
loader_opt_level=-${optimization_level-"O1"}
1407
if test ! "$CC" = gcc ; then
1408
CFLAGS="${CFLAGS} -OPT:Olimit=7500"
1409
GPPCFLAGS="-OPT:Olimit=7500"
1412
trutils_opt_level=${c_opt_level}
1414
*-solaris* | *-sunos5* )
1416
LDFLAGS="${LDFLAGS} -lnsl -ldl"
1418
if test "${have_dl}" = "no" ; then
1419
AC_MSG_ERROR(Your system is missing library: \`dl')
1421
if test "${have_nsl}" = "no" ; then
1422
AC_MSG_ERROR(Your system is missing library: \`nsl')
1425
if test "${have_pthread}" != "no" ; then
1426
LDFLAGS="${LDFLAGS} -lpthread"
1430
AC_DEFINE(FOREIGN_ELF)
1432
case "${canonical}" in
1433
*i*86-*-*) AC_DEFINE(SOLARIS_x86)
1439
LDFLAGS="-lsocket ${LDFLAGS}"
1440
if test "$__export_dynamic" = "yes" ; then
1441
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1443
if test "${have_socket}" = "no" ; then
1444
AC_MSG_ERROR(Your system is missing library: \`socket')
1447
*-aix*) AC_DEFINE(IBM)
1449
*-sunos4*) AC_DEFINE(SUN)
1450
AC_DEFINE(FOREIGN_AOUT)
1451
CFLAGS="${CFLAGS} -DBIG_MEM"
1452
LDFLAGS="${LDFLAGS} -N"
1454
*-cygwin*) AC_DEFINE(CYGWIN)
1457
builtins_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
1458
loader_opt_level=-${optimization_level-"O3 -fno-strict-aliasing"}
1460
if test "${enable_no_cygwin}" = "yes"; then
1461
echo 'Configuring for host system type... no-cygwin'
1467
configuration_templ=xsb_configuration.in
1468
config_dot_h_templ=def_config_mnoc.in
1469
GPPWNTFLAG="-D WIN_NT"
1471
# if test "${xsb_scheduling_strategy}" = "local" ; then
1472
# emuloop_opt_level=-${optimization_level-"O1 -fomit-frame-pointer"}
1475
LDFLAGS="$LDFLAGS -lwsock32 -luser32"
1480
if test "${general_tagging}" = "yes" ; then
1481
AC_DEFINE(GENERAL_TAGGING)
1484
AC_SUBST(DYNMOD_SHAREDLIB_EXTENSION)
1485
AC_SUBST(DYNMOD_LINKFLAGS)
1488
case "$canonical" in
1489
*mips*) AC_DEFINE(MIPS_BASED)
1493
dnl Let autoconf take care of the "inline" and "const" keywords.
1494
if test -z "$with_os" ; then
1495
dnl test for inlining only on Unix
1496
dnl hard-set it in xsb_config.h on windows
1500
# Don't optimize and inline if debugging!!
1501
if test "${do_debugging}" = "yes" -o "${disable_optimization}" = "yes" ; then
1509
if test "${do_debugging}" = "yes" ; then
1510
if test "${enable_dwarf_debug}" = "yes" ; then
1511
CFLAGS="${CFLAGS} -gdwarf-2 -g3"
1513
CFLAGS="${CFLAGS} -g"
1514
LDFLAGS=" -g ${LDFLAGS}"
1515
LINKFLAGS=" -g ${LINKFLAGS}"
1519
if test "${CC}" = "gcc" -a "${host_os}" != "windows" ; then
1520
dnl gcc is smarter when creating dynamic libraries in Unix
1522
LINKFLAGS="-nodefaultlibs -nostartfiles ${LINKFLAGS}"
1527
dnl special flags for simplescalar
1528
if test "${CC}" = "sslittle-na-sstrix-gcc"; then
1529
AC_DEFINE(SIMPLESCALAR)
1530
CROSS_SIMULATOR="sim-fast"
1531
c_opt_level=-${optimization_level-"O1"}
1532
LD=sslittle-na-sstrix-ld
1535
if test "${CC}" = "arm-linux-gcc"; then
1539
#dnl Prepend Oracle tricky library list
1540
#if test "${with_oracle}" = yes ; then
1541
# LDFLAGS="-lclntsh -lsql -lsqlnet -lncr \
1542
# -lsqlnet -lclient -lcommon -lgeneric -lsqlnet \
1543
# -lncr -lsqlnet -lclient -lcommon -lgeneric \
1544
# -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 \
1545
# -lnlsrtl3 -lsocket -lnsl -lm -ldl -lm -lthread \
1550
if test "${with_odbc}" = yes ; then
1551
case "$canonical" in
1552
*-cygwin*) LDFLAGS="-lodbc32 ${LDFLAGS}"
1553
LINKFLAGS="-lodbc32 ${LINKFLAGS}"
1555
*) if test -n "${with_iodbc}"; then
1556
LDFLAGS="-liodbc ${LDFLAGS}"
1557
LINKFLAGS="-liodbc ${LINKFLAGS}"
1559
LDFLAGS="-lodbc ${LDFLAGS}"
1560
LINKFLAGS="-lodbc ${LINKFLAGS}"
1565
# this is needed for -mno-cygwin dll compilation
1568
if test "${enable_no_cygwin}" = "yes" -a "${real_host_os}" = "cygwin"; then
1569
CC="${CC} -mno-cygwin"
1573
#These are used to compile the interface with sModels
1574
if test "x${with_smodels}" = "x"; then
1575
echo " Not using SMODELS"
1580
if test "$os_type" = "windows"; then
1581
XASPLIBNAME=xasppkg.dll
1582
XASPDEFFILE=xasppkg.def
1583
smoCFLAGS="-I${arch_config_prefix} -I${with_smodels}"
1584
smoLDFLAGS="-L${arch_config_prefix}/bin -L${with_smodels}"
1585
smoLIB="-lsmodels -lxsb"
1586
if test "${enable_no_cygwin}" = "yes"; then
1587
CXX="${CXX} -mno-cygwin"
1590
XASPLIBNAME=xasppkg.so
1592
smoCFLAGS="-I${arch_config_prefix} -I${with_smodels}"
1593
smoLDFLAGS="-L${arch_config_prefix}/bin"
1594
smoLIB="${with_smodels}/.libs/libsmodels.a"
1597
AC_SUBST(XASPLIBNAME)
1598
AC_SUBST(XASPDEFFILE)
1600
AC_SUBST(smoLDFLAGS)
1604
AC_SUBST(with_smodels)
1605
AC_SUBST(smodels_goal)
1608
loaderCFLAGS="${c_site_includes} ${loader_opt_level} ${c_inline_level} ${CFLAGS}"
1609
builtinsCFLAGS="${c_site_includes} ${builtins_opt_level} ${c_inline_level} ${CFLAGS}"
1610
emuloopCFLAGS="${c_site_includes} ${emuloop_opt_level} ${c_inline_level} ${CFLAGS}"
1611
trutilsCFLAGS="${c_site_includes} ${trutils_opt_level} ${c_inline_level} ${CFLAGS}"
1612
dnl Set CFLAGS **after** emuloopCFLAGS, trutilsCFLAGS
1613
CFLAGS="${c_site_includes} ${c_opt_level} ${c_inline_level} ${CFLAGS}"
1614
LDFLAGS="${ld_site_libraries} ${LDFLAGS}"
1617
os_version=`echo $host_os | sed -e 's/[[^0-9]]*//'`
1618
os_type=`echo $host_os | sed -e 's/[[0-9]].*$//'`
1620
dnl Some more #define symbols
1621
AC_DEFINE_UNQUOTED(CONFIGURATION, "${canonical}")
1622
AC_DEFINE_UNQUOTED(FULL_CONFIG_NAME, "${full_config_name}")
1624
if test "${enable_profile+yes}" = "yes"; then
1625
compile_mode=profile
1626
elif test "${enable_debug+yes}" = "yes"; then
1628
elif test "$disable_optimization" = "yes"; then
1631
compile_mode=optimal
1634
### Specify what will be substituted into Makefile, xsb_config.h, etc.
1635
AC_SUBST(xsb_version)
1637
AC_SUBST(full_config_name)
1642
AC_SUBST(CROSS_SIMULATOR)
1645
AC_SUBST(arch_config_prefix)
1646
AC_SUBST(arch_install_config_prefix)
1647
AC_SUBST(arch_config_file)
1648
AC_SUBST(config_tag)
1650
AC_SUBST(arch_bindir)
1653
AC_SUBST(loaderCFLAGS)
1654
AC_SUBST(builtinsCFLAGS)
1655
AC_SUBST(emuloopCFLAGS)
1656
AC_SUBST(trutilsCFLAGS)
1658
AC_SUBST(GPPWNTFLAG)
1662
dnl used for SGIs only
1665
# Just something so we won't forget to set it in the future
1666
emumake_goal=doodledandy
1668
if test "${with_oracle}" = "yes" ; then
1673
AC_SUBST(emumake_goal)
1675
# These are used in xsb_configuration.in
1677
AC_SUBST(os_version)
1679
AC_SUBST(host_vendor)
1681
AC_SUBST(compile_mode)
1682
AC_SUBST(xsb_major_version)
1683
AC_SUBST(xsb_minor_version)
1684
AC_SUBST(xsb_beta_version)
1685
AC_SUBST(xsb_codename)
1686
AC_SUBST(release_year)
1687
AC_SUBST(release_month)
1688
AC_SUBST(release_monthname)
1689
AC_SUBST(release_day)
1690
AC_SUBST(xsb_scheduling_strategy)
1691
AC_SUBST(site_prefix)
1693
AC_SUBST(xsb_release_date)
1694
AC_SUBST(xsb_full_version_name)
1695
AC_SUBST(engine_mode)
1699
AC_SUBST(INTERPROLOGSRC)
1700
AC_SUBST(INTERPROLOGOBJ)
1701
AC_SUBST(mno_cyg_inclib)
1702
AC_SUBST(mno_cyg_lib)
1704
AC_SUBST(win_site_includes)
1705
AC_SUBST(win_ld_site_libraries)
1707
## XSB file extensions
1708
xsb_src_extension_sans_dot=P
1709
xsb_hdr_extension_sans_dot=H
1710
xsb_obj_extension_sans_dot=xwam
1711
xsb_asm_extension_sans_dot=A
1712
xsb_dcl_extension_sans_dot=D
1713
AC_SUBST(xsb_src_extension_sans_dot)
1714
AC_SUBST(xsb_hdr_extension_sans_dot)
1715
AC_SUBST(xsb_obj_extension_sans_dot)
1716
AC_SUBST(xsb_asm_extension_sans_dot)
1717
AC_SUBST(xsb_dcl_extension_sans_dot)
1718
xsb_src_extension=.$xsb_src_extension_sans_dot
1719
xsb_hdr_extension=.$xsb_hdr_extension_sans_dot
1720
xsb_obj_extension=.$xsb_obj_extension_sans_dot
1721
xsb_asm_extension=.$xsb_asm_extension_sans_dot
1722
xsb_dcl_extension=.$xsb_dcl_extension_sans_dot
1723
AC_SUBST(xsb_src_extension)
1724
AC_SUBST(xsb_hdr_extension)
1725
AC_SUBST(xsb_obj_extension)
1726
AC_SUBST(xsb_asm_extension)
1727
AC_SUBST(xsb_dcl_extension)
1729
AC_OUTPUT([ ${arch_config_prefix}/topMakefile:topMakefile.in
1730
${arch_config_prefix}/emuMakefile:emuMakefile.in
1731
${arch_config_prefix}/modMakefile:modMakefile.in
1732
${arch_config_prefix}/gppMakefile:gppMakefile.in
1733
${arch_config_prefix}/smoMakefile:smoMakefile.in
1734
${arch_config_prefix}/makedef.sh:makedef.sh.in
1735
${arch_config_file}:${configuration_templ}
1737
${emudir}/extensions_xsb.h:extensions_xsb.in
1738
${scriptdir}/xsb${config_tag}:xsb.in
1739
${scriptdir}/chr_pp${config_tag}:chr_pp.in
1740
${scriptdir}/xsb.bat:wxsb.in
1741
${arch_config_prefix}/banner.msg:banner.in
1742
${arch_config_prefix}/MSVC_mkfile.mak:MSVC_mkfile.in
1743
${prefix}/packages/xmc/xmc-gui:xmc-gui.in
1746
chmod 644 ${arch_config_file}
1748
# Need to re-state the trap since configure resets it occasionally
1749
trap 'rm buildxsb.lock; exit 1' 1 2 3 15
1751
############ End of configuration -- the rest is mostly cosmetic ##############
1752
###############################################################################
1755
#### Report on what we decided to do.
1756
dnl Start redirection to | tee Installation_summary
1763
INSTALLATION SUMMARY
1764
--------------------
1766
XSB Version: ${xsb_version}
1767
Code name: ${xsb_codename}
1768
Release date: ${xsb_release_date}
1769
Configuration: ${canonical}
1770
Installation date: ${install_date}
1772
Build process is looking for XSB sources in: ${topdir}
1773
XSB should be installed in: ${prefix}
1774
Configuration-specific executables go in: ${arch_bindir}
1775
Configuration-specific libraries go in: ${arch_config_libdir}
1776
Object code goes in: ${arch_config_objlibdir}
1777
Site-specific code goes in: ${site_prefix}
1778
Site configuration-specific code goes in: ${site_config_prefix}
1779
XSB will be built with: ${CC} ${CFLAGS}
1780
builtin.c will be built with: ${CC} ${builtinsCFLAGS}
1781
loader_xsb.c will be built with: ${CC} ${loaderCFLAGS}
1782
emuloop.c will be built with: ${CC} ${emuloopCFLAGS}
1783
tr_utils.c will be built with: ${CC} ${trutilsCFLAGS}
1784
Loader flags: ${LDFLAGS}
1785
Compilation mode: ${compile_mode}
1786
XSB abstract machine: ${engine_mode}
1787
XSB scheduling strategy: ${xsb_scheduling_strategy}
1788
Garbage Collection Stress-Test: ${gc_test}
1789
Jumptable-based emulator loop: ${jumptable}
1790
Demand support: ${demand}"
1794
case "$with_oracle" in
1795
"yes") echo " Building with support for ORACLE: yes"
1797
"no") echo " Building with support for ORACLE: NO"
1800
case "$with_odbc" in
1801
"yes") echo " Building with support for ODBC: yes"
1803
"no") echo " Building with support for ODBC: NO"
1806
case "$with_interprolog" in
1807
"yes") echo " Building with support for InterProlog: yes"
1809
"no") echo " Building with support for InterProlog: NO"
1813
if test -n "$site_dynamic_libraries" ; then
1814
echo " Configured with dynamic libraries:"
1815
for arg in $site_dynamic_libraries ; do
1816
dnl Strip the trailing slashes
1817
arg=`echo "${arg}" | sed 's,\([[^/]]\)/*$,\1,'`
1821
echo " POSIX regexp matching libraries: $regmatch_support"
1822
echo " POSIX wildcard matching libraries: $wildmatch_support"
1823
echo " Perl support: $perl_support"
1825
if test "$perl_support" = "yes"; then
1827
Perl archlib: $perl_archlib/CORE
1828
Perl C compiler: $perl_cc_compiler
1829
Perl C flags: $perl_ccflags
1830
Perl loader flags: $perl_libs
1834
if test -n "${with_libwww}" && test -f $topdir/packages/libwww/Installation_summary; then
1835
cat $topdir/packages/libwww/Installation_summary
1838
if test -n "${with_dbdrivers}" && test -f $topdir/packages/dbdrivers/Installation_summary; then
1839
cat $topdir/packages/dbdrivers/Installation_summary
1842
if test -n "$javac"; then
1844
Java compiler: $javac
1851
) | tee Installation_summary
1855
# This is needed so that *after* XSB is installed in a common directory,
1856
# users could compile packages that produce arch-specific code.
1857
chmod 777 ${site_config_libdir};
1858
chmod a+t ${site_config_libdir};
1859
chmod 777 ${arch_install_config_libdir};
1860
chmod a+t ${arch_install_config_libdir};
1863
dnl Add site dynamic libraries to XSB library path
1864
if test -n "$site_dynamic_libraries"; then
1865
tempfile=/tmp/libpath.$$
1867
echo "Appending dynamic libraries to the XSB library search path:"
1869
echo "%% --- DO NOT EDIT THIS LINE AND BELOW: reserved for the configure script" >> $tempfile
1870
echo "" >> $tempfile
1871
for arg in $site_dynamic_libraries; do
1872
dnl Strip the trailing slashes
1873
arg=`echo "${arg}" | sed 's,\([[^/]]\)/*$,\1,'`
1874
echo ":- assert(library_directory('${arg}'))." >> ${tempfile}
1879
dnl Append to siteinitrc.P and create it, if necessary
1880
test -f ${site_prefix}/siteinitrc.P || ./touch.sh ${site_prefix}/siteinitrc.P
1882
dnl delete below the magic line
1883
sed '/%%[[ \t]]*-[[-]]*[[ \t]]*DO NOT EDIT THIS LINE/,$ d' \
1884
${site_prefix}/siteinitrc.P | \
1885
cat - ${tempfile} > ${tempfile}1
1887
mv -f ${tempfile}1 ${site_prefix}/siteinitrc.P
1891
if test "$with_os" = wind ; then
1893
mv MSVC.dep ${arch_config_prefix}
1895
# copy the windows-specific odbc files to the wondows specific directory
1896
cp odbc/* ${arch_config_prefix} 2> /dev/null
1900
# Now set modes, copy some files
1901
chmod 555 ${scriptdir}/xsb${config_tag} ${scriptdir}/chr_pp${config_tag} makexsb
1903
# These files should really be read-only, but this causes problems when
1904
# configuring for Windows over Samba, NFS, etc.
1905
chmod 644 ${arch_config_file} \
1906
${arch_config_prefix}/xsb_config.h \
1907
${arch_config_prefix}/xsb_debug.h \
1908
${arch_config_prefix}/*Makefile \
1909
${arch_config_prefix}/MSVC*
1912
# phantom private_builtin.c file
1913
test -f ${emudir}/private_builtin.c || \
1914
cp ${build_dir}/private_builtin.in ${emudir}/private_builtin.c
1916
dnl Copying to the installation directory ($prefix) is done in the top
1919
echo "XSB is configured for installation in ${prefix}"
1920
echo "Site libraries are to be found in ${site_prefix}"
1923
echo "Configuration report is saved in ./Installation_summary"
1925
if test "$have_warnings" = "yes"; then
1927
echo "PLEASE SCAN THE ABOVE MESSAGES FOR CONFIGURATION WARNINGS"
1931
if test "$with_os" = wind ; then
1932
xsb_compile_command=makexsb_wind
1934
xsb_compile_command=makexsb
1938
if test -z "$config_tag" ; then
1939
echo "***Now compile XSB with: \`$xsb_compile_command'"
1941
echo "***Now compile XSB with: \`$xsb_compile_command --config-tag=${config_tag_sans_dash}'"
1943
if test "$with_os" = wind ; then
1944
echo "***on a windows box."