Skip to content

Commit

Permalink
* added --build-quickly option for configure
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn David Pringle, B.Sc committed Mar 29, 2024
1 parent f35c61f commit 5ea0e8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
15 changes: 8 additions & 7 deletions source/Makefile.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ ifeq "$(EMINGW)" "1"
LIBRARY_NAME=eudbg.a
endif
else
EOSMING=-ffast-math -O2 -Os
EOSMING=-ffast-math -Os
ifdef FPIC
LIBRARY_NAME=euso.a
else
Expand Down Expand Up @@ -183,7 +183,7 @@ else
LIBRARY_NAME=eudbg.a
endif
else
EOSMING=-ffast-math -O2 -Os
EOSMING=-ffast-math $(OPT) -Os
ifdef FPIC
LIBRARY_NAME=euso.a
else
Expand Down Expand Up @@ -232,6 +232,7 @@ ifdef COVERAGE
COVERAGEFLAG=-fprofile-arcs -ftest-coverage
DEBUG_FLAGS=-g3 -O0 -Wall
COVERAGELIB=-lgcov
OPT=
endif

ifndef TESTFILE
Expand Down Expand Up @@ -314,11 +315,11 @@ endif

WARNINGFLGS =
ifeq "$(MANAGED_MEM)" "1"
FE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(EPTHREAD) -Wno-unused-variable -Wno-unused-but-set-variable -c -fsigned-char $(EOSTYPE) $(EOSMING) -ffast-math $(FP_FLAGS) $(EOSFLAGS) $(DEBUG_FLAGS) -I$(CYPTRUNKDIR)/source -I$(CYPTRUNKDIR) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE) $(MEM_FLAGS)
FE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(EPTHREAD) -Wno-unused-variable -Wno-unused-but-set-variable -c -fsigned-char $(EOSTYPE) $(EOSMING) -ffast-math $(FP_FLAGS) $(EOSFLAGS) $(DEBUG_FLAGS) -I$(CYPTRUNKDIR)/source -I$(CYPTRUNKDIR) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE) $(MEM_FLAGS) $(OPT)
else
FE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(EPTHREAD) -Wno-unused-variable -Wno-unused-but-set-variable -c -fsigned-char $(EOSTYPE) $(EOSMING) -ffast-math $(FP_FLAGS) $(EOSFLAGS) $(DEBUG_FLAGS) -I$(CYPTRUNKDIR)/source -I$(CYPTRUNKDIR) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE)
FE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(EPTHREAD) -Wno-unused-variable -Wno-unused-but-set-variable -c -fsigned-char $(EOSTYPE) $(EOSMING) -ffast-math $(FP_FLAGS) $(EOSFLAGS) $(DEBUG_FLAGS) -I$(CYPTRUNKDIR)/source -I$(CYPTRUNKDIR) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE) $(OPT)
endif
BE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(EPTHREAD) -c -Wall $(EOSTYPE) $(EBSDFLAG) $(RUNTIME_FLAGS) $(EOSFLAGS) $(BACKEND_FLAGS) -fsigned-char -ffast-math $(FP_FLAGS) $(DEBUG_FLAGS) $(MEM_FLAGS) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE) $(FPIC) -I$(TRUNKDIR)/source
BE_FLAGS = $(ARCH_FLAG) $(COVERAGEFLAG) $(MSIZE) $(OPT) $(EPTHREAD) -c -Wall $(EOSTYPE) $(EBSDFLAG) $(RUNTIME_FLAGS) $(EOSFLAGS) $(BACKEND_FLAGS) -fsigned-char -ffast-math $(FP_FLAGS) $(DEBUG_FLAGS) $(MEM_FLAGS) $(PROFILE_FLAGS) -DARCH=$(ARCH) $(EREL_TYPE) $(FPIC) -I$(TRUNKDIR)/source

# Disable Position Independent Executable (PIE)
ifneq (,$(shell $(CC) -v 2>&1 | grep default-pie))
Expand Down Expand Up @@ -997,7 +998,7 @@ else
endif

ifeq "$(ARCH)" "ARM"
EUC_CFLAGS=-cflags "-fomit-frame-pointer -c -w -fsigned-char -O2 -I$(TRUNKDIR) -ffast-math"
EUC_CFLAGS=-cflags "-fomit-frame-pointer -c -w -fsigned-char -I$(TRUNKDIR) -ffast-math"
EUC_LFLAGS=-lflags "$(CYPBUILDDIR)/eu.a -ldl -lm -lpthread"
else
EUC_CFLAGS=-cflags "$(FE_FLAGS)"
Expand Down Expand Up @@ -1168,7 +1169,7 @@ $(BUILDDIR)/$(OBJDIR)/back/%.o : $(TRUNKDIR)/source/%.c $(CONFIG_FILE) | $(BUILD
$(CC) $(BE_FLAGS) $(EBSDFLAG) -I $(BUILDDIR)/$(OBJDIR)/back -I $(BUILDDIR)/include $(TRUNKDIR)/source/$*.c -o$(BUILDDIR)/$(OBJDIR)/back/$*.o

$(BUILDDIR)/$(OBJDIR)/back/be_callc.o : $(TRUNKDIR)/source/$(BE_CALLC).c $(CONFIG_FILE) | $(BUILDDIR)/$(OBJDIR)/back/
$(CC) -c -Wall $(EOSTYPE) $(ARCH_FLAG) $(FPIC) $(EOSFLAGS) $(EBSDFLAG) $(MSIZE) -DARCH=$(ARCH) -fsigned-char -O2 -fno-omit-frame-pointer -ffast-math -fno-defer-pop $(CALLC_DEBUG) $(TRUNKDIR)/source/$(BE_CALLC).c -o$(BUILDDIR)/$(OBJDIR)/back/be_callc.o
$(CC) -c -Wall $(EOSTYPE) $(ARCH_FLAG) $(FPIC) $(EOSFLAGS) $(EBSDFLAG) $(MSIZE) -DARCH=$(ARCH) -fsigned-char $(OPT) -fno-omit-frame-pointer -ffast-math -fno-defer-pop $(CALLC_DEBUG) $(TRUNKDIR)/source/$(BE_CALLC).c -o$(BUILDDIR)/$(OBJDIR)/back/be_callc.o

$(BUILDDIR)/$(OBJDIR)/back/be_inline.o : $(TRUNKDIR)/source/be_inline.c $(CONFIG_FILE) | $(BUILDDIR)/$(OBJDIR)/back/
$(CC) -finline-functions $(BE_FLAGS) $(EBSDFLAG) $(RUNTIME_FLAGS) $(TRUNKDIR)/source/be_inline.c -o$(BUILDDIR)/$(OBJDIR)/back/be_inline.o
Expand Down
11 changes: 11 additions & 0 deletions source/configure
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ ROOTDIR="$TRUNKDIR"
HG="git"

CONFIGURE_PARAMS="$@"
OPT=-O3

# parameters
while [ "$1" != "" ]; do
case $1 in
--build-quickly)
OPT=-O0
;;

--plat*|--target)
VAL=`echo $1 | cut -d = -f 2`
if [ "$VAL" = "$1" ]; then
Expand Down Expand Up @@ -235,6 +240,7 @@ while [ "$1" != "" ]; do

--debug )
EDEBUG=1
OPT=-ggdb
;;

--prefix*)
Expand Down Expand Up @@ -392,6 +398,7 @@ while [ "$1" != "" ]; do
echo " Set the OS that we will translate to."
echo " Values can be: WINDOWS, OSX, LINUX,"
echo " FREEBSD, OPENBSD or NETBSD."
echo " --build-quickly The targets will be built with no C optimization."
echo " --watcom The translator will create C code"
echo " for the Watcom compiler."
echo " --cc-prefix Prefix to use with the compiler and"
Expand Down Expand Up @@ -629,4 +636,8 @@ if [ -f "$TRUNKDIR/source/eu.cfg" ] ; then
rm "$TRUNKDIR/source/eu.cfg"
fi


[ -n "$OPT" ] && echo OPT=$OPT >> "$PREFIX"${CONFIG_FILE}


echo >> ${CONFIG_FILE}
2 changes: 1 addition & 1 deletion source/pcre/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for PCRE to be included into Euphoria
#

CFLAGS=-O2 $(EOSTYPE) -D HAVE_CONFIG_H -D NO_RECURSE $(MSIZE) $(EOSFLAGS) $(FPIC)
CFLAGS=-O3 $(EOSTYPE) -D HAVE_CONFIG_H -D NO_RECURSE $(MSIZE) $(EOSFLAGS) $(FPIC)

include objects.mak
include $(CONFIG)
Expand Down

0 comments on commit 5ea0e8c

Please sign in to comment.