trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r1031269 - in /trafficserver/traffic/trunk: Makefile.am configure.ac tsxs.in
Date Thu, 04 Nov 2010 21:41:43 GMT
Author: jesus
Date: Thu Nov  4 21:41:43 2010
New Revision: 1031269

URL: http://svn.apache.org/viewvc?rev=1031269&view=rev
Log:
TS-512 it's neat that his is a power of two... tsxs to help compile modules

Added:
    trafficserver/traffic/trunk/tsxs.in   (with props)
Modified:
    trafficserver/traffic/trunk/Makefile.am
    trafficserver/traffic/trunk/configure.ac

Modified: trafficserver/traffic/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/Makefile.am?rev=1031269&r1=1031268&r2=1031269&view=diff
==============================================================================
--- trafficserver/traffic/trunk/Makefile.am (original)
+++ trafficserver/traffic/trunk/Makefile.am Thu Nov  4 21:41:43 2010
@@ -36,6 +36,8 @@ EXTRA_DIST=CHANGES INSTALL STATUS NOTICE
 installcheck-local:
 	$(DESTDIR)$(bindir)/traffic_server -R 1
 
+install-exec-local:
+	$(INSTALL) -m 0755 tsxs $(DESTDIR)$(bindir)/tsxs
 
 doxygen:
 	$(MAKE) -C doc doxygen

Modified: trafficserver/traffic/trunk/configure.ac
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/configure.ac?rev=1031269&r1=1031268&r2=1031269&view=diff
==============================================================================
--- trafficserver/traffic/trunk/configure.ac (original)
+++ trafficserver/traffic/trunk/configure.ac Thu Nov  4 21:41:43 2010
@@ -98,6 +98,8 @@ TS_PARSE_ARGUMENTS
 # Host detection
 #
 AC_CANONICAL_HOST
+HOST_GUESS="$host"
+AC_SUBST(HOST_GUESS)
 
 #
 # Build environment
@@ -1189,6 +1191,7 @@ AC_SUBST([TFW_PACKAGE_SUFFIX])
 # -----------------------------------------------------------------------------
 # 6. OUTPUT FILES
 
+AC_CONFIG_FILES([tsxs])
 AC_CONFIG_FILES([doc/Doxyfile])
 AC_CONFIG_FILES([doc/Makefile])
 AC_CONFIG_FILES([rc/Makefile])

Added: trafficserver/traffic/trunk/tsxs.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/tsxs.in?rev=1031269&view=auto
==============================================================================
--- trafficserver/traffic/trunk/tsxs.in (added)
+++ trafficserver/traffic/trunk/tsxs.in Thu Nov  4 21:41:43 2010
@@ -0,0 +1,143 @@
+#!/bin/sh
+
+host="@HOST_GUESS@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+INSTALLDIR=`eval echo "@libexecdir@"`
+INCLUDEDIR=`eval echo "@includedir@"`
+CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
+BUILD=
+
+if [ -z "$CC" ]; then
+	CC="@CC@"
+fi
+if [ -z "$CXX" ]; then
+	CXX="@CXX@"
+fi
+
+case $host in
+*-*-darwin*)
+        PICFLAGS="-fPIC"
+        MODULELD="$CC -bundle -flat_namespace -undefined suppress"
+        MODULELDXX="$CXX -bundle -flat_namespace -undefined suppress"
+        MODULEEXT=bundle
+        RLDFLAG="-Wl,--rpath="
+        ;;
+*-*-solaris*)
+        if test "x$CC" != "xgcc" ; then
+                CFLAGS="$CFLAGS -mt"
+        fi
+        PICFLAGS="-Kpic"
+        MODULELD="$CC -G"
+        MODULELDXX="$CXX -G"
+        MODULEEXT=so
+        RLDFLAG="-R"
+        WHOLE_ARCHIVE="-Wl,-z -Wl,allextract"
+        NOWHOLE_ARCHIVE="-Wl,-z -Wl,defaultextract"
+        ;;
+*-*-linux*)
+        LDFLAGS="$LDFLAGS -Wl,-E"
+        CPPFLAGS="$CPPFLAGS"
+        PICFLAGS="-fpic"
+        MODULELD="$CC -shared"
+        MODULELDXX="$CXX -shared"
+        MODULEEXT=so
+        RLDFLAG="-Wl,--rpath="
+        WHOLE_ARCHIVE="-Wl,--whole-archive"
+        NOWHOLE_ARCHIVE="-Wl,--no-whole-archive"
+        ;;
+*-*-freebsd*)
+        PICFLAGS="-fpic"
+        MODULELD="$CC -shared"
+        MODULELDXX="$CXX -shared"
+        MODULEEXT=so
+        RLDFLAG="-Wl,--rpath="
+        ;;
+*)
+        PICFLAGS="-fpic"
+        MODULELD="$CC -shared"
+        MODULEEXT=so
+        RLDFLAG="-Wl,--rpath="
+        ;;
+esac
+
+LD=$MODULELD
+for v in $* 
+do
+	case $v in 
+	-h)
+		cat <<EOF
+$0 : a tool to compile, link and install trafficserver plugins.
+
+ compiling/linking:
+	-c [ file1.c [ file2.c [ ... ] ] ]      ## compiles C files
+	-C [ file1.cc [ file2.C [ ... ] ] ]     ## compiles C++ files
+	-o modulename.so                        ## the name of the module
+	-l lib                                  ## add -llib to the link
+
+ installing:
+	-o modulename.so                        ## the name of the module
+	-i                                      ## install the object
+
+EOF
+		exit
+		;;
+	-l)
+		LIBS="$LIBS -l$2"
+		shift 2
+		;;
+	-c)
+		shift
+		while [ -r $1 ]; do
+			SRC=$1
+			obj=`echo $SRC | sed -e 's/\.[a-z]*$/\.lo/g;'`
+			echo " compiling $SRC -> $obj"
+			echo "$CC $CPPFLAGS $CFLAGS $PICFLAGS -c $SRC -o $obj"
+			$CC $CPPFLAGS $CFLAGS $PICFLAGS -c $SRC -o $obj
+			OBJS="$OBJS $obj"
+			BUILD=1
+			shift
+		done
+		;;
+	-C)
+		shift
+		while [ -r $1 ]; do
+			SRC=$1
+			obj=`echo $SRC | sed -e 's/\.[a-z]*$/\.lo/g;'`
+			echo " compiling $SRC -> $obj"
+			echo "$CXX $CPPFLAGS $CXXFLAGS $PICFLAGS -c $SRC -o $obj"
+			$CXX $CPPFLAGS $CXXFLAGS $PICFLAGS -c $SRC -o $obj	
+			OBJS="$OBJS $obj"
+			LD=$MODULELDXX
+			BUILD=1
+			shift
+		done
+		;;
+	-o)
+		OBJ=$2
+		shift 2
+		;;
+	-i)
+		INSTALL=1
+		shift
+		;;
+	esac
+done
+
+if [ "$BUILD" = "1" -a -n "$OBJ" ]; then
+	echo " linking -> $OBJ"
+	echo "$LD $LDFLAGS -o $OBJ $OBJS $LIBS"
+	$LD $LDFLAGS -o $OBJ $OBJS $LIBS
+fi
+
+if [ -n "$OBJ" ]; then
+	if [ -r "$OBJ" ]; then
+		if [ "$INSTALL" = "1" ]; then
+			echo "installing $OBJ -> $INSTALLDIR/$OBJ"
+			cp $OBJ $INSTALLDIR/$OBJ
+			chmod 0755 $INSTALLDIR/$OBJ
+		fi
+	else
+		echo "No $OBJ"
+	fi
+fi

Propchange: trafficserver/traffic/trunk/tsxs.in
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message