Issues with config.h

Ryan Schmidt ryandesign at
Fri Aug 5 20:29:11 UTC 2022

On Aug 4, 2022, at 08:36, Robert Kennedy wrote:

> 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

The config.h file clearly does define HAVE_STDINT_H (empty) on line 29 and then redefines it (with a value) on line 42, which is clearly wrong. Remove line 29 and maybe the problem goes away.

The problem does seem to stem from the fact that config.h is getting included twice. For example one place that seems to happen is in mpeg2enc/fdctref.c which first includes mpeg2enc.h (which itself includes config.h) and then includes config.h again. The developer needs to decide whether it is valid to include config.h multiple times. If so, config.h needs to be written so that multiple inclusion works. Include guards are one way to do that. Otherwise, the developer needs to ensure that config.h only gets included once. Since the project is archived and the developer apparently no longer develops it, you get to decide.

On Aug 4, 2022, at 12:30, Robert Kennedy wrote:

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

You're right. This does make it a bit difficult to help.

> 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.

MacPorts sets many environment variables and flags and also applies certain protections like sandboxing. MacPorts also builds in parallel by default. These might account for such differences in behavior.

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

Since you are using "use_configure no", consider using the makefile portgroup; read it to find out how to use it.

You can delete the worksrcdir line since the value you've set it to is the default.

Since your distfile is unversioned, follow

More information about the macports-dev mailing list