home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # Copyright (c) 1993 by Westmount Technology B.V., Delft, The Netherlands.
- #
- # This software is furnished under a license and may be used only in
- # accordance with the terms of such license and with the inclusion of
- # the above copyright notice. This software or any other copies thereof
- # may not be provided or otherwise made available to any other person.
- # No title to and ownership of the software is hereby transferred.
- #
- # The information in this software is subject to change without notice
- # and should not be construed as a commitment by Westmount Technology B.V.
- #
- #---------------------------------------------------------------------------
- #
- # File : @(#)subcfg.tcl /main/hindenburg/1 04 Apr 1996
- # Author : peku
- # Original date : 17-11-1993
- # Description : specific config file for CC 3.0 and
- # RogueWave class library
- #
- #---------------------------------------------------------------------------
- #
-
- global default_cxx
- set default_cxx CC
- global default_cxxdebug
- set default_cxxdebug -g0
- global default_RWinc
- set default_RWinc /usr/local/include
- global default_RWlib
- set default_RWlib /usr/local/lib/librwtool.a
- global default_templates
- set default_templates 1
-
- # set help variabele 'base'
-
- global base
- if $projcf {
- set base [m4basedir]
- [[ClientContext::global] currentConfig] setProperty makeCommand "make"
- } else {
- set base [m4_var get M4_home]
- }
-
- global set_default_actions
- set set_default_actions {
- dfl_librw4omt
- dfl_librwdbobj
- dfl_maketmpl
- dfl_cpp_config_tcl
- }
- global ask_actions
- set ask_actions {
- ask_config
- }
-
- global copy_actions
- set copy_actions {
- cp_librw4omt
- cp_librwdbobj
- cp_maketmpl
- cp_cpp_config_tcl
- }
-
- global config_actions
- set config_actions {
- cf_librw4omt
- cf_librwdbobj
- cf_maketmpl
- cf_cpp_config_tcl
- }
-
- global msg_actions
- set msg_actions {
- msg_config
- }
-
- # this configuration asks for c++ compiler and templates
- # other defines are implied by choosing this file
-
- proc ask_config {} {
- global cxx_def templates_def RWlib_def RWinc_def
-
- set prompt "Enter command name for the C++ compiler"
- get_config_var $prompt cxx_def
- set prompt "What is the Rogue Wave class library path + name"
- get_config_var $prompt RWlib_def
- set prompt "What is the Rogue Wave class library include directory"
- get_config_var $prompt RWinc_def
- set templates_def 1
- if [file exists [location $base include]] {
- # previous installation ??
- set answer_def n
- puts "\nA previous C++ configuration exists."
- puts "overwrite or reconfigure only"
- puts -nonewline "Overwrite y/n \[$answer_def]: "
- set answer [string trim [gets stdin]]
- if {$answer == ""} {
- set answer $answer_def
- }
- if {$answer != "y" && $answer != "Y"} {
- global copy_actions config_actions msg_actions
- set copy_actions ""
- set config_actions ""
- set msg_actions ""
- }
- }
- }
-
- proc msg_config {} {
- puts "\nNow you have to build the library manually by giving the following commands"
- puts "(this may need proper search path setting for the compiler):\n"
- puts "cd [location $base src librw4omt]; make install"
- if [file exist [location $base src librwdbobj]] {
- puts "cd [location $base src librwdbobj]; make install"
- }
- puts ""
- }
-
- #-------------------------------------------------------------------------------
-
- # Makefile for librw4omt needs: c++ compiler
- # Rogue Wave include directory
-
- proc dfl_librw4omt {} {
- global cxx_def
- set cxx_def $default_cxx
- global RWinc_def
- set RWinc_def $default_RWinc
- }
-
- proc cp_librw4omt {} {
- m4copydir [location src librw4omt]
- }
-
- proc cf_librw4omt {} {
- set cxx_line "CXX =\t\t$cxx_def"
- set cxx_patt {^CXX =.*$}
- set incs_line "INCS =\t\t-I../../include -I$RWinc_def"
- set incs_patt {^INCS =.*$}
- set cfg(cxx) [list $cxx_patt $cxx_line]
- set cfg(incs) [list $incs_patt $incs_line]
-
- add_ranlib_config cfg
- config_file [location src librw4omt] Makefile cfg
- }
-
- #-------------------------------------------------------------------------------
- #
- # Makefile for librwdbobj.a needs: c++ compiler
- # Rogue Wave include directory
- # (fixed: Westmount RW-wrap include)
-
- proc dfl_librwdbobj {} {
- global cxx_def
- set cxx_def $default_cxx
- global RWinc_def
- set RWinc_def $default_RWinc
- }
-
- proc cp_librwdbobj {} {
- m4copydir [location src librwdbobj]
-
- global target
- $target::copy
- }
-
- proc cf_librwdbobj {} {
- set cxx_line "CXX =\t\t$cxx_def"
- set cxx_patt {^CXX =.*$}
- set incs_line "INCS =\t\t-I../../include -I$RWinc_def"
- set incs_patt {^INCS =.*$}
-
- set cfg(cxx) [list $cxx_patt $cxx_line]
- set cfg(incs) [list $incs_patt $incs_line]
-
- add_ranlib_config cfg
- config_file [location src librwdbobj] Makefile cfg
-
- global target
- $target::config
- }
-
- #-------------------------------------------------------------------------------
-
- # maketmpl needs: c++ compiler
- # c++ compiler debug flags
- # Rogue Wave class library include
- # Rogue Wave class library name
- # Westmount class library include
- # Westmount class library name
- # DBObject library include
- # DBObject library name
-
- proc dfl_maketmpl {} {
- global cxx_def
- set cxx_def $default_cxx
- global cxxdebug_def
- set cxxdebug_def $default_cxxdebug
-
- global classinc_def
- set classinc_def [location \
- {~[[[ClientContext::global] currentConfig] path]} include]
- global classlib_def
- set classlib_def [location \
- {~[[[ClientContext::global] currentConfig] path]} lib librw4omt.a]
- global dbobjinc_def
- set dbobjinc_def [location \
- {~[[[ClientContext::global] currentConfig] path]} include]
- global dbobjlib_def
- set dbobjlib_def [location \
- {~[[[ClientContext::global] currentConfig] path]} lib librwdbobj.a]
- global RWinc_def
- set RWinc_def $default_RWinc
- global RWlib_def
- set RWlib_def $default_RWlib
- }
-
- proc cp_maketmpl {} {
- m4copyfile etc maketmpl.maketmpl maketmpl
- }
-
- proc cf_maketmpl {} {
- set cxx_line "CXX =\t\t$cxx_def"
- set cxx_patt {^CXX =.*$}
- set cxxdebug_line "DEBUGFLAGS =\t$cxxdebug_def"
- set cxxdebug_patt {^DEBUGFLAGS =.*$}
- if {$classinc_def != $dbobjinc_def} {
- set incs_line "INCS =\t\t-I$classinc_def -I$dbobjinc_def"
- } else {
- set incs_line "INCS =\t\t-I$classinc_def"
- }
- append incs_line " -I$RWinc_def"
- set incs_patt {^INCS =.*$}
- set classlib_line "CLASSLIB =\t$classlib_def $RWlib_def"
- set classlib_patt {^CLASSLIB =.*$}
- set dbobjlib_line "DBOBJLIB =\t$dbobjlib_def"
- set dbobjlib_patt {^DBOBJLIB =.*$}
-
- set cfg(cxx) [list $cxx_patt $cxx_line]
- set cfg(cxxdebug) [list $cxxdebug_patt $cxxdebug_line]
- set cfg(incs) [list $incs_patt $incs_line]
- set cfg(classlib) [list $classlib_patt $classlib_line]
- set cfg(dbobjlib) [list $dbobjlib_patt $dbobjlib_line]
-
- config_file etc maketmpl.maketmpl cfg maketmpl
- }
-
- #-------------------------------------------------------------------------------
-
- proc dfl_cpp_config_tcl {} {
- global templates_def
- set templates_def $default_templates
- }
-
- proc cp_cpp_config_tcl {} {
- m4copyfile tcl cpp_config.tcl
- }
-
- # cpp_config.tcl needs: templates y/n
- # (is fixed 'y' on for this configuration)
-
- proc cf_cpp_config_tcl {} {
- set has_templates_line "set has_templates $templates_def"
- set has_templates_patt {set has_templates .*$}
- set cfg(templates) [list $has_templates_patt $has_templates_line]
-
- config_file tcl cpp_config.tcl cfg
- }
-
-