changeset 391:6e6c8c4fc210

Buildsystem improvements.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 03 Mar 2016 14:08:38 +0200
parents eb79d11d8d40
children 851468fda833
files Makefile th_types.h
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Mar 03 13:49:45 2016 +0200
+++ b/Makefile	Thu Mar 03 14:08:38 2016 +0200
@@ -9,11 +9,12 @@
 RANLIB ?= ranlib
 INSTALL ?= install
 
-CFLAGS += -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_CONFIG_H=1
+CFLAGS += -DHAVE_STRING_H -DHAVE_CONFIG_H
 LDFLAGS +=
 
-#CFLAGS += -DHAVE_STDINT_H
+CFLAGS += -DHAVE_STDINT_H
 #CFLAGS += -DHAVE_SYS_TYPES_H
+CFLAGS += -DHAVE_INTTYPES_H
 
 # Miscellaneous
 BINPATH=./
--- a/th_types.h	Thu Mar 03 13:49:45 2016 +0200
+++ b/th_types.h	Thu Mar 03 14:08:38 2016 +0200
@@ -17,12 +17,6 @@
 #  ifndef HAVE_INT_TYPES
 #    define HAVE_INT_TYPES 1
 #  endif
-// Check for arch bitness
-#  if UINTPTR_MAX == 0xffffffff
-#    define TH_ARCH 32
-#  elif UINTPTR_MAX == 0xffffffffffffffff
-#    define TH_ARCH 64
-#  endif
 #endif
 
 #ifdef HAVE_SYS_TYPES_H
@@ -32,6 +26,19 @@
 #  endif
 #endif
 
+#ifdef HAVE_INTTYPES_H
+#  include <inttypes.h>
+#endif
+
+
+// Check for arch bitness
+#if UINTPTR_MAX == 0xffffffff
+#  define TH_ARCH 32
+#elif UINTPTR_MAX == 0xffffffffffffffff
+#  define TH_ARCH 64
+#endif
+
+
 #if !defined(TH_ARCH)
 #  if defined(__LP64__) || defined(_LP64)
 #    define TH_ARCH 64