File: configure.in

package info (click to toggle)
blackened 1.8.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,916 kB
  • ctags: 3,389
  • sloc: ansic: 46,055; sh: 554; makefile: 270; perl: 46
file content (639 lines) | stat: -rw-r--r-- 13,452 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
dnl configure.in for ircii, 2.3.  copyright (c) matthew green, 1993,
dnl except those bits attributed otherwise.
dnl thanks to the screen 3.3 configure.in for giving me examples to
dnl work from and steal ;)
dnl
dnl
dnl based upon: @(#)$ Id : configure.in,v 1.13 2001/12/15 23:42:02 toast Exp $
dnl @(#)$Id: configure.in,v 1.4 2002/01/14 20:34:47 joostvb Exp $
dnl

AC_REVISION($Revision: 1.4 $)dnl
AC_INIT(source/irc.c)
AC_CONFIG_HEADER(include/defs.h)

dnl
dnl grok the version number - from source/irc.c
dnl

VERSION=`sed -n -e 's/"$//' -e '/#define BLACKENED_VERSION	*"/s///p' -e '/#define BLACKENED_VERSION/q' < source/irc.c` 
echo this is Blackened version $VERSION
echo
AC_SUBST(VERSION)

dnl
dnl initial stuff
dnl

AC_PROG_CC
AC_PROG_CPP
AC_ISC_POSIX
dnl AC_PATH_PROG(perl, perl)

dnl These commands are needed by the bsdinstall script
AC_PATH_PROG(CPCMD, cp, cp, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(MVCMD, mv, mv, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(RMCMD, rm, rm, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(LNCMD, ln, ln, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(MKDIR, mkdir, mkdir, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(CHMOD, chmod, chmod, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(CHOWN, chown, chown, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(CHGRP, chgrp, chgrp, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)
AC_PATH_PROG(STRIP, strip, strip, $PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/etc)

dnl
dnl check for NeXT.. and -bsd switch
dnl

AC_MSG_CHECKING(for NeXT)
AC_EGREP_CPP(yes,
[#if defined(NeXT) || defined(__NeXT) || defined(__NeXT__)
  yes
#endif
],nextstep=1)

if test -n "$nextstep"; then
  AC_MSG_RESULT(yes)
  CFLAGS="$CFLAGS -posix"
  LIBS="$LIBS -lposix"
else
  AC_MSG_RESULT(no)
fi

dnl AC_AIX is broken.  blah.

AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes,
[
#ifdef _AIX
  yes
#endif
],AC_MSG_RESULT(yes)
  aix=1
  AC_DEFINE(_ALL_SOURCE),
  AC_MSG_RESULT(no))

AC_PROG_LEX
AC_PROG_GCC_TRADITIONAL
AC_CHECK_LIB(sun, getpwnam)

AC_MSG_CHECKING(for qnx)
case "$(uname -s)" in
  QNX*)
    AC_MSG_RESULT(yes)
    LDFLAGS=-N64k                  dnl 64k of stack
    CFLAGS="-w4 -O -g -fi=unix.h"  dnl better compile options
  ;;
  *)
    AC_MSG_RESULT(no)
esac

AC_MSG_CHECKING(for solaris)
if /bin/sun 2> /dev/null
then
  uname=`uname -r`
  case "$uname" in
    4.*)
      AC_MSG_RESULT(no) 
      sunos4=1
      ;;
    5.*)
      AC_MSG_RESULT(yes)
      AC_DEFINE(__solaris__)
      AC_DEFINE(SVR4)
      svr4=1
      ;;
  esac
else
  AC_MSG_RESULT(no)
  AC_MSG_CHECKING(for SVR4)
  AC_EGREP_CPP(yes,
[#if defined(SVR4) || defined(__svr4__)
  yes
#endif
],svr4=1)
fi

if test -n "$svr4"
then
  AC_MSG_RESULT(yes)
  LIBS="-L/usr/ccs/lib $LIBS"
  AC_DEFINE(SVR4)
else
  if test ! -n "$sunos4"
  then
    AC_MSG_RESULT(no)
  fi
fi

dnl
dnl testing for svr3/wollengong tcp's /usr/netinclude
dnl

AC_MSG_CHECKING(for -I/usr/netinclude)
if test -d /usr/netinclude; then
  AC_MSG_RESULT(yes)
  CFLAGS="$CFLAGS -I/usr/netinclude"
else
  AC_MSG_RESULT(no)
fi
  
AC_CHECK_HEADERS(sys/un.h sys/select.h sys/fcntl.h sys/file.h sys/time.h sys/wait.h sys/twg_config.h sys/ptem.h)dnl sys/ ones
AC_CHECK_HEADERS(stdarg.h unistd.h fcntl.h string.h memory.h netdb.h limits.h)dnl non sys/ ones
AC_CHECK_HEADERS(termbits.h)
AC_CHECK_FUNC(setsid, AC_DEFINE(HAVE_SETSID),)
AC_CHECK_FUNC(getpgid, AC_DEFINE(HAVE_GETPGID),)
AC_CHECK_FUNC(getsid, AC_DEFINE(HAVE_GETSID),)
AC_CHECK_FUNC(scandir, AC_DEFINE(HAVE_SCANDIR),)
AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE),)
AC_CHECK_FUNC(uname, AC_DEFINE(HAVE_UNAME),)
AC_CHECK_FUNC(getcwd,, AC_DEFINE(NEED_GETCWD))
AC_CHECK_FUNC(fchmod,, AC_DEFINE(NEED_FCHMOD))
AC_CHECK_FUNC(strerror,, AC_DEFINE(NEED_STRERROR))
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_TYPE_SIGNAL
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T

if test x$ac_cv_header_sys_twg_config_h = xyes
then
  AC_DEFINE(WINS)
fi

dnl
dnl check for hpux, and hpux version
dnl

AC_MSG_CHECKING(for hpux version)
if test -f /hp-ux; then
  AC_MSG_RESULT(yes)
  hpux=1
  uname=`uname -r` 2> /dev/null
  case $uname in
	A.09* | A.9* | a.9* | a.09* | 9* | 09*)
		;;
	A.08* | A.8* | a.8* | a.08* | 8* | 08*)
		AC_DEFINE(HPUX8)
		;;
	A.07* | A.B7* | A.7* | a.7* | a.07* | 7* | 07*)
		AC_DEFINE(HPUX7)
		;;
	*)
		AC_DEFINE(HPUXUNKNOWN)
		;;
  esac
else
  AC_MSG_RESULT(no)
fi

dnl
dnl do ultrix/posix stuff
dnl

AC_MSG_CHECKING(for ultrix)
AC_EGREP_CPP(yes,
[#if defined(ultrix) || defined(__ultrix) || defined(__ultrix)
  yes
#endif
], ultrix=1)

if test -n "$ultrix"; then
  AC_MSG_RESULT(yes)
  test -z "$GCC" && CC="$CC -YBSD"
else
  AC_MSG_RESULT(no)
  # POSIX termios is broken on Ultrix so don't look for it.
AC_MSG_CHECKING(for POSIX.1)
AC_EGREP_CPP(yes,
[#include <sys/types.h>
#include <unistd.h>
main () {
#ifdef _POSIX_VERSION
  yes
#endif
}
], AC_DEFINE(POSIX) AC_MSG_RESULT(yes); posix=1, AC_MSG_RESULT(no))
fi

dnl
dnl check for ptx
dnl

AC_MSG_CHECKING(for sequent/ptx)
AC_EGREP_CPP(yes,
[#ifdef _SEQUENT_
  yes
#endif
], LIBS="$LIBS -lseq" seqptx=1 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

dnl
dnl check for struct linger
dnl

AC_MSG_CHECKING(for struct linger)
AC_EGREP_HEADER([struct( |	)*linger], sys/socket.h, AC_MSG_RESULT(yes), AC_DEFINE(NO_STRUCT_LINGER) AC_MSG_RESULT(no, ugh.))

dnl
dnl grok process groups
dnl

if test x$ac_cv_func_getsid != xyes && test x$ac_cv_func_getpgid != xyes
then
  AC_MSG_CHECKING(if getpgrp takes an argument)
  AC_TRY_RUN([
main()
{
  int pid;
  int pgid;

  pid = fork();

  if (0 == pid)
  {
#ifdef HAVE_SETSID
    setsid();
#else
    setpgrp(0, getpid());
#endif /* HAVE_SETSID */
    sleep(10);
  }
  else
  {
    sleep(2);
    pgid = getpgrp(pid);
    kill(pid,9);
    if (pid != pgid)
      exit(1);
  }
  exit(0);
}
],
  AC_MSG_RESULT(yes),
  AC_MSG_RESULT(no your getpgrp is painful)
  AC_DEFINE(BROKEN_GETPGRP), :)
fi

dnl
dnl work out wait type..
dnl

if test x$posix != x1
then
AC_MSG_CHECKING(for bsd wait)
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/wait.h>
],[
  union wait x;
  int y;
#ifdef WEXITSTATUS
  y = WEXITSTATUS(x);
#endif
],
  AC_DEFINE(BSDWAIT)
  bsdwait=1
  AC_MSG_RESULT(yes),
  AC_MSG_RESULT(no)
  AC_CHECK_FUNC(waitpid,,
    AC_DEFINE(NEED_WAITPID)))
fi

dnl
dnl checking for select()
dnl

olibs="$LIBS"
AC_CHECK_FUNC(select, ,
  AC_CHECK_LIB(socket, select, LIBS="$LIBS -lsocket",
    AC_CHECK_LIB(nsl, select, LIBS="$LIBS -lnsl",
      AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet",
        AC_CHECK_LIB(cposix, select, LIBS="$LIBS -lcposix",
          AC_CHECK_LIB(net, select, LIBS="$LIBS -lnet",
            AC_MSG_WARN(i can not find select.  you might need to help me)))))))

dnl
dnl termcap or curses
dnl
if test x$hpux = x1 -o x$aix = x1
then
  LIBS="-lcurses $LIBS"
  AC_DEFINE(USING_CURSES)
else
  olibs="$LIBS"
  AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $olibs",
    AC_CHECK_LIB(termlib, tgetent, LIBS="-ltermlib $olibs",
      AC_CHECK_LIB(curses, tgetent, LIBS="-lcurses $olibs",
        AC_CHECK_LIB(xtermcap, tgetent, LIBS="-lxtermcap $olibs",
          AC_MSG_WARN(i can not find tgetent.  you might need to help me)))))
fi

dnl
dnl signal handling
dnl

AC_CHECKING(signal implimentation)
AC_CHECK_FUNC(sigaction, AC_DEFINE(USE_SIGACTION)
  echo using posix signals
  ,
  AC_CHECK_FUNC(sigset, AC_DEFINE(USE_SIGSET)
  echo using ok system v signals
  ,

echo checking for reliable signals
AC_TRY_RUN([
#include <sys/types.h>
#include <signal.h>

#ifndef SIGCHLD
# define SIGCHLD SIGCLD
#endif
#ifdef USE_SIGSET
# define signal sigset
#endif

int got;

#ifdef SIGVOID
void
#endif
hand()
{
  got++;
}

main()
{
  (void)signal(SIGCHLD, hand);
  kill(getpid(), SIGCHLD);
  kill(getpid(), SIGCHLD);
  if (got < 2)
    exit(1);
  exit(0);
}
], 
echo using bsd signals
, AC_DEFINE(SYSVSIGNALS)
echo using system v signals, you lose.
)))

if test x$bsdwait = x1
then
  AC_MSG_CHECKING(for wait3 declaration)
  AC_EGREP_CPP([wait3( |	|\()],[#include <sys/types.h> dnl )
#include <signal.h>
#include <sys/wait.h>
], AC_DEFINE(WAIT3_DECLARED) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
else
  AC_MSG_CHECKING(for waitpid declaration)
  AC_EGREP_CPP([waitpid( |	|\()],[#include <sys/types.h> dnl )
#include <signal.h>
#include <sys/wait.h>
], AC_DEFINE(WAITPID_DECLARED) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
fi

dnl
dnl check for sys_errlist declaration
dnl

AC_MSG_CHECKING(for sys_errlist declaration)
AC_TRY_RUN([
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
main()
{
  char *s = sys_errlist[0];
  exit(0);
}
],
  AC_MSG_RESULT(yes)
  AC_DEFINE(SYS_ERRLIST_DECLARED),
  AC_MSG_RESULT(no), :)

dnl
dnl need this for systems with 64-bit pointers
dnl

AC_MSG_CHECKING(for a 64 bit pointer)
AC_TRY_RUN([
main()
{
  if (sizeof(long long) == sizeof(char *))
    exit(0);
  exit(1);
}
],
  AC_MSG_RESULT(yes)
  AC_DEFINE(LONGLONG_POINTER),
  AC_MSG_RESULT(no), :)

dnl
dnl need this for dcc stuff
dnl

AC_MSG_CHECKING(for a 32 bit integer)
AC_TRY_RUN([
main()
{
  if (4 == sizeof(unsigned long))
    exit(0);
  exit(1);
}
],
  AC_MSG_RESULT(unsigned long)
  AC_DEFINE(UNSIGNED_LONG32),
  AC_TRY_RUN([
main()
{
  if (4 == sizeof(unsigned int))
    exit(0);
  exit(1);
}
],
  AC_MSG_RESULT(unsigned int),
  AC_DEFINE(UNSIGNED_INT32),
  AC_MSG_RESULT(none, using unsigned long)
  AC_DEFINE(UNKNOWN_32INT)), :)

dnl
dnl libraries
dnl

dnl i think this was only needed for solaris with -lucb.
dnl AC_HAVE_LIBRARY(elf, LIBS="$LIBS -lelf",)
dnl AC_HAVE_LIBRARY(nls, libnls=1;AC_DEFINE(HAVE_LIB_NLS),)
if test ! -n "$libsocket"; then
	AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",)
fi
dnl this is for isc.  need the nsl_s library as well.
if test ! -n "$libinet"; then
	AC_CHECK_LIB(inet, socket, libnsl=1; LIBS="$LIBS -linet -lnsl_s",)
fi
if test ! -n "$libnsl"; then
	AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl",)
fi
AC_CHECK_LIB(dgc, inet_addr, LIBS="$LIBS -ldgc",)
AC_CHECK_LIB(resolv, gethostbyname,
  olibs=$LIBS
  LIBS="$LIBS -lresolv"
  AC_TRY_RUN([
#include <netdb.h>
main()
{
  struct hostent *hp;

  hp = gethostbyname("foo");
  exit(0);
}
],,LIBS=$olibs, :))
dnl AC_HAVE_LIBRARY(PW, LIBS="$LIBS -lPW",)

dnl this is all stolen from perl-4.036's Configure.  larry is god.
echo "generating a list of signal names..."
set X `cat /usr/include/signal.h /usr/include/sys/signal.h 2>&1 | awk '
$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
  [sig[$3] = substr($2,4,20)]
  if (max < $3 && $3 < 60) {
	max = $3
  }
}

END {
  for (i=1; i<=max; i++) {
    [if (sig[i] == "")]
      printf "%d", i
    else
      [printf "%s", sig[i]]
    if (i < max)
      printf " "
  }
  printf "\n"
}
'`
shift
case $# in
0)
  set X `kill -l 2> /dev/null`
  shift
  case $# in
  0) set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
    ;;
  esac
  ;;
esac
sig_name="ZERO $*"
if test -f source/sig.inc; then
  $RMCMD -f source/sig.inc
fi
[echo $sig_name | sed -e 's/$/"};/' -e 's/ /", "/g' -e 's/^/char *signals[] = { "/' >> source/sig.inc]

dnl work out UNIX mail dir..

AC_MSG_CHECKING(for unix mail directory)

for foo in /var/spool/mail /usr/spool/mail /var/mail /usr/mail
do
  if test -d $foo; then
    mdir=$foo
    break
  fi
done

if test -n "$mdir"; then
  UNIX_MAIL=\"$mdir\"
else
  UNIX_MAIL=\"unknown\"
fi

AC_MSG_RESULT($mdir)

AC_DEFINE_UNQUOTED(UNIX_MAIL, "$mdir")

if test -z "$CFLAGS"; then CFLAGS=-O ; fi
if test -z "$LDFLAGS"; then LDFLAGS= ; fi
RM="$RMCMD -f"
LN="$LNCMD -s"

if test ! -n "$bindir";
then
	bindir=\${exec_prefix}/bin
fi

dnl This doesn't seem to work!
dnl BINDIR=`eval echo ${bindir}` ; BINDIR=`eval echo ${BINDIR}`

if test ! -n "$IRCLIB";
then
	IRCLIB=\${datadir}/blackened
fi

dnl This also enables one to _not_ create a link, by
dnl specifying --without-irclink
AC_ARG_WITH(irclink, 
	[  --with-irclink=PATH     create a symbolic link to the client binary with an 
                          alternative name. Default linkname is irc], 
	[if test x$withval != x; then
		if test $withval = no; then
			irclink=
		else
			irclink="$withval"
		fi
	else
		irclink="irc"
	fi
])

IRCLINK=$irclink

dnl AC_DEFINE_UNQUOTED(IRCLINK, "$IRCLINK")
dnl
dnl IRCLINK is an empty string in case we're called --without-irclink
AC_SUBST(IRCLINK, "$IRCLINK")

dnl
dnl give user possibility to overwrite default binary name
dnl

IRCBINARY=blackened-$VERSION
AC_ARG_WITH(ircbinary, 
	[  --with-ircbinary=NAME
                          name for the blackened binary. Default binary name is blackened-<version>.], 
	[if test x$withval != x; then
		IRCBINARY="$withval"
	fi
])
AC_SUBST(IRCBINARY)

if test -n "$nextstep"; then
  LIBS=`echo $LIBS | sed -e 's/-lposix/-lsys_s -lposix/'`
fi

AC_SUBST(RM)
AC_SUBST(LN)
AC_SUBST(IRCLIB)
AC_SUBST(IRCLINK)
AC_SUBST(bindir)
dnl AC_SUBST(BINDIR)
AC_SUBST(CHMOD)
AC_SUBST(CHOWN)
AC_SUBST(CHGRP)
AC_SUBST(STRIP)
AC_SUBST(MKDIR)
AC_SUBST(CPCMD)
AC_SUBST(MVCMD)
AC_SUBST(RMCMD)
AC_SUBST(LNCMD)
AC_OUTPUT(Makefile source/Makefile bsdinstall)

$CHMOD a+x bsdinstall

echo
echo well there we are, you now might want to look in include/config.h
echo and see if there is anything you might want to tune, else you can
echo just run a make here..  good luck!
echo