File: configure.in

package info (click to toggle)
portslave 2005.04.03
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 860 kB
  • ctags: 690
  • sloc: ansic: 7,309; sh: 176; makefile: 121
file content (159 lines) | stat: -rw-r--r-- 4,221 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/lib.c)
AC_SUBST(version)
version="2005.04.03"

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

AC_PROG_RANLIB

dnl Sets /usr as the base for installation instead of /usr/local
dnl AC_PREFIX_DEFAULT(/usr)

if [[ "$prefix" = "NONE" ]]; then
  prefix=$ac_default_prefix
fi
if [[ "$exec_prefix" = "NONE" ]]; then
  exec_prefix=$prefix
fi
if [[ "$bindir" = "\${exec_prefix}/bin" ]]; then
  bindir=$exec_prefix/bin
fi
if [[ "$sbindir" = "\${exec_prefix}/sbin" ]]; then
  sbindir=$exec_prefix/sbin
fi
if [[ "$libdir" = "\${exec_prefix}/lib" ]]; then
  libdir=$exec_prefix/lib
fi
if [[ "$sysconfdir" = "\${prefix}/etc" ]]; then
  if [[ "$prefix" = "/usr" ]]; then
    sysconfdir=/etc
  else
    sysconfdir=$prefix/etc
  fi
fi
AC_SUBST(pppdradius)
AC_ARG_WITH(pppdradius,
     [  --with-pppdradius=pathname       specifies full path to pppd-radius [$sbindir/pppd-radius] ],
     pppdradius=$withval, pppdradius="$sbindir/pppd-radius")

AC_SUBST(stripping)
AC_ARG_ENABLE(stripping,
      [  --disable-stripping  disables stripping of installed binaries],
      STRIPPING=$strippingval, STRIPPING=no)
if [[ ! "$STRIPPING" = "no" ]]; then
  stripping=""
else
  stripping="-s"
fi
echo $DEB_BUILD_OPTIONS | grep -q nostrip
if [[ "$?" = "0" ]]; then
  stripping=""
fi

AC_ARG_ENABLE(debug,
      [  --enable-debug  enables debug code generation for binaries],
      debug=-g, debug="")
echo $DEB_BUILD_OPTIONS | grep -q debug
if [[ "$?" = "0" ]]; then
  debug=-g
fi

AC_SUBST(callback)
AC_SUBST(callback_patch)
AC_ARG_ENABLE(callback,
     [  --enable-callback  enables compilation of callback PPP code],
     callback=y, callback="")
if [[ "$callback" = "y" ]]; then
  callback="#define PORTSLAVE_CALLBACK"
  callback_patch=../patches/ppp-2.4.1-CBCPs.asp.patch
fi

AC_SUBST(fido)
AC_ARG_ENABLE(fido,
     [  --enable-fido  enables compilation of Fidonet support code],
     fido=y, fido="")
if [[ "$fido" = "y" ]]; then
  fido="#define HAVE_FIDO"
fi

AC_SUBST(assignment)
AC_SUBST(no_local_ip)
AC_ARG_ENABLE(assignment,
     [  --enable-assignment  enables client assignment of IP addresses],
     assignment=y, assignment="")
if [[ "$assignment" = "y" ]]; then
  assignment="#define PORTSLAVE_CLIENT_IP_RULES"
  no_local_ip="#define ALLOW_NO_LOCAL_IP"
fi

AC_SUBST(ipv6)
AC_ARG_ENABLE(ipv6,
     [  --enable-ipv6  enables IPv6],
     ipv6=y, ipv6="")
if [[ "$ipv6" = "y" ]]; then
  ipv6="#define HAVE_IPV6"
fi

AC_SUBST(shadow)
AC_ARG_ENABLE(shadow,
      [  --enable-shadow          enables shadow password support ],
      shadow=y, shadow="")
if [[ "$shadow" = "y" ]]; then
  shadow="#define HAS_SHADOW"
fi

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

AC_SUBST(rundir)
AC_ARG_WITH(rundir,
     [  --with-rundir=DIR       specifies directory for pid files etc [/var/run] ],
     rundir=$withval, rundir="/var/run")

inst_libdir='${PREFIX}'$libdir

AC_SUBST(radclient_cfg)
AC_ARG_WITH(radclient_cfg,
     [  --with-radclient-cfg=file       specifies default radclient config file ],
     radclient_cfg=$withval, radclient_cfg="$sysconfdir/radiusclient.conf")

AC_SUBST(pppdir)
pppdir=ppp-2.4.1

AC_SUBST(route)
AC_PATH_PROG(route, "route", "/sbin/route", "$PATH:/sbin:/usr/sbin")
AC_SUBST(ifconfig)
AC_PATH_PROG(ifconfig, "ifconfig", "/sbin/ifconfig", "$PATH:/sbin:/usr/sbin")
AC_SUBST(arp)
AC_PATH_PROG(arp, "arp", "/usr/sbin/arp", "$PATH:/sbin:/usr/sbin")
AC_SUBST(telnet)
AC_PATH_PROG(telnet, "telnet", "/usr/bin/telnet", "$PATH")
AC_SUBST(ssh)
AC_PATH_PROG(ssh, "ssh", "/usr/bin/ssh", "$PATH")
AC_SUBST(rlogin)
AC_PATH_PROG(rlogin, "rlogin", "/usr/bin/rlogin", "$PATH")

dnl defined if UT_HOSTSIZE > 23
AC_SUBST(bigutmp)
AC_TRY_COMPILE([#include <utmp.h>
] , [char foo[UT_HOSTSIZE - 23];]
  , bigutmp=yes)
if [[ "$bigutmp" = "yes" ]]; then
  bigutmp="#define HAVE_BIGUTMP"
fi

AC_SUBST(pppsourcedir)
if [[ -f $pppdir.t*gz ]]; then
    pppsourcedir="."
else
    pppsourcedir=".."
fi
AC_SUBST(CFLAGS)
CFLAGS="-O2 $debug -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic"

AC_OUTPUT(Makefile pslave_cfg.h pslave.conf portslave.8 portslave.spec src/Makefile extract_and_patch)