5 # Copyright 2008 Free Software Foundation.
7 # DO NOT RUN THIS SCRIPT UNTIL YOU UNDERSTAND IT!!! IT WILL REMOVE
8 # FILES ON YOUR SYSTEM.
10 # Read the script thoroughly before running it; it will *remove*
11 # /usr/local/gnuradio and repopulate it.
13 # This script provides a way to build GNU Radio modules individually,
14 # and both serves as an example of using the component build system
15 # and provides a way to test the build system. When run, it will
16 # build and install each GNU Radio module in turn, using the
17 # just-installed modules as prerequisites. It places the output of
18 # each build in a separate file BUILD.NNN.options, so that one can do
19 # 'tail -f BUILD.*' to see which components were successfully built.
21 # This script is intended to be broadly portable; be careful when
22 # modifying not to cause problems on systems that place dependencies
25 # Besides GNU Radio dependencies, this program requires sudo, with a
26 # timer long enough to build each module (or no password requirement).
31 # Do not use /opt, because many systems do not have /opt and that
32 # risks running out of space in /. /usr/local/gnuradio is believed to
33 # be reasonable on all of *BSD and GNU/Linux. Probably this needs
34 # OS-specific overrides.
35 PREFIX=/usr/local/gnuradio
37 echo "ABOUT TO COMPLETELY REMOVE $PREFIX in 10 SECONDS!"
40 echo -n "README.components START "; date
42 # This file provides an example of how to build GNU Radio under pkgsrc.
44 # Avoid using rm -rf with $PREFIX, which could be /. Make a backup of
46 sudo rm -rf $PREFIX.old
47 if [ -d $PREFIX ]; then
48 sudo mv $PREFIX $PREFIX.old
52 # Bootstrap just once, rather than once per module.
55 # Determine where prereqs come from.
58 export PKG_CONFIG_PATH=
59 if [ -d /usr/pkg ]; then
61 LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
62 CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
64 # pkg-config is from pkgsrc, so already knows about /usr/pkg/lib/pkgconfig
65 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig"
68 echo LDFLAGS ,$LDFLAGS,
69 echo CPPFLAGS ,$CPPFLAGS,
70 echo PKG_CONFIG_PATH ,$PKG_CONFIG_PATH,
72 # Determine number of cpus and thus how many jobs to run.
76 ncpus=`sysctl hw.ncpu|awk '{print $3}'`
79 jflag=-j`expr $ncpus \* 2`
81 # These are currently ignored.
87 CONF_DISABLE_ALL="--disable-all-components"
89 # We use % instead of ' ' to be able to iterate with /bin/sh's for.
90 # This variable should list all possible arguments, in tsorted order.
93 --with-omnithread%--enable-gnuradio-core
94 --with-omnithread%--enable-pmt
95 --with-omnithread%--with-pmt%--enable-mblock
96 --with-omnithread%--with-pmt%--with-mblock%--enable-usrp
97 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--enable-gr-usrp
98 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-msdd6000
99 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-alsa
100 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-jack
101 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-oss
102 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-osx
103 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-portaudio
104 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-audio-windows
105 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-atsc
106 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-comedi
107 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-cvsd-vocoder
108 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--enable-gr-gpio
109 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-gsm-fr-vocoder
110 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-pager
111 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--enable-gr-radar-mono
112 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-radio-astronomy
113 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-trellis
114 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-video-sdl
115 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gr-wxgui
116 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--enable-gr-sounder
117 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--with-usrp%--with-gr-usrp%--with-gr-wxgui%--enable-gr-utils
118 --with-omnithread%--with-gnuradio-core%--with-pmt%--with-mblock%--enable-gnuradio-examples
122 for arg in $CONF_ENABLE_ARGS; do
124 # Convert sequence numbers and arguments to usable values.
125 seqprint=`printf "%03d" $seq`
126 argspace=`echo $arg | sed -e 's/%/ /g'`
128 echo "BUILDING WITH $argspace"
131 # configure with just one module
132 ./configure --prefix=$PREFIX $CONF_DISABLE_ALL $argspace &&
134 # remove all prior objects
143 echo "SUCCEEDED $argspace"
145 ) > BUILD.$seqprint.$arg 2>&1
150 echo -n "README.components FINISH "; date