]> granicus.if.org Git - graphviz/commitdiff
Move checks from features/vmalloc to configure.ac
authorErwin Janssen <erwinjanssen@outlook.com>
Thu, 5 Jan 2017 13:34:50 +0000 (14:34 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 5 Jan 2017 13:44:54 +0000 (14:44 +0100)
Instead of checking certain headers and functions in a seperate config
script, place these checks in configure.ac and use HAVE_* style defines.
Some checks were already present in configure.ac, the others have been
added. No addtional defines in windows/config.h were needed.
There is only one check remaining in features/vmalloc.

configure.ac
lib/vmalloc/features/vmalloc
lib/vmalloc/malloc.c
lib/vmalloc/vmhdr.h
windows/include/FEATURE/vmalloc

index 361fe078b90215f2a2164e48a2b712b001304284..f8cdb55f9e2eadd53f764d1b9cff06e0075445fa 100644 (file)
@@ -419,7 +419,7 @@ dnl Checks for header files
 # AC_HEADER_STDC
 AC_CHECK_HEADERS(malloc.h \
        fcntl.h search.h termios.h \
-       unistd.h strings.h \
+       unistd.h strings.h stat.h \
        sys/time.h sys/types.h sys/select.h \
        sys/stat.h sys/mman.h \
        sys/ioctl.h sys/inotify.h crt_externs.h)
@@ -447,7 +447,7 @@ LIBS=$save_LIBS
 
 # Checks for library functions
 AC_CHECK_FUNCS([lrand48 drand48 srand48 setmode setenv getenv \
-       cbrt vsnprintf _NSGetEnviron])
+       cbrt vsnprintf _NSGetEnviron mallopt mallinfo mstats getpagesize])
 
 AC_REPLACE_FUNCS([strcasecmp strncasecmp strcasestr])
 
index 9cecdfcdccf5d49d3284fe55ff5238f327f8594f..ff3cbb233a9701eda70d873475c0026620836b61 100644 (file)
@@ -5,15 +5,6 @@
 # Written by Kiem-Phong Vo (08/15/95).
 ####################################################################
 
-lib getpagesize
-hdr stat
-sys stat
-typ ssize_t
-hdr malloc
-lib mallopt
-lib mallinfo
-lib mstats
-
 std    malloc note{ stuck with standard malloc }end noexecute{
        _BEGIN_EXTERNS_
        extern void _exit(int);
index d50ff97ab0de501fd1874b396a7193f15ccba8e8..7a07110b32e08b1471506435571fb0d05ddb44bc 100644 (file)
@@ -33,10 +33,10 @@ int _STUB_malloc;
 **     Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
 */
 
-#if _hdr_stat
+#if HAVE_STAT_H
 #include       <stat.h>
 #else
-#if _sys_stat
+#if HAVE_SYS_STAT_H
 #include       <sys/stat.h>
 #endif
 #endif
@@ -289,7 +289,7 @@ void *valloc(reg size_t size)
     return (*Vmregion->meth.alignf) (Vmregion, size, _Vmpagesize);
 }
 
-#if _hdr_malloc
+#ifdef HAVE_MALLOC_H
 
 #define calloc ______calloc
 #define free   ______free
@@ -301,7 +301,7 @@ void *valloc(reg size_t size)
 /* in Windows, this is a macro defined in malloc.h and not a function */
 #undef alloca
 
-#if _lib_mallopt
+#ifdef HAVE_MALLOPT
 int mallopt(int cmd, int value)
 {
     VMFLINIT();
@@ -309,7 +309,7 @@ int mallopt(int cmd, int value)
 }
 #endif
 
-#if _lib_mallinfo
+#ifdef HAVE_MALLINFO
 struct mallinfo mallinfo(void)
 {
     Vmstat_t sb;
@@ -327,7 +327,7 @@ struct mallinfo mallinfo(void)
 }
 #endif
 
-#if _lib_mstats
+#ifdef HAVE_MSTATS
 struct mstats mstats(void)
 {
     Vmstat_t sb;
@@ -346,6 +346,6 @@ struct mstats mstats(void)
 }
 #endif
 
-#endif/*_hdr_malloc*/
+#endif/* HAVE_MALLOC_H */
 
 #endif /*_std_malloc || _BLD_INSTRUMENT_ || cray*/
index a44793fe2c4aa1b1ee9350b43943abad091178ab..313742502c45eed4374cbf5754a6846eee8b6556 100644 (file)
@@ -82,7 +82,7 @@ extern "C" {
 #define COUNT(n)       ((n) += 1)
 #endif /*DEBUG*/
 #define VMPAGESIZE     8192
-#if _lib_getpagesize
+#if HAVE_GETPAGESIZE
 #define GETPAGESIZE(x) ((x) ? (x) : \
                         (((x)=getpagesize()) < VMPAGESIZE ? ((x)=VMPAGESIZE) : (x)) )
 #else
@@ -445,9 +445,6 @@ extern "C" {
     extern void _cleanup(void);
 
 /* for vmdcsbrk.c */
-#if !_typ_ssize_t
-    typedef int ssize_t;
-#endif
 #if !defined(_WIN32)
     extern Vmuchar_t *sbrk(ssize_t);
 #endif
index 1c4e00c1f5b9f425fdc7feac50e2c5e1acec99c8..a92d3a2d545b2b4c271ec791300a52ab376656df 100644 (file)
@@ -2,17 +2,4 @@
 #ifndef _def_atexit_vmalloc
 #define _def_atexit_vmalloc    1
 
-#undef _sys_types
-#define _sys_types     1       /* #include <sys/types.h> ok */
-
-#undef _lib_getpagesize
-#define _lib_getpagesize       0       /* getpagesize() in default lib(s) */
-
-#undef _sys_stat
-#define _sys_stat      1       /* #include <sys/stat.h> ok */
-
-#undef _typ_ssize_t
-#define _typ_ssize_t   1       /* ssize_t is a type */
-
-#undef _hdr_malloc
-#define _hdr_malloc    1       /* #include <malloc.h> ok */
+#endif