summary refs log tree commit diff
path: root/sysdeps/loongarch/preconfigure
blob: 118963cda6c44175be5588b6bc3203c48392477e (plain) (blame)
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
# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
# Local preconfigure fragment for sysdeps/loongarch

case "$machine" in
loongarch*)

    abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __loongarch_\(lp64\|ilp32\).*/\1/p'`
    float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __loongarch_\(soft\|single\|double\)_float.*/\1/p'`

    with_fp_cond="!defined __loongarch_soft_float"

    case "$float_abi" in
    soft)
	abi_flen=0
	as_fn_error 1 "loongarch does not yet support soft floating-point  ABI!!" "$LINENO" 5
	;;
    single)
	as_fn_error 1 "glibc does not yet support the single floating-point ABI!!" "$LINENO" 5
	;;
    double)
	abi_flen=64
	;;
    *)
	as_fn_error 1 "Unable to determine floating-point ABI!!" "$LINENO" 5
	;;
    esac

    case "$abi" in
    ilp32)
	as_fn_error 1 "loongarch does not yet support ilp32 ABI!!" "$LINENO" 5
	;;
    lp64)
	grlen=64
	machine=loongarch/lp64
	;;
    *)
	as_fn_error 1 "Unable to determine GRLEN!!" "$LINENO" 5
	;;
    esac

    cat >>confdefs.h <<_ACEOF
#define LOONGARCH_ABI_GRLEN $grlen
_ACEOF

    cat >>confdefs.h <<_ACEOF
#define LOONGARCH_ABI_FRLEN $abi_flen
_ACEOF


    base_machine=loongarch
    ;;
esac