Commit bd9ff04c authored by Felix Geyer's avatar Felix Geyer

Imported Upstream version 0.1.9998svn2543

parent beb92cf0
# $Id: Config.kmk 2266 2009-01-23 00:43:08Z bird $
# $Id: Config.kmk 2538 2011-08-02 20:00:46Z bird $
## @file
# Build Configuration.
#
#
# Copyright (c) 2005-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
# Copyright (c) 2005-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
......@@ -32,8 +32,8 @@ KBUILD_DO_AUTO_INSTALL := 1
#
KBUILD_VERSION_MAJOR = 0
KBUILD_VERSION_MINOR = 1
KBUILD_VERSION_PATCH = 98
KBUILD_VERSION = 0.1.98
KBUILD_VERSION_PATCH = 9998
KBUILD_VERSION = 0.1.9998
DEFS += \
KBUILD_VERSION_MAJOR=$(KBUILD_VERSION_MAJOR) \
KBUILD_VERSION_MINOR=$(KBUILD_VERSION_MINOR) \
......@@ -96,6 +96,16 @@ include $(KBUILD_SVN_INFO_KMK)
PATH_GNUMAKE_SRC ?= $(PATH_ROOT)/src/kmk
#
# Various platform specific hacks.
#
ifn1of ($(KBUILD_TARGET), openbsd)
GCC_Wextra = -Wextra
endif
if1of ($(KBUILD_TARGET), openbsd)
TOOL_FLEX_LEX = gflex
endif
#
# The OS and Architecture indicators.
#
......@@ -178,7 +188,7 @@ TEMPLATE_DOC_GID ?= $(firstword $(MY_INST_DOC_GID) $(MY_INST_GID))
#
# Template for building commandline tools.
#
TEMPLATE_BIN = Commandline binary
TEMPLATE_BIN = Command line binary
TEMPLATE_BIN_INCS = $(PATH_ROOT)/src/lib
TEMPLATE_BIN_DEFS.profile = NDEBUG
......@@ -203,19 +213,33 @@ endif
ifeq ($(KBUILD_TARGET),darwin)
ifndef KBUILD_MACOSX_VERSION
export KBUILD_MACOSX_VERSION := $(firstword $(subst ., ,$(shell uname -r)))
export KBUILD_MACOSX_VERSION := $(expr $(firstword $(subst ., ,$(shell uname -r))) - 4)
endif
ifndef KBUILD_MACOSX_TARGET_VERSION
if $(KBUILD_TARGET_ARCH) == amd64
KBUILD_MACOSX_TARGET_VERSION = 6
else
KBUILD_MACOSX_TARGET_VERSION = 4
endif
endif
if $(KBUILD_MACOSX_TARGET_VERSION) == 4
TOOL_GCC4MACHO_SUFFIX = -4.0
TOOL_GXX4MACHO_SUFFIX = -4.0
else if $(KBUILD_MACOSX_TARGET_VERSION) >= 5
TOOL_GCC4MACHO_SUFFIX = -4.2
TOOL_GXX4MACHO_SUFFIX = -4.2
endif
KBUILD_MACOSX_SDK ?= /Developer/SDKs/MacOSX10.4u.sdk
KBUILD_MACOSX_SDK ?= /Developer/SDKs/MacOSX10.$(KBUILD_MACOSX_TARGET_VERSION)$(if-expr $(KBUILD_MACOSX_TARGET_VERSION)==4,u,).sdk
TEMPLATE_BIN_TOOL = GCC4MACHO
TEMPLATE_BIN_CFLAGS = -g -mmacosx-version-min=10.4 -isysroot $(KBUILD_MACOSX_SDK)
TEMPLATE_BIN_CFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) -isysroot $(KBUILD_MACOSX_SDK)
ifeq ($(USER),bird)
TEMPLATE_BIN_CFLAGS += -Wall -Wextra -pedantic -Wno-unused-parameter
TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter -Wno-long-long
TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS
endif
TEMPLATE_BIN_CFLAGS.profile = -O3 -pg
TEMPLATE_BIN_CFLAGS.release = -O3
TEMPLATE_BIN_LDFLAGS = -g -mmacosx-version-min=10.4 -Wl,-syslibroot,$(KBUILD_MACOSX_SDK)
ifneq ($(int-ge $(KBUILD_MACOSX_VERSION),9),) # >= 10.5
TEMPLATE_BIN_LDFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) -Wl,-syslibroot,$(KBUILD_MACOSX_SDK)
if $(KBUILD_MACOSX_TARGET_VERSION) == 4 && $(KBUILD_MACOSX_VERSION) >= 5
TEMPLATE_BIN_LDFLAGS += -classic_ld
endif
TEMPLATE_BIN_LDFLAGS.profile = -pg
......@@ -270,7 +294,7 @@ ifndef TEMPLATE_BIN_TOOL
endif
TEMPLATE_BIN_CFLAGS = -g
ifeq ($(USER),bird)
TEMPLATE_BIN_CFLAGS += -Wall -Wextra -pedantic -Wno-unused-parameter
TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter
TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS
endif
TEMPLATE_BIN_LDFLAGS = -g
......@@ -296,10 +320,25 @@ ifndef TEMPLATE_BIN_TOOL
TEMPLATE_BIN_LDFLAGS.amd64 += -m64
TEMPLATE_BIN_LDFLAGS.sparc64 += -m64
ifeq ($(KBUILD_TARGET),solaris)
TEMPLATE_BIN_LIBS += rt
TEMPLATE_BIN_LIBS += rt dl
TEMPLATE_BIN_LDFLAGS += -Wl,-i
TEMPLATE_BIN_DEFS.x86 += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
TEMPLATE_BIN_DEFS.sparc32 += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
endif
endif
if1of ($(KBUILD_TARGET), darwin win)
TEMPLATE_BIN_LD_DEBUG = split
endif
#
# Template for building threaded binaries.
#
TEMPLATE_BIN-THREADED = Threaded command line binary
TEMPLATE_BIN-THREADED_EXTENDS = BIN
TEMPLATE_BIN-THREADED_EXTENDS_BY = appending
if1of ($(KBUILD_TARGET), dragonfly freebsd openbsd)
TEMPLATE_BIN-THREADED_LIBS = pthread
endif
#
# Template for building libraries for the tools.
......
# $Id: Maintenance.kmk 2243 2009-01-10 02:24:02Z bird $
# $Id: Maintenance.kmk 2413 2010-09-11 17:43:04Z bird $
## @file
# Maintenance Makefile for kBuild.
#
#
# Copyright (c) 2008-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
# Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
......
# $Id: Makefile.kmk 2243 2009-01-10 02:24:02Z bird $
# $Id: Makefile.kmk 2440 2011-07-06 12:17:51Z bird $
## @file
# Top-Level Sub-Makefile for kBuild.
#
#
# Copyright (c) 2005-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
# Copyright (c) 2005-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
......@@ -72,9 +72,6 @@ kBuild_bin_SOURCES.os2 = \
kBuild/bin/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/libc063.dll=>libc063.dll
if1of ($(KBUILD_TARGET), nt win)
kBuild_bin_SOURCES.$(KBUILD_TARGET) = \
kBuild/bin/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/kmk_ash.exe=>kmk_ash.exe \
kBuild/bin/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/cygwin1.dll=>cygwin1.dll
kBuild_bin_SOURCES.$(KBUILD_TARGET).x86 = \
kBuild/bin/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/msvcr71.dll=>msvcr71.dll
kBuild_bin_SOURCES.$(KBUILD_TARGET).amd64 = \
......
/* $Id: kdev.e 2243 2009-01-10 02:24:02Z bird $ -*- tab-width: 4 c-indent-level: 4 -*- */
/* $Id: kdev.e 2413 2010-09-11 17:43:04Z bird $ -*- tab-width: 4 c-indent-level: 4 -*- */
/** @file
* Visual SlickEdit Documentation Macros.
*/
/*
* Copyright (c) 1999-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
* Copyright (c) 1999-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
*
* This file is part of kBuild.
*
......@@ -69,7 +69,7 @@ def 'C-S-M' = k_javadoc_moduleheader
def 'C-S-O' = k_oneliner
def 'C-S-P' = k_mark_modified_line
def 'C-S-S' = k_box_structs
def 'C-S-T' = odin32_maketagfile
def 'C-S-T' = k_rebuild_tagfile
def 'C-S-L' = k_style_load
//optional stuff
......@@ -92,7 +92,7 @@ def 'C-S-L' = k_style_load
/* Remeber to change these! */
static _str skUserInitials = "bird";
static _str skUserName = "knut st. osmundsen";
static _str skUserEmail = "bird-kBuild-spamix@anduin.net";
static _str skUserEmail = "bird-kBuild-spamx@anduin.net";
/*******************************************************************************
......@@ -184,10 +184,22 @@ static boolean k_commentconfig(_str &sLeft, _str &sRight, int &iColumn, _str sEx
if (sLexer)
{
/* multiline */
#if __VERSION__>=14.0
_str aComments[];
GetComments(aComments, "mlcomment", sLexer)
for (i = 0; i < aComments._length(); i++)
if (!pos("documentation", aComments[i]) > 0)
{
sLine = aComments[i];
break;
}
if (sLine != '')
#else
rc = _ini_get_value(slick_path_search("user.vlx"), sLexer, 'mlcomment', sLine);
if (rc)
rc = _ini_get_value(slick_path_search("vslick.vlx"), sLexer, 'mlcomment', sLine);
if (!rc)
#endif
{
sLeft = strip(word(sLine, 1));
sRight = strip(word(sLine, 2));
......@@ -196,10 +208,21 @@ static boolean k_commentconfig(_str &sLeft, _str &sRight, int &iColumn, _str sEx
}
/* failed, try single line. */
#if __VERSION__>=14.0
GetComments(aComments, "linecomment", sLexer)
for (i = 0; i < aComments._length(); i++)
if (!pos("documentation", aComments[i]) > 0)
{
sLine = aComments[i];
break;
}
if (sLine != '')
#else
rc = _ini_get_value(slick_path_search("user.vlx"), sLexer, 'linecomment', sLine);
if (rc)
rc = _ini_get_value(slick_path_search("vslick.vlx"), sLexer, 'linecomment', sLine);
if (!rc)
#endif
{
sLeft = strip(word(sLine, 1));
sRight = '';
......@@ -1171,6 +1194,7 @@ void k_javadoc_funcbox()
_str sArgs = "";
int iCursorLine;
int iPadd = k_alignup(11, p_SyntaxIndent);
/* look for parameters */
boolean fFoundFn = !k_func_goto_nearest_function();
if (fFoundFn)
......@@ -1195,11 +1219,13 @@ void k_javadoc_funcbox()
for (i = 0; i < cArgs; i++)
{
_str sName, sType, sDefault;
if (!k_func_enumparams(sArgs, i, sType, sName, sDefault)
if ( !k_func_enumparams(sArgs, i, sType, sName, sDefault)
&& iPadd2 < length(sName))
iPadd2 = length(sName);
}
iPadd2 = k_alignup((iPadd + iPadd2), p_SyntaxIndent);
if (iPadd2 < 28)
iPadd2 = k_alignup(28, p_SyntaxIndent);
/*
* Insert parameter.
......@@ -1209,7 +1235,7 @@ void k_javadoc_funcbox()
_str sName, sType, sDefault;
if (!k_func_enumparams(sArgs, i, sType, sName, sDefault))
{
_str sStr3 = '';
_str sStr3 = '.';
if (sDefault != "")
sStr3 = '(default='sDefault')';
k_javadoc_box_line('@param', iPadd, sName, iPadd2, sStr3);
......@@ -1943,35 +1969,24 @@ static void klib_klog_file_int(boolean fAsk)
}
}
/*******************************************************************************
* Odin32 backward compatibility *
*******************************************************************************/
_command void odin32_maketagfile()
/** @todo move to kkeys.e */
_command void k_rebuild_tagfile()
{
/* We'll */
#if 1 /*__VERSION__ < 14.0*/
if (file_match('-p 'maybe_quote_filename(strip_filename(_project_name,'e'):+TAG_FILE_EXT),1) != "")
{
_project_update_files_retag(false,false,false,false);
/*
RetagFilesInTagFile2(project_tag_file, orig_view_id, temp_view_id, rebuild_all, false,
doRemove,false,true,true);*/
}
_project_update_files_retag(false, false, false, false);
else
_project_update_files_retag(true,false,false,true);
}
_command void odin32_setcurrentdir()
{
//_ini_get_value(_project_name,"COMPILER","WORKINGDIR", workingdir);
//cd(workingdir);
/* Go the the directory containing the project filename */
cd(strip_filename(_project_name, 'NE'));
_project_update_files_retag(true, false, false, true);
#else
_str sArgs = "-refs=on";
if (file_match('-p 'maybe_quote_filename(strip_filename(_project_name,'e'):+TAG_FILE_EXT),1) != "")
sArgs = sArgs :+ " -retag";
sArgs = sArgs :+ " " :+ _workspace_filename;
build_workspace_tagfiles(sArgs);
#endif
}
/*******************************************************************************
* Styles *
*******************************************************************************/
......@@ -2728,6 +2743,7 @@ static int k_style_emacs_var(_str sVar, _str sVal)
case 'nuke-trailing-whitespace-p':
{
#if 0
_str sName = 'def-koptions-'p_buf_id;
int idx = insert_name(sName, MISC_TYPE, "kstyledoc");
if (!idx)
......@@ -2740,6 +2756,7 @@ static int k_style_emacs_var(_str sVar, _str sVal)
set_name_info(idx, "saveoptions: -S");
say 'sVal=' sVal;
}
#endif
break;
}
......@@ -2872,12 +2889,17 @@ void k_style_load()
void _buffer_add_kdev(int buf_id)
{
_str sName = 'def-koptions-'buf_id;
int idx = insert_name(sName, MISC_TYPE, "kstyledoc");
if (!idx)
idx = find_index(sName, MISC_TYPE);
int idx = find_index(sName, MISC_TYPE);
if (idx)
delete_name(idx);
//message("_buffer_add_kdev: " idx " name=" sName);
sName = 'def-kstyledoc-'buf_id;
idx = find_index(sName, MISC_TYPE);
if (idx)
set_name_info(idx, "");
//message("_buffer_add_kdev: " idx);
delete_name(idx);
//k_style_load();
}
......@@ -3315,9 +3337,9 @@ btnCancel.lbutton_up()
definit()
{
/* do cleanup. */
for (i = 0; i < 200; i++)
for (i = 0; i < 999; i++)
{
index = name_match("def-koptions-", 1, MISC_TYPE);
index = name_match("def-koptions-", 1 /*find_first*/, MISC_TYPE);
if (!index)
break;
delete_name(index);
......
/* $Id: kkeys.e 2243 2009-01-10 02:24:02Z bird $ */
/* $Id: kkeys.e 2437 2011-03-28 19:17:08Z bird $ */
/** @file
* Bird's key additions to Visual Slickedit.
*/
/*
* Copyright (c) 2004-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
* Copyright (c) 2004-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
*
* This file is part of kBuild.
*
......@@ -23,6 +23,15 @@
*
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include 'slick.sh'
/*******************************************************************************
* Global Variables *
*******************************************************************************/
defeventtab default_keys
def 'A-UP' = find_prev
def 'A-DOWN' = find_next
......@@ -41,19 +50,54 @@ def 'C-DOWN' = kkeys_scroll_up
def 'C-PGUP' = prev_window
def 'C-PGDN' = next_window
def 'C-DEL' = kkeys_delete_right
#if __VERSION__ >= 15.0
def 'S-C-=' = svn_diff_with_base
#endif
#if __VERSION__ >= 14.0
def 'C-/' = kkeys_push_ref
def 'S-C-/' = push_ref
def 'S-A-]' = next_buff_tab
def 'S-A-[' = prev_buff_tab
def 'S-A-U' = kkeys_gen_uuid
#endif
/* For the mac (A/M mix, all except A-z): */
def 'M-1' = cursor_error
def 'M-UP' = find_prev
def 'M-DOWN' = find_next
def 'M-PGUP' = prev_proc
def 'M-PGDN' = next_proc
def 'M-d' = delete_line
def 'M-f' = kkeys_open_file_menu
def 'M-e' = kkeys_open_edit_menu
def 'M-o' = kkeys_duplicate_line
def 'M-s' = kkeys_switch_lines
def 'M-t' = kkeys_open_tools_menu
def 'M-u' = undo_cursor
def 'M-g' = goto_line
#if __VERSION__ >= 14.0
def 'S-M-]' = next_buff_tab
def 'S-M-[' = prev_buff_tab
def 'S-M-U' = kkeys_gen_uuid
#endif
/* Fixing brainfucked slickedit silliness: */
def 'M-v' = paste
/** Saves the cursor position. */
static long kkeys_save_cur_pos()
{
long offset = _QROffset();
message(offset);
return offset;
}
/** Restores a saved cursor position. */
static void kkeys_restore_cur_pos(long lSavedCurPos)
{
_GoToROffset(lSavedCurPos);
}
_command kkeys_switch_lines()
{
/* Allocate a selection for copying the current line. */
......@@ -91,18 +135,31 @@ _command kkeys_duplicate_line()
_command kkeys_delete_right()
{
col=p_col
search('[ \t]#|?|$|^','r+');
if ( match_length()&& get_text(1,match_length('s'))=='' )
col=p_col;
/* virtual space hack*/
keyin(" ");
left();
_delete_char();
/* are we in a word, delete it? */
ch = get_text();
if (ch != ' ' && ch != "\t" && ch != "\r" && ch != "\n")
delete_word();
/* delete spaces and newlines until the next word. */
ch = get_text();
if (ch == ' ' || ch == "\t" || ch == "\r" || ch == "\n")
{
_nrseek(match_length('s'));
_delete_text(match_length());
if (search('[ \t\n\r]#','r+') == 0)
{
_nrseek(match_length('s'));
_delete_text(match_length());
}
}
else
delete_word();
p_col=col
//retrieve_command_results()
}
_command kkeys_delete_left()
......@@ -140,11 +197,9 @@ _command kkeys_scroll_down()
_command boxer_paste()
{
int rc;
offset = _QROffset();
message(offset);
rc = paste();
_GoToROffset(offset);
long lSavedCurPos = kkeys_save_cur_pos()
paste();
kkeys_restore_cur_pos(lSavedCurPos);
}
_command kkeys_fullscreen()
......@@ -238,9 +293,117 @@ _command boxer_select()
}
}
#if __VERSION__ >= 14.0
/**
* Search for references only in the current workspace.
*/
_command kkeys_push_ref()
{
if (_isEditorCtl())
{
sProjTagFile = project_tags_filename();
sLangId = p_LangId;
if (sProjTagFile != '')
{
/* HACK ALERT: Make sure gtag_filelist_last_ext has the right value. */
_update_tag_filelist_ext(sLangId);
/* save */
boolean saved_gtag_filelist_cache_updated = gtag_filelist_cache_updated;
_str saved_gtag_filelist_ext[] = gtag_filelist_ext;
/* HACK ALERT: Replace the tag file list for this language. */
gtag_filelist_ext._makeempty();
gtag_filelist_ext[0] = sProjTagFile;
saved_gtag_filelist_cache_updated = true;
/* Do the reference searching. */
push_ref('-e ' :+ sLangId);
/* restore*/
gtag_filelist_cache_updated = saved_gtag_filelist_cache_updated;
gtag_filelist_ext = saved_gtag_filelist_ext;
}
else
push_ref();
}
else
push_ref();
}
_command kkeys_gen_uuid()
{
_str uuid = guid_create_string('G');
uuid = lowcase(uuid);
long lSavedCurPos = kkeys_save_cur_pos();
_insert_text(uuid);
kkeys_restore_cur_pos(lSavedCurPos);
}
#endif /* >= 14.0 */
/** @name Mac OS X Hacks: Alt+[fet] -> drop down menu
*
* This only works when the alt menu hotkeys are enabled in the
* settings. Al
*
* @{
*/
_command void kkeys_open_file_menu()
{
call_key(A_F)
}
_command void kkeys_open_edit_menu()
{
call_key(A_E)
}
_command void kkeys_open_tools_menu()
{
call_key(A_T)
}
/** @} */
void nop()
{
}
#if __VERSION__ >= 14.0
/*
* Some diff keyboard hacks for Mac OS X.
*/
defeventtab _diff_form
def 'M-f' = kkeys_diffedit_find
def 'M-n' = kkeys_diffedit_next
def 'M-p' = kkeys_diffedit_prev
_command kkeys_diffedit_find()
{
_nocheck _control _ctlfind;
_ctlfind.call_event(_ctlfind, LBUTTON_UP);
}
_command kkeys_diffedit_next()
{
_nocheck _control _ctlfile1;
_nocheck _control _ctlfile2;
_DiffNextDifference(_ctlfile1, _ctlfile2);
}
_command kkeys_diffedit_prev()
{
_nocheck _control _ctlfile1;
_nocheck _control _ctlfile2;
_DiffNextDifference(_ctlfile1, _ctlfile2, '-');
}
#endif /* >= 14.0 */
# $Id: bootstrap.gmk 2243 2009-01-10 02:24:02Z bird $
# $Id: bootstrap.gmk 2421 2010-10-17 21:27:53Z bird $
## @file
# GNU Make Compatible bootstrap Makefile.
#
#
# Copyright (c) 2007-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
# Copyright (c) 2007-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
#
# This file is part of kBuild.
#
......@@ -41,6 +41,9 @@
# Note to self on bootstrapping solaris.sparc64:
# SED_MAKE_DEFS="SED=gsed" AUTOPOINT=true ACLOCAL=aclocal-1.10 AUTOMAKE=automake-1.10 nice ./kBuild/env.sh --full gmake -f bootstrap.gmk
#
# Note to self on bootstrapping openbsd:
# AUTOCONF_VERSION=2.59 AUTOMAKE_VERSION=1.9 ./kBuild/env.sh --full gmake -f bootstrap.gmk
#
#
# OPTIONAL:
......@@ -215,11 +218,11 @@ $(OUTDIR)/ts-stage2-build: \