From 595c08df882c4d86f634743838b01050ef1f8131 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 6 Feb 2009 21:58:59 +0000 Subject: [PATCH] Work on getting everything compiling properly in Linux. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@432 96395faa-99c1-11dd-bbfe-3dabce05a288 --- build.sh | 2 +- plugins/CDVDiso/build.sh | 32 +-- plugins/build.sh | 29 ++- plugins/zerogs/opengl/3rdparty | 1 + plugins/zerogs/opengl/Makefile.am | 98 +++++----- plugins/zerogs/opengl/configure.ac | 300 ++++++++++++++--------------- 6 files changed, 239 insertions(+), 223 deletions(-) create mode 120000 plugins/zerogs/opengl/3rdparty diff --git a/build.sh b/build.sh index b90c6a607f..f46dad8a8e 100644 --- a/build.sh +++ b/build.sh @@ -16,7 +16,7 @@ export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --prefix `pwd`" #export PCSX2OPTIONS="--enable-debug --enable-devbuild --enable-sse3 --prefix `pwd`" # Make sure we have plugins, and bring the normal plugins in. -sh fetch.sh +#sh fetch.sh option=$@ export PCSX2PLUGINS="`pwd`/bin/plugins" diff --git a/plugins/CDVDiso/build.sh b/plugins/CDVDiso/build.sh index daf35304d3..3f569fbc03 100644 --- a/plugins/CDVDiso/build.sh +++ b/plugins/CDVDiso/build.sh @@ -1,16 +1,16 @@ -#!/bin/sh - -curdir=`pwd` - -echo ---------------- -echo Building CDVDiso -echo ---------------- - -cd ${curdir}/src/Linux -make $@ - -# copy the files -if [ -s cfgCDVDiso ] && [ -s libCDVDiso.so ] -then -cp cfgCDVDiso libCDVDiso.so ${PCSX2PLUGINS} -fi +#!/bin/sh + +curdir=`pwd` + +echo ---------------- +echo Building CDVDiso +echo ---------------- + +cd ${curdir}/src/Linux +make $@ + +# copy the files +if [ -s cfgCDVDiso ] && [ -s libCDVDiso.so ] +then +cp cfgCDVDiso libCDVDiso.so ${PCSX2PLUGINS} +fi diff --git a/plugins/build.sh b/plugins/build.sh index bf591ab847..e7ecc9f662 100644 --- a/plugins/build.sh +++ b/plugins/build.sh @@ -12,10 +12,25 @@ exit 1 fi } -buildplugin gs $@ -buildplugin cdvd $@ -buildplugin dev9 $@ -buildplugin fw $@ -buildplugin pad $@ -buildplugin spu2 $@ -buildplugin usb $@ +#buildplugin gs $@ +#buildplugin cdvd $@ +#buildplugin dev9 $@ +#buildplugin fw $@ +#buildplugin pad $@ +#buildplugin spu2 $@ +#buildplugin usb $@ + +buildplugin CDVDnull $@ +buildplugin dev9null $@ +buildplugin FWnull $@ +buildplugin USBnull $@ + +buildplugin zerogs $@ +buildplugin zeropad $@ +buildplugin zerospu2 $@ + +buildplugin PeopsSPU2 $@ + +buildplugin CDVDiso $@ +buildplugin CDVDisoEFP $@ +buildplugin CDVDlinuz $@ \ No newline at end of file diff --git a/plugins/zerogs/opengl/3rdparty b/plugins/zerogs/opengl/3rdparty new file mode 120000 index 0000000000..4f59478266 --- /dev/null +++ b/plugins/zerogs/opengl/3rdparty @@ -0,0 +1 @@ +../../../3rdparty/ \ No newline at end of file diff --git a/plugins/zerogs/opengl/Makefile.am b/plugins/zerogs/opengl/Makefile.am index 70e456411f..f15ca94d3a 100644 --- a/plugins/zerogs/opengl/Makefile.am +++ b/plugins/zerogs/opengl/Makefile.am @@ -1,49 +1,49 @@ -# Create a shared library libZeroGSogl -AUTOMAKE_OPTIONS = foreign -noinst_LIBRARIES = libZeroGSogl.a -INCLUDES = -I@srcdir@/common - -libZeroGSogl_a_CPPFLAGS = $(shell pkg-config --cflags gtk+-2.0) -libZeroGSogl_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) - -if X86_64 -libZeroGSogl_a_CPPFLAGS += -fPIC -libZeroGSogl_a_CXXFLAGS += -fPIC -CCASFLAGS += -fPIC -endif - -# Create a shared object by faking an exe (thanks to ODE makefiles) -traplibdir=$(prefix) - - -if RELEASE_TO_PUBLIC -preext=r -endif - -EXEEXT=$(preext)@so_ext@ - -traplib_PROGRAMS=libZeroGSogl -libZeroGSogl_SOURCES= -libZeroGSogl_DEPENDENCIES = libZeroGSogl.a -libZeroGSogl_LDFLAGS= @SHARED_LDFLAGS@ -libZeroGSogl_LDFLAGS+=-Wl,-soname,@ZEROGS_SONAME@ -libZeroGSogl_LDADD=$(libZeroGSogl_a_OBJECTS) - -libZeroGSogl_a_SOURCES = \ -GSmain.cpp memcpy_amd.cpp Regs.cpp x86.cpp zpipe.cpp \ -Mem.cpp rasterfont.cpp targets.cpp zerogs.cpp - -if X86_64 -libZeroGSogl_a_SOURCES += x86-64.S -else -libZeroGSogl_a_SOURCES += x86-32.S -endif - -if SSE2 -CCASFLAGS+= -DZEROGS_SSE2 -endif - -libZeroGSogl_a_DEPENDENCIES = Linux/libZeroGSLinux.a -libZeroGSogl_LDADD += Linux/libZeroGSLinux.a - -SUBDIRS = Linux . +# Create a shared library libZeroGSogl +AUTOMAKE_OPTIONS = foreign +noinst_LIBRARIES = libZeroGSogl.a +INCLUDES = -I@srcdir@/common -I@srcdir@/3rdparty + +libZeroGSogl_a_CPPFLAGS = $(shell pkg-config --cflags gtk+-2.0) +libZeroGSogl_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) + +if X86_64 +libZeroGSogl_a_CPPFLAGS += -fPIC +libZeroGSogl_a_CXXFLAGS += -fPIC +CCASFLAGS += -fPIC +endif + +# Create a shared object by faking an exe (thanks to ODE makefiles) +traplibdir=$(prefix) + + +if RELEASE_TO_PUBLIC +preext=r +endif + +EXEEXT=$(preext)@so_ext@ + +traplib_PROGRAMS=libZeroGSogl +libZeroGSogl_SOURCES= +libZeroGSogl_DEPENDENCIES = libZeroGSogl.a +libZeroGSogl_LDFLAGS= @SHARED_LDFLAGS@ +libZeroGSogl_LDFLAGS+=-Wl,-soname,@ZEROGS_SONAME@ +libZeroGSogl_LDADD=$(libZeroGSogl_a_OBJECTS) + +libZeroGSogl_a_SOURCES = \ +GSmain.cpp memcpy_amd.cpp Regs.cpp x86.cpp zpipe.cpp \ +Mem.cpp rasterfont.cpp targets.cpp zerogs.cpp + +if X86_64 +libZeroGSogl_a_SOURCES += x86-64.S +else +libZeroGSogl_a_SOURCES += x86-32.S +endif + +if SSE2 +CCASFLAGS+= -DZEROGS_SSE2 +endif + +libZeroGSogl_a_DEPENDENCIES = Linux/libZeroGSLinux.a +libZeroGSogl_LDADD += Linux/libZeroGSLinux.a + +SUBDIRS = Linux . diff --git a/plugins/zerogs/opengl/configure.ac b/plugins/zerogs/opengl/configure.ac index e627f8f829..85fdcd4730 100644 --- a/plugins/zerogs/opengl/configure.ac +++ b/plugins/zerogs/opengl/configure.ac @@ -1,150 +1,150 @@ -AC_INIT(ZeroGSogl,0.96.2,zerofrog@gmail.com) - -AM_INIT_AUTOMAKE(ZeroGSogl,0.96.2) - -AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) -AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) -AC_PROG_CPP([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) -AM_PROG_CC_C_O - -AC_PROG_INSTALL -AC_PROG_RANLIB - -dnl necessary for compiling assembly -AM_PROG_AS - -ZEROGS_CURRENT=0 -ZEROGS_REVISION=96 -ZEROGS_AGE=2 -ZEROGS_SONAME=libZeroGSogl.so.[$ZEROGS_CURRENT].[$ZEROGS_REVISION].[$ZEROGS_AGE] -ZEROGS_RELEASE=[$ZEROGS_CURRENT].[$ZEROGS_REVISION].[$ZEROGS_AGE] - -AC_SUBST(ZEROGS_CURRENT) -AC_SUBST(ZEROGS_REVISION) -AC_SUBST(ZEROGS_AGE) -AC_SUBST(ZEROGS_RELEASE) -AC_SUBST(ZEROGS_SONAME) - -CFLAGS=" -I/opt/cg/include -L/opt/cg/lib " -CPPFLAGS=" -I/opt/cg/include -L/opt/cg/lib " -CXXFLAGS=" -I/opt/cg/include -L/opt/cg/lib " - -dnl Check for debug build -AC_MSG_CHECKING(debug build) -AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [debug build]), - debug=$enableval,debug=no) -if test "x$debug" == xyes -then - AC_DEFINE(_DEBUG,1,[_DEBUG]) - CFLAGS+="-g " - CPPFLAGS+="-g -fpermissive " - CXXFLAGS+="-g- fpermissive " -else - AC_DEFINE(NDEBUG,1,[NDEBUG]) - CFLAGS+="-O3 -fomit-frame-pointer " - CPPFLAGS+="-O3 -fomit-frame-pointer " - CXXFLAGS+="-O3 -fomit-frame-pointer -fpermissive " -fi -AC_MSG_RESULT($debug) - -AC_CHECK_FUNCS([ _aligned_malloc _aligned_free ], AC_DEFINE(HAVE_ALIGNED_MALLOC)) - -dnl Check for dev build -AC_MSG_CHECKING(for development build...) -AC_ARG_ENABLE(devbuild, AC_HELP_STRING([--enable-devbuild], [Special Build for developers that simplifies testing and adds extra checks]), - devbuild=$enableval,devbuild=no) -if test "x$devbuild" == xno -then - AC_DEFINE(RELEASE_TO_PUBLIC,1,[RELEASE_TO_PUBLIC]) -fi -AC_MSG_RESULT($devbuild) -AM_CONDITIONAL(RELEASE_TO_PUBLIC, test x$devbuild = xno) - -dnl Check for recompilation -AC_MSG_CHECKING(check for sse2...) -AC_ARG_ENABLE(sse2, AC_HELP_STRING([--enable-sse2], [Enable sse2 instructions]), - sse2=$enableval,sse2=no) -if test "x$sse2" == xyes -then - AC_DEFINE(ZEROGS_SSE2,1,[ZEROGS_SSE2]) -fi -AC_MSG_RESULT($sse2) -AM_CONDITIONAL(SSE2, test x$sse2 = xyes) - -dnl Check for 64bit CPU -AC_MSG_CHECKING(for a x86-64 CPU) -dnl if test "$build_os" == "target_os" -dnl then -AC_TRY_RUN([ -int main() -{ -int a = 0; -int*pa = &a; -asm(".intel_syntax\n" - "mov %%rax, %0\n" - "mov %%eax, [%%rax]\n" - ".att_syntax\n" - : : "r"(pa) : "%rax"); -return 0; -} -],cpu64=yes,cpu64=no,) -dnl else -dnl cpu64=no -dnl fi -if test "x$cpu64" == xyes -then -AC_DEFINE(__x86_64__,1,[__x86_64__]) -fi -AC_MSG_RESULT($cpu64) -AM_CONDITIONAL(X86_64, test x$cpu64 = xyes) - -dnl gtk -AC_MSG_CHECKING(gtk2+) -AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config) -LIBS+=$(pkg-config --libs gtk+-2.0) - -dnl bindir = pcsx2exe - -dnl assuming linux environment -so_ext=".so.$ZEROGS_RELEASE" -SHARED_LDFLAGS="-shared" -AC_SUBST(so_ext) -AC_SUBST(SHARED_LDFLAGS) - -AC_MSG_CHECKING(OpenGL) -AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glext.h],,, - [[#if HAVE_GL_GL_H - #include - #endif - #if HAVE_GL_GLU_H - #include - #endif - ]]) -AC_CHECK_LIB(GL,main,[LIBS="$LIBS -lGL"]) -AC_CHECK_LIB(GLU,main,[LIBS="$LIBS -lGLU"]) -AC_CHECK_LIB(GLEW,main,[LIBS="$LIBS -lGLEW"]) -AC_MSG_CHECKING(Cg) -#AC_CHECK_HEADERS([Cg/cg.h Cg/cgGL.h]) - -AC_CHECK_LIB(jpeg,main,[LIBS="$LIBS -ljpeg"]) -AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"]) -AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"]) -AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"]) -AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"]) -AC_CHECK_LIB(Xxf86vm,main,[LIBS="$LIBS -lXxf86vm"]) - -dnl AC_CHECK_LIB(Cg,cgCreateContext,[LIBS="$LIBS -lCg"]) -dnl AC_CHECK_LIB(CgGL,cgGLEnableProfile,[LIBS="$LIBS -lCgGL"]) -LIBS+=" -lCg -lCgGL" - -AC_OUTPUT([ - Makefile - Linux/Makefile - ]) - -echo "Configuration:" -echo " Target system type: $target" -echo " x86-64 build? $cpu64" -echo " Debug build? $debug" -echo " Dev build? $devbuild" -echo " SSE2 enabled? $sse2" +AC_INIT(ZeroGSogl,0.96.2,zerofrog@gmail.com) + +AM_INIT_AUTOMAKE(ZeroGSogl,0.96.2) + +AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) +AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) +AC_PROG_CPP([gcc g++ cl KCC CC cxx cc++ xlC aCC c++]) +AM_PROG_CC_C_O + +AC_PROG_INSTALL +AC_PROG_RANLIB + +dnl necessary for compiling assembly +AM_PROG_AS + +ZEROGS_CURRENT=0 +ZEROGS_REVISION=96 +ZEROGS_AGE=2 +ZEROGS_SONAME=libZeroGSogl.so.[$ZEROGS_CURRENT].[$ZEROGS_REVISION].[$ZEROGS_AGE] +ZEROGS_RELEASE=[$ZEROGS_CURRENT].[$ZEROGS_REVISION].[$ZEROGS_AGE] + +AC_SUBST(ZEROGS_CURRENT) +AC_SUBST(ZEROGS_REVISION) +AC_SUBST(ZEROGS_AGE) +AC_SUBST(ZEROGS_RELEASE) +AC_SUBST(ZEROGS_SONAME) + +CFLAGS=" -I/opt/cg/include -L/opt/cg/lib " +CPPFLAGS=" -I/opt/cg/include -L/opt/cg/lib " +CXXFLAGS=" -I/opt/cg/include -L/opt/cg/lib " + +dnl Check for debug build +AC_MSG_CHECKING(debug build) +AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [debug build]), + debug=$enableval,debug=no) +if test "x$debug" == xyes +then + AC_DEFINE(_DEBUG,1,[_DEBUG]) + CFLAGS+="-g " + CPPFLAGS+="-g -fpermissive " + CXXFLAGS+="-g- fpermissive " +else + AC_DEFINE(NDEBUG,1,[NDEBUG]) + CFLAGS+="-O3 -fomit-frame-pointer " + CPPFLAGS+="-O3 -fomit-frame-pointer " + CXXFLAGS+="-O3 -fomit-frame-pointer -fpermissive " +fi +AC_MSG_RESULT($debug) + +AC_CHECK_FUNCS([ _aligned_malloc _aligned_free ], AC_DEFINE(HAVE_ALIGNED_MALLOC)) + +dnl Check for dev build +AC_MSG_CHECKING(for development build...) +AC_ARG_ENABLE(devbuild, AC_HELP_STRING([--enable-devbuild], [Special Build for developers that simplifies testing and adds extra checks]), + devbuild=$enableval,devbuild=no) +if test "x$devbuild" == xno +then + AC_DEFINE(RELEASE_TO_PUBLIC,1,[RELEASE_TO_PUBLIC]) +fi +AC_MSG_RESULT($devbuild) +AM_CONDITIONAL(RELEASE_TO_PUBLIC, test x$devbuild = xno) + +dnl Check for recompilation +AC_MSG_CHECKING(check for sse2...) +AC_ARG_ENABLE(sse2, AC_HELP_STRING([--enable-sse2], [Enable sse2 instructions]), + sse2=$enableval,sse2=no) +if test "x$sse2" == xyes +then + AC_DEFINE(ZEROGS_SSE2,1,[ZEROGS_SSE2]) +fi +AC_MSG_RESULT($sse2) +AM_CONDITIONAL(SSE2, test x$sse2 = xyes) + +dnl Check for 64bit CPU +AC_MSG_CHECKING(for a x86-64 CPU) +dnl if test "$build_os" == "target_os" +dnl then +AC_TRY_RUN([ +int main() +{ +int a = 0; +int*pa = &a; +asm(".intel_syntax\n" + "mov %%rax, %0\n" + "mov %%eax, [%%rax]\n" + ".att_syntax\n" + : : "r"(pa) : "%rax"); +return 0; +} +],cpu64=yes,cpu64=no,) +dnl else +dnl cpu64=no +dnl fi +if test "x$cpu64" == xyes +then +AC_DEFINE(__x86_64__,1,[__x86_64__]) +fi +AC_MSG_RESULT($cpu64) +AM_CONDITIONAL(X86_64, test x$cpu64 = xyes) + +dnl gtk +AC_MSG_CHECKING(gtk2+) +AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config) +LIBS+=$(pkg-config --libs gtk+-2.0) + +dnl bindir = pcsx2exe + +dnl assuming linux environment +so_ext=".so.$ZEROGS_RELEASE" +SHARED_LDFLAGS="-shared" +AC_SUBST(so_ext) +AC_SUBST(SHARED_LDFLAGS) + +AC_MSG_CHECKING(OpenGL) +AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glext.h],,, + [[#if HAVE_GL_GL_H + #include + #endif + #if HAVE_GL_GLU_H + #include + #endif + ]]) +AC_CHECK_LIB(GL,main,[LIBS="$LIBS -lGL"]) +AC_CHECK_LIB(GLU,main,[LIBS="$LIBS -lGLU"]) +AC_CHECK_LIB(GLEW,main,[LIBS="$LIBS -lGLEW"]) +AC_MSG_CHECKING(Cg) +#AC_CHECK_HEADERS([Cg/cg.h Cg/cgGL.h]) + +AC_CHECK_LIB(jpeg,main,[LIBS="$LIBS -ljpeg"]) +AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"]) +AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"]) +AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"]) +AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"]) +AC_CHECK_LIB(Xxf86vm,main,[LIBS="$LIBS -lXxf86vm"]) + +dnl AC_CHECK_LIB(Cg,cgCreateContext,[LIBS="$LIBS -lCg"]) +dnl AC_CHECK_LIB(CgGL,cgGLEnableProfile,[LIBS="$LIBS -lCgGL"]) +LIBS+=" -lCg -lCgGL" + +AC_OUTPUT([ + Makefile + Linux/Makefile + ]) + +echo "Configuration:" +echo " Target system type: $target" +echo " x86-64 build? $cpu64" +echo " Debug build? $debug" +echo " Dev build? $devbuild" +echo " SSE2 enabled? $sse2"