Skip to content

Commit

Permalink
tweaks to build in homebrew
Browse files Browse the repository at this point in the history
builds with simply:
make -j16
also mutiple Qt instances conflict resolved by: brew unlink qt && brew link qt@5
  • Loading branch information
Garux committed Nov 7, 2022
1 parent 15ca706 commit f7d120f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 55 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ LIBS_QTGUI ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt
CPPFLAGS_QTWIDGETS ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --cflags $(STDERR_TO_DEVNULL))
LIBS_QTWIDGETS ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --libs-only-l $(STDERR_TO_DEVNULL))
ifeq ($(OS),Darwin)
LIBS_QTCORE = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Core --libs $(STDERR_TO_DEVNULL))
LIBS_QTGUI = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Gui --libs $(STDERR_TO_DEVNULL))
LIBS_QTWIDGETS = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --libs $(STDERR_TO_DEVNULL))
endif

CPPFLAGS_GL ?=
LIBS_GL ?= -lGL # -lopengl32 on Win32
CPPFLAGS_DL ?=
Expand Down Expand Up @@ -226,7 +232,7 @@ ifeq ($(OS),Darwin)
CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
CFLAGS_COMMON += -fPIC
CXXFLAGS_COMMON += -fno-exceptions -fno-rtti
MACLIBDIR ?= /opt/local/lib
MACLIBDIR ?= /usr/local/lib
CPPFLAGS_COMMON += -I$(MACLIBDIR)/../include -I/usr/X11R6/include
LDFLAGS_COMMON += -L$(MACLIBDIR) -L/usr/X11R6/lib
LDFLAGS_DLL += -dynamiclib -ldl
Expand Down
2 changes: 2 additions & 0 deletions radiant/renderstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ void GLSLProgram_validate( GLuint program ){
printProgramLog( program );
}

#ifndef __APPLE__ // hack: says 'Current draw framebuffer is invalid.' but works; Showing messagebox at this init point triggers Qt crash.
ASSERT_MESSAGE( validated, "program validation failed" );
#endif
}

bool g_bumpGLSLPass_enabled = false;
Expand Down
54 changes: 0 additions & 54 deletions tools/quake3/common/unzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2496,15 +2496,13 @@ static const uLong crc_table[256] = {
/* =========================================================================
* This function can be used by asm versions of crc32()
*/
#ifndef __APPLE__
const uLong * get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty) make_crc_table();
#endif
return (const uLong *)crc_table;
}
#endif

/* ========================================================================= */
#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
Expand All @@ -2513,7 +2511,6 @@ const uLong * get_crc_table()
#define DO8(buf) DO4(buf); DO4(buf);

/* ========================================================================= */
#ifndef __APPLE__
uLong crc32(uLong crc, const Byte *buf, uInt len)
{
if (buf == Z_NULL) return 0L;
Expand All @@ -2532,7 +2529,6 @@ uLong crc32(uLong crc, const Byte *buf, uInt len)
} while (--len);
return crc ^ 0xffffffffL;
}
#endif

/* infblock.h -- header to use infblock.c
* Copyright (C) 1995-1998 Mark Adler
Expand Down Expand Up @@ -2813,7 +2809,6 @@ extern int inflate_flush OF((
*/


#ifndef __APPLE__
void inflate_blocks_reset(inflate_blocks_statef *s, z_streamp z, uLong *c)
{
if (c != Z_NULL)
Expand All @@ -2830,9 +2825,7 @@ void inflate_blocks_reset(inflate_blocks_statef *s, z_streamp z, uLong *c)
z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0);
Tracev(("inflate: blocks reset\n"));
}
#endif

#ifndef __APPLE__
inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w)
{
inflate_blocks_statef *s;
Expand All @@ -2859,9 +2852,7 @@ inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w)
inflate_blocks_reset(s, z, Z_NULL);
return s;
}
#endif

#ifndef __APPLE__
int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
{
uInt t; /* temporary storage */
Expand Down Expand Up @@ -3104,9 +3095,7 @@ int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
LEAVE
}
}
#endif

#ifndef __APPLE__
int inflate_blocks_free(inflate_blocks_statef *s, z_streamp z)
{
inflate_blocks_reset(s, z, Z_NULL);
Expand All @@ -3116,26 +3105,21 @@ int inflate_blocks_free(inflate_blocks_statef *s, z_streamp z)
Tracev(("inflate: blocks freed\n"));
return Z_OK;
}
#endif

#ifndef __APPLE__
void inflate_set_dictionary(inflate_blocks_statef *s, const Byte *d, uInt n)
{
zmemcpy(s->window, d, n);
s->read = s->write = s->window + n;
}
#endif

/* Returns true if inflate is currently at the end of a block generated
* by Z_SYNC_FLUSH or Z_FULL_FLUSH.
* IN assertion: s != Z_NULL
*/
#ifndef __APPLE__
int inflate_blocks_sync_point(inflate_blocks_statef *s)
{
return s->mode == LENS;
}
#endif

/* And'ing with mask[n] masks the lower n bits */
uInt inflate_mask[17] = {
Expand All @@ -3145,7 +3129,6 @@ uInt inflate_mask[17] = {
};

/* copy as much as possible from the sliding window to the output area */
#ifndef __APPLE__
int inflate_flush(inflate_blocks_statef *s, z_streamp z, int r)
{
uInt n;
Expand Down Expand Up @@ -3208,17 +3191,14 @@ int inflate_flush(inflate_blocks_statef *s, z_streamp z, int r)
/* done */
return r;
}
#endif

/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/

#ifndef __APPLE__
const char inflate_copyright[] =
" inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
#endif

/*
If you use the zlib library in a product, an acknowledgment is welcome
Expand Down Expand Up @@ -3498,7 +3478,6 @@ static int huft_build(uInt *b, uInt n, uInt s, const uInt *d, const uInt *e, inf
}


#ifndef __APPLE__
int inflate_trees_bits(uInt *c, uInt *bb, inflate_huft * *tb, inflate_huft *hp, z_streamp z)
//uInt *c; /* 19 code lengths */
//uInt *bb; /* bits tree desired/actual depth */
Expand All @@ -3524,9 +3503,7 @@ int inflate_trees_bits(uInt *c, uInt *bb, inflate_huft * *tb, inflate_huft *hp,
ZFREE(z, v);
return r;
}
#endif

#ifndef __APPLE__
int inflate_trees_dynamic(uInt nl, uInt nd, uInt *c, uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, inflate_huft *hp, z_streamp z)
//uInt nl; /* number of literal/length codes */
//uInt nd; /* number of distance codes */
Expand Down Expand Up @@ -3589,7 +3566,6 @@ int inflate_trees_dynamic(uInt nl, uInt nd, uInt *c, uInt *bl, uInt *bd, inflate
ZFREE(z, v);
return Z_OK;
}
#endif

/* inffixed.h -- table for decoding fixed codes
* Generated automatically by the maketree.c program
Expand Down Expand Up @@ -3743,7 +3719,6 @@ static inflate_huft fixed_td[] = {
{{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
};

#ifndef __APPLE__
int inflate_trees_fixed(uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *td, z_streamp z)
//uInt *bl; /* literal desired/actual bit depth */
//uInt *bd; /* distance desired/actual bit depth */
Expand All @@ -3757,7 +3732,6 @@ int inflate_trees_fixed(uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *
*td = fixed_td;
return Z_OK;
}
#endif

/* simplify the use of the inflate_huft type with some defines */
#define exop word.what.Exop
Expand All @@ -3772,7 +3746,6 @@ int inflate_trees_fixed(uInt *bl, uInt *bd, inflate_huft * *tl, inflate_huft * *
at least ten. The ten bytes are six bytes for the longest length/
distance pair plus four bytes for overloading the bit buffer. */

#ifndef __APPLE__
int inflate_fast(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, inflate_blocks_statef *s, z_streamp z)
{
inflate_huft *t; /* temporary pointer */
Expand Down Expand Up @@ -3911,7 +3884,6 @@ int inflate_fast(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, inflate_b
UPDATE
return Z_OK;
}
#endif

/* infcodes.c -- process literals and length/distance pairs
* Copyright (C) 1995-1998 Mark Adler
Expand Down Expand Up @@ -3963,7 +3935,6 @@ struct inflate_codes_state {

};

#ifndef __APPLE__
inflate_codes_statef *inflate_codes_new(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, z_streamp z)
{
inflate_codes_statef *c;
Expand All @@ -3980,9 +3951,7 @@ inflate_codes_statef *inflate_codes_new(uInt bl, uInt bd, inflate_huft *tl, infl
}
return c;
}
#endif

#ifndef __APPLE__
int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r)
{
uInt j; /* temporary storage */
Expand Down Expand Up @@ -4148,15 +4117,12 @@ int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r)
return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
#endif
}
#endif

#ifndef __APPLE__
void inflate_codes_free(inflate_codes_statef *c, z_streamp z)
{
ZFREE(z, c);
Tracev(("inflate: codes free\n"));
}
#endif

/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-1998 Mark Adler
Expand All @@ -4179,7 +4145,6 @@ void inflate_codes_free(inflate_codes_statef *c, z_streamp z)
#define DO16(buf) DO8(buf,0); DO8(buf,8);

/* ========================================================================= */
#ifndef __APPLE__
uLong adler32(uLong adler, const Byte *buf, uInt len)
{
unsigned long s1 = adler & 0xffff;
Expand All @@ -4205,7 +4170,6 @@ uLong adler32(uLong adler, const Byte *buf, uInt len)
}
return (s2 << 16) | s1;
}
#endif


/* infblock.h -- header to use infblock.c
Expand Down Expand Up @@ -4287,7 +4251,6 @@ struct internal_state {
};


#ifndef __APPLE__
int inflateReset(z_streamp z)
{
if (z == Z_NULL || z->state == Z_NULL)
Expand All @@ -4299,9 +4262,7 @@ int inflateReset(z_streamp z)
Tracev(("inflate: reset\n"));
return Z_OK;
}
#endif

#ifndef __APPLE__
int inflateEnd(z_streamp z)
{
if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
Expand All @@ -4313,9 +4274,7 @@ int inflateEnd(z_streamp z)
Tracev(("inflate: end\n"));
return Z_OK;
}
#endif

#ifndef __APPLE__
int inflateInit2_(z_streamp z, int w, const char *version, int stream_size)
{
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
Expand Down Expand Up @@ -4367,19 +4326,15 @@ int inflateInit2_(z_streamp z, int w, const char *version, int stream_size)
inflateReset(z);
return Z_OK;
}
#endif

#ifndef __APPLE__
int inflateInit_(z_streamp z, const char *version, int stream_size)
{
return inflateInit2_(z, DEF_WBITS, version, stream_size);
}
#endif

#define iNEEDBYTE {if(z->avail_in==0)return r;r=f;}
#define iNEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)

#ifndef __APPLE__
int inflate(z_streamp z, int f)
{
int r;
Expand Down Expand Up @@ -4504,9 +4459,7 @@ int inflate(z_streamp z, int f)
return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
#endif
}
#endif

#ifndef __APPLE__
int inflateSetDictionary(z_streamp z, const Byte *dictionary, uInt dictLength)
{
uInt length = dictLength;
Expand All @@ -4526,9 +4479,7 @@ int inflateSetDictionary(z_streamp z, const Byte *dictionary, uInt dictLength)
z->state->mode = imBLOCKS;
return Z_OK;
}
#endif

#ifndef __APPLE__
int inflateSync(z_streamp z)
{
uInt n; /* number of bytes to look at */
Expand Down Expand Up @@ -4577,7 +4528,6 @@ int inflateSync(z_streamp z)
z->state->mode = imBLOCKS;
return Z_OK;
}
#endif

/* Returns true if inflate is currently at the end of a block generated
* by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
Expand All @@ -4586,16 +4536,13 @@ int inflateSync(z_streamp z)
* decompressing, PPP checks that at the end of input packet, inflate is
* waiting for these length bytes.
*/
#ifndef __APPLE__
int inflateSyncPoint(z_streamp z)
{
if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
return Z_STREAM_ERROR;
return inflate_blocks_sync_point(z->state->blocks);
}
#endif

#ifndef __APPLE__
voidp zcalloc (voidp opaque, unsigned items, unsigned size)
{
if (opaque) items += size - size; /* make compiler happy */
Expand All @@ -4607,4 +4554,3 @@ void zcfree (voidp opaque, voidp ptr)
free(ptr);
if (opaque) return; /* make compiler happy */
}
#endif

0 comments on commit f7d120f

Please sign in to comment.