Commit dee46d59 authored by Timothy Stack's avatar Timothy Stack

Cross compilation fixes for the stargates, 'gmake client' should now
build, link, and install properly.  Haven't really tried to run stuff though.

	* GNUmakerules: Add target for stripping executables, used instead
	of "install -s" since that doesn't work for cross-compiling.

	* Makeconf.in: Add ELVIN_CONFIG variable that refers to
	'elvin-config'.

	* configure, configure.in: Detect and save the elvin-config path
	since we need a different one for cross-compiling.

	* event/lib/GNUmakefile.in, event/link-agent/GNUmakefile.in,
	event/linktest/GNUmakefile.in, event/program-agent/GNUmakefile.in,
	event/proxy/GNUmakefile.in, event/tbgen/GNUmakefile.in,
	event/trafgen/GNUmakefile.in, os/dijkstra/GNUmakefile.in,
	os/syncd/GNUmakefile.in, sensors/slothd/GNUmakefile.in,
	tmcd/GNUmakefile.in, tmcd/linux/GNUmakefile.in: Cross compilation
	fixes, don't statically link on arm, create "foo-debug"
	executables with debugging info and install separately stripped
	ones instead of passing "-s" to install.
parent 99779cfb
......@@ -68,6 +68,9 @@ vpath % $(SRCDIR) $(MOSTLY_SRCDIRS)
%_xdr.c: %.x %_xdr.h
rpcgen -c $< > $@
%: %-debug
$(STRIP) -o $@ $<
#
# Rules to regen configure written files.
#
......
......@@ -15,6 +15,8 @@ export STRIP = @STRIP@
export RANLIB = @RANLIB@
export AR = @AR@
export ELVIN_CONFIG = @ELVIN_CONFIG@
export JAVAC = @JAVAC@
export JAR = @JAR@
......
......@@ -808,10 +808,45 @@ fi
# Extract the first word of "elvin-config", so it can be a program name with args.
set dummy elvin-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:815: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ELVIN_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$ELVIN_CONFIG" in
/*)
ac_cv_path_ELVIN_CONFIG="$ELVIN_CONFIG" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_ELVIN_CONFIG="$ELVIN_CONFIG" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_ELVIN_CONFIG="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
;;
esac
fi
ELVIN_CONFIG="$ac_cv_path_ELVIN_CONFIG"
if test -n "$ELVIN_CONFIG"; then
echo "$ac_t""$ELVIN_CONFIG" 1>&6
else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "javac", so it can be a program name with args.
set dummy javac; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:815: checking for $ac_word" >&5
echo "configure:850: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -846,7 +881,7 @@ fi
# Extract the first word of "jar", so it can be a program name with args.
set dummy jar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:850: checking for $ac_word" >&5
echo "configure:885: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -882,7 +917,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ssh", so it can be a program name with args.
set dummy ${ac_tool_prefix}ssh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:886: checking for $ac_word" >&5
echo "configure:921: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -1541,7 +1576,7 @@ fi
# Check for the robot vision system dependencies.
#
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1545: checking how to run the C preprocessor" >&5
echo "configure:1580: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
......@@ -1556,13 +1591,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1560 "configure"
#line 1595 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
......@@ -1573,13 +1608,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1577 "configure"
#line 1612 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
......@@ -1590,13 +1625,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1594 "configure"
#line 1629 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
......@@ -1624,17 +1659,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1628: checking for $ac_hdr" >&5
echo "configure:1663: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1633 "configure"
#line 1668 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -1667,7 +1702,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1671: checking for $ac_word" >&5
echo "configure:1706: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -1746,7 +1781,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1750: checking for a BSD compatible install" >&5
echo "configure:1785: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2098,6 +2133,7 @@ s%@CXX@%$CXX%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@STRIP@%$STRIP%g
s%@ELVIN_CONFIG@%$ELVIN_CONFIG%g
s%@JAVAC@%$JAVAC%g
s%@JAR@%$JAR%g
s%@SSH@%$SSH%g
......
......@@ -27,6 +27,7 @@ AC_CHECK_TOOL(AR,ar)
AC_CHECK_TOOL(RANLIB,ranlib)
AC_CHECK_TOOL(STRIP,strip)
AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
AC_PATH_PROG(JAVAC,javac)
AC_PATH_PROG(JAR,jar)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -27,11 +27,11 @@ include $(TESTBED_SRCDIR)/GNUmakerules
#CFLAGS += -DDEBUG
CFLAGS += -O2 -g -static -I. -Wall
SCFLAGS = $(CFLAGS) `elvin-config --cflags vin4c`
TCFLAGS = $(CFLAGS) `elvin-config --cflags vin4mt`
SCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4c`
TCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4mt`
# Special CFLAGS w/o warnings, for SWIG-generated code
CFLAGS_NOWARN += -O2 -g -static -I.
CFLAGS_NOWARN += `elvin-config --cflags vin4c`
CFLAGS_NOWARN += `$(ELVIN_CONFIG) --cflags vin4c`
ifeq ($(SYSTEM),Linux)
PCORE = -I/usr/lib/perl5/5.6.1/i386-linux/CORE
else
......@@ -100,10 +100,10 @@ event_wrap_py.o: $(SRCDIR)/event_wrap_py.c
$(CC) -c $(CFLAGS_NOWARN) $(PYCORE) $<
event.so: event.o event_wrap.o util.o
ld -shared $^ `elvin-config --libs vin4c` -lcrypto -o event.so
ld -shared $^ `$(ELVIN_CONFIG) --libs vin4c` -lcrypto -o event.so
_tbevent.so: event.o event_wrap_py.o util.o
ld -shared $^ `elvin-config --libs vin4c` -lcrypto -o $@
ld -shared $^ `$(ELVIN_CONFIG) --libs vin4c` -lcrypto -o $@
LIB_STUFF = event.pm event.so tbevent.py _tbevent.so
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -19,13 +19,17 @@ all: $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall
CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
LDFLAGS += -static -L../lib -L${OBJDIR}/lib/libtb
LDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
LIBS += -levent -ltb -lcrypto
LIBS += `elvin-config --libs vin4c`
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
......@@ -34,8 +38,13 @@ ifeq ($(NEEDKERB),0)
endif
LIBS += -ldl
endif
endif
ifeq ($(SYSTEM),Linux)
LIBS += -ldl
endif
link-agent: link-agent.o
link-agent-debug: link-agent.o
$(CC) $(LDFLAGS) -o $@ link-agent.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
......@@ -44,7 +53,7 @@ install:
client: $(PROGRAMS)
client-install: client
$(INSTALL_PROGRAM) -s link-agent$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/link-agent$(EXE)
$(INSTALL_PROGRAM) link-agent$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/link-agent$(EXE)
clean:
/bin/rm -f *.o $(PROGRAMS)
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -30,20 +30,28 @@ all: binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG -DCLIENT_BINDIR='"$(CLIENT_BINDIR)"'
CFLAGS += -O -g -static -Wall
CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
LDFLAGS += -static -L../lib -L${OBJDIR}/lib/libtb
LDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
LIBS += -levent -lcrypto -lssl
LIBS += `elvin-config --libs vin4c`
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
CFLAGS += `/usr/kerberos/bin/krb5-config --cflags`
LIBS += `/usr/kerberos/bin/krb5-config --libs krb5`
endif
LIBS += -ldl
endif
endif
ifeq ($(SYSTEM),Linux)
LIBS += -ldl
LOCAL_BINDIR = linux
endif
......@@ -69,10 +77,10 @@ $(LOCAL_BINDIR):
binaries: $(LOCAL_BINDIR) $(LOCAL_BINDIR)/$(DAEMON) $(LOCAL_BINDIR)/$(LTEVENT)
$(LOCAL_BINDIR)/$(DAEMON): $(DAEMON_OBJS) $(LIBTB_OBJS)
$(LOCAL_BINDIR)/$(DAEMON)-debug: $(DAEMON_OBJS) $(LIBTB_OBJS)
$(CC) $(LDFLAGS) $(DAEMON_OBJS) $(LIBTB_OBJS) $(LIBS) -o $@
$(LOCAL_BINDIR)/$(LTEVENT): $(LTEVENT_OBJS) $(LIBTB_OBJS)
$(LOCAL_BINDIR)/$(LTEVENT)-debug: $(LTEVENT_OBJS) $(LIBTB_OBJS)
$(CC) $(LDFLAGS) $(LTEVENT_OBJS) $(LIBTB_OBJS) $(LIBS) -o $@
$(DAEMON_OBJS): linktest.h ../lib/libevent.a ../lib/event.h
......@@ -103,8 +111,8 @@ control-install: binaries
client: all
client-install: client
$(INSTALL_PROGRAM) -s $(LOCAL_BINDIR)/$(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) -s $(LOCAL_BINDIR)/$(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
$(INSTALL_PROGRAM) $(SRCDIR)/$(SCRIPT_TBCOMPAT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_TBCOMPAT)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -19,13 +19,17 @@ all: $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall
CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
LDFLAGS += -static -L../lib -L${OBJDIR}/lib/libtb
LDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
LIBS += -levent -ltb -lcrypto
LIBS += `elvin-config --libs vin4c`
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
......@@ -34,8 +38,9 @@ ifeq ($(NEEDKERB),0)
endif
LIBS += -ldl
endif
endif
program-agent: program-agent.o
program-agent-debug: program-agent.o
$(CC) $(LDFLAGS) -o $@ program-agent.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
......@@ -44,7 +49,7 @@ install:
client: $(PROGRAMS)
client-install: client
$(INSTALL_PROGRAM) -s program-agent$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/program-agent$(EXE)
$(INSTALL_PROGRAM) program-agent$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/program-agent$(EXE)
clean:
/bin/rm -f *.o $(PROGRAMS)
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -33,19 +33,24 @@ $(LIBEVENTDIR)/%.a:
@$(MAKE) -C $(LIBEVENTDIR) $(@F)
CFLAGS += -DDEBUG
CFLAGS += -O2 -g -static -Wall
CFLAGS += -O2 -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
PFLAGS = -pthread
PFLAGS += -DDEBUG
PFLAGS += -O2 -g -Wall
PFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
PFLAGS += `elvin-config --cflags vin4mt`
PFLAGS += `$(ELVIN_CONFIG) --cflags vin4mt`
LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS += -levent -ltb -lcrypto
LIBS += `elvin-config --libs vin4c`
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
PLDFLAGS += -static
ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
......@@ -54,32 +59,33 @@ ifeq ($(NEEDKERB),0)
endif
LIBS += -ldl
endif
endif
PLDFLAGS = -pthread -static
PLDFLAGS = -pthread
PLDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
PLIBS = -levent_r -ltb
PLIBS += -L/usr/local/lib -lvin4mt -lvin4c -lvin4 -lcrypto -lm
evproxy: evproxy.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ evproxy.o $(LIBS)
evproxy-debug: evproxy.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -o $@ evproxy.o $(LIBS)
evproxyclient: proxyclient.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ proxyclient.o $(LIBS)
evproxyclient-debug: proxyclient.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -o $@ proxyclient.o $(LIBS)
evproxyserver: proxyserver.o $(LIBTBDIR)/log.o
$(CC) $(PLDFLAGS) -static -o $@ proxyserver.o $(PLIBS)
evproxyserver-debug: proxyserver.o $(LIBTBDIR)/log.o
$(CC) $(PLDFLAGS) -o $@ proxyserver.o $(PLIBS)
proxyserver.o: proxyserver.c
$(CC) $(PFLAGS) -c $<
proxytest: proxytest.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ proxytest.o $(LIBS)
proxytest-debug: proxytest.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -o $@ proxytest.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
client: evproxy
client-install: client
$(INSTALL_PROGRAM) -s evproxy$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy$(EXE)
$(INSTALL_PROGRAM) evproxy$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy$(EXE)
clean:
/bin/rm -f *.o $(PROGRAMS)
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -30,13 +30,17 @@ $(LIBEVENTDIR)/%.a:
@$(MAKE) -C $(LIBEVENTDIR) $(@F)
CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall
CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS += -levent -lcrypto
LIBS += `elvin-config --libs vin4c`
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0)
......@@ -45,11 +49,12 @@ ifeq ($(NEEDKERB),0)
endif
LIBS += -ldl
endif
endif
# Link against some of the object files from libtb, instead of the
# whole library, since the latter cannot be built on clients (without mysql)
tevc: tevc.o $(LIBTBDIR)/log.o $(LIBTBDIR)/tbdefs.o
$(CC) $(LDFLAGS) -static -o $@ tevc.o $(LIBTBDIR)/log.o \
tevc-debug: tevc.o $(LIBTBDIR)/log.o $(LIBTBDIR)/tbdefs.o
$(CC) $(LDFLAGS) -o $@ tevc.o $(LIBTBDIR)/log.o \
$(LIBTBDIR)/tbdefs.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
......@@ -61,7 +66,7 @@ control-install: $(INSTALL_BINDIR)/tevc
client: tevc
client-install: client
$(INSTALL_PROGRAM) -s tevc$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/tevc$(EXE)
$(INSTALL_PROGRAM) tevc$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/tevc$(EXE)
clean:
rm -f *.o $(PROGRAMS)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -37,19 +37,23 @@ all: tg2.0 $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG
CFLAGS += -O -g -static #-Wall
CFLAGS += -O -g #-Wall
CFLAGS += -I. -I$(TGSRCDIR) -I${OBJDIR}
CFLAGS += -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4c`
CFLAGS += `$(ELVIN_CONFIG) --cflags vin4c`
CFLAGS += -DUSEEVENTS
LDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
LIBS += -levent -ltb -lcrypto
# Expand the elvin-config list now so it can be filtered below.
LIBS += $(shell elvin-config --libs vin4c)
LIBS += $(shell $(ELVIN_CONFIG) --libs vin4c)
SYSTEM := $(shell uname -s)
ifneq ($(host_cpu),arm)
LDFLAGS += -static
endif
ifeq ($(SYSTEM),FreeBSD)
# FreeBSD
CFLAGS += -DFREEBSD
......@@ -71,6 +75,7 @@ LIBS := $(filter-out -lc,$(LIBS))
LIBS += -lfl
endif
ifneq ($(host_cpu),arm)
ifeq ($(SYSTEM),Linux)
# Linux
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
......@@ -78,9 +83,13 @@ ifeq ($(NEEDKERB),0)
CFLAGS += `/usr/kerberos/bin/krb5-config --cflags`
LIBS += `/usr/kerberos/bin/krb5-config --libs krb5`
endif
endif
endif
ifeq ($(SYSTEM),Linux)
CFLAGS += -DLINUX
YCFLAGS += -I. -I$(TGSRCDIR) -DUSEEVENTS -DLINUX -t
LIBS += -ll -ldl
LIBS += -ldl
endif
LEX = flex -l
......@@ -94,8 +103,8 @@ tg.o: tg.y lex.yy.c
yacc -vd $<
$(CC) -g -o tg.o $(YCFLAGS) -c y.tab.c
trafgen: $(OBJS)
$(CC) $(LDFLAGS) -static -o $@ $(OBJS) $(LIBS)
trafgen-debug: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
......@@ -103,7 +112,7 @@ install:
client: $(PROGRAMS)
client-install: client
$(INSTALL_PROGRAM) -s trafgen$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/trafgen$(EXE)
$(INSTALL_PROGRAM) trafgen$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/trafgen$(EXE)
clean:
/bin/rm -f lex.yy.c y.* *.o $(PROGRAMS)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -17,14 +17,14 @@ all: dijkstra
include $(TESTBED_SRCDIR)/GNUmakerules
dijkstra: dijkstra.o bitmath.o Compressor.o IpTree.o SingleSource.o \
dijkstra-debug: dijkstra.o bitmath.o Compressor.o IpTree.o SingleSource.o \
bitmath.h Exception.h SingleSource.h IpTree.h dijkstra.h \
Compressor.h lib.h
$(CXX) $(CXXFLAGS) -static dijkstra.o bitmath.o Compressor.o IpTree.o SingleSource.o $(LIBS) -o dijkstra
$(CXX) $(CXXFLAGS) -static dijkstra.o bitmath.o Compressor.o IpTree.o SingleSource.o $(LIBS) -o $@
client: all
client-install: client
$(INSTALL_PROGRAM) -s dijkstra$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/dijkstra$(EXE)
$(INSTALL_PROGRAM) dijkstra$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/dijkstra$(EXE)
clean:
rm -f *.o dijkstra
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -18,8 +18,8 @@ all: genhostsfile genfromdb genfromtopo
include $(TESTBED_SRCDIR)/GNUmakerules
genhostsfile: genhostsfile.o
$(CC) $(CFLAGS) genhostsfile.o $(LIBS) -o genhostsfile
genhostsfile-debug: genhostsfile.o
$(CC) $(CFLAGS) genhostsfile.o $(LIBS) -o $@
wgraph.o: wgraph.cc wgraph.h
......@@ -27,7 +27,7 @@ install: $(INSTALL_LIBEXECDIR)/genhostsfile
client: genhostsfile
client-install: client
$(INSTALL_PROGRAM) -s genhostsfile$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/genhostsfile$(EXE)
$(INSTALL_PROGRAM) genhostsfile$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/genhostsfile$(EXE)
clean:
rm -f *.o genhostsfile genfromtopo genfromdb
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,30 +11,35 @@ SUBDIR = os/syncd
include $(OBJDIR)/Makeconf
CFLAGS = -Wall -O2 -g -static \
CFLAGS = -Wall -O2 -g \
-I${OBJDIR} -I${TESTBED_SRCDIR}/lib/libtb
LIBS = ${OBJDIR}/lib/libtb/libtb.a
LDFLAGS =
ifneq ($(host_cpu),arm)
LDFLAGS += -static
endif
all: emulab-syncd emulab-sync
include $(TESTBED_SRCDIR)/GNUmakerules
emulab-syncd: emulab-syncd.o version.o decls.h
$(CC) $(CFLAGS) emulab-syncd.o version.o $(LIBS) -o emulab-syncd
emulab-syncd-debug: emulab-syncd.o version.o decls.h
$(CC) $(CFLAGS) emulab-syncd.o version.o $(LDFLAGS) $(LIBS) -o $@
emulab-sync: emulab-sync.o version.o decls.h
$(CC) $(CFLAGS) emulab-sync.o version.o $(LIBS) -o emulab-sync
emulab-sync-debug: emulab-sync.o version.o decls.h
$(CC) $(CFLAGS) emulab-sync.o version.o $(LDFLAGS) $(LIBS) -o $@
version.c: emulab-syncd.c
echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"
client: all
client-install: client
$(INSTALL_PROGRAM) -s emulab-syncd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-syncd$(EXE)
$(INSTALL_PROGRAM) -s emulab-sync$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-sync$(EXE)
$(INSTALL_PROGRAM) emulab-syncd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-syncd$(EXE)
$(INSTALL_PROGRAM) emulab-sync$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-sync$(EXE)
$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)$(CLIENT_MANDIR)/man1
$(INSTALL_PROGRAM) $(SRCDIR)/emulab-syncd.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-syncd.1
$(INSTALL_PROGRAM) $(SRCDIR)/emulab-sync.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-sync.1
$(INSTALL_DATA) $(SRCDIR)/emulab-syncd.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-syncd.1
$(INSTALL_DATA) $(SRCDIR)/emulab-sync.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-sync.1
check:
sh $(SRCDIR)/syncd_test.sh
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -29,7 +29,7 @@ all: $(SDPROGS) client
include ${TESTBED_SRCDIR}/GNUmakerules
slothd: slothd.o slothd.h version.o
slothd-debug: slothd.o slothd.h version.o
$(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ slothd.o version.o $(LIBS)
sdcollectd: sdcollectd.o sdcollectd.h version.o $(TBLIB)
......@@ -48,7 +48,7 @@ install: $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS) sdcollectd) webfeedbac
$(INSTALL_PROGRAM) webfeedback $(INSTALL_LIBEXECDIR)
client-install: client
$(INSTALL_PROGRAM) -s slothd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)$(EXE)
$(INSTALL_PROGRAM) slothd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)$(EXE)
clean:
rm -f *.o $(SDPROGS) *~ core *.core version.c
......@@ -81,11 +81,11 @@ tmcc-shared: tmcc.c decls.h $(SSLOBJ)
$(CC) $(CFLAGS) $(SSLFLAGS) -g -o tmcc $< $(SSLOBJ) \
$(LFLAGS) $(TMLIBS)
tmcc-nossl: tmcc.c decls.h
$(CC) $(CFLAGS) -static -g -o tmcc-nossl $< $(LFLAGS) $(TMSLIBS)
tmcc-nossl-debug: tmcc.c decls.h
$(CC) $(CFLAGS) -static -g -o $@ $< $(LFLAGS) $(TMSLIBS)
findif: findif.o
$(CC) $(CFLAGS) -g -o findif findif.o $(LFLAGS) -static
findif-debug: findif.o
$(CC) $(CFLAGS) -g -o $@ findif.o $(LFLAGS) -static
ssl.o: ssl.c ssl.h decls.h
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -75,8 +75,8 @@ sup-install: dir-install supfile
$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth
bin-install: dir-install
$(INSTALL) -m 755 -s ../tmcc-nossl$(EXE) $(BINDIR)/tmcc.bin$(EXE)
$(INSTALL) -m 755 -s ../findif$(EXE) $(BINDIR)/findif$(EXE)
$(INSTALL) -m 755 ../tmcc-nossl$(EXE) $(BINDIR)/tmcc.bin$(EXE)
$(INSTALL) -m 755 ../findif$(EXE) $(BINDIR)/findif$(EXE)
etc-install: dir-install sysetc-remove sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
......
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