<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Ryan,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I also fixed the inline macro which was wrong.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
#define  inline __attribute__ ((__always_inline__))<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
should really be:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
#define inline inline __attribute__ ((__always_inline__))<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
for the code to really work.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I have also patched config.h to address the ARCH issue.  It now reads:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
#ifndef LINUX
<div>          #if defined(__ppc__) || defined(__ppc64__)</div>
<div>                #define ARCH_PPC</div>
<div>          #elif defined(__i386__)</div>
<div>                #define ARCH_X86</div>
<div>          #elif defined(__x86_64__)</div>
<div>              #define ARCH_X86_64</div>
<div>        #elif defined ((__arm64__) && defined(__APPLE__)) || (__aarch64__)</div>
<div>            #define ARCH_ARM64</div>
<div>        #else</div>
<div>            #define ARCH_X86</div>
<div>        #endif</div>
#endif<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I will check whether the code uses <span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">WORDS_BIGENDIAN. </span><span style="color: rgb(32, 31, 30); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255); display: inline !important;">
 I</span><span style="color: rgb(32, 31, 30); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255); display: inline !important;">f not, I will just patch out the problematic code:</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important">#ifndef
 LINUX</span><br style="background-color:rgb(255, 255, 255)">
<span style="background-color:rgb(255, 255, 255);display:inline !important">#define WORDS_BIGENDIAN 1</span><br style="background-color:rgb(255, 255, 255)">
<span style="background-color:rgb(255, 255, 255);display:inline !important">#endif</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color: rgb(255, 255, 255); display: inline !important; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">P.S. 
 I have been fixing some other bugs.  I will submit a PR soon.</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
P.P.S.  It looks like the developer for M2VDownsizer was Metakine who developed and sold
<b>DVD Remaster</b> 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).</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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.  </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
If one wants to shrink DVD's, it is best to use M2VRequantiser and M2VDownsizer in a script.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(32, 31, 30);font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important">Rob</span></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Ryan Schmidt <ryandesign@macports.org><br>
<b>Sent:</b> August 5, 2022 4:38 PM<br>
<b>To:</b> Robert Kennedy <amtor@hotmail.com><br>
<b>Cc:</b> MacPorts Developers <macports-dev@lists.macports.org><br>
<b>Subject:</b> Re: Issues with config.h</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Early in config.h it says:<br>
<br>
<br>
#ifndef LINUX<br>
        #if defined(__ppc__) || defined(__ppc64__)<br>
                #define ARCH_PPC<br>
        #elif defined(__i386__)<br>
                #define ARCH_X86<br>
        #endif<br>
#else<br>
#define ARCH_X86<br>
#endif<br>
<br>
<br>
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.<br>
<br>
<br>
And these lines at the end of config.h are suspicious:<br>
<br>
<br>
#ifndef LINUX<br>
#define WORDS_BIGENDIAN 1<br>
#endif<br>
<br>
<br>
Certainly not all non-Linux systems are big-endian. Intel and Apple Silicon systems are little-endian.<br>
<br>
</div>
</span></font></div>
</body>
</html>