File: configure.in

package info (click to toggle)
open-amulet 4.3.1-7.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,804 kB
  • ctags: 9,779
  • sloc: cpp: 97,058; sh: 7,698; ansic: 1,881; makefile: 756; lisp: 153; exp: 15
file content (179 lines) | stat: -rw-r--r-- 4,974 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
dnl Configure system for OpenAmulet - Rodolphe Ortalo
dnl $Id:  $
dnl Process this file with autoconf to produce a configure script.

AC_INIT(header/amulet.h)

dnl === Library package version and name ===
dnl We want the definition of 'PACKAGE' and 'VERSION' macros
AM_INIT_AUTOMAKE(open-amulet,4.3.1)

dnl Use '--enable-maintainer-mode' if you change config. or build files
AM_MAINTAINER_MODE

dnl ========================================================================
dnl Set some defaults

if test "x$CXXFLAGS" = x; then
  CXXFLAGS="-O2"
fi

dnl ========================================================================
dnl Checks for C features first (before selecting C++)

AC_PROG_CC
AC_HEADER_STDC


dnl ========================================================================
dnl Checks for programs and set languages

AC_PROG_CXX
AC_LANG_CPLUSPLUS
AC_PROG_LN_S

dnl Turn off building of static libraries by default due to the
dnl size of the final library and executables. You can turn it
dnl on again with --enable-static.
AM_DISABLE_STATIC
AM_PROG_LIBTOOL

dnl ========================================================================
dnl User selectable options

AC_ARG_ENABLE(release,
[  --disable-release       Build the standard release version (default=enable)],
[case "${enableval}" in
  yes) release=true ;;
  no)  release=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-release) ;;
esac],[release=true])

AM_CONDITIONAL(BUILD_release, test x$release = xtrue)

AC_ARG_ENABLE(develop,
[  --disable-develop       Build the development version (default=enable)],
[case "${enableval}" in
  yes) develop=true ;;
  no)  develop=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-develop) ;;
esac],[develop=true])

AM_CONDITIONAL(BUILD_develop, test x$develop = xtrue)

AC_ARG_ENABLE(ggi,
[  --enable-ggi            Use GEM-on-GGI: EXPERIMENTAL! (default=disable)],
[case "${enableval}" in
  yes) ggi=true ;;
  no)  ggi=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-ggi) ;;
esac],[ggi=false])

AM_CONDITIONAL(USE_ggi, test x$ggi = xtrue)

dnl ========================================================================
dnl Checks for libraries

dnl === check for -lX11 ===

AC_PATH_XTRA()

dnl === check for -lm ===

AC_CHECK_LIB(m,cos,math_lib=yes LIBS="$LIBS -lm")

dnl Warn eventually

if test "$math_lib" != yes; then
  AC_MSG_WARN([
   *?*?*?* You need the math. library (-lm) to use OpenAmulet *?*?*?*])
fi

dnl ========================================================================
dnl Checks for header files.

dnl ========================================================================
dnl Checks for typedefs, structures, and compiler characteristics.

AC_MSG_CHECKING([if c++ supports bool])
AC_TRY_COMPILE([],[bool b = true; return false;],[my_res="yes"
],[my_res="no"
AC_DEFINE(NEED_BOOL)])
AC_MSG_RESULT($my_res)

dnl ========================================================================
dnl Checks for library functions.

dnl TODO: See if there are some portability problems in amulet...

dnl Checks if we need a cast for socket functions (Solaris <= 2.5)

AC_MSG_CHECKING([if cast needed for sockets])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],[short i; send(1, &i, 2, 0);],[my_res="none"
AC_DEFINE(SOCK_BUFFER_CAST,[])
],[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],[short i; send(1, (char*)&i, 2, 0);],[my_res="to char*"
AC_DEFINE(SOCK_BUFFER_CAST,[(char*)])
],AC_MSG_ERROR([Unable to provide suitable net files!]))])
AC_MSG_RESULT($my_res)

dnl ========================================================================
dnl Finally add some flags

dnl Prepare compilation and link flags NOW!
dnl Change (ie: move to Makefile.am) if not needed on Unix someday. ;-)
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LIBS="$LIBS $X_EXTRA_LIBS $X_LIBS -lX11"

CPPFLAGS="$CPPFLAGS -DGCC -DMEMORY"

AMULET_DEVELOP_FLAGS="-DDEBUG"
AC_SUBST(AMULET_DEVELOP_FLAGS)

dnl ========================================================================
dnl Write output

dnl We don't use a config header file in fact (yet)...
dnl AM_CONFIG_HEADER(config.h)

AC_OUTPUT(
Makefile
header/Makefile
header/amulet/Makefile
header/amulet/impl/Makefile
source/Makefile
source/gem/Makefile
source/gem/X/Makefile
source/gem/ggi/Makefile
source/gem/mac/Makefile
source/gem/win32/Makefile
source/object/Makefile
source/opal/Makefile
source/opal/objects/Makefile
source/inter/Makefile
source/utils/Makefile
source/debug/Makefile
source/widgets/Makefile
source/widgets/objects/Makefile
source/anim/Makefile
source/gesture/Makefile
source/scripting/Makefile
source/net/Makefile
data/Makefile
data/images/Makefile
data/images/scripting/Makefile
test/Makefile
test/gem/Makefile
test/gem/config/Makefile
test/gem/gem.cmu/Makefile
test/object/Makefile
test/opal/Makefile
test/inter/Makefile
test/gesture/Makefile
test/anim/Makefile
test/utils/Makefile
test/widgets/Makefile
test/timing/Makefile
test/net/Makefile
)