This sounds good Ben... thanks for looking into it.

How hard was it to go through the code and change all of the #ifdefs  
and such?

Derek

On Sep 17, 2008, at 8:06 AM, Benjamin Kirk wrote:

> I am about to check in a substantial change set that prefixes every  
> variable
> in include/base/libmesh_config.h with LIBMESH_ to avoid conflicts with
> external packages.
>
> I found an autoconf macro designed to do just that.  The process is  
> a little
> convoluted and deserves some explanation.
>
> Because of all the builtin variables (SIZEOF_INT, etc...) it is not as
> simple as changing all out AC_DEFINES(HAVE_ to AC_DEFINE(LIBMESH_HAVE_
> What happens is the last step of ./configure goes through  
> libmesh_config.h
> and prefixes everything with LIBMESH_
>
> So, the aclocal.m4 code will say AC_DEFINE(HAVE_MPI), but the actual  
> symbol
> will be LIBMESH_HAVE_MPI.  That is a little confusing, I know, but  
> it was
> the most straightforward implementation.
>
> -Ben
>
> PS:  in doing this, I came across the following, which replaces  
> strings in a
> list of files in place
>
> usage:
> ./greplace STRING1 STRING2 ./src/*/*.C ./include/*/*.h
>
> #!/bin/sh
>
> #
> # greplace
> #
> # Globally replace one string with another in a set of files
> #
>
> src=$1
> shift
> dest=$1
> shift
>
> /usr/bin/perl -p -i -e "s/$src/$dest/g" $@
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Libmesh-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to