script for win32

Derek Atkins warlord at MIT.EDU
Sun Aug 27 10:02:06 EDT 2006

Christian Stimming <stimming at> writes:

>> Yeah, this is definitely a problem.  In MOST cases it's only required
>> to run gnucash from the build tree.  I'm pretty happy to not worry about
>> that here.  
> The "gnucash" directory is needed for "make check", though.

Oh.  Durn..  Oh well, I guess we need both.

> See attached patch for gnc-module/

Okay.  I've got some comments below about it..

>> Hopefully all this will get MUCH easier once we move to swig.  But for
>> now I think it's safe to just hard-code "-0" into g-wrap.  Want me to
>> work on that, or do you want to work on it?
> Could you do that? Thanks.

Sure, I'll work on that.  No guarantees, tho.  I've got a lot of other
things to do today, and I'm going on holiday tomorrow (well, Friday,
but I'm actually flying there tomorrow).

Some comments on your patch:

>  .scm-links: 
> -	rm -f gnucash g-wrapped
> -	$(LN_S) -f . gnucash
> -	$(LN_S) -f . g-wrapped
>  	for X in ${SCM_FILE_LINKS} ; do \
>  	  $(LN_S) -f ${srcdir}/$$X . ; \
>  	done
>  endif

Why don't we just do this ALL the time?  There's no real reason not to
use the same code path in all cases.  It certainly doesn't hurt, and
this way we can actually test the code on Linux too and make sure it
continues to work.  It also means someone wont inadvertantly change
something and break the windows build.

> +	rm -rf gnucash g-wrapped
> +	mkdir -p gnucash g-wrapped
> +	make $(BUILT_SOURCES)

Instead of running make, just make .scm-links depend on $(BUILT_SOURCES):

  .scm-links: $(BUILT_SOURCES)

Unfortuntely this might not work in all cases.  For example, in a
directory where there are multiple g-wrapped libraries that depend on
each other you may need an incremental copy into the g-wrapped

> +	(cd g-wrapped; $(LN_S) ../gw-*.scm . )
> +	(cd gnucash; $(LN_S) ../*.scm . )
> +else
> +	rm -f gnucash g-wrapped
> +	$(LN_S) -f . gnucash
> +	$(LN_S) -f . g-wrapped
> +endif
>  	touch .scm-links
> +clean-local:
> +	rm -rf g-wrapped gnucash
> +endif

Again, I think we should use the same process on windows and linux.

>  gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: \
> -  .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
> +  gw-gnc-module-spec.scm ${top_builddir}/config.status
>  	FLAVOR=gnome $(GUILE) -c \
>  	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
>  	  (primitive-load \"./gw-gnc-module-spec.scm\") \

We should figure out what parts get done where.  I think we need one
rule to make sure the directories are created, and then another rule
to copy the generated files appropriately.  Perhaps we want something
like this:

        [ -d gnucash ] || mkdir gnucash
        [ -d g-wrapped ] || mkdir g-wrapped
        ( cd gnucash; for f in $(gncmod_DATA) ; do $(LN_S) -f ../$$f . ; done )

        $(RM) -rf gnucash g-wrapped

gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: \
	.scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
  	FLAVOR=gnome $(GUILE) -c \
  	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
	( cd g-wrapped ; $(LN_S) -f ../gw-*.scm . )

What do you think?  (I can send this as a patch if you prefer?)


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list