forked from scheme/scsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aclocal.m4
112 lines (110 loc) · 3.01 KB
/
aclocal.m4
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
### s48_ldflags.m4 --- S48_LDFLAGS macro -*- Autoconf -*-
# serial 1
dnl
dnl
dnl
dnl -rdynamic is needed for loading external code
AC_DEFUN([S48_LDFLAGS], [dnl
AC_MSG_CHECKING([-rdynamic])
oldLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_TRY_RUN([int main() { return 0;}],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
LDFLAGS="$oldLDFLAGS"],
[AC_MSG_RESULT(no)
LDFLAGS="$oldLDFLAGS"])
])dnl
### s48_ldflags.m4 ends here
### s48_dynamic_externals.m4 --- S48_DYNAMIC_EXTERNALS macro -*- Autoconf -*-
# serial 1
dnl
dnl
dnl
AC_DEFUN([S48_DYNAMIC_EXTERNALS], [dnl
dnl
AC_CHECK_PROGS([LD], [ld cc gcc])
AC_MSG_CHECKING([compile and link flags for dynamic externals])
DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE=""
case "$host_os" in
hpux* )
dnl +z means position-independent code
DYNAMIC_EXTERNALS_CFLAGS='+z -D_HPUX_SOURCE'
DYNAMIC_EXTERNALS_LDFLAGS='-b'
;;
aix* )
DYNAMIC_EXTERNALS_CFLAGS=''
dnl -bM:SRE means shared object
dnl -brtl means run-time linking is enabled
dnl -bnoentry means no default entry point
DYNAMIC_EXTERNALS_LDFLAGS='-bM:SRE -brtl -bI:\$(incdir)/scheme48.exp -bnoentry -bE:\$(incdir)/scheme48-external.exp -lc'
DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE='-bM:SRE -brtl -bI:\$(srcdir)/c/scheme48.exp -bnoentry -bE:\$(srcdir)/c/scheme48-external.exp -lc'
;;
darwin*|macosx* )
DYNAMIC_EXTERNALS_CFLAGS='-fno-common'
DYNAMIC_EXTERNALS_LDFLAGS="$CFLAGS $LDFLAGS -bundle -flat_namespace -undefined suppress"
dnl linker workaround for MacOSX
LD="$CC"
;;
solaris* )
DYNAMIC_EXTERNALS_CFLAGS="$PIC"
dnl -G means shared object
DYNAMIC_EXTERNALS_LDFLAGS="$LDFLAGS -G"
LD="$CC"
;;
linux* )
dnl various Linuxen link in strange stuff we don't know about,
dnl but gcc does
LD="$CC"
DYNAMIC_EXTERNALS_CFLAGS="$PIC"
DYNAMIC_EXTERNALS_LDFLAGS="-shared $LDFLAGS"
;;
cygwin* )
LD="$CC"
DYNAMIC_EXTERNALS_CFLAGS=""
DYNAMIC_EXTERNALS_LDFLAGS='-shared $(bindir)/scheme48vm.a'
DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE='-shared $(srcdir)/scheme48vm.a'
;;
* )
DYNAMIC_EXTERNALS_CFLAGS="$PIC"
DYNAMIC_EXTERNALS_LDFLAGS='-shared'
;;
esac
if test -z "$DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE"; then
DYNAMIC_EXTERNALS_LDFLAGS_IN_PLACE="$DYNAMIC_EXTERNALS_LDFLAGS"
fi
AC_MSG_RESULT([$DYNAMIC_EXTERNALS_CFLAGS, $DYNAMIC_EXTERNALS_LDFLAGS])
])dnl
### s48_dynamic_externals.m4 ends here
### s48_pic_option_name.m4 --- S48_PIC_OPTION_NAME macro -*- Autoconf -*-
# serial 1
dnl
dnl
dnl Determine the name of compiler option for generating position
dnl independent code.
AC_DEFUN([S48_PIC_OPTION_NAME], [dnl
AC_MSG_CHECKING([how to compile position independent code])
case "$host_os" in
solaris* )
if test "$GCC" = "yes"; then
PIC="-fPIC"
else
# for SUN's compiler
PIC="-KPIC"
fi
;;
darwin*|macosx* )
# Code on this platform is PIC by default
PIC=""
;;
*)
PIC="-fPIC"
;;
esac
if test "$PIC" = ""; then
AC_MSG_RESULT(no extra option necessary)
else
AC_MSG_RESULT($PIC)
fi
])dnl
### s48_pic_option_name.m4 ends here