Index: trunk/Makefile.tmpl =================================================================== --- trunk/Makefile.tmpl (nonexistent) +++ trunk/Makefile.tmpl (revision 350) @@ -0,0 +1,2 @@ +# common template to be included in any Makefile.in + Index: trunk/config.h =================================================================== Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (nonexistent) +++ trunk/config.h.in (revision 350) @@ -0,0 +1 @@ + Index: trunk/configure =================================================================== --- trunk/configure (nonexistent) +++ trunk/configure (revision 350) @@ -0,0 +1,4 @@ +#!/bin/sh +cd scconfig +make +./configure "$@" Property changes on: trunk/configure ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: trunk/scconfig/Makefile =================================================================== --- trunk/scconfig/Makefile (nonexistent) +++ trunk/scconfig/Makefile (revision 350) @@ -0,0 +1,86 @@ +# --- configuration part -- + +# - generic configuration - +# where scconfig source is; this is a path to a partial or full checkout of +# svn://repo.hu/scconfig/trunk/src +SRC=src/ + +# where compiled binaries (e.g. objects) should land; should be the same as +# $(SRC) the project has its own copy of scconfig embedded +BIN=src/ + +# what cflags to use to compile scconfig +#USER_CFLAGS = -Wall -g +# -DGENCALL + +# what ldflags to use to link scconfig +USER_LDFLAGS = + +# in case hooks.c needs to link to something local +USER_OBJS = + +# what to build - a ./configure +all: configure + +# This line imports scconfig core and default tests +include $(SRC)/default/Makefile.plugin + +# +# - PLUGINS - +# +# Comment this line if you are not interested in c99 features +#include $(SRC)/c99/Makefile.plugin + +# Comment this line if you do not need script libs to be detected +#include $(SRC)/scripts/Makefile.plugin + +# Comment this line if you do not need parser libs to be detected +#include $(SRC)/parser/Makefile.plugin + +# Comment this line if you do not need to detect parser generators +#include $(SRC)/parsgen/Makefile.plugin + +# Comment this line if you do not need math related libs +#include $(SRC)/math/Makefile.plugin + +# Comment this line if you do not need socket/networking +#include $(SRC)/socket/Makefile.plugin + +# Comment this line if you do not need user/password API detection +#include $(SRC)/userpass/Makefile.plugin + +# Comment this line if you do not need gui (X11, toolkits) +#include $(SRC)/gui/Makefile.plugin + +# Comment this line if you do not need tty (nurses, slang, pty-related calls) +#include $(SRC)/tty/Makefile.plugin + +# Comment this line if you do not need software utility libs (gen*, glib) +#include $(SRC)/sul/Makefile.plugin + +# Comment this line if you do not need to detect POSIX calls +#include $(SRC)/posix/Makefile.plugin + +# Uncomment this line if you need menus +#include $(SRC)/menulib/Makefile.plugin + +# Comment this line if you do not need generator (templating); conflicts with tmpasm +#include $(SRC)/generator/Makefile.plugin + +# Comment this line if you do not need tmpasm (templating); conflicts with generator +include $(SRC)/tmpasm/Makefile.plugin + +# --- you shouldn't edit the lines below --- +OBJS = $(USER_OBJS) hooks.o $(DEFAULT_NOMAIN_OBJS) $(SCRIPT_OBJS) $(PARSER_OBJS) $(GENERATOR_OBJS) $(TMPASM_OBJS) $(C99_OBJS) $(PARSGEN_OBJS) $(MATH_OBJS) $(SOCKET_OBJS) $(USERPASS_OBJS) $(GUI_OBJS) $(TTY_OBJS) $(SUL_OBJS) $(POSIX_OBJS) +CFLAGS = $(USER_CFLAGS) $(DEFAULT_CFLAGS) $(SCRIPT_CFLAGS) $(PARSER_CFLAGS) $(GENERATOR_CFLAGS) $(TMPASM_CFLAGS) $(C99_CFLAGS) $(PARSGEN_CFLAGS) $(MATH_CFLAGS) $(SOCKET_CFLAGS) $(USERPASS_CFLAGS) $(GUI_CFLAGS) $(TTY_CFLAGS) $(SUL_CFLAGS) $(POSIX_CFLAGS) $(MENULIB_CFLAGS) -I$(SRC)/default +LDFLAGS = $(USER_LDFLAGS) $(DEFAULT_LDFLAGS) $(SCRIPT_LDFLAGS) $(PARSER_LDFLAGS) $(GENERATOR_LDFLAGS) $(TMPASM_LDFLAGS) $(C99_LDFLAGS) $(PARSGEN_LDFLAGS) $(MATH_LDFLAGS) $(SOCKET_LDFLAGS) $(USERPASS_LDFLAGS) $(GUI_LDFLAGS) $(TTY_LDFLAGS) $(SUL_LDFLAGS) $(POSIX_LDFLAGS) $(MENULIB_LDFLAGS) + +configure: $(OBJS) $(DEFAULT_MAIN_OBJS) + $(CC) -o configure $(OBJS) $(DEFAULT_MAIN_OBJS) + +menuconfig: $(OBJS) $(MENULIB_OBJS) + $(CC) -o configure $(OBJS) $(MENULIB_OBJS) + +clean: + rm $(OBJS) $(DEFAULT_MAIN_OBJS) configure + Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (nonexistent) +++ trunk/scconfig/hooks.c (revision 350) @@ -0,0 +1,122 @@ +#include +#include +#include "arg.h" +#include "log.h" +#include "dep.h" +#include "db.h" +#include "libs.h" +#include "tmpasm_scconfig.h" + +/* Runs when a custom command line argument is found + returns true if no furhter argument processing should be done */ +int hook_custom_arg(const char *key, const char *value) +{ + if (strcmp(key, "debug") == 0) { + put("/local/csch/debug", strue); +/* pup_set_debug(strue);*/ + return 1; + } + if (strcmp(key, "profile") == 0) { + put("/local/csch/profile", strue); + return 1; + } + return 0; +} + + +/* Runs before anything else */ +int hook_preinit() +{ + return 0; +} + +/* Runs after initialization */ +int hook_postinit() +{ + db_mkdir("/local"); + db_mkdir("/local/csch"); + + /* defaults */ + put("/local/csch/debug", sfalse); + put("/local/csch/profile", sfalse); + return 0; +} + +/* Runs after all arguments are read and parsed */ +int hook_postarg() +{ + return 0; +} + +/* Runs when things should be detected for the host system */ +int hook_detect_host() +{ + return 0; +} + +/* Runs when things should be detected for the target system */ +int hook_detect_target() +{ + const char *host_ansi, *host_ped, *target_ansi, *target_ped, *target_pg, *target_no_pie; + require("cc/cc", 0, 1); + + require("cc/fpic", 0, 0); + host_ansi = get("/host/cc/argstd/ansi"); + host_ped = get("/host/cc/argstd/pedantic"); + target_ansi = get("/target/cc/argstd/ansi"); + target_ped = get("/target/cc/argstd/pedantic"); + target_pg = get("/target/cc/argstd/pg"); + target_no_pie = get("/target/cc/argstd/no-pie"); + + { /* need to set debug flags here to make sure libs are detected with the modified cflags; -ansi matters in what #defines we need for some #includes */ + const char *tmp, *fpic, *debug; + fpic = get("/target/cc/fpic"); + if (fpic == NULL) fpic = ""; + debug = get("/arg/debug"); + if (debug == NULL) debug = ""; + tmp = str_concat(" ", fpic, debug, NULL); + put("/local/global_cflags", tmp); + + /* for --debug mode, use -ansi -pedantic for all detection */ + put("/local/cc_flags_save", get("/target/cc/cflags")); + if (istrue(get("/local/csch/debug"))) { + append("/target/cc/cflags", " "); + append("/target/cc/cflags", target_ansi); + append("/target/cc/cflags", " "); + append("/target/cc/cflags", target_ped); + } + if (istrue(get("/local/csch/profile"))) { + append("/target/cc/cflags", " "); + append("/target/cc/cflags", target_pg); + append("/target/cc/cflags", " "); + append("/target/cc/cflags", target_no_pie); + } + } + + return 0; +} + +static const char *IS_OK(int val) +{ + if (val == 0) return "ok"; + return "ERROR"; +} + +/* Runs after detection hooks, should generate the output (Makefiles, etc.) */ +int hook_generate() +{ + printf("Generating config.h... %s\n", IS_OK(tmpasm(NULL, "../config.h.in", "../config.h"))); + printf("Generating src/libcschem/Makefile... %s\n", IS_OK(tmpasm(NULL, "../src/libcschem/Makefile.in", "../src/libcschem/Makefile"))); + return 0; +} + +/* Runs before everything is uninitialized */ +void hook_preuninit() +{ +} + +/* Runs at the very end, when everything is already uninitialized */ +void hook_postuninit() +{ +} + Index: trunk/scconfig =================================================================== --- trunk/scconfig (nonexistent) +++ trunk/scconfig (revision 350) Property changes on: trunk/scconfig ___________________________________________________________________ Added: svn:externals ## -0,0 +1 ## +svn://repo.hu/scconfig/trunk/src src Index: trunk/src/libcschem/Makefile =================================================================== --- trunk/src/libcschem/Makefile (revision 349) +++ trunk/src/libcschem/Makefile (nonexistent) @@ -1,13 +0,0 @@ -CFLAGS = -I.. -I../../src_3rd -CFLAGS += -Wall -g -CFLAGS += -ansi -pedantic -OBJS = compile.o vtcoutline.o vtoid.o rtree.o - -all: $(OBJS) - -compile.o: compile.c - -vtcoutline.o: vtcoutline.c - -clean: - rm $(OBJS) Index: trunk/src/libcschem/Makefile.in =================================================================== --- trunk/src/libcschem/Makefile.in (nonexistent) +++ trunk/src/libcschem/Makefile.in (revision 350) @@ -0,0 +1,15 @@ +print [@ +CFLAGS = -I.. -I../../src_3rd +CFLAGS += -Wall -g +CFLAGS += -ansi -pedantic +OBJS = compile.o vtcoutline.o vtoid.o rtree.o + +all: $(OBJS) + +compile.o: compile.c + +vtcoutline.o: vtcoutline.c + +clean: + rm $(OBJS) +@] Index: trunk/src_3rd =================================================================== --- trunk/src_3rd (revision 349) +++ trunk/src_3rd (revision 350) Property changes on: trunk/src_3rd ___________________________________________________________________ Modified: svn:externals ## -1,3 +1,4 ## genht svn://svn.repo.hu/genht/trunk/src libminuid svn://svn.repo.hu/libminuid/trunk/libminuid genvector svn://svn.repo.hu/genvector/trunk/genvector +genrtree svn://svn.repo.hu/genrtree/trunk/genrtree