Commit 480fdc70 authored by Mike Hibler's avatar Mike Hibler

Updates for new FreeBSD 10.1 based servers.

Big changes a comin' to try to get us back on the supported path.

 * perl 5.14 -> 5.20
 * mysql 5.1 -> 5.5
 * php 5.4   -> 5.6
 * tcl 8.4   -> 8.6
 * number of vim patches up to 683.

Not everything tested yet, but getting there.

Specific changes:

 * New install/ports directory. New packages for FreeBSD 10.1 are version
   6.1. Cleaned up the ports' Makefiles getting rid of conditionals for
   all older versions. Also got rid of ports we don't use. Old ports tree
   is now install/oports.

 * Install script changes. Make sure /usr/bin/perl and /usr/local/bin/python
   links exist. Ports no longer make these but we use them in '#!'. Changes
   to mysql install and startup script--mysql has changed a LOT since we did
   the support in 4.x. Create syslog entry for named.log. Make sure php.conf
   loads the legacy "mysql" module rather than using "mysqli".

 * Elabinelab support. reflect new packages, remove all old packages
   (except perl) before installing new versions, install "extras" package,
   make sure sendmail cert get regenerated, make sure /usr/bin/perl link
   exists, make sure /usr/local/bin/python link exists.

 * Custom ports. otcl and xerces-c2 have both been removed from the ports
   tree as of Q2 2015. ipmitool-devel is a port for the latest version of
   ipmitool. The FreeBSD port is still a rev behind here. We need the
   newer version as it appears to make our SOL consoles more stable.

 * Random. Fixed prerender as neato output has changed again. Tweak to
   sslxmlrpc_server to reflect change in an underlying library. Tweak to
   db/libdb.py.in to turn on autocommit which matters now as mysql 5.5 will
   hang on a metadata lock otherwise. Remade eventsys perl/python stubs
   with SWIG 2.0. SWIG 1.3 did not produce working stubs for perl 5.20.

Specific un-changes:

 * Apache is still at 2.2. I lack the guts and skilz to upgrade to 2.4.

 * Xerces library is still at (now unsupported) 2.8. Assign will need
   changes before we can move to 3.x.

 * Python is still 2.7.

Thanks to Keith Sklower for all the work he did converting ports!
parent b9d8f28b
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -39,6 +39,9 @@ endif
SYSTEM := $(shell uname -s)
ARCH := $(shell uname -m)
# For the swig-*wrappers targets
SWIG = swig2.0
# We should be able to use va_copy everywhere, but be conservative
SWIGCFLAGS =
ifeq ($(ARCH),amd64)
......@@ -127,7 +130,7 @@ util.So: util.c
# instructions
#
swig-wrappers: event.i event.c event.pm.tail
swig -exportall -perl5 -shadow -I$(SRCDIR) $(SRCDIR)/event.i
$(SWIG) -exportall -perl5 -shadow -I$(SRCDIR) $(SRCDIR)/event.i
cat $(SRCDIR)/event.pm.tail >> $(SRCDIR)/event.pm
event_wrap.o: $(SRCDIR)/event_wrap.c
......@@ -140,7 +143,7 @@ event_wrap.So: $(SRCDIR)/event_wrap.c
# same problems as the perl one.
#
swig-pywrappers: event.i event.h event.c tbevent.py.tail
swig -python -I$(SRCDIR) -o $(SRCDIR)/event_wrap_py.c -module tbevent \
$(SWIG) -python -I$(SRCDIR) -o $(SRCDIR)/event_wrap_py.c -module tbevent \
$(SRCDIR)/event.i
cat $(SRCDIR)/tbevent.py.tail >> $(SRCDIR)/tbevent.py
touch $@
......
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.39
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
......@@ -645,6 +645,17 @@ sub EventFork() {
$event::EventSendHandle = undef;
}
#
# When we exit, unregister with the event system if we're connected
#
END {
if ($event::EventSendHandle) {
if (event_unregister($event::EventSendHandle) == 0) {
warn "Could not unregister with event system";
}
}
}
push @EXPORT, qw(event_subscribe event_poll event_poll_blocking EventSend
EventSendFatal EventSendWarn EventFork EventRegister);
1;
......
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.39
*
* This file is not intended to be easily readable and contains a number of
* Version 2.0.12
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGPERL
......@@ -42,28 +42,28 @@
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
......@@ -106,7 +106,7 @@
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
......@@ -144,7 +144,7 @@
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike.
*/
......@@ -170,16 +170,16 @@
#define SWIG_POINTER_OWN 0x1
/*
/*
Flags/methods for returning states.
The SWIG conversion methods, as ConvertPtr, return and integer
The SWIG conversion methods, as ConvertPtr, return an integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
Use the following macros/flags to set or process the returning
states.
In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
......@@ -212,23 +212,23 @@
} else {
// fail code
}
I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as
int SWIG_ConvertPtr(obj, ptr,...) {
if (<obj is ok>) {
if (<need new object>) {
*ptr = <ptr to new allocated object>;
return SWIG_NEWOBJ;
} else {
*ptr = <ptr to old object>;
return SWIG_OLDOBJ;
}
} else {
return SWIG_BADOBJ;
}
int SWIG_ConvertPtr(obj, ptr,...) {
if (<obj is ok>) {
if (<need new object>) {
*ptr = <ptr to new allocated object>;
return SWIG_NEWOBJ;
} else {
*ptr = <ptr to old object>;
return SWIG_OLDOBJ;
}
} else {
return SWIG_BADOBJ;
}
}
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
......@@ -242,17 +242,17 @@
int fooi(int);
and you call
food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState()
*/
#define SWIG_OK (0)
#define SWIG_OK (0)
#define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0)
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8)
......@@ -283,14 +283,14 @@
# endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) {
SWIGINTERNINLINE int SWIG_AddCast(int r) {
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
# define SWIG_AddCast
# define SWIG_AddCast(r) (r)
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif
......@@ -298,6 +298,7 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
#include <string.h>
#ifdef __cplusplus
#include <string>
extern "C" {
#endif
......@@ -334,7 +335,7 @@ typedef struct swig_module_info {
void *clientdata; /* Language specific module data */
} swig_module_info;
/*
/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
......@@ -354,18 +355,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
/*
Check type equivalence in a name list like <name1>|<name2>|...
Return 0 if not equal, 1 if equal
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
int equiv = 0;
SWIG_TypeCmp(const char *nb, const char *tb) {
int equiv = 1;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (!equiv && *ne) {
while (equiv != 0 && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
if (*ne) ++ne;
}
return equiv;
......@@ -373,24 +374,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
/*
Check type equivalence in a name list like <name1>|<name2>|...
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
int equiv = 0;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (!equiv && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
if (*ne) ++ne;
}
return equiv;
SWIG_TypeEquiv(const char *nb, const char *tb) {
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}
/*
Check the typename
*/
......@@ -418,7 +408,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
return 0;
}
/*
/*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
......@@ -453,7 +443,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}
/*
/*
Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
......@@ -497,7 +487,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
return type->name;
}
/*
/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
......@@ -505,14 +495,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
swig_cast_info *cast = ti->cast;
/* if (ti->clientdata == clientdata) return; */
ti->clientdata = clientdata;
while (cast) {
if (!cast->converter) {
swig_type_info *tc = cast->type;
if (!tc->clientdata) {
SWIG_TypeClientData(tc, clientdata);
}
}
}
cast = cast->next;
}
}
......@@ -521,18 +511,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
SWIG_TypeClientData(ti, clientdata);
ti->owndata = 1;
}
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)
We start searching at module start, and finish searching when start == end.
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
swig_module_info *end,
SWIG_MangledTypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
swig_module_info *iter = start;
do {
......@@ -541,11 +531,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
register size_t r = iter->size - 1;
do {
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
register size_t i = (l + r) >> 1;
register size_t i = (l + r) >> 1;
const char *iname = iter->types[i]->name;
if (iname) {
register int compare = strcmp(name, iname);
if (compare == 0) {
if (compare == 0) {
return iter->types[i];
} else if (compare < 0) {
if (i) {
......@@ -570,14 +560,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types).
We start searching at module start, and finish searching when start == end.
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start,
swig_module_info *end,
SWIG_TypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
/* STEP 1: Search the name field using binary search */
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
......@@ -596,12 +586,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
iter = iter->next;
} while (iter != end);
}
/* neither found a match */
return 0;
}
/*
/*
Pack binary data into a string
*/
SWIGRUNTIME char *
......@@ -617,7 +607,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
return c;
}
/*
/*
Unpack binary data from a string
*/
SWIGRUNTIME const char *
......@@ -631,21 +621,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
uu = ((d - '0') << 4);
else if ((d >= 'a') && (d <= 'f'))
uu = ((d - ('a'-10)) << 4);
else
else
return (char *) 0;
d = *(c++);
if ((d >= '0') && (d <= '9'))
uu |= (d - '0');
else if ((d >= 'a') && (d <= 'f'))
uu |= (d - ('a'-10));
else
else
return (char *) 0;
*u = uu;
}
return c;
}
/*
/*
Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
......@@ -705,18 +695,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
#endif
/* Errors in SWIG */
#define SWIG_UnknownError -1
#define SWIG_IOError -2
#define SWIG_RuntimeError -3
#define SWIG_IndexError -4
#define SWIG_TypeError -5
#define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7
#define SWIG_SyntaxError -8
#define SWIG_ValueError -9
#define SWIG_UnknownError -1
#define SWIG_IOError -2
#define SWIG_RuntimeError -3
#define SWIG_IndexError -4
#define SWIG_TypeError -5
#define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7
#define SWIG_SyntaxError -8
#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
#define SWIG_MemoryError -12
#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
......@@ -830,50 +820,35 @@ extern "C" {
SWIGINTERN const char*
SWIG_Perl_ErrorType(int code) {
const char* type = 0;
switch(code) {
case SWIG_MemoryError:
type = "MemoryError";
break;
return "MemoryError";
case SWIG_IOError:
type = "IOError";
break;
return "IOError";
case SWIG_RuntimeError:
type = "RuntimeError";
break;
return "RuntimeError";
case SWIG_IndexError:
type = "IndexError";
break;
return "IndexError";
case SWIG_TypeError:
type = "TypeError";
break;
return "TypeError";
case SWIG_DivisionByZero:
type = "ZeroDivisionError";
break;
return "ZeroDivisionError";
case SWIG_OverflowError:
type = "OverflowError";
break;
return "OverflowError";
case SWIG_SyntaxError:
type = "SyntaxError";
break;
return "SyntaxError";
case SWIG_ValueError:
type = "ValueError";
break;
return "ValueError";
case SWIG_SystemError:
type = "SystemError";
break;
return "SystemError";
case SWIG_AttributeError:
type = "AttributeError";
break;
return "AttributeError";
default:
type = "RuntimeError";
return "RuntimeError";
}
return type;
}
/* -----------------------------------------------------------------------------
* perlrun.swg
*
......@@ -894,6 +869,7 @@ SWIG_Perl_ErrorType(int code) {
/* for raw pointers */
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
/* for raw packed data */
......@@ -915,14 +891,14 @@ SWIG_Perl_ErrorType(int code) {
/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
/* Error manipulation */
#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
#define SWIG_fail goto fail
/* Perl-specific SWIG API */
......@@ -1016,8 +992,6 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
#endif /* MULTIPLICITY */
#endif /* PERL_OBJECT */
/* Workaround for bug in perl 5.6.x croak and earlier */
#if (PERL_VERSION < 8)
# ifdef PERL_OBJECT
# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
......@@ -1025,17 +999,16 @@ static void SWIG_Perl_croak_null(CPerlObj *pPerl)
static void SWIG_croak_null()
# endif
{
SV *err=ERRSV;
SV *err = get_sv("@", GV_ADD);
# if (PERL_VERSION < 6)
croak("%_", err);
# else
if (SvOK(err) && !SvROK(err)) croak("%_", err);
croak(Nullch);
if (sv_isobject(err))
croak(0);
else
croak("%s", SvPV_nolen(err));
# endif
}
#else
# define SWIG_croak_null() croak(Nullch)
#endif
/*
......@@ -1087,8 +1060,7 @@ SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) ||
(iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) {
if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
......@@ -1110,10 +1082,14 @@ SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
/* Function for getting a pointer value */
SWIGRUNTIME int
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
swig_cast_info *tc;
void *voidptr = (void *)0;
SV *tsv = 0;
if (own)
*own = 0;
/* If magical, apply more magic */
if (SvGMAGICAL(sv))
mg_get(sv);
......@@ -1145,8 +1121,14 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
return SWIG_OK;
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
if (!SvROK(sv)) {
*(ptr) = (void *) 0;
return SWIG_OK;
/* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
if (SvIOK(sv)) {
return SWIG_ERROR;
} else {
/* NULL pointer (reference to undef). */
*(ptr) = (void *) 0;
return SWIG_OK;
}
} else {
return SWIG_ERROR;
}
......@@ -1163,7 +1145,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
{
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
assert(!newmemory); /* newmemory handling not yet implemented */
if (newmemory == SWIG_CAST_NEW_MEMORY) {
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
if (own)
*own = *own | SWIG_CAST_NEW_MEMORY;
}
}
} else {
*ptr = voidptr;
......@@ -1178,7 +1164,7 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
*/
SV *obj = sv;