Manolis Ragkousis <manolis...@gmail.com> skribis: > I started writing the macro that chooses between 'glibc/linux' and > 'glibc/hurd' so I added #:export (glibc) at defined modules, renamed glibc > to glibc/linux and then I added > > (define (glibc-for-target target) > "Return the glibc for TARGET, glibc/linux for a linux host or > glibc/hurd for a hurd host" > (match target > ("i686-pc-gnu" glibc/hurd) > (_ glibc/linux))) > > (define-syntax glibc > (identifier-syntax (glibc-for-target (%current-target-system))))
Looks good! It should be: (glibc-for-target (or (%current-target-system) (%current-system))) so that, when we build natively on GNU/Hurd, we also end up using glibc/hurd. > Is my approach right? Because I am getting the error > > gnu/packages/base.scm:772:3: In procedure #<procedure 48307c0 ()>: > gnu/packages/base.scm:772:3: In procedure struct-ref: Wrong type argument > in position 1 (expecting struct): #<syntax-transformer glibc> Run ‘make clean-go && make’ to recompile the Scheme file, and everything will be alright, hopefully. :-) (This is because macros are expanded at compile time, so any Scheme file that refers to ‘glibc’ must be recompiled so that the macro gets expanded.) Ludo’.