config.h: generate HAS_LIBREADLINE, do not add #include line for libreadline (yet) as this is wip

This commit is contained in:
stefan schippers 2024-05-01 11:53:54 +02:00
parent 43c7e08521
commit ba44bfb337
5 changed files with 37 additions and 29 deletions

View File

@ -2,6 +2,7 @@ put /local/xschem/cflags [@
@cc/cflags@ @cc/cflags@
@?libs/sul/libjpeg/cflags@ @?libs/sul/libjpeg/cflags@
@?libs/gui/cairo/cflags@ @?libs/gui/cairo/cflags@
@?libs/tty/readline/cflags@
@?libs/gui/xrender/cflags@ @?libs/gui/xrender/cflags@
@?libs/gui/xcb/cflags@ @?libs/gui/xcb/cflags@
@?libs/gui/xcb_render/cflags@ @?libs/gui/xcb_render/cflags@
@ -16,6 +17,7 @@ put /local/xschem/ldflags [@
-lm -lm
@?libs/sul/libjpeg/ldflags@ @?libs/sul/libjpeg/ldflags@
@?libs/gui/cairo/ldflags@ @?libs/gui/cairo/ldflags@
@?libs/tty/readline/ldflags@
@?libs/gui/xrender/ldflags@ @?libs/gui/xrender/ldflags@
@?libs/gui/xcb/ldflags@ @?libs/gui/xcb/ldflags@
@?libs/gui/xcb_render/ldflags@ @?libs/gui/xcb_render/ldflags@

View File

@ -12,6 +12,7 @@ put /local/xschem/includes [@
@] @]
uniq /local/xschem/includes uniq /local/xschem/includes
gsub /local/xschem/includes {[\\][n]} {\n}
put /tmpasm/IFS { \t\r\n} put /tmpasm/IFS { \t\r\n}
@ -24,6 +25,9 @@ print {\n\n/* Uncomment following line to work around some GPU problems in graph
print {/* with tiled fill pattern. Restore of damaged content will use XCopyArea() */\n} print {/* with tiled fill pattern. Restore of damaged content will use XCopyArea() */\n}
print {/* #define FIX_BROKEN_TILED_FILL 1 */} print {/* #define FIX_BROKEN_TILED_FILL 1 */}
print {\n\n/* Define this var if libreadline is available and is to be used */\n}
print_ternary ?libs/tty/readline/presents {#define HAS_LIBREADLINE 1} {/*#undef HAS_LIBREADLINE */}
print {\n\n/* Define this var if libjpeg is available and is to be used */\n} print {\n\n/* Define this var if libjpeg is available and is to be used */\n}
print_ternary ?libs/sul/libjpeg/presents {#define HAS_LIBJPEG 1} {/*#undef HAS_LIBJPEG */} print_ternary ?libs/sul/libjpeg/presents {#define HAS_LIBJPEG 1} {/*#undef HAS_LIBJPEG */}

View File

@ -53,7 +53,7 @@ include $(SRC)/parsgen/Makefile.plugin
include $(SRC)/gui/Makefile.plugin include $(SRC)/gui/Makefile.plugin
# Comment this line if you do not need tty (nurses, slang, pty-related calls) # Comment this line if you do not need tty (nurses, slang, pty-related calls)
#include $(SRC)/tty/Makefile.plugin include $(SRC)/tty/Makefile.plugin
# Comment this line if you do not need software utility libs (gen*, glib) # Comment this line if you do not need software utility libs (gen*, glib)
#include $(SRC)/sul/Makefile.plugin #include $(SRC)/sul/Makefile.plugin

View File

@ -297,6 +297,7 @@ int hook_detect_target()
require("fstools/awk", 0, 1); require("fstools/awk", 0, 1);
require("libs/gui/xpm/*", 0, 1); require("libs/gui/xpm/*", 0, 1);
require("libs/gui/cairo/*", 0, 0); require("libs/gui/cairo/*", 0, 0);
require("libs/tty/readline/*", 0, 0);
require("libs/sul/libjpeg/*", 0, 0); require("libs/sul/libjpeg/*", 0, 0);
/* require("libs/types/stdint/*", 0, 0); */ /* require("libs/types/stdint/*", 0, 0); */
require("sys/types/size/4_u_int", 0, 1); require("sys/types/size/4_u_int", 0, 1);
@ -372,6 +373,7 @@ int hook_generate()
printf(" tcl: %s\n", get("/target/libs/script/tcl/ldflags")); printf(" tcl: %s\n", get("/target/libs/script/tcl/ldflags"));
printf(" tk: %s\n", get("/target/libs/script/tk/ldflags")); printf(" tk: %s\n", get("/target/libs/script/tk/ldflags"));
printf(" cairo: %s\n", istrue(get("/target/libs/gui/cairo/presents")) ? "yes" : "no"); printf(" cairo: %s\n", istrue(get("/target/libs/gui/cairo/presents")) ? "yes" : "no");
printf(" readline: %s\n", istrue(get("/target/libs/tty/readline/presents")) ? "yes" : "no");
printf(" libjpeg: %s\n", istrue(get("/target/libs/sul/libjpeg/presents")) ? "yes" : "no"); printf(" libjpeg: %s\n", istrue(get("/target/libs/sul/libjpeg/presents")) ? "yes" : "no");
printf(" xcb: %s\n", istrue(get("/target/libs/gui/xcb/presents")) ? "yes" : "no"); printf(" xcb: %s\n", istrue(get("/target/libs/gui/xcb/presents")) ? "yes" : "no");

View File

@ -27,38 +27,38 @@
static void check_opt(char *opt, char *optval, int type) static void check_opt(char *opt, char *optval, int type)
{ {
if( (type == SHORT && *opt == 'd') || (type == LONG && !strcmp("debug", opt)) ) { if( (type == SHORT && *opt == 'd') || (type == LONG && !strcmp("debug", opt)) ) {
if(optval) debug_var=atoi(optval); if(optval) debug_var = atoi(optval);
else debug_var = 0; else debug_var = 0;
} else if( (type == SHORT && *opt == 'S') || (type == LONG && !strcmp("simulate", opt)) ) { } else if( (type == SHORT && *opt == 'S') || (type == LONG && !strcmp("simulate", opt)) ) {
dbg(1, "process_options(): will do simulation\n"); dbg(1, "process_options(): will do simulation\n");
cli_opt_do_simulation=1; cli_opt_do_simulation = 1;
} else if( (type == SHORT && *opt == 'W') || (type == LONG && !strcmp("waves", opt)) ) { } else if( (type == SHORT && *opt == 'W') || (type == LONG && !strcmp("waves", opt)) ) {
dbg(1, "process_options(): will show waves\n"); dbg(1, "process_options(): will show waves\n");
cli_opt_do_waves=1; cli_opt_do_waves = 1;
} else if( (type == SHORT && *opt == 'n') || (type == LONG && !strcmp("netlist", opt)) ) { } else if( (type == SHORT && *opt == 'n') || (type == LONG && !strcmp("netlist", opt)) ) {
dbg(1, "process_options(): will do netlist\n"); dbg(1, "process_options(): will do netlist\n");
cli_opt_do_netlist=1; cli_opt_do_netlist = 1;
} else if( (type == SHORT && *opt == 'f') || (type == LONG && !strcmp("flat_netlist", opt)) ) { } else if( (type == SHORT && *opt == 'f') || (type == LONG && !strcmp("flat_netlist", opt)) ) {
dbg(1, "process_options(): set flat netlist\n"); dbg(1, "process_options(): set flat netlist\n");
cli_opt_flat_netlist=1; cli_opt_flat_netlist = 1;
} else if( (type == SHORT && *opt == 'r') || (type == LONG && !strcmp("no_readline", opt)) ) { } else if( (type == SHORT && *opt == 'r') || (type == LONG && !strcmp("no_readline", opt)) ) {
cli_opt_no_readline=1; cli_opt_no_readline = 1;
} else if( (type == LONG && !strcmp("pipe", opt)) ) { } else if( (type == LONG && !strcmp("pipe", opt)) ) {
cli_opt_no_readline=1; cli_opt_no_readline = 1;
} else if( (type == SHORT && *opt == 'p') || (type == LONG && !strcmp("postscript", opt)) ) { } else if( (type == SHORT && *opt == 'p') || (type == LONG && !strcmp("postscript", opt)) ) {
dbg(1, "process_options(): will print postscript/pdf\n"); dbg(1, "process_options(): will print postscript/pdf\n");
cli_opt_do_print=1; cli_opt_do_print = 1;
} else if( (type == LONG && !strcmp("pdf", opt)) ) { } else if( (type == LONG && !strcmp("pdf", opt)) ) {
dbg(1, "process_options(): will print postscript/pdf\n"); dbg(1, "process_options(): will print postscript/pdf\n");
cli_opt_do_print=1; cli_opt_do_print = 1;
} else if( (type == LONG && !strcmp("plotfile", opt)) ) { } else if( (type == LONG && !strcmp("plotfile", opt)) ) {
dbg(1, "process_options(): user plotfile specified: %s\n", optval ? optval : "NULL"); dbg(1, "process_options(): user plotfile specified: %s\n", optval ? optval : "NULL");
@ -70,7 +70,7 @@ static void check_opt(char *opt, char *optval, int type)
} else if( (type == LONG && !strcmp("png", opt)) ) { } else if( (type == LONG && !strcmp("png", opt)) ) {
dbg(1, "process_options(): will print png\n"); dbg(1, "process_options(): will print png\n");
cli_opt_do_print=2; cli_opt_do_print = 2;
} else if( (type == LONG && !strcmp("preinit", opt)) ) { } else if( (type == LONG && !strcmp("preinit", opt)) ) {
dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval); dbg(1, "process_options(): passing tcl command to interpreter: %s\n", optval);
@ -94,26 +94,26 @@ static void check_opt(char *opt, char *optval, int type)
} else if( (type == LONG && !strcmp("tcp_port", opt)) ) { } else if( (type == LONG && !strcmp("tcp_port", opt)) ) {
dbg(1, "process_options(): setting tcp port: %s\n", optval); dbg(1, "process_options(): setting tcp port: %s\n", optval);
if(optval) tcp_port=atoi(optval); if(optval) tcp_port = atoi(optval);
else tcp_port = 0; else tcp_port = 0;
} else if( (type == LONG && !strcmp("svg", opt)) ) { } else if( (type == LONG && !strcmp("svg", opt)) ) {
dbg(1, "process_options(): will print png\n"); dbg(1, "process_options(): will print png\n");
cli_opt_do_print=3; cli_opt_do_print = 3;
} else if( (type == SHORT && *opt == 'c') || (type == LONG && !strcmp("color_ps", opt)) ) { } else if( (type == SHORT && *opt == 'c') || (type == LONG && !strcmp("color_ps", opt)) ) {
dbg(1, "process_options(): set color postscript\n"); dbg(1, "process_options(): set color postscript\n");
color_ps=1; color_ps = 1;
} else if( (type == SHORT && *opt == 'i') || (type == LONG && !strcmp("no_rcload", opt)) ) { } else if( (type == SHORT && *opt == 'i') || (type == LONG && !strcmp("no_rcload", opt)) ) {
cli_opt_load_initfile=0; cli_opt_load_initfile = 0;
} else if( (type == SHORT && *opt == 'l') || (type == LONG && !strcmp("log", opt)) ) { } else if( (type == SHORT && *opt == 'l') || (type == LONG && !strcmp("log", opt)) ) {
if(optval) { if(optval) {
errfp = fopen(optval, "w"); errfp = fopen(optval, "w");
setvbuf(errfp, NULL, _IOLBF, 0); /* line (_IOLBF) or disable (_IONBF) buffering on error log */ setvbuf(errfp, NULL, _IOLBF, 0); /* line (_IOLBF) or disable (_IONBF) buffering on error log */
if(!errfp) { if(!errfp) {
errfp=stderr; errfp = stderr;
dbg(0, "Problems opening log file: %s\n", optval); dbg(0, "Problems opening log file: %s\n", optval);
} }
} }
@ -126,44 +126,44 @@ static void check_opt(char *opt, char *optval, int type)
} else if( (type == SHORT && *opt == 's') || (type == LONG && !strcmp("spice", opt)) ) { } else if( (type == SHORT && *opt == 's') || (type == LONG && !strcmp("spice", opt)) ) {
dbg(1, "process_options(): set netlist type to spice\n"); dbg(1, "process_options(): set netlist type to spice\n");
cli_opt_netlist_type=CAD_SPICE_NETLIST; cli_opt_netlist_type = CAD_SPICE_NETLIST;
} else if( (type == SHORT && *opt == 'y') || (type == LONG && !strcmp("symbol", opt)) ) { } else if( (type == SHORT && *opt == 'y') || (type == LONG && !strcmp("symbol", opt)) ) {
dbg(1, "process_options(): set netlist type to symbol\n"); dbg(1, "process_options(): set netlist type to symbol\n");
cli_opt_netlist_type=CAD_SYMBOL_ATTRS; cli_opt_netlist_type = CAD_SYMBOL_ATTRS;
} else if( (type == SHORT && *opt == 'V') || (type == LONG && !strcmp("vhdl", opt)) ) { } else if( (type == SHORT && *opt == 'V') || (type == LONG && !strcmp("vhdl", opt)) ) {
dbg(1, "process_options(): set netlist type to vhdl\n"); dbg(1, "process_options(): set netlist type to vhdl\n");
cli_opt_netlist_type=CAD_VHDL_NETLIST; cli_opt_netlist_type = CAD_VHDL_NETLIST;
} else if( (type == SHORT && *opt == 'w') || (type == LONG && !strcmp("verilog", opt)) ) { } else if( (type == SHORT && *opt == 'w') || (type == LONG && !strcmp("verilog", opt)) ) {
dbg(1, "process_options(): set netlist type to verilog\n"); dbg(1, "process_options(): set netlist type to verilog\n");
cli_opt_netlist_type=CAD_VERILOG_NETLIST; cli_opt_netlist_type = CAD_VERILOG_NETLIST;
} else if( (type == SHORT && *opt == 'b') || (type == LONG && !strcmp("detach", opt)) ) { } else if( (type == SHORT && *opt == 'b') || (type == LONG && !strcmp("detach", opt)) ) {
cli_opt_detach = 1; cli_opt_detach = 1;
} else if( (type == SHORT && *opt == 'v') || (type == LONG && !strcmp("version", opt)) ) { } else if( (type == SHORT && *opt == 'v') || (type == LONG && !strcmp("version", opt)) ) {
print_version(); print_version();
cli_opt_quit=1; cli_opt_quit = 1;
has_x=0; has_x = 0;
} else if( (type == SHORT && *opt == 't') || (type == LONG && !strcmp("tedax", opt)) ) { } else if( (type == SHORT && *opt == 't') || (type == LONG && !strcmp("tedax", opt)) ) {
dbg(1, "process_options(): set netlist type to tEDAx\n"); dbg(1, "process_options(): set netlist type to tEDAx\n");
cli_opt_netlist_type=CAD_TEDAX_NETLIST; cli_opt_netlist_type = CAD_TEDAX_NETLIST;
} else if( (type == SHORT && *opt == 'q') || (type == LONG && !strcmp("quit", opt)) ) { } else if( (type == SHORT && *opt == 'q') || (type == LONG && !strcmp("quit", opt)) ) {
cli_opt_quit=1; cli_opt_quit = 1;
} else if( (type == SHORT && *opt == 'x') || (type == LONG && !strcmp("no_x", opt)) ) { } else if( (type == SHORT && *opt == 'x') || (type == LONG && !strcmp("no_x", opt)) ) {
has_x=0; has_x = 0;
} else if( (type == SHORT && *opt == 'z') || (type == LONG && !strcmp("rainbow", opt)) ) { } else if( (type == SHORT && *opt == 'z') || (type == LONG && !strcmp("rainbow", opt)) ) {
rainbow_colors=1; rainbow_colors = 1;
} else if( (type == SHORT && *opt == 'h') || (type == LONG && !strcmp("help", opt)) ) { } else if( (type == SHORT && *opt == 'h') || (type == LONG && !strcmp("help", opt)) ) {
help=1; help = 1;
cli_opt_quit=1; cli_opt_quit = 1;
has_x=0; has_x = 0;
} else { } else {
fprintf(errfp, "Unknown option: %s\n", opt); fprintf(errfp, "Unknown option: %s\n", opt);
} }