X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=mpw-configure;h=01e0c8b00e6c3013725fbb3c7d9c0bd81ee22b9d;hb=cf02c13ce233d2e7dc2ac391b605fc862b2b545d;hp=ddac26e65cda9912b1d50ae34bd016c1f38e25c4;hpb=aa8f28af4b5ffa3eb67b9b51db0ab3c436be7ace;p=deliverable%2Fbinutils-gdb.git diff --git a/mpw-configure b/mpw-configure index ddac26e65c..01e0c8b00e 100644 --- a/mpw-configure +++ b/mpw-configure @@ -1,6 +1,26 @@ # Configuration script +# Copyright (C) 1994, 1995 Free Software Foundation, Inc. -### This script (and its config.in fragments) must NOT use any 8-bit chars! +# This program 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 2 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; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +### WARNING +### This script (and mpw-config.in fragments) must NOT use any 8-bit chars! +### WARNING + +# This is an MPW Shell script that sets everything up for compilation, +# mainly creating directories, and editing copies of files. Set savedir "`Directory`" @@ -14,13 +34,17 @@ Set srcdir ":" Set objdir ":" -Set prefix ":" +Set prefix "{MPW}":GNUTools: + +Set exec_prefix "" -Set hostalias "m68k-apple-mpw" +Set host_alias "m68k-apple-mpw" -Set targetalias {hostalias} +Set target_alias {host_alias} -Set prefix "{Boot}"Cygnus:latest: +Set host_cc "mpwc" + +Set with_gnu_ld 0 Set verify 0 Set verifystr "" @@ -29,7 +53,19 @@ Set verifystr "" Loop Break If {#} == 0 - If "{1}" =~ /--prefix/ + If "{1}" =~ /--cc/ + Set host_cc "{2}" + Shift 1 + Else If "{1}" =~ /--enable/ + Set "{2}" 1 + Shift 1 + Else If "{1}" =~ /--exec-prefix/ + Set exec_prefix "{2}" + Shift 1 + Else If "{1}" =~ /--host/ + Set host_alias "{2}" + Shift 1 + Else If "{1}" =~ /--prefix/ Set prefix "{2}" Shift 1 Else If "{1}" =~ /--srcdir/ @@ -39,12 +75,13 @@ Loop Set srcroot "{2}" Shift 1 Else If "{1}" =~ /--target/ - Set targetalias "{2}" + Set target_alias "{2}" Shift 1 Else If "{1}" =~ /-v/ Set verify 1 Set verifystr "-v" - Shift 1 + Else If "{1}" =~ /--with-gnu-ld/ + Set with_gnu_ld 1 Else Echo "{1}" is not a valid argument Exit 1 @@ -54,9 +91,127 @@ End Loop Set Exit 0 +# Default exec_prefix from prefix. + +If "{exec_prefix}" == "" + Set exec_prefix "{prefix}" +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 ar_name '{AR_LIB}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_LINK}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /sc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_SC}' + Set segment_flag '-s {Default}' + Set ar_name '{AR_LIB}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_LINK}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /mwc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_MWC68K}' + Set segment_flag '-s {Default}' + Set ar_name '{AR_MWLINK68K}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_MWLINK68K}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /gcc68k/ + Set host_alias "m68k-apple-mpw" + Set cc_name '{CC_68K_GCC}' + Set segment_flag '-s {Default}' + Set ar_name '{AR_68K_AR}' + Set ranlib_name '{RANLIB_RANLIB}' + Set cc_ld_name '{CC_68K_GCC}' + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_C}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_68K}' +Else If "{host_cc}" =~ /ppcc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_PPCC}' + Set segment_flag '' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /mrc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_MRC}' + Set segment_flag '' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /scppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_SC}' + Set segment_flag '' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_PPCLINK}' + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /mwcppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_MWCPPC}' + Set segment_flag '' + Set ar_name '{AR_MWLINKPPC}' + Set ranlib_name '{RANLIB_NULL}' + Set cc_ld_name '{CC_LD_MWLINKPPC}' + # Misleading, but we don't need a PEF step. + Set prog_ext_name '{PROG_EXT_68K}' + Set extralibs_name '{EXTRALIBS_MWCPPC}' + Set makepef_name '{MAKEPEF_NULL}' + Set rez_name '{REZ_PPC}' +Else If "{host_cc}" =~ /gccppc/ + Set host_alias "powerpc-apple-mpw" + Set cc_name '{CC_PPC_GCC}' + Set segment_flag '' + Set ar_name '{AR_PPCLINK}' + Set ranlib_name '{RANLIB_RANLIB}' + If {with_gnu_ld} == 1 + Set cc_ld_name '{CC_LD_GLD}' + Else + Set cc_ld_name '{CC_LD_PPCLINK}' + End If + Set prog_ext_name '{PROG_EXT_XCOFF}' + Set extralibs_name '{EXTRALIBS_PPC}' + Set makepef_name '{MAKEPEF_PPC}' + Set rez_name '{REZ_PPC}' +Else + Echo "{host_cc}" is not a known MPW compiler type +End If + # (should interpret aliases if not in canonical form) -Set target_canonical "{targetalias}" +Set host_canonical "{host_alias}" + +Set target_canonical "{target_alias}" Set configdirs "" @@ -72,61 +227,120 @@ If "`Exists "{srcroot}"`" == "" Exit 1 End If +Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`" +Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`" +Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`" + +# Create a file that is guaranteed to be older than any other here. + +If "`Exists "{objdir}"_oldest`" == "" + mpw-touch _oldest +End If + +# Record this before creating any files, makefiles sometimes mention +# 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 +MoveIfChange config.new config.status + If "`Exists "{srcdir}"mpw-config.in`" != "" - Execute "{srcdir}"mpw-config.in + tr-7to8 "{srcdir}"mpw-config.in >"{objdir}"mpw-config.in + Execute "{objdir}"mpw-config.in End If -If "`Exists "{srcdir}"mpw-xconfig.in`" != "" - Execute "{srcdir}"mpw-xconfig.in + +# Start Makefile construction by defining all the variables chosen by +# configuration. + +Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem +Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem +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 "host_alias = " {host_alias} >> "{objdir}"Makefile.tem +Echo "target_alias = " {target_alias} >> "{objdir}"Makefile.tem +Echo "target_cpu = " {target_cpu} >> "{objdir}"Makefile.tem +Echo "target_vendor = " {target_vendor} >> "{objdir}"Makefile.tem +Echo "target_os = " {target_os} >> "{objdir}"Makefile.tem +Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem +Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem +Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem +Echo "CC = " {cc_name} >> "{objdir}"Makefile.tem +Echo "AR = " {ar_name} >> "{objdir}"Makefile.tem +Echo "RANLIB = " {ranlib_name} >> "{objdir}"Makefile.tem +Echo "CC_LD = " {cc_ld_name} >> "{objdir}"Makefile.tem +Echo "PROG_EXT = " {prog_ext_name} >> "{objdir}"Makefile.tem +Echo "EXTRALIBS = " {extralibs_name} >> "{objdir}"Makefile.tem +Echo "MAKEPEF = " {makepef_name} >> "{objdir}"Makefile.tem +Echo "REZ = " {rez_name} >> "{objdir}"Makefile.tem + +# Append the master set of definitions for the various compilers. + +If "`Exists "{srcdir}"config:mpw-mh-mpw`" != "" + tr-7to8 "{srcdir}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem +Else If "`Exists "{srcroot}"config:mpw-mh-mpw`" != "" + tr-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem +Else + Echo "can't find a host config file!" + Exit 0 End If -If "`Exists "{srcdir}"mpw-make.in`" != "" - Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem - Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem - Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem - Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem - Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem - Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem - Echo "mdname = " {mdname} >> "{objdir}"Makefile.tem - Echo "EMUL = " {emulname} >> "{objdir}"Makefile.tem - Echo "ARCHDEFS = -d" {archname} >> "{objdir}"Makefile.tem - If "{tdepfiles}" != "" - Echo "TDEPFILES = " {tdepfiles} >> "{objdir}"Makefile.tem - End If - If "{tm_file}" != "" - Echo "TM_FILE = " {tm_file} >> "{objdir}"Makefile.tem - End If - If "{xdepfiles}" != "" - Echo "XDEPFILES = " {xdepfiles} >> "{objdir}"Makefile.tem +# Append anything produced by the directory's mpw-config.in. + +If "`Exists "{objdir}"mk.tmp`" != "" + Catenate "{objdir}"mk.tmp >>"{objdir}"Makefile.tem + # An mpw-config.in might change so as not to create this + # anymore, so get rid of it now to be safe. + Delete -i -y "{objdir}"mk.tmp +End If + +# If there are sed scripts to edit the Unix Makefile.in, use them; otherwise +# use an mpw-make.in if present. + +If "`Exists "{srcdir}"mpw-make.sed`" != "" + If "`Exists "{objdir}"hacked_Makefile.in`" != "" + Set MakefileIn "{objdir}"hacked_Makefile.in + Else + Set MakefileIn "{srcdir}"Makefile.in End If - If "{xm_file}" != "" - Echo "XM_FILE = " {xm_file} >> "{objdir}"Makefile.tem + If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != "" + sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 + Else + Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1 End If - If "{nat_file}" != "" - Echo "NAT_FILE = " {nat_file} >> "{objdir}"Makefile.tem + 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 + tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem + MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile + Delete -i -y "{objdir}"Makefile.tem[12] + If {verify} == 1 + Echo Created Makefile in "`Directory`" End If - Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem - Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem - mpw-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem - mpw-7to8 "{srcdir}"mpw-make.in >>"{objdir}"Makefile.tem - mpw-edit-prefix "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 - MoveIfChange "{objdir}"Makefile.tem2 "{objdir}"Makefile +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 + tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem + MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile + Delete -i -y "{objdir}"Makefile.tem[12] If {verify} == 1 Echo Created Makefile in "`Directory`" End If End If +# Produce a build script if the source is defined. + If "`Exists "{srcdir}"mpw-build.in`" != "" Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem - mpw-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem + tr-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build If {verify} == 1 Echo Created mpw-build in "`Directory`" End If -Else - Echo '::mpw-build {1}' >"{objdir}"mpw-build End If For subdir In {configdirs} @@ -142,11 +356,8 @@ For subdir In {configdirs} NewFolder "{objdir}{subdir}" End If SetDirectory "{objdir}{subdir}:" - "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" {verifystr} + "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} SetDirectory "{savedir}" End For -Echo "# This directory was configured as follows:" >config.status -Echo "mpw-configure --host {hostalias} --target {targetalias} --srcdir {srcdir}" >>config.status - SetDirectory "{savedir}"