From f6cc4445afb527655a0dbb551252547e55f8b3ef Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Wed, 3 Aug 2016 21:15:53 +0200 Subject: [PATCH] buildsystem: do not use program-prefix to set the kconfig- prefix Currently, we use automake's --program-prefix to set the prefix of the kconfig executables to 'kconfig-'. However, this is neither very nice nor very reliable. In some cases, the standard practice distributions use is to force the prefix to be empty, in which case this would create clashes with other tools (esp. diff and merge). Furthermore, we use a dirty trick to achieve this, by initialising program-prefix before initialising automake. There is no guarantee this will continue to work with future automake versions. Stop using this trick, and directly include the 'kconfig-' prefix for all programs (binaries and scripts alike) that we may generate and install. Signed-off-by: "Yann E. MORIN" --- .gitignore | 20 +++++-------- configure.ac | 9 ------ frontends/conf/Makefile.am | 18 +++++------ frontends/gconf/Makefile.am | 30 +++++++++---------- frontends/mconf/Makefile.am | 24 +++++++-------- frontends/nconf/Makefile.am | 22 +++++++------- frontends/qconf/Makefile.am | 26 ++++++++-------- scripts/ksync.list | 6 ++-- utils/Makefile.am | 24 +++++++-------- utils/{diff => kconfig-diff} | 0 utils/{merge => kconfig-merge} | 0 utils/{tweak.in => kconfig-tweak.in} | 0 ...{tweak.in.patch => kconfig-tweak.in.patch} | 6 ++-- 13 files changed, 85 insertions(+), 100 deletions(-) rename utils/{diff => kconfig-diff} (100%) rename utils/{merge => kconfig-merge} (100%) rename utils/{tweak.in => kconfig-tweak.in} (100%) rename utils/{tweak.in.patch => kconfig-tweak.in.patch} (83%) diff --git a/.gitignore b/.gitignore index 58139e6..da028f8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,16 +8,11 @@ .libs/ -/frontends/conf/conf -/frontends/conf/*-conf -/frontends/gconf/gconf -/frontends/gconf/*-gconf -/frontends/mconf/mconf -/frontends/mconf/*-mconf -/frontends/nconf/nconf -/frontends/nconf/*-nconf -/frontends/qconf/qconf -/frontends/qconf/*-qconf +/frontends/conf/kconfig-conf +/frontends/gconf/kconfig-gconf +/frontends/mconf/kconfig-mconf +/frontends/nconf/kconfig-nconf +/frontends/qconf/kconfig-qconf /frontends/qconf/qconf.moc /libs/images/images.c @@ -26,9 +21,8 @@ /libs/parser/lconf.c /libs/parser/yconf.c -/utils/tweak -/utils/gettext -/utils/*-gettext +/utils/kconfig-tweak +/utils/kconfig-gettext aclocal.m4 configure diff --git a/configure.ac b/configure.ac index c404185..ad923e9 100644 --- a/configure.ac +++ b/configure.ac @@ -20,14 +20,6 @@ AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4]) #---------------------------------------- # Prepare automake -# We want to allow the user to override our default program-prefix, -# so we must set-it now, before automake has a chance to interpret -# it, but after the options are parsed, so as not to overwrite the -# value (if any) set by the user -AS_IF( - [test "$program_prefix" = NONE], - [program_prefix=kconfig-]) - AM_INIT_AUTOMAKE([foreign]) # For releases, enable silent rules, unless the user explicitly @@ -511,7 +503,6 @@ AC_MSG_NOTICE([- parser library :$lib_list]) AC_MSG_NOTICE([ - root-menu prompt : $root_menu]) AC_MSG_NOTICE([ - config prefix : $config_prefix]) AC_MSG_NOTICE([- frontends :$fe_list]) -AC_MSG_NOTICE([ - transform name : $program_transform_name]) AC_MSG_NOTICE([ - localised : $has_gettext]) AC_MSG_NOTICE([- install utilities : $enable_utils]) AC_MSG_NOTICE([- CFLAGS CXXFLAGS : $wall_CFLAGS $werror_CFLAGS]) diff --git a/frontends/conf/Makefile.am b/frontends/conf/Makefile.am index 10566cc..38db98f 100644 --- a/frontends/conf/Makefile.am +++ b/frontends/conf/Makefile.am @@ -1,10 +1,10 @@ -bin_PROGRAMS = conf +bin_PROGRAMS = kconfig-conf -conf_SOURCES = conf.c -conf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(intl_CPPFLAGS) \ - -I$(top_srcdir)/libs/parser -conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) -conf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(intl_LIBS) \ - $(conf_EXTRA_LIBS) +kconfig_conf_SOURCES = conf.c +kconfig_conf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(intl_CPPFLAGS) \ + -I$(top_srcdir)/libs/parser +kconfig_conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) +kconfig_conf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(intl_LIBS) \ + $(conf_EXTRA_LIBS) diff --git a/frontends/gconf/Makefile.am b/frontends/gconf/Makefile.am index 93ad7d4..abdb193 100644 --- a/frontends/gconf/Makefile.am +++ b/frontends/gconf/Makefile.am @@ -1,17 +1,17 @@ -bin_PROGRAMS = gconf +bin_PROGRAMS = kconfig-gconf -gconf_SOURCES = gconf.c gconf.glade -gconf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(intl_CPPFLAGS) \ - -I$(top_srcdir)/libs/parser \ - -I$(top_builddir)/libs/images \ - -DGUI_PATH='"$(pkgdatadir)/gconf.glade"' -gconf_CFLAGS = $(AM_CFLAGS) \ - $(kf_CFLAGS) \ - $(gtk_CFLAGS) -gconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(top_builddir)/libs/images/libkconfig-images.a \ - $(intl_LIBS) $(gtk_LIBS) $(gconf_EXTRA_LIBS) -gconfdir = $(pkgdatadir) -gconf_DATA = gconf.glade +kconfig_gconf_SOURCES = gconf.c gconf.glade +kconfig_gconf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(intl_CPPFLAGS) \ + -I$(top_srcdir)/libs/parser \ + -I$(top_builddir)/libs/images \ + -DGUI_PATH='"$(pkgdatadir)/gconf.glade"' +kconfig_gconf_CFLAGS = $(AM_CFLAGS) \ + $(kf_CFLAGS) \ + $(gtk_CFLAGS) +kconfig_gconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(top_builddir)/libs/images/libkconfig-images.a \ + $(intl_LIBS) $(gtk_LIBS) $(gconf_EXTRA_LIBS) +kconfig_gconfdir = $(pkgdatadir) +kconfig_gconf_DATA = gconf.glade EXTRA_DIST = gconf.c.patch diff --git a/frontends/mconf/Makefile.am b/frontends/mconf/Makefile.am index 47240f2..175a712 100644 --- a/frontends/mconf/Makefile.am +++ b/frontends/mconf/Makefile.am @@ -1,13 +1,13 @@ -bin_PROGRAMS = mconf +bin_PROGRAMS = kconfig-mconf -mconf_SOURCES = mconf.c -mconf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(ncurses_mconf_CPPFLAGS) \ - $(intl_CPPFLAGS) \ - -I$(top_srcdir)/libs \ - -I$(top_srcdir)/libs/parser -mconf_CFLAGS = $(AM_CFLAGS) \ - $(kf_CFLAGS) -mconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a \ - $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS) +kconfig_mconf_SOURCES = mconf.c +kconfig_mconf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(ncurses_mconf_CPPFLAGS) \ + $(intl_CPPFLAGS) \ + -I$(top_srcdir)/libs \ + -I$(top_srcdir)/libs/parser +kconfig_mconf_CFLAGS = $(AM_CFLAGS) \ + $(kf_CFLAGS) +kconfig_mconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a \ + $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS) diff --git a/frontends/nconf/Makefile.am b/frontends/nconf/Makefile.am index 90a6154..de0664b 100644 --- a/frontends/nconf/Makefile.am +++ b/frontends/nconf/Makefile.am @@ -1,12 +1,12 @@ -bin_PROGRAMS = nconf +bin_PROGRAMS = kconfig-nconf -nconf_SOURCES = nconf.c nconf.gui.c nconf.h -nconf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(intl_CPPFLAGS) \ - $(ncurses_nconf_CPPFLAGS) \ - -I$(top_srcdir)/libs/parser -nconf_CFLAGS = $(AM_CFLAGS) \ - $(kf_CFLAGS) -nconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS) \ - $(nconf_EXTRA_LIBS) +kconfig_nconf_SOURCES = nconf.c nconf.gui.c nconf.h +kconfig_nconf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(intl_CPPFLAGS) \ + $(ncurses_nconf_CPPFLAGS) \ + -I$(top_srcdir)/libs/parser +kconfig_nconf_CFLAGS = $(AM_CFLAGS) \ + $(kf_CFLAGS) +kconfig_nconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS) \ + $(nconf_EXTRA_LIBS) diff --git a/frontends/qconf/Makefile.am b/frontends/qconf/Makefile.am index 3feabd3..bc49498 100644 --- a/frontends/qconf/Makefile.am +++ b/frontends/qconf/Makefile.am @@ -1,18 +1,18 @@ -bin_PROGRAMS = qconf +bin_PROGRAMS = kconfig-qconf -qconf_SOURCES = qconf.cc qconf.h +kconfig_qconf_SOURCES = qconf.cc qconf.h BUILT_SOURCES = qconf.moc -qconf_CPPFLAGS = $(AM_CPPFLAGS) \ - $(intl_CPPFLAGS) \ - -I$(top_srcdir)/libs/parser \ - -I$(top_builddir)/libs/images -qconf_CXXFLAGS = $(AM_CXXFLAGS) \ - $(kf_CFLAGS) \ - $(Qt5_CFLAGS) \ - -fPIC -qconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(top_builddir)/libs/images/libkconfig-images.a \ - $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS) +kconfig_qconf_CPPFLAGS = $(AM_CPPFLAGS) \ + $(intl_CPPFLAGS) \ + -I$(top_srcdir)/libs/parser \ + -I$(top_builddir)/libs/images +kconfig_qconf_CXXFLAGS = $(AM_CXXFLAGS) \ + $(kf_CFLAGS) \ + $(Qt5_CFLAGS) \ + -fPIC +kconfig_qconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(top_builddir)/libs/images/libkconfig-images.a \ + $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS) CLEANFILES = qconf.moc EXTRA_DIST = qconf.cc.patch diff --git a/scripts/ksync.list b/scripts/ksync.list index aa8b9b6..c2d66fa 100644 --- a/scripts/ksync.list +++ b/scripts/ksync.list @@ -28,9 +28,9 @@ scripts/kconfig/menu.c --> libs/parser/menu.c scripts/kconfig/symbol.c --> libs/parser/symbol.c scripts/kconfig/util.c --> libs/parser/util.c scripts/kconfig/zconf.y --> libs/parser/yconf.y -scripts/config --> utils/tweak.in -scripts/diffconfig --> utils/diff -scripts/kconfig/merge_config.sh --> utils/merge +scripts/config --> utils/kconfig-tweak.in +scripts/diffconfig --> utils/kconfig-diff +scripts/kconfig/merge_config.sh --> utils/kconfig-merge scripts/kconfig/kxgettext.c --> utils/gettext.c Documentation/kbuild/kconfig-language.txt --> docs/kconfig-language.txt Documentation/kbuild/kconfig.txt --> docs/kconfig.txt diff --git a/utils/Makefile.am b/utils/Makefile.am index b3f55df..6438110 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,21 +1,21 @@ -bin_SCRIPTS = tweak -dist_bin_SCRIPTS = diff merge +bin_SCRIPTS = kconfig-tweak +dist_bin_SCRIPTS = kconfig-diff kconfig-merge if COND_utils_gettext - MAYBE_utils_gettext = gettext + MAYBE_utils_gettext = kconfig-gettext endif bin_PROGRAMS = $(MAYBE_utils_gettext) -gettext_SOURCES = gettext.c -gettext_CPPFLAGS = $(AM_CPPFLAGS) \ - -I$(top_srcdir)/libs/parser -gettext_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) -gettext_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ - $(intl_LIBS) -CLEANFILES = tweak -EXTRA_DIST = tweak.in tweak.in.patch +kconfig_gettext_SOURCES = gettext.c +kconfig_gettext_CPPFLAGS = $(AM_CPPFLAGS) \ + -I$(top_srcdir)/libs/parser +kconfig_gettext_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) +kconfig_gettext_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ + $(intl_LIBS) +CLEANFILES = kconfig-tweak +EXTRA_DIST = kconfig-tweak.in kconfig-tweak.in.patch -tweak: tweak.in +kconfig-tweak: kconfig-tweak.in $(AM_V_GEN)$(SED) -e "s/@CONFIG_@/$(config_prefix)/g" \ $< >$@ @chmod +x $@ diff --git a/utils/diff b/utils/kconfig-diff similarity index 100% rename from utils/diff rename to utils/kconfig-diff diff --git a/utils/merge b/utils/kconfig-merge similarity index 100% rename from utils/merge rename to utils/kconfig-merge diff --git a/utils/tweak.in b/utils/kconfig-tweak.in similarity index 100% rename from utils/tweak.in rename to utils/kconfig-tweak.in diff --git a/utils/tweak.in.patch b/utils/kconfig-tweak.in.patch similarity index 83% rename from utils/tweak.in.patch rename to utils/kconfig-tweak.in.patch index c4b8557..5a85fe7 100644 --- a/utils/tweak.in.patch +++ b/utils/kconfig-tweak.in.patch @@ -1,6 +1,6 @@ -diff --git a/utils/tweak.in b/utils/tweak.in ---- a/utils/tweak.in -+++ b/utils/tweak.in +diff --git a/utils/kconfig-tweak.in b/utils/kconfig-tweak.in +--- a/utils/kconfig-tweak.in ++++ b/utils/kconfig-tweak.in @@ -3,8 +3,8 @@ myname=${0##*/} -- 2.39.5