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) ...@@ -68,6 +68,9 @@ vpath % $(SRCDIR) $(MOSTLY_SRCDIRS)
%_xdr.c: %.x %_xdr.h %_xdr.c: %.x %_xdr.h
rpcgen -c $< > $@ rpcgen -c $< > $@
%: %-debug
$(STRIP) -o $@ $<
# #
# Rules to regen configure written files. # Rules to regen configure written files.
# #
......
...@@ -15,6 +15,8 @@ export STRIP = @STRIP@ ...@@ -15,6 +15,8 @@ export STRIP = @STRIP@
export RANLIB = @RANLIB@ export RANLIB = @RANLIB@
export AR = @AR@ export AR = @AR@
export ELVIN_CONFIG = @ELVIN_CONFIG@
export JAVAC = @JAVAC@ export JAVAC = @JAVAC@
export JAR = @JAR@ export JAR = @JAR@
......
...@@ -808,10 +808,45 @@ fi ...@@ -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. # Extract the first word of "javac", so it can be a program name with args.
set dummy javac; ac_word=$2 set dummy javac; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -846,7 +881,7 @@ fi ...@@ -846,7 +881,7 @@ fi
# Extract the first word of "jar", so it can be a program name with args. # Extract the first word of "jar", so it can be a program name with args.
set dummy jar; ac_word=$2 set dummy jar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -882,7 +917,7 @@ fi ...@@ -882,7 +917,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ssh", so it can be a program name with args. # 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 set dummy ${ac_tool_prefix}ssh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_SSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -1541,7 +1576,7 @@ fi ...@@ -1541,7 +1576,7 @@ fi
# Check for the robot vision system dependencies. # Check for the robot vision system dependencies.
# #
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 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. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
...@@ -1556,13 +1591,13 @@ else ...@@ -1556,13 +1591,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1560 "configure" #line 1595 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -1573,13 +1608,13 @@ else ...@@ -1573,13 +1608,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1577 "configure" #line 1612 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -1590,13 +1625,13 @@ else ...@@ -1590,13 +1625,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -nologo -E" CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1594 "configure" #line 1629 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -1624,17 +1659,17 @@ for ac_hdr in linux/videodev.h ...@@ -1624,17 +1659,17 @@ for ac_hdr in linux/videodev.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1633 "configure" #line 1668 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -1667,7 +1702,7 @@ done ...@@ -1667,7 +1702,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -1746,7 +1781,7 @@ fi ...@@ -1746,7 +1781,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./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 $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 test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2098,6 +2133,7 @@ s%@CXX@%$CXX%g ...@@ -2098,6 +2133,7 @@ s%@CXX@%$CXX%g
s%@AR@%$AR%g s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g s%@RANLIB@%$RANLIB%g
s%@STRIP@%$STRIP%g s%@STRIP@%$STRIP%g
s%@ELVIN_CONFIG@%$ELVIN_CONFIG%g
s%@JAVAC@%$JAVAC%g s%@JAVAC@%$JAVAC%g
s%@JAR@%$JAR%g s%@JAR@%$JAR%g
s%@SSH@%$SSH%g s%@SSH@%$SSH%g
......
...@@ -27,6 +27,7 @@ AC_CHECK_TOOL(AR,ar) ...@@ -27,6 +27,7 @@ AC_CHECK_TOOL(AR,ar)
AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(RANLIB,ranlib)
AC_CHECK_TOOL(STRIP,strip) AC_CHECK_TOOL(STRIP,strip)
AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
AC_PATH_PROG(JAVAC,javac) AC_PATH_PROG(JAVAC,javac)
AC_PATH_PROG(JAR,jar) AC_PATH_PROG(JAR,jar)
......
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -27,11 +27,11 @@ include $(TESTBED_SRCDIR)/GNUmakerules ...@@ -27,11 +27,11 @@ include $(TESTBED_SRCDIR)/GNUmakerules
#CFLAGS += -DDEBUG #CFLAGS += -DDEBUG
CFLAGS += -O2 -g -static -I. -Wall CFLAGS += -O2 -g -static -I. -Wall
SCFLAGS = $(CFLAGS) `elvin-config --cflags vin4c` SCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4c`
TCFLAGS = $(CFLAGS) `elvin-config --cflags vin4mt` TCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4mt`
# Special CFLAGS w/o warnings, for SWIG-generated code # Special CFLAGS w/o warnings, for SWIG-generated code
CFLAGS_NOWARN += -O2 -g -static -I. CFLAGS_NOWARN += -O2 -g -static -I.
CFLAGS_NOWARN += `elvin-config --cflags vin4c` CFLAGS_NOWARN += `$(ELVIN_CONFIG) --cflags vin4c`
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
PCORE = -I/usr/lib/perl5/5.6.1/i386-linux/CORE PCORE = -I/usr/lib/perl5/5.6.1/i386-linux/CORE
else else
...@@ -100,10 +100,10 @@ event_wrap_py.o: $(SRCDIR)/event_wrap_py.c ...@@ -100,10 +100,10 @@ event_wrap_py.o: $(SRCDIR)/event_wrap_py.c
$(CC) -c $(CFLAGS_NOWARN) $(PYCORE) $< $(CC) -c $(CFLAGS_NOWARN) $(PYCORE) $<
event.so: event.o event_wrap.o util.o 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 _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 LIB_STUFF = event.pm event.so tbevent.py _tbevent.so
......
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -19,13 +19,17 @@ all: $(PROGRAMS) ...@@ -19,13 +19,17 @@ all: $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb 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 += -levent -ltb -lcrypto
LIBS += `elvin-config --libs vin4c` LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0) ifeq ($(NEEDKERB),0)
...@@ -34,8 +38,13 @@ ifeq ($(NEEDKERB),0) ...@@ -34,8 +38,13 @@ ifeq ($(NEEDKERB),0)
endif endif
LIBS += -ldl LIBS += -ldl
endif 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) $(CC) $(LDFLAGS) -o $@ link-agent.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h $(PROGRAMS): ../lib/libevent.a ../lib/event.h
...@@ -44,7 +53,7 @@ install: ...@@ -44,7 +53,7 @@ install:
client: $(PROGRAMS) client: $(PROGRAMS)
client-install: client 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: clean:
/bin/rm -f *.o $(PROGRAMS) /bin/rm -f *.o $(PROGRAMS)
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -30,20 +30,28 @@ all: binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \ ...@@ -30,20 +30,28 @@ all: binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG -DCLIENT_BINDIR='"$(CLIENT_BINDIR)"' 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 += -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 += -levent -lcrypto -lssl
LIBS += `elvin-config --libs vin4c` LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0) ifeq ($(NEEDKERB),0)
CFLAGS += `/usr/kerberos/bin/krb5-config --cflags` CFLAGS += `/usr/kerberos/bin/krb5-config --cflags`
LIBS += `/usr/kerberos/bin/krb5-config --libs krb5` LIBS += `/usr/kerberos/bin/krb5-config --libs krb5`
endif endif
LIBS += -ldl endif
endif
ifeq ($(SYSTEM),Linux)
LIBS += -ldl
LOCAL_BINDIR = linux LOCAL_BINDIR = linux
endif endif
...@@ -69,10 +77,10 @@ $(LOCAL_BINDIR): ...@@ -69,10 +77,10 @@ $(LOCAL_BINDIR):
binaries: $(LOCAL_BINDIR) $(LOCAL_BINDIR)/$(DAEMON) $(LOCAL_BINDIR)/$(LTEVENT) 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 $@ $(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 $@ $(CC) $(LDFLAGS) $(LTEVENT_OBJS) $(LIBTB_OBJS) $(LIBS) -o $@
$(DAEMON_OBJS): linktest.h ../lib/libevent.a ../lib/event.h $(DAEMON_OBJS): linktest.h ../lib/libevent.a ../lib/event.h
...@@ -103,8 +111,8 @@ control-install: binaries ...@@ -103,8 +111,8 @@ control-install: binaries
client: all client: all
client-install: client client-install: client
$(INSTALL_PROGRAM) -s $(LOCAL_BINDIR)/$(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON) $(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) -s $(LOCAL_BINDIR)/$(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT) $(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT) $(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN) $(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
$(INSTALL_PROGRAM) $(SRCDIR)/$(SCRIPT_TBCOMPAT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_TBCOMPAT) $(INSTALL_PROGRAM) $(SRCDIR)/$(SCRIPT_TBCOMPAT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_TBCOMPAT)
......
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -19,13 +19,17 @@ all: $(PROGRAMS) ...@@ -19,13 +19,17 @@ all: $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -DDEBUG CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb 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 += -levent -ltb -lcrypto
LIBS += `elvin-config --libs vin4c` LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0) ifeq ($(NEEDKERB),0)
...@@ -34,8 +38,9 @@ ifeq ($(NEEDKERB),0) ...@@ -34,8 +38,9 @@ ifeq ($(NEEDKERB),0)
endif endif
LIBS += -ldl LIBS += -ldl
endif endif
endif
program-agent: program-agent.o program-agent-debug: program-agent.o
$(CC) $(LDFLAGS) -o $@ program-agent.o $(LIBS) $(CC) $(LDFLAGS) -o $@ program-agent.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h $(PROGRAMS): ../lib/libevent.a ../lib/event.h
...@@ -44,7 +49,7 @@ install: ...@@ -44,7 +49,7 @@ install:
client: $(PROGRAMS) client: $(PROGRAMS)
client-install: client 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: clean:
/bin/rm -f *.o $(PROGRAMS) /bin/rm -f *.o $(PROGRAMS)
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -33,19 +33,24 @@ $(LIBEVENTDIR)/%.a: ...@@ -33,19 +33,24 @@ $(LIBEVENTDIR)/%.a:
@$(MAKE) -C $(LIBEVENTDIR) $(@F) @$(MAKE) -C $(LIBEVENTDIR) $(@F)
CFLAGS += -DDEBUG CFLAGS += -DDEBUG
CFLAGS += -O2 -g -static -Wall CFLAGS += -O2 -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb 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 = -pthread
PFLAGS += -DDEBUG PFLAGS += -DDEBUG
PFLAGS += -O2 -g -Wall PFLAGS += -O2 -g -Wall
PFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb 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 LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS += -levent -ltb -lcrypto 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) ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0) ifeq ($(NEEDKERB),0)
...@@ -54,32 +59,33 @@ ifeq ($(NEEDKERB),0) ...@@ -54,32 +59,33 @@ ifeq ($(NEEDKERB),0)
endif endif
LIBS += -ldl LIBS += -ldl
endif endif
endif
PLDFLAGS = -pthread -static PLDFLAGS = -pthread
PLDFLAGS += -L../lib -L${OBJDIR}/lib/libtb PLDFLAGS += -L../lib -L${OBJDIR}/lib/libtb
PLIBS = -levent_r -ltb PLIBS = -levent_r -ltb
PLIBS += -L/usr/local/lib -lvin4mt -lvin4c -lvin4 -lcrypto -lm PLIBS += -L/usr/local/lib -lvin4mt -lvin4c -lvin4 -lcrypto -lm
evproxy: evproxy.o $(LIBTBDIR)/log.o evproxy-debug: evproxy.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ evproxy.o $(LIBS) $(CC) $(LDFLAGS) -o $@ evproxy.o $(LIBS)
evproxyclient: proxyclient.o $(LIBTBDIR)/log.o evproxyclient-debug: proxyclient.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ proxyclient.o $(LIBS) $(CC) $(LDFLAGS) -o $@ proxyclient.o $(LIBS)
evproxyserver: proxyserver.o $(LIBTBDIR)/log.o evproxyserver-debug: proxyserver.o $(LIBTBDIR)/log.o
$(CC) $(PLDFLAGS) -static -o $@ proxyserver.o $(PLIBS) $(CC) $(PLDFLAGS) -o $@ proxyserver.o $(PLIBS)
proxyserver.o: proxyserver.c proxyserver.o: proxyserver.c
$(CC) $(PFLAGS) -c $< $(CC) $(PFLAGS) -c $<
proxytest: proxytest.o $(LIBTBDIR)/log.o proxytest-debug: proxytest.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -static -o $@ proxytest.o $(LIBS) $(CC) $(LDFLAGS) -o $@ proxytest.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h $(PROGRAMS): ../lib/libevent.a ../lib/event.h
client: evproxy client: evproxy
client-install: client client-install: client
$(INSTALL_PROGRAM) -s evproxy$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy$(EXE) $(INSTALL_PROGRAM) evproxy$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy$(EXE)
clean: clean:
/bin/rm -f *.o $(PROGRAMS) /bin/rm -f *.o $(PROGRAMS)
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
...@@ -30,13 +30,17 @@ $(LIBEVENTDIR)/%.a: ...@@ -30,13 +30,17 @@ $(LIBEVENTDIR)/%.a:
@$(MAKE) -C $(LIBEVENTDIR) $(@F) @$(MAKE) -C $(LIBEVENTDIR) $(@F)
CFLAGS += -DDEBUG CFLAGS += -DDEBUG
CFLAGS += -O -g -static -Wall CFLAGS += -O -g -Wall
CFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb 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 LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS += -levent -lcrypto LIBS += -levent -lcrypto
LIBS += `elvin-config --libs vin4c` LIBS += `$(ELVIN_CONFIG) --libs vin4c`
ifeq ($(host_cpu),arm)
else
LDFLAGS += -static
ifeq ($(SYSTEM),Linux) ifeq ($(SYSTEM),Linux)
NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?) NEEDKERB := $(shell nm /usr/lib/libssl.a | grep -q krb; echo $$?)
ifeq ($(NEEDKERB),0) ifeq ($(NEEDKERB),0)
...@@ -45,11 +49,12 @@ ifeq ($(NEEDKERB),0) ...@@ -45,11 +49,12 @@ ifeq ($(NEEDKERB),0)
endif endif
LIBS += -ldl LIBS += -ldl
endif endif