From d8ed32fc1b3ce1fd28ecb730d7b17dc999ca9622 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 20 Jun 2009 01:25:15 +0000 Subject: [PATCH] windows resource files and such --- dtool/Config.pp | 8 ++++ dtool/Package.pp | 5 +++ dtool/pptempl/Global.gmsvc.pp | 7 +--- dtool/pptempl/Global.msvc.pp | 7 +--- dtool/pptempl/Global.nmake.pp | 7 +--- dtool/pptempl/Global.pp | 16 ++++++++ dtool/pptempl/Template.gmsvc.pp | 73 ++++++++++++++++----------------- dtool/pptempl/Template.msvc.pp | 8 ++-- dtool/pptempl/Template.nmake.pp | 68 +++++++++++++++--------------- dtool/pptempl/Template.unix.pp | 38 ++++++++--------- 10 files changed, 125 insertions(+), 112 deletions(-) diff --git a/dtool/Config.pp b/dtool/Config.pp index 8a79b8b8d8..650d104fa1 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -739,6 +739,14 @@ #define ODE_LIBS $[if $[WINDOWS_PLATFORM],ode.lib,ode] #defer HAVE_ODE $[libtest $[ODE_LPATH],$[ODE_LIBS]] +// Mozilla's so-called Gecko SDK, a.k.a. Xulrunner SDK, implements +// NPAPI, Mozilla's semi-standard API to build a web plugin for +// Firefox and other Mozilla-based browsers. +#define NPAPI_IPATH +#define NPAPI_LPATH +#define NPAPI_LIBS +#define HAVE_NPAPI + // Do you want to build the DirectD tools for starting Panda clients // remotely? This only affects the direct tree. Enabling this may // cause libdirect.dll to fail to load on Win98 clients. diff --git a/dtool/Package.pp b/dtool/Package.pp index 385c8666ad..08c0ab6807 100644 --- a/dtool/Package.pp +++ b/dtool/Package.pp @@ -256,6 +256,11 @@ #set ODE_LIBS $[ODE_LIBS] #set HAVE_ODE $[HAVE_ODE] +#set NPAPI_IPATH $[unixfilename $[NPAPI_IPATH]] +#set NPAPI_LPATH $[unixfilename $[NPAPI_LPATH]] +#set NPAPI_LIBS $[NPAPI_LIBS] +#set HAVE_NPAPI $[HAVE_NPAPI] + #set HAVE_THREADS $[HAVE_THREADS] #set DEBUG_THREADS $[DEBUG_THREADS] #set MUTEX_SPINLOCK $[MUTEX_SPINLOCK] diff --git a/dtool/pptempl/Global.gmsvc.pp b/dtool/pptempl/Global.gmsvc.pp index e984f4f52c..52fb900746 100644 --- a/dtool/pptempl/Global.gmsvc.pp +++ b/dtool/pptempl/Global.gmsvc.pp @@ -99,11 +99,6 @@ // distinction is so important in Windows). #define dllext $[if $[<= $[OPTIMIZE],2],_d] -// note: does NOT include .dll or .lib at end -#defun get_dllname dll_basename - $[if $[ne $[DONT_USE_PANDA_DLL_NAMING],], $[dll_basename], lib$[dll_basename]$[dllext]] -#end get_dllname - #defer interrogate_ipath $[decygwin %,-S"%",$[install_parser_inc_dir]] $[decygwin %,-I"%",$[target_ipath]] // '#defer extra_cflags $[extra_cflags] /STUFF' will never work because extra_cflags hasnt been @@ -138,7 +133,7 @@ // if we're attached, use dllbase.txt. otherwise let OS loader resolve dll addrspace collisions #if $[ne $[CTPROJS],] // use predefined bases to speed dll loading and simplify debugging -#defer DLLNAMEBASE $[get_dllname $[TARGET]] +#defer DLLNAMEBASE $[lib_prefix]$[TARGET] #defer DLLBASEADDRFILENAME dllbase.txt #defer DLLBASEARG "/BASE:@$[dtool_ver_dir]\$[DLLBASEADDRFILENAME],$[DLLNAMEBASE]" #else diff --git a/dtool/pptempl/Global.msvc.pp b/dtool/pptempl/Global.msvc.pp index 6209cd9682..96409b53cf 100644 --- a/dtool/pptempl/Global.msvc.pp +++ b/dtool/pptempl/Global.msvc.pp @@ -112,11 +112,6 @@ // distinction is so important in Windows). #define dllext $[if $[<= $[OPTIMIZE],2],_d] -// note: does NOT include .dll or .lib at end -#defun get_dllname dll_basename - $[if $[ne $[DONT_USE_PANDA_DLL_NAMING],], $[dll_basename], lib$[dll_basename]$[dllext]] -#end get_dllname - // Because Visual Studio .NET prefers to generate object files using the same // base name as the source file, we don't want an object file prefix. #define obj_prefix @@ -144,7 +139,7 @@ // if we're attached, use dllbase.txt. otherwise let OS loader resolve dll addrspace collisions #if $[ne $[CTPROJS],] // use predefined bases to speed dll loading and simplify debugging -#defer DLLNAMEBASE $[get_dllname $[TARGET]] +#defer DLLNAMEBASE $[lib_prefix]$[TARGET] #defer DLLBASEADDRFILENAME dllbase.txt #defer DLLBASEARG "/BASE:@$[dtool_ver_dir]\$[DLLBASEADDRFILENAME],$[DLLNAMEBASE]" #else diff --git a/dtool/pptempl/Global.nmake.pp b/dtool/pptempl/Global.nmake.pp index 03b6d9574b..4da7ed7861 100644 --- a/dtool/pptempl/Global.nmake.pp +++ b/dtool/pptempl/Global.nmake.pp @@ -112,11 +112,6 @@ // distinction is so important in Windows). #define dllext $[if $[<= $[OPTIMIZE],2],_d] -// note: does NOT include .dll or .lib at end -#defun get_dllname dll_basename - $[if $[ne $[DONT_USE_PANDA_DLL_NAMING],], $[dll_basename], lib$[dll_basename]$[dllext]] -#end get_dllname - #defer interrogate_ipath $[decygwin %,-S"%",$[install_parser_inc_dir]] $[decygwin %,-I"%",$[target_ipath]] // '#defer extra_cflags $[extra_cflags] /STUFF' will never work because extra_cflags hasnt been @@ -139,7 +134,7 @@ // if we're attached, use dllbase.txt. otherwise let OS loader resolve dll addrspace collisions #if $[ne $[CTPROJS],] // use predefined bases to speed dll loading and simplify debugging -#defer DLLNAMEBASE $[get_dllname $[TARGET]] +#defer DLLNAMEBASE $[lib_prefix]$[TARGET] #defer DLLBASEADDRFILENAME dllbase.txt #defer DLLBASEARG "/BASE:@$[dtool_ver_dir]\$[DLLBASEADDRFILENAME],$[DLLNAMEBASE]" #else diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index 7470f6186c..7e3c831f4b 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -213,6 +213,13 @@ #define ode_libs $[ODE_LIBS] #endif +#if $[HAVE_NPAPI] + #define npapi_ipath $[wildcard $[NPAPI_IPATH]] + #define npapi_lpath $[wildcard $[NPAPI_LPATH]] + #define npapi_cflags $[NPAPI_CFLAGS] + #define npapi_libs $[NPAPI_LIBS] +#endif + #if $[HAVE_JPEG] #define jpeg_ipath $[wildcard $[JPEG_IPATH]] #define jpeg_lpath $[wildcard $[JPEG_LPATH]] @@ -465,9 +472,18 @@ #defer link_lib_c $[if $[lib_is_static],$[static_lib_c],$[shared_lib_c]] #defer link_lib_c++ $[if $[lib_is_static],$[static_lib_c++],$[shared_lib_c++]] +// "lib" is the default prefix applied to every generated library. +// This comes from Unix convention. This can be redefined on a +// per-target basis. +#define LIB_PREFIX lib +#defer lib_prefix $[LIB_PREFIX] + +// The default library extension various based on the OS. #defer dynamic_lib_ext $[DYNAMIC_LIB_EXT] #defer static_lib_ext $[STATIC_LIB_EXT] #defer lib_ext $[if $[lib_is_static],$[static_lib_ext],$[dynamic_lib_ext]] + +// OSX also has a "bundle" concept. #defer bundle_ext $[BUNDLE_EXT] // If BUILD_COMPONENTS is not true, we don't actually build all the diff --git a/dtool/pptempl/Template.gmsvc.pp b/dtool/pptempl/Template.gmsvc.pp index b7bf91cd6c..af80337c75 100644 --- a/dtool/pptempl/Template.gmsvc.pp +++ b/dtool/pptempl/Template.gmsvc.pp @@ -56,7 +56,7 @@ #if $[eq $[module $[TARGET],$[TARGET]],] // This library is not on a metalib, so we can build it. #set real_lib_targets $[real_lib_targets] $[TARGET] - #set real_lib_target_libs $[real_lib_target_libs] $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] + #set real_lib_target_libs $[real_lib_target_libs] $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #else // This library is on a metalib, so we can't build it, but we // should build all the obj's that go into it. @@ -71,7 +71,7 @@ // the list of binaries that are to be built only when specifically // asked for. - #define lib_targets $[forscopes metalib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target,$[if $[build_target],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]]] $[real_lib_target_libs] + #define lib_targets $[forscopes metalib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target,$[if $[build_target],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]]] $[real_lib_target_libs] #define bin_targets \ $[active_target(bin_target noinst_bin_target):%=$[ODIR]/%.exe] \ @@ -119,7 +119,7 @@ // with that happen to be static libs. We will introduce dependency // rules for these. (We don't need dependency rules for dynamic libs, // since these don't get burned in at build time.) -#defer static_lib_dependencies $[all_libs $[if $[and $[lib_is_static],$[build_lib]],$[RELDIR:%=%/$[ODIR]/lib$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] +#defer static_lib_dependencies $[all_libs $[if $[and $[lib_is_static],$[build_lib]],$[RELDIR:%=%/$[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] // $[target_ipath] is the proper ipath to put on the command line, // from the context of a particular target. @@ -366,30 +366,29 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target)] $[components $[patsubst %,$[RELDIR]/$[%_obj],$[compile_sources]],$[active_component_libs]] #endif - #define varname $[subst -,_,.,_,lib$[TARGET]$[lib_ext]] + #define varname $[subst -,_,.,_,$[lib_prefix]$[TARGET]$[lib_ext]] $[varname] = $[sources] - #define target $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] + #define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) #define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%] - #define mybasename $[basename $[notdir $[target]]] - #define tmpdirname_cyg $[install_lib_dir]/$[mybasename] - #define tmpdirname_win $[osfilename $[tmpdirname_cyg]] // not parallel (requires gmake 3.79) because of link.exe conflicts in TMP dir (see audiotraits dir) -#if $[GENERATE_BUILDDATE] -.NOTPARALLEL $[target] : $[sources] $[static_lib_dependencies] $[dtool_ver_dir_cyg]/version.rc $[DLLBASEADDRFILENAME:%=$[dtool_ver_dir_cyg]/%] -// first generate builddate for rc compiler using compiler preprocessor -$[TAB] mkdir -p $[tmpdirname_cyg] // this dir-creation-stuff is leftover from trying to resolve parallel link difficulties - #define VER_RESOURCE "$[tmpdirname_win]\$[mybasename].res" -$[TAB] cl /nologo /EP "$[dtool_ver_dir]\verdate.cpp" > "$[tmpdirname_win]\verdate.h" -$[TAB] rc /n /I"$[tmpdirname_win]" $[DECYGWINED_INC_PATHLIST_ARGS] /fo$[VER_RESOURCE] $[filter /D%, $[flags]] "$[dtool_ver_dir]\version.rc" +#if $[or $[GENERATE_BUILDDATE],$[WIN_RESOURCE_FILE]] + #define resource_file $[or $[WIN_RESOURCE_FILE],$[dtool_ver_dir_cyg]/version.rc] +.NOTPARALLEL $[target] : $[sources] $[static_lib_dependencies] $[resource_file] $[DLLBASEADDRFILENAME:%=$[dtool_ver_dir_cyg]/%] + + // first generate builddate for rc compiler using compiler preprocessor + #define ver_resource "$[ODIR]\$[lib_prefix]$[TARGET].res" +$[TAB] cl /nologo /EP "$[dtool_ver_dir]\verdate.cpp" > "$[ODIR]\verdate.h" +$[TAB] rc /n /I"$[ODIR]" $[DECYGWINED_INC_PATHLIST_ARGS] /fo$[ver_resource] $[filter /D%, $[flags]] "$[osfilename $[resource_file]]" + #define sources $[sources] $[ver_resource] #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]] $[TAB] $[link_lib_c++] #else $[TAB] $[link_lib_c] #endif #else - #define VER_RESOURCE + .NOTPARALLEL $[target] : $[sources] $[DLLBASEADDRFILENAME:%=$[dtool_ver_dir_cyg]/%] #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]] $[TAB] $[link_lib_c++] @@ -401,10 +400,10 @@ $[TAB] $[link_lib_c] // Additional dependency rules for the implicit files that get built // along with a .dll. #if $[not $[lib_is_static]] -$[ODIR]/$[get_dllname $[TARGET]].lib : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +$[ODIR]/$[lib_prefix]$[TARGET].lib : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #endif #if $[has_pdb] -$[ODIR]/$[get_dllname $[TARGET]].pdb : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +$[ODIR]/$[lib_prefix]$[TARGET].pdb : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #endif #endif @@ -413,9 +412,9 @@ $[ODIR]/$[get_dllname $[TARGET]].pdb : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext // everything that goes along with it. #define installed_files \ $[if $[build_lib], \ - $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext] \ - $[if $[not $[lib_is_static]],$[install_lib_dir]/$[get_dllname $[TARGET]].lib] \ - $[if $[has_pdb],$[install_lib_dir]/$[get_dllname $[TARGET]].pdb] \ + $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] \ + $[if $[not $[lib_is_static]],$[install_lib_dir]/$[lib_prefix]$[TARGET].lib] \ + $[if $[has_pdb],$[install_lib_dir]/$[lib_prefix]$[TARGET].pdb] \ ] \ $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \ $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \ @@ -430,8 +429,8 @@ uninstall-lib$[TARGET] : $[TAB] rm -f $[sort $[installed_files]] #endif -$[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext] : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] -#define local $[get_dllname $[TARGET]]$[lib_ext] +$[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] +#define local $[lib_prefix]$[TARGET]$[lib_ext] #define dest $[install_lib_dir] #if $[eq $[USE_COMPILER], MSVC8] $[TAB] mt -manifest $[ODIR]/$[local].manifest -outputresource:$[ODIR]/$[local]\;2 @@ -441,16 +440,16 @@ $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/ // Install the .lib associated with a .dll. #if $[not $[lib_is_static]] -$[install_lib_dir]/$[get_dllname $[TARGET]].lib : $[ODIR]/$[get_dllname $[TARGET]].lib -#define local $[get_dllname $[TARGET]].lib +$[install_lib_dir]/$[lib_prefix]$[TARGET].lib : $[ODIR]/$[lib_prefix]$[TARGET].lib +#define local $[lib_prefix]$[TARGET].lib #define dest $[install_lib_dir] $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/ #endif #if $[has_pdb] -$[install_lib_dir]/$[get_dllname $[TARGET]].pdb : $[ODIR]/$[get_dllname $[TARGET]].pdb -#define local $[get_dllname $[TARGET]].pdb +$[install_lib_dir]/$[lib_prefix]$[TARGET].pdb : $[ODIR]/$[lib_prefix]$[TARGET].pdb +#define local $[lib_prefix]$[TARGET].pdb #define dest $[install_lib_dir] $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/ #endif @@ -460,7 +459,7 @@ $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/ // data, if needed. // The library name is based on this library. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] // The module name comes from the metalib that includes this library. #define igatemod $[module $[TARGET],$[TARGET]] #if $[eq $[igatemod],] @@ -477,9 +476,9 @@ $[TAB] cp $[install_dash_p] -f $[local] $[dest]/ // parallel make. $[igatedb] : $[igateoutput] -lib$[TARGET]_igatescan = $[igatescan] +$[lib_prefix]$[TARGET]_igatescan = $[igatescan] $[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] -$[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) +$[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $($[lib_prefix]$[TARGET]_igatescan) #endif // igatescan @@ -489,12 +488,12 @@ $[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] - // file into the library, if this is a metalib that includes // interrogated components. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] #define igatemod $[TARGET] -lib$[TARGET]_igatemscan = $[igatemscan] +$[lib_prefix]$[TARGET]_igatemscan = $[igatemscan] #define target $[igatemout] -#define sources $(lib$[TARGET]_igatemscan) +#define sources $($[lib_prefix]$[TARGET]_igatemscan) $[target] : $[sources] $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources] @@ -513,9 +512,9 @@ $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[iga ///////////////////////////////////////////////////////////////////// #forscopes noinst_lib_target test_lib_target -#define varname $[subst -,_,.,_,lib$[TARGET]$[lib_ext]] +#define varname $[subst -,_,.,_,$[lib_prefix]$[TARGET]$[lib_ext]] $[varname] = $[patsubst %,$[%_obj],$[compile_sources]] -#define target $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +#define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) #define $[VER_RESOURCE] $[COMPILED_RESOURCES] $[target] : $[sources] $[static_lib_dependencies] $[GENERATED_SOURCES] @@ -525,9 +524,9 @@ $[TAB] $[link_lib_c++] $[TAB] $[link_lib_c] #endif -$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #if $[has_pdb] -$[ODIR]/$[get_dllname $[TARGET]].pdb : $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +$[ODIR]/$[lib_prefix]$[TARGET].pdb : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #endif // this section is all very clunky and not generalized enough diff --git a/dtool/pptempl/Template.msvc.pp b/dtool/pptempl/Template.msvc.pp index 97ceb4f334..c629deea1e 100644 --- a/dtool/pptempl/Template.msvc.pp +++ b/dtool/pptempl/Template.msvc.pp @@ -260,7 +260,7 @@ #define igatemout $[get_igatemout] #if $[build_it] - #define target $[ODIR]\$[get_dllname $[TARGET]].$[dlllib] + #define target $[ODIR]\$[lib_prefix]$[TARGET].$[dlllib] // Installation paths #define mybasename $[basename $[notdir $[target]]] @@ -276,7 +276,7 @@ // Additional rules to generate and compile the interrogate data, if needed. #if $[igatescan] - #define igatelib lib$[TARGET] + #define igatelib $[lib_prefix]$[TARGET] // The module name comes from the metalib that includes this library. #define igatemod $[module $[TARGET],$[TARGET]] @@ -298,7 +298,7 @@ // file into the library, if this is a metalib that includes // interrogated components. #if $[igatemout] - #define igatelib lib$[TARGET] + #define igatelib $[lib_prefix]$[TARGET] #define igatemod $[TARGET] #define igatemod_commandline \ @@ -421,7 +421,7 @@ ///////////////////////////////////////////////////////////////////// #forscopes static_lib_target ss_lib_target -#define target $[ODIR]\$[get_dllname $[TARGET]].lib +#define target $[ODIR]\$[lib_prefix]$[TARGET].lib #define defines $[join ;,$[extra_defines]] #output $[TARGET].vcproj diff --git a/dtool/pptempl/Template.nmake.pp b/dtool/pptempl/Template.nmake.pp index 2b30ab9d5d..5139899655 100644 --- a/dtool/pptempl/Template.nmake.pp +++ b/dtool/pptempl/Template.nmake.pp @@ -63,7 +63,7 @@ #if $[eq $[module $[TARGET],$[TARGET]],] // This library is not on a metalib, so we can build it. #set real_lib_targets $[real_lib_targets] $[TARGET] - #set real_lib_target_libs $[real_lib_target_libs] $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] + #set real_lib_target_libs $[real_lib_target_libs] $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #else // This library is on a metalib, so we can't build it, but we // should build all the obj's that go into it. @@ -78,7 +78,7 @@ // list of binaries that are to be built only when specifically // asked for. - #define lib_targets $[forscopes metalib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target,$[if $[build_target],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]]] $[real_lib_target_libs] + #define lib_targets $[forscopes metalib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target,$[if $[build_target],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]]] $[real_lib_target_libs] #define bin_targets \ $[active_target(bin_target noinst_bin_target):%=$[ODIR]/%.exe] \ @@ -132,7 +132,7 @@ // with that happen to be static libs. We will introduce dependency // rules for these. (We don't need dependency rules for dynamic libs, // since these don't get burned in at build time.) -#defer static_lib_dependencies $[all_libs $[if $[lib_is_static],$[RELDIR:%=%/$[ODIR]/lib$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] +#defer static_lib_dependencies $[all_libs $[if $[lib_is_static],$[RELDIR:%=%/$[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] // And $[complete_ipath] is the list of directories (from within this // tree) we should add to our -I list. It's basically just one for @@ -388,9 +388,9 @@ igate : $[patsubst %,$[osfilename %],$[get_igatedb(metalib_target lib_target ss_ $[patsubst %,$[%_obj],$[compile_sources]] \ $[components $[patsubst %,$[RELDIR]/$[%_obj],$[compile_sources]],$[active_component_libs]] - #define varname $[subst -,_,lib$[TARGET]_so] + #define varname $[subst -,_,$[lib_prefix]$[TARGET]_so] $[varname] = $[patsubst %,$[osfilename %],$[sources]] - #define target $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] + #define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) #define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%] #define mybasename $[basename $[notdir $[target]]] @@ -423,10 +423,10 @@ $[TAB] mt -nologo -manifest $[target].manifest -outputresource:$[target];2 #endif #if $[build_dlls] -$[osfilename $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] +$[osfilename $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] #endif #if $[build_pdbs] -$[osfilename $[ODIR]/$[get_dllname $[TARGET]].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] +$[osfilename $[ODIR]/$[lib_prefix]$[TARGET].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] #endif #endif @@ -435,9 +435,9 @@ $[osfilename $[ODIR]/$[get_dllname $[TARGET]].pdb] : $[patsubst %,$[osfilename % // everything that goes along with it. #define installed_files \ $[if $[build_it], \ - $[if $[build_dlls],$[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext]] \ - $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext] \ - $[if $[and $[build_dlls],$[build_pdbs]],$[install_lib_dir]/$[get_dllname $[TARGET]].pdb] \ + $[if $[build_dlls],$[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext]] \ + $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] \ + $[if $[and $[build_dlls],$[build_pdbs]],$[install_lib_dir]/$[lib_prefix]$[TARGET].pdb] \ ] \ $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \ $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \ @@ -455,8 +455,8 @@ $[TAB] if exist $[file] del /f $[file] #endif #if $[build_dlls] -$[osfilename $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] -#define local $[get_dllname $[TARGET]]$[lib_ext] +$[osfilename $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] +#define local $[lib_prefix]$[TARGET]$[lib_ext] #define dest $[install_lib_dir] #if $[eq $[USE_COMPILER], MSVC8] $[TAB] mt -nologo -manifest $[ODIR]/$[local].manifest -outputresource:$[ODIR]/$[local];2 @@ -465,14 +465,14 @@ $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local]] $[osfilename $[dest]] $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local].manifest] $[osfilename $[dest]] #endif -$[osfilename $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] -#define local $[get_dllname $[TARGET]]$[lib_ext] +$[osfilename $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] +#define local $[lib_prefix]$[TARGET]$[lib_ext] #define dest $[install_lib_dir] $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local]] $[osfilename $[dest]] #if $[and $[build_dlls],$[build_pdbs]] -$[osfilename $[install_lib_dir]/$[get_dllname $[TARGET]].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]].pdb] -#define local $[get_dllname $[TARGET]].pdb +$[osfilename $[install_lib_dir]/$[lib_prefix]$[TARGET].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET].pdb] +#define local $[lib_prefix]$[TARGET].pdb #define dest $[install_lib_dir] $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local]] $[osfilename $[dest]] #endif @@ -482,7 +482,7 @@ $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local]] $[osfilename $[dest]] // data, if needed. // The library name is based on this library. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] // The module name comes from the metalib that includes this library. #define igatemod $[module $[TARGET],$[TARGET]] #if $[eq $[igatemod],] @@ -499,7 +499,7 @@ $[TAB] xcopy /I/Y $[osfilename $[local]] $[osfilename $[dest]] // parallel make. $[osfilename $[igatedb]] : $[patsubst %,$[osfilename %],$[igateoutput]] -lib$[TARGET]_igatescan = $[patsubst %,$[osfilename %],$[igatescan]] +$[lib_prefix]$[TARGET]_igatescan = $[patsubst %,$[osfilename %],$[igatescan]] $[osfilename $[igateoutput]] : $[patsubst %,$[osfilename %],$[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]]] //// Sauce //// There's a bug here. The -od is being passed into a string in the file. This @@ -507,9 +507,9 @@ $[osfilename $[igateoutput]] : $[patsubst %,$[osfilename %],$[sort $[patsubst %. //// The hacky fix is to use \\ instead of \. Windows seems to still let you open files if you //// include multiple slashes in them. Then, when quoted, the string will properly //// be created. -//$[TAB] $[INTERROGATE] -od $[subst \,\\,$[osfilename $[igatedb]]] -oc $[osfilename $[igateoutput]] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) +//$[TAB] $[INTERROGATE] -od $[subst \,\\,$[osfilename $[igatedb]]] -oc $[osfilename $[igateoutput]] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $($[lib_prefix]$[TARGET]_igatescan) // Actually, drose kindly fixed that -$[TAB] $[INTERROGATE] -od $[osfilename $[igatedb]] -oc $[osfilename $[igateoutput]] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) +$[TAB] $[INTERROGATE] -od $[osfilename $[igatedb]] -oc $[osfilename $[igateoutput]] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $($[lib_prefix]$[TARGET]_igatescan) #endif // igatescan @@ -519,12 +519,12 @@ $[TAB] $[INTERROGATE] -od $[osfilename $[igatedb]] -oc $[osfilename $[igateoutpu // file into the library, if this is a metalib that includes // interrogated components. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] #define igatemod $[TARGET] -lib$[TARGET]_igatemscan = $[patsubst %,$[osfilename %],$[igatemscan]] +$[lib_prefix]$[TARGET]_igatemscan = $[patsubst %,$[osfilename %],$[igatemscan]] #define target $[igatemout] -#define sources $(lib$[TARGET]_igatemscan) +#define sources $($[lib_prefix]$[TARGET]_igatemscan) $[osfilename $[target]] : $[patsubst %,$[osfilename %],$[sources]] $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources] @@ -543,9 +543,9 @@ $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[iga ///////////////////////////////////////////////////////////////////// #forscopes noinst_lib_target test_lib_target -#define varname $[subst -,_,lib$[TARGET]_so] +#define varname $[subst -,_,$[lib_prefix]$[TARGET]_so] $[varname] = $[patsubst %,$[osfilename $[%_obj]],$[compile_sources]] -#define target $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +#define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) $[osfilename $[target]] : $[patsubst %,$[osfilename %],$[sources] $[static_lib_dependencies] $[GENERATED_SOURCES]] #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]] @@ -558,10 +558,10 @@ $[TAB] mt -nologo -manifest $[target].manifest -outputresource:$[target];2 #endif #if $[build_dlls] -$[osfilename $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] +$[osfilename $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] #endif #if $[build_pdbs] -$[osfilename $[ODIR]/$[get_dllname $[TARGET]].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] +$[osfilename $[ODIR]/$[lib_prefix]$[TARGET].pdb] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] #endif // this section is all very clunky and not generalized enough @@ -628,9 +628,9 @@ $[TAB] $[MIDL_COMMAND] // ///////////////////////////////////////////////////////////////////// // #forscopes static_lib_target ss_lib_target -// #define varname $[subst -,_,lib$[TARGET]_a] +// #define varname $[subst -,_,$[lib_prefix]$[TARGET]_a] // $[varname] = $[patsubst %,$[osfilename $[%_obj]],$[compile_sources]] -// #define target $[ODIR]/$[get_dllname $[TARGET]]$[lib_ext] +// #define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] // #define sources $($[varname]) // $[osfilename $[target]] : $[patsubst %,$[osfilename %],$[sources]] // #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]] @@ -640,23 +640,23 @@ $[TAB] $[MIDL_COMMAND] // #endif // #define installed_files \ -// $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext] \ +// $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] \ // $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \ // $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \ // $[INSTALL_DATA:%=$[install_data_dir]/%] \ // $[INSTALL_CONFIG:%=$[install_config_dir]/%] -// install-lib$[TARGET] : $[patsubst %,$[osfilename %],$[installed_files]] +// install-$[lib_prefix]$[TARGET] : $[patsubst %,$[osfilename %],$[installed_files]] -// uninstall-lib$[TARGET] : +// uninstall-$[lib_prefix]$[TARGET] : // #if $[installed_files] // #foreach file $[patsubst %,$[osfilename %],$[sort $[installed_files]]] // $[TAB] if exist $[file] del /f $[file] // #end file // #endif -// $[osfilename $[install_lib_dir]/$[get_dllname $[TARGET]]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[get_dllname $[TARGET]]$[lib_ext]] -// #define local $[get_dllname $[TARGET]]$[lib_ext] +// $[osfilename $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext]] : $[patsubst %,$[osfilename %],$[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext]] +// #define local $[lib_prefix]$[TARGET]$[lib_ext] // #define dest $[install_lib_dir] // $[TAB] xcopy /I/Y $[osfilename $[ODIR]/$[local]] $[osfilename $[dest]] diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index 6d7405a1e8..8362729ccc 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -87,7 +87,7 @@ // with that happen to be static libs. We will introduce dependency // rules for these. (We don't need dependency rules for dynamic libs, // since these don't get burned in at build time.) -#defer static_lib_dependencies $[all_libs $[if $[lib_is_static],$[RELDIR:%=%/$[ODIR]/lib$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] +#defer static_lib_dependencies $[all_libs $[if $[lib_is_static],$[RELDIR:%=%/$[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]] // $[target_ipath] is the proper ipath to put on the command line, // from the context of a particular target. @@ -347,9 +347,9 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target)] #define cc_ld $[or $[get_ld],$[CC]] #define cxx_ld $[or $[get_ld],$[CXX]] - #define varname $[subst -,_,.,_,lib$[TARGET]$[lib_ext]] + #define varname $[subst -,_,.,_,$[lib_prefix]$[TARGET]$[lib_ext]] $[varname] = $[sources] $[if $[not $[bundle_ext]],$[interrogate_sources]] - #define target $[ODIR]/lib$[TARGET]$[lib_ext] + #define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) $[target] : $[sources] $[static_lib_dependencies] @@ -361,8 +361,8 @@ $[TAB] $[link_lib_c] #if $[bundle_ext] // Also generate the bundles (on OSX only). - #define target $[ODIR]/lib$[TARGET]$[bundle_ext] - #define sources $[interrogate_sources] $[ODIR]/lib$[TARGET]$[lib_ext] + #define target $[ODIR]/$[lib_prefix]$[TARGET]$[bundle_ext] + #define sources $[interrogate_sources] $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] $[target] : $[sources] $[static_lib_dependencies] $[TAB] $[BUNDLE_LIB_C++] #endif // BUNDLE_EXT @@ -371,8 +371,8 @@ $[TAB] $[BUNDLE_LIB_C++] // Here are the rules to install and uninstall the library and // everything that goes along with it. #define installed_files \ - $[install_lib_dir]/lib$[TARGET]$[lib_ext] \ - $[if $[bundle_ext],$[install_lib_dir]/lib$[TARGET]$[bundle_ext]] \ + $[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] \ + $[if $[bundle_ext],$[install_lib_dir]/$[lib_prefix]$[TARGET]$[bundle_ext]] \ $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \ $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \ $[INSTALL_DATA:%=$[install_data_dir]/%] \ @@ -386,14 +386,14 @@ uninstall-lib$[TARGET] : $[TAB] rm -f $[sort $[installed_files]] #endif -$[install_lib_dir]/lib$[TARGET]$[lib_ext] : $[ODIR]/lib$[TARGET]$[lib_ext] -#define local $[ODIR]/lib$[TARGET]$[lib_ext] +$[install_lib_dir]/$[lib_prefix]$[TARGET]$[lib_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] +#define local $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define dest $[install_lib_dir] $[TAB] $[INSTALL] #if $[bundle_ext] -$[install_lib_dir]/lib$[TARGET]$[bundle_ext] : $[ODIR]/lib$[TARGET]$[bundle_ext] -#define local $[ODIR]/lib$[TARGET]$[bundle_ext] +$[install_lib_dir]/$[lib_prefix]$[TARGET]$[bundle_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[bundle_ext] +#define local $[ODIR]/$[lib_prefix]$[TARGET]$[bundle_ext] #define dest $[install_lib_dir] $[TAB] $[INSTALL] #endif // BUNDLE_EXT @@ -403,7 +403,7 @@ $[TAB] $[INSTALL] // data, if needed. // The library name is based on this library. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] // The module name comes from the metalib that includes this library. #define igatemod $[module $[TARGET],$[TARGET]] #if $[eq $[igatemod],] @@ -420,9 +420,9 @@ $[TAB] $[INSTALL] // parallel make. $[igatedb] : $[igateoutput] -lib$[TARGET]_igatescan = $[igatescan] +$[lib_prefix]$[TARGET]_igatescan = $[igatescan] $[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] -$[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) +$[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $($[lib_prefix]$[TARGET]_igatescan) #endif // igatescan @@ -432,12 +432,12 @@ $[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] - // file into the library, if this is a metalib that includes // interrogated components. -#define igatelib lib$[TARGET] +#define igatelib $[lib_prefix]$[TARGET] #define igatemod $[TARGET] -lib$[TARGET]_igatemscan = $[igatemscan] +$[lib_prefix]$[TARGET]_igatemscan = $[igatemscan] #define target $[igatemout] -#define sources $(lib$[TARGET]_igatemscan) +#define sources $($[lib_prefix]$[TARGET]_igatemscan) $[target] : $[sources] $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources] @@ -458,9 +458,9 @@ $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[iga ///////////////////////////////////////////////////////////////////// #forscopes noinst_lib_target -#define varname $[subst -,_,lib$[TARGET]_so] +#define varname $[subst -,_,$[lib_prefix]$[TARGET]_so] $[varname] = $[patsubst %,$[%_obj],$[compile_sources]] -#define target $[ODIR]/lib$[TARGET]$[lib_ext] +#define target $[ODIR]/$[lib_prefix]$[TARGET]$[lib_ext] #define sources $($[varname]) $[target] : $[sources] $[static_lib_dependencies] #if $[filter %.mm %.cxx %.yxx %.lxx,$[get_sources]]