File: configure.in

package info (click to toggle)
nntpcache 2.3.3b4-2
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 8,512 kB
  • ctags: 6,333
  • sloc: ansic: 37,340; perl: 4,873; sh: 1,789; makefile: 255
file content (195 lines) | stat: -rw-r--r-- 5,701 bytes parent folder | download
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
dnl $Id: configure.in,v 1.3 1998/08/04 20:18:40 proff Exp $
dnl $Smallcopyright:$

AC_INIT(src/nntpcache.c)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(nntpcache, 2.3.3b4)
AM_CONFIG_HEADER(config.h)
if test "$prefix" = NONE; then
	prefix=$ac_default_prefix
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_C_INLINE

if test "$GCC" != yes; then
  case "$build_os" in
    hpux*)
	CFLAGS_old="$CFLAGS"
	CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE"
	AC_CACHE_CHECK([if the compiler understands $CFLAGS],
	  nc_cv_prog_cc_hpux,
	    AC_TRY_COMPILE(,,
	      nc_cv_prog_cc_hpux=yes,
	      nc_cv_prog_cc_hpux=no))
	if test $nc_cv_prog_cc_hpux = no; then
	  CFLAGS="$CFLAGS_old"
	fi ;;
  esac
else
dnl we have gcc
	CFLAGS_old="$CFLAGS"
	CFLAGS="$CFLAGS -O2"
	AC_CACHE_CHECK( "for gcc no-strength-reduce bug", ac_cv_c_gcc_strength_bug,
		AC_TRY_RUN([
int main(void) {
  static int Array[[3]];
  unsigned int B = 3;
  int i;
  for(i=0; i<B; i++) Array[[i]] = i - 3;
  exit( Array[[1]] != -2 );
}],
    ac_cv_c_gcc_strength_bug="no",
    ac_cv_c_gcc_strength_bug="yes",
    ac_cv_c_gcc_strength_bug="yes") )
	if test "$ac_cv_c_gcc_strength_bug" = "yes"
	  then
	    CFLAGS="$CFLAGS_old -O2 -fno-strength-reduce"
	  else
	    CFLAGS="$CFLAGS_old"
	fi

	CFLAGS_old="$CFLAGS"
	CFLAGS="$CFLAGS -Wall"
	AC_CACHE_CHECK([if the compiler understands -Wall],
	  nc_cv_prog_gcc_wall,
	    AC_TRY_COMPILE(,,
	      nc_cv_prog_gcc_wall=yes,
	      nc_cv_prog_gcc_wall=no))
	if test $nc_cv_prog_gcc_wall = no; then
	  CFLAGS="$CFLAGS_old"
	fi

	CFLAGS_old="$CFLAGS"
	CFLAGS="$CFLAGS -pipe"
	AC_CACHE_CHECK([if the compiler understands -pipe],
	  nc_cv_prog_gcc_pipe,
	    AC_TRY_COMPILE(,,
	      nc_cv_prog_gcc_pipe=yes,
	      nc_cv_prog_gcc_pipe=no))
	if test $nc_cv_prog_gcc_pipe = no; then
	  CFLAGS="$CFLAGS_old"
	fi
fi
    
AC_PREFIX_DEFAULT(/usr/local)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h stddef.h stdarg.h sys/file.h sys/unistd.h sys/ioctl.h sys/time.h utime.h sys/param.h sys/mount.h sys/vfs.h sys/statvfs.h syslog.h sys/select.h limits.h libutil.h sys/resource.h)

dnl FD_SETSIZE hackery

AC_CACHE_CHECK([for the size of FD_SETSIZE],
  nc_cv_FD_SETSIZE,
  AC_TRY_RUN([
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SELECT_H
#  include <sys/select.h>
#endif
int main (void) {
	FILE *f = fopen("conftestval", "w");
	if (!f)
		exit(1);
	fprintf(f, "%d\n", FD_SETSIZE);
	fclose(f);
	exit(0);
}],
  nc_cv_FD_SETSIZE="`cat conftestval`", nc_cv_FD_SETSIZE=0, nc_cv_FD_SETSIZE=1024))
AC_DEFINE_UNQUOTED(NC_FD_SETSIZE, $nc_cv_FD_SETSIZE)

dnl Find a good uid

AC_CACHE_CHECK([for nntpcache UID [[from nntpcache, news, daemon, adm]]],
  nc_cv_UID,
	grep '^adm:' /etc/passwd >/dev/null && nc_cv_UID=adm
	grep '^daemon:' /etc/passwd >/dev/null && nc_cv_UID=daemon
	grep '^news:' /etc/passwd >/dev/null && nc_cv_UID=news
	grep '^nntpcache:' /etc/passwd >/dev/null && nc_cv_UID=nntpcache)
nntpcacheUID=$nc_cv_UID
AC_SUBST(nntpcacheUID)

dnl and gid too.
AC_CACHE_CHECK([for nntpcache GID [[from nntpcache, news, daemon, adm]]],
  nc_cv_GID,
	grep '^adm:' /etc/group >/dev/null && nc_cv_GID=adm
	grep '^daemon:' /etc/group >/dev/null && nc_cv_GID=daemon
	grep '^news:' /etc/group >/dev/null && nc_cv_GID=news
	grep '^nntpcache:' /etc/group >/dev/null && nc_cv_GID=nntpcache)
nntpcacheGID=$nc_cv_GID
AC_SUBST(nntpcacheGID)

AC_CACHE_CHECK([for hostname],
  nc_cv_hostname,
	nc_cv_hostname=`hostname || uname -n || echo unknown.host.com 2>/dev/null`)
nntpcachehostname=$nc_cv_hostname
AC_SUBST(nntpcachehostname)

dnl PGP
AC_PATH_PROG(PGP, pgp, pgp, $PATH:/usr/local/bin:/usr/pkg/bin)
if test "$PGP" = "pgp"; then
  PGPlocated=no
else
  PGPlocated=yes
fi
AC_SUBST(PGPlocated)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_MODE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_OFF_T
AC_CHECK_SIZEOF(char *, 4)
AC_CHECK_SIZEOF(int *, 4)
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(u_int, 4)
AC_CHECK_SIZEOF(long int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(int64_t, 8)
AC_CHECK_SIZEOF(u_int64_t, 8)
dnl the next entry is for hpux
AC_CHECK_SIZEOF(uint64_t, 8)	
AC_CHECK_SIZEOF(quad_t, 8)
AC_CHECK_SIZEOF(u_quad_t, 8)
AC_CHECK_SIZEOF(uquad_t, 8)

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(resolv, gethostbyname)
dnl bind v8
AC_CHECK_LIB(bind, gethostbyname)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(gen, syslog)
AC_CHECK_LIB(util, setproctitle)
AC_CHECK_FUNCS(getdtablesize statfs statvfs usleep utime waitpid wait3 chroot strdup strcasecmp strcasestr strncasestr vsnprintf daemon setenv putenv mmap getpagesize setproctitle snprintf strerror setpriority)

AC_PROG_MAKE_SET

if test ! -n "$configDir"; then
	eval configDir=$sysconfdir/nntpcache
fi
if test ! -n "$cacheDir"; then
	eval cacheDir=$localstatedir/nntpcache
fi
AC_SUBST(configDir)
AC_SUBST(cacheDir)
sysconfdir=$configDir
localstatedir=$cacheDir
pkgdatadir=$configDir
dnl XXX find a cleaner way of doing this
dnl we use -MG or make depend will break on the as-yet-ungenerated .ext's
MKDEP='gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
AC_SUBST(MKDEP)
AC_OUTPUT(Makefile mk/Makefile mk/rules.mk common/Makefile mmap/Makefile src/Makefile cf/Makefile cf/nnconf.cf scripts/Makefile libproff/Makefile libconfused/Makefile confused/Makefile libdbz/Makefile libmmalloc/Makefile doc/Makefile doc/nntpcached.8 doc/nntpcache.lsm filters/Makefile pgp/Makefile http/Makefile contrib/Makefile contrib/newshound/Makefile innreport/Makefile innreport/innreport.sh)