From cb6a2fbc185048846578bd81b4600b06281ac6f2 Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 27 Aug 2015 16:47:06 +0300 Subject: [PATCH] 0026602: Configuration, genproj.tcl - drop code generating Automake files StdPrs/FILES - drop duplicates genproj.sh - fix launcher --- adm/genproj.tcl | 751 +--------------------- adm/templates/acinclude.m4 | 157 ----- adm/templates/template.ac | 1170 ----------------------------------- adm/templates/template.mam | 22 - adm/templates/template.mamx | 10 - genproj.sh | 2 +- src/StdPrs/FILES | 3 - 7 files changed, 7 insertions(+), 2108 deletions(-) delete mode 100644 adm/templates/acinclude.m4 delete mode 100644 adm/templates/template.ac delete mode 100644 adm/templates/template.mam delete mode 100644 adm/templates/template.mamx diff --git a/adm/genproj.tcl b/adm/genproj.tcl index e767c87736..83dd3cccf7 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -17,7 +17,7 @@ # ======================================================================= # This script defines Tcl command genproj generating project files for # different IDEs: -# "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "amk" "xcd" +# "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" # # Example: # genproj -path=D:/occt -target=vc10 @@ -106,14 +106,14 @@ proc _get_used_files { pk {inc true} {src true} } { # Wrapper-function to generate VS project files proc genproj { args } { global path targetStation - set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "amk" "xcd" } + set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } set anArgs $args # Setting default IDE. set anTarget "" switch -exact -- "$targetStation" { "wnt" {set anTarget "$::env(VCVER)"} - "lin" {set anTarget "amk"} + "lin" {set anTarget "cbp"} "mac" {set anTarget "xcd"} } @@ -188,18 +188,14 @@ proc genproj { args } { vc12 - Visual Studio 2013 vc14 - Visual Studio 2015 cbp - CodeBlocks - xcd - XCode - amk - AutoMake" + xcd - XCode" return } if {!$isTargetDefault} { puts "the \'$anTarget\' target has been applied" } - - if {"$anTarget" == "amk"} { - set targetStation "lin" - } + set anAdmPath "$path/adm" OS:MKPRC "$anAdmPath" "$anTarget" "$aLibType" "$aPlatform" @@ -220,8 +216,6 @@ proc genprojbat {thePath theIDE} { if {[regexp {(vc)[0-9]*$} $theIDE] == 1} { set aTargetPlatform wnt - } elseif {"$theIDE" == "amk"} { - set aTargetPlatform lin } elseif {"$theIDE" == "xcd"} { set aTargetPlatform mac } @@ -278,7 +272,7 @@ set THE_GUIDS_LIST($aTKNullKey) "{00000000-0000-0000-0000-000000000000}" # Entry function to generate project files and solutions for IDE proc OS:MKPRC { {theOutDir {}} {theIDE ""} {theLibType "dynamic"} {thePlatform ""} } { global path targetStation - set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "amk" "xcd" } + set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } if { [lsearch $aSupportedIDE $theIDE] < 0 } { puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]" @@ -350,7 +344,6 @@ proc OS:MKPRC { {theOutDir {}} {theIDE ""} {theLibType "dynamic"} {thePlatform " "vc12" - "vc14" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE } "cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution } - "amk" { OS:MKAMK $anOutDir $aModules "adm/${aWokStation}/${theIDE}"} "xcd" { set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000" OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform @@ -1816,46 +1809,6 @@ proc osutils:vcproj:file { theVcVer theFile theOptions } { return $aText } -### AUTOMAKE ############################################################################### -proc OS:MKAMK { theOutDir {theModules {}} theSubPath} { - global path - wokUtils:FILES:mkdir $theOutDir - - foreach aModule $theModules { - foreach aToolKit [$aModule:toolkits] { - puts " toolkit: $aToolKit ==> $path/src/$aToolKit/EXTERNLIB" - wokUtils:FILES:rmdir $theOutDir/$aToolKit - wokUtils:FILES:mkdir $theOutDir/$aToolKit - osutils:tk:mkam $theOutDir/$aToolKit $aToolKit - } - foreach anExecutable [OS:executable $aModule] { - wokUtils:FILES:rmdir $theOutDir/$anExecutable - wokUtils:FILES:mkdir $theOutDir/$anExecutable - osutils:tk:mkamx $theOutDir/$anExecutable $anExecutable - } - } - osutils:am:adm $theOutDir $theModules - osutils:am:root $path $theSubPath $theModules - - puts "The automake files are stored in the $theOutDir directory" -} - -proc wokUtils:FILES:rmdir { d } { - global env - global tcl_platform tcl_version - regsub -all {\.[^.]*} $tcl_version "" major - if { $major == 8 } { - file delete -force $d - } else { - if { "$tcl_platform(platform)" == "unix" } { - catch { exec rm -rf $d} - } else { - - } - } - return -} - proc wokUtils:FILES:mkdir { d } { global tcl_version regsub -all {\.[^.]*} $tcl_version "" major @@ -1877,51 +1830,6 @@ proc wokUtils:FILES:mkdir { d } { } } -# "Nice letter: %s" { a b c } => {Nice letter: %a} {Nice letter: %b} .. -# as a string without backslash -proc wokUtils:EASY:FmtSimple1 { fmt l {backslh 1} } { - foreach e $l { - if { $backslh } { - append str [format $fmt $e] "\n" - } else { - append str [format $fmt $e] - } - } - return $str -} - -# edit_last is performed ONCE fmt has been applied. -proc wokUtils:EASY:FmtString2 { fmt l {yes_for_last 0} {edit_last {}} } { - set ldeb [lrange $l 0 [expr [llength $l] -2]] - set last [lrange $l end end] - foreach e $ldeb { - append str [format $fmt $e $e] " \\" "\n" - } - - if {$edit_last != {} } { - set slast [$edit_last [format $fmt $last $last]] - } else { - set slast [format $fmt $last $last] - } - - if { $yes_for_last } { - append str $slast " \\" "\n" - } else { - append str $slast "\n" - } - - return $str -} - -# { a.x b.c c.v } => { a b c} -proc wokUtils:LIST:sanspoint { l } { - set rr {} - foreach x $l { - lappend rr [file root $x] - } - return $rr -} - # remove from listloc OpenCascade units indesirables on Unix proc osutils:justunix { listloc } { if { "$::tcl_platform(os)" == "Darwin" } { @@ -1932,653 +1840,6 @@ proc osutils:justunix { listloc } { return [osutils:juststation $goaway $listloc] } -# remove ":" from last item of dependencies list in target VPATH of Makefile.am -proc osutils:am:__VPATH__lastoccur { str } { - if { [regsub {:$} $str "" u] != 0 } { - return $u - } -} - -# ((((((((((((( Formats in Makefile.am ))))))))))))) -# Used to replace the string __VPATH__ in Makefile.am -# l is the list of the units in a toolkit. -proc osutils:am:__VPATH__ { l } { - set fmt "@top_srcdir@/src/%s:" - return [wokUtils:EASY:FmtString2 $fmt $l 0 osutils:am:__VPATH__lastoccur] -} - -# Used to replace the string __INCLUDES__ in Makefile.am -# l is the list of packages in a toolkit. -proc osutils:am:__INCLUDES__ { l } { - set fmt "-I@top_srcdir@/src/%s" - return [wokUtils:EASY:FmtString2 $fmt $l] -} - -# Used to replace the string __LIBADD__ in Makefile.am -# l is the toolkit closure list of a toolkit. -proc osutils:am:__LIBADD__ { theIncToolkits {final 0} } { - global path - global fBranch - set aFatherModules "" - set aCurrentWorkBench [file tail $path] - if { $fBranch != "" } { - set fd [open $fBranch/adm/UDLIST rb] - set fileContent [split [read $fd] "\n"] - close $fd - set ftoolkits [lsearch -all -inline $fileContent "t *"] - foreach ft $ftoolkits { - set aFatherModules "$aFatherModules [string range $ft 2 end]" - } - } - set aLibString "" - foreach aIncToolkit $theIncToolkits { - if { [lsearch [split $aFatherModules " "] $aIncToolkit] != -1} { - append aLibString " \\\n-l$aIncToolkit" - } else { - append aLibString " \\\n../$aIncToolkit/lib$aIncToolkit.la" - } - } - return $aLibString -} - -# Used to replace the string __SOURCES__ in Makefile.am -# l is the list of all compilable files in a toolkit. -proc osutils:am:__SOURCES__ { l } { - set fmt "%s" - return [wokUtils:EASY:FmtString1 $fmt $l] -} - -proc osutils:am:__CXXFLAG__ { l } { - set fmt "%s" - return [wokUtils:EASY:FmtString1 $fmt [osutils:am:PkCXXOption $l]] -} - -proc osutils:am:PkCXXOption { ppk } { - global path - #puts "\t 1 [lindex [wokparam -e %CMPLRS_CXX_Options [wokcd]] 0]" - set CXXCOMMON [_get_options lin cmplrs_cxx b] - #puts "\t 2 [wokparam -v %CMPLRS_CXX_Options [w_info -f]]" - #puts "\t 3 [wokparam -v %CMPLRS_CXX_Options]" - set FoundFlag "[lindex [osutils:intersect3 [split [_get_options lin cmplrs_cxx f]] [split [_get_options lin cmplrs_cxx b]] ] 2]" - foreach pk $ppk { - #puts $pk - if {![file isdirectory $path/src/$pk]} { - continue - } - set src_files [_get_used_files $pk false] - set only_src_files {} - foreach s $src_files { - regexp {source ([^\s]+)} $s dummy name - lappend only_src_files $name - } - if {[lsearch $only_src_files ${pk}_CMPLRS.edl] != "-1"} { - set pk_cmplrs_cxx [_get_options lin cmplrs_cxx $pk] - if {$pk_cmplrs_cxx == ""} { - set pk_cmplrs_cxx [_get_options lin cmplrs_cxx b] - } - set CXXStr $pk_cmplrs_cxx - #puts "\t 4 [wokparam -e %CMPLRS_CXX_Options [woklocate -u $pk]] $pk" - set LastIndex [expr {[string length $CXXCOMMON ] - 1}] - if {[string equal $CXXCOMMON [string range $CXXStr 0 $LastIndex]]} { - set CXXOption " " - } else { - set CXXOption [string range $CXXStr 0 [expr {[string last $CXXCOMMON $CXXStr] - 1}]] - } - if {$CXXOption != " " && $CXXOption != "" && $CXXOption != " " && $CXXOption != " "} { - set FoundList [split $CXXOption " "] - foreach elem $FoundList { - if {$elem != ""} { - if {[string first "-I" $elem] == "-1" } { - if {[string first $elem $FoundFlag] == "-1"} { - set FoundFlag "$FoundFlag $elem" - } - } - } - } - } - } - } - return $FoundFlag -} - -# Create in dir the Makefile.am associated with toolkit tkloc. -# Returns the full path of the created file. -proc osutils:tk:mkam { dir tkloc } { - global path - set pkgs $path/src/${tkloc}/PACKAGES - if { ![file exists $pkgs] } { - puts stderr "osutils:tk:mkam : Error. File PACKAGES not found for toolkit $tkloc." - return {} - } - - set tmplat [osutils:readtemplate mam "Makefile.am"] - set lpkgs [osutils:justunix [wokUtils:FILES:FileToList $pkgs]] - set close [wokUtils:LIST:Purge [osutils:tk:close $tkloc]] - set lsrc [lsort [osutils:tk:files $tkloc osutils:compilable 1 osutils:justunix]] - set lobj [wokUtils:LIST:sanspoint $lsrc] - - set lcsf [osutils:tk:csfInExternlib $path/src/${tkloc}/EXTERNLIB] - - set final 0 - set externinc "" - set externlib "" - if { $lcsf != {} } { - set final 1 - set fmtinc "\$(%s_INCLUDES) " - set fmtlib "\$(%s_LIB) " - set externinc [wokUtils:EASY:FmtSimple1 $fmtinc $lcsf 0] - set externlib [wokUtils:EASY:FmtSimple1 $fmtlib $lcsf 0] - } - - regsub -all -- {__TKNAM__} $tmplat $tkloc tmplat - set vpath [osutils:am:__VPATH__ $lpkgs] - regsub -all -- {__VPATH__} $tmplat $vpath tmplat - set inclu [osutils:am:__INCLUDES__ $lpkgs] - regsub -all -- {__INCLUDES__} $tmplat $inclu tmplat - if { $close != {} } { - set libadd [osutils:am:__LIBADD__ $close $final] - } else { - set libadd "" - } - regsub -all -- {__LIBADD__} $tmplat $libadd tmplat - set source [osutils:am:__SOURCES__ $lsrc] - regsub -all -- {__SOURCES__} $tmplat $source tmplat - regsub -all -- {__EXTERNINC__} $tmplat $externinc tmplat - set CXXFl [osutils:am:__CXXFLAG__ $lpkgs] - regsub -all -- {__CXXFLAG__} $tmplat $CXXFl tmplat - set CFl [osutils:am:__CFLAG__ $lpkgs] - regsub -all -- {__CFLAG__} $tmplat $CFl tmplat - - regsub -all -- {__EXTERNLIB__} $tmplat $externlib tmplat - - wokUtils:FILES:StringToFile $tmplat [set fmam [file join $dir Makefile.am]] - return [list $fmam] -} - -# Write a string in a file -proc wokUtils:FILES:StringToFile { str path } { - if { [catch { set out [ open $path w ] } errout] == 0 } { - puts -nonewline $out $str - close $out - return 1 - } else { - return {} - } -} - -# Create in dir the Makefile.am associated with toolkit tkloc. -# Returns the full path of the created file. -proc osutils:tk:mkamx { dir tkloc } { - global path - set src_files [_get_used_files $tkloc false] - set only_src_files {} - foreach s $src_files { - regexp {source ([^\s]+)} $s dummy name - lappend only_src_files $name - } - if { [lsearch $only_src_files ${tkloc}_WOKSteps.edl] != "-1"} { - set pkgs "$path/src/${tkloc}/EXTERNLIB" - if { $pkgs == {} } { - puts stderr "osutils:tk:mkamx : Error. File EXTERNLIB not found for executable $tkloc." - #return {} - } - set tmplat [osutils:readtemplate mamx "Makefile.am (executable)"] - set close [wokUtils:LIST:Purge [osutils:tk:close $tkloc]] - set lsrc [lsort [osutils:tk:files $tkloc osutils:compilable 1 osutils:justunix]] - set lobj [wokUtils:LIST:sanspoint $lsrc] - set CXXList {} - foreach SourceFile $only_src_files { - if {[file extension $SourceFile] == ".cxx"} { - lappend CXXList [file rootname $SourceFile] - } - } - set pkgs [LibToLinkX $tkloc [lindex $CXXList 0]] - set lpkgs [osutils:justunix [wokUtils:FILES:FileToList $pkgs]] - puts "pkgs $pkgs" - #set lcsf [osutils:tk:csfInExternlib [woklocate -p ${tkloc}:source:EXTERNLIB [wokcd]]] - - set lcsf {} - foreach tk $pkgs { - foreach element [osutils:tk:csfInExternlib "$path/src/${tk}/EXTERNLIB"] { - if {[lsearch $lcsf $element] == "-1"} { - set lcsf [concat $lcsf $element] - } - } - } - set final 0 - set externinc "" - set externlib "" - if { $lcsf != {} } { - set final 1 - set fmtinc "\$(%s_INCLUDES) " - set fmtlib "\$(%s_LIB) " - set externinc [wokUtils:EASY:FmtSimple1 $fmtinc $lcsf 0] - set externlib [wokUtils:EASY:FmtSimple1 $fmtlib $lcsf 0] - } - regsub -all -- {__XQTNAM__} $tmplat $tkloc tmplat - set tmplat "$tmplat \nlib_LTLIBRARIES=" - foreach entity $CXXList { - set tmplat "$tmplat lib${entity}.la" - } - set tmplat "$tmplat\n" - set inclu [osutils:am:__INCLUDES__ $lpkgs] - regsub -all -- {__INCLUDES__} $tmplat $inclu tmplat - if { $pkgs != {} } { - set libadd [osutils:am:__LIBADD__ $pkgs $final] - } else { - set libadd "" - } - regsub -all -- {__LIBADD__} $tmplat $libadd tmplat - set source [osutils:am:__SOURCES__ $CXXList] - regsub -all -- {__SOURCES__} $tmplat $source tmplat - regsub -all -- {__EXTERNINC__} $tmplat $externinc tmplat - foreach entity $CXXList { - set tmplat "$tmplat lib${entity}_la_SOURCES = @top_srcdir@/src/${tkloc}/${entity}.cxx \n" - } - foreach entity $CXXList { - set tmplat "$tmplat lib${entity}_la_LIBADD = $libadd $externlib \n" - } - wokUtils:FILES:StringToFile $tmplat [set fmam [file join $dir Makefile.am]] - - unset tmplat - - return [list $fmam] - - } else { - set pkgs "$path/src/${tkloc}/EXTERNLIB" - if { $pkgs == {} } { - puts stderr "osutils:tk:mkamx : Error. File EXTERNLIB not found for executable $tkloc." - #return {} - } - set tmplat [osutils:readtemplate mamx "Makefile.am (executable)"] - set close [wokUtils:LIST:Purge [osutils:tk:close $tkloc]] - set lsrc [lsort [osutils:tk:files $tkloc osutils:compilable 1 osutils:justunix]] - set lobj [wokUtils:LIST:sanspoint $lsrc] - set CXXList {} - foreach SourceFile $only_src_files { - if {[file extension $SourceFile] == ".cxx"} { - lappend CXXList [file rootname $SourceFile] - } - } - set pkgs [LibToLinkX $tkloc [lindex $CXXList 0]] - set lpkgs [osutils:justunix [wokUtils:FILES:FileToList $pkgs]] - set lcsf [osutils:tk:csfInExternlib "$path/src/${tkloc}/EXTERNLIB"] - - set lcsf {} - foreach tk $pkgs { - foreach element [osutils:tk:csfInExternlib "$path/src/${tk}/EXTERNLIB"] { - if {[lsearch $lcsf $element] == "-1"} { - set lcsf [concat $lcsf $element] - } - } - } - set final 0 - set externinc "" - set externlib "" - if { $lcsf != {} } { - set final 1 - set fmtinc "\$(%s_INCLUDES) " - set fmtlib "\$(%s_LIB) " - set externinc [wokUtils:EASY:FmtSimple1 $fmtinc $lcsf 0] - set externlib [wokUtils:EASY:FmtSimple1 $fmtlib $lcsf 0] - } - regsub -all -- {__XQTNAM__} $tmplat $tkloc tmplat - set tmplat "$tmplat \nbin_PROGRAMS=" - foreach entity $CXXList { - set tmplat "${tmplat} ${entity}" - } - - set tmplat "${tmplat}\n" - set inclu [osutils:am:__INCLUDES__ $lpkgs] - regsub -all -- {__INCLUDES__} $tmplat $inclu tmplat - if { $pkgs != {} } { - set libadd [osutils:am:__LIBADD__ $pkgs $final] - } else { - set libadd "" - } - set source [osutils:am:__SOURCES__ $CXXList] - regsub -all -- {__SOURCES__} $tmplat $source tmplat - regsub -all -- {__EXTERNINC__} $tmplat $externinc tmplat - foreach entity $CXXList { - set tmplat "$tmplat ${entity}_SOURCES = @top_srcdir@/src/${tkloc}/${entity}.cxx \n" - } - foreach entity $CXXList { - set tmplat "$tmplat ${entity}_LDADD = $libadd $externlib \n" - } - wokUtils:FILES:StringToFile $tmplat [set fmam [file join $dir Makefile.am]] - - return [list $fmam] - } -} - -# Create in dir the Makefile.am in $dir directory. -# Returns the full path of the created file. -proc osutils:am:adm { dir {lesmodules {}} } { - set amstring "srcdir = @srcdir@\n\n" - set subdirs "SUBDIRS =" - set vpath "VPATH = @srcdir@ ${dir}: " - set make "" - set phony ".PHONY:" - foreach theModule $lesmodules { - set units [osutils:tk:sort [$theModule:toolkits]] - set units [concat $units [OS:executable $theModule]] - append amstring "${theModule}_PKGS =" - append vpath "\\\n" - foreach unit $units { - append amstring " ${unit}" - append vpath "${dir}/${unit}: " - } - set up ${theModule} - if { [info procs ${theModule}:alias] != "" } { - set up [${theModule}:alias] - } - set up [string toupper ${up}] - append amstring "\n\nif ENABLE_${up}\n" - append amstring " ${theModule}_DIRS = \$(${theModule}_PKGS)\n" - append amstring "else\n" - append amstring " ${theModule}_DIRS = \n" - append amstring "endif\n\n" - append subdirs " \$(${theModule}_DIRS)" - append make "${theModule}:\n" - append make "\tfor d in \$(${theModule}_PKGS); do \\\n" - append make "\t\tcd \$\$d; \$(MAKE) \$(AM_MAKEFLAGS) lib\$\$d.la; cd ..; \\\n" - append make "\tdone\n\n" - append phony " ${theModule}" - } - append amstring "$subdirs\n\n" - append amstring "$vpath\n\n" - append amstring $make - append amstring $phony - wokUtils:FILES:StringToFile $amstring [set fmam [file join $dir Makefile.am]] - return [list $fmam] -} - -# retourne la liste de dependances de module. -proc OS:lsdep { m } { - set res {} - set l [${m}:depends] - if { $l != {} } { - set res [concat $res $l] - foreach h $l { - set res [concat $res [OS:lsdep ${h}]] - } - } - return $res -} - -# Create in dir the Makefile.am and configure.ac in CASROOT directory. -# Returns the full path of the created file. -proc osutils:am:root { dir theSubPath {lesmodules {}} } { - global path - set amstring "srcdir = @srcdir@\n\n" - append amstring "SUBDIRS = ${theSubPath}\n\n" - append amstring "VPATH = @srcdir@ @top_srcdir@/${theSubPath}: @top_srcdir@/${theSubPath}:\n\n" - - set phony ".PHONY:" - - set acstring [osutils:readtemplate ac "Makefile.am"] - set enablestr "" - set confstr "" - set condstr "" - set repstr "" - set acconfstr "" - - set exelocal "install-exec-local:\n" - append exelocal "\t" - append exelocal {$(INSTALL) -d $(prefix)/$(platform)} - append exelocal "\n" - foreach d {bin lib} { - append exelocal "\t" - append exelocal "if \[ -e \$(prefix)/${d} -a ! -e \$(prefix)/\$(platform)/${d} \]; then \\\n" - append exelocal "\t\tcd \$(prefix)/\$(platform) && ln -s ../${d} ${d}; \\\n" - append exelocal "\tfi\n" - } - append exelocal "\t" - append exelocal {buildd=`pwd`; cd $(top_srcdir); sourced=`pwd`; cd $(prefix); installd=`pwd`; cd $$buildd;} - append exelocal " \\\n" - append exelocal "\t" - append exelocal {if [ "$$installd" != "$$sourced" ]; then} - append exelocal " \\\n" - append exelocal "\t\t" - append exelocal {$(INSTALL) -d $(prefix)/src;} - append exelocal " \\\n" - append exelocal "\t\t" - append exelocal {cp -frL $(top_srcdir)/src $(prefix);} - append exelocal " \\\n" - append exelocal "\t\t" - append exelocal {cp -frL $$buildd/config.h $(prefix);} - append exelocal " \\\n" - append exelocal "\t\tfor d in " - - foreach theModule $lesmodules { - append amstring "${theModule}_PKGS =" - foreach r [${theModule}:ressources] { - if { "[lindex $r 1]" == "r" } { - append amstring " [lindex $r 2]" - } - } - set up ${theModule} - if { [info procs ${theModule}:alias] != "" } { - set up [${theModule}:alias] - } - set up [string toupper ${up}] - set lower ${theModule} - if { [info procs ${theModule}:alias] != "" } { - set lower [${theModule}:alias] - } - set lower [string tolower ${lower}] - - append amstring "\n\nif ENABLE_${up}\n" - append amstring " ${theModule}_DIRS = \$(${theModule}_PKGS)\n" - append amstring "else\n" - append amstring " ${theModule}_DIRS = \n" - append amstring "endif\n\n" - append amstring "${theModule}:\n" - append amstring "\tcd \$(top_builddir)/${theSubPath} && \$(MAKE) \$(AM_MAKEFLAGS) ${theModule}\n\n" - append phony " ${theModule}" - - append exelocal " \$(${theModule}_DIRS)" - - append enablestr "AC_ARG_ENABLE(\[${lower}\],\n" - append enablestr " \[AS_HELP_STRING(\[--disable-${lower}\],\[Disable ${theModule} components\])\],\n" - append enablestr " \[ENABLE_${up}=\${enableval}\],\[ENABLE_${up}=yes\])\n" - - set deplist [OS:lsdep ${theModule}] - set acdeplist {} - if { [info procs ${theModule}:acdepends] != "" } { - set acdeplist [${theModule}:acdepends] - } - - if { [llength $deplist] > 0 || [llength $acdeplist] > 0} { - append confstr "if test \"xyes\" = \"x\$ENABLE_${up}\"; then\n" - } else { - append confstr "if test \"xyes\" != \"x\$ENABLE_${up}\"; then\n" - } - foreach dep $deplist { - set dup ${dep} - if { [info procs ${dep}:alias] != "" } { - set dup [${dep}:alias] - } - set dup [string toupper ${dup}] - append confstr " if test \"xyes\" = \"x\$ENABLE_${up}\" -a \"xyes\" != \"x\$ENABLE_${dup}\"; then\n" - append confstr " AC_MSG_NOTICE(\[Disabling ${theModule}: not building ${dep} component\])\n" - append confstr " DISABLE_${up}_REASON=\"(${dep} component disabled)\"\n" - append confstr " ENABLE_${up}=no\n" - append confstr " fi\n" - } - foreach dep $acdeplist { - append confstr " if test \"xyes\" = \"x\$ENABLE_${up}\" -a \"xyes\" != \"x\$HAVE_${dep}\"; then\n" - append confstr " AC_MSG_NOTICE(\[Disabling ${theModule}: ${dep} not found\])\n" - append confstr " DISABLE_${up}_REASON=\"(${dep} not found)\"\n" - append confstr " ENABLE_${up}=no\n" - append confstr " fi\n" - } - if { [llength $deplist] > 0 || [llength $acdeplist] > 0 } { - append confstr "else\n" - } - append confstr " DISABLE_${up}_REASON=\"(Disabled)\"\n" - append confstr "fi\n" - - append condstr "AM_CONDITIONAL(\[ENABLE_${up}\], \[test \"xyes\" = \"x\$ENABLE_${up}\"\])\n" - append repstr [format "echo \"%-*s \$ENABLE_${up} \$DISABLE_${up}_REASON\"" 26 ${theModule}] - append repstr "\n" - - set units [$theModule:toolkits] - set units [concat $units [OS:executable $theModule]] - foreach unit $units { - append acconfstr "${theSubPath}/${unit}/Makefile \\\n" - } - } - - append exelocal "; do \\\n" - append exelocal "\t\t\t" - append exelocal {$(INSTALL) -d $(prefix)/src/$$d;} - append exelocal " \\\n" - append exelocal "\t\t\t" - append exelocal {cp -frL $(top_srcdir)/src/$$d $(prefix)/src;} - append exelocal " \\\n" - append exelocal "\t\tdone; \\\n" - append exelocal "\tfi\n" - append exelocal "\t" - append exelocal {if [ -e $(prefix)/src/config.h ]; then} - append exelocal " \\\n" - append exelocal "\t\t" - append exelocal {unlink $(prefix)/src/config.h;} - append exelocal " \\\n" - append exelocal "\tfi\n" - append exelocal "\t" - append exelocal {cd $(prefix)/src && ln -s ../config.h config.h} - append exelocal "\n" - append exelocal "\t" - append exelocal {cd $(top_srcdir) && cp *.sh $(prefix)} - append exelocal "\n" - append exelocal "\n" - - append amstring $exelocal - append amstring $phony - - regsub -all -- {__ENABLEMODULES__} $acstring $enablestr acstring - regsub -all -- {__CONFMODULES__} $acstring $confstr acstring - regsub -all -- {__CONDMODULES__} $acstring $condstr acstring - regsub -all -- {__REPMODULES__} $acstring $repstr acstring - regsub -all -- {__ACCONFMODULES__} $acstring $acconfstr acstring - - wokUtils:FILES:StringToFile $amstring [set fmam [file join $dir Makefile.am]] - wokUtils:FILES:StringToFile $acstring [set fmam [file join $dir configure.ac]] - file copy -force -- [file join $path/adm/templates build_configure] [file join $dir build_configure] - file copy -force -- [file join $path/adm/templates acinclude.m4] [file join $dir acinclude.m4] - file copy -force -- [file join $path/adm/templates custom.sh.in] [file join $dir custom.sh.in] - return [list $fmam] -} - -proc wokUtils:EASY:FmtString1 { fmt l {yes_for_last 0} {edit_last {}} } { - set ldeb [lrange $l 0 [expr [llength $l] -2]] - set last [lrange $l end end] - foreach e $ldeb { - append str [format $fmt $e] " \\" "\n" - } - - if {$edit_last != {} } { - set slast [$edit_last [format $fmt $last]] - } else { - set slast [format $fmt $last] - } - - if { $yes_for_last } { - append str $slast " \\" "\n" - } else { - append str $slast "\n" - } - return $str -} - -# Used to replace the string __CFLAG__ in Makefile.am -# l is the list of all compilable files in a toolkit. -proc osutils:am:__CFLAG__ { l } { - set fmt "%s" - return [wokUtils:EASY:FmtString1 $fmt [osutils:am:PkCOption $l]] -} - -proc osutils:am:PkCOption { ppk } { - global path - #puts "\t\t $ppk" - #puts "\t 5 [lindex [wokparam -e %CMPLRS_C_Options [wokcd]] 0]" - set CCOMMON [_get_options lin cmplrs_c b] - #puts "\t 6 [lindex [wokparam -v %CMPLRS_C_Options [w_info -f]] 0]" - set FoundFlag "[lindex [osutils:intersect3 [split [_get_options lin cmplrs_c f]] [split [_get_options lin cmplrs_c b]]] 2]" - foreach pk $ppk { - if {![file isdirectory $path/src/$pk]} { - continue - } - set src_files [_get_used_files $pk false] - set only_src_files {} - foreach s $src_files { - regexp {source ([^\s]+)} $s dummy name - lappend only_src_files $name - } - if {[lsearch $src_files ${pk}_CMPLRS.edl] != "-1"} { - #puts "\t 7 [lindex [wokparam -e %CMPLRS_C_Options [woklocate -u $pk]] 0] $pk" - set aPkList [split "[_get_options lin cmplrs_c $pk]" " "] - set aCcomList [split "$CCOMMON" " "] - - foreach aPkItem $aPkList { - if { [lsearch aCcomList $aPkItem] != -1 } { - if {[string first "-I" $aPkItem] == "-1" } { - set FoundFlag "$FoundFlag $aPkItem" - } - } - } - } - } - return $FoundFlag -} - -proc osutils:tksrcfiles { theUnits theRelatedPath {theCompatible {}} } { - set aTKSrcFiles [list] - - if [array exists written] { unset written } - foreach anUnit $theUnits { - set xlo $anUnit - set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0] - - if { $theCompatible != {} } { - set aSrcFiles [osutils:tk:files $xlo $theCompatible 0] - } - - foreach aSrcFile [lsort $aSrcFiles] { - if { ![info exists written([file tail $aSrcFile])] } { - set written([file tail $aSrcFile]) 1 - lappend aTKSrcFiles "${theRelatedPath}/[wokUtils:FILES:wtail $aSrcFile 3]" - } else { - puts "Warning : more than one occurences for [file tail $aSrcFile]" - } - } - } - - return $aTKSrcFiles -} - -proc osutils:mm_compilable { } { - return [list .mm] -} - -proc osutils:tkdefs { theUnits } { - set aTKDefines [list] - - foreach anUnit $theUnits { - lappend aTKDefines "__${anUnit}_DLL" - } - - return $aTKDefines -} - -proc osutils:fileGroupName { theSrcFile } { - set path [file dirname [file normalize ${theSrcFile}]] - regsub -all [file normalize "${path}/.."] ${path} "" aGroupName - - return $aGroupName -} - ####### CODEBLOCK ################################################################### # Function to generate Code Blocks workspace and project files diff --git a/adm/templates/acinclude.m4 b/adm/templates/acinclude.m4 deleted file mode 100644 index 0c84f00a8a..0000000000 --- a/adm/templates/acinclude.m4 +++ /dev/null @@ -1,157 +0,0 @@ -#------------------------------------------------------------------------ -# Check for TCL -# Options: --with-tcl= : Specify location of tclConfig.sh -# --without-tcl= : Skip check for TCL, assume not installed -# Defines: -# HAVE_TCL : yes/no -# Everything from tclConfig.sh -#------------------------------------------------------------------------ -AC_DEFUN([SC_TCL_CFG], [ - AC_ARG_WITH(tcl, -AC_HELP_STRING([--with-tcl=PATH],[Directory containing tclConfig.sh]) -AC_HELP_STRING([--without-tcl], [Assume no tcl libraries available]) , - [with_tcl="${withval}";require_tcl=yes],[with_tcl=yes;require_tcl=no]) - - # If user requested disabling of tcl check - if test "xno" = "x$with_tcl"; then - HAVE_TCL=no - require_tcl=no - # Otherwise... - else - HAVE_TCL=no - # Search for tclConfig.sh - if test "xyes" != "x$with_tcl"; then - # If user specified location - . "${with_tcl}/tclConfig.sh" || AC_MSG_ERROR("Cannot read file: ${with_tcl}/tclConfig.sh") - HAVE_TCL=yes - else - # Search for tclConfig.sh in usual spots - tcl_cfg_file= - AC_MSG_CHECKING([for tclConfig.sh]) - for i in /usr /usr/local ${prefix} /opt/sfw /usr/tcltk; do - if test -d $i; then - for j in $i/lib $i/lib/tcl $i/lib/tcl[[8-9]].[[0-9]] $i/lib/itcl; do - if test -r "$j/tclConfig.sh"; then - tcl_cfg_file="$j/tclConfig.sh" - break - fi - done - fi - if test "x" != "x$tcl_cfg_file"; then - break - fi - done - AC_MSG_RESULT("$tcl_cfg_file") - - if test "x" != "x$tcl_cfg_file"; then - . "$tcl_cfg_file" || AC_MSG_ERROR("Cannot read file: $tcl_cfg_file") - HAVE_TCL=yes - - # if TCL_INCLUDE_SPEC wasn't defined, try to define it using TCL_INC_DIR - if test "x" = "x$TCL_INCLUDE_SPEC"; then - inc_path=`expr "x$TCL_INC_DIR" : "x\(.*\)/tcl-private/generic"` - if test "x" != "$inc_path"; then - TCL_INCLUDE_SPEC="-I$inc_path" - elif test "x" != "x$TCL_INC_DIR"; then - TCL_INCLUDE_SPEC="-I$TCL_INC_DIR" - fi - fi - else - HAVE_TCL=no - fi - fi - - # Check for tcl.h - AC_LANG_C - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC" - AC_CHECK_HEADER([tcl.h],[],[HAVE_TCL=no]) - CPPFLAGS="$save_CPPFLAGS" - - if test "xyes" = "x$require_tcl"; then - if test "xno" = "x$HAVE_TCL"; then - AC_MSG_ERROR([TCL not found.]) - fi - fi - fi -]) - - -#------------------------------------------------------------------------ -# Check for Tk -# Options: --with-tk= : Specify location of Tk -# --without-tk= : Skip check for Tk, assume not installed -# Defines: -# HAVE_TK : yes/no -# Everything from tkConfig.sh -#------------------------------------------------------------------------ -AC_DEFUN([SC_TK_CFG], [ - AC_ARG_WITH(tk, -AC_HELP_STRING([--with-tk=PATH],[Directory containing tkConfig.sh]) -AC_HELP_STRING([--without-tk], [Assume no Tk libraries available]) , - [with_tk="${withval}";require_tk=yes],[with_tk=yes;require_tk=no]) - - # If user requested disabling of Tk check - if test "xno" = "x$with_tk"; then - HAVE_TK=no - require_tk=no - # Otherwise... - else - HAVE_TK=no - # Search for tkConfig.sh - if test "xyes" != "x$with_tk"; then - # If user specified location - . "${with_tk}/tkConfig.sh" || AC_MSG_ERROR("Cannot read file: ${with_tk}/tkConfig.sh") - HAVE_TK=yes - else - # Search for tkConfig.sh in usual spots - tk_cfg_file= - AC_MSG_CHECKING([for tkConfig.sh]) - for i in /usr /usr/local ${prefix} /opt/sfw /usr/tcltk; do - if test -d $i; then - for j in $i/lib $i/lib/tk $i/lib/tk[[8-9]].[[0-9]] $i/lib/itcl; do - if test -r "$j/tkConfig.sh"; then - tk_cfg_file="$j/tkConfig.sh" - break - fi - done - fi - if test "x" != "x$tk_cfg_file"; then - break - fi - done - AC_MSG_RESULT("$tk_cfg_file") - - if test "x" != "x$tk_cfg_file"; then - . "$tk_cfg_file" || AC_MSG_ERROR("Cannot read file: $tk_cfg_file") - HAVE_TK=yes - - # if TK_INCLUDE_SPEC wasn't defined, try to define it using TK_INC_DIR - if test "x" = "x$TK_INCLUDE_SPEC"; then - inc_path=`expr "x$TK_INC_DIR" : "x\(.*\)/tk-private/generic"` - if test "x" != "$inc_path"; then - TK_INCLUDE_SPEC="-I$inc_path" - elif test "x" != "x$TK_INC_DIR"; then - TK_INCLUDE_SPEC="-I$TK_INC_DIR" - fi - fi - else - HAVE_TK=no - fi - fi - - # Check for tk.h - AC_LANG_C - HAVE_TK=yes - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC $TK_INCLUDE_SPEC" - AC_CHECK_HEADER([tk.h],[],[HAVE_TK=no]) - CPPFLAGS="$save_CPPFLAGS" - - if test "xyes" = "x$require_tk"; then - if test "xno" = "x$HAVE_TK"; then - AC_MSG_ERROR([Tk not found.]) - fi - fi - fi -]) diff --git a/adm/templates/template.ac b/adm/templates/template.ac deleted file mode 100644 index 4602aa4064..0000000000 --- a/adm/templates/template.ac +++ /dev/null @@ -1,1170 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT([OpenCASCADE], [6.8.0]) -AC_CONFIG_AUX_DIR(make) -AM_INIT_AUTOMAKE([foreign]) -AC_CANONICAL_HOST -dnl AM_CONFIG_SRCDIR(src/Standard/Standard.cxx) - -CFLAGS="$CFLAGS" -CXXFLAGS="$CXXFLAGS" - -AC_PROG_CC - -AM_CONFIG_HEADER(config.h) - -dnl AM_MAINTAINER_MODE - -AC_AIX -AC_ISC_POSIX -AC_C_BIGENDIAN - -AC_DISABLE_STATIC - -dnl Checks for programs. -AM_PROG_LIBTOOL -AC_PROG_CXX -AC_PROG_CC_C_O - -AC_PROG_AWK -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_YACC -AC_PROG_MAKE_SET - -dnl Checks for header files. - -AC_HEADER_STDC -AC_LANG([C]) -AC_MSG_CHECKING([ for C header files ]) -AC_CHECK_HEADERS(dlfcn.h dl.h ieeefp.h time.h sys/time.h pwd.h) -AC_CHECK_HEADERS(sys/statvfs.h sys/vfs.h sys/param.h osfcn.h netdb.h) -AC_CHECK_HEADERS(sys/ioctl.h net/if.h sys/systeminfo.h sys/utsname.h) -AC_CHECK_HEADERS(sysent.h unistd.h sys/unistd.h sys/socket.h) -AC_CHECK_HEADERS(ndir.h sys/ndir.h sys/dir.h signal.h sys/signal.h) -AC_CHECK_HEADERS(sigfpe.h floatingpoint.h sys/machsig.h sys/siginfo.h) -AC_CHECK_HEADERS(malloc.h strings.h sys/stat.h sys/sem.h sys/ipc.h) -AC_CHECK_HEADERS(sys/times.h dirent.h getopt.h sys/vnode.h) - - -AC_LANG([C++]) -AC_MSG_CHECKING([ for C++ header files ]) -AC_CHECK_HEADERS(istream ostream istream fstream ios iomanip iostream ) -AC_CHECK_HEADERS(stream.h strstream.h istream.h ostream.h fstream.h stdlib.h ios.h iostream.h) -AC_CHECK_HEADERS(iomanip.h limits.h values.h float.h) -AC_CHECK_HEADERS(siginfo.h bits/sigset.h bstring.h sys/types.h sys/select.h) -AC_CHECK_HEADERS(X11/extensions/transovl.h X11/extensions/readdisplay.h) -AC_CHECK_HEADERS(X11/extensions/multibuf.h,[],[],[#include ]) -AC_CHECK_HEADERS(sys/filio.h sys/mman.h libc.h) - -#----------------------------------------------------------------------------- -# Posix threads library is required -#----------------------------------------------------------------------------- -AC_CHECK_HEADER([pthread.h],[],[AC_MSG_ERROR([Posix threads required])]) -AC_CHECK_LIB([pthread],[pthread_create],[],[AC_MSG_ERROR([Posix threads required])]) -CSF_ThreadLibs_LIB=-lpthread -AC_SUBST(CSF_ThreadLibs_LIB) - -#----------------------------------------------------------------------------- -# dl library is required -#----------------------------------------------------------------------------- -AC_CHECK_LIB([dl],[dlopen],[],[AC_MSG_ERROR([dl library is required])]) -CSF_SOCKETLibs_LIB=-ldl - -#--------------------------------------------------------------------- -# -# Test for 64-bit platforms -# -# -#--------------------------------------------------------------------- -AC_MSG_CHECKING([if platform is 64-bit]) -AC_TRY_COMPILE( [], - [int array[((int)sizeof(void*))-6];], - [AC_MSG_RESULT([yes]); ARCH=64; case $platform in Linux*) CPPFLAGS="$CPPFLAGS -m64";; esac], - [AC_MSG_RESULT([no]); ARCH=32;] ) -AC_SUBST(ARCH) - -if test "x${CSF_OPT_INC}" != "x"; then - CSF_OPT_INCLUDES= - for c in `echo ${CSF_OPT_INC} | sed 's/:/ /g'`; do - CSF_OPT_INCLUDES="-I$c ${CSF_OPT_INCLUDES}" - done -fi -if test "$ARCH" = "32" -a "x${CSF_OPT_LIB32}" != "x"; then - CSF_OPT_LIB=${CSF_OPT_LIB32} - CSF_OPT_LIBS= - for c in `echo ${CSF_OPT_LIB32} | sed 's/:/ /g'`; do - CSF_OPT_LIBS="-L$c ${CSF_OPT_LIBS}" - done -fi -if test "$ARCH" = "64" -a "x${CSF_OPT_LIB64}" != "x"; then - CSF_OPT_LIB=${CSF_OPT_LIB64} - CSF_OPT_LIBS= - for c in `echo ${CSF_OPT_LIB64} | sed 's/:/ /g'`; do - CSF_OPT_LIBS="-L$c ${CSF_OPT_LIBS}" - done -fi - -AC_SUBST(CSF_OPT_INCLUDES) -AC_SUBST(CSF_OPT_LIBS) - -#------------------------------------------------------------------------------ -# Get Tcl and TK configuration information from tclConfig.sh. -#------------------------------------------------------------------------------ - -SC_TCL_CFG -SC_TK_CFG -HAVE_TCLTK=no -if test "xyes" = "x$HAVE_TCL"; then - if test "xyes" = "x$HAVE_TK"; then - HAVE_TCLTK=yes - CSF_TclLibs_INCLUDES="${TCL_INCLUDE_SPEC}" - CSF_TclTkLibs_INCLUDES="${TK_INCLUDE_SPEC}" - CSF_TclLibs_LIB="${TCL_LIB_SPEC}" - CSF_TclTkLibs_LIB="${TK_LIB_SPEC}" - CSF_OPT_INC="${TCL_PREFIX}/include:${TK_PREFIX}/include:${CSF_OPT_INC}" - CSF_OPT_LIB="${TCL_PREFIX}/lib:${TK_PREFIX}/lib:${CSF_OPT_LIB}" - fi -fi -if test "x${HAVE_TCLTK}" != "xyes"; then - DISABLE_TCLTK_REASON="(tcltk was not found)" -fi -AC_SUBST(TCL_VERSION) -AC_SUBST(TK_VERSION) -AC_SUBST(HAVE_TCLTK) -AC_SUBST(CSF_TclLibs_INCLUDES) -AC_SUBST(CSF_TclTkLibs_INCLUDES) -AC_SUBST(CSF_TclLibs_LIB) -AC_SUBST(CSF_TclTkLibs_LIB) - -platform=`uname -s` - -dnl Make sure CSFDB is defined in CXXFLAGS and CFLAGS -CXXFLAGS="$CXXFLAGS -DCSFDB -DOCC_CONVERT_SIGNALS" -CFLAGS="$CFLAGS -DCSFDB -DOCC_CONVERT_SIGNALS" - -case $platform in - Linux*) CXXFLAGS="$CXXFLAGS -DLIN -DLININTEL -D_GNU_SOURCE=1 -mmmx -msse -msse2 -mfpmath=sse -Wall" - CFLAGS="$CFLAGS -DLIN -DLININTEL -fexceptions -mmmx -msse -msse2 -mfpmath=sse -Wall" - LDFLAGS="$LDFLAGS -lstdc++ -lrt";; - SunOS*) CXXFLAGS="$CXXFLAGS -Usun -DSOLARIS -instances=static" - CFLAGS="$CFLAGS -Usun -DSOLARIS -instances=static" - LDFLAGS="$LDFLAGS -instances=static" - CSF_SOCKETLibs_LIB="-lnsl ${CSF_SOCKETLibs_LIB}";; - OSF1*) CXXFLAGS="$CXXFLAGS -DDECOSF1 -D__USE_STD_IOSTREAM -D_RWSTD_NO_EXCEPTIONS" - CFLAGS="$CFLAGS -std1 -DDECOSF1" - LD=$CXX;; - *) ;; -esac -AC_SUBST(CSF_SOCKETLibs_LIB) - -AC_SUBST(platform) -AC_LANG([C++]) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_SIZE_T -AC_STRUCT_TM - -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_FUNC_MEMCMP -AC_TYPE_SIGNAL -AC_CHECK_FUNCS(gethostname putenv re_comp regcomp strcspn strdup strtol) -AC_CHECK_FUNCS(statfs statvfs) - - -AC_CACHE_CHECK([if it is OK to define stream input and output], -def_cv_ios_ok, -[AC_LANG([C++]) - AC_TRY_COMPILE([#include -static const int input = (ios::in) | (ios::nocreate); -static const int output= (ios::out);], -[return 0;], - def_cv_ios_ok=yes, def_cv_ios_ok=no) -]) -if test "$def_cv_ios_ok" = yes; then - AC_DEFINE(DEF_IOS_OK,,[define if the compiler allows redefinition of stream input and output]) -fi - - -AC_CACHE_CHECK([if class ostream has member function form], -[ostream_cv_form_ok], -[AC_LANG([C++]) - AC_TRY_COMPILE([#include ], -[cout << cout.form("%9.3e", 3.14159627e-4) << endl; -return 0;], - ostream_cv_form_ok=yes, ostream_cv_form_ok=no) -]) -if test "$ostream_cv_form_ok" = yes; then - AC_DEFINE(OSTREAM_FORM_OK,,[define if the class ostream has member function form]) -fi - - -dnl Checks for typedefs, structures, and compiler characteristics. - -# if the following code compiles then the union semun is -# defined in the header - -AC_CACHE_CHECK([if union semun is defined in ], -[semun_cv_defined], -[AC_LANG([C]) -AC_TRY_COMPILE([#include -#include ], -[union semun c;], - semun_cv_defined=yes, semun_cv_defined=no) -]) -if test "$semun_cv_defined" = yes; then - AC_DEFINE(SEMUN_DEFINED,,[define if the union semun is in sys/sem.h]) -fi - -# if the following code compiles then the union semun has -# the member __buf - -if test "$semun_cv_defined" = yes; then - - AC_CACHE_CHECK(if union semun has member __buf, - semun_cv_buf_defined, - [AC_LANG([C]) - AC_TRY_COMPILE([#include ], - [ union semun c; c.__buf = 0;], - semun_cv_buf_defined=yes, semun_cv_buf_defined=no) - ]) - if test "$sumun_buf_defined" = yes; then - AC_DEFINE(SEMUN_BUF_DEFINED,,[define if semun has member __buf]) - fi -fi - - -AC_CACHE_CHECK([if function semop takes a value], -[semop_cv_no_reference], -[AC_LANG([C]) -AC_TRY_COMPILE([#include -static struct sembuf event_flag ;], -[int status; - int *semid; - status = semop(*semid,event_flag,1); -], - semop_cv_no_reference=yes, semop_cv_no_reference=no) -]) -if test "$semop_cv_no_reference" = yes; then - AC_DEFINE(SEMOP_NO_REFERENCE,,[define if the function semop takes a value]) -fi - - -AC_CACHE_CHECK([if function semctl takes a value], -[semctl_cv_no_reference], -[AC_LANG([C]) -AC_TRY_COMPILE([#include -int get_semaphore(semid,event,value) - int *semid, *event, *value; -{ - int status; - status = semctl((*semid),*event,GETVAL,value); - return 0; -} -int *a,*b,*c;], -[if(get_semaphore(a,b,c)) - exit 0;], - semctl_cv_no_reference=yes, semctl_cv_no_reference=no) -]) -if test "$semctl_cv_no_reference" = yes; then - AC_DEFINE(SEMCTL_NO_REFERENCE,,[define if the function semctl takes a value]) -fi - -AC_CHECK_LIB(malloc,mallinfo,[ - AC_DEFINE(HAVE_MALLINFO,,[Define if we have a function called "mallinfo" in -lmalloc.]) - LIBS="$LIBS -lmalloc" -]) - -AC_CHECK_LIB(sunmath,ieee_handler,[ - AC_DEFINE(HAVE_SUNMATH,,[Define if we have a function called "ieee_handler" in -lsunmath.]) - LIBS="$LIBS -lsunmath" -]) - -AC_CHECK_LIB(m,finite,[ - AC_DEFINE(HAVE_FINITE,,[Define if we have a function called "finite" in -lm.]) -]) - -#--------------------------------------------------------------------- -# -# Check for Java Header Files -# -# -#--------------------------------------------------------------------- - -AC_ARG_WITH([java-include], - [AC_HELP_STRING([--with-java-include=DIR],[Location of jni.h])], - [java_include="${withval}"],[java_include=]) -if test "xno" = "x$java_include"; then - # user specified --without-java-include - HAVE_JAVA=no -else - if test "xyes" != "x$java_include" && test "x" != "x$java_include"; then - # user specified some path - - # test user-specified value is a directory - if test ! -d "$java_include"; then - AC_MSG_ERROR([$java_include: Not a directory]) - fi - - # search for jni_md.h (typically in a system-specific subdir) - AC_MSG_CHECKING([for jni_md.h in $java_include]) - extra_java_include= - if test -f "$java_include/jni_md.h"; then - result="$java_include/jni_md.h" - else - result= - for d in "$java_include"/*; do - if test -f "$d/jni_md.h"; then - extra_java_include="-I$d" - result="$d/jni_md.h" - break - fi - done - AC_MSG_RESULT([$result]) - fi - - # put user-specified directory and jni_mh.h directory (if found) - # into CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$java_include $extra_java_include" - fi - - # Now we check for a working jni.h that is version 1.2 or newer. - # Note: This check is done unless user specified --without-java-include - # If --with-java-include wasn't specified, it will check the - # default compiler search path and any paths the user specified - # via CPPFLAGS on the command line. - AC_CHECK_HEADER( [jni.h], [HAVE_JAVA=yes], [HAVE_JAVA=no - AC_MSG_NOTICE("Specify --with-java-include= to enable Java support")] ) - if test "xyes" = "x$HAVE_JAVA"; then - AC_MSG_CHECKING([java JNI version >= 1.2]) - AC_TRY_COMPILE( [#include ], - [#ifndef JNI_VERSION_1_2 - choke me - #endif], [HAVE_JAVA=yes],[HAVE_JAVA=no] ) - AC_MSG_RESULT([$HAVE_JAVA]) - fi - - # If user specified --with-java-include, fail if not found - # (If user didn't specify, then we gracefully disable things that - # require java.) - if test "x" != "x$java_include" && test "xyes" != "x$HAVE_JAVA"; then - AC_MSG_ERROR([working jni.h not found]) - fi -fi - -CFLAGS_save="$CFLAGS" -CXXFLAGS_save="$CXXFLAGS" -CPPFLAGS_save="$CPPFLAGS" -LDFLAGS_save="$LDFLAGS" -LIBS_save="$LIBS" - -#--------------------------------------------------------------------- -# -# Configure X11 and check for utility library -# -#--------------------------------------------------------------------- -AC_LANG([C]) - -AC_PATH_X -HAVE_X11=no -X_INCLUDE="" -X_LIBS="" -CSF_XmuLibs_INCLUDES="" -CSF_XmuLibs_LIB="" -if test "xyes" != "x$no_x"; then - HAVE_X11=yes - if test "x" != "x$x_includes"; then - X_INCLUDE="-I$x_includes" - CSF_XmuLibs_INCLUDES="$X_INCLUDE" - CXXFLAGS="$CXXFLAGS -I$x_includes" - fi - if test "x" != "x$x_libraries"; then - X_LIBS="-L$x_libraries" - CSF_XmuLibs_LIB="$X_LIBS" - LDFLAGS="$LDFLAGS -L$x_libraries" - fi - AC_CHECK_LIB( [X11], [XCreateWindow], [X_LIBS="${X_LIBS} -lXt -lX11"], [HAVE_X11=no] ) - AC_CHECK_HEADER( [X11/Xmu/Xmu.h], [], [HAVE_X11=no] ) - AC_CHECK_LIB( [Xmu], [XmuLookupStandardColormap], [CSF_XmuLibs_LIB="$CSF_XmuLibs_LIB -lXmu"], [HAVE_X11=no], [-lXt -lX11] ) -fi - -#--------------------------------------------------------------------- -# -# Check for OpenGL Libraries -# -# -#--------------------------------------------------------------------- -CSF_OpenGlLibs_INCLUDES="$X_INCLUDE" -CSF_OpenGlLibs_LIB="$X_LIBS" -if test "xno" = "x$HAVE_X11"; then - HAVE_GL=no -else -AC_LANG([C]) - HAVE_GL=yes - HAVE_GL_INC=yes - AC_CHECK_HEADER( [GL/gl.h], [AC_CHECK_HEADER([GL/glu.h],[],[HAVE_GL_INC=no])], [HAVE_GL_INC=no] ) - if test "x$HAVE_GL_INC" = "xyes"; then - AC_CHECK_TYPE(_GLUfuncptr,[],[CSF_OpenGlLibs_INCLUDES="$CSF_OpenGlLibs_INCLUDES -DNOGLUfuncptr=1"],[#include "GL/glu.h"]) - else - HAVE_GL=no - AC_MSG_NOTICE("Specify CPPFLAGS=-I to enable OpenGL support") - fi - CPPFLAGS="$CSF_OpenGlLibs_INCLUDES $CPPFLAGS" - HAVE_GL_LIB=yes - AC_CHECK_LIB( [GL], [glClear], [AC_CHECK_LIB([GLU],[gluSphere],[CSF_OpenGlLibs_LIB="$CSF_OpenGlLibs_LIB -lGLU -lGL"],[HAVE_GL_LIB=no],[-lGL])], [HAVE_GL_LIB=no] ) - if test "xno" = "x$HAVE_GL_LIB"; then - HAVE_GL=no - AC_MSG_NOTICE("Specify LDFLAGS=-L to enable OpenGL support") - fi -fi -AM_CONDITIONAL( HAVE_GL, [test "xyes" = "x$HAVE_GL"] ) - -#--------------------------------------------------------------------- -# -# Check for FREETYPE Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([freetype], - [AC_HELP_STRING([--with-freetype=DIR],[Location of FREETYPE])], - [freetype="${withval}"],[freetype=yes]) - -CSF_FREETYPE_INCLUDES="" -CSF_FREETYPE_LIB="" -HAVE_FREETYPE=no - -if test "xyes" = "x${HAVE_GL}"; then - AC_LANG([C++]) - if test "xno" = "x${freetype}"; then - dnl freetype check is explicitly disabled by --without-freetype or --with-freetype=no - AC_MSG_NOTICE([freetype check is explicitly disabled]) - DISABLE_FREETYPE_REASON="(freetype check was explicitly disabled)" - else - if test "xyes" = "x${freetype}" -o "x/usr" = "x${freetype}"; then - dnl try native freetype (default) - AC_MSG_NOTICE(try system freetype) - FREETYPE_INCLUDES="-I/usr/include/freetype2" - FREETYPE_LIBS="-lfreetype" - FREETYPE_OPT_INC="/usr/include/freetype2" - FREETYPE_OPT_LIB= - else - AC_MSG_NOTICE(try freetype in $freetype) - if test ! -d ${freetype}; then - DISABLE_FREETYPE_REASON="(${freetype} directory does not exists)" - AC_MSG_ERROR([${freetype} directory does not exists]) - fi - FREETYPE_INCLUDES="-I${freetype}/include -I${freetype}/include/freetype2" - FREETYPE_LIBS="-L${freetype}/lib -lfreetype" - FREETYPE_OPT_INC="${freetype}/include:${freetype}/include/freetype2" - FREETYPE_OPT_LIB="${freetype}/lib" - fi - CPPFLAGS_old=${CPPFLAGS} - LDFLAGS_old=${LDFLAGS} - CPPFLAGS="${FREETYPE_INCLUDES} $CPPFLAGS" - LDFLAGS="${FREETYPE_LIBS} $LDFLAGS" - AC_CHECK_HEADER( [ft2build.h], [HAVE_FREETYPE_INC=yes], [HAVE_FREETYPE_INC=no] ) - if test "x${HAVE_FREETYPE_INC}" = "xyes"; then - AC_CHECK_LIB(freetype, FT_Init_FreeType, - [ - HAVE_FREETYPE=yes - CSF_FREETYPE_INCLUDES="${FREETYPE_INCLUDES}" - CSF_FREETYPE_LIB="${FREETYPE_LIBS}" - LIBS="$CSF_FREETYPE_LIB $LIBS" - CSF_OPT_INC="${FREETYPE_OPT_INC}:${CSF_OPT_INC}" - CSF_OPT_LIB="${FREETYPE_OPT_LIB}:${CSF_OPT_LIB}" - ], - [ - DISABLE_FREETYPE_REASON="(freetype was not found)" - AC_MSG_ERROR([Unable to locate the required FreeType library]) - ]) - else - DISABLE_FREETYPE_REASON="(freetype was not found)" - fi - CPPFLAGS=${CPPFLAGS_old} - LDFLAGS=${LDFLAGS_old} - fi -else - DISABLE_FREETYPE_REASON="(freetype requires OpenGL support)" -fi -AM_CONDITIONAL( HAVE_FREETYPE, [test "xyes" = "x$HAVE_FREETYPE"] ) - -#--------------------------------------------------------------------- -# -# Check for FTGL Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([ftgl], - [AC_HELP_STRING([--with-ftgl=DIR],[Location of FTGL])], - [ftgl="${withval}"],[ftgl=yes]) - -CSF_FTGL_INCLUDES="" -CSF_FTGL_LIB="" -HAVE_FTGL=no - -if test "xno" = "x${HAVE_FREETYPE}"; then - DISABLE_FTGL_REASON=$DISABLE_FREETYPE_REASON -else - AC_LANG([C++]) - if test "xno" = "x${ftgl}"; then - dnl ftgl check is explicitly disabled by --without-ftgl or --with-ftgl=no - AC_MSG_NOTICE([ftgl check is explicitly disabled]) - DISABLE_FTGL_REASON="(ftgl check was explicitly disabled)" - else - if test "xyes" = "x${ftgl}" -o "x/usr" = "x${ftgl}"; then - dnl try native ftgl (default) - ftgl=/usr - AC_MSG_NOTICE(try system ftgl) - FTGL_INCLUDES="-I/usr/include/FTGL" - FTGL_LIBS="-lftgl" - FTGL_OPT_INC="/usr/include/FTGL" - FTGL_OPT_LIB= - else - AC_MSG_NOTICE(try ftgl in ${ftgl}) - if test ! -d ${ftgl}; then - DISABLE_FTGL_REASON="(${ftgl} directory does not exists)" - AC_MSG_ERROR([${ftgl} directory does not exists]) - fi - FTGL_INCLUDES="-I${ftgl}/include -I${ftgl}/include/FTGL" - FTGL_LIBS="-L${ftgl}/lib -lftgl" - FTGL_OPT_INC="${ftgl}/include:${ftgl}/include/FTGL" - FTGL_OPT_LIB="${ftgl}/lib" - fi - for hf in ftgl.h FTGL.h; do - dnl check presence of ftgl header file in the specified directory - test -f ${ftgl}/include/FTGL/${hf} -o -f ${ftgl}/include/${hf} && HAVE_FTGL_INC=yes - test "xyes" = "x${HAVE_FTGL_INC}" -a "${hf}" = "FTGL.h" && HAVE_FTGL_UPPERCASE=-DHAVE_FTGL_UPPERCASE - test "xyes" = "x${HAVE_FTGL_INC}" && break - done - if test "xyes" = "x${HAVE_FTGL_INC}" ; then - CPPFLAGS_old=${CPPFLAGS} - LDFLAGS_old=${LDFLAGS} - CPPFLAGS="${FTGL_INCLUDES} ${HAVE_FTGL_UPPERCASE} ${CSF_FREETYPE_INCLUDES} $CPPFLAGS" - LDFLAGS="${FTGL_LIBS} ${CSF_FREETYPE_LIB} $LDFLAGS" - AC_CHECK_HEADERS([${hf}], - [ - HAVE_FTGL_INC=yes - break - ], - [ - HAVE_FTGL_INC=no - ]) - if test "x${HAVE_FTGL_INC}" = "xyes"; then - AC_MSG_CHECKING([for FTGLTextureFont in -lftgl]) - CPPFLAGS="${FTGL_INCLUDES} ${HAVE_FTGL_UPPERCASE} ${CSF_FREETYPE_INCLUDES} ${CPPFLAGS_old}" - AC_TRY_LINK( - [ - #ifdef HAVE_FTGL_UPPERCASE - #include - #include - #else - #include - #endif - ], - [ - FTGLTextureFont font(""); - ], - [ - AC_MSG_RESULT(yes) - HAVE_FTGL=yes - CSF_FTGL_INCLUDES="${FTGL_INCLUDES} ${HAVE_FTGL_UPPERCASE}" - CSF_FTGL_LIB="${FTGL_LIBS}" - CSF_OPT_INC="${FTGL_OPT_INC}:${CSF_OPT_INC}" - CSF_OPT_LIB="${FTGL_OPT_LIB}:${CSF_OPT_LIB}" - ], - [ - AC_MSG_RESULT(no) - DISABLE_FTGL_REASON="(ftgl was not found)" - AC_MSG_ERROR([Unable to locate the required ftgl library]) - ]) - else - DISABLE_FTGL_REASON="(ftgl was not found)" - fi - CPPFLAGS=${CPPFLAGS_old} - LDFLAGS=${LDFLAGS_old} - else - AC_MSG_RESULT([ftgl was not found]) - DISABLE_FTGL_REASON="(ftgl was not found)" - fi - fi -fi -AM_CONDITIONAL( HAVE_FTGL, [test "xyes" = "x$HAVE_FTGL"] ) - -#--------------------------------------------------------------------- -# -# Check for GL2PS Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([gl2ps], - [AC_HELP_STRING([--with-gl2ps=DIR],[Location of GL2PS])], - [gl2ps="${withval}"],[gl2ps=]) - -if test "xno" = "xno$gl2ps"; then -# user specified --without-gl2ps - HAVE_GL2PS=no - DISABLE_GL2PS_REASON="(--with-gl2ps=DIR option was not defined)" -else - CSF_GL2PS_INCLUDES="" - CSF_GL2PS_LIB="" - - if test "xno" = "x$HAVE_GL"; then - HAVE_GL2PS=no - DISABLE_GL2PS_REASON="(OpenGL was not found)" - else - AC_LANG([C++]) - HAVE_GL2PS=no - HAVE_GL2PS_INC=no - CPPFLAGS="-I$gl2ps/include $CPPFLAGS"; - AC_CHECK_HEADER( [gl2ps.h], [HAVE_GL2PS_INC=yes], [HAVE_GL2PS_INC=no] ) - if test ! -d $gl2ps; then - DISABLE_GL2PS_REASON="($gl2ps directory is not exists)" - AC_MSG_ERROR([$gl2ps directory is not exists]) - elif test "x$HAVE_GL2PS_INC" = "xyes"; then - CSF_GL2PS_INCLUDES="" - CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$gl2ps/include -DHAVE_GL2PS" - HAVE_GL2PS_LIB=yes - AC_MSG_CHECKING([for gl2psEndPage in -lgl2ps]) - LDFLAGS="-L$gl2ps/lib $LDFLAGS" - LIBS="$CSF_OpenGlLibs_LIB $LIBS" - AC_CHECK_LIB( [gl2ps], [gl2psEndPage], - [ - CSF_GL2PS_LIB="-L$gl2ps/lib -lgl2ps" - CSF_OPT_INC="$gl2ps/include:${CSF_OPT_INC}" - CSF_OPT_LIB="$gl2ps/lib:${CSF_OPT_LIB}" - HAVE_GL2PS_LIB=yes - ], - [ - HAVE_GL2PS_LIB=no - ]) - fi - if test "xyes" = "x$HAVE_GL2PS_LIB"; then - HAVE_GL2PS=yes - else - HAVE_GL2PS=no - DISABLE_GL2PS_REASON="(gl2ps was not found)" - fi - fi -fi -AM_CONDITIONAL( HAVE_GL2PS, [test "xyes" = "x$HAVE_GL2PS"] ) - -#--------------------------------------------------------------------- -# -# Check for FREEIMAGE Libraries and Includes -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([freeimage], - [AC_HELP_STRING([--with-freeimage=DIR],[Location of freeimage])], - [freeimage="${withval}"],[freeimage=]) - -if test "xno" = "xno$freeimage"; then - # user specified --without-freeimage - HAVE_FREEIMAGE=no - DISABLE_FREEIMAGE_REASON="(--with-freeimage=DIR option was not defined)" -else - CSF_FreeImagePlus_INCLUDES="" - CSF_FreeImagePlus_LIB="" - - AC_LANG([C++]) - HAVE_FREEIMAGE=no - HAVE_FREEIMAGE_INC=yes - CPPFLAGS="-I$freeimage/include $CPPFLAGS"; - AC_CHECK_HEADER( [FreeImage.h], [], [HAVE_FREEIMAGE_INC=no] ) - if test ! -d $freeimage; then - DISABLE_FREEIMAGE_REASON="($freeimage directory is not exists)" - AC_MSG_ERROR([$freeimage directory is not exists]) - elif test "x$HAVE_FREEIMAGE_INC" = "xyes"; then - CSF_FreeImagePlus_INCLUDES="" - CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$freeimage/include -DHAVE_FREEIMAGE" - HAVE_FREEIMAGE_LIB=yes - AC_MSG_CHECKING([for FreeImage_OpenMemory in -lfreeimageplus]) - LDFLAGS="-L$freeimage/lib $LDFLAGS" - LIBS="$CSF_FreeImagePlus_LIB $LIBS" - AC_CHECK_LIB( [freeimageplus], [FreeImage_OpenMemory], - [ - HAVE_FREEIMAGE_LIB=yes; - CSF_OPT_INC="$freeimage/include:${CSF_OPT_INC}" - CSF_OPT_LIB="$freeimage/lib:${CSF_OPT_LIB}" - CSF_FreeImagePlus_LIB="-L$freeimage/lib -lfreeimageplus" - ], [HAVE_FREEIMAGE_LIB=no] ) - fi - if test "xyes" = "x$HAVE_FREEIMAGE_LIB"; then - HAVE_FREEIMAGE=yes - else - HAVE_FREEIMAGE=no - DISABLE_FREEIMAGE_REASON="(freeimage was not found)" - fi -fi -AM_CONDITIONAL( HAVE_FREEIMAGE, [test "xyes" = "x$HAVE_FREEIMAGE"] ) - -#--------------------------------------------------------------------- -# -# Check for TBB Includes -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([tbb-include], - [AC_HELP_STRING([--with-tbb-include=DIR],[Location of Intel Threading Building Blocks includes])], - [tbb_inc="${withval}"],[tbb_inc=]) - -if test "xno" = "xno$tbb_inc"; then - # user specified --without-tbb-lib - HAVE_TBB=no - HAVE_TBB_INC=no - DISABLE_TBB_REASON_INC="(--with-tbb-include=DIR option was not defined)" -else - CSF_TBB_INCLUDES="" - AC_LANG([C++]) - HAVE_TBB_INC=yes - if test ! -d $tbb_inc; then - DISABLE_TBB_REASON_INC="($tbb_inc directory is not exists)" - AC_MSG_ERROR([$tbb_inc directory is not exists]) - elif test "x$tbb_inc" != "x"; then - CPPFLAGS="-I$tbb_inc $CPPFLAGS"; - else - AC_MSG_NOTICE("--with-tbb-include key is not defined") - fi - AC_CHECK_HEADER( [tbb/tbb.h], [], [HAVE_TBB_INC=no] ) - if test "x$HAVE_TBB_INC" != "xyes"; then - AC_MSG_NOTICE("Specify --with-tbb-include to enable TBB support") - DISABLE_TBB_REASON_INC="(tbb includes were not found)" - fi -fi - -#--------------------------------------------------------------------- -# -# Check for OpenCL SDK Includes -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([opencl-include], - [AC_HELP_STRING([--with-opencl-include=DIR],[Location of OpenCL SDK includes])], - [opencl_inc="${withval}"],[opencl_inc=]) - -if test "xno" = "xno$opencl_inc"; then - # user specified --without-opencl-lib - HAVE_OPENCL=no - HAVE_OPENCL_INC=no - DISABLE_OPENCL_REASON_INC="(--with-opencl-include=DIR option was not defined)" -else - CSF_OPENCL_INCLUDES="" - AC_LANG([C++]) - HAVE_OPENCL_INC=yes - if test ! -d $opencl_inc; then - DISABLE_OPENCL_REASON_INC="($opencl_inc directory is not exists)" - AC_MSG_ERROR([$opencl_inc directory is not exists]) - elif test "x$opencl_inc" != "x"; then - CPPFLAGS="-I$opencl_inc $CPPFLAGS"; - else - AC_MSG_NOTICE("--with-opencl-include key is not defined") - fi - # TODO: Add MacOS X specific header check - AC_CHECK_HEADER( [CL/cl.h], [], [HAVE_OPENCL_INC=no] ) - if test "x$HAVE_OPENCL_INC" != "xyes"; then - AC_MSG_NOTICE("Specify --with-opencl-include to enable OpenCL support") - DISABLE_OPENCL_REASON_INC="(OpenCL includes were not found)" - fi -fi - -#--------------------------------------------------------------------- -# -# Check for VTK Includes -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([vtk-include], - [AC_HELP_STRING([--with-vtk-include=DIR],[Location of VTK includes])], - [vtk_inc="${withval}"],[vtk_inc=]) - -if test "xno$vtk_inc" = "xno"; then - # user specified --without-vtk-lib - HAVE_VTK_INC=no - DISABLE_VTK_REASON="(--with-vtk-include=DIR option was not defined)" -else - CSF_VTK_INCLUDES="" - AC_LANG([C++]) - HAVE_VTK_INC=yes - if test ! -d $vtk_inc; then - DISABLE_VTK_REASON="($vtk_inc directory does not exists)" - AC_MSG_ERROR([$vtk_inc directory does not exists]) - elif test ! -f $vtk_inc/vtkVersion.h; then - DISABLE_VTK_REASON="(vtk headers are not found in $vtk_inc)" - AC_MSG_ERROR([vtk headers are not found in $vtk_inc]) - elif test "x$vtk_inc" != "x"; then - CPPFLAGS="-I$vtk_inc $CPPFLAGS"; - else - HAVE_VTK_INC=no - DISABLE_VTK_REASON="(--with-vtk-include=DIR option was not defined)" - AC_MSG_NOTICE("--with-vtk-include=DIR option was not defined") - fi -fi - -#--------------------------------------------------------------------- -# -# Check for TBB Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([tbb-library], - [AC_HELP_STRING([--with-tbb-library=DIR],[Location of Intel Threading Building Blocks libraries])], - [tbb_lib="${withval}"],[tbb_lib=]) - -if test "xno" = "xno$tbb_lib"; then - # user specified --without-tbb - HAVE_TBB=no - DISABLE_TBB_REASON_LIB="(--with-tbb-library=DIR option was not defined)" -else - CSF_TBB_LIB="" - HAVE_TBB=yes - - if test "x$HAVE_TBB_INC" = "xyes"; then - if test ! -d $tbb_lib; then - DISABLE_TBB_REASON_LIB="($tbb_lib directory is not exists)" - AC_MSG_ERROR([$tbb_lib directory is not exists]) - elif test "x$tbb_lib" != "x"; then - LDFLAGS="-L$tbb_lib $LDFLAGS" - fi - AC_CHECK_LIB([tbb], [TBB_runtime_interface_version], [], [HAVE_TBB=no]) - else - HAVE_TBB=no - fi - - if test "x$HAVE_TBB" = "xyes"; then - if test "x$tbb_inc" != "x"; then - CSF_TBB_INCLUDES="" - CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$tbb_inc -DHAVE_TBB" - else - HAVE_TBB=no - fi - if test "x$tbb_lib" != "x"; then - if test "x$enable_debug" = "xyes"; then - CSF_TBB_LIB="-L$tbb_lib -ltbb_debug -ltbbmalloc_debug" - else - CSF_TBB_LIB="-L$tbb_lib -ltbb -ltbbmalloc" - fi - else - HAVE_TBB=no - fi - if test "x$HAVE_TBB" = "xyes"; then - CSF_OPT_INC="$tbb_inc:${CSF_OPT_INC}" - CSF_OPT_LIB="$tbb_lib:${CSF_OPT_LIB}" - else - DISABLE_TBB_REASON="(tbb was not found)"; - fi - else - AC_MSG_NOTICE("Specify --with-tbb-library to enable TBB support") - DISABLE_TBB_REASON_LIB="(tbb libraries were not found)" - fi -fi - -AM_CONDITIONAL( HAVE_TBB, [test "xyes" = "x$HAVE_TBB"] ) - -#--------------------------------------------------------------------- -# -# Check for OpenCL SDK Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([opencl-library], - [AC_HELP_STRING([--with-opencl-library=DIR],[Location of OpenCL SDK libraries])], - [opencl_lib="${withval}"],[opencl_lib=]) - -if test "xno" = "xno$opencl_lib"; then - # user specified --without-opencl - HAVE_OPENCL=no - DISABLE_OPENCL_REASON_LIB="(--with-opencl-library=DIR option was not defined)" -else - CSF_OPENCL_LIB="" - HAVE_OPENCL=yes - - if test "x$HAVE_OPENCL_INC" = "xyes"; then - if test ! -d $opencl_lib; then - DISABLE_OPENCL_REASON_LIB="($opencl_lib directory is not exists)" - AC_MSG_ERROR([$opencl_lib directory is not exists]) - elif test "x$opencl_lib" != "x"; then - LDFLAGS="-L$opencl_lib $LDFLAGS" - fi - AC_CHECK_LIB(OpenCL, [clGetPlatformInfo], [], [HAVE_OPENCL=no]) - else - HAVE_OPENCL=no - fi - - if test "x$HAVE_OPENCL" = "xyes"; then - if test "x$opencl_inc" != "x"; then - CSF_OPENCL_INCLUDES="" - CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$opencl_inc -DHAVE_OPENCL" - else - HAVE_OPENCL=no - fi - if test "x$opencl_lib" != "x"; then - CSF_OPENCL_LIB="-L$opencl_lib -lOpenCL" - else - HAVE_OPENCL=no - fi - - if test "x$HAVE_OPENCL" = "xyes"; then - CSF_OPT_INC="$opencl_inc:${CSF_OPT_INC}" - CSF_OPT_LIB="$opencl_lib:${CSF_OPT_LIB}" - else - DISABLE_OPENCL_REASON="(OpenCL was not found)"; - fi - else - AC_MSG_NOTICE("Specify --with-opencl-library to enable OpenCL support") - DISABLE_OPENCL_REASON_LIB="(OpenCL libraries were not found)" - fi -fi - -AM_CONDITIONAL( HAVE_OPENCL, [test "xyes" = "x$HAVE_OPENCL"] ) - -#--------------------------------------------------------------------- -# -# Check for QT Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([qt], - [AC_HELP_STRING([--with-qt=QTDIR],[Location of QT])], - [qt="${withval}"],[qt=]) - -if test "xno" = "xno$qt"; then -# user specified --without-qt - HAVE_QT=no - DISABLE_QT_REASON="(--with-qt=DIR option was not defined)" -else - CSF_QT_INCLUDES="" - CSF_QT_LIB="" - - if test "xno" = "x$HAVE_GL"; then - HAVE_QT=no - DISABLE_QT_REASON="(OpenGL was not found)" - else - AC_LANG([C++]) - HAVE_QT=no - HAVE_QT_INC=no - CPPFLAGS="-I$qt/include/QtGui -I$qt/include/QtCore -I$qt/include/Qt -I$qt/include $CPPFLAGS" - AC_CHECK_HEADER( [Qt/qpixmap.h], [HAVE_QT_INC=yes], [HAVE_QT_INC=no] ) - if test ! -d $qt; then - DISABLE_QT_REASON="($qt directory is not exists)" - AC_MSG_ERROR([$qt directory is not exists]) - elif test "x$HAVE_QT_INC" = "xyes"; then - CSF_QT_INCLUDES="-I$qt/include/QtGui -I$qt/include/QtCore -I$qt/include/Qt -I$qt/include" - HAVE_QT_LIB=yes - AC_MSG_CHECKING([for connect in -lQtGui]) - LDFLAGS="-L$qt/lib $LDFLAGS" - LIBS="$CSF_OpenGlLibs_LIB $LIBS" - AC_CHECK_LIB( [QtGui], [connect], - [ - CSF_QT_LIB="-L$qt/lib -lQtGui -lQtCore" - CSF_OPT_INC="$qt/include/QtGui:$qt/include/QtCore:$qt/include/Qt:$qt/include:${CSF_OPT_INC}" - CSF_OPT_LIB="$qt/lib:${CSF_OPT_LIB}" - HAVE_QT_LIB=yes - ], - [ - HAVE_QT_LIB=no - ]) - fi - if test "xyes" = "x$HAVE_QT_LIB"; then - HAVE_QT=yes - else - HAVE_QT=no - DISABLE_QT_REASON="(qt was not found)" - fi - fi -fi -AM_CONDITIONAL( HAVE_QT, [test "xyes" = "x$HAVE_QT"] ) - -AC_LANG([C]) - -CFLAGS="$CFLAGS_save" -CXXFLAGS="$CXXFLAGS_save" -CPPFLAGS="$CPPFLAGS_save" -LDFLAGS="$LDFLAGS_save" -LIBS="$LIBS_save" - -AC_ARG_ENABLE([debug], - [AC_HELP_STRING([--enable-debug],[Debug Symbols])], - [enable_debug=${enableval}],[enable_debug=no]) -AC_ARG_ENABLE([production], - [AC_HELP_STRING([--enable-production],[Optimized build (default)])], - [enable_prod=${enableval}],[enable_prod=]) - -# Enable production unless enable-default was specified -if test "x$enable_prod" = "x"; then - if test "x$enable_debug" != "xyes"; then - enable_prod=yes - fi -fi - -if test "x$enable_prod" = "xyes"; then - CFLAGS="$CFLAGS -O2" - CXXFLAGS="$CXXFLAGS -O2" -fi -if test "x$enable_debug" = "xyes"; then - CFLAGS="$CFLAGS -g" - CXXFLAGS="$CXXFLAGS -g" - CPPFLAGS="$CPPFLAGS -DDEB -D_DEBUG" -else - CPPFLAGS="$CPPFLAGS -DNDEBUG -DNo_Exception" -fi - -#--------------------------------------------------------------------- -# -# Check for VTK Libraries -# -# -#--------------------------------------------------------------------- -AC_ARG_WITH([vtk-library], - [AC_HELP_STRING([--with-vtk-library=DIR],[Location of VTK libraries])], - [vtk_lib="${withval}"],[vtk_lib=]) - -if test "xno" = "xno$vtk_lib"; then -# user specified --without-vtk - HAVE_VTK=no - if test "x$DISABLE_VTK_REASON" = "x" ; then - DISABLE_VTK_REASON="(--with-vtk-library=DIR option was not defined)" - fi -else - CSF_VTK_LIB="" - HAVE_VTK=yes - - #CPP_FLAGS="-I$vtk $CPPFLAGS" - #AC_CHECK_HEADER( [Vtk/vtkConfigure.h], [HAVE_VTK_INC=yes], [HAVE_VTK_INC=no] ) - if test "x$HAVE_VTK_INC" = "xyes"; then - if test ! -d $vtk_lib; then - DISABLE_VTK_REASON="($vtk_lib directory does not exist)" - AC_MSG_ERROR([$vtk_lib directory does not exist]) - elif test ! -f $vtk_lib/libvtkCommonCore-6.1.so; then - DISABLE_VTK_REASON="(vtk libraries are not found in $vtk_lib)" - AC_MSG_ERROR([vtk libraries are not found in $vtk_lib]) - elif test "x$vtk_lib" != "x" -a "x$vtk_inc" != "x"; then - CSF_VTK_LIB="-L$vtk_lib -lvtkCommonCore-6.1 -lvtkCommonDataModel-6.1 -lvtkCommonExecutionModel-6.1 -lvtkCommonMath-6.1 -lvtkCommonTransforms-6.1 " - CSF_VTK_LIB="${CSF_VTK_LIB} -lvtkRenderingCore-6.1 -lvtkRenderingOpenGL-6.1 -lvtkFiltersGeneral-6.1 -lvtkIOCore-6.1 -lvtkIOImage-6.1 -lvtkImagingCore-6.1 -lvtkInteractionStyle-6.1 " - CSF_OPT_INC="$vtk_inc:${CSF_OPT_INC}" - CSF_OPT_LIB="$vtk_lib:${CSF_OPT_LIB}" - CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$vtk_inc -DHAVE_VTK" - else - HAVE_VTK=no - AC_MSG_NOTICE("--with-vtk-library=DIR option was not defined") - DISABLE_VTK_REASON="(--with-vtk-library=DIR option was not defined)" - fi - else - HAVE_VTK=no - fi -fi - -#CSF_VTK="$CSF_VTK_LIB" -AM_CONDITIONAL( HAVE_VTK, [test "xyes" = "x$HAVE_VTK"] ) - -#---------------------------------------------------------------------- -# -# Enalbe/Disable Modules -# -#---------------------------------------------------------------------- -__ENABLEMODULES__ -# Process options from above. The behavior we want is: -# -# ENABLE_X = yes : User specified --enable-x -# print informative error and exit if it cannot be built -# -# ENABLE_X = no : User specified --disable-x (or --enable-x=no) -# silently disable building of component -# -# ENABLE_X = : User didn't specify either way -# Build if possible. Warn if it cannot be build -# because of some missing system requirement. Inform -# if disabled because some other required component -# was disabled. -__CONFMODULES__ -# Convert to automake conditional values -__CONDMODULES__ -#---------------------------------------------------------------------- -# -# Write Output Files -# -#---------------------------------------------------------------------- - - -AC_SUBST(CPPFLAGS) -CXXCPPFLAGS="$CPPFLAGS" -AC_SUBST(CXXCPPFLAGS) -AC_SUBST(CFLAGS) -AC_SUBST(CXXFLAGS) -AC_SUBST(LIBS) -AC_SUBST(LDFLAGS) - - -CSF_XwLibs_LIB="$X_LIBS" -CSF_MotifLibs_LIB="$X_LIBS" - -AC_SUBST(CSF_SOCKETLibs_LIB) -AC_SUBST(CSF_FPELibs_LIB) -AC_SUBST(CSF_OpenGlLibs_INCLUDES) -AC_SUBST(CSF_OpenGlLibs_LIB) -AC_SUBST(HAVE_FREETYPE) -AC_SUBST(CSF_FREETYPE_INCLUDES) -AC_SUBST(CSF_FREETYPE_LIB) -AC_SUBST(HAVE_FTGL) -AC_SUBST(CSF_FTGL_INCLUDES) -AC_SUBST(CSF_FTGL_LIB) -AC_SUBST(HAVE_GL2PS) -AC_SUBST(CSF_GL2PS_INCLUDES) -AC_SUBST(CSF_GL2PS_LIB) -AC_SUBST(HAVE_FREEIMAGE) -AC_SUBST(CSF_FreeImagePlus_INCLUDES) -AC_SUBST(CSF_FreeImagePlus_LIB) -AC_SUBST(CSF_advapi32_LIB) -AC_SUBST(CSF_gdi32_LIB) -AC_SUBST(CSF_user32_LIB) -AC_SUBST(CSF_wsock32_LIB) -AC_SUBST(CSF_XwLibs_LIB) -AC_SUBST(CSF_MotifLibs_LIB) -AC_SUBST(CSF_XmuLibs_LIB) -AC_SUBST(CSF_XmuLibs_INCLUDES) -AC_SUBST(HAVE_TBB) -AC_SUBST(CSF_TBB_INCLUDES) -AC_SUBST(CSF_TBB_LIB) -AC_SUBST(HAVE_OPENCL) -AC_SUBST(CSF_OPENCL_INCLUDES) -AC_SUBST(CSF_OPENCL_LIB) -AC_SUBST(HAVE_QT) -AC_SUBST(CSF_QT_INCLUDES) -AC_SUBST(CSF_QT_LIB) -AC_SUBST(HAVE_VTK) -AC_SUBST(CSF_VTK_INCLUDES) -AC_SUBST(CSF_VTK_LIB) - -AC_SUBST(CSF_OPT_INC) -AC_SUBST(CSF_OPT_LIB) -AC_SUBST(CSF_OPT_BIN) - -echo -echo "CC = $CC" -echo "CXX = $CXX" -echo "CFLAGS = $CFLAGS" -echo "CXXFLAGS = $CXXFLAGS" -echo "CPPFLAGS = $CPPFLAGS" -echo "LDFLAGS = $LDFLAGS" -echo -echo "3rdparty mandatory products " -echo "---------------------------------" -echo "freetype : $HAVE_FREETYPE $DISABLE_FREETYPE_REASON" -echo "tcltk : $HAVE_TCLTK $DISABLE_TCLTK_REASON" -echo -echo "3rdparty optional products " -echo "---------------------------------" -echo "gl2ps : $HAVE_GL2PS $DISABLE_GL2PS_REASON" -echo "freeimage : $HAVE_FREEIMAGE $DISABLE_FREEIMAGE_REASON" -echo "tbb includes : $HAVE_TBB_INC $DISABLE_TBB_REASON_INC" -echo "tbb libraries : $HAVE_TBB $DISABLE_TBB_REASON_LIB" -echo "opencl : $HAVE_OPENCL $DISABLE_OPENCL_REASON" -echo "qt : $HAVE_QT $DISABLE_QT_REASON" -echo "vtk : $HAVE_VTK $DISABLE_VTK_REASON" -echo -echo "Component Build" -echo "-------------------------- -----" -__REPMODULES__ -echo - -AC_OUTPUT([Makefile adm/lin/amk/Makefile custom.sh \ -__ACCONFMODULES__]) diff --git a/adm/templates/template.mam b/adm/templates/template.mam deleted file mode 100644 index 5669bceb2b..0000000000 --- a/adm/templates/template.mam +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile.am for Open Cascade toolkit __TKNAM__ -srcdir = @srcdir@ - -VPATH = @srcdir@ : \ -__VPATH__ - -AM_CXXFLAGS = __CXXFLAG__ - -AM_CFLAGS = __CFLAG__ - -INCLUDES = $(CSF_OPT_INCLUDES) __EXTERNINC__ \ --I@top_srcdir@/inc \ -__INCLUDES__ - -lib_LTLIBRARIES=lib__TKNAM__.la - -lib__TKNAM___la_LIBADD = $(CSF_OPT_LIBS) \ -__LIBADD__ \ -__EXTERNLIB__ - -lib__TKNAM___la_SOURCES = \ -__SOURCES__ diff --git a/adm/templates/template.mamx b/adm/templates/template.mamx deleted file mode 100644 index da81a601ff..0000000000 --- a/adm/templates/template.mamx +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile.am for executable __XQTNAM__ -srcdir = @srcdir@ - -VPATH = @srcdir@ : \ -@top_srcdir@/src/__XQTNAM__ - -INCLUDES = $(CSF_OPT_INCLUDES) __EXTERNINC__ \ --I@top_srcdir@/inc \ --I@top_srcdir@/src/__XQTNAM__ - diff --git a/genproj.sh b/genproj.sh index c565cf6570..91576ca24a 100755 --- a/genproj.sh +++ b/genproj.sh @@ -33,7 +33,7 @@ source "${aScriptPath}/custom.sh" if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi -tclsh "${aScriptPath}/adm/genproj.tcl" -path="${aScriptPath}" -target=${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5 +tclsh "${aScriptPath}/adm/start.tcl" genproj -path="${aScriptPath}" -target=${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5 export PATH="$anOldPath" export LD_LIBRARY_PATH="$anOldLd" diff --git a/src/StdPrs/FILES b/src/StdPrs/FILES index 7144b189d3..94ffef116e 100644 --- a/src/StdPrs/FILES +++ b/src/StdPrs/FILES @@ -26,8 +26,6 @@ StdPrs_ToolPoint.hxx StdPrs_ToolRFace.cxx StdPrs_ToolRFace.hxx StdPrs_ToolTriangulatedShape.cxx -StdPrs_ToolTriangulatedShape.cxx -StdPrs_ToolTriangulatedShape.hxx StdPrs_ToolTriangulatedShape.hxx StdPrs_ToolVertex.cxx StdPrs_ToolVertex.hxx @@ -40,7 +38,6 @@ StdPrs_WFDeflectionSurface.hxx StdPrs_WFPoleSurface.cxx StdPrs_WFPoleSurface.hxx StdPrs_WFRestrictedFace.cxx -StdPrs_WFRestrictedFace.cxx StdPrs_WFRestrictedFace.hxx StdPrs_WFShape.cxx StdPrs_WFShape.hxx -- 2.20.1