#include <stdio.h>
+#ifdef __WIN32__
+ #include <io.h>
+#endif
+
using namespace application;
using namespace basis;
using namespace loggers;
FUNCDEF("execute");
SETUP_COMBO_LOGGER;
+#ifndef __WIN32__
int test_runs = 1000000;
time_stamp start; // start of test.
LOG(a_sprintf("test run took %0.2f milliseconds or %0.2f seconds or %0.2f minutes.", durat, secs, secs / 60.0));
// divide by two because we're doing two calls above.
LOG(a_sprintf("individual call takes %0.0f milliseconds.", durat / double(test_runs) / 2.0));
+#endif
return 0;
}
// sole purpose of this is to make the lib be generated,\r
// even though we currently do not have any code that lives inside it.\r
\r
-\r
int __private_private_bogus_placeholder_xj27_qx19() { return 32; }\r
+\r
+\r
// compliant functions that required Unicode in win32 but not in Unix systems.
#if defined(UNICODE)
+#error should not be in here right now --cak
///holding to test wx && defined(__WIN32__)
//! to_unicode_temp() converts to UTF-16 as needed for win32 system calls.
/*! this conversion is only appropriate to use within expressions. it does
#include <io.h>
#endif
-//#define DEBUG_BYTE_FILER
+#define DEBUG_BYTE_FILER
// uncomment for noisy version of class.
using namespace basis;
close();
_auto_close = true; // reset since we know we're opening this.
_filename->reset(fname);
-#ifndef __WIN32__
_handle->fp = _filename->raw().t()? fopen(_filename->raw().s(), perms.s()) : NIL;
-#else
- _handle->fp = _filename->raw().t()? _wfopen((wchar_t *)(UTF16 *)transcode_to_utf16(_filename->raw()),
- (wchar_t *)(UTF16 *)transcode_to_utf16(perms)) : NIL;
-
-#ifdef DEBUG_BYTE_FILER
- if (!_handle->fp)
- wprintf((wchar_t *)(UTF16 *)transcode_to_utf16("could not open: %ls\n"),
- (wchar_t *)(UTF16 *)transcode_to_utf16(_filename->raw()));
-#endif
-
-#endif
+ if (_handle->fp == NIL) return false;
return good();
}
filename test17("r/");
ASSERT_EQUAL(test17, astring("r\\"), GROUP + "test 17 failed");
filename test18("/kr/soop");
- ASSERT_NOT_EQUAL(test18, astring("\\kr\\soop"), GROUP + "test 18 failed");
+ ASSERT_INEQUAL(test18, astring("\\kr\\soop"), GROUP + "test 18 failed");
}
#endif
+++ /dev/null
-//need header here.
-
-// make ms be quiet about strncat.
-#define _CRT_SECURE_NO_WARNINGS
-
-#ifdef _MSC_VER
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-// turns the cygwin name format into a usable windos filename.
-char *translate_cygwin(char *fname)
-{
- int oldlen = strlen(fname);
- if (!strncmp(fname, "/cygdrive/", 10) && (oldlen > 10) ) {
- // in the first case the filename has /cygdrive in it, right at the front.
- char *newprefix = (char *)malloc(oldlen);
- // build the drive letter first.
- newprefix[0] = fname[10];
- newprefix[1] = ':';
- newprefix[2] = '\0';
- // concatenate the filename without cygdrive in it.
- strncat(newprefix, fname + 11, oldlen - 11 + 1); // one extra for null char.
- return newprefix; // mem leak here; cannot be helped for quick fix using functional style.
- } else if ( (fname[0] == '-') && (oldlen > 12)
- && (!strncmp(fname + 2, "/cygdrive/", 10)) ) {
- // in the second case we are looking for command line options. this code handles a parameter
- // that starts with a single dash and has a single flag character after that.
- char *newprefix = (char *)malloc(oldlen);
- newprefix[0] = fname[0];
- newprefix[1] = fname[1];
- newprefix[2] = fname[12];
- newprefix[3] = ':';
- newprefix[4] = '\0';
- // now concatenate the useful filename portion, offset by the flag found.
- strncat(newprefix, fname + 13, oldlen - 13 + 1); // one extra for null char.
- return newprefix;
- } else {
- return fname;
- }
-}
-
-
-/*
-
-function dossify_and_run_commands()
-{
-
-
- declare -a darc_commands=()
- for i in "$@"; do
- // we only mess with the command line on windows.
- if [ "$OS" == "Windows_NT" ]; then
- if [[ "$i" =~ ^-[a-zA-z][/\"].* ]]; then
-#echo matched on our pattern for parameters
- flag="${i:0:2}"
- filename="$(unix_to_dos_path ${i:2})"
-
-#echo "first two chars are $flag"
-#echo "last after that are $filename"
-#combined="$flag$filename"
-#echo combined is $combined
-
- darc_commands+=("$flag$filename")
- else
- darc_commands+=($(unix_to_dos_path $i))
- fi
- else
- darc_commands+=("$i")
- fi
- done
-
-}
-
-*/
-
-int main(int argc, char *argv[])
-{
- for (int i = 1; i < argc; i++) {
- printf("%s", translate_cygwin(argv[i]));
- }
- return 0;
-}
-
-#ifdef __BUILD_STATIC_APPLICATION__
- // static dependencies found by buildor_gen_deps.sh:
-#endif // __BUILD_STATIC_APPLICATION__
-
ifeq "$(OMIT_VERSIONS)" ""
SOURCE += clamtools_version.rc
endif
-TARGETS = cygwin_fixer.exe value_tagger.exe version_stamper.exe vsts_version_fixer.exe write_build_config.exe
+TARGETS = value_tagger.exe version_stamper.exe vsts_version_fixer.exe write_build_config.exe
include cpp/rules.def
{
LOG(a_sprintf("%s usage:", filename(_global_argv[0]).basename().raw().s()));
LOG("");
+
LOG("\
This utility scans a code base for outcome and filter definitions. It will\n\
only scan the header files (*.h) found in the directories specified. The\n\
# this flag selects whether to build with unicode enabled. this mainly affects
# win32 OSes, and right now we know it affects them badly if this is enabled.
# unix may build slightly differently too, such as for WX widgets.
-ifeq "$(OP_SYSTEM)" "WIN32"
-###
-### do not enable on win32 right now.
-### DEFINITIONS += UNICODE=t
-###
-else
- DEFINITIONS += UNICODE=t
+ifneq "$(OP_SYSTEM)" "WIN32"
+# DEFINITIONS += UNICODE=t
endif
# if this flag is turned on, then memory allocations will be trapped for
$(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_DIR)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
endif
$(HIDER)rm -f $(@:%.dll=%.lib)
+ echo about to run link tool.
$(CATCHER)$(LINK_TOOL) $(LINKER_OUTPUT_FLAG)$@ -dll $(LOAD_FLAG_PREFIX) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_RESX_FLAGS) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX)
+ echo ran link tool.
ifeq "$(COMPILER_VERSION)" "8"
$(HIDESH)$(CLAM_DIR)/cpp/ms_manifest.sh "$@" "2"
endif
# set these way up here so we can override them later.
CC = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/cl.exe
LINK_TOOL = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/link.exe
+ LIBRARY_TOOL = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/lib
# This is needed to protect against the use of 64-bit time_t structure
# on windows. We are casting to time_t from a 32-bit structure.
ifeq "$(COMPILER_VERSION)" "6"
COMPILER_HEADER_DIR = $(COMPILER_ROOT_DIR)/include $(COMPILER_ROOT_DIR)/atl/include
COMPILER_LIBRARY_DIR = $(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atl/lib
- RC = $(COMPILER_ROOT_DIR)/../common/msdev98/bin/rc
+ RC = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/../common/msdev98/bin/rc
endif
ifeq "$(COMPILER_VERSION)" "7"
COMPILER_HEADER_DIR = $(COMPILER_ROOT_DIR)/include $(COMPILER_ROOT_DIR)/atlmfc/include $(COMPILER_ROOT_DIR)/platformsdk/include $(FRAMEWORK_DIR)
COMPILER_LIBRARY_DIR = $(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atlmfc/lib $(COMPILER_ROOT_DIR)/platformsdk/lib
- RC = $(COMPILER_ROOT_DIR)/bin/rc
+ RC = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/rc
COMPILER_FLAGS += -Zc:forScope
# turn on proper loop scoping.
endif
ifeq "$(COMPILER_VERSION)" "8"
COMPILER_HEADER_DIR = $(COMPILER_ROOT_DIR)/include $(COMPILER_ROOT_DIR)/atlmfc/include $(COMPILER_ROOT_DIR)/platformsdk/include $(FRAMEWORK_DIR)
COMPILER_LIBRARY_DIR = $(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atlmfc/lib $(COMPILER_ROOT_DIR)/platformsdk/lib
- RC = $(COMPILER_ROOT_DIR)/bin/rc
+ RC = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(COMPILER_ROOT_DIR)/bin/rc
COMPILER_FLAGS += -Zc:forScope
# turn on proper loop scoping.
DEFINITIONS += _WIN32_WINNT=0x501
COMPILER_LIBRARY_DIR = $(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atlmfc/lib $(PLATYPUS)/lib
DEFINITIONS += _WIN32_WINNT=0x501
DEPENDENCY_DEFINITIONS += _WIN32_WINNT=0x501
- RC = $(PLATYPUS)/bin/rc
+ RC = $(BUILD_SCRIPTS_DIR)/wrapdoze.sh $(PLATYPUS)/bin/rc
COMPILER_FLAGS += -Zc:forScope
# turn on proper loop scoping.
endif
DEFINITIONS += _Windows _WINDOWS WIN32 __WIN32__ __FLAT__ VC_EXTRALEAN WIN32_LEAN_AND_MEAN ATL_NO_LEAN_AND_MEAN
DEF_FILE =
- LIBRARY_TOOL = $(COMPILER_ROOT_DIR)/bin/lib
LOAD_FLAG_PREFIX = -subsystem:windows -machine:X86 -nologo
LOAD_FLAG_SUFFIX =
promote version_stamper # used for version stamping.
promote vsts_version_fixer # used for version stamping.
promote write_build_config # creates a header of build-specific config info.
- promote cygwin_fixer # translates cygwin paths into dos-style equivalents.
popd &>/dev/null
fi
source $FEISTY_MEOW_SCRIPTS/core/functions.sh
+# for a windows build, this will replace any forward slashes
+# and other cygwin notation with the appropriate dos style paths.
function dossify_and_run_commands()
{
- # we only mess with the command line on windows...
if [ "$OS" != "Windows_NT" ]; then
# for non windows, just run the commands straight up.
eval "${@}"
return $?
fi
+ # force all slashes to be dossy.
+# export SERIOUS_SLASH_TREATMENT=true
+
declare -a darc_commands=()
-#hmmm: may need the serious slash treatment.
for i in "$@"; do
if [[ "$i" =~ ^-[a-zA-z][/\"].* ]]; then
real_commands+=($(echo $i | sed -e 's/\\/\\\\/g'))
done
-#temp!
- echo commands are now:
- for i in "${real_commands[@]}"; do
- echo -n "$i "
- done
- echo
-#end temp
+ if [ ! -z "$SHELL_DEBUG" ]; then
+ echo commands are now:
+ for i in "${real_commands[@]}"; do
+ echo -n "$i "
+ done
+ echo
+ fi
# now actually run the chewed command.
cmd /c "${real_commands[@]}"