[PATCH 0/2] Adding embedded and utilities to configure options
Hi, Attached are the patches to update configure.ac and some Makefile.am to use more default option selection style. I commented the docdir var in the main Makefile.am. The second patch contains the addition of --disable-utilities and --enable-embedded options. I never made a patch mail before so let me know if anything is missing. Best regards, Job ==== job (2): Adapted configure options to autoconf default behaviour Added autoconf option for utilities and embedded Makefile.am | 2 +- configure.ac | 55 ++++++++++++++++++++++++++++++++++++++-------------- utils/Makefile.am | 2 + 3 files changed, 43 insertions(+), 16 deletions(-) -- 1.7.4.1
From: job <job@hackwerk.org> --- Makefile.am | 2 +- configure.ac | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9086522..e6af3c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ EXTRA_DIST = git-version-gen if HAVE_DOXYGEN -docdir=$(datadir)/doc +#docdir=$(datadir)/doc pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION) doc_htmldir=$(pkgdocdir)/html diff --git a/configure.ac b/configure.ac index ef4b0aa..bdc630c 100644 --- a/configure.ac +++ b/configure.ac @@ -42,40 +42,40 @@ AC_ARG_ENABLE(talloc, [--disable-talloc], [Disable building talloc memory allocator] )], - [enable_talloc=0], [enable_talloc=1]) -AM_CONDITIONAL(ENABLE_TALLOC, test "x$enable_talloc" = "x1") + [enable_talloc=$enableval], [enable_talloc="yes"]) +AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"]) AC_ARG_ENABLE(plugin, [AS_HELP_STRING( [--disable-plugin], [Disable support for dlopen plugins], )], - [enable_plugin=0], [enable_plugin=1]) -AM_CONDITIONAL(ENABLE_PLUGIN, test "x$enable_plugin" = "x1") + [enable_plugin=$enableval], [enable_plugin="yes"]) +AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes") AC_ARG_ENABLE(tests, [AS_HELP_STRING( [--disable-tests], [Disable building test programs] )], - [enable_tests=0], [enable_tests=1]) -AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "x1") + [enable_tests=$enableval], [enable_tests="yes"]) +AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes") AC_ARG_ENABLE(vty, [AS_HELP_STRING( [--disable-vty], [Disable building VTY telnet interface] )], - [enable_vty=0], [enable_vty=1]) -AM_CONDITIONAL(ENABLE_VTY, test "x$enable_vty" = "x1") + [enable_vty=$enableval], [enable_vty="yes"]) +AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes") AC_ARG_ENABLE(panic_infloop, [AS_HELP_STRING( [--enable-panic-infloop], [Trigger infinite loop on panic rather than fprintf/abort] )], - [panic_infloop=1], [panic_infloop=0]) -if test "x$panic_infloop" = "x1" + [panic_infloop=$enableval], [panic_infloop="no"]) +if test x"$panic_infloop" = x"yes" then AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) fi @@ -85,8 +85,8 @@ AC_ARG_ENABLE(bsc_fd_check, [--enable-bsc-fd-check], [Instrument bsc_register_fd to check that the fd is registered] )], - [fd_check=1], [fd_check=0]) -if test "x$fd_check" = "x1" + [fd_check=$enableval], [fd_check="no"]) +if test x"$fd_check" = x"no" then AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd]) fi @@ -96,8 +96,8 @@ AC_ARG_ENABLE(msgfile, [--disable-msgfile], [Disable support for the msgfile], )], - [enable_msgfile=0], [enable_msgfile=1]) -AM_CONDITIONAL(ENABLE_MSGFILE, test "x$enable_msgfile" = "x1") + [enable_msgfile=$enableval], [enable_msgfile="yes"]) +AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes") AC_OUTPUT( -- 1.7.4.1
From: job <job@hackwerk.org> --- configure.ac | 25 +++++++++++++++++++++++++ utils/Makefile.am | 2 ++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index bdc630c..e89afea 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,31 @@ AC_ARG_ENABLE(msgfile, [enable_msgfile=$enableval], [enable_msgfile="yes"]) AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes") +AC_ARG_ENABLE(utilities, + [AS_HELP_STRING( + [--disable-utilities], + [Disable building utility programs], + )], + [enable_utilities=$enableval], [enable_utilities="yes"]) +AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes") + +AC_ARG_ENABLE(embedded, + [AS_HELP_STRING( + [--enable-embedded], + [Enable building for embedded use and disable unsupported features] + )], + [embedded=$enableval], [embedded="no"]) +if test x"$embedded" = x"yes" +then + AC_DEFINE([EMBEDDED],[1],[Select building for embedded use]) + AM_CONDITIONAL(ENABLE_TESTS, false) + AM_CONDITIONAL(ENABLE_PLUGIN, false) + AM_CONDITIONAL(ENABLE_MSGFILE, false) + AM_CONDITIONAL(ENABLE_VTY, false) + AM_CONDITIONAL(ENABLE_TALLOC, false) + AM_CONDITIONAL(ENABLE_UTILITIES, false) + AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) +fi AC_OUTPUT( libosmocore.pc diff --git a/utils/Makefile.am b/utils/Makefile.am index 645cfd5..22903d9 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,5 +1,7 @@ +if ENABLE_UTILITIES INCLUDES = $(all_includes) -I$(top_srcdir)/include noinst_PROGRAMS = osmo-arfcn osmo_arfcn_SOURCES = osmo-arfcn.c osmo_arfcn_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +endif -- 1.7.4.1
Hi Harald, Any comments on those patches, or do they look ok to you ? They seemed to work for me, so it's more a style issue. The first one looks OK to me (except maybe just remove docdir alltogether rather than comment it). The second, it's a question of whether we leave the individual options and just add a 'embedded one' that enables them all at once, or if we remove all the individual ones alltogether. Cheers, Sylvain On Sun, Aug 21, 2011 at 5:18 PM, Job <baseband@hackwerk.org> wrote:
Hi,
Attached are the patches to update configure.ac and some Makefile.am to use more default option selection style. I commented the docdir var in the main Makefile.am.
The second patch contains the addition of --disable-utilities and --enable-embedded options.
I never made a patch mail before so let me know if anything is missing.
Best regards,
Job
====
job (2): Adapted configure options to autoconf default behaviour Added autoconf option for utilities and embedded
Makefile.am | 2 +- configure.ac | 55 ++++++++++++++++++++++++++++++++++++++-------------- utils/Makefile.am | 2 + 3 files changed, 43 insertions(+), 16 deletions(-)
-- 1.7.4.1
Hi Job, On Sun, Aug 21, 2011 at 05:18:22PM +0200, Job wrote:
Attached are the patches to update configure.ac and some Makefile.am to use more default option selection style. I commented the docdir var in the main Makefile.am.
The second patch contains the addition of --disable-utilities and --enable-embedded options.
thanks, I've just merged them.
I never made a patch mail before so let me know if anything is missing.
everything seemed to be fine! congratulations :) -- - Harald Welte <laforge@gnumonks.org> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Hi,
I never made a patch mail before so let me know if anything is missing.
everything seemed to be fine! congratulations :)
That's good to hear :-) One thing to note: it still requires a patch to osmocom-bb. I did not provide it as I had a question on this script: src/shared/update-libosmocore.sh It uses "git-subtree pull" instead of "git subtree pull", which is what I have to use with a default install of subtree. Is it ok to change this in the patch for the Makefile? Note that if you edit update-libosmocore.sh it then refuses to work because the source tree changed compared to the master. Best regards, Job
participants (3)
-
Harald Welte -
Job -
Sylvain Munaut