Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10 | reyssat | 1 | # Process this file with autoconf to produce a configure script. |
3242 | bpr | 2 | AC_INIT(WIMS, WIMS_VERSION, wimsdev@cru.fr) |
10 | reyssat | 3 | AC_CONFIG_SRCDIR([wims.c]) |
4 | AC_CONFIG_HEADER([config.h:config.hin]) |
||
5 | |||
6 | AC_DEFUN([WIMS_NEED], [ |
||
7 | AC_PATH_PROG($1,$2) |
||
8 | if test -z "`eval echo '$'$1`"; then |
||
9 | echo ERROR: WIMS requires $3 |
||
10 | echo Please install this package then restart configure. |
||
11 | exit 1 |
||
12 | fi |
||
13 | ]) |
||
14 | AC_DEFUN([WIMS_FAIL], [ |
||
15 | if test "$2" = no; then |
||
16 | echo |
||
17 | echo ERROR! Your system does not have $1 |
||
18 | echo WIMS cannot be installed. Please report. |
||
19 | echo |
||
20 | exit 1 |
||
21 | fi |
||
22 | ]) |
||
23 | |||
24 | # Checks for programs. |
||
25 | AC_PROG_LN_S |
||
26 | if test "$LN_S" != "ln -s"; then |
||
27 | WIMS_FAIL([symbolic links], no) |
||
28 | fi |
||
29 | AC_PROG_AWK |
||
30 | AC_PROG_YACC |
||
31 | AC_PROG_CC(gcc cc) |
||
32 | AC_PROG_CXX |
||
33 | AC_PROG_CPP |
||
34 | AC_PROG_LEX |
||
35 | AC_PROG_MAKE_SET |
||
36 | AC_PROG_RANLIB |
||
37 | AC_CHECK_PROG(STRIP,strip,strip,:) |
||
38 | |||
39 | WIMS_NEED([TEX], [tex], [TeX]) |
||
40 | #WIMS_NEED([GP], [gp], [Pari/GP]) |
||
41 | #WIMS_NEED([CONVERT], [convert], [ImageMagick]) |
||
42 | |||
43 | # Checks for libraries. |
||
44 | SAVE=$LIBS |
||
45 | AC_CHECK_LIB([m], [cos]) |
||
46 | AC_CHECK_FUNCS([floor pow rint sqrt]) |
||
47 | |||
48 | LIBS=$SAVE |
||
49 | AC_CHECK_LIB([crypt], [crypt]) |
||
50 | AC_CHECK_FUNCS([crypt]) |
||
51 | CRYPTLIB=$LIBS |
||
52 | |||
53 | LIBS=$SAVE |
||
54 | AC_CHECK_LIB([fl], [main]) |
||
55 | FLEXLIB=$LIBS |
||
56 | |||
57 | LIBS=$SAVE |
||
58 | fun=gethostbyname |
||
59 | AC_CHECK_FUNCS($fun) |
||
60 | if test "$ac_cv_func_gethostbyname" = no; then |
||
61 | AC_CHECK_LIB([nsl], $fun) |
||
62 | WIMS_FAIL($fun, $ac_cv_lib_gethostbyname) |
||
63 | fi |
||
64 | |||
65 | fun=gethostname |
||
66 | AC_CHECK_FUNCS($fun) |
||
67 | WIMS_FAIL($fun, $ac_cv_func_gethostname) |
||
68 | |||
69 | fun=socket |
||
70 | AC_CHECK_FUNCS($fun) |
||
71 | if test "$ac_cv_func_socket" = no; then |
||
72 | AC_CHECK_LIB([socket], [$fun]) |
||
73 | if test "$ac_cv_lib_socket" = no; then |
||
74 | AC_CHECK_LIB([socket], [$fun], [], [], [-lnsl]) |
||
75 | WIMS_FAIL($fun, $ac_cv_lib_socket) |
||
76 | fi |
||
77 | fi |
||
78 | |||
79 | fun=inet_ntoa |
||
80 | AC_CHECK_FUNCS($fun) |
||
81 | if test "$ac_cv_func_inet_ntoa" = no; then |
||
82 | AC_CHECK_LIB([socket], [$fun], [], [], [-lnsl]) |
||
83 | fi |
||
84 | fun=inet_aton |
||
85 | AC_CHECK_FUNCS($fun) |
||
86 | if test "$ac_cv_func_inet_aton" = no; then |
||
87 | AC_CHECK_LIB([resolv], [$fun]) |
||
88 | fi |
||
89 | NETLIBS=$LIBS |
||
90 | |||
91 | LIBS=$SAVE |
||
92 | |||
93 | # Checks for header files. |
||
94 | AC_FUNC_ALLOCA |
||
95 | AC_HEADER_DIRENT |
||
96 | AC_HEADER_STDC |
||
97 | AC_HEADER_SYS_WAIT |
||
98 | AC_MEMORY_H |
||
99 | AC_CHECK_HEADERS([crypt.h arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h \ |
||
100 | stdlib.h string.h sys/socket.h sys/time.h unistd.h utime.h]) |
||
101 | |||
102 | # Checks for typedefs, structures, and compiler characteristics. |
||
103 | AC_C_CONST |
||
104 | AC_C_INLINE |
||
105 | AC_TYPE_PID_T |
||
106 | AC_TYPE_SIZE_T |
||
107 | AC_HEADER_TIME |
||
108 | AC_STRUCT_TM |
||
109 | AC_CHECK_TYPES(socklen_t, [], [], [ |
||
110 | #include <sys/types.h> |
||
111 | #include <sys/socket.h>]) |
||
112 | |||
113 | # Runpath |
||
114 | RPATH= |
||
115 | case "$CC+$with_dynamic" in |
||
116 | gcc+yes) RPATH="-Xlinker -rpath -Xlinker ../lib:../../lib:../../../lib";; |
||
117 | esac |
||
118 | |||
119 | # Checks for library functions. |
||
120 | AC_FUNC_ERROR_AT_LINE |
||
121 | AC_FUNC_FORK |
||
122 | AC_FUNC_LSTAT |
||
123 | AC_FUNC_MALLOC |
||
124 | AC_FUNC_MEMCMP |
||
125 | AC_FUNC_REALLOC |
||
126 | AC_TYPE_SIGNAL |
||
127 | AC_FUNC_STAT |
||
128 | AC_FUNC_STRTOD |
||
129 | AC_FUNC_UTIME_NULL |
||
130 | AC_CHECK_FUNCS([dup2 alarm getcwd gethostbyname gethostname gettimeofday \ |
||
131 | inet_ntoa memmove memset mkdir regcomp rmdir putenv select socket \ |
||
132 | strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr utime]) |
||
133 | |||
134 | # setenv ? |
||
135 | AC_CHECK_FUNCS([setenv]) |
||
136 | if test "$ac_cv_func_setenv" = no; then |
||
137 | common=../Common |
||
138 | SETENV_OBJS=$common/setenv.o |
||
139 | # FIXME: there should not be various xmallocs with different semantics. Only |
||
140 | # SETENV_OBJS should be necessary. |
||
141 | ALLSETENV_OBJS="$SETENV_OBJS $common/xmalloc.o" |
||
142 | else |
||
143 | SETENV_OBJS= |
||
144 | ALLSETENV_OBJS= |
||
145 | fi |
||
146 | |||
147 | # Case insensitive file system? |
||
148 | AC_CHECK_FILE(WIMS.C, D_CASE_INSENSITIVE_FS="-DCASE_INSENSITIVE_FS=1", |
||
149 | D_CASE_INSENSITIVE_FS=) |
||
150 | # Static libm? |
||
151 | AC_CHECK_FILE(/usr/lib/libm.a,STATIC_LIB=-static,STATIC_LIB=) |
||
152 | |||
153 | # Configure options |
||
154 | AC_ARG_WITH(units, [ --without-units Don't compile units-filter (units recognition)],echo Compile units-filter: $with_units, with_units=yes; echo Compile units-filter: yes) |
||
155 | BUILD_UNITS= |
||
156 | if test "$with_units" = "yes"; then |
||
157 | case "$LEXLIB" in |
||
158 | -lfl) BUILD_UNITS=units-filter;; |
||
159 | *) with_units=no; echo "Wait ... flex is not available, Compile units : no";; |
||
160 | esac |
||
161 | fi |
||
162 | |||
163 | AC_ARG_WITH(chemeq,[ --without-chemeq Don't compile chemeq (chemical equation analyzer)],echo Compile chemeq: $with_chemeq, with_chemeq=yes; echo Compile chemeq: yes) |
||
164 | BUILD_CHEMEQ= |
||
165 | if test "$with_chemeq" = "yes"; then |
||
166 | case "$LEXLIB" in |
||
167 | -lfl) if test "$CXX" = "g++"; then |
||
168 | case `"$CXX" --version` in |
||
169 | [ 1*|2.[1-8]*|2.9[1-4]*|2.95.[1-2]) ] |
||
170 | with_chemeq=no |
||
171 | echo "Wait ... I need at least g++-2.95.3, Compile chemeq: no" ;; |
||
172 | *) BUILD_CHEMEQ=chemeq;; |
||
173 | esac |
||
174 | else |
||
175 | with_chemeq=no |
||
176 | echo "Wait ... g++ is not available, Compile chemeq: no" |
||
177 | fi;; |
||
178 | *) with_chemeq=no |
||
179 | echo "Wait ... flex is not available, Compile chemeq: no";; |
||
180 | esac |
||
181 | fi |
||
182 | |||
183 | AC_ARG_WITH(wimsd,[ --without-wimsd Don't compile wimsd (standalone http server)],echo Compile wimsd: $with_wimsd, with_wimsd=yes; echo Compile wimsd: yes) |
||
184 | if test "$with_wimsd" = "yes"; then |
||
185 | BUILD_WIMSD=wimsd |
||
186 | fi |
||
187 | |||
188 | date=`date +%Y-%m-%d` |
||
189 | DEFINES="-DGNU_SOURCE -DVERSION_DATE=\\\"$date\\\"" |
||
190 | AC_SUBST(D_CASE_INSENSITIVE_FS) |
||
191 | AC_SUBST(STATIC_LIB) |
||
192 | AC_SUBST(DEFINES) |
||
193 | AC_SUBST(STRIP) |
||
194 | AC_SUBST(RPATH) |
||
195 | AC_SUBST(BUILD_UNITS) |
||
196 | AC_SUBST(BUILD_CHEMEQ) |
||
197 | AC_SUBST(BUILD_WIMSD) |
||
198 | AC_SUBST(SETENV_OBJS) |
||
199 | AC_SUBST(ALLSETENV_OBJS) |
||
200 | AC_SUBST(NETLIBS) |
||
201 | AC_SUBST(FLEXLIB) |
||
202 | AC_SUBST(CRYPTLIB) |
||
203 | |||
204 | AC_CONFIG_FILES([Flydraw/gd/Makefile |
||
205 | Flydraw/Makefile |
||
206 | Interfaces/Makefile |
||
207 | Lib/Makefile |
||
208 | Makefile |
||
209 | Misc/Makefile |
||
210 | Misc/symtext/Makefile |
||
211 | Misc/mathexp/Makefile |
||
212 | Misc/chemeq/Makefile |
||
213 | Misc/chemeq/src/Makefile |
||
214 | Misc/units-filter/src/Makefile |
||
215 | Misc/voronoiW/Makefile |
||
795 | bpr | 216 | Misc/bioinfo/Makefile |
913 | bpr | 217 | Misc/checkmol/Makefile |
3398 | bpr | 218 | Misc/crossword/Makefile |
2143 | bpr | 219 | Misc/lceb/Makefile |
3519 | schaersvoo | 220 | Misc/moneyprint/Makefile |
3689 | schaersvoo | 221 | Misc/toascii/Makefile |
913 | bpr | 222 | Misc/whirlgif/Makefile |
10 | reyssat | 223 | Module/Makefile |
224 | Module/drawode/Makefile |
||
225 | Msg2wims/Makefile |
||
226 | Oef2wims/Makefile |
||
227 | Wimsd/Makefile |
||
228 | Wimslogd/Makefile |
||
229 | Texgif/Makefile]) |
||
230 | AC_OUTPUT |