source: git/omalloc/configure.ac @ 49d2b5

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