summary refs log blame commit diff stats
path: root/libotr/libgcrypt-1.8.7/mpi/config.links
blob: 3ead4f0872a4e0b0c30b84c3d30f14da63ddf142 (plain) (tree)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454





































































































































































































































































































































































































































































                                                                                
# config.links - helper for ../configure             -*- mode: sh -*-
# Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
# Copyright (C) 2012  g10 Code GmbH
#
# This file is part of Libgcrypt.
#
# Libgcrypt is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# Libgcrypt 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
# sourced by ../configure to get the list of files to link
# this should set $mpi_ln_list.
# Note: this is called from the above directory.
#
# Reguired variables:
#  $ac_cv_sys_symbol_underscore
#  $gcry_cv_gcc_arm_platform_as_ok

mpi_sflags=
mpi_extra_modules=
mpi_cpu_arch=

test -d ./mpi || mkdir ./mpi

# We grep the list of modules from the Makefile so that
# we don't need to maintain them here.
mpi_standard_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
                 if( $3 != "O" ) print $2 }'  $srcdir/mpi/Makefile.am`
mpi_optional_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
                 if( $3 == "O" ) print $2 }' $srcdir/mpi/Makefile.am`


echo '/* created by config.links - do not edit */' >./mpi/asm-syntax.h
echo "/* Host: ${host} */" >>./mpi/asm-syntax.h

case "${host}" in
    i[34567]86*-*-openbsd[12]*     | \
    i[34567]86*-*-openbsd3.[0123]*)
       echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
       path=""
       mpi_cpu_arch="x86"
       ;;
    i[3467]86*-*-openbsd*         | \
    i[3467]86*-*-freebsd*-elf     | \
    i[3467]86*-*-freebsd[3-9]*    | \
    i[3467]86*-*-freebsd[12][0-9]*| \
    i[3467]86*-*-freebsdelf*      | \
    i[3467]86*-*-netbsd*          | \
    i[3467]86*-*-k*bsd*)
       echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
       cat  $srcdir/mpi/i386/syntax.h	   >>./mpi/asm-syntax.h
       path="i386"
       mpi_cpu_arch="x86"
       ;;
    i586*-*-openbsd*         | \
    i586*-*-freebsd*-elf     | \
    i586*-*-freebsd[3-9]*    | \
    i586*-*-freebsd[12][0-9]*| \
    i586*-*-freebsdelf*      | \
    i586*-*-netbsd*	     | \
    i586*-*-k*bsd*	     | \
    pentium-*-netbsd*	     | \
    pentiumpro-*-netbsd*)
       echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
       cat  $srcdir/mpi/i386/syntax.h	   >>./mpi/asm-syntax.h
       path="i586 i386"
       mpi_cpu_arch="x86"
       ;;
    i[34]86*-*-bsdi4*)
       echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
       cat  $srcdir/mpi/i386/syntax.h	 >>./mpi/asm-syntax.h
       path="i386"
       mpi_cpu_arch="x86"
       ;;
    i[3467]86*-*-linuxaout*  | \
    i[3467]86*-*-linuxoldld* | \
    i[3467]86*-*-*bsd*)
	echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
	echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	path="i386"
        mpi_cpu_arch="x86"
	;;
    i586*-*-linuxaout*  | \
    i586*-*-linuxoldld* | \
    i586*-*-*bsd*)
	echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
	echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	path="i586 i386"
        mpi_cpu_arch="x86"
	;;
    i[3467]86*-msdosdjgpp* | \
    i[34]86*-apple-darwin*)
	echo '#define BSD_SYNTAX'        >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	 >>./mpi/asm-syntax.h
	path="i386"
        mpi_cpu_arch="x86"
	;;
    i586*-msdosdjgpp* | \
    i[567]86*-apple-darwin*)
	echo '#define BSD_SYNTAX'        >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	 >>./mpi/asm-syntax.h
	path="i586 i386"
        mpi_cpu_arch="x86"
	;;
    i[3467]86*-*-*)
	echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	path="i386"
        mpi_cpu_arch="x86"
	;;
    i586*-*-*  | \
    pentium-*-*   | \
    pentiumpro-*-*)
	echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	path="i586 i386"
        mpi_cpu_arch="x86"
	;;
    x86_64-apple-darwin*)
	echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/amd64/func_abi.h   >>./mpi/asm-syntax.h
	path="amd64"
        mpi_cpu_arch="x86"
	;;
    x86_64-*mingw32*)
	echo '#define USE_MS_ABI' >>./mpi/asm-syntax.h
	echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/amd64/func_abi.h   >>./mpi/asm-syntax.h
	path="amd64"
        mpi_cpu_arch="x86"
        ;;
    x86_64-*-*)
	echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/i386/syntax.h	    >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/amd64/func_abi.h   >>./mpi/asm-syntax.h
	path="amd64"
        mpi_cpu_arch="x86"
	;;
    alpha*-*-*)
	echo '/* configured for alpha */' >>./mpi/asm-syntax.h
	path="alpha"
	mpi_extra_modules="udiv-qrnnd"
        mpi_cpu_arch="alpha"
	;;
    aarch64-*-*)
	echo '/* configured for aarch64 */' >>./mpi/asm-syntax.h
	path="aarch64"
	mpi_cpu_arch="aarch64"
	;;
    arm*-*-*)
	mpi_cpu_arch="arm"
	if test "$gcry_cv_gcc_arm_platform_as_ok" = "yes" ; then
	  echo '/* configured for arm */' >>./mpi/asm-syntax.h
	  path="arm"
	else
	  echo '/* No assembler modules configured */' >>./mpi/asm-syntax.h
	  path=""
	fi
	;;
    hppa7000*-*-*)
	echo '/* configured for HPPA (pa7000) */' >>./mpi/asm-syntax.h
	path="hppa1.1 hppa"
	mpi_extra_modules="udiv-qrnnd"
	mpi_cpu_arch="hppa"
	;;
    hppa1.0*-*-*)
	echo '/* configured for HPPA 1.0 */' >>./mpi/asm-syntax.h
	path="hppa"
	mpi_extra_modules="udiv-qrnnd"
	mpi_cpu_arch="hppa"
	;;
    hppa*-*-*)	# assume pa7100
	echo '/* configured for HPPA (pa7100) */' >>./mpi/asm-syntax.h
	path="pa7100 hppa1.1 hppa"
	mpi_extra_modules="udiv-qrnnd"
	mpi_cpu_arch="hppa"
	;;
    sparc64-*-linux-gnu)
        echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
	path=""
        mpi_cpu_arch="sparc"
	;;
    sparc64-sun-solaris2*)
        echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
	path=""
        mpi_cpu_arch="sparc"
        ;;
    sparc64-*-netbsd* | sparc64-*-freebsd* | sparc64-*-openbsd*)
       # There are no sparc64 assembler modules that work on the
       # *BSDs, so use the generic C functions.
       echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
       path=""
       mpi_cpu_arch="sparc"
       ;;
    sparc64*-*-*)
       echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
       path=""
       mpi_cpu_arch="sparc"
       ;;
    sparc9*-*-*     | \
    ultrasparc*-*-* )
	echo '/* configured for sparc9 or higher */' >>./mpi/asm-syntax.h
	path="sparc32v8 sparc32"
        mpi_cpu_arch="sparc"
	;;
    sparc8*-*-*     | \
    microsparc*-*-*)
	echo '/* configured for sparc8 */' >>./mpi/asm-syntax.h
	path="sparc32v8 sparc32"
        mpi_cpu_arch="sparc"
	;;
    supersparc*-*-*)
	echo '/* configured for supersparc */' >>./mpi/asm-syntax.h
	path="supersparc sparc32v8 sparc32"
	mpi_extra_modules="udiv"
        mpi_cpu_arch="sparc"
	;;
    sparc*-*-*)
	echo '/* configured for sparc */' >>./mpi/asm-syntax.h
	path="sparc32"
	mpi_extra_modules="udiv"
        mpi_cpu_arch="sparc"
	;;
    mips[34]*-*-* | \
    mips*-*-irix6*)
       echo '/* configured for MIPS3 */' >>./mpi/asm-syntax.h
       path="mips3"
       mpi_cpu_arch="mips"
       ;;
    mips*-*-*)
       echo '/* configured for MIPS2 */' >>./mpi/asm-syntax.h
       path="mips2"
       mpi_cpu_arch="mips"
       ;;

    # Motorola 68k configurations.  Let m68k mean 68020-68040.
    # mc68000 or mc68060 configurations need to be specified explicitly
    m680[234]0*-*-linuxaout* | \
    m68k*-*-linuxaout*)
	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k/mc68020 m68k"
        mpi_cpu_arch="m68k"
	;;
    m68060*-*-linuxaout*)
	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k"
        mpi_cpu_arch="m68k"
	;;
    m680[234]0*-*-linux* | \
    m68k*-*-linux*)
	echo '#define ELF_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
        mpi_cpu_arch="m68k"
	;;
    m68060*-*-linux*)
	echo '#define ELF_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k"
        mpi_cpu_arch="m68k"
	;;
    m68k-atari-mint)
	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k"
        mpi_cpu_arch="m68k"
	;;
    m68000*-*-* | \
    m68060*-*-*)
	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k/mc68000"
        mpi_cpu_arch="m68k"
	;;
    m680[234]0*-*-* | \
    m68k*-*-*)
	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
	path="m68k/mc68020 m68k"
        mpi_cpu_arch="m68k"
	;;

    powerpc-apple-darwin*)
       echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
       path=""
       mpi_cpu_arch="ppc"
       ;;

    powerpc*-*-netbsd* | powerpc*-*-openbsd*)
       echo '/* configured {Open,Net}BSD on powerpc */' >>./mpi/asm-syntax.h
       echo '#define ELF_SYNTAX'                 >>./mpi/asm-syntax.h
       cat   $srcdir/mpi/powerpc32/syntax.h	 >>./mpi/asm-syntax.h
       mpi_sflags="-Wa,-mppc"
       path="powerpc32"
       mpi_cpu_arch="ppc"
       ;;

    ppc620-*-*	    | \
    powerpc64*-*-*)
	mpi_sflags="-Wa,-mppc"
	path="powerpc64"
        mpi_cpu_arch="ppc"
	;;
    powerpc*-*-linux*)
	echo '/* configured for powerpc/ELF */' >>./mpi/asm-syntax.h
	echo '#define ELF_SYNTAX'               >>./mpi/asm-syntax.h
	cat   $srcdir/mpi/powerpc32/syntax.h	>>./mpi/asm-syntax.h
	path="powerpc32"
	mpi_cpu_arch="ppc"
	;;

    rs6000-*-aix[456789]*    | \
    rs6000-*-aix3.2.[456789])
	mpi_sflags="-Wa,-mpwr"
	path="power"
	mpi_extra_modules="udiv-w-sdiv"
	mpi_cpu_arch="ppc"
	;;
    rs6000-*-* | \
    power-*-*  | \
    power2-*-*)
	mpi_sflags="-Wa,-mppc"
	path="power"
	mpi_extra_modules="udiv-w-sdiv"
        mpi_cpu_arch="ppc"
	;;
    powerpc-ibm-aix4.2.* )
	# I am not sure about this one but a machine identified by
	# powerpc-ibm-aix4.2.1.0 cannot use the powerpc32 code.
	mpi_sflags="-Wa,-mpwr"
	path="power"
	mpi_extra_modules="udiv-w-sdiv"
        mpi_cpu_arch="ppc"
	;;
    ppc601-*-*)
	mpi_sflags="-Wa,-mppc"
	path="power powerpc32"
        mpi_cpu_arch="ppc"
	;;
    ppc60[234]*-*-*)
	mpi_sflags="-Wa,-mppc"
	path="powerpc32"
        mpi_cpu_arch="ppc"
	;;
    powerpc*-*-*)
	mpi_sflags="-Wa,-mppc"
	path="powerpc32"
        mpi_cpu_arch="ppc"
	;;
    *)
	echo '/* Platform not known */' >>./mpi/asm-syntax.h
	path=""
	;;
esac

# If asm modules are disabled reset the found variables but keep
# mpi_cpu_arch.
if test "$try_asm_modules" != "yes" ; then
    echo '/* Assembler modules disabled on request */' >./mpi/asm-syntax.h
    path=""
    mpi_sflags=""
    mpi_extra_modules=""
fi

# Make sure that mpi_cpu_arch is not the empty string.
if test x"$mpi_cpu_arch" = x ; then
    mpi_cpu_arch="unknown"
fi


# Make sysdep.h
echo '/* created by config.links - do not edit */' >./mpi/sysdep.h
if test x$ac_cv_sys_symbol_underscore = xyes; then
    cat <<EOF >>./mpi/sysdep.h
#if __STDC__
#define C_SYMBOL_NAME(name) _##name
#else
#define C_SYMBOL_NAME(name) _/**/name
#endif
EOF
else
    cat <<EOF >>./mpi/sysdep.h
#define C_SYMBOL_NAME(name) name
EOF
fi


# Figure the required modules out
mpi_required_modules=$mpi_standard_modules
if test "$mpi_extra_modules" != ""; then
  for fn in $mpi_extra_modules; do
      for i in $mpi_optional_modules; do
          if test "$fn" = "$i" ; then
             mpi_required_modules="$mpi_required_modules $fn"
          fi
      done
  done
fi

# Try to get file to link from the assembler subdirectory and
# if this fails get it from the generic subdirectory.
mpi_ln_list=
mpi_mod_list=
path=`echo "$mpi_extra_path $path generic" | tr ':' ' '`
echo '/* Created by config.links - do not edit */' >./mpi/mod-source-info.h
echo "/* Host: ${host} */" >>./mpi/mod-source-info.h
echo "static char mod_source_info[] =" >>./mpi/mod-source-info.h
for fn in $mpi_required_modules ; do
    fnu=`echo $fn | sed 's/-/_/g'`
    eval mpi_mod_c_${fnu}=no
    eval mpi_mod_asm_${fnu}=no
    for dir in $path ; do
	rm -f $srcdir/mpi/$fn.[Sc]
	if test -f $srcdir/mpi/$dir/$fn.S ; then
            echo "  \":$dir/$fn.S\"" >>./mpi/mod-source-info.h
            mpi_ln_list="$mpi_ln_list mpi/$fn-asm.S:mpi/$dir/$fn.S"
            eval mpi_mod_asm_${fnu}=yes
            mpi_mod_list="$mpi_mod_list $fn"
	    break;
	elif test -f $srcdir/mpi/$dir/$fn.c ; then
            echo "  \":$dir/$fn.c\"" >>./mpi/mod-source-info.h
            mpi_ln_list="$mpi_ln_list mpi/$fn.c:mpi/$dir/$fn.c"
            eval mpi_mod_c_${fnu}=yes
            mpi_mod_list="$mpi_mod_list $fn"
	    break;
	fi
    done
done
echo "  ;" >>./mpi/mod-source-info.h

# Same thing for the file which defines the limb size
path=`echo "$path generic" | tr ':' ' '`
for dir in $path ; do
    rm -f $srcdir/mpi/mpi-asm-defs.h
    if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then
        mpi_ln_list="$mpi_ln_list mpi/mpi-asm-defs.h:mpi/$dir/mpi-asm-defs.h"
        break;
    fi
done