-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
148 lines (120 loc) · 3.39 KB
/
configure.ac
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
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 2015 Bernd Paysan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([net2o], [0.9.9-20250205], [[email protected]], [net2o], [https://fossil.net2o.de/net2o/reportlist])
AC_PREREQ([2.59])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
LT_INIT
AC_MSG_CHECKING([for gforth])
GFX=""
case "$CC"
in
*-m32*)
GFX="-386"
;;
esac
AC_CHECK_PROGS(GFORTH, gforth$GFX)
AC_CHECK_PROGS(GFORTHFAST, gforth-fast$GFX)
test -z "$GFORTH" || read dummy GFVER GFARCH <<EOF
$(eval $GFORTH -v 2>&1)
EOF
GFDEBVER=$(echo $GFVER | tr '_' '-')
GFORTH=$(which $GFORTH)
GFORTHFAST=$(which $GFORTHFAST)
FAST=no
CPUFLAGS="none"
case "$host" in
arm*-*linux*)
FAST=yes
CPUFLAGS="none neon"
;;
i686-*linux*|i686-*cygwin*)
CPUFLAGS="none ssse3 xop"
FAST=yes
;;
x86_64-*)
AC_MSG_CHECKING([if $CC understands -mavx2])
CFLAGS_1="$CFLAGS"
CFLAGS="$CFLAGS -mavx2"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[avx2=yes],[avx2=no])
CFLAGS="$CFLAGS_1"
AC_MSG_RESULT($avx2)
AC_MSG_CHECKING([if $CC understands -mavx512f -mavx512vl])
CFLAGS_1="$CFLAGS"
CFLAGS="$CFLAGS -mavx512f -mavx512vl"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[avx512=yes],[avx512=no])
CFLAGS="$CFLAGS_1"
AC_MSG_RESULT($avx512)
for i in avx2 avx512
do
if eval test x'$'$i = xyes
then
CPUFLAGS="$CPUFLAGS $i"
fi
done
;;
esac
AC_SUBST(FAST)
AC_SUBST(CPUFLAGS)
VERDIR=
NOVERDIR='#'
case "$host" in
*android*)
VERDIR='#'
NOVERDIR=
;;
esac
AC_SUBST(VERDIR)
AC_SUBST(NOVERDIR)
AC_PROG_CC
AC_PROG_INSTALL
PRECC=${CC%gcc*}
PRECLANG=${PRECC%clang*}
dnl MacOS X has a libtool that does something else
AC_CHECK_PROGS(GNU_LIBTOOL,glibtool libtool)
GNU_LIBTOOL=${PRECLANG}${GNU_LIBTOOL}
echo "Libtool: $PRECC, $PRECLANG, $GNU_LIBTOOL"
AC_ARG_ENABLE(gps,
AC_HELP_STRING([--enable-gps],
[ Enable GPS (default enabled).]),
,enable_gps=yes)
HAS_GPSD=0
if test x"$enable_gps" = xyes; then
AC_CHECK_LIB(gps, gps_open, , enable_gps=no)
if test x"$enable_gps" = xyes; then
HAS_GPSD=1
fi
fi
AC_SUBST(HAS_GPSD)
AC_SUBST(GFORTH)
AC_SUBST(GFORTHFAST)
AC_SUBST(GFVER)
AC_SUBST(GFDEBVER)
AC_SUBST(GFARCH)
AC_SUBST(GNU_LIBTOOL)
ED25519_DONNA=
test -d ed25519-donna && ED25519_DONNA=ed25519-donna
AC_SUBST(ED25519_DONNA)
test "x$prefix" = xNONE && prefix=$ac_default_prefix
DATADIR=$(eval echo $(eval echo $datadir))
AC_SUBST(DATADIR)
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
LIBDIR=$(eval echo $(eval echo $libdir))
AC_SUBST(LIBDIR)
AC_CONFIG_SUBDIRS([keccak-low threefish ed25519-donna bdelta])
AC_CONFIG_FILES([Makefile n2o n2o-fi.fs qrscan version.fs debian/changelog debian/control])
AC_CONFIG_COMMANDS([stamp-h],[[date > stamp-h
chmod +x n2o qrscan]],[PACKAGE_VERSION=$PACKAGE_VERSION
machine=$machine
ARCH=$ARCH])
AC_OUTPUT