-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcross-configure-aarch64-axiom
executable file
·164 lines (134 loc) · 5.6 KB
/
cross-configure-aarch64-axiom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/sh
[ -z "$HOST_DIR" ] && HOST_DIR=$HOME/linaro/host
LIBTYPE="debug"
SYSROOT=$ROOTFS
for arg in "$@";do
echo "$arg" | grep -q '^--with-axiom-host=' && HOST_DIR=$(echo "$arg" | sed 's#^--with-axiom-host=##')
echo "$arg" | grep -q '^--with-axiom-sysroot=' && SYSROOT=$(echo "$arg" | sed 's#^--with-axiom-sysroot=##')
echo "$arg" | grep -q '^--enable-debug' && LIBTYPE="debug"
echo "$arg" | grep -q '^--disable-debug' && LIBTYPE="performance"
done
################################################
# Usage Instructions:
# 1. fill in the following values to point to the target and host compilers:
export PATH=$HOST_DIR/usr/bin:$PATH
CC="$HOST_DIR/usr/bin/aarch64-linux-gnu-gcc -fPIC" ; export CC
CXX="$HOST_DIR/usr/bin/aarch64-linux-gnu-g++ -fPIC" ; export CXX
LDFLAGS="--sysroot=$SYSROOT"; export LDFLAGS
# Host C compiler
# NOTE: you may need to set GCC_EXEC_PREFIX=/usr/bin/
# to get the correct assembler if gcc is your host compiler
HOST_CC='gcc' ; export HOST_CC
HOST_CFLAGS='-g -O2' ; export HOST_CFLAGS
# Host C++ compiler - required by Titanium, not required for UPC or GASNet
HOST_CXX='g++' ; export HOST_CXX
HOST_CXXFLAGS='-g -O2' ; export HOST_CXXFLAGS
# Optional additional settings: (see configure --help for complete list)
#MPI_CC='mpicc' ; export MPI_CC # MPI-enabled C compiler
#MPI_CFLAGS='' ; export MPI_CFLAGS # flags for MPI_CC
#MPI_LIBS='' ; export MPI_LIBS # libs for linking with MPI_CC
#MPIRUN_CMD='mpirun -np %N %C' ; export MPIRUN_CMD # launch command for MPI jobs
EXTRA_CONFIGURE_ARGS='' ; export EXTRA_CONFIGURE_ARGS # misc configure args to pass
# 2. Fill in the canonical target machine type. You can usually obtain this
# by running config-aux/config.guess on the target machine
TARGET_ID='aarch64-linux-gnu'
# 3. Review the automatically-detected settings below and make corrections as necessary.
# 4. Place this output script in your top-level source directory and run it,
# passing it any additional configure arguments as usual (see configure --help).
################################################
# Whether the ARM system has working kernel support for cmpxchg
CROSS_HAVE_ARM_CMPXCHG='1' ; export CROSS_HAVE_ARM_CMPXCHG
# Whether the ARM system has working kernel support for memory barriers
CROSS_HAVE_ARM_MEMBAR='1' ; export CROSS_HAVE_ARM_MEMBAR
# Whether the system has a working version of anonymous mmap
CROSS_HAVE_MMAP='1' ; export CROSS_HAVE_MMAP
# The system VM page size (ie mmap granularity, even if swapping is not supported)
CROSS_PAGESIZE='4096' ; export CROSS_PAGESIZE
# Does the system stack grow up?
CROSS_STACK_GROWS_UP='0' ; export CROSS_STACK_GROWS_UP
# Is char a signed type?
CROSS_CHAR_IS_SIGNED='0' ; export CROSS_CHAR_IS_SIGNED
# Basic primitive C type sizes (in bytes)
CROSS_SIZEOF_CHAR='1' ; export CROSS_SIZEOF_CHAR
CROSS_SIZEOF_SHORT='2' ; export CROSS_SIZEOF_SHORT
CROSS_SIZEOF_INT='4' ; export CROSS_SIZEOF_INT
CROSS_SIZEOF_LONG='4' ; export CROSS_SIZEOF_LONG
CROSS_SIZEOF_LONG_LONG='8' ; export CROSS_SIZEOF_LONG_LONG
CROSS_SIZEOF_VOID_P='4' ; export CROSS_SIZEOF_VOID_P
CROSS_SIZEOF_SIZE_T='4' ; export CROSS_SIZEOF_SIZE_T
CROSS_SIZEOF_PTRDIFF_T='4' ; export CROSS_SIZEOF_PTRDIFF_T
# System signal values
CROSS_SIGHUP='1' ; export CROSS_SIGHUP
CROSS_SIGINT='2' ; export CROSS_SIGINT
CROSS_SIGQUIT='3' ; export CROSS_SIGQUIT
CROSS_SIGKILL='9' ; export CROSS_SIGKILL
CROSS_SIGTERM='15' ; export CROSS_SIGTERM
CROSS_SIGUSR1='10' ; export CROSS_SIGUSR1
SRCDIR=`dirname $0`
SRCDIR=`realpath $SRCDIR`
if test ! -f "$SRCDIR/configure" ; then
echo "ERROR: The $0 script should be placed in the same directory as the configure script before execution"
exit 1
fi
# Detect the build host machine type
HOST_ARG=`echo "$@" | grep -e --host`
HOST_APPEND=
if test "$HOST_ARG" = ""; then
oldCC_FOR_BUILD="$CC_FOR_BUILD"
oldHOST_CC="$HOST_CC"
oldCC="$CC"
CC_FOR_BUILD=
HOST_CC=
CC=
if test "$HOST_ID" = ""; then
HOST_ID=`$SRCDIR/config-aux/config.guess`
fi
if test "$HOST_ID" = ""; then
echo 'ERROR: failed to auto-detect build host. Please run with --host=machineid to identify the host machine running this script'
exit 1
else
HOST_APPEND="--host=$HOST_ID"
fi
CC_FOR_BUILD="$oldCC_FOR_BUILD"
HOST_CC="$oldHOST_CC"
CC="$oldCC"
fi
#export PKG_CONFIG_PATH=$SRCDIR/../output/lib/pkgconfig
#if PKG_CONFIG_LIBDIR="" pkg-config --exists ompi; then
# export MPI_CFLAGS="$(pkg-config --cflags ompi) -fPIC"
# export MPI_LIBS="$(pkg-config --libs ompi)"
# #export MPI_CC="$(pkg-config --variable=exec_prefix ompi)/bin/aarch64-buildroot-linux-gnu-gcc"
# #MPI_CC="$(pkg-config --variable=exec_prefix ompi)/bin/mpicc"
# EXTRA_CONFIGURE_ARGS="$EXTRA_CONFIGURE_ARGS --enable-mpi"
#fi
# Now that everything is setup, run the actual configure script
echo $SRCDIR/configure \
--prefix=/usr \
--libdir=/usr/lib/$LIBTYPE \
--includedir=/usr/include/$LIBTYPE \
--enable-cross-compile \
--host=$TARGET_ID \
--target=$TARGET_ID \
--program-prefix='' \
--enable-debug --disable-trace --disable-stats --disable-debug-malloc --disable-system-debug-malloc \
--disable-seq --disable-parsync \
--disable-smp \
--disable-udp \
--enable-axiom \
$EXTRA_CONFIGURE_ARGS \
"$@"
$SRCDIR/configure \
--prefix=/usr \
--libdir=/usr/lib/$LIBTYPE \
--includedir=/usr/include/$LIBTYPE \
--enable-cross-compile \
--host=$TARGET_ID \
--target=$TARGET_ID \
--program-prefix='' \
--enable-debug --disable-trace --disable-stats --disable-debug-malloc --disable-system-debug-malloc \
--disable-seq --disable-parsync \
--disable-smp \
--disable-udp \
--enable-axiom \
$EXTRA_CONFIGURE_ARGS \
"$@"