| 1 |
## Makefile for the toplevel directory of the libssp library. |
| 2 |
## |
| 3 |
## Copyright (C) 2005-2025 Free Software Foundation, Inc. |
| 4 |
## |
| 5 |
|
| 6 |
AUTOMAKE_OPTIONS = foreign |
| 7 |
ACLOCAL_AMFLAGS = -I .. -I ../config |
| 8 |
MAINT_CHARSET = latin1 |
| 9 |
|
| 10 |
# May be used by various substitution variables. |
| 11 |
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) |
| 12 |
|
| 13 |
if LIBSSP_USE_SYMVER |
| 14 |
if LIBSSP_USE_SYMVER_GNU |
| 15 |
version_arg = -Wl,--version-script=$(srcdir)/ssp.map |
| 16 |
version_dep = $(srcdir)/ssp.map |
| 17 |
endif |
| 18 |
if LIBSSP_USE_SYMVER_SUN |
| 19 |
version_arg = -Wl,-M,ssp.map-sun |
| 20 |
version_dep = ssp.map-sun |
| 21 |
ssp.map-sun : $(srcdir)/ssp.map \ |
| 22 |
$(top_srcdir)/../contrib/make_sunver.pl \ |
| 23 |
$(libssp_la_OBJECTS) $(libssp_la_LIBADD) |
| 24 |
perl $(top_srcdir)/../contrib/make_sunver.pl \ |
| 25 |
$(srcdir)/ssp.map \ |
| 26 |
$(libssp_la_OBJECTS) $(libssp_la_LIBADD) \ |
| 27 |
> $@ || (rm -f $@ ; exit 1) |
| 28 |
endif |
| 29 |
else |
| 30 |
version_arg = |
| 31 |
version_dep = |
| 32 |
endif |
| 33 |
|
| 34 |
AM_CFLAGS = -Wall |
| 35 |
AM_CFLAGS += $(XCFLAGS) |
| 36 |
|
| 37 |
toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la |
| 38 |
|
| 39 |
target_noncanonical = @target_noncanonical@ |
| 40 |
libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include |
| 41 |
nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h |
| 42 |
|
| 43 |
libssp_la_SOURCES = \ |
| 44 |
ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \ |
| 45 |
memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \ |
| 46 |
strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \ |
| 47 |
vsnprintf-chk.c vsprintf-chk.c |
| 48 |
libssp_la_LIBADD = |
| 49 |
libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD) |
| 50 |
if ENABLE_DARWIN_AT_RPATH |
| 51 |
libssp_darwin_rpath = -Wc,-nodefaultrpaths |
| 52 |
libssp_darwin_rpath += -Wl,-rpath,@loader_path |
| 53 |
endif |
| 54 |
libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ |
| 55 |
$(version_arg) $(lt_host_flags) $(libssp_darwin_rpath) |
| 56 |
|
| 57 |
libssp_nonshared_la_SOURCES = \ |
| 58 |
ssp-local.c |
| 59 |
libssp_nonshared_la_CFLAGS = -prefer-pic $(XCFLAGS) |
| 60 |
libssp_nonshared_la_LIBADD = |
| 61 |
libssp_nonshared_la_DEPENDENCIES = $(libssp_nonshared_la_LIBADD) |
| 62 |
libssp_nonshared_la_LDFLAGS = -static |
| 63 |
|
| 64 |
|
| 65 |
# XXX hack alert |
| 66 |
# From libffi/Makefile.am |
| 67 |
|
| 68 |
# Work around what appears to be a GNU make bug handling MAKEFLAGS |
| 69 |
# values defined in terms of make variables, as is the case for CC and |
| 70 |
# friends when we are called from the top level Makefile. |
| 71 |
AM_MAKEFLAGS = \ |
| 72 |
"AR_FLAGS=$(AR_FLAGS)" \ |
| 73 |
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \ |
| 74 |
"CFLAGS=$(CFLAGS)" \ |
| 75 |
"CXXFLAGS=$(CXXFLAGS)" \ |
| 76 |
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ |
| 77 |
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ |
| 78 |
"EXPECT=$(EXPECT)" \ |
| 79 |
"INSTALL=$(INSTALL)" \ |
| 80 |
"INSTALL_DATA=$(INSTALL_DATA)" \ |
| 81 |
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ |
| 82 |
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ |
| 83 |
"JC1FLAGS=$(JC1FLAGS)" \ |
| 84 |
"LDFLAGS=$(LDFLAGS)" \ |
| 85 |
"LIBCFLAGS=$(LIBCFLAGS)" \ |
| 86 |
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ |
| 87 |
"MAKE=$(MAKE)" \ |
| 88 |
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ |
| 89 |
"PICFLAG=$(PICFLAG)" \ |
| 90 |
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ |
| 91 |
"SHELL=$(SHELL)" \ |
| 92 |
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \ |
| 93 |
"exec_prefix=$(exec_prefix)" \ |
| 94 |
"infodir=$(infodir)" \ |
| 95 |
"libdir=$(libdir)" \ |
| 96 |
"prefix=$(prefix)" \ |
| 97 |
"includedir=$(includedir)" \ |
| 98 |
"AR=$(AR)" \ |
| 99 |
"AS=$(AS)" \ |
| 100 |
"CC=$(CC)" \ |
| 101 |
"CXX=$(CXX)" \ |
| 102 |
"LD=$(LD)" \ |
| 103 |
"LIBCFLAGS=$(LIBCFLAGS)" \ |
| 104 |
"NM=$(NM)" \ |
| 105 |
"PICFLAG=$(PICFLAG)" \ |
| 106 |
"RANLIB=$(RANLIB)" \ |
| 107 |
"DESTDIR=$(DESTDIR)" |
| 108 |
|
| 109 |
MAKEOVERRIDES= |
| 110 |
|
| 111 |
## ################################################################ |
| 112 |
|
| 113 |
include $(top_srcdir)/../multilib.am |