File: configure.in

package info (click to toggle)
librep 0.9-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,576 kB
  • ctags: 1,928
  • sloc: ansic: 21,612; sh: 7,386; lisp: 5,331; makefile: 392; sed: 93
file content (384 lines) | stat: -rw-r--r-- 11,361 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
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
dnl  Process this file with autoconf to produce a configure script.
dnl  Copyright (C) 1998 John Harper <john@dcs.warwick.ac.uk>
dnl  $Id: configure.in,v 1.60 1999/12/11 11:40:57 john Exp $
dnl
dnl  This file is part of Jade.
dnl
dnl  Jade is free software; you can redistribute it and/or modify it
dnl  under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; either version 2, or (at your option)
dnl  any later version.
dnl
dnl  Jade is distributed in the hope that it will be useful, but
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with Jade; see the file COPYING.  If not, write to
dnl  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

AC_REVISION($Revision: 1.60 $)

AC_INIT(src/rep_subrs.h)
AC_CONFIG_HEADER(config.h src/rep.h)
AC_CONFIG_AUX_DIR(etc)

dnl Release versioning info
version="0.9"

dnl libtool versioning info: `CURRENT:REVISION:AGE'. CURRENT is the
dnl current interface id, REVISION is the version number of this
dnl implementation, AGE defines the first interface id also supported
dnl (i.e. all interfaces between CURRENT-AGE and CURRENT are supported)
libversion="6:0:1"

makefile_template="Makefile.in:Makedefs.in"
output_files="src/Makefile:Makedefs.in:src/Makefile.in\
 lisp/Makefile:Makedefs.in:lisp/Makefile.in\
 Makefile:Makedefs.in:Makefile.in\
 man/Makefile:Makedefs.in:man/Makefile.in\
 intl/Makefile librep.spec"

dnl Find the system type
AC_CANONICAL_HOST

dnl Remove trailing slash in $prefix if necessary
case "${prefix}" in
  */)
    prefix=`echo ${prefix} | sed -e 's/^\(.*\)\/$/\1/'`
    ;;
esac

repdir='${datadir}/rep'
replispdir='${repdir}/${version}/lisp'
repexecdir='${libexecdir}/rep/${version}/${host_type}'
repcommonexecdir='${libexecdir}/rep/${host_type}'
repdocfile='${repdir}/${version}/DOC'

EXTRA_LIBOBJS=""
AC_SUBST(EXTRA_LIBOBJS)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL
AM_PROG_LIBTOOL

dnl Workaround etc/install-sh not being found from subdirectories
if test "$INSTALL" = "$ac_install_sh"; then
  dnl Why is the backslash needed?
  INSTALL='\${top_srcdir}/etc/install-sh -c'
fi

dnl Abort if shared libraries aren't enabled
if test "${enable_shared}" != "yes"; then
  AC_MSG_ERROR([Need shared libraries enabled])
fi

dnl Checks for libraries.
AC_CHECK_LIB(nsl, xdr_void)
AC_CHECK_LIB(socket, bind)
AC_CHECK_LIB(dl, dlopen)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h sys/utsname.h unistd.h siginfo.h memory.h stropts.h termios.h string.h)

dnl Check for Doug Lea's malloc in libc, otherwise compile dlmalloc.c
doug_lea_malloc=yes
AC_CHECK_FUNC(malloc_get_state, , doug_lea_malloc=no)
AC_CHECK_FUNC(malloc_set_state, , doug_lea_malloc=no)
if test "$doug_lea_malloc" = "no"; then
  case ${host} in
    *-dec-osf*)
      # dlmalloc is broken on Tru64
      AC_DEFINE(LIBC_MALLOC)
      ;;
    *)
      EXTRA_LIBOBJS="${EXTRA_LIBOBJS} dlmalloc.o"
      AC_DEFINE(DOUG_LEA_MALLOC)
      ;;
  esac
else
  AC_DEFINE(DOUG_LEA_MALLOC)
  AC_DEFINE(LIBC_MALLOC)
fi

dnl Check for readline
AC_ARG_WITH(readline,
 [  --with-readline         support fancy command input editing], [],
 [with_readline=maybe])

dnl Only look if explicitly asked for..
if test "$with_readline" = "yes"; then
  READLINE_LIBS=""
  AC_SUBST(READLINE_LIBS)
  AC_CHECK_LIB(ncurses, tparm, TERMLIB=-lncurses,
   AC_CHECK_LIB(termcap, tgetent, TERMLIB=-ltermcap))
  saved_LIBS="$LIBS"
  LIBS="$LIBS $TERMLIB"
  AC_CHECK_LIB(readline, readline,
   [AC_CHECK_HEADER(readline/readline.h,
    [READLINE_LIBS="-lreadline $TERMLIB"
     AC_DEFINE(HAVE_LIBREADLINE)])])
  LIBS="$saved_LIBS"
fi

dnl Check for dynamic loading
AC_CHECK_HEADER(dlfcn.h, [AC_DEFINE(HAVE_DLFCN_H)])
AC_CHECK_HEADER(dl.h, [AC_DEFINE(HAVE_DL_H)])
dl_ok=no
AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_DLOPEN) dl_ok=dl])
AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD) dl_ok=shl])

if test $dl_ok = dl; then
  AC_MSG_CHECKING([for preceding underscore in symbols])
  dnl copied from glib configure.in
  AC_TRY_RUN([#ifdef HAVE_DLFCN_H
	      # include <dlfcn.h>
	      #endif
              int glib_underscore_test (void) { return 42; }
              int main() {
                void *f1 = (void*)0, *f2 = (void*)0, *handle;
                handle = dlopen ((void*)0, 0);
                if (handle) {
                  f1 = dlsym (handle, "glib_underscore_test");
                  f2 = dlsym (handle, "_glib_underscore_test");
                } return (!f2 || f1);
              }],
              [AC_DEFINE(DLSYM_NEED_USCORE)
	       AC_MSG_RESULT(yes)],
	      [AC_MSG_RESULT(no)])
fi

if test $dl_ok != no; then
  AC_DEFINE(HAVE_DYNAMIC_LOADING)
else
  AC_MSG_ERROR([can't figure out how to do dynamic loading])
fi

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd gethostname select socket strcspn strerror strstr stpcpy strtol psignal strsignal snprintf grantpt lrand48 getpagesize setitimer dladdr dlerror)
AC_REPLACE_FUNCS(realpath)

dnl Custom tests

dnl How do we get dependency lines in the Makefile?
if test "x${GCC}" = "xyes"; then
  MAKEDEP='$(CC) -MM -MG'
else
  case ${host} in
    *-dec-osf*)
      # works on Tru64
      MAKEDEP='$(CC) -M'
      ;;
    *-sun-solaris*)
      # works on Solaris
      MAKEDEP='/usr/lib/cpp -M'
      ;;
    *)
      # disable dependences?
      MAKEDEP='true'
      ;;
  esac
fi
AC_SUBST(MAKEDEP)

dnl If using GCC and it doesn't look as though the cflags have been
dnl set explicitly, add some warning options. Turn off implicit-int
dnl warnings since the X11 includes on Solaris generate a lot of these
if test "x${GCC}" = "xyes" -a "x$CFLAGS" = "x-g -O2"; then
  CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes -Wno-implicit-int"
fi

dnl Does <unistd.h> declare char **environ?
AC_CACHE_CHECK([whether unistd.h declares environ], jade_cv_decl_environ,
 AC_TRY_COMPILE([#include <unistd.h>], [char **foo = environ;],
  [jade_cv_decl_environ=yes],
  [jade_cv_decl_environ=no]))
if test ${jade_cv_decl_environ} = no; then
  AC_DEFINE(ENVIRON_UNDECLARED)
fi

dnl Are ptys available, and if so, how?
AC_MSG_CHECKING([whether /dev/ptmx exists])
if test -r /dev/ptmx; then
  AC_MSG_RESULT([yes])
  AC_DEFINE(HAVE_PTYS)
  AC_DEFINE(HAVE_DEV_PTMX)
else
  AC_MSG_RESULT([no])
fi

dnl Look for old-style /dev/ptyXN devices
AC_CACHE_CHECK([whether /dev/ptyXN devices exist], jade_cv_sys_dev_pty,
 jade_cv_sys_dev_pty=no
 for c in p q r s t u v w x y z a b c d e f g h i j k l m n o; do
   if test -r "/dev/pty${c}0"; then
     jade_cv_sys_dev_pty=${c}
     break
   fi
 done)
if test ${jade_cv_sys_dev_pty} != no; then
  AC_DEFINE(HAVE_PTYS)
  AC_DEFINE_UNQUOTED(FIRST_PTY_LETTER, '${jade_cv_sys_dev_pty}')
fi

dnl Try to find the aclocal directory for installation
aclocaldir=none
AC_ARG_WITH(aclocaldir,
  [  --with-aclocaldir=DIR   Directory in which to install autoconf macros],
  aclocaldir=$withval)
AC_MSG_CHECKING([for aclocal directory])
if test "$aclocaldir" = none; then
  aclocaldir="`aclocal --print-ac-dir`"
  if test "x${aclocaldir}" = "x"; then
    aclocaldir='${datadir}/aclocal'
  fi
fi
AC_MSG_RESULT([${aclocaldir}])
AC_SUBST(aclocaldir)

AC_ARG_ENABLE(dballoc,
 [  --enable-dballoc	  Trace all memory allocations
  --disable-dballoc	  Don't trace memory allocations [default]],
 [if test "$enableval" != "no"; then AC_DEFINE(DEBUG_SYS_ALLOC) fi])

AC_ARG_ENABLE(dbsyms,
 [  --enable-dbsyms	  When writing debug output, translate addresses
			   to symbol names. [default=yes]
  --disable-dbsyms],
 [if test "$enableval" != "no"; then AC_DEFINE(DB_RESOLVE_SYMBOLS) fi],
 [AC_DEFINE(DB_RESOLVE_SYMBOLS)])

dnl Assumption for now
HAVE_UNIX=1
AC_DEFINE(rep_HAVE_UNIX, 1)

dnl We need to find an integer type that's big enough to store any pointer
AC_MSG_CHECKING([for data type to store Lisp values])
AC_ARG_WITH(value-type,
 [  --with-value-type=TYPE  Implicitly signed integer type, at least as wide
			   as a pointer. [TYPE=<probed>] (see README)], [],
 [with_value_type="undef"])
if test "${with_value_type}" = "undef"; then
  AC_TRY_RUN([main () { exit (!(sizeof (int) >= sizeof (void *)));}],
	     [with_value_type=int])
fi
if test "${with_value_type}" = "undef"; then
  AC_TRY_RUN([main () { exit (!(sizeof (long int) >= sizeof (void *)));}],
	     [with_value_type="long int"])
fi
if test "${with_value_type}" = "undef"; then
  AC_TRY_RUN([main () { exit (!(sizeof (long long int) >= sizeof (void *)));}],
	     [with_value_type="long long int"])
fi
if test "${with_value_type}" = "undef"; then
  AC_MSG_ERROR([can't find Lisp value type; set --with-value-type (see README)])
fi
AC_MSG_RESULT([${with_value_type}])
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT, ${with_value_type})

dnl What's the suffix to get an integer constant of the above size?
AC_MSG_CHECKING([for value type constant suffix])
case "${with_value_type}" in
  "long long int"|"long long")
    rep_value_suffix=LL
    ;;
  *)
    dnl We should be okay to default to longs..
    rep_value_suffix=L
    ;;
esac
AC_MSG_RESULT([${rep_value_suffix}])
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT_SUFFIX, ${rep_value_suffix})

dnl What's the printf integer conversion for this type?
AC_MSG_CHECKING([for value type printf conversion])
case "${with_value_type}" in
  "long long int"|"long long")
    dnl other options would be L or q!?
    rep_value_conv=ll
    ;;
  long|"long int")
    rep_value_conv=l
    ;;
  *)
    rep_value_conv=
    ;;
esac
AC_MSG_RESULT([${rep_value_conv}])
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT_CONV, "${rep_value_conv}")

dnl This is the malloc granularity. It's unlikely that anything has
dnl less alignment than the default value of four bytes
AC_ARG_WITH(malloc-alignment,
 [  --with-malloc-alignment=BYTES
			  Must be less than or equal to the alignment
			   returned by the malloc function. [BYTES=4]], [],
 [with_malloc_alignment=4])
AC_DEFINE_UNQUOTED(rep_MALLOC_ALIGNMENT, ${with_malloc_alignment})

dnl Nonstandard exported symbols
AC_SUBST(version)
AC_SUBST(libversion)
AC_SUBST(repdir)
AC_SUBST(repexecdir)
AC_SUBST(repcommonexecdir)
AC_SUBST(replispdir)
AC_SUBST(repdocfile)
AC_SUBST(HAVE_UNIX)
AC_SUBST(HAVE_X11)
AC_SUBST(LIBOBJS)

AC_DEFINE_UNQUOTED(rep_VERSION, "${version}")

dnl Hacks for libintl
VERSION="$version"
PACKAGE="librep"
DATADIRNAME="share"
MKINSTALLDIRS='${top_srcdir}/mkinstalldirs'
USE_INCLUDED_LIBINTL=yes
INTLOBJS="\$(GETTOBJS)"
GT_YES='#'
GT_NO=''
l=l
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
AC_SUBST(DATADIRNAME)
AC_SUBST(MKINSTALLDIRS)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(INTLOBJS)
AC_SUBST(GT_YES)
AC_SUBST(GT_NO)
AC_SUBST(l)

dnl Build all files
AC_OUTPUT(${output_files})

dnl If it doesn't look like GNU Make is being used, give a friendly warning
tem=`make --version -f /dev/null 2>&1 | grep GNU`
if test "x$tem" = "x"; then
  AC_MSG_WARN([You need to use GNU Make when compiling])
fi

dnl Local variables:
dnl major-mode: sh-mode
dnl End: