3 # This is a little helper script to build LWP static, and pthread shared and static
4 # objects from a single source file. We use libtool to do the heavy lifting for
5 # the pthreaded builds, but build the LWP objects here ourselves.
15 while [ -z "$done" ] && [ $# -gt 0 ] ; do
52 echo "Usage: lwptool --mode compile|link -o <object> --lwpcc <lwp compiler> --mtcc <pthread compiler> -- ..." >&2;
60 if [ -z "$object" ] || [ -z "$lwpcc" ] || \
61 [ -z "$mtcc" ] || [ -z "$mode" ] ; then
62 echo "Usage: lwptool --mode compile -o <object>" >&2;
63 echo " --lwpcc <lwp compiler>" >&2;
64 echo " --mtcc <pthread compiler> blah -- ..." >&2;
68 lwpobj=`echo $object | sed -e 's/.lo$/.o/'`
71 mkdir .lwp 2>/dev/null
72 echo $lwpcc -o $lwpobj "$@"
73 $lwpcc -o $lwpobj "$@" || exit 1
74 echo $mtcc -o $object "$@"
75 $mtcc -o $object "$@" || exit 1
78 if [ -z "$object" ] || [ -z "$linker" ] || \
79 [ -z "$ranlib" ] ; then
80 echo "Usage: l§wptool --mode linker -o <object>" >&2;
81 echo " --linker <linker and options>" >&2;
82 echo " --ranlib <ranlib>" >&2;
86 # This will go horribly wrong if we ever have objects with shell
87 # special characters in their names
90 while [ $# -gt 0 ] ; do
92 realobject=`echo $arg | sed -e 's/\(.*\).lo/.lwp\/\1.o/'`
93 objects="$objects $realobject"
97 rm -f $object 2>/dev/null
98 echo $linker $object $objects
99 $linker $object $objects