1 # geda-data-dirs.m4 -*-Autoconf-*-
4 dnl gEDA data and configuration directories
5 dnl Copyright (C) 2009 Peter Brett <peter@peter-b.co.uk>
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.
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.
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],
26 # Check where to install ordinary data files (e.g. symbols and
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
38 AC_MSG_CHECKING([where to install gEDA rc files])
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"
46 GEDARCDIR="$with_rcdir"
48 AC_MSG_RESULT([$GEDARCDIR])
50 AC_MSG_RESULT([$GEDADATADIR])
52 [ AC_MSG_RESULT([$GEDADATADIR])
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()])
68 GEDARCDIR=$GEDADATADIR
71 AC_SUBST([GEDADATADIR])