From 413bb8dfb5ea230350caab2ac45cbb222df0fe52 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 17 Jan 2012 21:18:53 +0100 Subject: [PATCH] all: shuffle files around Review and reorganise the package layout. Signed-off-by: "Yann E. MORIN" --- .hgignore | 6 ++ Makefile.am | 30 +------ POTFILES.in | 12 --- check.sh | 14 ---- configure.ac | 7 +- frontends/Makefile.am | 1 + frontends/conf/Makefile.am | 5 ++ conf.c => frontends/conf/conf.c | 0 gconf.c => frontends/gconf/gconf.c | 0 gconf.glade => frontends/gconf/gconf.glade | 0 images.c => frontends/gconf/images.c | 0 frontends/mconf/Makefile.am | 5 ++ mconf.c => frontends/mconf/mconf.c | 0 frontends/nconf/Makefile.am | 5 ++ nconf.c => frontends/nconf/nconf.c | 0 nconf.gui.c => frontends/nconf/nconf.gui.c | 0 nconf.h => frontends/nconf/nconf.h | 0 qconf.cc => frontends/qconf/qconf.cc | 0 qconf.h => frontends/qconf/qconf.h | 0 lxdialog/Makefile.am | 2 +- lxdialog/check-lxdialog.sh | 84 ------------------- kxgettext.c => misc/kxgettext.c | 0 merge_config.sh => misc/merge_config.sh | 0 .../streamline_config.pl | 0 parser/Makefile.am | 32 +++++++ confdata.c => parser/confdata.c | 0 expr.c => parser/expr.c | 0 expr.h => parser/expr.h | 0 hconf.gperf => parser/hconf.gperf | 0 lconf.l => parser/lconf.l | 0 lkc.h => parser/lkc.h | 0 lkc_proto.h => parser/lkc_proto.h | 0 menu.c => parser/menu.c | 0 symbol.c => parser/symbol.c | 0 util.c => parser/util.c | 0 yconf.y => parser/yconf.y | 0 36 files changed, 62 insertions(+), 141 deletions(-) delete mode 100644 POTFILES.in delete mode 100755 check.sh create mode 100644 frontends/Makefile.am create mode 100644 frontends/conf/Makefile.am rename conf.c => frontends/conf/conf.c (100%) rename gconf.c => frontends/gconf/gconf.c (100%) rename gconf.glade => frontends/gconf/gconf.glade (100%) rename images.c => frontends/gconf/images.c (100%) create mode 100644 frontends/mconf/Makefile.am rename mconf.c => frontends/mconf/mconf.c (100%) create mode 100644 frontends/nconf/Makefile.am rename nconf.c => frontends/nconf/nconf.c (100%) rename nconf.gui.c => frontends/nconf/nconf.gui.c (100%) rename nconf.h => frontends/nconf/nconf.h (100%) rename qconf.cc => frontends/qconf/qconf.cc (100%) rename qconf.h => frontends/qconf/qconf.h (100%) delete mode 100644 lxdialog/check-lxdialog.sh rename kxgettext.c => misc/kxgettext.c (100%) rename merge_config.sh => misc/merge_config.sh (100%) rename streamline_config.pl => misc/streamline_config.pl (100%) create mode 100644 parser/Makefile.am rename confdata.c => parser/confdata.c (100%) rename expr.c => parser/expr.c (100%) rename expr.h => parser/expr.h (100%) rename hconf.gperf => parser/hconf.gperf (100%) rename lconf.l => parser/lconf.l (100%) rename lkc.h => parser/lkc.h (100%) rename lkc_proto.h => parser/lkc_proto.h (100%) rename menu.c => parser/menu.c (100%) rename symbol.c => parser/symbol.c (100%) rename util.c => parser/util.c (100%) rename yconf.y => parser/yconf.y (100%) diff --git a/.hgignore b/.hgignore index aa858a3..d6774d6 100644 --- a/.hgignore +++ b/.hgignore @@ -4,6 +4,12 @@ syntax: glob *.o *.a +frontends/conf/conf +frontends/mconf/mconf +frontends/nconf/nconf + +parser/?conf.c + aclocal.m4 configure config.h diff --git a/Makefile.am b/Makefile.am index 5d89c81..068a42b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,29 +1 @@ -SUFFIXES = .gperf - -bin_PROGRAMS = conf nconf mconf - -conf_SOURCES = \ - conf.c \ - yconf.y - -mconf_SOURCES = \ - mconf.c \ - yconf.y -mconf_CFLAGS = -DCURSES_LOC='"${CURSES_LOC}"' -mconf_LDADD = lxdialog/liblxdialog.a - -nconf_SOURCES = \ - nconf.c \ - nconf.gui.c \ - yconf.y -nconf_LDADD = -lmenu -lpanel - -yconf.o: lconf.c hconf.c - -.gperf.c: - $(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< - -.l.c: - $(LEX) $(LFLAGS) $(AM_LFLAGS) -o$@ $< - -SUBDIRS = lxdialog . +SUBDIRS = lxdialog parser frontends diff --git a/POTFILES.in b/POTFILES.in deleted file mode 100644 index 9674573..0000000 --- a/POTFILES.in +++ /dev/null @@ -1,12 +0,0 @@ -scripts/kconfig/lxdialog/checklist.c -scripts/kconfig/lxdialog/inputbox.c -scripts/kconfig/lxdialog/menubox.c -scripts/kconfig/lxdialog/textbox.c -scripts/kconfig/lxdialog/util.c -scripts/kconfig/lxdialog/yesno.c -scripts/kconfig/mconf.c -scripts/kconfig/conf.c -scripts/kconfig/confdata.c -scripts/kconfig/gconf.c -scripts/kconfig/gconf.glade.h -scripts/kconfig/qconf.cc diff --git a/check.sh b/check.sh deleted file mode 100755 index fa59cbf..0000000 --- a/check.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# Needed for systems without gettext -$* -xc -o /dev/null - > /dev/null 2>&1 << EOF -#include -int main() -{ - gettext(""); - return 0; -} -EOF -if [ ! "$?" -eq "0" ]; then - echo -DKBUILD_NO_NLS; -fi - diff --git a/configure.ac b/configure.ac index 9393234..8712973 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.67]) AC_INIT([kconfig-frontends], [m4_esyscmd_s([cat .version])], [nobody@nowhere.org]) -AC_CONFIG_SRCDIR([menu.c]) +AC_CONFIG_SRCDIR([frontends/conf/conf.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([scripts]) @@ -82,5 +82,10 @@ AS_IF( AC_CONFIG_FILES([ Makefile lxdialog/Makefile + parser/Makefile + frontends/Makefile + frontends/conf/Makefile + frontends/mconf/Makefile + frontends/nconf/Makefile ]) AC_OUTPUT diff --git a/frontends/Makefile.am b/frontends/Makefile.am new file mode 100644 index 0000000..ef66433 --- /dev/null +++ b/frontends/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = conf mconf nconf diff --git a/frontends/conf/Makefile.am b/frontends/conf/Makefile.am new file mode 100644 index 0000000..5b8a083 --- /dev/null +++ b/frontends/conf/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = conf + +conf_SOURCES = conf.c +conf_CPPFLAGS = $(AM_CPPFLAGS) -I../../parser +conf_LDADD = ../../parser/libkconfigparser.a diff --git a/conf.c b/frontends/conf/conf.c similarity index 100% rename from conf.c rename to frontends/conf/conf.c diff --git a/gconf.c b/frontends/gconf/gconf.c similarity index 100% rename from gconf.c rename to frontends/gconf/gconf.c diff --git a/gconf.glade b/frontends/gconf/gconf.glade similarity index 100% rename from gconf.glade rename to frontends/gconf/gconf.glade diff --git a/images.c b/frontends/gconf/images.c similarity index 100% rename from images.c rename to frontends/gconf/images.c diff --git a/frontends/mconf/Makefile.am b/frontends/mconf/Makefile.am new file mode 100644 index 0000000..0f2eb37 --- /dev/null +++ b/frontends/mconf/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = mconf + +mconf_SOURCES = mconf.c +mconf_CPPFLAGS = $(AM_CPPFLAGS) -I../../parser -DCURSES_LOC='"${CURSES_LOC}"' +mconf_LDADD = ../../parser/libkconfigparser.a ../../lxdialog/liblxdialog.a diff --git a/mconf.c b/frontends/mconf/mconf.c similarity index 100% rename from mconf.c rename to frontends/mconf/mconf.c diff --git a/frontends/nconf/Makefile.am b/frontends/nconf/Makefile.am new file mode 100644 index 0000000..3d87b86 --- /dev/null +++ b/frontends/nconf/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = nconf + +nconf_SOURCES = nconf.c nconf.gui.c nconf.h +nconf_CPPFLAGS = $(AM_CPPFLAGS) -I../../parser +nconf_LDADD = ../../parser/libkconfigparser.a -lmenu -lpanel diff --git a/nconf.c b/frontends/nconf/nconf.c similarity index 100% rename from nconf.c rename to frontends/nconf/nconf.c diff --git a/nconf.gui.c b/frontends/nconf/nconf.gui.c similarity index 100% rename from nconf.gui.c rename to frontends/nconf/nconf.gui.c diff --git a/nconf.h b/frontends/nconf/nconf.h similarity index 100% rename from nconf.h rename to frontends/nconf/nconf.h diff --git a/qconf.cc b/frontends/qconf/qconf.cc similarity index 100% rename from qconf.cc rename to frontends/qconf/qconf.cc diff --git a/qconf.h b/frontends/qconf/qconf.h similarity index 100% rename from qconf.h rename to frontends/qconf/qconf.h diff --git a/lxdialog/Makefile.am b/lxdialog/Makefile.am index cf66893..3404314 100644 --- a/lxdialog/Makefile.am +++ b/lxdialog/Makefile.am @@ -9,4 +9,4 @@ liblxdialog_a_SOURCES = \ util.c \ yesno.c -liblxdialog_a_CFLAGS = -DCURSES_LOC='"${CURSES_LOC}"' +liblxdialog_a_CPPFLAGS = $(AM_CPPFLAGS) -DCURSES_LOC='"${CURSES_LOC}"' diff --git a/lxdialog/check-lxdialog.sh b/lxdialog/check-lxdialog.sh deleted file mode 100644 index 82cc3a8..0000000 --- a/lxdialog/check-lxdialog.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# Check ncurses compatibility - -# What library to link -ldflags() -{ - for ext in so a dylib ; do - for lib in ncursesw ncurses curses ; do - $cc -print-file-name=lib${lib}.${ext} | grep -q / - if [ $? -eq 0 ]; then - echo "-l${lib}" - exit - fi - done - done - exit 1 -} - -# Where is ncurses.h? -ccflags() -{ - if [ -f /usr/include/ncurses/ncurses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncurses/curses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncursesw/curses.h ]; then - echo '-I/usr/include/ncursesw -DCURSES_LOC=""' - elif [ -f /usr/include/ncurses.h ]; then - echo '-DCURSES_LOC=""' - else - echo '-DCURSES_LOC=""' - fi -} - -# Temp file, try to clean up after us -tmp=.lxdialog.tmp -trap "rm -f $tmp" 0 1 2 3 15 - -# Check if we can link to ncurses -check() { - $cc -xc - -o $tmp 2>/dev/null <<'EOF' -#include CURSES_LOC -main() {} -EOF - if [ $? != 0 ]; then - echo " *** Unable to find the ncurses libraries or the" 1>&2 - echo " *** required header files." 1>&2 - echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 - echo " *** " 1>&2 - echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 - echo " *** " 1>&2 - exit 1 - fi -} - -usage() { - printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n" -} - -if [ $# -eq 0 ]; then - usage - exit 1 -fi - -cc="" -case "$1" in - "-check") - shift - cc="$@" - check - ;; - "-ccflags") - ccflags - ;; - "-ldflags") - shift - cc="$@" - ldflags - ;; - "*") - usage - exit 1 - ;; -esac diff --git a/kxgettext.c b/misc/kxgettext.c similarity index 100% rename from kxgettext.c rename to misc/kxgettext.c diff --git a/merge_config.sh b/misc/merge_config.sh similarity index 100% rename from merge_config.sh rename to misc/merge_config.sh diff --git a/streamline_config.pl b/misc/streamline_config.pl similarity index 100% rename from streamline_config.pl rename to misc/streamline_config.pl diff --git a/parser/Makefile.am b/parser/Makefile.am new file mode 100644 index 0000000..498fd3d --- /dev/null +++ b/parser/Makefile.am @@ -0,0 +1,32 @@ +SUFFIXES = .gperf + +noinst_LIBRARIES = libkconfigparser.a + +libkconfigparser_a_SOURCES = yconf.y +dist_EXTRA_libkconfigparser_a_SOURCES = \ + hconf.gperf lconf.l \ + confdata.c menu.c symbol.c util.c \ + expr.c expr.h lkc.h lkc_proto.h + +BUILT_SOURCES = hconf.c lconf.c + +.gperf.c: + $(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< + +# The following rule produces a warning: +# parser/Makefile.am:31: user target `.l.c' defined here... +# /usr/share/automake-1.11/am/lex.am: ... overrides Automake target +# `.l.c' defined here +# +# This is expected, and can't be avoided (for now). +# That's because, when working with lex+yacc sources, the default is to +# build each files searately, and then link them together into the final +# output. But the Linux kernel's parser simply #include-s the lexer, +# so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES), +# and thus automake does not catch the need to call lex. +# Secondly, when flex is told to change the symbols' prefix (kconfig +# uses zconf in lieue of the original yy), then the output file is +# also renamed, but automake does not now that, and make would fail +# because it would think no file was generated. +.l.c: + $(LEXCOMPILE) -o$@ $< diff --git a/confdata.c b/parser/confdata.c similarity index 100% rename from confdata.c rename to parser/confdata.c diff --git a/expr.c b/parser/expr.c similarity index 100% rename from expr.c rename to parser/expr.c diff --git a/expr.h b/parser/expr.h similarity index 100% rename from expr.h rename to parser/expr.h diff --git a/hconf.gperf b/parser/hconf.gperf similarity index 100% rename from hconf.gperf rename to parser/hconf.gperf diff --git a/lconf.l b/parser/lconf.l similarity index 100% rename from lconf.l rename to parser/lconf.l diff --git a/lkc.h b/parser/lkc.h similarity index 100% rename from lkc.h rename to parser/lkc.h diff --git a/lkc_proto.h b/parser/lkc_proto.h similarity index 100% rename from lkc_proto.h rename to parser/lkc_proto.h diff --git a/menu.c b/parser/menu.c similarity index 100% rename from menu.c rename to parser/menu.c diff --git a/symbol.c b/parser/symbol.c similarity index 100% rename from symbol.c rename to parser/symbol.c diff --git a/util.c b/parser/util.c similarity index 100% rename from util.c rename to parser/util.c diff --git a/yconf.y b/parser/yconf.y similarity index 100% rename from yconf.y rename to parser/yconf.y -- 2.39.5