summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/mpw-configure
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-04 19:11:21 +0000
commitc3c8d76890b592bf5acc1a9b7faeabd9b829dd71 (patch)
tree6358a23d0df9de73b6d5d6d3a75545ff35f05b47 /gnu/usr.bin/binutils/mpw-configure
parent4ba440a6e788da3a64fa29b782c37150a3f5cc18 (diff)
Merge the Cygnus 960904 sources
Diffstat (limited to 'gnu/usr.bin/binutils/mpw-configure')
-rw-r--r--gnu/usr.bin/binutils/mpw-configure79
1 files changed, 60 insertions, 19 deletions
diff --git a/gnu/usr.bin/binutils/mpw-configure b/gnu/usr.bin/binutils/mpw-configure
index f2cb5c9e328..02e913196d4 100644
--- a/gnu/usr.bin/binutils/mpw-configure
+++ b/gnu/usr.bin/binutils/mpw-configure
@@ -38,6 +38,8 @@ Set prefix "{MPW}":GNUTools:
Set exec_prefix ""
+Set bindir ""
+
Set host_alias "m68k-apple-mpw"
Set target_alias {host_alias}
@@ -49,6 +51,9 @@ Set with_gnu_ld 0
Set verify 0
Set verifystr ""
+Set enable_options ""
+Set disable_options ""
+
# Parse arguments.
Loop
@@ -56,10 +61,15 @@ Loop
If "{1}" =~ /--cc/
Set host_cc "{2}"
Shift 1
+ Else If "{1}" =~ /--bindir/
+ Set bindir "{2}"
+ Shift 1
Else If "{1}" =~ /--disable-?+/
- Set "`Echo {1} | sed -e 's/--disable-/enable_/'`" no
+ Set `Echo {1} | sed -e 's/--disable-/enable_/'` no
+ Set disable_options "{disable_options} '{1}'"
Else If "{1}" =~ /--enable-?+/
- Set "`Echo {1} | sed -e 's/--enable-/enable_/'`" yes
+ Set `Echo {1} | sed -e 's/--enable-/enable_/'` yes
+ Set enable_options "{enable_options} '{1}'"
Else If "{1}" =~ /--exec-prefix/
Set exec_prefix "{2}"
Shift 1
@@ -98,12 +108,16 @@ If "{exec_prefix}" == ""
Set exec_prefix "{prefix}"
End If
+If "{bindir}" == ""
+ Set bindir "{prefix}"bin:
+End If
+
# Point to the correct set of tools to use with the chosen compiler.
If "{host_cc}" =~ /mpwc/
Set host_alias "m68k-apple-mpw"
Set cc_name '{CC_MPW_C}'
- Set segment_flag '-s {Default}'
+ Set segment_flag '-s '
Set ar_name '{AR_LIB}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_LINK}'
@@ -114,7 +128,7 @@ If "{host_cc}" =~ /mpwc/
Else If "{host_cc}" =~ /sc68k/
Set host_alias "m68k-apple-mpw"
Set cc_name '{CC_SC}'
- Set segment_flag '-s {Default}'
+ Set segment_flag '-s '
Set ar_name '{AR_LIB}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_LINK}'
@@ -125,7 +139,7 @@ Else If "{host_cc}" =~ /sc68k/
Else If "{host_cc}" =~ /mwc68k/
Set host_alias "m68k-apple-mpw"
Set cc_name '{CC_MWC68K}'
- Set segment_flag '-s {Default}'
+ Set segment_flag '-s '
Set ar_name '{AR_MWLINK68K}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_MWLINK68K}'
@@ -136,7 +150,7 @@ Else If "{host_cc}" =~ /mwc68k/
Else If "{host_cc}" =~ /gcc68k/
Set host_alias "m68k-apple-mpw"
Set cc_name '{CC_68K_GCC}'
- Set segment_flag '-s {Default}'
+ Set segment_flag '-s '
Set ar_name '{AR_68K_AR}'
Set ranlib_name '{RANLIB_RANLIB}'
Set cc_ld_name '{CC_68K_GCC}'
@@ -147,7 +161,7 @@ Else If "{host_cc}" =~ /gcc68k/
Else If "{host_cc}" =~ /ppcc/
Set host_alias "powerpc-apple-mpw"
Set cc_name '{CC_PPCC}'
- Set segment_flag ''
+ Set segment_flag '-d ___s_e_g___='
Set ar_name '{AR_PPCLINK}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_PPCLINK}'
@@ -158,7 +172,7 @@ Else If "{host_cc}" =~ /ppcc/
Else If "{host_cc}" =~ /mrc/
Set host_alias "powerpc-apple-mpw"
Set cc_name '{CC_MRC}'
- Set segment_flag ''
+ Set segment_flag '-d ___s_e_g___='
Set ar_name '{AR_PPCLINK}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_PPCLINK}'
@@ -169,7 +183,7 @@ Else If "{host_cc}" =~ /mrc/
Else If "{host_cc}" =~ /scppc/
Set host_alias "powerpc-apple-mpw"
Set cc_name '{CC_SC}'
- Set segment_flag ''
+ Set segment_flag '-d ___s_e_g___='
Set ar_name '{AR_PPCLINK}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_PPCLINK}'
@@ -180,7 +194,7 @@ Else If "{host_cc}" =~ /scppc/
Else If "{host_cc}" =~ /mwcppc/
Set host_alias "powerpc-apple-mpw"
Set cc_name '{CC_MWCPPC}'
- Set segment_flag ''
+ Set segment_flag '-d ___s_e_g___='
Set ar_name '{AR_MWLINKPPC}'
Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_MWLINKPPC}'
@@ -192,12 +206,13 @@ Else If "{host_cc}" =~ /mwcppc/
Else If "{host_cc}" =~ /gccppc/
Set host_alias "powerpc-apple-mpw"
Set cc_name '{CC_PPC_GCC}'
- Set segment_flag ''
+ Set segment_flag '-d ___s_e_g___='
Set ar_name '{AR_PPCLINK}'
- Set ranlib_name '{RANLIB_RANLIB}'
If {with_gnu_ld} == 1
+ Set ranlib_name '{RANLIB_RANLIB}'
Set cc_ld_name '{CC_LD_GLD}'
Else
+ Set ranlib_name '{RANLIB_NULL}'
Set cc_ld_name '{CC_LD_PPCLINK}'
End If
Set prog_ext_name '{PROG_EXT_XCOFF}'
@@ -208,6 +223,13 @@ Else
Echo "{host_cc}" is not a known MPW compiler type
End If
+Set dash_c_flag ''
+If "{host_cc}" =~ /gcc68k/
+ Set dash_c_flag '-c'
+Else If "{host_cc}" =~ /gccppc/
+ Set dash_c_flag '-c'
+End If
+
# (should interpret aliases if not in canonical form)
Set host_canonical "{host_alias}"
@@ -242,7 +264,7 @@ End If
# dependencies on config.status.
Echo "# This directory was configured as follows:" >config.new
-Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir} --srcroot {srcroot} --prefix {prefix} --cc {host_cc}" >>config.new
+Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir} --srcroot {srcroot} --prefix {prefix} --cc {host_cc} {verifystr} {enable_options} {disable_options}" >>config.new
MoveIfChange config.new config.status
If "`Exists "{srcdir}"mpw-config.in`" != ""
@@ -259,6 +281,7 @@ Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem
Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem
Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem
Echo "mpw_exec_prefix = " {exec_prefix} >> "{objdir}"Makefile.tem
+Echo "mpw_bindir = " {bindir} >> "{objdir}"Makefile.tem
Echo "host_alias = " {host_alias} >> "{objdir}"Makefile.tem
Echo "target_alias = " {target_alias} >> "{objdir}"Makefile.tem
Echo "target_cpu = " {target_cpu} >> "{objdir}"Makefile.tem
@@ -276,6 +299,16 @@ Echo "EXTRALIBS = " {extralibs_name} >> "{objdir}"Makefile.tem
Echo "MAKEPEF = " {makepef_name} >> "{objdir}"Makefile.tem
Echo "REZ = " {rez_name} >> "{objdir}"Makefile.tem
+If {host_cc} =~ /gccppc/
+ Echo -n "dq =\Option-d\Option-d\Option-d" > "{objdir}"Makefile.tem0
+ Echo '"' >> "{objdir}"Makefile.tem0
+ tr-7to8 "{objdir}"Makefile.tem0 >>"{objdir}"Makefile.tem
+Else
+ Echo -n "dq ='" >> "{objdir}"Makefile.tem
+ Echo -n '"' >> "{objdir}"Makefile.tem
+ Echo "'" >> "{objdir}"Makefile.tem
+End If
+
# Append the master set of definitions for the various compilers.
If "`Exists "{srcdir}"config:mpw-mh-mpw`" != ""
@@ -305,14 +338,20 @@ If "`Exists "{srcdir}"mpw-make.sed`" != ""
Else
Set MakefileIn "{srcdir}"Makefile.in
End If
- If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != ""
+ # Find the generic makefile editing script.
+ If "`Exists "{srcroot}"config:mpw:g-mpw-make.sed`" != ""
+ sed -f "{srcroot}"config:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
+ Else If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != ""
sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
+ Else If "`Exists "{srcdir}"g-mpw-make.sed`" != ""
+ sed -f "{srcdir}"g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
Else
+ Echo Warning: g-mpw-make.sed not found, copying "{MakefileIn}" verbatim...
Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1
End If
sed -f "{srcdir}"mpw-make.sed "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2
- sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3
- sed -e "s/@SEGMENT_FLAG@/{segment_flag}/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in
+ sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' -e 's/^bindir = @bindir@/bindir = {mpw_bindir}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3
+ sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}\1/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in
tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem
If "`Exists "{objdir}"mk.sed`" != ""
sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
@@ -325,7 +364,7 @@ If "`Exists "{srcdir}"mpw-make.sed`" != ""
End If
Else If "`Exists "{srcdir}"mpw-make.in`" != ""
sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' "{srcdir}"mpw-make.in >"{objdir}"Makefile.tem1
- sed -e "s/@SEGMENT_FLAG@/{segment_flag}/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2
+ sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}}\1/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2
tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem
If "`Exists "{objdir}"mk.sed`" != ""
sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
@@ -357,7 +396,9 @@ End If
For subdir In {configdirs}
Set savedir "`Directory`"
If "`Exists "{srcdir}{subdir}:"`" == ""
- Echo Strange, no {subdir} in {srcdir}
+ If {verify} == 1
+ Echo No "{srcdir}{subdir}:" found, skipping
+ End If
Continue
End If
If {verify} == 1
@@ -367,7 +408,7 @@ For subdir In {configdirs}
NewFolder "{objdir}{subdir}"
End If
SetDirectory "{objdir}{subdir}:"
- "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr}
+ "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} {enable_options} {disable_options}
SetDirectory "{savedir}"
End For