linux build fixes

This commit is contained in:
sezero
2018-08-03 19:43:02 +03:00
parent bc892aff15
commit 9b83acbefd
13 changed files with 45 additions and 131 deletions

View File

@@ -117,7 +117,7 @@ ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
@@ -268,7 +268,7 @@ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)

View File

@@ -109,8 +109,8 @@ ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
# shameless plug and splash screen - not for linux DRI builds
#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
@@ -128,7 +128,7 @@ ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
@@ -274,7 +274,7 @@ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)

View File

@@ -227,25 +227,3 @@ char *file_getenv (const char *a)
return NULL;
}
#include <linutil.h>
/*-------------------------------------------------------------------
Function: tlKbHit
Date: 2/28
Implementor(s): jdt
Library: test library
Description:
Returns true if there are pending characters in the input queue
Arguments:
none
Return:
nonzero if keys in queue
-------------------------------------------------------------------*/
int hwcKbHit( void ) {
return lin_kbhit();
}
char hwcGetCH( void ) {
return lin_getch();
}

View File

@@ -62,7 +62,7 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers,
#include <string.h>
#include <math.h>
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
/*#include <X11/extensions/xf86dga.h>*/
#include <X11/extensions/xf86vmode.h>
#include "lindri.h"
@@ -154,16 +154,6 @@ void grDRIPosition(int x, int y, int w, int h,
driInfo.pClip=pClip;
}
#if 0 /* unused */
static FxU32
pow2Round(FxU32 val, FxU32 pow2Const)
{
const FxU32 pow2Mask = (pow2Const - 1UL);
return ((val + pow2Mask) & ~pow2Mask);
}
#endif
static void loadEnvFile() {
FILE *file;
char data[128];
@@ -607,22 +597,6 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers,
#undef FN_NAME
} /* hwcCheckMemSize */
#if 0 /* unused */
static FxU32
calculateLfbStride(FxU32 screenWidth)
{
#if 1
unsigned int TileAperturePitch;
for (TileAperturePitch = 1024;
(TileAperturePitch < (16u << 10)) && (TileAperturePitch < screenWidth);
TileAperturePitch <<= 1);
return(TileAperturePitch);
#else
return(0x1000);
#endif
}
#endif
/* How the hw treats lfb accesses are dependent on the 'type' of
* memory (tiled/linear) that the color/aux buffers are in. We
* pre-compute the actual lfb address here while we know about the

View File

@@ -115,8 +115,8 @@ ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
# shameless plug and splash screen - not for linux DRI builds
#CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
@@ -134,7 +134,7 @@ ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
@@ -302,7 +302,7 @@ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)

View File

@@ -21,7 +21,9 @@
#include <stdlib.h>
#include <stdio.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <assert.h>
#include <string.h>
#include <math.h>

View File

@@ -2179,7 +2179,8 @@ tlScreenDump
return FXTRUE;
}
#if defined(__unix__) && !defined(__DJGPP__)
#ifdef __linux__
#include <linutil.h>
/*-------------------------------------------------------------------
Function: tlKbHit
@@ -2194,7 +2195,7 @@ tlScreenDump
nonzero if keys in queue
-------------------------------------------------------------------*/
int tlKbHit( void ) {
return hwcKbHit();
return lin_kbhit();
}
FxBool
tlErrorMessage( char *err) {
@@ -2215,7 +2216,7 @@ tlErrorMessage( char *err) {
character
-------------------------------------------------------------------*/
char tlGetCH( void ) {
return hwcGetCH();
return lin_getch();
}
FxU32

View File

@@ -1541,25 +1541,3 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo,
}
}
#include <linutil.h>
/*-------------------------------------------------------------------
Function: tlKbHit
Date: 2/28
Implementor(s): jdt
Library: test library
Description:
Returns true if there are pending characters in the input queue
Arguments:
none
Return:
nonzero if keys in queue
-------------------------------------------------------------------*/
int hwcKbHit( void ) {
return lin_kbhit();
}
char hwcGetCH( void ) {
return lin_getch();
}

View File

@@ -62,7 +62,7 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers,
#include <string.h>
#include <math.h>
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
/*#include <X11/extensions/xf86dga.h>*/
#include <X11/extensions/xf86vmode.h>
#include "lindri.h"
@@ -79,8 +79,10 @@ static FxU32 __attribute_used fenceVar;
# define P6FENCE asm volatile("mf.a" ::: "memory");
#elif defined (__alpha__)
# define P6FENCE asm volatile("mb" ::: "memory");
#else
#elif (defined(__i386__) || defined(__x86_64__))
# define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax");
#else
# error "No P6FENCE asm for this architecture"
#endif
#define MAXFIFOSIZE 0x40000
@@ -972,28 +974,6 @@ void hwcSLIReadDisable(hwcBoardInfo *bInfo)
#endif
}
#include <linutil.h>
/*-------------------------------------------------------------------
Function: tlKbHit
Date: 2/28
Implementor(s): jdt
Library: test library
Description:
Returns true if there are pending characters in the input queue
Arguments:
none
Return:
nonzero if keys in queue
-------------------------------------------------------------------*/
int hwcKbHit( void ) {
return lin_kbhit();
}
char hwcGetCH( void ) {
return lin_getch();
}
void grDRIImportFifo(int fifoPtr, int fifoRead)
{
_grImportFifo(fifoPtr, fifoRead);

View File

@@ -121,7 +121,7 @@ ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
@@ -190,7 +190,6 @@ GLIDE_OBJECTS += \
../../init/init.o \
../../init/vgdrvr.o \
../../init/vg96drvr.o \
../../init/h3drvr.o \
../../init/initvg/gamma.o \
../../init/initvg/dac.o \
../../init/initvg/video.o \
@@ -264,7 +263,7 @@ $(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_LIB)
ifeq ($(TEXUS2),1)

View File

@@ -44,7 +44,7 @@ LCDEFS += -D$(INITHW)
HEADERS = init.h sst1vid.h
PRIVATE_HEADERS = fxinit.h
INSTALL_DESTINATION = $(BUILD_ROOT_HW)
CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c
CFILES = init.c vgdrvr.c vg96drvr.c
LIBRARIES = libinit.a

View File

@@ -44,7 +44,7 @@ LCDEFS += -D$(INITHW)
HEADERS = init.h sst1vid.h
PRIVATE_HEADERS = fxinit.h
INSTALL_DESTINATION = $(BUILD_ROOT_SST1)
CFILES = init.c vgdrvr.c vg96drvr.c h3drvr.c
CFILES = init.c vgdrvr.c vg96drvr.c
LIBRARIES = libinit.a

View File

@@ -42,12 +42,12 @@ int fxGethostname(char *name, int n)
#if !macintosh && !defined(__FreeBSD__)
/* return current time in seconds (floating point) */
float fxTime(void)
{
#if defined ( __sparc__ ) || defined ( __DJGPP__ )
/* times returns 0 in BSD Unix, so we use ftime instead */
# include <sys/types.h>
# include <sys/timeb.h>
#include <sys/types.h>
#include <sys/timeb.h>
float fxTime(void)
{
struct timeb tb;
static time_t once; // saves first time value
@@ -55,21 +55,23 @@ float fxTime(void)
if (once == 0) // stash away first call
once = tb.time; // as float is not big enough
return (tb.time - once) + tb.millitm * .001;
#else
#if defined ( WIN32 ) || ( __DOS__ )
# include <time.h>
# define times(a) clock()
# define HZ CLOCKS_PER_SEC
#else
# include <sys/types.h>
# include <sys/times.h>
# include <sys/param.h>
struct tms foo;
#endif
return times(&foo)/(float)HZ;
#endif
}
#elif defined ( WIN32 ) || ( __DOS__ )
#include <time.h>
float fxTime(void)
{
return clock()/(float)CLOCKS_PER_SEC;
}
#else
#include <sys/types.h>
#include <sys/times.h>
#include <sys/param.h>
float fxTime(void)
{
struct tms foo;
return times(&foo)/(float)HZ;
}
#endif
/* returns elapsed time in seconds */
float timer(int flag)