File: configure.in

package info (click to toggle)
fsp 2.81.b3-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,072 kB
  • ctags: 1,264
  • sloc: ansic: 7,764; makefile: 357; sh: 312
file content (210 lines) | stat: -rw-r--r-- 5,751 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a working configure script.
AC_INIT(Makefile.in)
AC_CONFIG_HEADER(include/tweak.h)
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CPP
AC_ISC_POSIX
AC_MSG_CHECKING(for DYNIX/ptx )
FSP_PROGRAM_GREP(yes,
[#if defined(_SEQUENT_)
  yes
#endif
], SEQUENT=1,)
if test -n "$SEQUENT"; then
EX_LIBS="-lsocket -linet -lnsl -lseq"
PARALLEL_MAKE='\&'
CC='cc'
GCC=
AC_MSG_RESULT(yes ... Using cc and parallel make)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(PARALLEL_MAKE)
AC_MSG_CHECKING(for SunOS 5.x )
if test -x /usr/bin/uname ;  then
  if (/usr/bin/uname -sr | grep "SunOS 5."); then
    EX_LIBS="-lsocket -lnsl"
    AC_SUBST(EX_LIBS)
  else
    AC_MSG_RESULT(no)
  fi
else
  AC_MSG_RESULT(no)
fi
AC_AIX
AC_MSG_CHECKING(for Linux )
if test -x /bin/uname ;  then
  if (/bin/uname -sr | grep "Linux"); then
    AC_DEFINE(HAVE_LINUX)
  else
    AC_MSG_RESULT(no)
  fi
else
  AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for DGUX )
FSP_PROGRAM_GREP(yes,
[#if defined(DGUX)
  yes
#endif], DGUX=1;echo yes,echo no)
AC_PROG_RANLIB
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECKING(for ansi-style prototypes)
AC_TRY_RUN([main(int argc,char **argv){exit(0);}],
                AC_DEFINE(HAVE_ANSI_PROTO),,)
if test -n "$GCC"; then
AC_DEFINE(HAVE_ANSI_PROTO)
fi
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h memory.h strings.h)
AC_SYS_LONG_FILE_NAMES
AC_CHECKING(for word sizes)
AC_TRY_RUN([ main(){ exit(sizeof(unsigned)!=2); }], AC_DEFINE(SIZE_INT_2))
AC_TRY_RUN([ main(){ exit(sizeof(unsigned)!=4); }], AC_DEFINE(SIZE_INT_4))
AC_TRY_RUN([ main(){ exit(sizeof(short)!=2); }], AC_DEFINE(SIZE_SRT_2))
AC_TRY_RUN([ main(){ exit(sizeof(long)!=4); }], AC_DEFINE(SIZE_LNG_4))
AC_CHECK_HEADERS(unistd.h)
FSP_MODE_T
FSP_PID_T
FSP_SIZE_T
FSP_UID_T
FSP_NLINK_T
AC_CHECK_FUNCS(bsearch , , AC_DEFINE(bsearch, ansi_bsearch))
AC_CHECK_FUNCS(random , , AC_DEFINE(NEED_RANDOM))
AC_CHECK_FUNCS(strdup, , AC_DEFINE(NEED_STRDUP))
AC_CHECK_FUNCS(bcopy, , AC_DEFINE(NEED_BCOPY))
AC_CHECK_FUNCS(flock, AC_DEFINE(HAVE_FLOCK), )
AC_CHECK_FUNCS(lockf, AC_DEFINE(HAVE_LOCKF), )
AC_MSG_CHECKING(for shmget )
LOCKPATH="conftestlock"
AC_TRY_RUN([
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define LOCKPATH "$LOCKPATH"

main() {
  key_t ky;
  int   sh, rv, fd;

  fd = open(LOCKPATH, O_RDWR | O_CREAT, 0666);
  if (fd == -1) exit(1);
  rv = 0;
  ky = ftok(LOCKPATH, 2001);
  if (ky == (key_t) -1) rv = 1;
  else {
    struct shmid_ds foo;
    sh = shmget(ky, 1, IPC_CREAT | 0666);
    if (sh == -1) rv = 1;
    else shmctl(sh, IPC_RMID, &foo);
  }
  close(fd);
  exit(rv); }], AC_DEFINE(HAVE_SHMEM) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
rm -f $LOCKPATH conftest.c
AC_MSG_CHECKING(for d_ino )
AC_TRY_COMPILE([#ifdef DIRENT
#include <dirent.h>
#else
#ifdef SYSDIR
#include <sys/dir.h>
#else
#ifdef SYSNDIR
#include <sys/ndir.h>
#endif
#endif
#endif], [
#ifdef DIRENT
struct dirent *dp;
#else
struct direct *dp;
#endif
int a ; a=dp->d_ino;], AC_DEFINE(HAVE_D_INO) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
AC_MSG_CHECKING(for d_fileno )
AC_TRY_COMPILE([#ifdef DIRENT
#include <dirent.h>
#else
#ifdef SYSDIR
#include <sys/dir.h>
#else
#ifdef SYSNDIR
#include <sys/ndir.h>
#endif
#endif
#endif], [
#ifdef DIRENT
struct dirent *dp;
#else
struct direct *dp;
#endif
int a ; a=dp->d_fileno;], AC_DEFINE(HAVE_D_FILENO) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
if test -z "$DGUX"; then
AC_MSG_CHECKING(for union wait )
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/wait.h>
], [union wait u ; ], AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
fi
AC_MSG_CHECKING(for WEXITSTATUS )
AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
#ifndef __hpux
#include <unistd.h>
#endif
#endif
#include <sys/types.h>
#include <sys/wait.h>], [
#if defined(HAVE_UNION_WAIT) && !defined(__hpux)
union wait foo;
#else
int foo;
#endif
WEXITSTATUS(foo);], AC_DEFINE(HAVE_WEXITSTATUS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
AC_MSG_CHECKING(for S_ISREG )
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>],
		 [struct stat sb; return S_ISREG(sb.st_mode);],
		 AC_DEFINE(HAVE_S_ISREG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
AC_MSG_CHECKING(for S_ISDIR )
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>],
		 [struct stat sb; return S_ISDIR(sb.st_mode);],
		 AC_DEFINE(HAVE_S_ISDIR) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
AC_CHECK_HEADER(tzfile.h, [TZFILE_H=1
AC_DEFINE(HAVE_TZFILE_H)],
		[AC_DEFINE(USE_SECSPERDAY, (long)60*60*24)
		 AC_DEFINE(USE_DAYSPERNYEAR, 365)])
if test -n "$TZFILE_H"; then
AC_MSG_CHECKING(for SECSPERDAY )
AC_TRY_COMPILE([#include <tzfile.h>], [long b = SECSPERDAY;],
		 AC_DEFINE(HAVE_SECSPERDAY) AC_MSG_RESULT(yes),
		 [AC_MSG_RESULT(no)
		  AC_MSG_CHECKING(for SECS_PER_DAY)
	          AC_TRY_COMPILE([#include <tzfile.h>],
				   [long b = SECS_PER_DAY;],
				   AC_DEFINE(USE_SECSPERDAY, SECS_PER_DAY) AC_MSG_RESULT(yes)	
				   AC_DEFINE(USE_SECSPERDAY, (long)60*60*24)) AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for DAYSPERNYEAR )
AC_TRY_COMPILE([#include <tzfile.h>], [int b = DAYSPERNYEAR;],
		 AC_DEFINE(HAVE_DAYSPERNYEAR) AC_MSG_RESULT(yes),
		 [AC_MSG_RESULT(no)
		  AC_MSG_CHECKING(for DAYS_PER_NYEAR)
		  AC_TRY_COMPILE([#include <tzfile.h>],
				   [int b = DAYS_PER_NYEAR;],
				   AC_DEFINE(USE_DAYSPERNYEAR, DAYS_PER_NYEAR) AC_MSG_RESULT(yes),
				   AC_DEFINE(USE_DAYSPERNYEAR, 365)) AC_MSG_RESULT(no)])
fi
echo checking for string.h declaring some functions incorrectly
echo "$DEFS
#include <sys/types.h>
#include <string.h>
" > conftest.c
$CC conftest.c -o conftest $LIBS > conftest.out 2>&1
if grep "conflicting types for built-in function" conftest.out >/dev/null; then AC_DEFINE(STRING_H_BOGUS)
fi
rm -f conftest*
AC_FUNC_VPRINTF
if test -z "$GCC"; then
  AC_C_CONST
fi
AC_OUTPUT(Makefile)