Skip to content

Commit

Permalink
Wire up libTom stuff to build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 4, 2017
1 parent 7542966 commit 62f6f0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ Q3CPPDIR=$(MOUNT_DIR)/tools/lcc/cpp
Q3LCCETCDIR=$(MOUNT_DIR)/tools/lcc/etc
Q3LCCSRCDIR=$(MOUNT_DIR)/tools/lcc/src
AUTOUPDATERSRCDIR=$(MOUNT_DIR)/autoupdater
LIBTOMCRYPTSRCDIR=$(AUTOUPDATERSRCDIR)/rsa_tools/libtomcrypt-1.17
TOMSFASTMATHSRCDIR=$(AUTOUPDATERSRCDIR)/rsa_tools/tomsfastmath-0.13.1
LOKISETUPDIR=misc/setup
NSISDIR=misc/nsis
SDLHDIR=$(MOUNT_DIR)/SDL2
Expand Down Expand Up @@ -376,7 +378,7 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")

THREAD_LIBS=-lpthread
LIBS=-ldl -lm
AUTOUPDATER_LIBS += -ldl
AUTOUPDATER_LIBS += -ldl $(LIBTOMCRYPTSRCDIR)/libtomcrypt.a $(TOMSFASTMATHSRCDIR)/libtfm.a

CLIENT_LIBS=$(SDL_LIBS)
RENDERER_LIBS = $(SDL_LIBS) -lGL
Expand Down Expand Up @@ -419,6 +421,8 @@ ifeq ($(PLATFORM),darwin)
RENDERER_LIBS=
OPTIMIZEVM=

AUTOUPDATER_LIBS += $(LIBTOMCRYPTSRCDIR)/libtomcrypt.a $(TOMSFASTMATHSRCDIR)/libtfm.a

# Default minimum Mac OS X version
ifeq ($(MACOSX_VERSION_MIN),)
MACOSX_VERSION_MIN=10.7
Expand Down Expand Up @@ -1601,12 +1605,11 @@ $(Q3ASM): $(Q3ASMOBJ)

define DO_AUTOUPDATER_CC
$(echo_cmd) "AUTOUPDATER_CC $<"
$(Q)$(CC) $(CFLAGS) $(CURL_CFLAGS) -o $@ -c $<
$(Q)$(CC) $(CFLAGS) -I$(LIBTOMCRYPTSRCDIR)/src/headers -I$(TOMSFASTMATHSRCDIR)/src/headers $(CURL_CFLAGS) -o $@ -c $<
endef

Q3AUTOUPDATEROBJ = \
$(B)/autoupdater/autoupdater.o \
$(B)/autoupdater/sha256.o

$(B)/autoupdater/%.o: $(AUTOUPDATERSRCDIR)/%.c
$(DO_AUTOUPDATER_CC)
Expand Down
2 changes: 2 additions & 0 deletions code/autoupdater/rsa_tools/build-libtom-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if [ "$OSTYPE" = "Linux" ]; then
let NCPU=$NCPU+1
elif [ "$OSTYPE" = "Darwin" ]; then
NCPU=`sysctl -n hw.ncpu`
export CFLAGS="$CFLAGS -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070"
export LDFLAGS="$LDFLAGS -mmacosx-version-min=10.7"
elif [ "$OSTYPE" = "SunOS" ]; then
NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
else
Expand Down
2 changes: 1 addition & 1 deletion code/autoupdater/rsa_tools/build-rsa-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export TFMDIR="tomsfastmath-0.13.1"
export LTCDIR="libtomcrypt-1.17"

function build {
clang -I $TFMDIR/src/headers -I $LTCDIR/src/headers -o "$1" -Wall -O3 "$1.c" rsa_common.c $LTCDIR/libtomcrypt.a $TFMDIR/libtfm.a
clang -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -I $TFMDIR/src/headers -I $LTCDIR/src/headers -o "$1" -Wall -O3 "$1.c" rsa_common.c $LTCDIR/libtomcrypt.a $TFMDIR/libtfm.a
}

set -e
Expand Down

0 comments on commit 62f6f0c

Please sign in to comment.