[project @ 1997-09-03 23:39:12 by sof]
[ghc-hetmet.git] / aclocal.m4
1 #
2 # extra autoconf macros for Glasgow fptools distribution
3 #
4
5 #
6 # Has timezone the type time_t or long (HP-UX 10.20 apparently
7 # has `long'..)
8 #
9 AC_DEFUN(AC_TYPE_TIMEZONE,
10 [AC_CACHE_CHECK([type of timezone], ac_cv_type_timezone,
11 [AC_TRY_COMPILE([#if TIME_WITH_SYS_TIME
12 # include <sys/time.h>
13 # include <time.h>
14 #else
15 # if HAVE_SYS_TIME_H
16 #  include <sys/time.h>
17 # else
18 #  include <time.h>
19 # endif
20 #endif
21
22 extern time_t timezone;
23 ],
24 [int i;], ac_cv_type_timezone=time_t, ac_cv_type_timezone=long)])
25 AC_DEFINE_UNQUOTED(TYPE_TIMEZONE, $ac_cv_type_timezone)
26 ])
27
28 #
29 # Is altzone available?
30 #
31 AC_DEFUN(AC_ALTZONE,
32 [AC_CACHE_CHECK([altzone], ac_cv_altzone,
33 [AC_TRY_LINK([#if TIME_WITH_SYS_TIME
34 # include <sys/time.h>
35 # include <time.h>
36 #else
37 # if HAVE_SYS_TIME_H
38 #  include <sys/time.h>
39 # else
40 #  include <time.h>
41 # endif
42 #endif
43 ], [return altzone;], 
44 ac_cv_altzone=yes, ac_cv_altzone=no)])
45 if test "$ac_cv_altzone" = yes; then
46   AC_DEFINE(HAVE_ALTZONE)
47 fi
48 ])
49
50 #
51 dnl ** check for leading underscores in symbol names
52 #
53 # Test for determining whether symbol names have a leading
54 # underscore.
55 #
56 # We assume that they _haven't_ if anything goes wrong.
57 #
58 AC_DEFUN(AC_UNDERSCORE,
59 [AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")dnl
60 AC_CACHE_CHECK([leading underscore in symbol names], ac_cv_lead_uscore,
61 AC_TRY_RUN([#ifdef HAVE_NLIST_H
62 #include <nlist.h>
63 changequote(<<, >>)dnl
64 <<
65 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
66 #endif
67
68 main(argc, argv)
69 int argc;
70 char **argv;
71 {
72 #ifdef HAVE_NLIST_H
73     if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
74         exit(0);>>
75 changequote([, ])dnl
76 #endif
77     exit(1);
78 }], ac_cv_lead_uscore=yes, ac_cv_lead_uscore=no, ac_cv_lead_uscore=NO)),
79 #
80 # Hack!: nlist() under Digital UNIX insist on there being an _,
81 # but symbol table listings show none. What is going on here?!?
82 #
83 if test $HostPlatform = "alpha-dec-osf1"; then
84    LeadingUnderscore=NO
85 else
86    LeadingUnderscore=`echo $ac_cv_lead_uscore | sed 'y/yesno/YESNO/'`
87 fi;
88 test -n "$verbose" && echo "    setting LeadingUnderscore to $LeadingUnderscore"
89 AC_SUBST(LeadingUnderscore)
90 ])
91
92