Issues with config.h

Robert Kennedy amtor at
Thu Aug 4 17:30:01 UTC 2022

Thanks Chris and Josh for your comments.

Attached is main.log.  I created an error in the destroot stage so main.log would be created.

Also attached is the Portfile.  I commented out the patch to config.h listed in the Portfile that adds the all the "includes guards" to config.h so the "macro redefined" warnings will be generated.

As I mentioned in my previous post, I do not see them these errors when I compile the Project using the Makefile outside of Macports.

My "Includes guard" Patch to config.h does fix the problem when the Project is being built by Macports.

You will not be able to build the project without the Makefile and all the Patches that I created.

When I have time later today, I will submit a Pull Request containing all the files.  I just need to put the finishing touches on the patch that adds the Includes Guards.

With the Makefile and all the patches, M2VDownsizer builds just fine in Macports.

If you have any ideas on why the "macro redefined" warnings only appear when the Project is being built by Macports without the "Includes guard" patch, please let me know.

And of course, please provide any feedback on the Portfile since I am a newbie when it comes to writing Portfiles.

P.S.  As you will see in the Portfile, I created a "macports" target in the Makefile that first runs make depend to generate all those header dependencies before running make all.  These header dependencies are not really needed to build the Project but are needed if one wants to use the Makefile for development purposes so I commented out the "macports" build target in the Portfile.

I elected to not generate all these header dependencies for the Macports build because it will speed up the build in Macports.  The Project will build successfully either way.  If you believe it is best that these header dependencies are generated for the Makefile in the Macports build, please let me know. It is an easy change.



From: Joshua Root <jmr at>
Sent: August 4, 2022 10:21 AM
To: Robert Kennedy <amtor at>; macports-dev at <macports-dev at>
Subject: Re: Issues with config.h

On 2022-8-4 23:36 , Robert Kennedy wrote:
> I am working on creating a new port that uses its own *config.h*.  See
> attached.  The project compiles and builds just in clang outside of
> Macports but when it is built via Macports, a number of macro redefined
> warnings are generated:
> e.g.
>     .*/config.h:29:9: warning: 'HAVE_STDINT_H' macro redefined*
>     *#define HAVE_STDINT_H*
>     *        ^*
>     *./config.h:42:9: note: previous definition is here*
>     *#define HAVE_STDINT_H 1*
> I suspect Macports or the compiler is creating or referencing another
> *config.h*.

Unlikely, but it's very difficult for anyone else to know what's
happening unless you share your Portfile. For your own investigation,
the -H compiler option may be useful.

- Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.log
Type: application/octet-stream
Size: 150075 bytes
Desc: main.log
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Portfile
Type: application/octet-stream
Size: 3110 bytes
Desc: Portfile
URL: <>

More information about the macports-dev mailing list