From 9238b587210c53ba51dd665ffb9ff3e13456880f Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 4 Feb 2018 23:39:01 -0800 Subject: WIP: autotoolization Signed-off-by: Alexey Neyman --- kconfig/Makefile.am | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 kconfig/Makefile.am (limited to 'kconfig/Makefile.am') diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am new file mode 100644 index 00000000..dfb8617b --- /dev/null +++ b/kconfig/Makefile.am @@ -0,0 +1,33 @@ +## Process this file with automake to produce Makefile.in +## vim: set noet : + +## TBD install into lib/crosstool-ng/kconfig? +## TBD turn off program renaming for these? Or account for it in ct-ng script? +pkglibexec_PROGRAMS = conf + +AM_LFLAGS = -L -Pzconf +AM_YFLAGS = -l -b zconf -p zconf + +BUILT_SOURCES = zconf.c zconf.lex.c + +AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\" +conf_SOURCES = conf.c zconf.c + +# automake's support for yacc/lex/gperf is too idiosyncratic. It doesn't +# support a common pattern of including lex-generated file into yacc, nor does +# it support using a different base name for the generated C files. +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; + +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; + +zconf.c: zconf.y + $(AM_V_YACC)$(YACCCOMPILE) -o$@ $< + +zconf.lex.c: zconf.l + $(AM_V_LEX)$(LEXCOMPILE) -o$@ $< -- cgit v1.2.3 From 9a4e17cf9b0e27a9af49da932db96ccb19aeb1f7 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 17 Feb 2018 12:59:26 -0800 Subject: Add nconf build Signed-off-by: Alexey Neyman --- kconfig/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'kconfig/Makefile.am') diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index dfb8617b..66df802c 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -3,7 +3,7 @@ ## TBD install into lib/crosstool-ng/kconfig? ## TBD turn off program renaming for these? Or account for it in ct-ng script? -pkglibexec_PROGRAMS = conf +pkglibexec_PROGRAMS = conf nconf AM_LFLAGS = -L -Pzconf AM_YFLAGS = -l -b zconf -p zconf @@ -11,8 +11,13 @@ AM_YFLAGS = -l -b zconf -p zconf BUILT_SOURCES = zconf.c zconf.lex.c AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\" + conf_SOURCES = conf.c zconf.c +nconf_SOURCES = nconf.c nconf.gui.c zconf.c +nconf_CFLAGS = $(CURSES_CFLAGS) +nconf_LDADD = $(MENU_LIBS) $(PANEL_LIBS) $(CURSES_LIBS) + # automake's support for yacc/lex/gperf is too idiosyncratic. It doesn't # support a common pattern of including lex-generated file into yacc, nor does # it support using a different base name for the generated C files. -- cgit v1.2.3 From d9d4d090265b56dc158b9ffa7a875d0a68f9c57f Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 17 Feb 2018 18:24:27 -0800 Subject: Enable mconf build Signed-off-by: Alexey Neyman --- configure.ac | 2 +- kconfig/Makefile.am | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'kconfig/Makefile.am') diff --git a/configure.ac b/configure.ac index 02f91e09..bd7ccb48 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AC_CONFIG_AUX_DIR([scripts]) AC_CONFIG_MACRO_DIR([m4]) # TBD try to use gnu strictness? Just add the missing files? -AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2 subdir-objects]) #-------------------------------------------------------------------- # Allow dummy --{en,dis}able-{static,shared} diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 66df802c..1b4a06ca 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -1,9 +1,8 @@ -## Process this file with automake to produce Makefile.in ## vim: set noet : ## TBD install into lib/crosstool-ng/kconfig? ## TBD turn off program renaming for these? Or account for it in ct-ng script? -pkglibexec_PROGRAMS = conf nconf +pkglibexec_PROGRAMS = conf nconf mconf AM_LFLAGS = -L -Pzconf AM_YFLAGS = -l -b zconf -p zconf @@ -18,6 +17,11 @@ nconf_SOURCES = nconf.c nconf.gui.c zconf.c nconf_CFLAGS = $(CURSES_CFLAGS) nconf_LDADD = $(MENU_LIBS) $(PANEL_LIBS) $(CURSES_LIBS) +mconf_SOURCES = mconf.c zconf.c lxdialog/checklist.c lxdialog/inputbox.c \ + lxdialog/menubox.c lxdialog/textbox.c lxdialog/util.c \ + lxdialog/yesno.c +mconf_LDADD = $(CURSES_LIBS) + # automake's support for yacc/lex/gperf is too idiosyncratic. It doesn't # support a common pattern of including lex-generated file into yacc, nor does # it support using a different base name for the generated C files. -- cgit v1.2.3 From dbe3877285549d1cdc549826673cdf8f07cf154c Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 21 Feb 2018 23:34:58 -0800 Subject: Install ct-ng Also, move kconfig.mk into the main driver - we'd want kconfig to be a sub-package so there's no sense in writing the installation framework for the ct-ng-specific fragment in an otherwise independent directory. Signed-off-by: Alexey Neyman --- Makefile.am | 14 ++++++++++ ct-ng.in | 74 ++++++++++++++++++++++++++++++++++++++++++++++++----- kconfig/Makefile.am | 4 ++- kconfig/kconfig.mk | 68 ------------------------------------------------ 4 files changed, 84 insertions(+), 76 deletions(-) delete mode 100644 kconfig/kconfig.mk (limited to 'kconfig/Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8e25898f..37996f85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,3 +2,17 @@ ## vim: set noet : SUBDIRS = kconfig + +bin_SCRIPTS = ct-ng +CLEANFILES = $(bin_SCRIPTS) +EXTRA_DIST = ct-ng.in bootstrap + +do_subst = ( @SED@ \ + -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]libdir[@],$(libdir),g' \ + -e 's,[@]docdir[@],$(docdir),g' \ + -e 's,[@]mandir[@],$(mandir),g' \ + | $(SHELL) config.status --file=- ) + +ct-ng: ct-ng.in + $(AM_V_GEN)$(do_subst) < $< >$@-t && chmod a-w,a+x $@-t && mv $@-t $@ diff --git a/ct-ng.in b/ct-ng.in index a8ad09d0..7e0368dc 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -1,4 +1,4 @@ -#!@@CT_make@@ -rf +#!@MAKE@ -rf # Makefile for crosstool-NG. # Copyright 2006 Yann E. MORIN @@ -16,11 +16,11 @@ export CT_TOP_DIR:=$(shell pwd) # Paths and values set by ./configure # Don't bother to change it other than with a new ./configure! -export CT_LIB_DIR:=@@CT_LIBDIR@@ -export CT_DOC_DIR:=@@CT_DOCDIR@@ +export CT_LIB_DIR:=@libdir@ +export CT_DOC_DIR:=@docdir@ # This is crosstool-NG version string -export CT_VERSION:=@@CT_VERSION@@ +export CT_VERSION:=@PACKAGE_VERSION@ # Paths found by ./configure include $(CT_LIB_DIR)/paths.mk @@ -62,6 +62,59 @@ all: help PHONY += all FORCE: +# Configuration rules. Currently, saveSample.sh uses some of the variables +# below - they should be passed explicitly. + +# Top file of crosstool-NG configuration +export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in + +# We need CONF for savedefconfig in scripts/saveSample.sh +export CONF := $(CT_LIB_DIR)/kconfig/conf +MCONF := $(CT_LIB_DIR)/kconfig/mconf +NCONF := $(CT_LIB_DIR)/kconfig/nconf + +# Used by conf/mconf/nconf to find the .in files +# TBD needed? We do supply the defconfig name explicitly below +export srctree=$(CT_LIB_DIR) + +.PHONY: menuconfig nconfig oldconfig savedefconfig defconfig + +menuconfig: + @$(CT_ECHO) " CONF $@" + $(SILENT)$(MCONF) $(KCONFIG_TOP) + +nconfig: + @$(CT_ECHO) " CONF $@" + $(SILENT)$(NCONF) $(KCONFIG_TOP) + +oldconfig: .config + @$(CT_ECHO) " CONF $@" + $(SILENT)$(sed) -i -r -f $(CT_LIB_DIR)/scripts/upgrade.sed $< + $(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP) + +savedefconfig: .config + @$(CT_ECHO) ' GEN $@' + $(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) + +defconfig: + @$(CT_ECHO) ' CONF $@' + $(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) + +# Always be silent, the stdout an be >.config +extractconfig: + @$(awk) 'BEGIN { dump=0; } \ + dump==1 && $$0~/^\[.....\][[:space:]]+(# )?CT_/ { \ + $$1=""; \ + gsub("^[[:space:]]",""); \ + print; \ + } \ + $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \ + dump=0; \ + } \ + $$0~/Dumping user-supplied crosstool-NG configuration$$/ { \ + dump=1; \ + }' + # Help system help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail @@ -90,8 +143,8 @@ help-distrib:: help-env:: @echo - @if [ -r "@@CT_DOCDIR@@/manual/4_Building.md" ]; then \ - echo 'Environment variables (see @@CT_DOCDIR@@/0 - Table of content.txt):'; \ + @if [ -r "@docdir@/manual/4_Building.md" ]; then \ + echo 'Environment variables (see @docdir@/0 - Table of content.txt):'; \ else \ echo 'Environment variables (see http://crosstool-ng.github.io/docs/build/)'; \ fi @@ -111,12 +164,19 @@ help-clean:: @echo ' clean - Remove generated files' @echo ' distclean - Remove generated files, configuration and build directories' -include $(CT_LIB_DIR)/kconfig/kconfig.mk include $(CT_LIB_DIR)/steps.mk include $(CT_LIB_DIR)/samples/samples.mk include $(CT_LIB_DIR)/scripts/scripts.mk help-config:: + @echo ' menuconfig - Update current config using a menu based program' + @echo ' nconfig - Update current config using a menu based program' + @echo ' oldconfig - Update current config using a provided .config as base' + @echo ' extractconfig - Extract to stdout the configuration items from a' + @echo ' build.log file piped to stdin' + @echo ' savedefconfig - Save current config as a mini-defconfig to $${DEFCONFIG}' + @echo ' defconfig - Update config from a mini-defconfig $${DEFCONFIG}' + @echo ' (default: $${DEFCONFIG}=./defconfig)' @echo ' show-tuple - Print the tuple of the currently configured toolchain' help-distrib:: diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 1b4a06ca..413d9446 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -1,7 +1,9 @@ ## vim: set noet : -## TBD install into lib/crosstool-ng/kconfig? ## TBD turn off program renaming for these? Or account for it in ct-ng script? +transform = s,x,x, + +## TBD install into lib/crosstool-ng/kconfig? or move to libexec which seems more suitable pkglibexec_PROGRAMS = conf nconf mconf AM_LFLAGS = -L -Pzconf diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk deleted file mode 100644 index c489c724..00000000 --- a/kconfig/kconfig.mk +++ /dev/null @@ -1,68 +0,0 @@ -# =========================================================================== -# crosstool-NG configuration targets -# These targets are used from top-level makefile - -#----------------------------------------------------------- -# The configurators rules - -# Top file of crosstool-NG configuration -export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in - -# We need CONF for savedefconfig in scripts/saveSample.sh -export CONF := $(CT_LIB_DIR)/kconfig/conf -MCONF := $(CT_LIB_DIR)/kconfig/mconf -NCONF := $(CT_LIB_DIR)/kconfig/nconf - -# Used by conf/mconf/nconf to find the .in files -export srctree=$(CT_LIB_DIR) - -.PHONY: menuconfig nconfig oldconfig savedefconfig defconfig - -menuconfig: - @$(CT_ECHO) " CONF $@" - $(SILENT)$(MCONF) $(KCONFIG_TOP) - -nconfig: - @$(CT_ECHO) " CONF $@" - $(SILENT)$(NCONF) $(KCONFIG_TOP) - -oldconfig: .config - @$(CT_ECHO) " CONF $@" - $(SILENT)$(sed) -i -r -f $(CT_LIB_DIR)/scripts/upgrade.sed $< - $(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP) - -savedefconfig: .config - @$(CT_ECHO) ' GEN $@' - $(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) - -defconfig: - @$(CT_ECHO) ' CONF $@' - $(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) - -# Always be silent, the stdout an be >.config -extractconfig: - @$(awk) 'BEGIN { dump=0; } \ - dump==1 && $$0~/^\[.....\][[:space:]]+(# )?CT_/ { \ - $$1=""; \ - gsub("^[[:space:]]",""); \ - print; \ - } \ - $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \ - dump=0; \ - } \ - $$0~/Dumping user-supplied crosstool-NG configuration$$/ { \ - dump=1; \ - }' - -#----------------------------------------------------------- -# Help text used by make help - -help-config:: - @echo ' menuconfig - Update current config using a menu based program' - @echo ' nconfig - Update current config using a menu based program' - @echo ' oldconfig - Update current config using a provided .config as base' - @echo ' extractconfig - Extract to stdout the configuration items from a' - @echo ' build.log file piped to stdin' - @echo ' savedefconfig - Save current config as a mini-defconfig to $${DEFCONFIG}' - @echo ' defconfig - Update config from a mini-defconfig $${DEFCONFIG}' - @echo ' (default: $${DEFCONFIG}=./defconfig)' -- cgit v1.2.3 From 9dc94f36627ec79721e485bb4ae50af9fb67c9fc Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 23 Feb 2018 19:05:41 -0800 Subject: Install "pure data" directories ... and update .gitignore. Survives 'make distcheck'. Signed-off-by: Alexey Neyman --- .gitignore | 10 ++++------ Makefile.am | 4 ++++ bootstrap | 9 +++++++++ configure.ac | 6 +++++- kconfig/Makefile.am | 9 +++++++-- scripts/ylwrap | 1 - 6 files changed, 29 insertions(+), 10 deletions(-) delete mode 120000 scripts/ylwrap (limited to 'kconfig/Makefile.am') diff --git a/.gitignore b/.gitignore index 292a4f51..eb7d4912 100644 --- a/.gitignore +++ b/.gitignore @@ -7,15 +7,15 @@ config.log config.status Makefile Makefile.in -*ct-ng* +ct-ng !ct-ng.comp !ct-ng.in paths.* -!paths.in config/configure.in config/gen/ config/versions/ .config +verbatim-data.mk maintainer/package-versions # Temporaries @@ -26,9 +26,7 @@ temp.* # This is the place where toolchains are built .build/ -# .. and the legacy location -targets/ # .. and log for 'build-all' -.build-all +.build-all/ # .. and release creation -release +release/ diff --git a/Makefile.am b/Makefile.am index 37996f85..c58c45fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,12 +1,16 @@ ## Process this file with automake to produce Makefile.in ## vim: set noet : +include verbatim-data.mk + SUBDIRS = kconfig bin_SCRIPTS = ct-ng CLEANFILES = $(bin_SCRIPTS) EXTRA_DIST = ct-ng.in bootstrap +nobase_dist_pkgdata_DATA = $(verbatim_data) + do_subst = ( @SED@ \ -e 's,[@]bindir[@],$(bindir),g' \ -e 's,[@]libdir[@],$(libdir),g' \ diff --git a/bootstrap b/bootstrap index 25453de2..d5d17d4d 100755 --- a/bootstrap +++ b/bootstrap @@ -738,6 +738,15 @@ gen_selection menu debug "Debug facilities" gen_selection menu comp_tools "Companion tools" gen_selection menu comp_libs "Companion libraries" +msg "*** Gathering the list of data files to install" +{ + echo -n "verbatim_data =" + find config contrib packages samples scripts -type f | LANG=C sort | while read f; do + echo " \\" + echo -n " ${f}" + done +} > verbatim-data.mk + msg "*** Running autoreconf" autoreconf -Wall --force diff --git a/configure.ac b/configure.ac index bd7ccb48..20d5b42f 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,11 @@ AC_CONFIG_AUX_DIR([scripts]) AC_CONFIG_MACRO_DIR([m4]) # TBD try to use gnu strictness? Just add the missing files? -AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2 subdir-objects]) +# Set automake defaults: +# - Tarballs are compressed with xz and bzip2 +# - Object files are generated in a subdirectory (new default in automake) +# - Request new tar format (old, tar-v7, breaks on long paths we have) +AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2 subdir-objects tar-pax]) #-------------------------------------------------------------------- # Allow dummy --{en,dis}able-{static,shared} diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 413d9446..a54c170d 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -1,16 +1,21 @@ ## vim: set noet : ## TBD turn off program renaming for these? Or account for it in ct-ng script? +## TBD when kconfig is split into a subpackage, need to remove this option from sub-configure transform = s,x,x, ## TBD install into lib/crosstool-ng/kconfig? or move to libexec which seems more suitable pkglibexec_PROGRAMS = conf nconf mconf -AM_LFLAGS = -L -Pzconf -AM_YFLAGS = -l -b zconf -p zconf +EXTRA_DIST = zconf.y zconf.l \ + expr.h list.h lkc.h lkc_proto.h nconf.h lxdialog/dialog.h \ + confdata.c expr.c kconf_id.c menu.c symbol.c util.c +CLEANFILES = zconf.lex.c zconf.c BUILT_SOURCES = zconf.c zconf.lex.c +AM_LFLAGS = -L -Pzconf +AM_YFLAGS = -l -b zconf -p zconf AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\" conf_SOURCES = conf.c zconf.c diff --git a/scripts/ylwrap b/scripts/ylwrap deleted file mode 120000 index efe1e02d..00000000 --- a/scripts/ylwrap +++ /dev/null @@ -1 +0,0 @@ -/usr/share/automake-1.15/ylwrap \ No newline at end of file -- cgit v1.2.3