build: Capture the location of the GNUnet libraries.

* gnu/gnunet/config.scm.in: New file.
* gnu/gnunet/common.scm: Use (gnu gnunet config).
  (gnunet-util-ffi, gnunet-fs-ffi, gnunet-identity-ffi): Use the new
  %libgnunet-util etc. variables.
* configure.ac: Substitute GNUNETUTIL_LIBDIR, GNUNETFS_LIBDIR, and
  GNUNETIDENTITY_LIBDIR.
* Makefile.am (GOBJECTS): Add gnu/gnunet/config.go.
This commit is contained in:
Ludovic Courtès 2015-11-05 17:35:54 +01:00
parent f862f2b82c
commit b36ec7d915
5 changed files with 45 additions and 5 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ Makefile.in
*.go
/Makefile
/config.log
/gnu/gnunet/config.scm

View File

@ -29,7 +29,7 @@ MODULES = \
gnu/gnunet/fs/progress-info.scm \
gnu/gnunet/fs/uri.scm
GOBJECTS = $(MODULES:%.scm=%.go)
GOBJECTS = $(MODULES:%.scm=%.go) gnu/gnunet/config.go
CLEANFILES = $(GOBJECTS)
nobase_dist_guilemodule_DATA = $(MODULES)

View File

@ -38,7 +38,15 @@ PKG_CHECK_MODULES([GNUNETUTIL], [gnunetutil])
PKG_CHECK_MODULES([GNUNETFS], [gnunetfs])
PKG_CHECK_MODULES([GNUNETIDENTITY], [gnunetidentity])
AC_CONFIG_FILES([Makefile])
GNUNETUTIL_LIBDIR="`$PKG_CONFIG --variable=libdir gnunetutil`"
GNUNETFS_LIBDIR="`$PKG_CONFIG --variable=libdir gnunetfs`"
GNUNETIDENTITY_LIBDIR="`$PKG_CONFIG --variable=libdir gnunetidentity`"
AC_SUBST([GNUNETUTIL_LIBDIR])
AC_SUBST([GNUNETFS_LIBDIR])
AC_SUBST([GNUNETIDENTITY_LIBDIR])
AC_CONFIG_FILES([Makefile gnu/gnunet/config.scm])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_OUTPUT

View File

@ -21,6 +21,7 @@
#:use-module (rnrs bytevectors)
#:use-module (ice-9 match)
#:use-module (gnu gnunet binding-utils)
#:use-module (gnu gnunet config)
#:export (gnunet-ok
gnunet-system-error
gnunet-yes
@ -85,9 +86,9 @@
(define gnunet-yes 1)
(define gnunet-no 0)
(define gnunet-util-ffi (dynamic-link "libgnunetutil"))
(define gnunet-fs-ffi (dynamic-link "libgnunetfs"))
(define gnunet-identity-ffi (dynamic-link "libgnunetidentity"))
(define gnunet-util-ffi (dynamic-link %libgnunet-util))
(define gnunet-fs-ffi (dynamic-link %libgnunet-fs))
(define gnunet-identity-ffi (dynamic-link %libgnunet-identity))
(define-syntax define-foreign-definer

30
gnu/gnunet/config.scm.in Normal file
View File

@ -0,0 +1,30 @@
;;;; -*- mode: Scheme; indent-tabs-mode: nil; fill-column: 80; -*-
;;;;
;;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
;;;;
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation, either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu gnunet config)
#:export (%libgnunet-util
%libgnunet-fs
%libgnunet-identity))
(define %libgnunet-util
"@GNUNETUTIL_LIBDIR@/libgnunetutil")
(define %libgnunet-fs
"@GNUNETFS_LIBDIR@/libgnunetfs")
(define %libgnunet-identity
"@GNUNETIDENTITY_LIBDIR@/libgnunetidentity")