source: git/omalloc/configure.ac @ 996cc8

spielwiese
Last change on this file since 996cc8 was 996cc8, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Fixing the problem of regeneration of config headers
  • Property mode set to 100644
File size: 17.1 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
181main()
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"
211main()
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>
230main()
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
306main()
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
344main()
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
412AC_MSG_CHECKING(whether to disable debugging)
413if test "$with_debug" != no; then
414AC_MSG_RESULT(no)
415else
416AC_MSG_RESULT(yes)
417AC_DEFINE(OM_NDEBUG,1,"Disable debug")
418with_track=no
419fi
420
421AC_MSG_CHECKING(whether to have tracking debug functionality)
422if test "$with_track" != no; then
423AC_MSG_RESULT(yes)
424AC_DEFINE(OM_HAVE_TRACK,1,"Have track")
425else
426AC_MSG_RESULT(no)
427fi
428
429AC_MSG_CHECKING(whether to use internal debug)
430if test "$with_internal_debug" = yes; then
431AC_MSG_RESULT(yes)
432AC_DEFINE(OM_INTERNAL_DEBUG,1,"Internal debug")
433with_inline=no
434else
435AC_MSG_RESULT(no)
436fi
437
438AC_MSG_CHECKING(whether to inline)
439if test "$ac_cv_c_inline" != no && test "$with_inline" != no; then
440  AC_DEFINE_UNQUOTED(OM_INLINE, static $ac_cv_c_inline, "inline-declaration")
441  AC_DEFINE_UNQUOTED(OM_INLINE_DECL, static $ac_cv_c_inline, "inline-declaration")
442  AC_DEFINE_UNQUOTED(OM_INLINE_IMPL, static $ac_cv_c_inline, "inline-declaration")
443  AC_DEFINE_UNQUOTED(OM_INLINE_LOCAL, static $ac_cv_c_inline, "inline-declaration")
444  AC_MSG_RESULT(yes)
445else
446  AC_DEFINE_UNQUOTED(OM_INLINE_DECL, extern, "inline-declaration")
447  AC_DEFINE_UNQUOTED(OM_INLINE_IMPL,, "inline-declaration")
448  AC_DEFINE_UNQUOTED(OM_INLINE_LOCAL, static, "inline-declaration")
449  AC_MSG_RESULT(no)
450fi
451
452dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
453dnl backtrace business
454dnl
455AC_MSG_CHECKING(whether GET_RET_ADDR works)
456AC_CACHE_VAL(ac_cv_get_return_addr_works,
457AC_TRY_RUN([
458#include <stdlib.h>
459#include "omReturn.h"
460int test_return_addr()
461{
462  char* f;
463  GET_RET_ADDR(f);
464  return (int)(long) f;
465}
466int main()
467{
468   exit(! test_return_addr());
469}
470], ac_cv_get_return_addr_works=yes,
471   ac_cv_get_return_addr_works=no,
472   ac_cv_get_return_addr_works=no))
473AC_MSG_RESULT($ac_cv_get_return_addr_works)
474if test "$ac_cv_get_return_addr_works" = yes; then
475AC_DEFINE(OM_GET_RETURN_ADDR_WORKS,1, "Whether get return address works")
476fi
477
478AC_MSG_CHECKING(whether omGetBackTrace works)
479AC_CACHE_VAL(ac_cv_get_backtrace_works,
480AC_TRY_RUN([
481#include <stdio.h>
482#include <stdlib.h>
483#include "omGetBackTrace.c"
484int test_backtrace()
485{
486  void* bt;
487  int i = omGetBackTrace(&bt, 0, 10);
488  return i;
489}
490int main()
491{
492   int i;
493   #ifdef __APPLE__
494   /* omGetBackTrace crashes on OsX for i>2 */
495   i=0;
496   #else
497   omInitGetBackTrace();
498   i = test_backtrace();
499   #endif
500   if (i > 0) exit(0);
501   else exit(i+10);
502}
503], ac_cv_get_backtrace_works=yes,
504   ac_cv_get_backtrace_works=no,
505   ac_cv_get_backtrace_works=no))
506AC_MSG_RESULT($ac_cv_get_backtrace_works)
507if test "$ac_cv_get_backtrace_works" = yes; then
508AC_DEFINE(OM_GET_BACKTRACE_WORKS,1,"Whether omInitGetBackTrace () works")
509fi
510
511AC_MSG_CHECKING(whether addr2line works)
512AC_CACHE_VAL(ac_cv_prog_addr2line_works,
513AC_TRY_RUN([
514#include <stdlib.h>
515#undef OM_GET_BACKTRACE_WORKS
516#include "omReturn.h"
517#include "omStructs.h"
518#include "omGetBackTrace.h"
519#include "omRet2Info.c"
520
521int test_Ret_2_Info()
522{
523  void* bt;
524  int i;
525  struct omRetInfo_s info;
526
527  GET_RET_ADDR(bt);
528  i = omBackTrace_2_RetInfo(&bt, &info, 1);
529  return i;
530}
531
532int main(int argc, char** argv)
533{
534  int i;
535  omInitRet_2_Info(*argv);
536  i = test_Ret_2_Info();
537  if (i==1) exit(0);
538  else exit (i+10);
539}
540], ac_cv_prog_addr2line_works=yes,
541   ac_cv_prog_addr2line_works=no,
542   ac_cv_prog_addr2line_works=no))
543AC_MSG_RESULT($ac_cv_prog_addr2line_works)
544
545AC_MSG_CHECKING(whether to track return addresses)
546if test "$with_track_return" = no || test "$ac_cv_get_return_addr_works" = no || test "$ac_cv_prog_addr2line_works" != yes; then
547  with_track_return=no
548else
549  AC_DEFINE(OM_TRACK_RETURN,1,"Whether to track return")
550  with_track_return=yes
551fi
552AC_MSG_RESULT($with_track_return)
553
554AC_MSG_CHECKING(whether to track files and line numbers)
555if test "$with_track_fl" = no && test "$with_track_return" = no; then
556  with_track_fl=yes
557fi
558if test "${with_track_fl+set}" != set; then
559  if test "$with_track_return" = yes; then
560    with_track_fl=no
561  else
562    with_track_fl=yes
563  fi
564fi
565AC_MSG_RESULT($with_track_fl)
566if test "$with_track_fl" = yes; then
567  AC_DEFINE(OM_TRACK_FILE_LINE,1,"Whether to track file-line")
568fi
569
570AC_MSG_CHECKING(whether to track stack backtraces)
571if test "$with_track" != no && test "$ac_cv_get_backtrace_works" = yes && test "$with_track_backtrace" != no && test "$ac_cv_prog_addr2line_works" = yes; then
572  with_track_backtrace=yes
573  AC_DEFINE(OM_TRACK_BACKTRACE,1,"Whether to track backtrace")
574else
575  with_track_backtrace=no
576fi
577AC_MSG_RESULT($with_track_backtrace)
578
579AC_MSG_CHECKING(whether to track custom values)
580if test "$with_track" != no && test "$with_track_custom" = yes; then
581  AC_DEFINE(OM_TRACK_CUSTOM,1,"Enable custom tracking")
582else
583  with_track_custom=no
584fi
585AC_MSG_RESULT($with_track_custom)
586
587dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
588dnl figure out the return type of sbrk
589dnl
590
591AC_MSG_CHECKING(return type of sbrk)
592AC_TRY_LINK(
593#define __USE_MISC
594#include <unistd.h>
595,
596void *sbrk();
597,
598AC_DEFINE(Void_t,void,"Type of void"),
599AC_DEFINE(Void_t,char,"Type of void"),
600)
601AC_MSG_RESULT(Void_t)
602
603
604AC_DEFINE(OM_PROVIDE_MALLOC,0,[Provide NO standard routines!])
605
606
607dnl Restore user-specified CFLAGS, CXXFLAGS, LIBS
608
609CFLAGS=$BACKUP_CFLAGS
610CXXFLAGS=$BACKUP_CXXFLAGS
611LDFLAGS=$BACKUP_LDFLAGS
612
613dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
614dnl wrap it up
615dnl
616AC_CONFIG_FILES([Makefile omalloc.pc])
617AC_OUTPUT
618
Note: See TracBrowser for help on using the repository browser.