Update incorrectly checked in Makefile.am
[debian/gnuradio] / README.components
1 #!/bin/sh
2  
3 # $Id$
4
5 # Copyright 2008 Free Software Foundation.
6 #
7 # DO NOT RUN THIS SCRIPT UNTIL YOU UNDERSTAND IT!!!  IT WILL REMOVE
8 # FILES ON YOUR SYSTEM.
9 #
10 # Read the script thoroughly before running it; it will *remove*
11 # /usr/local/gnuradio and repopulate it.
12 #
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.
20
21 # This script is intended to be broadly portable; be careful when
22 # modifying not to cause problems on systems that place dependencies
23 # in other than /usr
24 #
25 # Besides GNU Radio dependencies, this program requires sudo, with a
26 # timer long enough to build each module (or no password requirement).
27 #
28
29 set -x
30
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
36
37 echo "ABOUT TO COMPLETELY REMOVE $PREFIX in 10 SECONDS!"
38 sleep 10
39
40 echo -n "README.components START "; date
41
42 # This file provides an example of how to build GNU Radio under pkgsrc.
43
44 # Avoid using rm -rf with $PREFIX, which could be /.  Make a backup of
45 # the old prefix.
46 sudo rm -rf $PREFIX.old
47 if [ -d $PREFIX ]; then
48     sudo mv $PREFIX $PREFIX.old
49 fi
50 rm -rf BUILD.*
51
52 # Bootstrap just once, rather than once per module.
53 ./bootstrap
54
55 # Determine where prereqs come from.
56 export LDFLAGS=
57 export CPPFLAGS=
58 export PKG_CONFIG_PATH=
59 if [ -d /usr/pkg ]; then
60     # pkgsrc
61     LDFLAGS="$LDFLAGS -L/usr/pkg/lib -R/usr/pkg/lib"
62     CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
63
64     # pkg-config is from pkgsrc, so already knows about /usr/pkg/lib/pkgconfig
65     PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig"
66 fi
67
68 echo LDFLAGS ,$LDFLAGS,
69 echo CPPFLAGS ,$CPPFLAGS,
70 echo PKG_CONFIG_PATH ,$PKG_CONFIG_PATH,
71
72 # Determine number of cpus and thus how many jobs to run.
73 ncpus=1
74 case x`uname` in
75     xNetBSD)
76         ncpus=`sysctl hw.ncpu|awk '{print $3}'`
77         ;;
78 esac
79 jflag=-j`expr $ncpus \* 2`
80
81 # These are currently ignored.
82 CONF_DOC_ARGS="
83 --enable-doxygen
84 --enable-dot
85 --enable-latex-docs
86 "
87 CONF_DISABLE_ALL="--disable-all-components"
88
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.
91 CONF_ENABLE_ARGS="
92 --enable-omnithread
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
119 "
120
121 seq=0
122 for arg in $CONF_ENABLE_ARGS; do
123
124     # Convert sequence numbers and arguments to usable values.
125     seqprint=`printf "%03d" $seq`
126     argspace=`echo $arg | sed -e 's/%/ /g'`
127
128     echo "BUILDING WITH $argspace"
129
130     (
131     # configure with just one module
132     ./configure --prefix=$PREFIX $CONF_DISABLE_ALL $argspace &&
133
134     # remove all prior objects
135     make clean &&
136
137     # build
138     make $jflag &&
139
140     # install
141     sudo make install &&
142
143     echo "SUCCEEDED $argspace"
144
145     ) > BUILD.$seqprint.$arg 2>&1
146
147     seq=`expr $seq + 1`
148 done
149
150 echo -n "README.components FINISH "; date