summaryrefslogtreecommitdiff
path: root/gcc/genmultilib
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-03 20:35:14 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-03 20:35:14 +0000
commitc954ff02f308a7c03628c9c7882c21b0fd032c67 (patch)
tree456cd45052f2e8eae6252ce7e1adc27a5c880d61 /gcc/genmultilib
parentbc0c486dac5212fc4ad0e4d2d6c20853415d0031 (diff)
downloadgcc-c954ff02f308a7c03628c9c7882c21b0fd032c67.tar.gz
* gcc.c (print_multi_os_directory): New variable.
(option_map): Support --print-multi-os-directory. (struct prefix_list): Add os_multilib field. (multilib_os_dir): New variable. (static_specs): Add multilib_options. (find_a_file): Add multilib argument. Search in GCC or OS multilib subdirs if non-zero. (read_specs, execute): Update callers. (find_file): Likewise. Don't prefix name with multilib_dir, instead pass 1 as multilib option. (display_help): Include --print-multi-os-directory. (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. (process_command): Update callers. Handle --print-multi-os-directory. (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is set. (main): Update find_a_file and add_prefix callers. Handle print_multi_os_directory. (struct mdswitchstr): New. (mdswitches, n_mdswitches): New variables. (used_arg): Add MULTILIB_DEFAULT switches too if they are not present on the command line nor their mutually incompatible switches. (default_arg): Optimize. (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches array. (print_multilib_info): Only print GCC multilib dir name, not OS multilib dirname. * genmultilib: Add osdirnames parameter. Output multilib_options variable. If osdirnames is specified, output dirnames as dirname:osdirname. * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES to compute libgcc_s soname and install path. * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of SHLIB_SLIBDIR_SUFFIXES to mklibgcc. (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib argument. * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 and -m64. * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. (STARTFILE_ARCH_SPEC): Remove. * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. (SHLIB_SLIBDIR_SUFFIXES): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmultilib')
-rw-r--r--gcc/genmultilib57
1 files changed, 51 insertions, 6 deletions
diff --git a/gcc/genmultilib b/gcc/genmultilib
index 3cbfaa1ebab..c687537d700 100644
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -63,6 +63,11 @@
# for the rule to exclude a set. Options can be preceded with a '!' to
# match a logical NOT.
+# The optional sevenths argument is a list of OS subdirectory names.
+# The format is the same as of the second argument.
+# The difference is that second argument describes multilib directories
+# in GCC conventions, while this one the OS multilib convention.
+
# The output looks like
# #define MULTILIB_MATCHES "\
# SUBDIRECTORY OPTIONS;\
@@ -79,17 +84,18 @@
# Here is an example (this is from the actual sparc64 case):
# genmultilib 'm64/m32 mno-app-regs|mcmodel=medany' '64 32 alt'
# 'mcmodel?medany=mcmodel?medmid' 'm32/mno-app-regs* m32/mcmodel=*'
-# 'm32/!m64/mno-app-regs m32/!m64/mcmodel=medany'
+# '' 'm32/!m64/mno-app-regs m32/!m64/mcmodel=medany'
+# '../lib64 ../lib32 alt'
# This produces:
# ". !m64 !m32 !mno-app-regs !mcmodel=medany;",
-# "64 m64 !m32 !mno-app-regs !mcmodel=medany;",
-# "32 !m64 m32 !mno-app-regs !mcmodel=medany;",
+# "64:../lib64 m64 !m32 !mno-app-regs !mcmodel=medany;",
+# "32:../lib32 !m64 m32 !mno-app-regs !mcmodel=medany;",
# "alt !m64 !m32 mno-app-regs mcmodel=medany;",
# "alt !m64 !m32 mno-app-regs !mcmodel=medany;",
# "alt !m64 !m32 !mno-app-regs mcmodel=medany;",
-# "64/alt m64 !m32 mno-app-regs mcmodel=medany;",
-# "64/alt m64 !m32 mno-app-regs !mcmodel=medany;",
-# "64/alt m64 !m32 !mno-app-regs mcmodel=medany;",
+# "64/alt:../lib64/alt m64 !m32 mno-app-regs mcmodel=medany;",
+# "64/alt:../lib64/alt m64 !m32 mno-app-regs !mcmodel=medany;",
+# "64/alt:../lib64/alt m64 !m32 !mno-app-regs mcmodel=medany;",
#
# The effect is that `gcc -mno-app-regs' (for example) will append "alt"
# to the directory name when searching for libraries or startup files and
@@ -106,6 +112,7 @@ matches=$3
exceptions=$4
extra=$5
exclusions=$6
+osdirnames=$7
echo "static const char *const multilib_raw[] = {"
@@ -202,6 +209,29 @@ if [ -n "${dirnames}" ]; then
done
fi
+# Construct a sed pattern which will convert option names to OS directory
+# names.
+toosdirnames=
+if [ -n "${osdirnames}" ]; then
+ set x ${osdirnames}
+ shift
+ for set in ${options}; do
+ for opts in `echo ${set} | sed -e 's|/| |'g`; do
+ patt="/"
+ for opt in `echo ${opts} | sed -e 's_|_ _'g`; do
+ if [ "$1" != "${opt}" ]; then
+ toosdirnames="${toosdirnames} -e s|/${opt}/|/${1}/|g"
+ patt="${patt}${1}/"
+ if [ "${patt}" != "/${1}/" ]; then
+ toosdirnames="${toosdirnames} -e s|${patt}|/${1}/|g"
+ fi
+ fi
+ done
+ shift
+ done
+ done
+fi
+
# We need another recursive shell script to correctly handle positive
# matches. If we are invoked as
# genmultilib "opt1 opt2" "" "opt1=nopt1 opt2=nopt2"
@@ -257,6 +287,16 @@ for combo in ${combinations}; do
# Remove the leading and trailing slashes.
dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/$||g'`
+ # Use the OS directory names rather than the option names.
+ if [ -n "${toosdirnames}" ]; then
+ osdirout=`echo ${combo} | sed ${toosdirnames}`
+ # Remove the leading and trailing slashes.
+ osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'`
+ if [ "x${dirout}" != "x${osdirout}" ]; then
+ dirout="${dirout}:${osdirout}"
+ fi
+ fi
+
# Look through the options. We must output each option that is
# present, and negate each option that is not present.
optout=
@@ -313,6 +353,11 @@ done
echo "NULL"
echo "};"
+# Output the options now
+moptions=`echo ${options} | sed -e 's,[ ][ ]*, ,g'`
+echo ""
+echo "static const char *multilib_options = \"${moptions}\";"
+
rm -f tmpmultilib2
exit 0