# configuration for compiling with g++

#
# Adjustable parameters
#

# This tells us where to find the X libraries.

J_X11_LIB_DIR := -L/usr/X11R6/lib

# This sets the optimization level

J_OPTIMIZE_LEVEL := 0

# Comment this out if your system is not ELF.

J_BUILD_SHARED_LIB := -fPIC

# Uncomment this if you want debugging versions of the libraries.

# J_COMPILE_DEBUG := -g

ifeq ($(strip $(filter-out jafl glenn laurence, $(USER))),)
  J_COMPILE_DEBUG := -g
endif

# Comment this out if ACE or other code gives you warnings that
# you can't avoid.

J_DIE_ON_WARNING := -Werror

# Uncomment this if istrstream is broken.  One way to check is to run
# testjcore/testJFileArray.

# J_ISTRSTREAM_BROKEN := -D_J_ISTRSTREAM_BROKEN

# Uncomment this if your version of GNU make does not automatically
# generate the -o parameter.

# J_MAKE_NEEDS_OUTPUT_ARG = -o $@

# Comment this out if your version of "ar" does not accept the -s option.

J_RANLIB_VIA_AR_S := -D_J_RANLIB_VIA_AR_S

# Uncomment this if your system doesn't have memmove() (used by jlib/regex)

# J_REGEX_USE_BCOPY := -DUSEBCOPY

# Adjust these until everything compiles

J_RAW_SYSTEM_STUFF := \
  -D_LOOSE_KERNEL_NAMES \
  -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED \
  -D_BSD_SOURCE -D_GNU_SOURCE

#
# Nothing below this line should ever need to be changed.
#

# for use in DEPENDFLAGS
# (-Wno-return-type keeps memory usage down when compiling templates)

J_COMPILER_DEPEND_FLAGS_FOR_BISON := \
  -Wall -Wno-unused -Wno-return-type \
  -fno-implicit-templates -fno-rtti \
  -O${J_OPTIMIZE_LEVEL} \
  -D_J_UNIX -D_J_LINUX_INTEL ${J_ISTRSTREAM_BROKEN} ${J_RAW_SYSTEM_STUFF}

J_COMPILER_DEPEND_FLAGS := \
  ${J_COMPILER_DEPEND_FLAGS_FOR_BISON} ${J_DIE_ON_WARNING}

# makemake variables

LINKER := g++

# make variables

CC       := gcc
CXX      := g++
CCC      := g++
CPPFLAGS  = ${DEPENDFLAGS}
CFLAGS    = ${J_MAKE_NEEDS_OUTPUT_ARG}
CXXFLAGS  = ${J_MAKE_NEEDS_OUTPUT_ARG}

# libraries to link

J_GCC_LIBS  := -lstdc++ -lm -lc -ldl
J_ACE_LIBS  := -L${JX_ROOT}/lib -lACE-${ACE_VERSION}

J_X11_LIBS  := ${J_X11_LIB_DIR} -lX11
J_MESA_LIBS := -L${JX_ROOT}/lib -lMesaGLU -lMesaGL ${J_X11_LIB_DIR} -lXext

J_SYS_LIBS  := ${J_ACE_LIBS} ${J_X11_LIBS} ${J_GCC_LIBS}
