version=${module.version}
+# We must follow major version changes of org.glite.lb.common due to
+# binary compatibility. However, we may live a life of our own, changing our
+# major version more frequently. This variable specifies how many steps ahead
+# we are (the number can be even negative).
+
+VERSION_AHEAD=-3
+
VPATH=${top_srcdir}/src:${top_srcdir}/interface:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/doc
AT3=${stagedir}/sbin/glite-lb-at3
GENSAM=${top_srcdir}/examples/gen_sample_job
-CHECK_VERSION:=VERSION=${version} VERSION_AHEAD=0 perl ${top_srcdir}/project/check_version.pl
+CHECK_VERSION:=VERSION=${version} VERSION_AHEAD=${VERSION_AHEAD} perl ${stagedir}/sbin/glite-lb-check_version.pl
SUFFIXES = .T .l
HDRS:=consumer.h notification.h statistics.h prod_proto.h connection.h \
Job.h Notification.h ServerConnection.h
FAKE_HDRS:=consumer_fake.h producer_fake.h
-GEN_HDRS:=JobStatus.h producer.h interface_version.h
+GEN_HDRS:=JobStatus.h producer.h
LIBTHROBJS:=${LIBOBJS:.o=.thr.o}
LIBLOBJS:=${LIBOBJS:.o=.lo}
ifdef LB_STANDALONE
compile all: generate ${LIB} ${THRLIB} ${TOOLS} logevent examples ${MAN_GZ}
else
-# FIXME:
-#compile all: generate ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${TOOLS} logevent examples ${MAN_GZ}
-compile all: generate ${LIB} ${THRLIB} ${TOOLS} logevent examples ${MAN_GZ}
+compile all: check_version generate ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${TOOLS} logevent examples ${MAN_GZ}
endif
generate: ${GEN_HDRS}
ln -vs . ${lbprefix}
for i in ${HDRS}; do ln -vs ../interface/$$i $$i ; done
-interface_version.h: ${top_srcdir}/project/version.properties
- echo "#define GLITE_LB_CLIENT_INTERFACE \"${version}\"" >$@
-
${LIB}: ${LIBOBJS}
${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${PREFIX}/lib \
${COMMON_LIB} \
rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/
check_version:
- ${CHECK_VERSION} ${stagedir}/include/glite/lb/interface_version.h
+ ${CHECK_VERSION} ${stagedir}/include/glite/lb/common_version.h
.PHONY: default all compile examples fake check stage dist distsrc distbin install clean check_version
-D_GNU_SOURCE \
-DDATAGRID_EXTENSION ${LB_STANDALONE_FLAGS}
-# We must follow major version changes of org.glite.lb.client-interface due to
-# binary compatibility. However, we may live a life of our own, changing our
-# major version more frequently. This variable specifies how many steps ahead
-# we are.
-
-VERSION_AHEAD=3
-CHECK_VERSION:=VERSION=${version} VERSION_AHEAD=${VERSION_AHEAD} perl ${top_srcdir}/project/check_version.pl
-
ifneq (${expat_prefix},/usr)
EXPAT_LIBS:=-L${expat_prefix}/lib
endif
xml_conversions.h log_proto.h events_parse.h il_string.h il_msg.h \
escape.h ulm_parse.h trio.h lb_maildir.h connpool.h notifid.h notif_rec.h \
query_rec.h timeouts.h LoggingExceptions.h CountRef.h ${PERF_HDRS}
-GEN_HDRS:=Event.h events.h jobstat.h
+GEN_HDRS:=Event.h events.h jobstat.h common_version.h
STATICLIB:=libglite_lb_common_${nothrflavour}.a
THRSTATICLIB:=libglite_lb_common_${thrflavour}.a
ln -vs . ${lbprefix}
for i in ${HDRS}; do ln -vs ../interface/$$i $$i ; done
+common_version.h: ${top_srcdir}/project/version.properties
+ echo "#define GLITE_LB_COMMON_VERSION \"${version}\"" >$@
+
all compile: generate ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB} ${TRIO_LIB} ${MAILDIR_LIB}
# In order to use libtool versioning correcty, we must have:
rm -f $@
${AT3} $< >$@ || rm -f $@
chmod -w $@ >/dev/null
-
-check_version:
- ${CHECK_VERSION} ${stagedir}/include/glite/lb/interface_version.h
SBIN=${stagedir}/sbin
PM=StructField.pm MultiStruct.pm
-T=events.T status.T types.T
+T=events.T status.T types.T
+SCRIPTS=at3 check_version.pl
default: compile
at3: at3.in
sed "s?%PREFIX%?${stagedir}?" at3.in >$@
+stage: install
+
install: compile
mkdir -p ${PM_DEST} ${T_DEST} ${SBIN}
install -m 644 ${PM} ${PM_DEST}
install -m 644 ${T} ${T_DEST}
- install -m 755 at3 ${SBIN}/glite-lb-at3
+ for p in ${SCRIPTS} ; do \
+ install -m 755 "$$p" "${SBIN}/glite-lb-$$p"; \
+ done
clean:
- rm -f at3
+ rm -vf at3
+ rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/
check:
--- /dev/null
+#!/usr/bin/perl
+
+# check_version script to be used to compare common and client module versions
+# Usage:
+# - set environment variables VERSION and VERSION_AHEAD of the module
+# - run against ${stagedir}/include/glite/lb/common_version.h
+# Example:
+# ./check_version.pl common_version.h
+
+my $version = $ENV{VERSION};
+if ($version =~ /(\d+)\.\d+\.\d+/) {
+ $version = $1;
+} else {
+ print "error: wrong version format ($version)\n";
+ exit 1;
+}
+
+my $ahead = $ENV{VERSION_AHEAD};
+if ($ahead =~ /(\-?\d+)/) {
+ $ahead = $1;
+} else {
+ print "error: wrong version_ahead format ($ahead)\n";
+ exit 1;
+}
+
+my $iface;
+
+while (<>) {
+ /#define GLITE_LB_COMMON_VERSION "(\d+)\.\d+\.\d+"/;
+ $iface = $1;
+}
+
+if ($iface + $ahead != $version) {
+ print "error: Major version of the common ($iface and $ahead ahead) DOES NOT match implementation ($version)\n" ;
+ exit 1;
+}