Buiding PNGTOMR on Mac OSX

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

I'm trying to build pngtomr from the logotools package on Mac OS X 106.8. (http://www.libpng.org/pub/png/libpng.html)

It requires libpng as a library (png.h). There is a version on fink for Mac OSX 10.6.8 (1.6.10-1) but I can't install fink becuase the version im trying to install (10.6.8 appropriate) keeps timing out or not being able to connect to mirrors during the install.

There is a version (1.2.41 )of libpng in /usr/X11/include/, but it is just not happy with it. And ive also installed libpng 1.0.8, and it is also producing the same errors:

Trying to build pngtomr via gcc just results in every function it trys to call from the library being an 'undefined symbol'. (small tidbit below).
Undefined symbols:
...
...
"_png_set_background", referenced from:
      _read_png in ccZtjJCH.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


What is going wrong?
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16375
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 104 times
Been thanked: 91 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by |darc| »

It fails using libpng 1.6.37 from Homebrew as well, but the error message is different.

AndrewK's logotools is like 18 years old now. No one else has made an open source mr converter?
It's thinking...
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

The only other tools I found were on Sizious' site http://sizious.com/download/dreamcast/ . He has a specific PNG to MR tool, and also that functionality is built in to his Inducer programs as well. However, his/hers PNG to MR tool is written in pascal, and his inducer tool is written in Delphi XE2, 2 languages I have no familiarity with and no compiles (on my Mac 10.6.8 ) for.
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16375
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 104 times
Been thanked: 91 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by |darc| »

Yeah I saw the same thing and wasn't interested in trying to compile them on my Mac either :lol:
It's thinking...
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by SiZiOUS »

I have a project to make a newer, multiplatform MR-Tool based on the implementation of Seflboot Inducer 5 which is the newer implementation at this time. Sadly, I haven't so much time yet. :(
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Buiding PNGTOMR on Mac OSX

Post by mrneo240 »

builds on linux with gcc 8.2 and libpng 1.2
ii  libpng12-0:i386                                             1.2.50-2+deb8u3                    i386         PNG library - runtime
ii  libpng12-dev:i386                                           1.2.50-2+deb8u3                    i386         PNG library - development

heres patch for libpng 1.5x and up (tested on 1.6)
diff -Naur orig/logoinsert.c new/logoinsert.c
--- orig/logoinsert.c	2001-05-09 06:20:09.000000000 -0400
+++ new/logoinsert.c	2019-06-10 10:33:21.681040100 -0400
@@ -26,7 +26,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-
+#include <stdlib.h>
+#include <string.h>
 #include <stdio.h>
 
 int main(int argc, char *argv[])
diff -Naur orig/Makefile new/Makefile
--- orig/Makefile	2001-05-09 06:22:03.000000000 -0400
+++ new/Makefile	2019-06-10 10:17:05.282843400 -0400
@@ -1,5 +1,5 @@
 CC	= gcc
-CFLAGS	= -O3 -mpentiumpro
+CFLAGS	= -O3 -s
 
 .c.o:
 	$(CC) $(CFLAGS) -o $@ -c $<
diff -Naur orig/pngtomr.c new/pngtomr.c
--- orig/pngtomr.c	2001-05-09 06:18:22.000000000 -0400
+++ new/pngtomr.c	2019-06-10 10:28:50.787435400 -0400
@@ -26,7 +26,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-
+#include <stdlib.h>
+#include <string.h>
 #include "png.h"
 
 typedef struct {
@@ -85,7 +86,7 @@
       return 0;
    }
 
-   if (setjmp(png_ptr->jmpbuf))
+   if (setjmp(png_jmpbuf(png_ptr)))
    {
       png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
       fclose(fp);
Attachments
logotools.patch
(1.11 KiB) Downloaded 50 times
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

Thanks for chiming in, MrNeo. Im trying to finish up a game im making and will be hopping back into this within a few weeks.
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

how exactly would i 'patch' that file into logotools?
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

That patch makes sense except for the
 typedef struct {
@@ -85,7 +86,7 @@
       return 0;
    }
part.
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Buiding PNGTOMR on Mac OSX

Post by I.M. Weasel »

Never mind I figured it all out
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
User avatar
BB Hood
DC Developer
DC Developer
Posts: 189
Joined: Fri Mar 30, 2007 12:09 am
Has thanked: 41 times
Been thanked: 10 times

Re: Buiding PNGTOMR on Mac OSX

Post by BB Hood »

I recently programmed a GIMP plugin to create MR images. https://gitlab.com/BBHoodsta/makeip [file-mr.py]
These users thanked the author BB Hood for the post (total 2):
|darc|SiZiOUS
Post Reply