guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.6.0 problems with libguilereadline-v-12 and fix


From: Thien-Thi Nguyen
Subject: Re: 1.6.0 problems with libguilereadline-v-12 and fix
Date: Fri, 20 Sep 2002 13:42:06 -0700

   From: Greg Troxel <address@hidden>
   Date: 20 Sep 2002 08:04:22 -0400

   Your point about apps needing to link with the srfi libs is one I had
   not considered.  If they link at compile time, then one either has
   them in a default path, uses LD_LIBRARY_PATH, or uses -rpath/-R  (or
   loses).  This is exactly the situation for libguile today.

another option is to provide "guile-config link-internal".  e.g.:

  $ guile-config link
  -L/home/ttn/local/lib -lguile -lltdl -lm

  $ guile-config link-internal
  guileqthreads
  guilereadline
  guilesrfi_13_14
  guilesrfi_4

  $ guile-config link-internal guilesrfi_13_14
  -L/home/ttn/local/lib/guile/1.4.1.89/modules -lguilesrfi_13_14

this way, the large majority of people who don't care about these
internal libraries can remain blissfully unaware of them, but yet the
necessary info is available to those who have the need.  their makefiles
would look like:

  LIBS = `guile-config link` `guile-config link-internal guilesrfi_13_14`

problem solved, everybody's happy.  in fact, i like this idea so much,
see below for a diff against scripts/guile-config that implements this
in cvs (will appear in 1.4.1.90).

thi


_________________________________________________
Index: guile-config
===================================================================
RCS file: /home/ttn/cvs/guile-core/scripts/guile-config,v
retrieving revision 1.4
diff -w -c -b -c -r1.4 guile-config
*** guile-config        1 Sep 2002 10:18:26 -0000       1.4
--- guile-config        20 Sep 2002 20:33:07 -0000
***************
*** 56,61 ****
--- 56,67 ----
  ;;   Print the linker command-line flags necessary to link against
  ;;   libguile, and any other libraries it requires.
  ;;
+ ;; * Usage: guile-config link-internal [LIB ...]
+ ;;
+ ;;   If LIB is given, print the linker command-line flags necessary
+ ;;   to link against internal libraries LIB ..., otherwise, print a list
+ ;;   of the internal libraries.
+ ;;
  ;; * Usage: guile-config compile
  ;;
  ;;   Print C compiler flags for compiling code that uses Guile.
***************
*** 99,105 ****
  
  (define *this-module* (current-module))
  
! (define *commands* '(link compile info re-prefix-info scmconfig acsubst))
  
  (define *me* "guile-config")
  
--- 105,117 ----
  
  (define *this-module* (current-module))
  
! (define *commands* '(link
!                      link-internal
!                      compile
!                      info
!                      re-prefix-info
!                      scmconfig
!                      acsubst))
  
  (define *me* "guile-config")
  
***************
*** 183,188 ****
--- 195,212 ----
              (else
               (cons (car libs) (loop (cdr libs))))))))
    (newline))
+ 
+ 
+ ;;; the "link-internal" subcommand
+ 
+ (define (COMMAND:link-internal args)
+   (let ((m (format #f "~A/~A/modules" (GBI 'pkglibdir) (GBI 'guileversion))))
+     (if (null? args)
+         (system (format #f "cd ~A && ls *.la | sed 's/^lib//;s/.la$//'" m))
+         (begin
+           (format #t "-L~A" m)
+           (for-each (lambda (lib) (format #t " -l~A" lib)) args)
+           (format #t "\n")))))
  
  
  ;;; the "compile" subcommand




reply via email to

[Prev in Thread] Current Thread [Next in Thread]