refdes_renum: warn of possible number clash with non-conforming values
[geda-gaf/whiteaudio.git] / m4 / geda-data-dirs.m4
blob640c3ef5334aa490ba6b726f717eca324084d6cc
1 # geda-data-dirs.m4                                     -*-Autoconf-*-
2 # serial 1.0
4 dnl gEDA data and configuration directories
5 dnl Copyright (C) 2009  Peter Brett <peter@peter-b.co.uk>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 # Check where gEDA data and configuration should be stored.
22 AC_DEFUN([AX_DATA_DIRS],
24   AC_PREREQ([2.60])dnl
26   # Check where to install ordinary data files (e.g. symbols and
27   # gnetlist backends)
28   # FIXME at some point this should become "$datarootdir/geda-gaf" to
29   # match the tarball name.
30   AC_MSG_CHECKING([where to install gEDA shared data])
31   GEDADATADIR="$datarootdir/gEDA"
32   AC_MSG_RESULT([$GEDADATADIR])
34   # Check where to install rc files.
35   # FIXME at some point the rc directory needs to start *defaulting*
36   # to "$sysconfdir/geda-gaf" in order to comply with the GNU & Linux
37   # FHS guidelines.
38   AC_MSG_CHECKING([where to install gEDA rc files])
39   AC_ARG_WITH([rcdir],
40     AS_HELP_STRING([--with-rcdir[[[=DIR]]]],
41       [install system config in specific DIR]),
42     [ if test "X$with_rcdir" != "Xno"; then
43         if test "X$with_rcdir" = "Xyes"; then
44           GEDARCDIR="$sysconfdir/gEDA"
45         else
46           GEDARCDIR="$with_rcdir"
47         fi
48         AC_MSG_RESULT([$GEDARCDIR])
49       else
50         AC_MSG_RESULT([$GEDADATADIR])
51       fi ],
52     [ AC_MSG_RESULT([$GEDADATADIR])
53   ])
55   # Now define some preprocessor symbols with the *expanded* values
56   GEDADATADIR_expand=`eval "echo $GEDADATADIR" | sed -e"s:^NONE:$ac_default_prefix:"`
57   AC_DEFINE_UNQUOTED([GEDADATADIR], ["$GEDADATADIR_expand"],
58     [Define to gEDA/gaf shared data directory.
59 Only libgeda should use this - apps should use s_path_sys_data()])
61   if test "x$GEDARCDIR" != "x"; then
62     GEDARCDIR_expand=`eval "echo $GEDARCDIR" | sed -e"s:^NONE:$ac_default_prefix:"`
63     AC_DEFINE_UNQUOTED([GEDARCDIR], ["$GEDARCDIR_expand"],
64       [Define to gEDA/gaf rc directory if different from GEDADATADIR.
65 Only libgeda should use this - apps should use s_path_sys_config()])
67   else
68     GEDARCDIR=$GEDADATADIR
69   fi
71   AC_SUBST([GEDADATADIR])
72   AC_SUBST([GEDARCDIR])
74 ])dnl AX_DATA_DIRS