Revision 3b0db383

b/Makefile.common
115 115
gr_docdir = $(docdir)-$(VERSION)
116 116

117 117
# System configuration files
118
gr_sysconfdir = $(sysconfdir)/$(PACKAGE)/conf.d
118
gr_prefsdir = $(GR_PREFSDIR)
119 119

120 120
# Other common defines; use "+=" to add to these
121 121
STAMPS =
b/config/grc_gnuradio_core.m4
86 86
        gnuradio-core/src/lib/filter/Makefile \
87 87
        gnuradio-core/src/lib/g72x/Makefile \
88 88
        gnuradio-core/src/lib/general/Makefile \
89
        gnuradio-core/src/lib/general/gr_prefix.cc \
89
        gnuradio-core/src/lib/general/gr_constants.cc \
90 90
        gnuradio-core/src/lib/gengen/Makefile \
91 91
        gnuradio-core/src/lib/io/Makefile \
92 92
        gnuradio-core/src/lib/missing/Makefile \
b/configure.ac
26 26
AC_CANONICAL_HOST
27 27
AC_CANONICAL_TARGET
28 28

29
AM_INIT_AUTOMAKE(gnuradio,3.3svn)
29

30
VERSION=3.3svn
31
AC_SUBST(VERSION)
32
AM_INIT_AUTOMAKE(gnuradio,$VERSION)
30 33

31 34
DEFINES=""
32 35
AC_SUBST(DEFINES)
......
286 289

287 290
dnl If this is being done from a subversion tree, create variables
288 291
GR_SUBVERSION
289
BUILD_DATE=`date -R`
292
BUILD_DATE=`date -R -u`
290 293
AC_SUBST(BUILD_DATE)
291 294

295
dnl SYSCONFDIR substitution
296
if test "${sysconfdir}" == "\${prefix}/etc" ; then
297
   if test "${prefix}" == "NONE" ; then
298
      SYSCONFDIR=["$ac_default_prefix/etc"]
299
   else
300
      SYSCONFDIR=["${prefix}/etc"]
301
   fi
302
else
303
   SYSCONFDIR=[${sysconfdir}]
304
fi
305
AC_SUBST(SYSCONFDIR)
306

307
dnl System configuration files
308
GR_PREFSDIR=[$SYSCONFDIR/${PACKAGE}/conf.d]
309
AC_SUBST(GR_PREFSDIR)
310

292 311
dnl Component specific configuration
293 312
dnl The order of the GR_ macros determines the order of compilation
294 313
dnl For -any- checks on $enable_all_components
b/gnuradio-core/Makefile.am
29 29
pkgconfigdir = $(libdir)/pkgconfig
30 30
pkgconfig_DATA = gnuradio-core.pc
31 31

32
etcdir = $(gr_sysconfdir)
32
etcdir = $(gr_prefsdir)
33 33
dist_etc_DATA = gnuradio-core.conf
b/gnuradio-core/src/lib/Makefile.am
29 29
SUBDIRS += swig
30 30
endif
31 31

32
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
33

32 34
# generate libgnuradio-core.la from the convenience libraries in subdirs
33 35

34 36
lib_LTLIBRARIES = libgnuradio-core.la libgnuradio-core-qa.la
......
64 66
	runtime/libruntime-qa.la	\
65 67
	libgnuradio-core.la		\
66 68
	$(CPPUNIT_LIBS)			
69

70
bin_PROGRAMS = gnuradio
71
gnuradio_SOURCES = gnuradio.cc
72
gnuradio_LDADD = libgnuradio-core.la $(BOOST_PROGRAM_OPTIONS_LIB)
b/gnuradio-core/src/lib/general/Makefile.am
31 31

32 32
EXTRA_DIST = 				\
33 33
	gen_sine_table.py		\
34
	gr_prefix.cc.in			
34
	gr_constants.cc.in			
35 35

36 36
libgeneral_la_SOURCES = 		\
37 37
	gr_agc_cc.cc                	\
......
117 117
	gr_pll_freqdet_cf.cc		\
118 118
	gr_pll_refout_cc.cc		\
119 119
	gr_pn_correlator_cc.cc		\
120
	gr_prefix.cc			\
120
	gr_constants.cc			\
121 121
	gr_prefs.cc			\
122 122
	gr_probe_avg_mag_sqrd_c.cc	\
123 123
	gr_probe_avg_mag_sqrd_cf.cc	\
......
273 273
	gr_pll_freqdet_cf.h		\
274 274
	gr_pll_refout_cc.h		\
275 275
	gr_pn_correlator_cc.h		\
276
	gr_prefix.h			\
276
	gr_constants.h			\
277 277
	gr_prefs.h			\
278 278
	gr_probe_avg_mag_sqrd_c.h	\
279 279
	gr_probe_avg_mag_sqrd_cf.h	\
......
432 432
	gr_pll_freqdet_cf.i		\
433 433
	gr_pll_refout_cc.i		\
434 434
	gr_pn_correlator_cc.i		\
435
	gr_prefix.i			\
435
	gr_constants.i			\
436 436
	gr_prefs.i			\
437 437
	gr_probe_avg_mag_sqrd_c.i	\
438 438
	gr_probe_avg_mag_sqrd_cf.i	\
b/gnuradio-core/src/lib/general/general.i
105 105
#include <gr_pa_2x2_phase_combiner.h>
106 106
#include <gr_kludge_copy.h>
107 107
#include <gr_prefs.h>
108
#include <gr_prefix.h>
108
#include <gr_constants.h>
109 109
#include <gr_test_types.h>
110 110
#include <gr_test.h>
111 111
#include <gr_unpack_k_bits_bb.h>
......
225 225
%include "gr_pa_2x2_phase_combiner.i"
226 226
%include "gr_kludge_copy.i"
227 227
%include "gr_prefs.i"
228
%include "gr_prefix.i"
228
%include "gr_constants.i"
229 229
%include "gr_test_types.h"
230 230
%include "gr_test.i"
231 231
%include "gr_unpack_k_bits_bb.i"
b/gnuradio-core/src/lib/general/gr_constants.cc.in
1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2006,2009 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22

23
#if HAVE_CONFIG_H
24
#include <config.h>
25
#endif
26

27
#include <gr_constants.h>
28

29
const std::string
30
gr_prefix()
31
{
32
  return "@prefix@";
33
}
34

35
const std::string
36
gr_sysconfdir()
37
{
38
  return "@SYSCONFDIR@";
39
}
40

41
const std::string
42
gr_prefsdir()
43
{
44
  return "@GR_PREFSDIR@";
45
}
46

47
const std::string
48
gr_build_date()
49
{
50
  return "@BUILD_DATE@";
51
}
52

53
const std::string
54
gr_svn_date()
55
{
56
  return "@SVNDATE@";
57
}
58

59
const std::string
60
gr_svn_version()
61
{
62
  return "@SVNVERSION@";
63
}
64

65
const std::string
66
gr_version()
67
{
68
  return "@VERSION@";
69
}
b/gnuradio-core/src/lib/general/gr_constants.h
1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2006,2009 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22
#ifndef INCLUDED_GR_CONSTANTS_H
23
#define INCLUDED_GR_CONSTANTS_H
24

25
#include <string>
26

27
/*!
28
 * \brief return ./configure --prefix argument.  Typically /usr/local
29
 */
30
const std::string gr_prefix();
31

32
/*!
33
 * \brief return ./configure --sysconfdir argument.  Typically $prefix/etc or /etc
34
 */
35
const std::string gr_sysconfdir();
36

37
/*!
38
 * \brief return preferences file directory.  Typically $sysconfdir/etc/conf.d
39
 */
40
const std::string gr_prefsdir();
41

42
/*!
43
 * \brief return date/time of build, as set when 'bootstrap' is run
44
 */
45
const std::string gr_build_date();
46

47
/*!
48
 * \brief return repository date as set when 'bootstrap' is run
49
 */
50
const std::string gr_svn_date();
51

52
/*!
53
 * \brief return repository version as set when 'bootstrap' is run
54
 */
55
const std::string gr_svn_version();
56

57
/*!
58
 * \brief return version string defined in configure.ac
59
 */
60
const std::string gr_version();
61

62
#endif /* INCLUDED_GR_CONSTANTS_H */
b/gnuradio-core/src/lib/general/gr_constants.i
1
/* -*- c++ -*- */
2

3
%rename(prefix) gr_prefix;
4
%rename(sysconfdir) gr_sysconfdir;
5
%rename(prefsdir) gr_prefsdir;
6
%rename(build_date) gr_build_date;
7
%rename(svn_date) gr_svn_date;
8
%rename(svn_version) gr_svn_version;
9
%rename(version) gr_version;
10

11
const std::string gr_prefix();
12
const std::string gr_sysconfdir();
13
const std::string gr_prefsdir();
14
const std::string gr_build_date();
15
const std::string gr_svn_date();
16
const std::string gr_svn_version();
17
const std::string gr_version();
/dev/null
1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2006 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22

23
#include <gr_prefix.h>
24

25
const std::string
26
gr_prefix()
27
{
28
  return "@prefix@";
29
}
/dev/null
1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2006 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22
#ifndef INCLUDED_GR_PREFIX_H
23
#define INCLUDED_GR_PREFIX_H
24

25
#include <string>
26

27
/*!
28
 * \brief return ./configure --prefix argument.  Typically /usr/local
29
 */
30
const std::string gr_prefix();
31

32

33
#endif /* INCLUDED_GR_PREFIX_H */
/dev/null
1
/* -*- c++ -*- */
2

3
%rename(prefix) gr_prefix;
4

5
const std::string gr_prefix();
b/gnuradio-core/src/lib/gnuradio.cc
1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2009 Free Software Foundation, Inc.
4
 * 
5
 * This file is part of GNU Radio
6
 * 
7
 * GNU Radio is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 3, or (at your option)
10
 * any later version.
11
 * 
12
 * GNU Radio is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 * 
17
 * You should have received a copy of the GNU General Public License
18
 * along with GNU Radio; see the file COPYING.  If not, write to
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
20
 * Boston, MA 02110-1301, USA.
21
 */
22

23
#if HAVE_CONFIG_H
24
#include <config.h>
25
#endif
26

27
#include <gr_constants.h>
28
#include <boost/program_options.hpp>
29
#include <iostream>
30

31
namespace po = boost::program_options;
32

33
int
34
main(int argc, char **argv)
35
{
36
  po::options_description desc("Program options: gnuradio [options]");
37
  po::variables_map vm;
38

39
  desc.add_options()
40
    ("help,h", "print help message")
41
    ("prefix", "print gnuradio installation prefix")
42
    ("sysconfdir", "print gnuradio system configuration directory")
43
    ("prefsdir", "print gnuradio preferences directory")
44
    ("builddate", "print gnuradio build date (RFC2822 format)")
45
    ("version,v", "print gnuradio version")
46
    ("svnversion", "print SVN repository version (SVN format)")
47
    ("svndate", "print SVN repository date")
48
    ;
49

50
  po::store(po::parse_command_line(argc, argv, desc), vm);
51
  po::notify(vm);
52

53
  if (vm.size() == 0 || vm.count("help")) {
54
    std::cout << desc << std::endl;
55
    return 1;
56
  }
57
      
58
  if (vm.count("prefix"))
59
    std::cout << gr_prefix() << std::endl;
60

61
  if (vm.count("sysconfdir"))
62
    std::cout << gr_sysconfdir() << std::endl;
63

64
  if (vm.count("prefsdir"))
65
    std::cout << gr_prefsdir() << std::endl;
66

67
  if (vm.count("builddate"))
68
    std::cout << gr_build_date() << std::endl;
69

70
  if (vm.count("version"))
71
    std::cout << gr_version() << std::endl;
72

73
  if (vm.count("svnversion"))
74
    std::cout << gr_svn_version() << std::endl;
75

76
  if (vm.count("svndate"))
77
    std::cout << gr_svn_date() << std::endl;
78

79
  return 0;
80
}
b/gnuradio-core/src/python/gnuradio/gr/prefs.py
33 33
    return os.path.expanduser('~/.gnuradio/config.conf')
34 34
        
35 35
def _sys_prefs_dirname():
36
    return os.path.join(gsp.prefix(), 'etc/gnuradio/conf.d')
36
    return gsp.prefsdir()
37 37

38 38
def _bool(x):
39 39
    """
b/gr-audio-alsa/Makefile.am
26 26
pkgconfigdir = $(libdir)/pkgconfig
27 27
dist_pkgconfig_DATA = gnuradio-audio-alsa.pc
28 28

29
etcdir = $(gr_sysconfdir)
29
etcdir = $(gr_prefsdir)
30 30
dist_etc_DATA = gr-audio-alsa.conf
b/gr-audio-jack/Makefile.am
26 26
pkgconfigdir = $(libdir)/pkgconfig
27 27
dist_pkgconfig_DATA = gnuradio-audio-jack.pc
28 28

29
etcdir = $(gr_sysconfdir)
29
etcdir = $(gr_prefsdir)
30 30
dist_etc_DATA = gr-audio-jack.conf
b/gr-audio-oss/Makefile.am
26 26
pkgconfigdir = $(libdir)/pkgconfig
27 27
dist_pkgconfig_DATA = gnuradio-audio-oss.pc
28 28

29
etcdir = $(gr_sysconfdir)
29
etcdir = $(gr_prefsdir)
30 30
dist_etc_DATA = gr-audio-oss.conf
b/gr-audio-portaudio/Makefile.am
26 26
pkgconfigdir = $(libdir)/pkgconfig
27 27
dist_pkgconfig_DATA = gnuradio-audio-portaudio.pc
28 28

29
etcdir = $(gr_sysconfdir)
29
etcdir = $(gr_prefsdir)
30 30
dist_etc_DATA = gr-audio-portaudio.conf
b/gr-wxgui/Makefile.am
29 29
if PYTHON
30 30
SUBDIRS = src
31 31

32
etcdir = $(gr_sysconfdir)
32
etcdir = $(gr_prefsdir)
33 33
dist_etc_DATA = gr-wxgui.conf
34 34

35 35
pkgconfigdir = $(libdir)/pkgconfig
b/grc/Makefile.am
39 39
ourpythondir = $(grc_src_prefix)
40 40
ourpython_PYTHON = __init__.py
41 41

42
etcdir = $(gr_sysconfdir)
42
etcdir = $(gr_prefsdir)
43 43
dist_etc_DATA = grc.conf
44 44

45 45
EXTRA_DIST = \

Also available in: Unified diff