summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-01-07 09:56:59 -0500
committermidipix <writeonce@midipix.org>2019-01-09 22:43:16 -0500
commit15ddf00cde1aacb7593c0bd4cf7b9c32ee321064 (patch)
tree73f040c05931669ce3ab2e3782817747c6afe686
parentfb33f19fdd71812fb5cc1071aec2c6273d56b8e0 (diff)
downloadmmglue-15ddf00cde1aacb7593c0bd4cf7b9c32ee321064.tar.bz2
mmglue-15ddf00cde1aacb7593c0bd4cf7b9c32ee321064.tar.xz
mmglue: modern source-tree support: added atomic_arch.h.
-rw-r--r--arch/nt32/atomic.h5
-rw-r--r--arch/nt32/atomic_arch.h7
-rw-r--r--arch/nt64/atomic.h5
-rw-r--r--arch/nt64/atomic_arch.h7
-rw-r--r--project/config/cfgdefs.in3
-rw-r--r--project/config/cfgdefs.sh7
6 files changed, 32 insertions, 2 deletions
diff --git a/arch/nt32/atomic.h b/arch/nt32/atomic.h
index 16fe1a2..c7eb85c 100644
--- a/arch/nt32/atomic.h
+++ b/arch/nt32/atomic.h
@@ -1,7 +1,10 @@
#ifndef _INTERNAL_ATOMIC_NT64_H
#define _INTERNAL_ATOMIC_NT64_H
+#ifdef __LIBC_LEGACY_SOURCE_TREE
#include "i386/atomic.h"
-
+#else
+#include "../internal/atomic.h"
#endif
+#endif
diff --git a/arch/nt32/atomic_arch.h b/arch/nt32/atomic_arch.h
new file mode 100644
index 0000000..243d0df
--- /dev/null
+++ b/arch/nt32/atomic_arch.h
@@ -0,0 +1,7 @@
+#ifndef _INTERNAL_ATOMIC_ARCH_NT32_H
+#define _INTERNAL_ATOMIC_ARCH_NT32_H
+
+#include "i386/atomic_arch.h"
+
+#endif
+
diff --git a/arch/nt64/atomic.h b/arch/nt64/atomic.h
index 9f18e3c..a9a6893 100644
--- a/arch/nt64/atomic.h
+++ b/arch/nt64/atomic.h
@@ -1,7 +1,10 @@
#ifndef _INTERNAL_ATOMIC_NT64_H
#define _INTERNAL_ATOMIC_NT64_H
+#ifdef __LIBC_LEGACY_SOURCE_TREE
#include "x86_64/atomic.h"
-
+#else
+#include "../internal/atomic.h"
#endif
+#endif
diff --git a/arch/nt64/atomic_arch.h b/arch/nt64/atomic_arch.h
new file mode 100644
index 0000000..097a90c
--- /dev/null
+++ b/arch/nt64/atomic_arch.h
@@ -0,0 +1,7 @@
+#ifndef _INTERNAL_ATOMIC_ARCH_NT64_H
+#define _INTERNAL_ATOMIC_ARCH_NT64_H
+
+#include "x86_64/atomic_arch.h"
+
+#endif
+
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
index ef94670..c2c4e6f 100644
--- a/project/config/cfgdefs.in
+++ b/project/config/cfgdefs.in
@@ -7,6 +7,9 @@ LIBC_MICRO = @libc_micro@
# port source directory
PORT_DIR = @port_dir@
+# source tree (atomic.h vs. atomic_arch.h)
+CFLAGS_CONFIG += @libc_source_tree@
+
# syscall.h
build/syscall_h.tag: build/@libc_syscall_arch@
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 3a2965e..928f46a 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -75,6 +75,12 @@ cfgdefs_set_libc_options()
else
libc_syscall_arch='syscall-copy.tag'
fi
+
+ if [ -f $mb_source_dir/arch/x86_64/atomic_arch.h ]; then
+ libc_source_tree='-D__LIBC_MODERN_SOURCE_TREE'
+ else
+ libc_source_tree='-D__LIBC_LEGACY_SOURCE_TREE'
+ fi
}
@@ -86,6 +92,7 @@ cfgdefs_output_custom_defs()
-e 's/@libc_major@/'"$libc_major"'/g' \
-e 's/@libc_minor@/'"$libc_minor"'/g' \
-e 's/@libc_micro@/'"$libc_micro"'/g' \
+ -e 's/@libc_source_tree@/'"$libc_source_tree"'/g' \
-e 's/@libc_syscall_arch@/'"$libc_syscall_arch"'/g' \
"$mb_project_dir/project/config/cfgdefs.in" \
| sed -e 's/[ \t]*$//g' \