~ubuntu-branches/ubuntu/trusty/librep/trusty

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2001-11-13 15:06:22 UTC
  • Revision ID: james.westby@ubuntu.com-20011113150622-vgmgmk6srj3kldr3
Tags: upstream-0.15.2
ImportĀ upstreamĀ versionĀ 0.15.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl  Process this file with autoconf to produce a configure script.
 
2
dnl  Copyright (C) 1998 John Harper <john@dcs.warwick.ac.uk>
 
3
dnl  $Id: configure.in,v 1.135 2001/10/29 06:18:43 jsh Exp $
 
4
dnl
 
5
dnl  This file is part of librep.
 
6
dnl
 
7
dnl  librep is free software; you can redistribute it and/or modify it
 
8
dnl  under the terms of the GNU General Public License as published by
 
9
dnl  the Free Software Foundation; either version 2, or (at your option)
 
10
dnl  any later version.
 
11
dnl
 
12
dnl  librep is distributed in the hope that it will be useful, but
 
13
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
dnl  GNU General Public License for more details.
 
16
dnl
 
17
dnl  You should have received a copy of the GNU General Public License
 
18
dnl  along with librep; see the file COPYING.  If not, write to
 
19
dnl  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 
 
21
AC_REVISION($Revision: 1.135 $)
 
22
 
 
23
AC_INIT(src/rep_subrs.h)
 
24
AC_CONFIG_HEADER(config.h src/rep_config.h)
 
25
 
 
26
dnl Release versioning info
 
27
version="0.15.2"
 
28
 
 
29
dnl libtool versioning info: `CURRENT:REVISION:AGE'. CURRENT is the
 
30
dnl current interface id, REVISION is the version number of this
 
31
dnl implementation, AGE defines the first interface id also supported
 
32
dnl (i.e. all interfaces between CURRENT-AGE and CURRENT are supported)
 
33
libcurrent=11
 
34
librevision=2
 
35
libage=2
 
36
libversion="$libcurrent:$librevision:$libage"
 
37
 
 
38
makefile_template="Makefile.in:Makedefs.in"
 
39
output_files="src/Makefile:Makedefs.in:src/Makefile.in\
 
40
 lisp/Makefile:Makedefs.in:lisp/Makefile.in\
 
41
 Makefile:Makedefs.in:Makefile.in\
 
42
 man/Makefile:Makedefs.in:man/Makefile.in\
 
43
 intl/Makefile librep.spec"
 
44
 
 
45
dnl Find the system type
 
46
AC_CANONICAL_HOST
 
47
 
 
48
dnl Remove trailing slash in $prefix if necessary
 
49
case "${prefix}" in
 
50
  */)
 
51
    prefix=`echo ${prefix} | sed -e 's/^\(.*\)\/$/\1/'`
 
52
    ;;
 
53
esac
 
54
 
 
55
repdir='${datadir}/rep'
 
56
replispdir='${repdir}/${version}/lisp'
 
57
repexecdir='${libexecdir}/rep/${version}/${host_type}'
 
58
repcommonexecdir='${libexecdir}/rep/${host_type}'
 
59
repdocfile='${repexecdir}/DOC'
 
60
 
 
61
emacssitelispdir='${datadir}/emacs/site-lisp'
 
62
 
 
63
EXTRA_LIBOBJS=""
 
64
AC_SUBST(EXTRA_LIBOBJS)
 
65
 
 
66
dnl Checks for programs.
 
67
AC_PROG_CC
 
68
AC_ISC_POSIX
 
69
AC_PROG_CPP
 
70
AC_PROG_INSTALL
 
71
AC_PROG_LN_S
 
72
AC_PROG_MAKE_SET
 
73
AC_PROG_GCC_TRADITIONAL
 
74
 
 
75
AC_DISABLE_STATIC
 
76
AM_PROG_LIBTOOL
 
77
 
 
78
dnl Abort if shared libraries aren't enabled
 
79
if test "${enable_shared}" != "yes"; then
 
80
  AC_MSG_ERROR([Need shared libraries enabled])
 
81
fi
 
82
 
 
83
dnl Checks for libraries.
 
84
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
 
85
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
 
86
AC_CHECK_FUNC(dlopen, , AC_CHECK_LIB(dl, dlopen))
 
87
 
 
88
dnl Checks for header files.
 
89
AC_HEADER_DIRENT
 
90
AC_HEADER_STDC
 
91
AC_HEADER_SYS_WAIT
 
92
AC_HEADER_TIME
 
93
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 limits.h argz.h locale.h nl_types.h malloc.h sys/param.h)
 
94
 
 
95
dnl Check for GNU MP library and header files
 
96
AC_ARG_WITH(gmp,
 
97
 [  --without-gmp                 Don't use GMP for bignum/rational numbers],
 
98
 [], [with_gmp=maybe])
 
99
 
 
100
GMP_LIBS="-lm"
 
101
if test "$with_gmp" != "no"; then
 
102
  AC_ARG_WITH(gmp-prefix, [  --with-gmp-prefix=DIR   path to GMP],
 
103
   [if test "$withval" != "no"; then
 
104
      CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
105
      LDFLAGS="${LDFLAGS} -L$withval/lib"
 
106
    fi],
 
107
   dnl debian brain-damage
 
108
   [if test -d /usr/include/gmp2; then
 
109
      CPPFLAGS="${CPPFLAGS} -I/usr/include/gmp2"
 
110
    fi])
 
111
 
 
112
  found_gmp=no
 
113
  AC_CHECK_HEADER(gmp.h,
 
114
    [AC_CHECK_LIB(gmp, mpz_init,
 
115
       [GMP_LIBS="-lgmp -lm"; found_gmp=yes],
 
116
       [AC_CHECK_LIB(gmp, __gmpz_init,
 
117
          [GMP_LIBS="-lgmp -lm"; found_gmp=yes])])])
 
118
 
 
119
  if test "$found_gmp" = "yes"; then
 
120
    AC_DEFINE(HAVE_GMP)
 
121
    _libs="$LIBS"
 
122
    LIBS="$LIBS $GMP_LIBS"
 
123
    AC_CHECK_FUNC(__gmp_randinit, AC_DEFINE(HAVE_GMP_RANDINIT))
 
124
    LIBS="$_libs"
 
125
  elif test "$with_gmp" != "no"; then
 
126
    AC_MSG_ERROR([Can't find GMP (--without-gmp for cut-down non-GMP build)])
 
127
  fi
 
128
fi
 
129
AC_SUBST(GMP_LIBS)
 
130
 
 
131
dnl Check for GNU DBM library and header files
 
132
AC_ARG_WITH(gdbm-prefix,
 
133
[  --with-gdbm-prefix=DIR  path to GDBM],[
 
134
  if test "$withval" != "no"; then
 
135
    CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
136
    LDFLAGS="${LDFLAGS} -L$withval/lib"
 
137
  fi
 
138
])
 
139
AC_CHECK_HEADER(gdbm.h,
 
140
    AC_CHECK_LIB(gdbm, gdbm_open, GDBM_LIBS="-lgdbm",
 
141
        AC_MSG_ERROR(Cannot find GDBM library)),
 
142
    AC_MSG_ERROR(Cannot find GDBM header))
 
143
AC_SUBST(GDBM_LIBS)
 
144
 
 
145
dnl Check for Doug Lea's malloc in libc, otherwise compile dlmalloc.c
 
146
doug_lea_malloc=yes
 
147
AC_CHECK_FUNC(malloc_get_state, , doug_lea_malloc=no)
 
148
AC_CHECK_FUNC(malloc_set_state, , doug_lea_malloc=no)
 
149
if test "$doug_lea_malloc" = "no"; then
 
150
  case ${host} in
 
151
    *-dec-osf*)
 
152
      dnl dlmalloc is broken on Tru64
 
153
      AC_DEFINE(LIBC_MALLOC)
 
154
      ;;
 
155
    *)
 
156
      EXTRA_LIBOBJS="${EXTRA_LIBOBJS} dlmalloc.o"
 
157
      AC_DEFINE(DOUG_LEA_MALLOC)
 
158
      ;;
 
159
  esac
 
160
else
 
161
  AC_DEFINE(DOUG_LEA_MALLOC)
 
162
  AC_DEFINE(LIBC_MALLOC)
 
163
fi
 
164
 
 
165
dnl Check for readline
 
166
AC_ARG_WITH(readline,
 
167
 [  --with-readline         support fancy command input editing
 
168
  --without-readline      Don't use readline], [], [with_readline=maybe])
 
169
 
 
170
if test "$with_readline" != "no"; then
 
171
  AC_ARG_WITH(readline-prefix,
 
172
  [  --with-readline-prefix=DIR path to readline],
 
173
  [ if test "$withval" != "no" -a "$withval" != "yes"; then
 
174
    # Save in case test with directory specified fails
 
175
    _cppflags=${CPPFLAGS}
 
176
    _ldflags=${LDFLAGS}
 
177
 
 
178
    CPPFLAGS="${CPPFLAGS} -I$withval/include"
 
179
    LDFLAGS="${LDFLAGS} -L$withval/lib"
 
180
  fi ])
 
181
 
 
182
  dnl check for terminal library
 
183
  dnl this is a very cool solution from octave's configure.in
 
184
  unset tcap
 
185
  for termlib in ncurses curses termcap terminfo termlib; do
 
186
    AC_CHECK_LIB(${termlib}, tputs, [tcap="$tcap -l$termlib"])
 
187
    case "$tcap" in
 
188
      *-l${termlib}*)
 
189
        break
 
190
      ;;
 
191
    esac
 
192
  done
 
193
 
 
194
  AC_CHECK_HEADER(readline/readline.h,
 
195
    AC_CHECK_LIB(readline, readline,[
 
196
      READLINE_LIBS="-lreadline $tcap"
 
197
      AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
 
198
 
 
199
  if test -z "$READLINE_LIBS"; then
 
200
    if test "$with_readline_prefix" = "yes"; then
 
201
      AC_MSG_ERROR([Can't find readline libraries])
 
202
    else
 
203
      CPPFLAGS=${_cppflags}
 
204
      LDFLAGS=${_ldflags}
 
205
    fi
 
206
  fi
 
207
fi
 
208
AC_SUBST(READLINE_LIBS)
 
209
 
 
210
dnl Check for dynamic loading
 
211
AC_CHECK_HEADER(dlfcn.h, [AC_DEFINE(HAVE_DLFCN_H)])
 
212
AC_CHECK_HEADER(dl.h, [AC_DEFINE(HAVE_DL_H)])
 
213
AC_CHECK_HEADER(sys/dl.h, [AC_DEFINE(HAVE_SYS_DL_H)])
 
214
dl_ok=no
 
215
AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_DLOPEN) dl_ok=dl],
 
216
    AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_DLOPEN) dl_ok=dl]))
 
217
AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD) dl_ok=shl],
 
218
    AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_DLOPEN) dl_ok=shl]))
 
219
 
 
220
if test $dl_ok = dl; then
 
221
  AC_MSG_CHECKING([for preceding underscore in symbols])
 
222
  dnl copied from glib configure.in
 
223
  AC_TRY_RUN([#ifdef HAVE_DLFCN_H
 
224
              # include <dlfcn.h>
 
225
              #endif
 
226
              int glib_underscore_test (void) { return 42; }
 
227
              int main() {
 
228
                void *f1 = (void*)0, *f2 = (void*)0, *handle;
 
229
                handle = dlopen ((void*)0, 0);
 
230
                if (handle) {
 
231
                  f1 = dlsym (handle, "glib_underscore_test");
 
232
                  f2 = dlsym (handle, "_glib_underscore_test");
 
233
                } return (!f2 || f1);
 
234
              }],
 
235
              [AC_DEFINE(DLSYM_NEED_USCORE)
 
236
               AC_MSG_RESULT(yes)],
 
237
              [AC_MSG_RESULT(no)])
 
238
 
 
239
  dnl RTLD_GLOBAL is broken for Tru64 UNIX V5.0 and V5.0A, such that
 
240
  dnl   xh = dlopen("libx.so", RTLD_GLOBAL|RTLD_LAZY); /* provides func */
 
241
  dnl   yh = dlopen("liby.so", RTLD_GLOBAL|RTLD_LAZY); /* provides func */
 
242
  dnl   yf = dlsym(yh, "func"); /* Error: returns func from libx.so */
 
243
  dnl It's hard to test for this apart from the version string, so
 
244
  dnl that's what we use.
 
245
  case ${host} in
 
246
    *-dec-osf5*)
 
247
      AC_MSG_CHECKING([for broken RTLD_GLOBAL on Tru64])
 
248
      if /usr/sbin/sizer -v | grep -E -q -e 'UNIX [[TVX]]5\.0A?(-[[[:digit:]]]+)? '; then
 
249
          AC_DEFINE(BROKEN_RTLD_GLOBAL)
 
250
          AC_MSG_RESULT(yes)
 
251
      else
 
252
          AC_MSG_RESULT(no)
 
253
      fi
 
254
      ;;
 
255
  esac
 
256
fi
 
257
 
 
258
if test $dl_ok != no; then
 
259
  AC_DEFINE(HAVE_DYNAMIC_LOADING)
 
260
else
 
261
  AC_MSG_ERROR([can't figure out how to do dynamic loading])
 
262
fi
 
263
 
 
264
dnl Checks for typedefs, structures, and compiler characteristics.
 
265
AC_C_CONST
 
266
AC_C_INLINE
 
267
AC_TYPE_OFF_T
 
268
AC_TYPE_PID_T
 
269
AC_TYPE_SIZE_T
 
270
AC_TYPE_SIGNAL
 
271
 
 
272
dnl Checks for library functions.
 
273
AC_FUNC_ALLOCA
 
274
AC_FUNC_MMAP
 
275
AC_FUNC_MEMCMP
 
276
AC_FUNC_VPRINTF
 
277
AC_CHECK_FUNCS(getcwd gethostname select socket strcspn strerror strstr stpcpy strtol psignal strsignal snprintf grantpt lrand48 getpagesize setitimer dladdr dlerror munmap putenv setenv setlocale strchr strcasecmp strncasecmp strdup __argz_count __argz_stringify __argz_next siginterrupt gettimeofday strtoll strtoq)
 
278
AC_REPLACE_FUNCS(realpath)
 
279
 
 
280
dnl check for crypt () function
 
281
AC_CHECK_FUNC(crypt, [AC_DEFINE(HAVE_CRYPT)],
 
282
    AC_CHECK_LIB(crypt, crypt, [AC_DEFINE(HAVE_CRYPT)
 
283
                                LIBS="$LIBS -lcrypt"]))
 
284
 
 
285
dnl Custom tests
 
286
 
 
287
dnl How do we get dependency lines in the Makefile?
 
288
if test "x${GCC}" = "xyes"; then
 
289
  MAKEDEP='$(CC) -MM'
 
290
else
 
291
  case ${host} in
 
292
    *-dec-osf*)
 
293
      dnl works on Tru64
 
294
      MAKEDEP='$(CC) -M'
 
295
      ;;
 
296
    *-sun-solaris*)
 
297
      dnl works on Solaris
 
298
      MAKEDEP='/usr/ccs/lib/cpp -M'
 
299
      ;;
 
300
    *)
 
301
      dnl disable dependences?
 
302
      MAKEDEP='true'
 
303
      ;;
 
304
  esac
 
305
fi
 
306
AC_SUBST(MAKEDEP)
 
307
 
 
308
dnl If using GCC and it doesn't look as though the cflags have been
 
309
dnl set explicitly, add some warning options.
 
310
if test "x${GCC}" = "xyes" -a "x$CFLAGS" = "x-g -O2"; then
 
311
  CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wmissing-prototypes"
 
312
  case ${host} in
 
313
    *-sun-solaris*)
 
314
      dnl Turn off implicit-int warnings since the X11 includes
 
315
      dnl on Solaris generate a lot of these
 
316
      CFLAGS="${CFLAGS} -Wno-implicit-int"
 
317
      ;;
 
318
  esac
 
319
fi
 
320
 
 
321
AC_ARG_WITH(extra-cflags,
 
322
  [  --with-extra-cflags=FLAGS Extra flags to pass to C compiler],
 
323
  CFLAGS="${CFLAGS} $with_extra_cflags")
 
324
 
 
325
dnl Does <unistd.h> declare char **environ?
 
326
AC_CACHE_CHECK([whether unistd.h declares environ], jade_cv_decl_environ,
 
327
 AC_TRY_COMPILE([#include <unistd.h>], [char **foo = environ;],
 
328
  [jade_cv_decl_environ=yes],
 
329
  [jade_cv_decl_environ=no]))
 
330
if test ${jade_cv_decl_environ} = no; then
 
331
  AC_DEFINE(ENVIRON_UNDECLARED)
 
332
fi
 
333
 
 
334
dnl Are ptys available, and if so, how?
 
335
AC_MSG_CHECKING([whether /dev/ptmx exists])
 
336
if test -r /dev/ptmx; then
 
337
  AC_MSG_RESULT([yes])
 
338
  AC_DEFINE(HAVE_PTYS)
 
339
  AC_DEFINE(HAVE_DEV_PTMX)
 
340
else
 
341
  AC_MSG_RESULT([no])
 
342
fi
 
343
 
 
344
dnl Look for old-style /dev/ptyXN devices
 
345
AC_CACHE_CHECK([whether /dev/ptyXN devices exist], jade_cv_sys_dev_pty,
 
346
 jade_cv_sys_dev_pty=no
 
347
 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
 
348
   if test -r "/dev/pty${c}0"; then
 
349
     jade_cv_sys_dev_pty=${c}
 
350
     break
 
351
   fi
 
352
 done)
 
353
if test ${jade_cv_sys_dev_pty} != no; then
 
354
  AC_DEFINE(HAVE_PTYS)
 
355
  AC_DEFINE_UNQUOTED(FIRST_PTY_LETTER, '${jade_cv_sys_dev_pty}')
 
356
fi
 
357
 
 
358
dnl Try to find the aclocal directory for installation
 
359
aclocaldir=none
 
360
AC_ARG_WITH(aclocaldir,
 
361
  [  --with-aclocaldir=DIR   Directory in which to install autoconf macros],
 
362
  aclocaldir=$withval)
 
363
AC_MSG_CHECKING([for aclocal directory])
 
364
if test "$aclocaldir" = none; then
 
365
  aclocaldir="`aclocal --print-ac-dir 2>/dev/null`"
 
366
  if test "x${aclocaldir}" = "x"; then
 
367
    aclocaldir='${datadir}/aclocal'
 
368
  fi
 
369
fi
 
370
AC_MSG_RESULT([${aclocaldir}])
 
371
AC_SUBST(aclocaldir)
 
372
 
 
373
AC_ARG_ENABLE(continuations,
 
374
 [  --disable-continuations Don't include support for continuations
 
375
                           or multi-threading],
 
376
 [if test "$enableval" != "no"; then AC_DEFINE(WITH_CONTINUATIONS) fi],
 
377
 [AC_DEFINE(WITH_CONTINUATIONS)])
 
378
 
 
379
AC_ARG_ENABLE(dballoc,
 
380
 [  --enable-dballoc      Trace all memory allocations],
 
381
 [if test "$enableval" != "no"; then AC_DEFINE(DEBUG_SYS_ALLOC) fi])
 
382
 
 
383
AC_ARG_ENABLE(dbsyms,
 
384
 [  --disable-dbsyms      When writing debug output, don't translate
 
385
                           addresses to symbol names],
 
386
 [if test "$enableval" != "no"; then AC_DEFINE(DB_RESOLVE_SYMBOLS) fi],
 
387
 [AC_DEFINE(DB_RESOLVE_SYMBOLS)])
 
388
 
 
389
AC_ARG_ENABLE(gprof,
 
390
 [  --enable-gprof        Build for gprof (needs --enable-static)],
 
391
 [CFLAGS="${CFLAGS} -pg"; LDFLAGS="${LDFLAGS} -pg"])
 
392
 
 
393
AC_ARG_ENABLE(full-name-terminator,
 
394
 [  --enable-full-name-terminator=C Full name in gecos field of passwd
 
395
                           file is terminated by first C character],
 
396
 [if test "$enableval" != "no"; then
 
397
   enableval="'$enableval'"
 
398
   AC_DEFINE_UNQUOTED(FULL_NAME_TERMINATOR, $enableval)
 
399
  fi])
 
400
 
 
401
dnl Assumption for now
 
402
HAVE_UNIX=1
 
403
AC_DEFINE(rep_HAVE_UNIX, 1)
 
404
 
 
405
dnl We need to find an integer type that's big enough to store any pointer
 
406
AC_MSG_CHECKING([for data type to store Lisp values])
 
407
AC_ARG_WITH(value-type,
 
408
 [  --with-value-type=TYPE  Implicitly signed integer type, at least as wide
 
409
                           as a pointer. [TYPE=<probed>] (see README)], [],
 
410
 [with_value_type="undef"])
 
411
if test "${with_value_type}" = "undef"; then
 
412
  AC_TRY_RUN([main () { exit (!(sizeof (int) >= sizeof (void *)));}],
 
413
             [with_value_type=int])
 
414
fi
 
415
if test "${with_value_type}" = "undef"; then
 
416
  AC_TRY_RUN([main () { exit (!(sizeof (long int) >= sizeof (void *)));}],
 
417
             [with_value_type="long int"])
 
418
fi
 
419
if test "${with_value_type}" = "undef"; then
 
420
  AC_TRY_RUN([main () { exit (!(sizeof (long long int) >= sizeof (void *)));}],
 
421
             [with_value_type="long long int"])
 
422
fi
 
423
if test "${with_value_type}" = "undef"; then
 
424
  AC_MSG_ERROR([can't find Lisp value type; set --with-value-type (see README)])
 
425
fi
 
426
AC_MSG_RESULT([${with_value_type}])
 
427
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT, ${with_value_type})
 
428
 
 
429
dnl Find the size (in bits) of the chosen value type
 
430
AC_MSG_CHECKING([for size of Lisp value type])
 
431
AC_ARG_WITH(value-sizeof,
 
432
 [  --with-value-sizeof=N   Size (in bytes) of value type. [N=<probed>]], [],
 
433
 [with_value_sizeof="undef"])
 
434
if test "${with_value_sizeof}" = "undef"; then
 
435
  dnl the following fragment is inspired by AC_CHECK_SIZEOF
 
436
  AC_TRY_RUN([#include <stdio.h>
 
437
              main () {
 
438
                FILE *f = fopen ("conftestval", "w");
 
439
                if (!f) exit (1);
 
440
                fprintf (f, "%d\n", sizeof (${with_value_type}));
 
441
                exit (0);
 
442
              }],
 
443
              [ with_value_sizeof=`cat conftestval`; rm -f conftestval])
 
444
fi
 
445
AC_MSG_RESULT([${with_value_sizeof} bytes])
 
446
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT_SIZEOF, ${with_value_sizeof})
 
447
 
 
448
dnl What's the suffix to get an integer constant of the above size?
 
449
AC_MSG_CHECKING([for value type constant suffix])
 
450
case "${with_value_type}" in
 
451
  "long long int"|"long long")
 
452
    rep_value_suffix=LL
 
453
    ;;
 
454
  *)
 
455
    dnl We should be okay to default to longs..
 
456
    rep_value_suffix=L
 
457
    ;;
 
458
esac
 
459
AC_MSG_RESULT([${rep_value_suffix}])
 
460
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT_SUFFIX, ${rep_value_suffix})
 
461
 
 
462
dnl What's the printf integer conversion for this type?
 
463
AC_MSG_CHECKING([for value type printf conversion])
 
464
case "${with_value_type}" in
 
465
  "long long int"|"long long")
 
466
    dnl other options would be L or q!?
 
467
    rep_value_conv=ll
 
468
    ;;
 
469
  long|"long int")
 
470
    rep_value_conv=l
 
471
    ;;
 
472
  *)
 
473
    rep_value_conv=
 
474
    ;;
 
475
esac
 
476
AC_MSG_RESULT([${rep_value_conv}])
 
477
AC_DEFINE_UNQUOTED(rep_PTR_SIZED_INT_CONV, "${rep_value_conv}")
 
478
 
 
479
dnl Check for size of long
 
480
AC_CHECK_SIZEOF(long)
 
481
 
 
482
dnl Check if `long long int' is available, also check it's size, if not
 
483
dnl available, then set it's size to the same as long
 
484
AC_MSG_CHECKING([for long long int])
 
485
AC_TRY_COMPILE([],[long long int foo = 42;],
 
486
               [AC_MSG_RESULT(yes)
 
487
                AC_DEFINE(rep_HAVE_LONG_LONG,1)
 
488
                AC_CHECK_SIZEOF(long long)],
 
489
               [AC_MSG_RESULT(no)
 
490
                AC_DEFINE(SIZEOF_LONG_LONG,SIZEOF_LONG)])
 
491
 
 
492
 
 
493
dnl This is the malloc granularity. It's unlikely that anything has
 
494
dnl less alignment than the default value of the number of bytes in
 
495
dnl the value type
 
496
AC_ARG_WITH(malloc-alignment,
 
497
 [  --with-malloc-alignment=BYTES Must be less than or equal to the alignment
 
498
                           returned by the malloc function. [BYTES=N]], [],
 
499
 [with_malloc_alignment=${with_value_sizeof}])
 
500
AC_DEFINE_UNQUOTED(rep_MALLOC_ALIGNMENT, ${with_malloc_alignment})
 
501
 
 
502
dnl Check for gcc crashes on alpha (seems to be fixed in new snapshots, but
 
503
dnl just to make it compile on all machines)
 
504
if test "x${GCC}" = "xyes"; then
 
505
  AC_MSG_CHECKING([for broken alpha gcc])
 
506
  AC_TRY_COMPILE([],[__builtin_return_address(1);],
 
507
                 [AC_MSG_RESULT(no)],
 
508
                 [AC_DEFINE(BROKEN_ALPHA_GCC,1)
 
509
                  AC_MSG_RESULT(yes)
 
510
                  AC_MSG_WARN([Backtrace support will not be compiled])])
 
511
fi
 
512
 
 
513
AC_MSG_CHECKING([for stack growth direction])
 
514
AC_ARG_WITH(stack-direction,
 
515
 [  --with-stack-direction=DIR Stack growth direction. -1 for downwards,
 
516
                           +1 for upwards.],
 
517
 [AC_MSG_RESULT(${with_stack_direction})],
 
518
 [with_stack_direction=unknown])
 
519
if test "${with_stack_direction}" = unknown; then
 
520
  case ${host_cpu} in
 
521
    sparc|i?86)
 
522
      AC_MSG_RESULT([assuming downwards])
 
523
      with_stack_direction="-1"
 
524
      ;;
 
525
    dnl any other known stack directions..?
 
526
  esac
 
527
fi
 
528
if test "${with_stack_direction}" = unknown; then
 
529
  AC_TRY_RUN([ void inner (char *foo) { char bar; exit (!(foo >= &bar)); }
 
530
               void main () { char foo; inner (&foo); } ],
 
531
   [AC_MSG_RESULT([downwards])
 
532
    with_stack_direction=-1],
 
533
   [AC_MSG_RESULT([upwards])
 
534
    with_stack_direction=+1])
 
535
fi
 
536
if test "${with_stack_direction}" != unknown; then
 
537
  AC_DEFINE_UNQUOTED(STACK_DIRECTION, ${with_stack_direction})
 
538
fi
 
539
 
 
540
dnl Nonstandard exported symbols
 
541
AC_SUBST(version)
 
542
AC_SUBST(libversion)
 
543
AC_SUBST(repdir)
 
544
AC_SUBST(repexecdir)
 
545
AC_SUBST(repcommonexecdir)
 
546
AC_SUBST(replispdir)
 
547
AC_SUBST(repdocfile)
 
548
AC_SUBST(emacssitelispdir)
 
549
AC_SUBST(HAVE_UNIX)
 
550
AC_SUBST(HAVE_X11)
 
551
AC_SUBST(LIBOBJS)
 
552
 
 
553
AC_DEFINE_UNQUOTED(rep_VERSION, "${version}")
 
554
AC_DEFINE_UNQUOTED(rep_INTERFACE, ${libcurrent})
 
555
 
 
556
dnl Hacks for libintl
 
557
AM_LC_MESSAGES
 
558
VERSION="$version"
 
559
PACKAGE="librep"
 
560
DATADIRNAME="share"
 
561
MKINSTALLDIRS='${top_srcdir}/mkinstalldirs'
 
562
INTLOBJS="\$(GETTOBJS)"
 
563
GT_YES='#'
 
564
GT_NO=''
 
565
l=l
 
566
AC_SUBST(VERSION)
 
567
AC_SUBST(PACKAGE)
 
568
AC_SUBST(DATADIRNAME)
 
569
AC_SUBST(MKINSTALLDIRS)
 
570
AC_SUBST(INTLOBJS)
 
571
AC_SUBST(GT_YES)
 
572
AC_SUBST(GT_NO)
 
573
AC_SUBST(l)
 
574
 
 
575
dnl If it looks like GNU gettext is in libc, don't compile a local copy
 
576
USE_INCLUDED_LIBINTL=yes
 
577
AC_SUBST(USE_INCLUDED_LIBINTL)
 
578
AC_CHECK_FUNC(_nl_msg_cat_cntr,
 
579
 [AC_DEFINE(LIBC_GETTEXT)
 
580
  AC_CHECK_HEADERS(libintl.h)
 
581
  USE_INCLUDED_LIBINTL=no])
 
582
 
 
583
dnl Build all files. Makes sure rules.mk is rebuild each time
 
584
AC_OUTPUT(${output_files}, [rm -f rules.mk])
 
585
 
 
586
dnl If it doesn't look like GNU Make is being used, give a friendly warning
 
587
tem=`make --version -f /dev/null 2>&1 | grep GNU`
 
588
if test "x$tem" = "x"; then
 
589
  AC_MSG_WARN([You need to use GNU Make when compiling])
 
590
fi
 
591
 
 
592
dnl Local variables:
 
593
dnl major-mode: sh-mode
 
594
dnl End: