source: git/omalloc/configure.ac @ f3b65d

spielwiese
Last change on this file since f3b65d was f3b65d, checked in by Hans Schoenemann <hannes@…>, 5 years ago
fix: pagesize via 'getconf PAGESIZE' (POSIX)
  • Property mode set to 100644
File size: 17.2 KB
Line 
1dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
2dnl File: configure.ac
3dnl Purpose: Process this file with autoconf to produce configure
4dnl Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
5dnl Created: 11/99
6dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
7
8AC_INIT([omalloc],[0.9.6])
9
10AC_CONFIG_MACRO_DIR([../m4])
11AC_CONFIG_AUX_DIR([../build-aux])
12AC_CONFIG_SRCDIR(om_Alloc.c)
13AC_CONFIG_HEADER([_config.h])
14
15AC_PROG_CC
16AC_PROG_CXX
17AM_PROG_AR
18
19SING_RESET_FLAGS()
20
21SING_WIN_FLAGS
22
23AM_MAINTAINER_MODE([enable])
24AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
25m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
26
27AM_SANITY_CHECK
28
29# Add pre'prefixed config
30AX_PREFIX_CONFIG_H([omConfig.h],[],[_config.h])
31
32# SING_CHECK_SET_ARGS()
33
34AC_SUBST(VERSION)
35
36dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
37dnl help for configure
38dnl
39
40AC_ARG_WITH(
41  external-config_h,
42  [ --with-external-config_h=HEADER_FILE
43                    use HEADER_FILE for external configuration])
44AC_ARG_WITH(
45  external-config_c,
46  [ --with-external-config_c=C_FILE
47                    use C_FILE for external implementations])
48AC_ARG_WITH(
49  malloc,
50  [ --with-malloc=system|external
51                    which malloc to use, default: malloc ])
52AC_ARG_WITH(
53  external-malloc_h,
54  [ --with-external-malloc-h=HEADER_FILE
55                    use HEADER_FILE for external malloc declaration])
56AC_ARG_WITH(
57  external-malloc_c,
58  [ --with-external-malloc-c=C_FILE
59                    use C_FILE for external malloc implementation])
60AC_ARG_WITH(
61  valloc,
62  [ --with-valloc=mmap|system|emulate
63                    how to get page-aligned memory, default: use first possible])
64AC_ARG_WITH(
65  align,
66  [ --with-align=8|sloppy|strict
67                    how memory is aligned,
68                    default: if possible sloppy, else strict])
69AC_ARG_WITH(
70  dense-bins,
71  [ --with-dense-bins  use dense bin distribution])
72AC_ARG_WITH(
73  inline,
74  [ --without-inline   do not inline])
75AC_ARG_WITH(
76  track,
77  [ --without-track    disable debug tracking functionality])
78AC_ARG_WITH(
79  track-fl,
80  [ --with-track-fl    track file and line numbers])
81AC_ARG_WITH(
82  track-return,
83  [ --with-track-return track return addresses])
84AC_ARG_WITH(
85  track-backtrace,
86  [ --with-track-backtrace track stack backtraces])
87AC_ARG_WITH(
88  track-custom,
89  [ --with-track-custom track custom values])
90AC_ARG_WITH(
91  internal_debug,
92  [ --with-internal-debug
93                       turn on internal debugging])
94AC_ARG_ENABLE(
95  debug,
96  [ --enable-debug    include backtrace stuff])
97
98AC_ARG_ENABLE(omalloc,
99   [AS_HELP_STRING([--disable-omalloc], [do NOT use omalloc but xalloc])],
100   [if test "x$enableval"  = "xyes"; then
101     ENABLE_OMALLOC=yes
102     AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
103     AC_DEFINE([HAVE_OMALLOC],[1])
104   else
105     ENABLE_OMALLOC=no
106   fi],
107   [ENABLE_OMALLOC=yes
108     AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
109     AC_DEFINE([HAVE_OMALLOC],[1])
110   ])
111dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
112dnl compiler/make  config
113dnl
114dnl I'm not sure why I did this
115dnl if test "${CFLAGS+set}" != set; then
116dnl  CFLAGS="-O"
117dnl  ac_cflags_set=no
118dnl fi
119
120CPPFLAGS="-I.. -I. $CPPFLAGS"
121AC_PROG_MAKE_SET
122AC_PROG_CC
123AC_PROG_CPP
124
125AC_PROG_LN_S
126AC_PROG_INSTALL
127AM_PROG_CC_C_O
128AC_C_CONST
129AC_C_INLINE
130
131LT_INIT([win32-dll])
132
133
134dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
135dnl check for programs
136dnl
137AC_CHECK_PROG(AR, ar, ar, :)
138if test "$ac_cv_prog_AR" = no; then
139  AC_MSG_ERROR(*** ar program not found)
140fi
141AC_CHECK_PROGS(PERL, perl, "no")
142if test "$ac_cv_prog_PERL" = no; then
143  AC_MSG_ERROR(*** perl program not found)
144fi
145
146AC_CHECK_PROG(ADDR2LINE, addr2line, addr2line, no)
147if test "$ac_cv_prog_ADDR2LINE" = addr2line; then
148  AC_DEFINE_UNQUOTED(OM_PROG_ADDR2LINE, "$ac_cv_prog_ADDR2LINE", "Name of addr2line")
149fi
150
151AC_MSG_NOTICE(HOSTCC set)
152HOSTCC=${HOSTCC:=$CC}
153HOSTLD=${HOSTLD:=$LD}
154HOSTCFLAGS=${HOSTCFLAGS:=$CFLAGS}
155  AC_SUBST(HOSTCC)
156  AC_SUBST(HOSTLD)
157  AC_SUBST(HOSTCFLAGS)
158
159dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
160dnl header file checks
161dnl
162AC_HEADER_STDC
163AC_CHECK_HEADERS(limits.h,,
164  AC_MSG_ERROR(Can not compile without limits.h))
165
166AC_CHECK_HEADERS(unistd.h sys/mman.h fcntl.h malloc.h malloc/malloc.h)
167
168AC_CHECK_FUNCS(popen mmap sbrk random malloc_usable_size malloc_size)
169
170dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
171dnl Find out more about particularity of the system
172dnl
173
174# sizes
175AC_CHECK_SIZEOF(long,4)
176AC_CHECK_SIZEOF(void*,4)
177AC_CHECK_SIZEOF(double, 8)
178AC_CHECK_SIZEOF(size_t, 4)
179
180if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
181  AC_MSG_ERROR(need equal sizes for long and void*)
182fi
183if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then
184  AC_MSG_ERROR(need void* to be 4 or 8 bytes long)
185fi
186if test "$ac_cv_sizeof_double" != 4 && test "$ac_cv_sizeof_double" != 8; then
187  AC_MSG_ERROR(need double to be 4 or 8 bytes long)
188fi
189
190dnl Set compiler, linker flags so that we can work with omalloc
191BACKUP_CFLAGS=$CFLAGS
192BACKUP_CXXFLAGS=$CXXFLAGS
193BACKUP_LDFLAGS=$LDFLAGS
194
195CFLAGS="$CFLAGS -I$srcdir"
196CXXFLAGS="$CXXFLAGS -I$srcdir"
197
198dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
199dnl figure out page size of the system
200dnl
201AC_MSG_CHECKING(size of system page)
202AC_CACHE_VAL(ac_cv_pagesize,
203ac_cv_pagesize=`getconf PAGESIZE`)
204# can not really handle pagesizes which are greater -- there must be a
205# bug somewhere
206if test $ac_cv_pagesize -gt 8192; then
207  ac_cv_pagesize=8192
208fi
209AC_MSG_RESULT($ac_cv_pagesize)
210if test "$ac_cv_pagesize" = 4096 || test "$ac_cv_pagesize" = 8192; then
211  AC_DEFINE_UNQUOTED(SIZEOF_SYSTEM_PAGE, $ac_cv_pagesize, "Page-size of the build-system")
212else
213AC_MSG_ERROR([need sytem page to be of size 4096 or 8192, but is $ac_cv_pagesize])
214fi
215
216AC_DEFINE_UNQUOTED(SIZEOF_OM_PAGE,SIZEOF_SYSTEM_PAGE,Page-size of the build-system)
217
218dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
219dnl check whether mmap actually works
220dnl
221if test "$ac_cv_func_mmap" = yes; then
222AC_MSG_CHECKING(whether mmap works)
223AC_CACHE_VAL(ac_cv_working_mmap,
224AC_TRY_RUN([
225#include <stdlib.h>
226#include "omMmap.c"
227int main()
228{
229  void* addr = omVallocMmap(128*${ac_cv_pagesize});
230  if (addr == 0 || ((unsigned long) addr % ${ac_cv_pagesize}))
231    exit(1);
232  exit(omVfreeMmap(addr, 128*${ac_cv_pagesize}));
233}], ac_cv_working_mmap=yes, ac_cv_working_mmap=no, ac_cv_working_mmap=no))
234AC_MSG_RESULT($ac_cv_working_mmap)
235if test "$ac_cv_working_mmap" = yes; then
236  AC_DEFINE(HAVE_WORKING_MMAP,1,"Whether we have a working mmap")
237fi
238fi
239
240dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
241dnl for strict alignment
242dnl
243AC_CACHE_CHECK(whether alignment needs to be strict, ac_cv_align_need_strict,
244AC_TRY_RUN([
245#include <stdlib.h>
246int main()
247{
248  void* ptr = (void*) malloc(12);
249  volatile double* d_ptr;
250  if ((unsigned long) ptr % 8 == 0) ptr = ptr + 4;
251  d_ptr = (double*) ptr;
252  *d_ptr = (double) 1.25;
253  if (*d_ptr != (double) 1.25) exit(1);
254  else exit(0);
255}
256], ac_cv_align_need_strict=no, ac_cv_align_need_strict=yes, ac_cv_align_need_strict=yes))
257
258dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
259dnl external config files
260dnl
261AC_MSG_CHECKING(for external config files)
262if test "${with_external_config_h+set}" = set; then
263    AC_DEFINE(OM_HAVE_EXTERNAL_CONFIG_H,1,"Whether we have external config.h")
264    EXTERNAL_CONFIG_HEADER=${with_external_config_h}
265    rm -f omExternalConfig.h
266    cp ${with_external_config_h} omExternalConfig.h
267fi
268if test "${with_external_config_c+set}" = set; then
269    AC_DEFINE(OM_HAVE_EXTERNAL_CONFIG_C,1,"Wether we have an external config.c")
270    EXTERNAL_CONFIG_SOURCE=${with_external_config_c}
271fi
272AC_SUBST(EXTERNAL_CONFIG_HEADER)
273AC_SUBST(EXTERNAL_CONFIG_SOURCE)
274if test "${EXTERNAL_CONFIG_HEADER+set}" = set || test "${EXTERNAL_CONFIG_SOURCE+set}" = set; then
275AC_MSG_RESULT(${EXTERNAL_CONFIG_HEADER} ${EXTERNAL_CONFIG_SOURCE})
276else
277AC_MSG_RESULT(none)
278fi
279
280dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
281dnl for malloc
282dnl
283AC_MSG_CHECKING(which malloc to use)
284if test "${with_malloc}" = system; then
285  OM_MALLOC_HEADER=omMallocSystem.h
286  AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc)
287  AC_DEFINE(OMALLOC_USES_SYSTEM_MALLOC,1,use system malloc as system allocator)
288elif test "${with_malloc}" = external; then
289  if test "${with_external_malloc_h+set}" != set; then
290    AC_MSG_ERROR(need --with_external_malloc_h for external malloc)
291  fi
292  AC_DEFINE(OMALLOC_USES_EXTERNAL_MALLOC,1,use external malloc as system allocator)
293  OM_MALLOC_HEADER=$with_external_malloc_h
294  OM_MALLOC_SOURCE=$with_external_malloc_c
295  AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc)
296else    ## default
297  OM_MALLOC_HEADER=omMallocSystem.h
298  AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc)
299  AC_DEFINE(OMALLOC_USES_SYSTEM_MALLOC,1,use system malloc as system allocator)
300fi
301AC_MSG_RESULT($with_malloc)
302
303AC_SUBST(OM_MALLOC_HEADER)
304AC_SUBST(OM_MALLOC_SOURCE)
305if test "${OM_MALLOC_SOURCE+set}" = set; then
306  AC_DEFINE(OM_HAVE_MALLOC_SOURCE,1,"Whether we have the source for malloc ()")
307fi
308
309dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
310dnl check whether valloc is provided and that it works
311dnl
312AC_MSG_CHECKING(whether working valloc exists)
313if test "${ac_cv_working_valloc}" = no; then
314  AC_MSG_RESULT( (cached) no)
315elif test "${ac_cv_working_valloc}" = "${OM_MALLOC_HEADER}_${OM_MALLOC_SOURCE}"; then
316  AC_MSG_RESULT( (cached) yes)
317else
318AC_TRY_RUN([
319#include <stdlib.h>
320#include "$OM_MALLOC_HEADER"
321#ifdef OM_HAVE_MALLOC_SOURCE
322#include "$OM_MALLOC_SOURCE"
323#endif
324
325int main()
326{
327  void* addr = OM_MALLOC_VALLOC(128*${ac_cv_pagesize});
328  if (addr == 0 || ((unsigned long) addr % ${ac_cv_pagesize}))
329    exit(1);
330  OM_MALLOC_VFREE(addr, 128*${ac_cv_pagesize});
331  exit(0);
332}
333], ac_cv_working_valloc="${OM_MALLOC_HEADER}_${OM_MALLOC_SOURCE}", ac_cv_working_valloc=no, ac_cv_working_valloc=no)
334if test "${ac_cv_working_valloc}" = no; then
335AC_MSG_RESULT(no)
336else
337AC_MSG_RESULT(yes)
338fi
339fi
340
341dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
342dnl for valloc
343dnl
344AC_MSG_CHECKING(which valloc to use)
345if test "${with_valloc+set}" != set || test "${with_valloc}" = mmap; then
346  if test "${ac_cv_working_mmap}" = yes; then
347    with_valloc=mmap
348    AC_DEFINE(OM_HAVE_VALLOC_MMAP,1,"Have valloc")
349  else
350    with_valloc=malloc
351  fi
352fi
353if test "${with_valloc}" = malloc; then
354  if test "${ac_cv_working_valloc}" != no; then
355    AC_DEFINE(OM_HAVE_VALLOC_MALLOC,1,"Have valloc")
356  else
357    with_valloc=emulate
358  fi
359fi
360AC_MSG_RESULT($with_valloc)
361
362dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
363dnl alignment
364dnl
365AC_MSG_CHECKING(how to align)
366if test "$with_align" = 8 || test "$ac_cv_sizeof_long" = 8; then
367  ac_cv_align=8
368  AC_DEFINE(OM_ALIGN_8,1,"Align to 8 bytes")
369else
370if test "$ac_cv_align_need_strict" = "yes" || test "$with_align" = "strict"; then
371  AC_DEFINE(OM_ALIGNMENT_NEEDS_WORK,1,"Whether alignment needs work")
372  ac_cv_align="strict"
373else
374  ac_cv_align="sloppy"
375fi
376fi
377AC_MSG_RESULT($ac_cv_align)
378
379dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
380dnl dense bins
381dnl
382AC_MSG_CHECKING(whether to use dense bins)
383if test "$with_dense_bins" = yes; then
384AC_MSG_RESULT(yes)
385AC_DEFINE(OM_HAVE_DENSE_BIN_DISTRIBUTION,1,"Whether we have dense bins")
386else
387AC_MSG_RESULT(no)
388fi
389
390dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
391dnl debug and inline
392dnl
393save_cflags="$CFLAGS"
394AC_MSG_CHECKING(whether to disable debugging)
395if test "$enable_debug" = yes; then
396AC_MSG_RESULT(no)
397CFLAGS="$CFLAGS -g"
398else
399AC_MSG_RESULT(yes)
400AC_DEFINE(OM_NDEBUG,1,"Disable debug")
401with_track=no
402fi
403AM_CONDITIONAL([WANT_DEBUG],[test x"$with_debug" = xyes])
404
405AC_MSG_CHECKING(whether to have tracking debug functionality)
406if test "$with_track" != no; then
407AC_MSG_RESULT(yes)
408AC_DEFINE(OM_HAVE_TRACK,1,"Have track")
409else
410AC_MSG_RESULT(no)
411fi
412
413AC_MSG_CHECKING(whether to use internal debug)
414if test "$with_internal_debug" = yes; then
415AC_MSG_RESULT(yes)
416AC_DEFINE(OM_INTERNAL_DEBUG,1,"Internal debug")
417with_inline=no
418else
419AC_MSG_RESULT(no)
420fi
421
422AC_MSG_CHECKING(whether to inline)
423if test "$ac_cv_c_inline" != no && test "$with_inline" != no; then
424  AC_DEFINE_UNQUOTED(OM_INLINE, static $ac_cv_c_inline, "inline-declaration")
425  AC_DEFINE_UNQUOTED(OM_INLINE_DECL, static $ac_cv_c_inline, "inline-declaration")
426  AC_DEFINE_UNQUOTED(OM_INLINE_IMPL, static $ac_cv_c_inline, "inline-declaration")
427  AC_DEFINE_UNQUOTED(OM_INLINE_LOCAL, static $ac_cv_c_inline, "inline-declaration")
428  AC_MSG_RESULT(yes)
429else
430  AC_DEFINE_UNQUOTED(OM_INLINE_DECL, extern, "inline-declaration")
431  AC_DEFINE_UNQUOTED(OM_INLINE_IMPL,, "inline-declaration")
432  AC_DEFINE_UNQUOTED(OM_INLINE_LOCAL, static, "inline-declaration")
433  AC_MSG_RESULT(no)
434fi
435
436dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
437dnl backtrace business
438dnl
439if test "x$with_track" != xno; then
440AC_MSG_CHECKING(whether GET_RET_ADDR works)
441AC_CACHE_VAL(ac_cv_get_return_addr_works,
442AC_TRY_RUN([
443#include <stdlib.h>
444#define OM_GET_RETURN_ADDR_WORKS 1
445#include "omReturn.h"
446int test_return_addr()
447{
448  char* f;
449  GET_RET_ADDR(f);
450  return (int)(long) f;
451}
452int main()
453{
454   exit(! test_return_addr());
455}
456], ac_cv_get_return_addr_works=yes,
457   ac_cv_get_return_addr_works=no,
458   ac_cv_get_return_addr_works=no))
459AC_MSG_RESULT($ac_cv_get_return_addr_works)
460if test "$ac_cv_get_return_addr_works" = yes; then
461AC_DEFINE(OM_GET_RETURN_ADDR_WORKS,1, "Whether get return address works")
462fi
463
464AC_MSG_CHECKING(whether omGetBackTrace works)
465AC_CACHE_VAL(ac_cv_get_backtrace_works,
466AC_TRY_RUN([
467#include <stdio.h>
468#include <stdlib.h>
469#include "omGetBackTrace.c"
470int test_backtrace0()
471{
472  void* bt @<:@ 10 @:>@ ;
473  int i = omGetBackTrace(bt, 0, 10);
474  return i;
475}
476int test_backtrace(){ return test_backtrace0(); }
477int main()
478{
479   int i;
480   #ifdef __APPLE__
481   /* omGetBackTrace crashes on OsX for i>2 */
482   i=0;
483   #else
484   omInitGetBackTrace();
485   i = test_backtrace();
486   #endif
487   if (i > 0) exit(0);
488   else exit(i+10);
489}
490], ac_cv_get_backtrace_works=yes,
491   ac_cv_get_backtrace_works=no,
492   ac_cv_get_backtrace_works=no))
493AC_MSG_RESULT($ac_cv_get_backtrace_works)
494if test "$ac_cv_get_backtrace_works" = yes; then
495AC_DEFINE(OM_GET_BACKTRACE_WORKS,1,"Whether omInitGetBackTrace () works")
496fi
497else
498   AC_MSG_CHECKING(whether GET_RET_ADDR works)
499   ac_cv_get_return_addr_works=no
500   AC_MSG_RESULT($ac_cv_get_return_addr_works)
501   AC_MSG_CHECKING(whether omGetBackTrace works)
502   ac_cv_get_backtrace_works=no
503   AC_MSG_RESULT($ac_cv_get_backtrace_works)
504fi
505
506AC_MSG_CHECKING(whether addr2line works)
507AC_CACHE_VAL(ac_cv_prog_addr2line_works,
508AC_TRY_RUN([
509#include <stdlib.h>
510#define OM_GET_RETURN_ADDR_WORKS 1
511#include "omReturn.h"
512#include "omStructs.h"
513/* #include "omGetBackTrace.h" */
514#include "omGetBackTrace.c"
515#include "omRet2Info.c"
516
517int test_Ret_2_Info()
518{
519  void* bt;
520  int i;
521  struct omRetInfo_s info;
522
523  GET_RET_ADDR(bt);
524  i = omBackTrace_2_RetInfo(&bt, &info, 1);
525  return i;
526}
527
528int main(int argc, char** argv)
529{
530  int i;
531  omInitRet_2_Info(*argv);
532  i = test_Ret_2_Info();
533  if (i==1) exit(0);
534  else exit (i+10);
535}
536], ac_cv_prog_addr2line_works=yes,
537   ac_cv_prog_addr2line_works=no,
538   ac_cv_prog_addr2line_works=no))
539AC_MSG_RESULT($ac_cv_prog_addr2line_works)
540
541CFLAGS="$save_cflags"
542
543AC_MSG_CHECKING(whether to track return addresses)
544if test "$with_track_return" = no || test "$ac_cv_get_return_addr_works" = no || test "$ac_cv_prog_addr2line_works" != yes; then
545  with_track_return=no
546else
547  AC_DEFINE(OM_TRACK_RETURN,1,"Whether to track return")
548  with_track_return=yes
549fi
550AC_MSG_RESULT($with_track_return)
551
552AC_MSG_CHECKING(whether to track files and line numbers)
553if test "$with_track_fl" = no && test "$with_track_return" = no; then
554  with_track_fl=yes
555fi
556if test "${with_track_fl+set}" != set; then
557  if test "$with_track_return" = yes; then
558    with_track_fl=no
559  else
560    with_track_fl=yes
561  fi
562fi
563AC_MSG_RESULT($with_track_fl)
564if test "$with_track_fl" = yes; then
565  AC_DEFINE(OM_TRACK_FILE_LINE,1,"Whether to track file-line")
566fi
567
568AC_MSG_CHECKING(whether to track stack backtraces)
569if test "$with_track" != no && test "$ac_cv_get_backtrace_works" = yes && test "$with_track_backtrace" != no && test "$ac_cv_prog_addr2line_works" = yes; then
570  with_track_backtrace=yes
571  AC_DEFINE(OM_TRACK_BACKTRACE,1,"Whether to track backtrace")
572else
573  with_track_backtrace=no
574fi
575AC_MSG_RESULT($with_track_backtrace)
576
577AC_MSG_CHECKING(whether to track custom values)
578if test "$with_track" != no && test "$with_track_custom" = yes; then
579  AC_DEFINE(OM_TRACK_CUSTOM,1,"Enable custom tracking")
580else
581  with_track_custom=no
582fi
583AC_MSG_RESULT($with_track_custom)
584
585dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
586dnl figure out the return type of sbrk
587dnl
588
589AC_MSG_CHECKING(return type of sbrk)
590AC_TRY_LINK(
591#define __USE_MISC
592#include <unistd.h>
593,
594void *sbrk();
595,
596AC_DEFINE(Void_t,void,"Type of void"),
597AC_DEFINE(Void_t,char,"Type of void"),
598)
599AC_MSG_RESULT(Void_t)
600
601
602AC_DEFINE(OM_PROVIDE_MALLOC,0,[Provide NO standard routines!])
603
604
605dnl Restore user-specified CFLAGS, CXXFLAGS, LIBS
606
607CFLAGS=$BACKUP_CFLAGS
608CXXFLAGS=$BACKUP_CXXFLAGS
609LDFLAGS=$BACKUP_LDFLAGS
610
611dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
612dnl wrap it up
613dnl
614AC_CONFIG_FILES([Makefile omalloc.pc])
615AC_OUTPUT
616
Note: See TracBrowser for help on using the repository browser.