2020-12-14 18:30:00 +01:00
|
|
|
# Makefile for c++tools
|
2022-01-03 10:42:10 +01:00
|
|
|
# Copyright (C) 2020-2022 Free Software Foundation, Inc.
|
2020-12-14 18:30:00 +01:00
|
|
|
#
|
|
|
|
# This file is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; see the file COPYING3. If not see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
srcdir := @srcdir@
|
|
|
|
prefix := @prefix@
|
|
|
|
bindir := @bindir@
|
|
|
|
libexecdir := @libexecdir@
|
|
|
|
target_noncanonical := @target_noncanonical@
|
2020-12-17 14:31:05 +01:00
|
|
|
gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
|
|
|
|
libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
|
2020-12-16 20:44:42 +01:00
|
|
|
INSTALL_PROGRAM := @INSTALL_PROGRAM@
|
|
|
|
INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
|
2020-12-14 18:30:00 +01:00
|
|
|
AUTOCONF := @AUTOCONF@
|
|
|
|
AUTOHEADER := @AUTOHEADER@
|
|
|
|
CXX := @CXX@
|
|
|
|
CXXFLAGS := @CXXFLAGS@
|
2020-12-23 13:50:00 +01:00
|
|
|
PIEFLAG := @PIEFLAG@
|
|
|
|
CXXOPTS := $(CXXFLAGS) $(PIEFLAG) -fno-exceptions -fno-rtti
|
|
|
|
LDFLAGS := @LDFLAGS@
|
2020-12-21 14:32:28 +01:00
|
|
|
exeext := @EXEEXT@
|
2020-12-14 18:30:00 +01:00
|
|
|
LIBIBERTY := ../libiberty/libiberty.a
|
build: libcody: Link with -lsocket -lnsl if necessary [PR98316]
With the introduction of C++20 modules and libcody, cc1plus and
cc1objplus gained a dependency on the socket functions. Before those
were merged into libc in Solaris 11.4, one needed to link with -lsocket -lnsl
on Solaris, so that merge broke the Solaris 11.3 build.
While we already have 4 different checks for those libraries in the
tree, I decided to import autoconf-archive's AX_LIB_SOCKET_NSL macro
instead. At the same time, the patch only links libcody and the
networking libs where needed (cc1plus, cc1objplus).
Bootstrapped without regressions on i386-pc-solaris2.11 (Solaris 11.3
and 11.4), sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.
2020-12-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
c++tools:
PR c++/98316
* configure.ac: Include ../config/ax_lib_socket_nsl.m4.
(NETLIBS): Determine using AX_LIB_SOCKET_NSL.
* configure: Regenerate.
* Makefile.in (NETLIBS): Define.
(g++-mapper-server$(exeext)): Add $(NETLIBS).
gcc/objcp:
PR c++/98316
* Make-lang.in (cc1objplus$(exeext)): Add $(CODYLIB), $(NETLIBS).
gcc/cp:
PR c++/98316
* Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
gcc:
PR c++/98316
* configure.ac (NETLIBS): Determine using AX_LIB_SOCKET_NSL.
* aclocal.m4, configure: Regenerate.
* Makefile.in (NETLIBS): Define.
(BACKEND): Remove $(CODYLIB).
config:
PR c++/98316
* ax_lib_socket_nsl.m4: Import from autoconf-archive.
2021-01-05 11:32:31 +01:00
|
|
|
NETLIBS := @NETLIBS@
|
2020-12-14 18:30:00 +01:00
|
|
|
VERSION.O := ../gcc/version.o
|
|
|
|
|
|
|
|
all::
|
|
|
|
|
|
|
|
mostlyclean::
|
|
|
|
rm -f $(MAPPER.O)
|
|
|
|
|
|
|
|
clean::
|
2020-12-16 14:14:57 +01:00
|
|
|
rm -f g++-mapper-server$(exeext)
|
2020-12-14 18:30:00 +01:00
|
|
|
|
|
|
|
distclean::
|
|
|
|
rm -f config.log config.status config.h
|
|
|
|
|
|
|
|
maintainer-clean::
|
|
|
|
|
|
|
|
install::
|
|
|
|
|
2020-12-16 20:44:42 +01:00
|
|
|
check::
|
|
|
|
installcheck::
|
|
|
|
dvi::
|
|
|
|
pdf::
|
|
|
|
html::
|
|
|
|
info::
|
|
|
|
install-info::
|
|
|
|
install-pdf::
|
2021-10-23 00:24:15 +02:00
|
|
|
install-dvi::
|
2020-12-16 20:44:42 +01:00
|
|
|
install-man::
|
|
|
|
install-html::
|
|
|
|
|
|
|
|
install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
|
|
|
|
ifneq ($(STRIP),)
|
|
|
|
install-strip: STRIPPROG = $(STRIP)
|
|
|
|
export STRIPPROG
|
|
|
|
endif
|
|
|
|
install-strip: install
|
2020-12-14 18:30:00 +01:00
|
|
|
|
|
|
|
vpath %.cc $(srcdir)
|
|
|
|
vpath %.in $(srcdir)
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .cc .o
|
|
|
|
|
|
|
|
# Per-source & per-directory compile flags (warning: recursive)
|
|
|
|
SRC_CXXFLAGS = $(CXXFLAGS$(patsubst $(srcdir)%,%,$1)) \
|
|
|
|
$(if $(filter-out $(srcdir)/,$1),\
|
|
|
|
$(call $0,$(dir $(patsubst %/,%,$1))))
|
|
|
|
|
|
|
|
%.o: %.cc
|
|
|
|
$(CXX) $(strip $(CXXOPTS) $(call SRC_CXXFLAGS,$<) $(CXXINC)) \
|
|
|
|
-MMD -MP -MF ${@:.o=.d} -c -o $@ $<
|
|
|
|
|
|
|
|
ifeq (@CXX_AUX_TOOLS@,yes)
|
|
|
|
|
|
|
|
all::g++-mapper-server$(exeext)
|
|
|
|
|
|
|
|
MAPPER.O := server.o resolver.o
|
|
|
|
CODYLIB = ../libcody/libcody.a
|
2021-04-20 16:56:07 +02:00
|
|
|
CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
|
2020-12-14 18:30:00 +01:00
|
|
|
g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
|
2021-04-20 16:56:07 +02:00
|
|
|
+$(CXX) $(LDFLAGS) $(PIEFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
|
2020-12-14 18:30:00 +01:00
|
|
|
|
|
|
|
# copy to gcc dir so tests there can run
|
|
|
|
all::../gcc/g++-mapper-server$(exeext)
|
|
|
|
|
|
|
|
../gcc/g++-mapper-server$(exeext): g++-mapper-server$(exeext)
|
2020-12-16 14:14:57 +01:00
|
|
|
$(INSTALL) $< $@
|
2020-12-14 18:30:00 +01:00
|
|
|
|
|
|
|
install::
|
2020-12-16 14:14:57 +01:00
|
|
|
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libexecsubdir)
|
2020-12-16 20:44:42 +01:00
|
|
|
$(INSTALL_PROGRAM) g++-mapper-server$(exeext) $(DESTDIR)$(libexecsubdir)
|
2020-12-14 18:30:00 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(MAINTAINER),)
|
|
|
|
override MAINTAINER += $1
|
|
|
|
endif
|
|
|
|
ifeq (@MAINTAINER@,yes)
|
|
|
|
MAINTAINER = $2
|
|
|
|
else
|
|
|
|
MAINTAINER = \# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
|
|
|
|
endif
|
|
|
|
|
|
|
|
all:: Makefile
|
|
|
|
|
|
|
|
Makefile: $(srcdir)/Makefile.in config.status
|
|
|
|
$(SHELL) ./config.status Makefile
|
|
|
|
|
|
|
|
$(srcdir)/configure: $(srcdir)/configure.ac
|
|
|
|
$(call MAINTAINER,$@,cd $(@D) && $(AUTOCONF) -W all,error)
|
|
|
|
|
|
|
|
$(srcdir)/config.h.in: $(srcdir)/configure.ac
|
|
|
|
$(call MAINTAINER,$@,cd $(@D) && $(AUTOHEADER) -f -W all,error)
|
|
|
|
|
|
|
|
config.h: config.status config.h.in
|
|
|
|
./$< --header=$@
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
config.status: $(srcdir)/configure $(srcdir)/config.h.in
|
|
|
|
if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi
|
|
|
|
|
|
|
|
.PHONY: all check clean distclean maintainer-clean
|
|
|
|
|
|
|
|
-include $(MAPPER.O:.o=.d)
|