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