1
0
Fork 0

[conifgure.ac] Try to link using CXX. Refs #184

This commit is contained in:
Witold Filipczyk 2022-08-16 17:36:13 +02:00
parent 9dc1f11438
commit 9ed288c717
3 changed files with 14 additions and 8 deletions

View File

@ -185,6 +185,7 @@ CONFIG_ZSTD = @CONFIG_ZSTD@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CXXFLAGS = @CXXFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
@ -193,6 +194,8 @@ INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
COMPILE_CXX = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
MAKE_COLOR = @MAKE_COLOR@
LIB_O_NAME = lib.o

View File

@ -55,6 +55,11 @@ quiet_cmd_compile = ' [$(CC_COLOR)CC$(END_COLOR)] $(RELPATH)$@'
masq_cmd_compile = $(COMPILE) -o $(@) -c $< $(2)
cmd_compile = $(COMPILE) -o $(@) -MD -MF .deps/$(*F).pp -c $< $(2)
quiet_cmd_compilecxx = ' [$(CC_COLOR)CXX$(END_COLOR)] $(RELPATH)$@'
masq_cmd_compilecxx = $(COMPILE_CXX) -o $(@) -c $< $(2)
cmd_compilecxx = $(COMPILE_CXX) -o $(@) -MD -MF .deps/$(*F).pp -c $< $(2)
# Rule to compile a set of .o files into one .o file
quiet_cmd_ld_objs = " [$(LD_COLOR)LD$(END_COLOR)] $(RELPATH)$@"
cmd_ld_objs = $(LD) -r -o $@ $(filter $(OBJS), $^) \
@ -62,7 +67,7 @@ quiet_cmd_ld_objs = " [$(LD_COLOR)LD$(END_COLOR)] $(RELPATH)$@"
`test -e $(subdir)/$(LIB_O_NAME) && echo $(subdir)/$(LIB_O_NAME)`)
quiet_cmd_link = ' [$(LINK_COLOR)LINK$(END_COLOR)] $(RELPATH)$@'
cmd_link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
cmd_link = $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
quiet_cmd_sparse = ' [SPARSE] $(RELPATH)$(2)'
cmd_sparse = $(SPARSE) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(SPARSE_FLAGS) $(2)
@ -140,7 +145,7 @@ endif
fi
%.obj: $(srcdir)%.cpp
$(call mcmd,compile)
$(call mcmd,compilecxx)
@-if test -e .deps/$(*F).pp; then \
cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \

View File

@ -61,9 +61,6 @@ echo "Feature summary:" > features.log
AC_PROG_CC
AC_PROG_CXX
if test x"$CC" = x"$CXX"; then
AC_LANG(C++)
fi
AC_CHECK_TOOL([LD], [ld])
AC_PROG_AWK
AC_PATH_PROGS(AWK, "$AWK")
@ -757,7 +754,6 @@ if test "x$CONFIG_SPIDERMONKEY" = xyes ||
SPIDERMONKEY_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags $package) $DB_LOCALSTORAGE_CFLAGS $XMLPLUSPLUS_CFLAGS"
LIBS="$SPIDERMONKEY_LIBS $LIBS_X"
CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
SPIDERMONKEY_FOUND=yes
AC_MSG_RESULT([yes])
@ -799,6 +795,8 @@ else
CONFIG_SCRIPTING_SPIDERMONKEY=no
fi
CXXFLAGS="$CXXFLAGS -fpermissive -Wno-sign-compare -std=gnu++17"
if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
LIBS="$LIBS $SPIDERMONKEY_LIBS"
@ -806,7 +804,7 @@ if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
AC_SUBST(SPIDERMONKEY_CFLAGS)
AC_SUBST(CONFIG_SPIDERMONKEY)
AC_SUBST(CONFIG_XML)
CFLAGS="$CFLAGS -fpermissive -Wno-sign-compare -std=gnu++17 $SPIDERMONKEY_CFLAGS"
CXXFLAGS="$CXXFLAGS $SPIDERMONKEY_CFLAGS"
fi
if test "x$CONFIG_QUICKJS" = xyes; then
@ -814,7 +812,6 @@ if test "x$CONFIG_QUICKJS" = xyes; then
EL_CONFIG(CONFIG_QUICKJS, [quickjs])
AC_SUBST(CONFIG_QUICKJS)
AC_SUBST(CONFIG_XML)
CFLAGS="$CFLAGS -fpermissive -Wno-sign-compare -std=gnu++17"
fi
# ===================================================================
# Check for Guile, optional even if installed.
@ -1966,6 +1963,7 @@ fi
AC_SUBST(GETTEXT_CFLAGS)
EL_LOG_CONFIG(CFLAGS, [Compiler flags (CFLAGS)], [])
EL_LOG_CONFIG(CPPFLAGS, [Preprocessor flags (CPPFLAGS)], [])
EL_LOG_CONFIG(CXXFLAGS, [C++ compiler flags (CXXFLAGS)], [])
EL_LOG_CONFIG(LDFLAGS, [Linker flags (LDFLAGS)], [])
EL_LOG_CONFIG(LIBS, [Library flags (LIBS)], [])