configure.ac 9.64 KB
Newer Older
1
#
2
# Copyright (c) 2000-2017 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
#
Leigh Stoller's avatar
Leigh Stoller committed
87
# Elvin compat option, which we	still need. Always turn on event system.
88 89 90
#
AC_SUBST(ELVIN_COMPAT)
ELVIN_COMPAT=0
Leigh Stoller's avatar
Leigh Stoller committed
91 92
AC_SUBST(EVENTSYS)
EVENTSYS=1
93

94 95 96
AC_SUBST(DISABLE_NAMED_SETUP)
DISABLE_NAMED_SETUP=0

97 98 99 100 101 102 103 104 105
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"

106 107 108 109 110 111 112 113
# 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

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

120 121 122 123 124 125 126 127
#
# Allow enabling of NTFS support in imagezip
#
AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(WINSUPPORT)
OUTERBOSS_NODENAME=""
WINSUPPORT=0

128 129 130 131 132 133 134 135
#
# 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
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
#
# 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
])

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

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

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

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

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.

223 224 225 226
# Conditional files created for various versions of Windows
# based on which variables are defined.

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

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


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

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

347 348
AC_CONFIG_FILES([$outfiles])
AC_OUTPUT