Issues with config.h

Robert Kennedy amtor at hotmail.com
Fri Aug 5 21:43:40 UTC 2022


Ryan,

I have created a patch file to add include guards everywhere in config.h.  see attached.  I know it is overkill.  But it will address the issue.

I also fixed the inline macro which was wrong.

#define  inline __attribute__ ((__always_inline__))

should really be:

#define inline inline __attribute__ ((__always_inline__))

for the code to really work.

I have also patched config.h to address the ARCH issue.  It now reads:

#ifndef LINUX
          #if defined(__ppc__) || defined(__ppc64__)
                #define ARCH_PPC
          #elif defined(__i386__)
                #define ARCH_X86
          #elif defined(__x86_64__)
              #define ARCH_X86_64
        #elif defined ((__arm64__) && defined(__APPLE__)) || (__aarch64__)
            #define ARCH_ARM64
        #else
            #define ARCH_X86
        #endif
#endif

But it looks like ARCH_PPC, ARCH_X86 is not used anywhere in the code.  It might have been easier to just remove all this code.

I will check whether the code uses WORDS_BIGENDIAN.  If not, I will just patch out the problematic code:

#ifndef LINUX
#define WORDS_BIGENDIAN 1
#endif

P.S.  I have been fixing some other bugs.  I will submit a PR soon.

P.P.S.  It looks like the developer for M2VDownsizer was Metakine who developed and sold DVD Remaster for many years before the company was bought out.  DVD Remaster used the open source command line tools M2VRequantiser and M2VDownsizer to do the real work to shrink DVD-9 discs to DVD-5 discs.  (Use "Show Package contents" on the DVD Remaster Application and you will see these two binaries along with the GPL-2 license in the Contents/Resources/Modules directory).

Metakine released the source code for these tools on their website under GPL-2.  Unlike M2VRequantiser, it is hard to find any info on M2VDownsizer on the web.  So I suspect it was written by Metakine.  I will add a man page to the port.

If one wants to shrink DVD's, it is best to use M2VRequantiser and M2VDownsizer in a script.

I have already submitted a port for M2VRequantiser which was approved and added to Macports.  I will submit a PR for the sister port, M2VDownsizer soon.  My port successfully builds an X86_64 binary which runs just fine on my Mac.  But until I do the PR, I will not know for sure if it builds and runs on Big Sur etc.

Rob
________________________________
From: Ryan Schmidt <ryandesign at macports.org>
Sent: August 5, 2022 4:38 PM
To: Robert Kennedy <amtor at hotmail.com>
Cc: MacPorts Developers <macports-dev at lists.macports.org>
Subject: Re: Issues with config.h

Early in config.h it says:


#ifndef LINUX
        #if defined(__ppc__) || defined(__ppc64__)
                #define ARCH_PPC
        #elif defined(__i386__)
                #define ARCH_X86
        #endif
#else
#define ARCH_X86
#endif


So, on non-Linux systems, it sets ARCH_PPC when building for 32-bit or 64-bit PowerPC systems, it sets ARCH_X86 when building for 32-bit Intel systems, and it sets nothing when building for 64-bit Intel systems and all ARM systems. Since this software predates Apple Silicon systems you may have some work to do to patch it to work on those systems, depending on how ARCH_PPC and ARCH_X86 are used in the code.


And these lines at the end of config.h are suspicious:


#ifndef LINUX
#define WORDS_BIGENDIAN 1
#endif


Certainly not all non-Linux systems are big-endian. Intel and Apple Silicon systems are little-endian.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20220805/6201b20b/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: config.h
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20220805/6201b20b/attachment-0001.h>


More information about the macports-dev mailing list