Commit 9ed83e81 authored by Leigh Stoller's avatar Leigh Stoller

Rename decls.h to tmcd.h, and fix up the makefile to build against

the new library directory.
parent ec5de064
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
EVENTSYS = @EVENTSYS@
SYSTEM := $(shell uname -s)
include $(OBJDIR)/Makeconf
all: libtmcc.a libtmcd.a
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -Wall -DUDP \
-I${OBJDIR} -I/usr/local/include \
-I${TESTBED_SRCDIR}/lib/libtb \
-L/usr/local/lib
LDFLAGS += $(LDSTATIC)
#
# For SSL enabled tmcd/tmcc
#
CFLAGS += -DETCDIR='"$(INSTALL_ETCDIR)"'
SSLFLAGS = -DWITHSSL
libtmcc.a: ssl.o tpm.o
$(AR) crv $@ ssl.o tpm.o
$(RANLIB) $@
libtmcd.a: ssl.o notpm.o
$(AR) crv $@ ssl.o notpm.o
$(RANLIB) $@
tpm.o: tpm.c
$(CC) -c $(CFLAGS) $(SSLFLAGS) $<
notpm.o: tpm.c
$(CC) -c -o notpm.o $(CFLAGS) $(SSLFLAGS) -DTPMOVERRIDE $<
ssl.o: ssl.c ssl.h tmcd.h
tpm.o: tpm.h ssl.h tmcd.h
notpm.o: tpm.h ssl.h tmcd.h
boss-install:
control-install:
subboss-install:
client-install:
mfs:
mfs-install:
frisbee-mfs:
frisbee-mfs-install:
clean:
rm -f *.o libtmcd.a libtmcc.a
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2004, 2006, 2007 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -32,7 +32,7 @@
#include <openssl/ssl.h>
#include <openssl/sha.h>
#include <openssl/err.h>
#include "decls.h"
#include "tmcd.h"
#include "ssl.h"
#include "tpm.h"
#ifndef STANDALONE
......@@ -443,6 +443,8 @@ tmcd_sslconnect(int sock, const struct sockaddr *name, socklen_t namelen)
/*
* Verify the certificate of the client.
*/
#ifdef BOSSNODE
/* Do not need this if no BOSSNODE; its a clientside build */
int
tmcd_sslverify_client(char *nodeid, char *class, char *type, int islocal)
{
......@@ -506,6 +508,7 @@ tmcd_sslverify_client(char *nodeid, char *class, char *type, int islocal)
#endif
return 0;
}
#endif
/*
* Write stuff out. According to docs, the write call will not
......
......@@ -18,11 +18,16 @@ fullclient: tmcc
client: tmcc-nossl findif dostype
server: tmcd tmcd.restart
# For VPATH.
MOSTLY_SRCDIRS = ${TESTBED_SRCDIR}/lib/libtb ${TESTBED_SRCDIR}/pxe \
${TESTBED_SRCDIR}/lib/tmcd
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -Wall -DUDP \
-I${OBJDIR} -I/usr/local/include \
-I${TESTBED_SRCDIR}/lib/libtb -I${TESTBED_SRCDIR}/pxe \
-I${TESTBED_SRCDIR}/lib/tmcd \
-L/usr/local/lib
TMLIBS = ${OBJDIR}/lib/libtb/libtb.a
BOOTINFO = ${OBJDIR}/pxe/bootinfo.o ${OBJDIR}/pxe/bootinfo_mysql.o
......@@ -35,8 +40,8 @@ CFLAGS += -DETCDIR='"$(INSTALL_ETCDIR)"'
SSLFLAGS = -DWITHSSL
TMLIBS += -lssl -lcrypto
SSLOBJ = ssl.o
TPMOBJ = tpm.o
NOTPM = notpm
TPMLIB = ${OBJDIR}/lib/tmcd/libtmcc.a
NOTPMLIB = ${OBJDIR}/lib/tmcd/libtmcd.a
ifeq ($(SYSTEM),Linux)
ifneq ($(LDSTATIC),)
......@@ -106,42 +111,41 @@ ifeq ($(EVENTSYS),1)
ELVINFLAGS = -lm -L/usr/local/lib -lpubsub
endif
tmcd: tmcd.c ${TMCDLIBS} decls.h version.o $(SSLOBJ) $(BOOTINFO) $(NOTPM)
tmcd: tmcd.c ${TMCDLIBS} tmcd.h version.o $(SSLOBJ) $(BOOTINFO) $(NOTPMLIB)
$(CC) $(CFLAGS) $(SSLFLAGS) $(TMCDCFLAGS) -o tmcd $< \
version.o $(SSLOBJ) $(TPMOBJ) $(BOOTINFO) \
version.o $(NOTPMLIB) $(BOOTINFO) \
$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient \
$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS) $(TMLIBS)
mod_tmcd.so: libtmcd.o
apxs -c mod_tmcd.c -L/usr/local/lib/mysqlclient -lmysqlclient \
-L /usr/local/lib -lxml2 $(SSLOBJ) \
$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS) $(TMLIBS) $<
-L /usr/local/lib -lxml2 \
$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS) $(NOTPMLIB) $(TMLIBS) $<
newtmcd: newtmcd.c libtmcd.o ${TMCDLIBS} decls.h version.o $(SSLOBJ) \
$(NOTPMOBJ) $(BOOTINFO)
newtmcd: newtmcd.c libtmcd.o ${TMCDLIBS} tmcd.h version.o \
$(NOTPMLIB) $(BOOTINFO)
$(CC) $(CFLAGS) $(SSLFLAGS) $(TMCDCFLAGS) -o tmcd $< \
libtmcd.o version.o $(SSLOBJ) $(TPMOBJ) $(BOOTINFO) \
libtmcd.o version.o $(NOTPMLIB) $(BOOTINFO) \
$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient -lxml2 \
$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS) $(TMLIBS)
libtmcd.o: libtmcd.c ${TMCDLIBS} decls.h version.o $(SSLOBJ) $(BOOTINFO)
libtmcd.o: libtmcd.c ${TMCDLIBS} tmcd.h version.o $(BOOTINFO)
$(CC) $(CFLAGS) -I/usr/local/include/libxml2 $(SSLFLAGS) \
$(TMCDCFLAGS) -c -o libtmcd.o $<
$(TMCDCFLAGS) -c -o libtmcd.o $<
libtmcd.so: libtmcd.o ${TMCDLIBS} decls.h $(BOOTINFO)
libtmcd.so: libtmcd.o ${TMCDLIBS} tmcd.h $(BOOTINFO)
$(LD) -shared $^ -L/usr/local/lib/mysql -lxml2 -lmysqlclient \
$(TMCDLIBS) $(ELVINFLAGS) ../lib/libtb/libtb.a \
-o $@
tmcc: tmcc.c decls.h $(SSLOBJ) $(TPMOBJ)
tmcc: tmcc.c tmcd.h $(SSLOBJ) $(TPMLIB)
$(CC) $(CFLAGS) $(SSLFLAGS) $(LDSTATIC) -g -o tmcc \
$< $(SSLOBJ) $(TPMOBJ) $(LFLAGS) $(TMLIBS)
$< $(TPMLIB) $(LFLAGS) $(TMLIBS)
tmcc-shared: tmcc.c decls.h $(SSLOBJ) $(TPMOBJ)
$(CC) $(CFLAGS) $(SSLFLAGS) -g -o tmcc $< $(SSLOBJ) \
$(TPMOBJ) $(LFLAGS) $(TMLIBS)
tmcc-shared: tmcc.c tmcd.h $(SSLOBJ) $(TPMLIB)
$(CC) $(CFLAGS) $(SSLFLAGS) -g -o tmcc $< $(TPMLIB) $(LFLAGS) $(TMLIBS)
tmcc-nossl-debug: tmcc.c decls.h
tmcc-nossl-debug: tmcc.c tmcd.h
$(CC) $(CFLAGS) $(LDSTATIC) -g -o $@ $< $(LFLAGS) $(TMSLIBS)
findif-debug: findif.o
......@@ -150,16 +154,6 @@ findif-debug: findif.o
dostype-debug: dostype.o
$(CC) $(CFLAGS) -g -o $@ dostype.o $(LFLAGS)
ssl.o: ssl.c ssl.h decls.h
tpm.o: tpm.c tpm.h ssl.h
$(CC) -c $(CFLAGS) $(SSLFLAGS) $(TESTBED_SRCDIR)/tmcd/tpm.c \
-I$(TESTBED_SRCDIR)/tmcd/
notpm: tpm.c tpm.h ssl.h
$(CC) -c $(CFLAGS) $(SSLFLAGS) -DTPMOVERRIDE \
$(TESTBED_SRCDIR)/tmcd/tpm.c -I$(TESTBED_SRCDIR)/tmcd/
version.c: tmcd.c
echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2008-2009 University of Utah and the Flux Group.
* Copyright (c) 2008-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -19,7 +19,7 @@
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/param.h>
#include "decls.h"
#include "tmcd.h"
#include "log.h"
#include "config.h"
#include "bootwhat.h"
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2008 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -28,7 +28,7 @@
#include <setjmp.h>
#include <pwd.h>
#include <grp.h>
#include "decls.h"
#include "tmcd.h"
#include "config.h"
#include "ssl.h"
#include "log.h"
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2009 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -43,7 +43,7 @@ typedef int socklen_t;
# include <arpa/inet.h>
# include <netdb.h>
#endif
#include "decls.h"
#include "tmcd.h"
#include "ssl.h"
#ifndef STANDALONE
# include "config.h"
......
......@@ -29,7 +29,7 @@
#include <pwd.h>
#include <grp.h>
#include <mysql/mysql.h>
#include "decls.h"
#include "tmcd.h"
#include "config.h"
#include "ssl.h"
#include "log.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment