File: configure.ac

package info (click to toggle)
wims 1%3A4.15d~dfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 142,064 kB
  • sloc: xml: 367,528; java: 119,440; ansic: 62,236; sh: 6,957; perl: 3,784; yacc: 3,138; lex: 1,791; cpp: 1,604; makefile: 1,283; lisp: 914; php: 366; pascal: 223; python: 191; asm: 51; sql: 10
file content (270 lines) | stat: -rw-r--r-- 7,123 bytes parent folder | download | duplicates (2)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# Process this file with autoconf to produce a configure script.

AC_INIT(WIMS, esyscmd(awk 'ORS=""; {print $0}' ../version), wimsdev@cru.fr)
AC_CONFIG_SRCDIR([wims.c])
AC_CONFIG_HEADER([config.h:config.hin])

AC_DEFUN([WIMS_NEED], [
  AC_PATH_PROG($1,$2)
  if test -z "`eval echo '$'$1`"; then
    echo ERROR: WIMS requires $3
    echo Please install this package then restart configure.
    exit 1
  fi
])
AC_DEFUN([WIMS_FAIL], [
  if test "$2" = no; then
    echo
    echo ERROR! Your system does not have $1
    echo WIMS cannot be installed. Please report.
    echo
    exit 1
  fi
])
AC_DEFUN([WIMS_CHECK_FUNC], [
  AC_CHECK_FUNCS($1)
  WIMS_FAIL($1, $ac_cv_func_$1)
])

# Checks for programs.
AC_PROG_LN_S
if test "$LN_S" != "ln -s"; then
  WIMS_FAIL([symbolic links], no)
fi
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC(gcc cc)
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_LEX
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_PROG(STRIP,strip,strip,:)

#WIMS_NEED([TEX], [tex], [TeX])
#WIMS_NEED([GP], [gp], [Pari/GP])
#WIMS_NEED([CONVERT], [convert], [ImageMagick])

# Checks for libraries.
SAVE=$LIBS
AC_CHECK_LIB([m], [cos])
WIMS_FAIL([Math library libm], $ac_cv_lib_m_cos)

AC_CHECK_FUNCS([rint])
WIMS_CHECK_FUNC(floor)
WIMS_CHECK_FUNC(pow)
WIMS_CHECK_FUNC(sqrt)

LIBS=$SAVE
AC_CHECK_LIB([gd], [gdFontCacheSetup])
AC_CHECK_FUNCS([gdFontCacheSetup])
GDLIB=$LIBS

LIBS=$SAVE
AC_CHECK_LIB([crypt], [crypt])
AC_CHECK_FUNCS([crypt])
CRYPTLIB=$LIBS

LIBS=$SAVE
AC_CHECK_LIB([fl], [main])
FLEXLIB=$LIBS

LIBS=$SAVE
fun=gethostbyname
AC_CHECK_FUNCS($fun)
if test "$ac_cv_func_$fun" = no; then
  AC_CHECK_LIB([nsl], $fun)
  WIMS_FAIL($fun, $ac_cv_lib_$fun)
fi

WIMS_CHECK_FUNC(gethostname)

fun=socket
AC_CHECK_FUNCS($fun)
if test "$ac_cv_func_$fun" = no; then
  AC_CHECK_LIB([socket], [$fun])
  if test "$ac_cv_lib_$fun" = no; then
    AC_CHECK_LIB([socket], [$fun], [], [], [-lnsl])
    WIMS_FAIL($fun, $ac_cv_lib_$fun)
  fi
fi

fun=inet_ntoa
AC_CHECK_FUNCS($fun)
if test "$ac_cv_func_$fun" = no; then
  AC_CHECK_LIB([socket], [$fun], [], [], [-lnsl])
fi
fun=inet_aton
AC_CHECK_FUNCS($fun)
if test "$ac_cv_func_$fun" = no; then
  AC_CHECK_LIB([resolv], [$fun])
fi
NETLIBS=$LIBS

LIBS=$SAVE

# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_MEMORY_H
AC_CHECK_HEADERS([crypt.h arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h \
stdlib.h string.h sys/socket.h sys/time.h unistd.h utime.h])
WIMS_FAIL([ANSI C header files], $ac_cv_header_stdc)
WIMS_FAIL([Header file unistd.h], $ac_cv_header_unistd_h)

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_CHECK_TYPES(socklen_t, [], [], [
#include <sys/types.h>
#include <sys/socket.h>])

# Runpath
RPATH=
case "$CC+$with_dynamic" in
  gcc+yes) RPATH="-Xlinker -rpath -Xlinker ../lib:../../lib:../../../lib";;
esac

# Checks for library functions.
AC_FUNC_MALLOC
WIMS_FAIL(malloc, $ac_cv_func_malloc_0_nonnull)
AC_FUNC_REALLOC
WIMS_FAIL(realloc, $ac_cv_func_realloc_0_nonnull)
AC_FUNC_FORK
WIMS_FAIL([working fork], $ac_cv_func_fork_works)

AC_FUNC_ERROR_AT_LINE
AC_FUNC_LSTAT
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRTOD
AC_CHECK_FUNCS([dup2 regcomp putenv strcasecmp strchr strdup strerror utime])

WIMS_CHECK_FUNC(alarm)
WIMS_CHECK_FUNC(getcwd)
WIMS_CHECK_FUNC(gettimeofday)
WIMS_CHECK_FUNC(memmove)
WIMS_CHECK_FUNC(memset)
WIMS_CHECK_FUNC(mkdir)
WIMS_CHECK_FUNC(rmdir)
WIMS_CHECK_FUNC(select)
WIMS_CHECK_FUNC(strncasecmp)
WIMS_CHECK_FUNC(strpbrk)
WIMS_CHECK_FUNC(strrchr)
WIMS_CHECK_FUNC(strstr)
WIMS_CHECK_FUNC(utime)

# setenv ?
AC_CHECK_FUNCS([setenv])
if test "$ac_cv_func_setenv" = no; then
  common=../Common
  SETENV_OBJS=$common/setenv.o
# FIXME: there should not be various xmallocs with different semantics. Only
# SETENV_OBJS should be necessary.
  ALLSETENV_OBJS="$SETENV_OBJS $common/xmalloc.o"
else
  SETENV_OBJS=
  ALLSETENV_OBJS=
fi

# Case insensitive file system?
AC_CHECK_FILE(WIMS.C, D_CASE_INSENSITIVE_FS="-DCASE_INSENSITIVE_FS=1",
                      D_CASE_INSENSITIVE_FS=)
# Static libm?
AC_CHECK_FILE(/usr/lib/libm.a,STATIC_LIB=-static,STATIC_LIB=)

# Configure options
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)
BUILD_UNITS=
if test "$with_units" = "yes"; then
  case "$LEXLIB" in
  -lfl) BUILD_UNITS=units-filter;;
  *) with_units=no; echo "Wait ... flex is not available, Compile units : no";;
  esac
fi

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)
BUILD_CHEMEQ=
if test "$with_chemeq" = "yes"; then
  case "$LEXLIB" in
  -lfl) if test "$CXX" = "g++"; then
          case `"$CXX" --version` in
          [ 1*|2.[1-8]*|2.9[1-4]*|2.95.[1-2]) ]
              with_chemeq=no
              echo "Wait ... I need at least g++-2.95.3, Compile chemeq: no" ;;
            *) BUILD_CHEMEQ=chemeq;;
          esac
        else
          with_chemeq=no
          echo "Wait ... g++ is not available, Compile chemeq: no"
        fi;;
  *) with_chemeq=no
     echo "Wait ... flex is not available, Compile chemeq: no";;
  esac
fi

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)
if test "$with_wimsd" = "yes"; then
  BUILD_WIMSD=wimsd
fi

if test -n "$SOURCE_DATE_EPOCH"; then
  date=`date --utc --date="@$SOURCE_DATE_EPOCH" +%Y-%m-%d`
else
  date=`date +%Y-%m-%d`
fi

DEFINES="-DGNU_SOURCE -DVERSION_DATE=\\\"$date\\\""
AC_SUBST(D_CASE_INSENSITIVE_FS)
AC_SUBST(STATIC_LIB)
AC_SUBST(DEFINES)
AC_SUBST(STRIP)
AC_SUBST(RPATH)
AC_SUBST(BUILD_UNITS)
AC_SUBST(BUILD_CHEMEQ)
AC_SUBST(BUILD_WIMSD)
AC_SUBST(SETENV_OBJS)
AC_SUBST(ALLSETENV_OBJS)
AC_SUBST(NETLIBS)
AC_SUBST(FLEXLIB)
AC_SUBST(GDLIB)
AC_SUBST(CRYPTLIB)

AC_CONFIG_FILES([Flydraw/Makefile
                 Interfaces/Makefile
                 Lib/Makefile
                 Makefile
                 Misc/Makefile
                 Misc/symtext/Makefile
                 Misc/mathexp/Makefile
                 Misc/chemeq/Makefile
                 Misc/chemeq/src/Makefile
                 Misc/units-filter/src/Makefile
                 Misc/voronoiW/Makefile
                 Misc/bioinfo/Makefile
                 Misc/checkmol/Makefile
                 Misc/crossword/Makefile
                 Misc/lceb/Makefile
                 Misc/moneyprint/Makefile
                 Misc/toascii/Makefile
                 Misc/scienceprint/Makefile
                 Misc/sigdigits/Makefile
                 Misc/canvasdraw/Makefile
                 Misc/whirlgif/Makefile
                 Misc/authors/jm.evers/applets/Makefile
		 Misc/applets/Makefile
                 Module/Makefile
                 Module/drawode/Makefile
                 OefMsg2wims/Makefile
                 Wimsd/Makefile
                 Wimslogd/Makefile
                 Texgif/Makefile
                 Mathml/Makefile])
AC_OUTPUT