aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: 300c960c0c194360e851a61a84fe605f787d9a6e (plain)
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
dnl Copyright (C) 2006-2010, Gabriel Dos Reis.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl     - Redistributions of source code must retain the above copyright
dnl       notice, this list of conditions and the following disclaimer.
dnl
dnl     - Redistributions in binary form must reproduce the above copyright
dnl       notice, this list of conditions and the following disclaimer in
dnl       the documentation and/or other materials provided with the
dnl       distribution.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dnl
dnl  This configure template details the configuration process of setting up 
dnl  OpenAxiom for build from source codes.  The  process scrutinizes the 
dnl  build, host,  and target environments, and finally instantiates 
dnl  Makefiles for building OpenAxiom interpreter, compiler, libraries, and
dnl  auxiliary tools where appropriate.
dnl

AC_INIT([OpenAxiom], [1.4.0-2011-01-01], 
        [open-axiom-bugs@lists.sf.net])

dnl Most of the macros used in this configure.ac are defined in files
dnl located in the subdirectory config/
m4_include([config/aclocal.m4])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])

dnl Put all configuration macros here
AC_CONFIG_HEADERS([config/openaxiom-c-macros.h])

AC_CANONICAL_SYSTEM

dnl Page Automake
AM_INIT_AUTOMAKE([foreign])
AC_PREREQ([2.62])

dnl Simple sanity check.
AC_CONFIG_SRCDIR(src/Makefile.in)


open_axiom_installdir=$libdir/open-axiom/$target/$PACKAGE_VERSION
AC_SUBST(open_axiom_installdir)

dnl For the moment, the OpenAxiom base source code is written
dnl in a way that does not support cross build.  However, we do
dnl want to make cross build possible; consequently we issue
dnl a warning when we detect attempt at cross build.
dnl Note that we do not stop the configuration process because we do seek
dnl contributions for cross build support.
if test $build != $target; then
   AC_MSG_WARN([Cross build is not supported.])
   AC_MSG_WARN([Please notify open-axiom-devel@open-axiom.org if you succeed.])
fi

## Although OpenAxiom does not support cross build yet, let
## alone Canadian cross, we want to make sure that we do not write
## the build machinery in a way that actively unsupports 
## cross build.  Consequently, in the build tree, we sequester
## tools that we build and use on the build platform,
## in  sub-directories different from others.
axiom_build_sharedir=$axiom_builddir/share


OPENAXIOM_HOST_COMPILERS
AM_CONDITIONAL([OA_BUILD_GCL], [test x$oa_include_gcl = xyes])

OPENAXIOM_HOST_DATA_PROPERTIES

OPENAXIOM_DYNAMIC_MODULE_SUPPORT
OPENAXIOM_BUILD_TOOLS
OPENAXIOM_LISP_FLAGS
OPENAXIOM_FILE_EXTENSIONS

OPENAXIOM_BUILD_OPTIONS
OPENAXIOM_HOST_PROGS

OPENAXIOM_CHECK_CORE_SUPPORT
OPENAXIOM_CHECK_IO
AM_CONDITIONAL([OA_BUILD_SMAN], [test $oa_use_sman = 1])
OPENAXIOM_CHECK_GRAPHICS
AM_CONDITIONAL([OA_BUILD_GRAPHICS], [test x$axiom_use_x = xyes])

OPENAXIOM_FFI_TYPE_TABLE
OPENAXIOM_GCL_BUILD_OPTIONS
OPENAXIOM_CHECK_MM
OPENAXIOM_CHECK_MISC

## We are ready to instantiate makefiles.
AC_CONFIG_FILES([Makefile src/Makefile])
OPENAXIOM_MAKEFILE([src/lib/Makefile])
OPENAXIOM_MAKEFILE([src/utils/Makefile])
OPENAXIOM_MAKEFILE([src/hyper/Makefile])
OPENAXIOM_MAKEFILE([src/driver/Makefile])
OPENAXIOM_MAKEFILE([src/lisp/Makefile])
OPENAXIOM_MAKEFILE([src/boot/Makefile])
OPENAXIOM_MAKEFILE([src/interp/Makefile])
OPENAXIOM_MAKEFILE([src/share/Makefile])
OPENAXIOM_MAKEFILE([src/algebra/Makefile])
OPENAXIOM_MAKEFILE([src/input/Makefile])
OPENAXIOM_MAKEFILE([src/etc/Makefile])
OPENAXIOM_MAKEFILE([src/doc/Makefile])
OPENAXIOM_MAKEFILE([src/clef/Makefile])
OPENAXIOM_MAKEFILE([src/sman/Makefile])
OPENAXIOM_MAKEFILE([src/graph/Makefile])
OPENAXIOM_MAKEFILE([src/graph/Gdraws/Makefile])
OPENAXIOM_MAKEFILE([src/graph/view2D/Makefile])
OPENAXIOM_MAKEFILE([src/graph/view3D/Makefile])
OPENAXIOM_MAKEFILE([src/graph/viewAlone/Makefile])
OPENAXIOM_MAKEFILE([src/graph/viewman/Makefile])

AC_OUTPUT

## Generate rules to extrad SPAD type definitions from pamphlets.
echo -n "extracting list of SPAD type definitions..."
egrep '<<(category|domain|package) .*>>=' \
    $srcdir/src/algebra/*.spad.pamphlet \
    | sort | uniq | \
    while IFS=':' read spad_file chunk_desc; do 
        chunk_desc=`echo $chunk_desc | sed -e 's,<<,,' -e 's,>>=,,'`
        set $chunk_desc; spad_abbrev=$2
        cat >> src/algebra/tmp-extract-spad.mk <<EOF
$spad_abbrev.spad: \$(srcdir)/`basename $spad_file` ; \
    @\$(oa_hammer) --output=\$@.tmp --tangle="$chunk_desc" \$< && \
    \$(top_confdir)/move-if-change \$@.tmp \$@
EOF
    done 
echo done
$srcdir/config/move-if-change \
    src/algebra/tmp-extract-spad.mk src/algebra/extract-spad.mk


echo "Type '${MAKE}' (without quotes) to build OpenAxiom"

dnl That is all folks.