Next Generation Emulation banner

1 - 19 of 19 Posts

·
Registered
Joined
·
92 Posts
Discussion Starter #1
Hello all,

I decided to try and compile the latest version of VJ as it's been over a year since I tried to compile anythingVJ related at all and felt I was missing out on some great fun :D

With Shamus' help, I managed to get VJ to compile last time (by altering the makefile) as I was having trouble (and still am) getting libcdio to compile on here.

The post which contained the answer to getting VJ to compile has disappeared so I now have no idea how to get it to build :( Though, I do believe this is a totally different error to last time....


So I say this..."Shamus, HHHEEEELLLLPPPPP!!!!!!!!"...hehe

Here is the error Msys kicks out,

$ make

*** Checking compilation environment... OK

*** Building Virtual Jaguar for generic Unix/Linux...

*** Compiling src/gui/button.cpp...
gcc.exe: CreateProcess: No such file or directory
make: *** [obj/button.o] Error 1

[email protected] ~/vj
$
It thinks it's trying to build for Unix/Linux by the looks of it, which we resolved last time but I cannot rememebr how :hdbash:

Having double checked, there is no "button.o" file anywhere to be seen in the VJ source folders. In fact, I deleted the line asking for obj/button.o but it turned out there is a whole string requests for files in that folder which do not exist.

So, out of curiosity, I removed all the calls to /obj/*.o....and I got 3 cannot find errors :(

[email protected] ~/vj
$ make

*** Checking compilation environment... OK

*** Building Virtual Jaguar for generic Unix/Linux...

*** Linking it all together...
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lstdc++
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lGL
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lcdio
collect2: ld returned 1 exit status
make: *** [vj] Error 1

[email protected] ~/vj
$

Any ideas folks ?

Cheers, Richard.
 

·
Registered
Joined
·
344 Posts
The #1 problem is that it's misidentifying the OS.

What does "echo $OSTYPE" (without the quotes) give you? :)
 

·
Registered
Joined
·
92 Posts
Discussion Starter #3 (Edited)
Hello Shamus,

msys is what it returns.....

can't for the life of me rembe*** forget that, got that bit sussed....I actually read through the makefile and hashed out anything that wasn't OSTYPE win32, sorted.

Also found comments on how to get past not havning libcdio and followed those steps, gets past that now. :D

Now it kicks out an error about lstdc+, which when I deleted out that it screamed at me about various not found references to do with the mk68000 compiling :/


[email protected] ~/vj
$ make

*** Checking compilation environment... OK

*** Building Virtual Jaguar for ...

*** Linking it all together...
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [vj] Error 1

[email protected] ~/vj
is what I am getting now and like I said all hell breaks loose when I remove the call for lstdc++
 

·
Registered
Joined
·
344 Posts
Try this Makefile:
Code:
#
# Unified Makefile for Virtual Jaguar GCC/SDL Portable Jaguar Emulator
#
# by James L. Hammons
#
# This software is licensed under the GPL v2 or any later version. Set the
# file GPL.TXT for details. ;-)
#

# Figure out which system we're compiling for, and set the appropriate variables

OSTYPE := $(shell uname -a)

ifeq "$(findstring Msys,$(OSTYPE))" "Msys"            # Win32

SYSTYPE    := __GCCWIN32__
EXESUFFIX  := .exe
GLLIB      := -lopengl32
ICON       := obj/icon.o
SDLLIBTYPE := --libs
MSG        := Win32 on MinGW

else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"    # Should catch both 'darwin' and 'darwin7.0'

SYSTYPE    := __GCCUNIX__ -D_OSX_
EXESUFFIX  :=
GLLIB      :=
ICON       :=
SDLLIBTYPE := --static-libs
MSG        := Mac OS X

else ifeq "$(findstring Linux,$(OSTYPE))" "Linux"        # Linux

SYSTYPE    := __GCCUNIX__
EXESUFFIX  :=
GLLIB      := -lGL -lGLU
ICON       :=
SDLLIBTYPE := --libs
MSG        := GNU/Linux

else                                            # ???

$(error OS TYPE UNDETECTED)

endif

# Set vars for libcdio
ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""
HAVECDIO := -DHAVE_LIB_CDIO
CDIOLIB  := -lcdio
else
HAVECDIO :=
CDIOLIB  :=
endif

CC         = gcc
LD         = gcc
TARGET     = vj

# Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2
CFLAGS   = -MMD -Wall -Wno-switch -O2 -D$(SYSTYPE) -ffast-math -fomit-frame-pointer `sdl-config --cflags`
CPPFLAGS = -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 -D$(SYSTYPE) \
        $(HAVECDIO) -ffast-math -fomit-frame-pointer `sdl-config --cflags` -g
#        -fomit-frame-pointer `sdl-config --cflags` -g
#        -fomit-frame-pointer `sdl-config --cflags` -DLOG_UNMAPPED_MEMORY_ACCESSES

LDFLAGS =

LIBS = -L/usr/local/lib -L/usr/lib `sdl-config $(SDLLIBTYPE)` -lstdc++ -lz $(GLLIB) $(CDIOLIB)

INCS = -I. -I./src -I./src/gui -I/usr/local/include -I/usr/include

OBJS = \
    obj/m68kcpu.o       \
    obj/m68kops.o       \
    obj/m68kopac.o      \
    obj/m68kopdm.o      \
    obj/m68kopnz.o      \
    obj/m68kdasm.o      \
\
    obj/button.o        \
    obj/element.o       \
    obj/filelist.o      \
    obj/gui.o           \
    obj/guimisc.o       \
    obj/image.o         \
    obj/listbox.o       \
    obj/menu.o          \
    obj/pushbutton.o    \
    obj/slideswitch.o   \
    obj/text.o          \
    obj/textedit.o      \
    obj/window.o        \
\
    obj/blitter.o       \
    obj/cdrom.o         \
    obj/cdintf.o        \
    obj/crc32.o         \
    obj/dac.o           \
    obj/dsp.o           \
    obj/eeprom.o        \
    obj/event.o         \
    obj/file.o          \
    obj/gpu.o           \
    obj/jagdasm.o       \
    obj/jaguar.o        \
    obj/jerry.o         \
    obj/joystick.o      \
    obj/log.o           \
    obj/memory.o        \
    obj/objectp.o       \
    obj/sdlemu_config.o \
    obj/sdlemu_opengl.o \
    obj/settings.o      \
    obj/state.o         \
    obj/tom.o           \
    obj/unzip.o         \
    obj/video.o         \
    obj/vj.o            \
    $(ICON)

# Targets for convenience sake, not "real" targets
.PHONY: clean

all: checkenv message obj $(TARGET)$(EXESUFFIX)
    @echo
    @echo -e "\033[01;33m***\033[00;32m Looks like it compiled OK... Give it a whirl!\033[00m"
    @echo

# Check the compilation environment, barf if not appropriate

checkenv: msg-check-env check-sdl check-zlib check-cdio check-gl ;

#check-sdl: msg-ck-sdl $(if $(strip ),,msg-no-sdl stop-on-error)
check-sdl: msg-ck-sdl $(if $(shell which sdl-config),,msg-no-sdl stop-on-error)
    @echo -e "\033[01;37mOK\033[00m"

msg-ck-sdl:
    @echo -en "   \033[00;32mSDL... \033[00m"

msg-no-sdl:
    @echo -e "\033[01;37mNOT FOUND\033[00m"
    @echo
    @echo -e "\033[01;33mIt seems that you don't have the SDL development libraries installed. If you"
    @echo -e "have installed them, make sure that the sdl-config file is somewhere in your"
    @echo -e "path and is executable.\033[00m"
    @echo

check-zlib: msg-ck-zlib $(if $(shell pkg-config --silence-errors --libs zlib),,msg-no-zlib stop-on-error)
    @echo -e "\033[01;37mOK\033[00m"

msg-ck-zlib:
    @echo -en "   \033[00;32mZLIB... \033[00m"

msg-no-zlib:
    @echo -e "\033[01;37mNOT FOUND\033[00m"
    @echo
    @echo -e "\033[01;33mIt seems that you don't have ZLIB installed. If you have installed it, make"
    @echo -e "sure that the pkg-config file is somewhere in your path and is executable.\033[00m"
    @echo

#NOTE that this check shouldn't be fatal, we can bounce back from it by excluding CD support
check-cdio: msg-ck-cdio $(if $(CDIOLIB),msg-cdio,msg-no-cdio) ;

msg-ck-cdio:
    @echo -en "   \033[00;32mLIBCDIO... \033[00m"

msg-cdio:
    @echo -e "\033[01;37mOK\033[00m"

msg-no-cdio:
    @echo -e "\033[01;37mNOT FOUND\033[00m"
    @echo
    @echo -e "\033[01;33mIt seems that you don't have LIBCDIO installed. Since this is not fatal,"
    @echo -e "Virtual Jaguar will be built WITHOUT CD support.\033[00m"
    @echo

check-gl: msg-ck-gl
    @echo -e "*** GL CHECK NOT IMPLEMENTED ***"

msg-ck-gl:
    @echo -en "   \033[00;32mOpenGL... \033[00m"

stop-on-error: ; $(error COMPILATION ENVIRONMENT)

msg-check-env:
    @echo
    @echo -e "\033[01;33m***\033[00;32m Checking compilation environment: \033[00m"
    @echo

message:
    @echo
    @echo -e "\033[01;33m***\033[00;32m Building Virtual Jaguar for $(MSG)...\033[00m"
    @echo

clean:
    @echo -en "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
    @rm -rf obj
    @rm -f ./$(TARGET)$(EXESUFFIX)
    @echo -e "\033[01;37mdone!\033[00m"

obj:
    @mkdir obj

# This is only done for Win32 at the moment...

ifneq "" "$(ICON)"
$(ICON): res/$(TARGET).rc res/$(TARGET).ico
    @echo -e "\033[01;33m***\033[00;32m Processing icon...\033[00m"
    @windres -i res/$(TARGET).rc -o $(ICON) --include-dir=./res
endif

obj/%.o: src/%.c
    @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
    @$(CC) $(CFLAGS) $(INCS) -c $< -o [email protected]

obj/%.o: src/%.cpp
    @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
    @$(CC) $(CPPFLAGS) $(INCS) -c $< -o [email protected]

obj/%.o: src/gui/%.cpp
    @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
    @$(CC) $(CPPFLAGS) $(INCS) -c $< -o [email protected]

$(TARGET)$(EXESUFFIX): $(OBJS)
    @echo -e "\033[01;33m***\033[00;32m Linking it all together...\033[00m"
    @$(LD) $(LDFLAGS) -o [email protected] $(OBJS) $(LIBS)
#    strip --strip-all vj$(EXESUFFIX)
#    upx -9 vj$(EXESUFFIX)

# Pull in dependencies autogenerated by gcc's -MMD switch
# The "-" in front is there just in case they haven't been created yet

-include obj/*.d

#
# Musashi specific stuffola
#

#obj/m68k%.o: obj/m68k%.c obj/m68kops.h
#    $(CC) $(CFLAGS) -Iobj -c src/m68k%.c -o obj/m68k%.o

#obj/m68k%.o: obj/m68k%.c obj/m68kmake$(EXESUFFIX)
#    $(CC) $(CFLAGS) -Iobj -c src/m68k%.c -o obj/m68k%.o

#see if you can collapse all this crap into one or two lines...
#NOTE: The above doesn't work for some reason...

obj/m68kcpu.o: obj/m68kops.h src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kcpu.c...\033[00m"
    @$(CC) $(CFLAGS) -Iobj -c src/m68kcpu.c -o obj/m68kcpu.o

obj/m68kops.o: obj/m68kmake$(EXESUFFIX) obj/m68kops.h obj/m68kops.c src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kops.c...\033[00m"
    @$(CC) $(CFLAGS) -Isrc -c obj/m68kops.c -o obj/m68kops.o

obj/m68kopac.o: obj/m68kmake$(EXESUFFIX) obj/m68kops.h obj/m68kopac.c src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kopac.c...\033[00m"
    @$(CC) $(CFLAGS) -Isrc -c obj/m68kopac.c -o obj/m68kopac.o

obj/m68kopdm.o: obj/m68kmake$(EXESUFFIX) obj/m68kops.h obj/m68kopdm.c src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kopdm.c...\033[00m"
    @$(CC) $(CFLAGS) -Isrc -c obj/m68kopdm.c -o obj/m68kopdm.o

obj/m68kopnz.o: obj/m68kmake$(EXESUFFIX) obj/m68kops.h obj/m68kopnz.c src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kopnz.c...\033[00m"
    @$(CC) $(CFLAGS) -Isrc -c obj/m68kopnz.c -o obj/m68kopnz.o

obj/m68kdasm.o: src/m68kdasm.c src/m68k.h src/m68kconf.h
    @echo -e "\033[01;33m***\033[00;32m Compiling m68kdasm.c...\033[00m"
    @$(CC) $(CFLAGS) -Isrc -c src/m68kdasm.c -o obj/m68kdasm.o

obj/m68kops.h: obj/m68kmake$(EXESUFFIX)
    @obj/m68kmake obj src/m68k_in.c

obj/m68kmake$(EXESUFFIX): src/m68kmake.c src/m68k_in.c
    @echo -e "\033[01;33m***\033[00;32m Preparing to make the Musashi core...\033[00m"
    @$(CC) $(WARNINGS) src/m68kmake.c -o obj/m68kmake$(EXESUFFIX)
It's going to take some time to iron out the checks between platforms. The upside is that this Makefile will try to detect if you have libcdio or not, and if not, build without it. :thumb:

BTW, what is the output of "pkg-config -?" (without the quotes)?
 

·
Registered
Joined
·
344 Posts
Boy, this is a sticky problem. I hate to throw yet another dependency into the stack but most modern OSes (Linux, OSX) have all this stuff built into the infrastructure... And I really, really hate autotools. And I'm not convinced this approach will work under Windows, but let's try it and see what happens. Go to this page:

FAQ | MinGW

and look at the entry entitled "How do I get pkg-config installed?" Let me know if that solves the problem with the Makefile or not. :)
 

·
Registered
Joined
·
92 Posts
Discussion Starter #10
pkg-config installed perfectly, once I ignored the MinGW FAQ and got a GTK+ runtime form somewhere else....


Now I get this

[email protected] ~/vj
$ make
Makefile:136: *** missing separator. Stop.

[email protected] ~/vj
$ make
Makefile:139: *** missing separator. Stop.

[email protected] ~/vj
$ make
Makefile:142: *** missing separator. Stop.

[email protected] ~/vj
$ make
Makefile:166: *** missing separator. Stop.

[email protected] ~/vj
$ make
Makefile:198: *** missing separator. Stop.

[email protected] ~/vj
$ make
Makefile:126: *** missing separator. Stop.
so, I hashed out the @echo and then I got the same error on line 136 so I hashed that out....142...hashed...166....198.....you get the picture

kind of odd, but hopefully it means something to you. :D

I appreciate all the effort you're putting in here Shamus, thanks for all your help. I would get no where without it :p
 

·
Registered
Joined
·
344 Posts
OK, here's the problem. All those lines in the Makefile that have 4 spaces in front of them should be a single Tab character. I forgot that the BBCode "code" tag doesn't preserve tabs. :p So, basically, you have to go through and convert every line that starts with 4 spaces into lines that start with a single tab character.

Once you do that, it should work just fine. :)
 

·
Registered
Joined
·
92 Posts
Discussion Starter #12
OK , I have done that and no more messages about spaces....:D

Now, I have d/loaded zlib (latest one), run ./configure, make, make install but VJ says "zlib is not installed".

I have spent over an hour searching (see trawling) through various forums and mailings but cannot find anything which seems to work. I have tried even resorting to mingw-get with various versions of zlib......still no joy

Thing is, it looks like zlib compiles ok from the output yet I cannot see zlib.anything or variations thereof anywahere in any folder to do with msys or mingw. Driving me nuts now, I will keep searching for an answer though, I am NOT giving up on this yet :D
 

·
Registered
Joined
·
344 Posts
Hmm, it seems that it doesn't install a pkg-config file so that pkg-config can pick it up... Well, for now, on the line that says
Code:
checkenv: msg-check-env check-sdl check-zlib check-cdio check-gl ;
you can take out the piece that says "check-zlib". I'm really going to have to think how to fix this so it works cross-platform without autotools. :p
 

·
Registered
Joined
·
92 Posts
Discussion Starter #14
I beggining to think you're doing this on purpose to make me learn......:p

[email protected] ~/vj
$ make

*** Checking compilation environment:

SDL... OK
LIBCDIO... NOT FOUND

It seems that you don't have LIBCDIO installed. Since this is not fatal,
Virtual Jaguar will be built WITHOUT CD support.

OpenGL... *** GL CHECK NOT IMPLEMENTED ***

*** Building Virtual Jaguar for Win32 on MinGW...

*** Preparing to make the Musashi core...
src/m68kmake.c:69:0: warning: "MAX_PATH" redefined
C:\MinGW\include/stdlib.h:45:0: note: this is the location of the previous definition

Musashi v3.3 68000, 68010, 68EC020, 68020 emulator
Copyright 1998-2000 Karl Stenerud ([email protected])

Generated 1962 opcode handlers from 503 primitives
*** Compiling m68kcpu.c...
*** Compiling m68kops.c...
obj/m68kops.c: In function 'm68ki_build_opcode_table':
obj/m68kops.c:2044:71: warning: array subscript is above array bounds
*** Compiling m68kopac.c...
*** Compiling m68kopdm.c...
make: *** No rule to make target `@echo', needed by `obj/m68kopnz.o'. Stop.
 

·
Registered
Joined
·
344 Posts
Any lines in the Makefile that start at the margin are considered to be targets by make. And anything that begins with @echo is probably not a target. ;) So that line probably needs a tab in front of it. :) I know the Makefile works, it's just that you need to restore all the tab stops that were in it before the BB stripped them out. :thumb:
 

·
Registered
Joined
·
92 Posts
Discussion Starter #16
w00t, found the problem and fixed it. an @echo on the /obj/m68kopnz.o statement had somehow lost it's carriage return and tab and been tacked onto the end of the command line instead....d'oh!

So, new error....lol
[email protected] ~/vj
$ make

*** Checking compilation environment:

SDL... OK
LIBCDIO... NOT FOUND

It seems that you don't have LIBCDIO installed. Since this is not fatal,
Virtual Jaguar will be built WITHOUT CD support.

OpenGL... *** GL CHECK NOT IMPLEMENTED ***

*** Building Virtual Jaguar for Win32 on MinGW...

*** Compiling m68kopnz.c...
*** Compiling m68kdasm.c...
*** Compiling src/gui/button.cpp...
gcc.exe: CreateProcess: No such file or directory
make: *** [obj/button.o] Error 1

[email protected] ~/vj
$
I feel we're getting close here now though. I think this is just something silly in the way Win7 or msys under Win7 is doing something. I'm going to keep digging in various files / paths and online just in case I can see the problem....

Thanks again Shamus :D
 

·
Registered
Joined
·
344 Posts
Yup, this is a MinGW problem... Apparently it's not finding a program it needs to do the compilation. Wish I could help you there, but I do enough work with Windows to know that I don't want to deal with them any more than I have to. :D No offence meant to those of you who use it. :thumb:
 

·
Registered
Joined
·
92 Posts
Discussion Starter #18
No offence taken matey. You've done more than enough trying to help me than you needed to.

Figured this was a crappy "MingW not doing as it advertised" problem, it just simply doesn't want to work withinthe environment it was written for......sounds like MicroSoft themselves wrote it :p

Thanks for all your help Shamus, I'll keep digging at it from time to time and maybe I'll find the problem........ or I'll go insane...one or the other...lol

Cheers, Richard.
 
1 - 19 of 19 Posts
Top