configure.ac 9.36 KB
Newer Older
1
#
2
# Copyright (c) 2000-2016 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 58 59 60 61 62 63 64 65 66 67
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
    AC_MSG_ERROR([no byacc found in \$PATH])
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
68
AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
69

70 71 72
# Need this for Makeconf.
AC_SUBST(PATH)

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

Leigh Stoller's avatar
Leigh Stoller committed
79 80 81 82
# TPM stuff. See option below.
TPM=0
AC_SUBST(TPM)

83
#
Leigh Stoller's avatar
Leigh Stoller committed
84
# Elvin compat option, which we	still need. Always turn on event system.
85 86 87
#
AC_SUBST(ELVIN_COMPAT)
ELVIN_COMPAT=0
Leigh Stoller's avatar
Leigh Stoller committed
88 89
AC_SUBST(EVENTSYS)
EVENTSYS=1
90

91 92 93
AC_SUBST(DISABLE_NAMED_SETUP)
DISABLE_NAMED_SETUP=0

94 95 96 97 98 99 100 101 102
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"

103 104 105 106 107 108 109 110
# 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

111 112
TBLOGFACIL="local5"
LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
113
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED, [Syslog log facility for Emulab daemons])
114 115 116
AC_SUBST(LOG_TESTBED)
AC_SUBST(TBLOGFACIL)

117 118 119 120 121 122 123 124
#
# Allow enabling of NTFS support in imagezip
#
AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(WINSUPPORT)
OUTERBOSS_NODENAME=""
WINSUPPORT=0

125 126 127 128 129 130 131 132
#
# 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
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
#
# 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
])

158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
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"
174
        AC_DEFINE_UNQUOTED(WINSUPPORT, 1, [Support Windows images])
175 176
fi

Leigh Stoller's avatar
Leigh Stoller committed
177 178 179 180 181 182 183 184 185 186
#
# 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
187
    AC_DEFINE_UNQUOTED(ELVIN_COMPAT, 1, [Obsolete])
Leigh Stoller's avatar
Leigh Stoller committed
188 189
fi

190 191 192 193 194 195 196
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
197
    AC_DEFINE_UNQUOTED(TPM, 1, [Something about TPM])
198 199
fi

Leigh Stoller's avatar
Leigh Stoller committed
200
# BEGIN Python detection. For the event library.
201
AC_PATH_PROGS(PYTHON, python python2.7 python2.6 python2.5 python2.4 python2.3 python2.2)
Leigh Stoller's avatar
Leigh Stoller committed
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

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

PYTHON_VERSION=`${PYTHON} -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2`
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.

220 221 222 223 224
# Conditional files created for various versions of Windows
# based on which variables are defined.

# Win7 Pro x86
if test -n ${WINDOWS_KEY_7PRO_X86}; then
225 226
   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
227 228 229
   winfiles="$winfiles tmcc/cygwinseven/unattend-7pro-x86.xml"
fi

230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
# 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


251
outfiles="Makeconf GNUmakefile setversion \
252 253 254 255
	  lib/GNUmakefile \
          lib/libtb/GNUmakefile \
          lib/tmcd/GNUmakefile \
          lib/event/GNUmakefile \
256
	  event/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
257
	  event/program-agent/GNUmakefile \
258
	  event/disk-agent/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
259
	  event/link-agent/GNUmakefile \
260
	  event/bs-agent/GNUmakefile \
261 262
	  event/proxy/GNUmakefile \
	  event/tevc/GNUmakefile \
263
	  event/trafgen/GNUmakefile \
264 265 266 267 268 269
	  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 \
270
 	  event/delay-agent/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
271
	  tools/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
272
	  tools/pcapper/GNUmakefile \
273
	  tools/teachswitch/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
274 275
	  sensors/GNUmakefile \
	  sensors/slothd/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
276
	  sensors/canaryd/GNUmakefile \
277 278 279 280 281 282 283 284
	  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 \
285
	  tmcc/freebsd/init/9/GNUmakefile \
286
	  tmcc/freebsd/init/10/GNUmakefile \
287
	  tmcc/freebsd/init/10.3/GNUmakefile \
288
	  tmcc/freebsd/init/11/GNUmakefile \
289 290 291 292 293
	  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 \
294
	  tmcc/fedora15/GNUmakefile \
295 296
	  tmcc/linux-sg/GNUmakefile tmcc/ubuntu7/GNUmakefile \
	  tmcc/ubuntu10/GNUmakefile \
297
	  tmcc/ubuntu11/GNUmakefile \
298
	  tmcc/ubuntu14/GNUmakefile \
David Johnson's avatar
David Johnson committed
299
	  tmcc/ubuntu15/GNUmakefile \
300 301
	  tmcc/ubuntu16/GNUmakefile \
	  tmcc/ubuntu16-ms/GNUmakefile \
302
	  tmcc/linux-ms/GNUmakefile \
303 304
	  tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile \
	  tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile \
305 306
	  tmcc/freebsd6/netif-emulab \
	  tmcc/freebsd7/GNUmakefile tmcc/freebsd7/netif-emulab \
Mike Hibler's avatar
Mike Hibler committed
307
	  tmcc/freebsd9/GNUmakefile tmcc/freebsd9/netif-emulab \
308
	  tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
Mike Hibler's avatar
Mike Hibler committed
309
	  tmcc/freebsd11/GNUmakefile tmcc/freebsd11/netif-emulab \
310
	  tmcc/freenas8/GNUmakefile tmcc/freenas9/GNUmakefile \
311 312
	  tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
	  tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
313
	  tmcc/plab/GNUmakefile tmcc/cygwinseven/GNUmakefile \
314
	  tmcc/centos6/GNUmakefile \
315
	  tmcc/centos7/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
316
	  os/GNUmakefile os/syncd/GNUmakefile \
317 318
	  os/dijkstra/GNUmakefile os/genhostsfile/GNUmakefile \
	  os/frisbee.redux/GNUmakefile \
319
	  os/capture/GNUmakefile \
320 321 322
	  os/growdisk/GNUmakefile \
	  os/zapdisk/GNUmakefile \
	  os/imagezip/GNUmakefile \
323
	  os/imagezip/libndz/GNUmakefile \
324 325
	  os/imagezip/mbr/GNUmakefile \
	  os/imagezip/gpt/GNUmakefile \
326 327
	  os/imagezip/ffs/GNUmakefile \
	  os/imagezip/extfs/GNUmakefile \
328
	  $winfiles \
329
	  os/imagezip/hashmap/GNUmakefile \
330 331
	  protogeni/GNUmakefile \
	  $mobilefiles"
332 333 334 335 336 337 338

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

339 340
AC_CONFIG_FILES([$outfiles])
AC_OUTPUT