]>
Commit | Line | Data |
---|---|---|
81fea2b1 | 1 | # Process this file with autoconf to produce a configure script. |
9e15ef05 | 2 | # Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc. |
81fea2b1 JL |
3 | # Contributed by Dave Love (d.love@dl.ac.uk). |
4 | # | |
5 | #This file is part of the GNU Fortran libU77 library. | |
6 | # | |
7 | #This library is free software; you can redistribute it and/or modify | |
8 | #it under the terms of the GNU General Public License as published by | |
9 | #the Free Software Foundation; either version 2, or (at your option) | |
10 | #any later version. | |
11 | # | |
12 | #GNU Fortran is distributed in the hope that it will be useful, | |
13 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | #GNU Library General Public License for more details. | |
16 | # | |
17 | #You should have received a copy of the GNU Library General Public | |
18 | #License along with GNU Fortran; see the file COPYING. If not, write | |
19 | #to Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
20 | #USA. | |
21 | ||
d5b2f1be | 22 | AC_PREREQ(2.13) |
81fea2b1 | 23 | AC_INIT(access_.c) |
e3a03859 | 24 | AC_CONFIG_HEADER(config.h:config.hin) |
81fea2b1 | 25 | |
7c6b0e92 GK |
26 | dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may |
27 | dnl not be able to. | |
28 | define([AC_PROG_CC_WORKS],[]) | |
29 | ||
81fea2b1 JL |
30 | # For g77 we'll set CC to point at the built gcc, but this will get it into |
31 | # the makefiles | |
32 | AC_PROG_CC | |
dedc4a53 | 33 | |
c6d05307 | 34 | # These defines are necessary to get 64-bit file size support. |
b33ee5f1 | 35 | # NetBSD 1.4 header files does not support XOPEN_SOURCE == 600, but it |
c6d05307 KW |
36 | # handles 64-bit file sizes without needing these defines. |
37 | AC_MSG_CHECKING(whether _XOPEN_SOURCE may be defined) | |
b33ee5f1 | 38 | AC_TRY_COMPILE([#define _XOPEN_SOURCE 600L |
c6d05307 KW |
39 | #include <unistd.h>],, |
40 | may_use_xopen_source=yes, | |
41 | may_use_xopen_source=no) | |
42 | AC_MSG_RESULT($may_use_xopen_source) | |
43 | if test $may_use_xopen_source = yes; then | |
b33ee5f1 | 44 | AC_DEFINE(_XOPEN_SOURCE, 600L, [Get Single Unix Specification semantics]) |
c6d05307 KW |
45 | # The following is needed by irix6.2 so that struct timeval is declared. |
46 | AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Get Single Unix Specification semantics]) | |
47 | # The following is needed by Solaris2.5.1 so that struct timeval is declared. | |
48 | AC_DEFINE(__EXTENSIONS__, 1, [Solaris extensions]) | |
49 | AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) | |
5b59406b AJ |
50 | # The following is needed by glibc2 so that gethostname is declared. |
51 | AC_DEFINE(_GNU_SOURCE, 1, [Get GNU extensions]) | |
c6d05307 KW |
52 | fi |
53 | ||
54 | dnl Checks for programs. | |
55 | ||
dedc4a53 JP |
56 | LIBTOOL='$(SHELL) ../libtool' |
57 | AC_SUBST(LIBTOOL) | |
58 | ||
81fea2b1 JL |
59 | dnl AC_C_CROSS |
60 | dnl Gives misleading `(cached)' message from the check. | |
61 | if test "$CROSS";then | |
62 | ac_cv_c_cross=yes | |
63 | else | |
64 | ac_cv_c_cross=no | |
65 | fi | |
66 | ||
b53c05f5 DL |
67 | test "$AR" || AR=ar |
68 | AC_SUBST(AR) | |
69 | AC_PROG_MAKE_SET | |
70 | ||
81fea2b1 JL |
71 | dnl This is only because we (horribly) punt the chmod job to the program at |
72 | dnl present. Note that the result of this test could be wrong in the cross | |
73 | dnl case. | |
74 | AC_PATH_PROG(ac_cv_prog_chmod, chmod, no) | |
75 | if test "$ac_cv_prog_chmod" != no || test "$CROSS"; then | |
76 | MAYBES=chmod_.o | |
77 | AC_DEFINE_UNQUOTED(CHMOD_PATH,"$ac_cv_prog_chmod") | |
78 | else | |
79 | MAYBES="" | |
80 | fi | |
81 | ||
81fea2b1 JL |
82 | dnl Checks for header files. |
83 | AC_HEADER_STDC | |
81fea2b1 JL |
84 | AC_HEADER_TIME |
85 | AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \ | |
86 | sys/param.h sys/times.h) | |
87 | ||
88 | dnl Checks for typedefs, structures, and compiler characteristics. | |
89 | AC_C_CONST | |
90 | AC_TYPE_SIZE_T | |
91 | AC_TYPE_MODE_T | |
92 | ||
93 | AC_TYPE_PID_T | |
94 | dnl The next 3 demand a dummy fileblocks.o (added to LIBOJS). We don't use | |
95 | dnl LIBOJS, though. | |
96 | AC_STRUCT_ST_BLKSIZE | |
97 | AC_STRUCT_ST_BLOCKS | |
98 | AC_STRUCT_ST_RDEV | |
99 | AC_STRUCT_TM | |
100 | ||
a60cb986 DL |
101 | dnl Some systems (SVR4, SCO OpenServer) need -lsocket for gethostname() |
102 | AC_CHECK_LIB(socket, gethostname, [LIBS="$LIBS -lsocket"]) | |
103 | ||
81fea2b1 JL |
104 | dnl Checks for library functions. |
105 | ||
106 | AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \ | |
9e15ef05 DL |
107 | getrusage times alarm getlogin getgid getuid kill link ttyname) |
108 | ||
109 | dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check | |
110 | dnl for struct timezone, as you might think. We also need to check how | |
111 | dnl to call gettimeofday if we have it. | |
112 | LIBU77_GETTIMEOFDAY | |
113 | ||
81fea2b1 JL |
114 | test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" |
115 | test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" | |
116 | test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" | |
117 | test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" | |
118 | AC_SUBST(MAYBES) | |
119 | ||
81fea2b1 JL |
120 | AC_SUBST(CROSS) |
121 | AC_SUBST(RANLIB) | |
122 | AC_SUBST(RANLIB_TEST) | |
7e29b261 | 123 | |
81fea2b1 | 124 | AC_OUTPUT(Makefile) |