configure.ac 10.1 KB
Newer Older
1
#
2
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
22
#
23
AC_PREREQ(2.69)
24 25

AC_INIT(Makeconf.in)
26
AC_CONFIG_AUX_DIR(autoconf)
27
AC_CONFIG_HEADER(config.h)
Leigh Stoller's avatar
Leigh Stoller committed
28
AC_CANONICAL_HOST
29

30 31 32 33 34 35
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_MKDIR_P
AC_PROG_INSTALL
Leigh Stoller's avatar
Leigh Stoller committed
36 37 38 39
AC_PATH_PROG(SUDO,sudo)
if test -z "$SUDO" ; then
    AC_MSG_ERROR([no acceptable sudo found in \$PATH])
fi
40 41 42 43
AC_PATH_PROG(AR, ar)
if test -z "$AR" ; then
    AC_MSG_ERROR([no acceptable ar found in \$PATH])
fi
44 45 46 47
AC_PATH_PROG(STRIP, strip)
if test -z "$STRIP" ; then
    AC_MSG_ERROR([no acceptable strip found in \$PATH])
fi
48 49 50 51 52 53 54 55 56 57
AC_PATH_PROG(RM, rm)
if test -z "$RM" ; then
    AC_MSG_ERROR([no acceptable rm found in \$PATH])
fi
AC_PATH_PROG(CP, cp)
if test -z "$CP" ; then
    AC_MSG_ERROR([no acceptable cp found in \$PATH])
fi
AC_PATH_PROG(YACC, byacc)
if test -z "$YACC" ; then
58 59 60 61
    AC_PATH_PROG(YACC, yacc)
    if test -z "$YACC" ; then
        AC_MSG_ERROR([no byacc nor yacc found in \$PATH])
    fi
62 63 64 65 66 67 68 69 70
fi
AC_PATH_PROG(TAR, tar)
if test -z "$TAR" ; then
    AC_MSG_ERROR([no tar found in \$PATH])
fi
AC_PATH_PROG(RPM, rpm, rpm)
if test -z "$RPM" ; then
    AC_MSG_ERROR([no rpm found in \$PATH])
fi
Leigh Stoller's avatar
Leigh Stoller committed
71
AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
72

73 74 75
# Need this for Makeconf.
AC_SUBST(PATH)

Leigh Stoller's avatar
Leigh Stoller committed
76 77 78 79 80 81
#
# Flag build as clientside only, not withing full Emulab build
#
WITH_EMULAB=0
AC_SUBST(WITH_EMULAB)

Leigh Stoller's avatar
Leigh Stoller committed
82 83 84 85
# TPM stuff. See option below.
TPM=0
AC_SUBST(TPM)

86 87 88 89
# Need this in a couple of places that share with Emulab.
BOSSNODE="boss"
AC_SUBST(BOSSNODE)

90
#
Leigh Stoller's avatar
Leigh Stoller committed
91
# Elvin compat option, which we	still need. Always turn on event system.
92 93 94
#
AC_SUBST(ELVIN_COMPAT)
ELVIN_COMPAT=0
Leigh Stoller's avatar
Leigh Stoller committed
95 96
AC_SUBST(EVENTSYS)
EVENTSYS=1
97

98 99 100
AC_SUBST(DISABLE_NAMED_SETUP)
DISABLE_NAMED_SETUP=0

101 102 103 104 105 106 107 108 109
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
AC_SUBST(CLIENT_VARDIR)
AC_SUBST(CLIENT_MANDIR)
CLIENT_ETCDIR="/etc/emulab"
CLIENT_BINDIR="/usr/local/etc/emulab"
CLIENT_VARDIR="/var/emulab"
CLIENT_MANDIR="/usr/local/man"

110 111 112 113 114 115 116 117
# XXX compat. We have no business expanding these on the client side!
AC_SUBST(PROJROOT_DIR)
AC_SUBST(EVENTSERVER)
AC_SUBST(NOSHAREDFS)
PROJROOT_DIR="/proj"
EVENTSERVER="event-server"
NOSHAREDFS=0

118 119
TBLOGFACIL="local5"
LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
120
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED, [Syslog log facility for Emulab daemons])
121 122 123
AC_SUBST(LOG_TESTBED)
AC_SUBST(TBLOGFACIL)

124 125 126 127 128 129 130 131
#
# Allow enabling of NTFS support in imagezip
#
AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(WINSUPPORT)
OUTERBOSS_NODENAME=""
WINSUPPORT=0

132 133 134 135 136 137 138 139
#
# Variables for Windows Unattended setup files.
#
AC_SUBST(WINDOWS_ORGNAME)
AC_SUBST(WINDOWS_OWNER)
AC_SUBST(WINDOWS_TIMEZONE)
AC_SUBST(WINDOWS_KEY_7PRO_X86)

Leigh Stoller's avatar
Leigh Stoller committed
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
#
# Allow tbdefs file that is supplied to full emulab build
#
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
[
    if test "$withval" = "yes"; then
	AC_MSG_ERROR([Invalid TBDEFS - Must specify the value])
    fi
    TBDEFS="$withval"
    TBPATH=`dirname $withval`

    if test -f $TBDEFS; then
        #
        # Remove the comments and newlines.  Really, that's what it does.
        #
        OLDPATH=$PATH
        PATH="$TBPATH:$PATH"
        . $TBDEFS
        PATH=$OLDPATH
    else
        AC_MSG_ERROR([Definitions file $TBDEFS was not found.])
    fi
])

165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
AC_ARG_ENABLE(windows,
[  --enable-windows[[=yes/no]]  Enable Windows FAT/NTFS support in imagezip [[default=no]]])

if test "$enable_windows" = "no"; then
	WINSUPPORT=0;
elif test "$enable_windows" = "yes"; then
	WINSUPPORT=1;
fi

if test $WINSUPPORT -eq 0; then
	winfiles="";
else
	winfiles="os/imagezip/ntfs/GNUmakefile \
		  os/imagezip/ntfs/liblocale/GNUmakefile \
		  os/imagezip/ntfs/libntfs/GNUmakefile \
		  os/imagezip/fat/GNUmakefile"
181
        AC_DEFINE_UNQUOTED(WINSUPPORT, 1, [Support Windows images])
182 183
fi

Leigh Stoller's avatar
Leigh Stoller committed
184 185 186 187 188 189 190 191 192 193
#
# Allow command line option, since might not have a defs file.
#
AC_ARG_ENABLE(elvin_compat,
[  --enable-elvin_compat[[=yes/no]]  Include Elvin Hash compat [[default=no]]])

if test "$enable_elvin_compat" = "yes"; then
    ELVIN_COMPAT=1
fi
if test $ELVIN_COMPAT -eq 1; then
194
    AC_DEFINE_UNQUOTED(ELVIN_COMPAT, 1, [Obsolete])
Leigh Stoller's avatar
Leigh Stoller committed
195 196
fi

197 198 199 200 201 202 203
AC_ARG_ENABLE(TPM,
[  --enable-TPM[[=yes/no]]           Include TPM support [[default=no]]])

if test "$enable_TPM" = "yes"; then
    TPM=1
fi
if test $TPM -eq 1; then
204
    AC_DEFINE_UNQUOTED(TPM, 1, [Something about TPM])
205 206
fi

Leigh Stoller's avatar
Leigh Stoller committed
207
# BEGIN Python detection. For the event library.
208
AC_PATH_PROGS(PYTHON, python python2.7 python2.6 python2.5 python2.4 python2.3 python2.2)
Leigh Stoller's avatar
Leigh Stoller committed
209 210 211 212 213

if test x"$PYTHON" = x""; then
    AC_MSG_ERROR([python not detected])
fi

214
PYTHON_VERSION=`${PYTHON} -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2 | head -1`
Leigh Stoller's avatar
Leigh Stoller committed
215 216 217 218 219 220 221 222 223 224 225 226
PYTHON_PATH=`dirname ${PYTHON}`
if test ! -d "$PYTHON_PATH/include"; then
    PYTHON_PATH=`dirname ${PYTHON_PATH}`
fi
PYTHON_INCLUDE="${PYTHON_PATH}/include/python${PYTHON_VERSION}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE}"
AC_CHECK_HEADERS([Python.h],
		 [],
		 [AC_MSG_WARN("Cannot find Python.h in ${PYTHON_INCLUDE}")])
AC_SUBST(PYTHON_INCLUDE)
# END Python detection.

227 228 229 230
# Conditional files created for various versions of Windows
# based on which variables are defined.

# Win7 Pro x86
231
if test -n "${WINDOWS_KEY_7PRO_X86}"; then
232 233
   WIN7_IMNAME="Windows 7 PROFESSIONAL"
   sed -e "s/@WIN7_IMNAME@/$WIN7_IMNAME/" < $srcdir/tmcc/cygwinseven/unattend-x86.xml.in.tmpl > $srcdir/tmcc/cygwinseven/unattend-7pro-x86.xml.in
234 235 236
   winfiles="$winfiles tmcc/cygwinseven/unattend-7pro-x86.xml"
fi

237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
# Mobile networking support
AC_SUBST(MOBILESUPPORT)
MOBILESUPPORT=0

AC_ARG_ENABLE(mobile,
[  --enable-mobile[[=yes/no]]  Enable mobile support (PhantomNet) [[default=no]]])

if test "$enable_mobile" = "no"; then
	MOBILESUPPORT=0;
elif test "$enable_mobile" = "yes"; then
	MOBILESUPPORT=1;
fi

if test $MOBILESUPPORT -eq 0; then
	mobilefiles=""
else
	mobilefiles="mobile/GNUmakefile"
        AC_DEFINE_UNQUOTED(MOBILESUPPORT, 1, [Support mobile networking])
fi


258
outfiles="Makeconf GNUmakefile setversion \
259 260 261 262
	  lib/GNUmakefile \
          lib/libtb/GNUmakefile \
          lib/tmcd/GNUmakefile \
          lib/event/GNUmakefile \
263
	  event/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
264
	  event/program-agent/GNUmakefile \
265
	  event/disk-agent/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
266
	  event/link-agent/GNUmakefile \
267
	  event/bs-agent/GNUmakefile \
268 269
	  event/proxy/GNUmakefile \
	  event/tevc/GNUmakefile \
270
	  event/trafgen/GNUmakefile \
271 272 273 274 275 276
	  event/linktest/GNUmakefile \
	  event/linktest/iperf/GNUmakefile \
	  event/linktest/rude/GNUmakefile \
	  event/linktest/weblinktest event/linktest/linktest.proxy \
	  event/linktest/linktest_control \
	  event/linktest/run_linktest.pl \
277
 	  event/delay-agent/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
278
	  tools/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
279
	  tools/pcapper/GNUmakefile \
280
	  tools/teachswitch/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
281 282
	  sensors/GNUmakefile \
	  sensors/slothd/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
283
	  sensors/canaryd/GNUmakefile \
284 285 286 287 288 289 290 291
	  tmcc/GNUmakefile \
	  tmcc/common/GNUmakefile tmcc/common/config/GNUmakefile \
	  tmcc/freebsd/GNUmakefile tmcc/freebsd/init/GNUmakefile \
	  tmcc/freebsd/init/4/GNUmakefile \
	  tmcc/freebsd/init/5/GNUmakefile \
	  tmcc/freebsd/init/6/GNUmakefile \
	  tmcc/freebsd/init/7/GNUmakefile \
	  tmcc/freebsd/init/8/GNUmakefile \
292
	  tmcc/freebsd/init/9/GNUmakefile \
293
	  tmcc/freebsd/init/10/GNUmakefile \
294
	  tmcc/freebsd/init/10.3/GNUmakefile \
295
	  tmcc/freebsd/init/10.4/GNUmakefile \
296
	  tmcc/freebsd/init/11/GNUmakefile \
297
	  tmcc/freebsd/init/11.2/GNUmakefile \
298
	  tmcc/freebsd/init/12/GNUmakefile \
299 300 301 302 303
	  tmcc/freebsd/supfile tmcc/freebsd/sethostname \
	  tmcc/linux/GNUmakefile tmcc/linux/supfile \
	  tmcc/linux/sethostname.dhclient \
	  tmcc/linux9/GNUmakefile tmcc/linux9/supfile \
	  tmcc/fedora/GNUmakefile tmcc/fedora/supfile \
304
	  tmcc/fedora15/GNUmakefile \
305 306
	  tmcc/linux-sg/GNUmakefile tmcc/ubuntu7/GNUmakefile \
	  tmcc/ubuntu10/GNUmakefile \
307
	  tmcc/ubuntu11/GNUmakefile \
308
	  tmcc/ubuntu14/GNUmakefile \
David Johnson's avatar
David Johnson committed
309
	  tmcc/ubuntu15/GNUmakefile \
310 311
	  tmcc/ubuntu16/GNUmakefile \
	  tmcc/ubuntu16-ms/GNUmakefile \
312
	  tmcc/ubuntu18/GNUmakefile \
313
	  tmcc/ubuntu18-ms/GNUmakefile \
314
	  tmcc/linux-ms/GNUmakefile \
315
	  tmcc/archlinux/GNUmakefile \
316
	  tmcc/alpine/GNUmakefile \
317 318
	  tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile \
	  tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile \
319 320
	  tmcc/freebsd6/netif-emulab \
	  tmcc/freebsd7/GNUmakefile tmcc/freebsd7/netif-emulab \
Mike Hibler's avatar
Mike Hibler committed
321
	  tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
322
	  tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
Mike Hibler's avatar
Mike Hibler committed
323
	  tmcc/freebsd11/GNUmakefile tmcc/freebsd11/netif-emulab \
324
	  tmcc/freebsd12/GNUmakefile tmcc/freebsd12/netif-emulab \
325
	  tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
326
	  tmcc/freenas11/GNUmakefile \
327 328
	  tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
	  tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
329
	  tmcc/plab/GNUmakefile tmcc/cygwinseven/GNUmakefile \
330
	  tmcc/centos6/GNUmakefile \
331
	  tmcc/centos7/GNUmakefile \
332
	  tmcc/onie/GNUmakefile \
333 334 335 336
	  tip/GNUmakefile \
	  xmlrpc/GNUmakefile xmlrpc/emulabclient.py \
	  xmlrpc/sslxmlrpc_client.py \
	  xmlrpc/script_wrapper.py xmlrpc/libxmlrpc.pm \
Leigh Stoller's avatar
Leigh Stoller committed
337
	  os/GNUmakefile os/syncd/GNUmakefile \
338 339
	  os/dijkstra/GNUmakefile os/genhostsfile/GNUmakefile \
	  os/frisbee.redux/GNUmakefile \
340
	  os/capture/GNUmakefile \
341
	  os/growdisk/GNUmakefile \
342
	  os/bootinfo/GNUmakefile \
343 344
	  os/zapdisk/GNUmakefile \
	  os/imagezip/GNUmakefile \
345
	  os/imagezip/libndz/GNUmakefile \
346 347
	  os/imagezip/mbr/GNUmakefile \
	  os/imagezip/gpt/GNUmakefile \
348 349
	  os/imagezip/ffs/GNUmakefile \
	  os/imagezip/extfs/GNUmakefile \
350
	  $winfiles \
351
	  os/imagezip/hashmap/GNUmakefile \
352 353
	  protogeni/GNUmakefile \
	  $mobilefiles"
354 355 356 357 358 359 360

#
# Do this for easy distclean.
#
DISTCLEAN_FILES="$outfiles"
AC_SUBST(DISTCLEAN_FILES)

361 362
AC_CONFIG_FILES([$outfiles])
AC_OUTPUT