5 # Copyright 2008 Free Software Foundation.
7 # This script provides a way to build GNU Radio modules individually,
8 # and both serves as an example of using the component build system
9 # and provides a way to test that build system. This script is
10 # intended to be broadly portable; be careful when modifying not to
11 # cause problems on systems that place dependencies in other than /usr
13 # Besides GNU Radio dependencies, this program requires sudo, with a
14 # timer long enough to build each module (or no password requirement).
16 # Read the script thoroughly before running it; it will *remove*
17 # /usr/gnuradio and repopulate it.
23 echo -n "README.components START "; date
25 # This file provides an example of how to build GNU Radio under pkgsrc.
27 # Avoid using rm -rf with $PREFIX, which could be /. Make a backup of
29 sudo rm -rf $PREFIX.old
30 sudo mv $PREFIX $PREFIX.old
33 # Bootstrap just once, rather than once per module.
36 # Determine where prereqs come from.
39 export PKG_CONFIG_PATH=
40 if [ -d /usr/pkg ]; then
42 LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
43 CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
45 # pkg-config is from pkgsrc, so already knows about /usr/pkg/lib/pkgconfig
46 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig"
49 echo LDFLAGS ,$LDFLAGS,
50 echo CPPFLAGS ,$CPPFLAGS,
51 echo PKG_CONFIG_PATH ,$PKG_CONFIG_PATH,
53 # Determine number of cpus and thus how many jobs to run.
57 ncpus=`sysctl hw.ncpu|awk '{print $3}'`
60 jflag=-j`expr $ncpus \* 2`
62 # These are currently ignored.
68 CONF_DISABLE_ALL="--disable-all-components"
70 # We use % instead of ' ' to be able to iterate with /bin/sh's for.
73 --with-omnithread%--enable-pmt
74 --with-omnithread%--with-pmt%--enable-mblock
75 --with-omnithread%--enable-gnuradio-core
76 --with-omnithread%--enable-usrp
77 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--enable-gr-usrp
78 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-oss
79 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-atsc
80 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-wxgui
81 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-utils
82 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gnuradio-examples
85 # These are not used, but a list of what the script does not build.
88 --enable-gr-cvsd-vocoder
90 --enable-gr-gsm-fr-vocoder
92 --enable-gr-radar-mono
93 --enable-gr-radio-astronomy
99 # start at 1 to reserve 0 for "./README.components > BUILD.000 2>&1 &"
101 for arg in $CONF_ENABLE_ARGS; do
103 # Convert sequence numbers and arguments to usable values.
104 seqprint=`printf "%03d" $seq`
105 argspace=`echo $arg | sed -e 's/%/ /g'`
107 echo "BUILDING WITH $argspace"
110 # configure with just one module
111 ./configure --prefix=$PREFIX $CONF_DISABLE_ALL $argspace &&
119 echo "SUCCEEDED $argspace"
121 ) > BUILD.$seqprint.$arg 2>&1
126 echo -n "README.components FINISH "; date