diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index ea0b403de1..7e45486545 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -28,11 +28,11 @@ Warning: Lib(s) $[nonexisting], referenced in $[DIRNAME]/$[TARGET], not found. #endif - #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]] + #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]] #end metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target #forscopes test_bin_target - #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]] + #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]] #end test_bin_target // Allow the user to define additional EXTRA_DEPENDS targets in each diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index 426c9ceda3..e5fd581908 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -251,6 +251,14 @@ $[if $[HAVE_NET],$[IF_NET_SOURCES]] \ $[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]] +#defer all_sources \ + $[SOURCES] \ + $[IF_CRYPTO_SOURCES] \ + $[IF_ZLIB_SOURCES] \ + $[IF_IPC_SOURCES] \ + $[IF_NET_SOURCES] \ + $[IF_PYTHON_SOURCES] + // This variable returns the set of sources that are to be // interrogated for the current target. #defer get_igatescan \ diff --git a/panda/src/downloader/Sources.pp b/panda/src/downloader/Sources.pp index b321895fea..ca5ebc48f4 100644 --- a/panda/src/downloader/Sources.pp +++ b/panda/src/downloader/Sources.pp @@ -21,14 +21,14 @@ zcompressor.h download_utils.cxx download_utils.h #define IF_CRYPTO_SOURCES \ - crypto_utils.cxx crypto_utils.h + crypto_utils.cxx crypto_utils.h hashVal.cxx hashVal.I hashVal.h #define INSTALL_HEADERS \ downloader.h downloader.I \ config_downloader.h zcompressor.I zcompressor.h \ asyncUtility.h asyncUtility.I decompressor.h \ extractor.h download_utils.h downloadDb.h downloadDb.I \ - patcher.h + hashVal.I hashVal.h patcher.h #define IGATESCAN all diff --git a/panda/src/downloader/crypto_utils.cxx b/panda/src/downloader/crypto_utils.cxx index 38d35c0605..7c7fb12df7 100644 --- a/panda/src/downloader/crypto_utils.cxx +++ b/panda/src/downloader/crypto_utils.cxx @@ -6,6 +6,7 @@ // This file is compiled only if we have crypto++ installed. #include "crypto_utils.h" +#include "hashVal.h" #include #include diff --git a/panda/src/downloader/crypto_utils.h b/panda/src/downloader/crypto_utils.h index 5aaa8ae717..b786c8ed29 100644 --- a/panda/src/downloader/crypto_utils.h +++ b/panda/src/downloader/crypto_utils.h @@ -10,23 +10,7 @@ #include #include -class EXPCL_PANDAEXPRESS HashVal { -public: - INLINE HashVal(void) { - hv[0] = hv[1] = hv[2] = hv[3] = 0; - } - INLINE bool operator == (const HashVal &other) const { - return (hv[0] == other.hv[0] && - hv[1] == other.hv[1] && - hv[2] == other.hv[2] && - hv[3] == other.hv[3]); - } - INLINE uint get_value(int val) const { - if (val < 4 && val >= 0) - return hv[val]; - } - uint hv[4]; -}; +class HashVal; EXPCL_PANDAEXPRESS void md5_a_file(const Filename &fname, HashVal &ret); EXPCL_PANDAEXPRESS void md5_a_buffer(uchar *buf, ulong len, HashVal &ret); diff --git a/panda/src/downloader/hashVal.I b/panda/src/downloader/hashVal.I new file mode 100644 index 0000000000..dbdbd1ee57 --- /dev/null +++ b/panda/src/downloader/hashVal.I @@ -0,0 +1,49 @@ +// Filename: hashVal.I +// Created by: drose (14Nov00) +// +//////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////// +// Function: HashVal::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE HashVal:: +HashVal(void) { + hv[0] = hv[1] = hv[2] = hv[3] = 0; +} + +//////////////////////////////////////////////////////////////////// +// Function: HashVal::operator == +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE bool HashVal:: +operator == (const HashVal &other) const { + return (hv[0] == other.hv[0] && + hv[1] == other.hv[1] && + hv[2] == other.hv[2] && + hv[3] == other.hv[3]); +} + +//////////////////////////////////////////////////////////////////// +// Function: HashVal::operator == +// Access: Public +// Description: Returns the integer value of the indicated component. +//////////////////////////////////////////////////////////////////// +INLINE uint HashVal:: +get_value(int val) const { + nassertr(val >= 0 && val < 4, 0); + return hv[val]; +} + +//////////////////////////////////////////////////////////////////// +// Function: HashVal::output +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void HashVal:: +output(ostream &out) const { + out << "[" << hv[0] << " " << hv[1] << " " << hv[2] << " " << hv[3] << "]"; +} diff --git a/panda/src/downloader/hashVal.cxx b/panda/src/downloader/hashVal.cxx new file mode 100644 index 0000000000..b61c939ccb --- /dev/null +++ b/panda/src/downloader/hashVal.cxx @@ -0,0 +1,7 @@ +// Filename: hashVal.cxx +// Created by: drose (14Nov00) +// +//////////////////////////////////////////////////////////////////// + +#include "hashVal.h" + diff --git a/panda/src/downloader/hashVal.h b/panda/src/downloader/hashVal.h new file mode 100644 index 0000000000..adaf4ede38 --- /dev/null +++ b/panda/src/downloader/hashVal.h @@ -0,0 +1,35 @@ +// Filename: hashVal.h +// Created by: drose (14Nov00) +// +//////////////////////////////////////////////////////////////////// + +#ifndef HASHVAL_H +#define HASHVAL_H + +#include +#include +#include + +//////////////////////////////////////////////////////////////////// +// Class : HashVal +// Description : A sixteen-byte hash value sent to the crypt library. +//////////////////////////////////////////////////////////////////// +class EXPCL_PANDAEXPRESS HashVal { +public: + INLINE HashVal(); + INLINE bool operator == (const HashVal &other) const; + INLINE uint get_value(int val) const; + + INLINE void output(ostream &out) const; + + uint hv[4]; +}; + +INLINE ostream &operator << (ostream &out, const HashVal &hv) { + hv.output(out); + return out; +} + +#include "hashVal.I" + +#endif diff --git a/panda/src/downloadertools/check_md5.cxx b/panda/src/downloadertools/check_md5.cxx index 694f43870e..83926987a1 100644 --- a/panda/src/downloadertools/check_md5.cxx +++ b/panda/src/downloadertools/check_md5.cxx @@ -1,4 +1,5 @@ #include +#include int main(int argc, char *argv[]) {