All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] help please
@ 2016-07-12 19:06 Mike King
  2016-07-12 20:44 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Mike King @ 2016-07-12 19:06 UTC (permalink / raw)
  To: buildroot

I am hoping someone will help me.  I am trying to create a package for
linux-gpib.  I can get it to configure and build but not install.  I
have listed below the package files that I have created.  I am not an
autotools expert.


###Config.in FILE###
config BR2_PACKAGE_LINUX_GPIB
bool "linux-gpib"
help
 The Linux GPIB Package is a support package for GPIB (IEEE 488) hardware.
 The package contains kernel driver modules, and a C user-space library with
 Guile, Perl, PHP, Python and TCL bindings. The API of the C library is intended
 to be compatible with National Instrument's GPIB library.

 http://linux-gpib.sourceforge.net

###linux-gpib.mk FILE###
################################################################################
#
# linux-gpib
#
################################################################################

LINUX_GPIB_VERSION = 4.0.3
LINUX_GPIB_SITE =
http://downloads.sourceforge.net/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/$(LINUX_GPIB_VERSION)
LINUX_GPIB_SOURCE = linux-gpib-$(LINUX_GPIB_VERSION).tar.gz
LINUX_GPIB_LICENSE = GPLv2
LINUX_GPIB_LICENSE_FILES = COPYING
LINUX_GPIB_INSTALL_STAGING = YES
LINUX_GPIB_AUTORECONF = YES
LINUX_GPIB_CONF_OPTS = --with-linux-srcdir=$(LINUX_DIR)/

$(eval $(autotools-package))


###PATCH FILE###
--- linux-gpib-4.0.3/configure.ac 2016-04-09 13:34:55.000000000 +0000
+++ linux-gpib-4.0.3/configure.ac.new 2016-07-05 01:37:47.524290832 +0000
@@ -30,9 +30,10 @@
 [ISODATE=`date +%Y-%m-%d`]
 AC_SUBST([ISODATE])

-AC_CHECK_FILE([util/.scm_version.tmp],
-  [SCM_VERSION=[$VERSION"\ [r"`cat util/.scm_version.tmp`"]"]],
-  [SCM_VERSION=$VERSION])
+#AC_CHECK_FILE([util/.scm_version.tmp],
+#  [SCM_VERSION=[$VERSION"\ [r"`cat util/.scm_version.tmp`"]"]],
+#  [SCM_VERSION=$VERSION])
+SCM_VERSION=4.0.3

 AC_SUBST(SCM_VERSION)

--- linux-gpib-4.0.3/drivers/Makefile.am 2016-04-09 09:33:14.000000000 -0400
+++ linux-gpib-4.0.3/drivers/Makefile.am.new 2016-07-09 11:13:37.356298300 -0400
@@ -28,7 +28,7 @@
  CC="$(LINUX_CC) -I at abs_top_srcdir@
-I at abs_top_srcdir@/drivers/gpib/include -I at abs_top_srcdir@/include" \
  SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)"

-install-data-hook: device-file-check /etc/gpib.conf
+install-data-hook:
  $(MAKE) -C $(LINUX_SRCDIR) V=1 modules_install\
  CC="$(LINUX_CC) -I at abs_top_srcdir@ -I at abs_top_srcdir@/driver/include
-I at abs_top_srcdir@/include" \
  SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)" INSTALL_MOD_DIR="gpib"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] help please
  2016-07-12 19:06 [Buildroot] help please Mike King
@ 2016-07-12 20:44 ` Yann E. MORIN
       [not found]   ` <CAAfO8NykMv=DCdn=rV6tCFOfRvZQf84V82ZrKgtJW-422F9nfQ@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2016-07-12 20:44 UTC (permalink / raw)
  To: buildroot

Mike, All,

On 2016-07-12 15:06 -0400, Mike King spake thusly:
> I am hoping someone will help me.  I am trying to create a package for
> linux-gpib.

Reminds me of something... ;-)

> I can get it to configure and build but not install. I
> have listed below the package files that I have created. I am not an
> autotools expert.

Pease also paste the build log (what you see in the console) starting
with the message:

    >>> linux-gpib 4.0.3 Configuring

up until the bottom.

> ###Config.in FILE###
> config BR2_PACKAGE_LINUX_GPIB
> bool "linux-gpib"

It also probably needs to depend on BR2_LINUX_KERNEL since it builds a
kernel module.

> help
>  The Linux GPIB Package is a support package for GPIB (IEEE 488) hardware.
>  The package contains kernel driver modules, and a C user-space library with
>  Guile, Perl, PHP, Python and TCL bindings. The API of the C library is intended
>  to be compatible with National Instrument's GPIB library.
> 
>  http://linux-gpib.sourceforge.net
> 
> ###linux-gpib.mk FILE###
> ################################################################################
> #
> # linux-gpib
> #
> ################################################################################
> 
> LINUX_GPIB_VERSION = 4.0.3
> LINUX_GPIB_SITE = http://downloads.sourceforge.net/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/$(LINUX_GPIB_VERSION)
> LINUX_GPIB_SOURCE = linux-gpib-$(LINUX_GPIB_VERSION).tar.gz
> LINUX_GPIB_LICENSE = GPLv2
> LINUX_GPIB_LICENSE_FILES = COPYING
> LINUX_GPIB_INSTALL_STAGING = YES
> LINUX_GPIB_AUTORECONF = YES
> LINUX_GPIB_CONF_OPTS = --with-linux-srcdir=$(LINUX_DIR)/
> 
> $(eval $(autotools-package))

Nothing really awfull here. Looks sane.

> ###PATCH FILE###
> --- linux-gpib-4.0.3/configure.ac 2016-04-09 13:34:55.000000000 +0000
> +++ linux-gpib-4.0.3/configure.ac.new 2016-07-05 01:37:47.524290832 +0000
> @@ -30,9 +30,10 @@
>  [ISODATE=`date +%Y-%m-%d`]
>  AC_SUBST([ISODATE])
> 
> -AC_CHECK_FILE([util/.scm_version.tmp],
> -  [SCM_VERSION=[$VERSION"\ [r"`cat util/.scm_version.tmp`"]"]],
> -  [SCM_VERSION=$VERSION])
> +#AC_CHECK_FILE([util/.scm_version.tmp],
> +#  [SCM_VERSION=[$VERSION"\ [r"`cat util/.scm_version.tmp`"]"]],
> +#  [SCM_VERSION=$VERSION])
> +SCM_VERSION=4.0.3
> 
>  AC_SUBST(SCM_VERSION)
> 
> --- linux-gpib-4.0.3/drivers/Makefile.am 2016-04-09 09:33:14.000000000 -0400
> +++ linux-gpib-4.0.3/drivers/Makefile.am.new 2016-07-09 11:13:37.356298300 -0400
> @@ -28,7 +28,7 @@
>   CC="$(LINUX_CC) -I at abs_top_srcdir@
> -I at abs_top_srcdir@/drivers/gpib/include -I at abs_top_srcdir@/include" \
>   SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)"
> 
> -install-data-hook: device-file-check /etc/gpib.conf
> +install-data-hook:
>   $(MAKE) -C $(LINUX_SRCDIR) V=1 modules_install\
>   CC="$(LINUX_CC) -I at abs_top_srcdir@ -I at abs_top_srcdir@/driver/include
> -I at abs_top_srcdir@/include" \
>   SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)" INSTALL_MOD_DIR="gpib"

Hmm... If this command is actually executed at install time, then it
looks like it is trying to install in the build machine's modules dir,
since it does not specify INSTALL_MOD_PATH

Is that the command that fails?

As stated above, please post the full build log, starting with the
configure message. It will easier to help if we can *see* the actual
error.

Otherwise, we also have an infrastructure to build a kernel module,
similar to the other package infras. Look for 'kernel-module' in the
manual.

Regards,
Yann E. MORIN.

> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] help please
       [not found]   ` <CAAfO8NykMv=DCdn=rV6tCFOfRvZQf84V82ZrKgtJW-422F9nfQ@mail.gmail.com>
@ 2016-07-13 18:21     ` Yann E. MORIN
       [not found]       ` <CAAfO8NwwwFGA-gCeFnOYs0HAbDAAnKs6nHnWusA-LzWpTWQ8ag@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2016-07-13 18:21 UTC (permalink / raw)
  To: buildroot

Mike, All,

On 2016-07-12 17:05 -0400, Mike King spake thusly:
> I have attached the build log.  I am now having compile errors.
> Before it was using the host kernel headers.  I "fixed" that by adding
> _CONF_OPTS line.

OK, so I've had a quick look at your build log, and it looks like
linux-gpib is quite a mess and will be difficult to package properly.

So, first, let's look at the configure log:

    Checking Linux kernel directory... ok
    checking Linux kernel compile flags... FATAL: /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/util/linux_flags/fake.o has no symtab?
    make[3]: *** [__modpost] Error 1
    make[2]: *** [modules] Error 2
    configure: WARNING: Failed to get compile flags from Linux kernel directory.
    ok
    checking for arm-buildroot-linux-uclibcgnueabihf-gcc... /home/vagrant/buildroot-2016.05/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gcc

This sounds like it is incorrectly looking for Linux directory for the
build system and/or kernel-land headers. Besides, it did not already
checked for the cross-compiler, as we can see that it does so *after*,
so it is probably using the host compiler at that point (and this will
be confirmed later during the build, see below...).

That one will be very difficult to fix, especially since their
configure.ac is very badly written:

   90 dnl get compile flags for modules from linux kernel source tree
   91 AC_MSG_CHECKING([Linux kernel compile flags])
   92 FLAGDIR=$(pwd)/util/linux_flags
   93 env LDFLAGS="" CFLAGS="" make --quiet -C ${LINUX_SRCDIR} V=1 SUBDIRS=${FLAGDIR} LINUXDIR=${LINUX_SRCDIR} modules > /dev/null
   94 if [[ $? != 0 ]]; then
   95     AC_MSG_WARN([Failed to get compile flags from Linux kernel directory.])
   96 fi
   97 AC_MSG_RESULT([ok])

Since it is not using standard and not passing the compiler, we can't
override it will configure flags or any ac_cv_* variable. :-(

That will be tough to fix. Unless this is not really needed in fact, and
we can in fact pass the expected values in the environment or some such
afterwards. And it seems we could do that, as the intermediate file
generated in this command (util/linux_flags/flags) is only used later to
actually build the driver. So we don;t need it at configure time, and
the check can very well fail, we don;t care (but it is nonetheless
completely borked).

And then, it means we can also probably use our kernel-module infra as
well to build the kernel module instead of letting their weirdly borked
buildsystem do it.

Then not much of interest, until it starts trying to build the kernel
module. And there, everything goes down hill pretty quick (lines slightly
reformatted by me):

    /usr/bin/make -C /home/vagrant/buildroot-2016.05/output/build/linux-26f3b72a9c049be10e6af196252283e1f6ab9d1f/ V=1 modules\
        CC="gcc -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3 
                -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/include
                -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/include" \
        CONFIG_GPIB_ISA="no" \
        SUBDIRS="/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib"

Bing, it uses the host compiler! That's just so utterly broken... :-/

And then (again, reformatted and elided by me):

    gcc -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3
        -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/include
        -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/include
        -Wp,-MD,/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/.ni_usb_gpib.o.d
        [--SNIP--]
        -DMODULE  -D"KBUILD_STR(s)=#s"
        -D"KBUILD_BASENAME=KBUILD_STR(ni_usb_gpib)"
        -D"KBUILD_MODNAME=KBUILD_STR(ni_usb_gpib)" -c -o
        /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/.tmp_ni_usb_gpib.o
        /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/ni_usb_gpib.c

So, really, it *is* using the host compiler, and there is no way, with
their infrastructure, to tell them to use another one. Definitely broken
beyond repair...

So, all we have to do is:
  - convince it not to try to build the kernel module,
  - build it ourselves with our kernel-module infra.

I'll try to have a deeper look latter... Dinner now. :-)

If you hang around on IRC tonight UTC+2, we can talk about it, too.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] help please
       [not found]       ` <CAAfO8NwwwFGA-gCeFnOYs0HAbDAAnKs6nHnWusA-LzWpTWQ8ag@mail.gmail.com>
@ 2016-07-14 18:07         ` Yann E. MORIN
  2016-07-15  1:26           ` Mike King
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2016-07-14 18:07 UTC (permalink / raw)
  To: buildroot

Mike, All,

[Please, keep the list in Cc: when you reply]

On 2016-07-14 02:11 -0400, Mike King spake thusly:
> Buildroot can now build and install the package minus the drivers of
> course.  Thanks again!

So, I've done some work to build the kernel modules, too. It works now,
but it was far from being easy.

linux-gpib uses such a weird, deviously-twisted buildsystem, that
building the kernel modules, especially in cross-compilation, is not
trivial:

  - they forget to pass correct include paths;

  - they override standard kernel headers because they want to provide
    legacy handling (but even fail at that).

I've done a few patches to fix that (and the rest of the install
procedure, btw) so that linux-gpib now should work, except for the
language bindings, that are yet another challenge to address... :-/

You'll find my branch updated there:

    https://github.com/yann-morin-1998/buildroot/commits/yem/linux-gpib

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] help please
  2016-07-14 18:07         ` Yann E. MORIN
@ 2016-07-15  1:26           ` Mike King
  0 siblings, 0 replies; 5+ messages in thread
From: Mike King @ 2016-07-15  1:26 UTC (permalink / raw)
  To: buildroot

Yann, All,

I have added an option for the python binding.  It builds but it does
not install into the target filesystem.

I am far outside of my comfort zone.  I have a lot to learn.


diff --git a/package/linux-gpib/0006-fix.patch
b/package/linux-gpib/0006-fix.patch
new file mode 100644
index 0000000..bd8ac7e
--- /dev/null
+++ b/package/linux-gpib/0006-fix.patch
@@ -0,0 +1,112 @@
+--- linux-gpib-4.0.3/configure.ac 2016-07-14 19:42:36.836946372 +0000
++++ linux-gpib-4.0.3/configure.ac.new 2016-07-14 19:47:05.336949101 +0000
+@@ -40,13 +40,13 @@
+ AC_ENABLE_STATIC([no])
+ AC_ARG_ENABLE([isa],[  --enable-isa Enable support for ISA cards in
GPIB kernel drivers],
+ [ENABLE_ISA=$enableval],[ENABLE_ISA="no"])
+-if test "$ENABLE_ISA" == "yes" ; then
++if test "$ENABLE_ISA" = "yes" ; then
+ AC_DEFINE([GPIB_CONFIG_ISA],[1],[Define to enable ISA support in drivers])
+ fi
+ AC_SUBST([ENABLE_ISA])
+ AC_ARG_ENABLE([pcmcia],[  --enable-pcmcia Enable support for PCMCIA
cards in GPIB kernel drivers],
+ [ENABLE_PCMCIA=$enableval],[ENABLE_PCMCIA="no"])
+-if test "$ENABLE_PCMCIA" == "yes" ; then
++if test "$ENABLE_PCMCIA" = "yes" ; then
+ AC_DEFINE([GPIB_CONFIG_PCMCIA],[1],[Define to enable pcmcia support
in drivers])
+ fi
+ AC_ARG_ENABLE(
+@@ -55,7 +55,7 @@
+     [BUILD_DRIVER=$enableval],[BUILD_DRIVER="yes"])
+ AC_ARG_ENABLE([driver-debug],[  --enable-driver-debug Enable debug
spam to console in GPIB kernel drivers],
+ [ENABLE_DRIVER_SPAM=$enableval],[ENABLE_DRIVER_SPAM="no"])
+-if test "$ENABLE_DRIVER_SPAM" == "yes" ; then
++if test "$ENABLE_DRIVER_SPAM" = "yes" ; then
+ AC_DEFINE([GPIB_CONFIG_KERNEL_DEBUG],[1],[Define to enable debug
spam to console in drivers])
+ fi
+ AC_ARG_ENABLE([guile-binding],[  --disable-guile-binding Disable
Guile binding to libgpib],
+@@ -75,7 +75,7 @@
+ AC_ARG_WITH([linux-srcdir],
+ [  --with-linux-srcdir=DIR location of Linux kernel source directory
[[DIR=/lib/modules/$(uname -r)/build/]]],
+ [LINUX_SRCDIR=$withval],[LINUX_SRCDIR=/lib/modules/$(uname -r)/build/])
+-if test "$LINUX_SRCDIR" == "no" ; then
++if test "$LINUX_SRCDIR" = "no" ; then
+ AC_MSG_WARN([A Linux kernel source directory is required to compile
driver modules.  Use --with-linux-srcdir=DIR.])
+ fi
+ AC_SUBST([LINUX_SRCDIR])
+@@ -106,16 +106,16 @@
+ AC_PROG_YACC
+ AC_PROG_LIBTOOL
+ AC_PATH_PROG([JW_PATH], [jw], [no])
+-if test "$JW_PATH" == "no" ; then
++if test "$JW_PATH" = "no" ; then
+ AC_MSG_NOTICE([docbook-tools (jw) not found, disabling documentation])
+ BUILD_DOCS="no"
+ fi
+ AC_PATH_PROG([DEPMOD], [depmod], [true],
[PATH:/sbin:/usr/sbin:/usr/local/sbin])
+-if test "$DEPMOD" == "true" ; then
++if test "$DEPMOD" = "true" ; then
+ AC_MSG_WARN([unable to find the 'depmod' program.  Is it in your path?])
+ fi
+
+-if test "$BIND_PYTHON" == "yes"; then
++if test "$BIND_PYTHON" = "yes"; then
+ AM_PATH_PYTHON()
+ PYTHON_MAJOR_VERSION=$(echo $PYTHON_VERSION | cut -d. -f1 )
+ PYTHON_MINOR_VERSION=$(echo $PYTHON_VERSION | cut -d. -f2 )
+@@ -125,11 +125,11 @@
+ fi
+ fi
+ AC_PATH_PROG([PERL], [perl], [no], [])
+-if test "$PERL" == "no"; then
++if test "$PERL" = "no"; then
+ AC_MSG_NOTICE([perl not found, disabling perl binding])
+ BIND_PERL="no"
+ fi
+-if test "$BIND_TCL" == "yes"; then
++if test "$BIND_TCL" = "yes"; then
+    SC_PATH_TCLCONFIG
+    if [[ $no_tcl ]]; then
+         AC_MSG_NOTICE([TCL config not found, disabling TCL binding])
+@@ -139,7 +139,7 @@
+    fi
+ fi
+ AC_PATH_PROG([PHP_CONFIG], [php-config], [no],[])
+-if test "$PHP_CONFIG" == "no"; then
++if test "$PHP_CONFIG" = "no"; then
+ AC_MSG_NOTICE([php-config not found, disabling PHP binding])
+ BIND_PHP="no"
+ fi
+@@ -161,7 +161,7 @@
+
+ AC_CHECK_HEADER(readline/readline.h,[readline_h=yes])
+ AC_CHECK_HEADER(readline/history.h,[history_h=yes])
+-if test $readline_lib == "yes" -a $readline_h == "yes" -a $history_h
== "yes"; then
++if test $readline_lib = "yes" -a $readline_h = "yes" -a $history_h =
"yes"; then
+    AC_SUBST([LIB_READLINE_CFLAGS], ["-DREADLINE"])
+ fi
+
+@@ -203,17 +203,17 @@
+ echo Configuration:
+ AM_CONDITIONAL([BUILD_DRIVER],[test "$BUILD_DRIVER" = "yes"])
+ echo "Build driver: $BUILD_DRIVER"
+-AM_CONDITIONAL([BUILD_DOCS], [test "$BUILD_DOCS" == "yes"])
++AM_CONDITIONAL([BUILD_DOCS], [test "$BUILD_DOCS" = "yes"])
+ echo "SGML Documentation: $BUILD_DOCS"
+-AM_CONDITIONAL([BIND_GUILE], [test "$BIND_GUILE" == "yes"])
++AM_CONDITIONAL([BIND_GUILE], [test "$BIND_GUILE" = "yes"])
+ echo "Guile binding: $BIND_GUILE"
+-AM_CONDITIONAL([BIND_PERL], [test "$BIND_PERL" == "yes"])
++AM_CONDITIONAL([BIND_PERL], [test "$BIND_PERL" = "yes"])
+ echo "Perl binding: $BIND_PERL"
+-AM_CONDITIONAL([BIND_PHP], [test "$BIND_PHP" == "yes"])
++AM_CONDITIONAL([BIND_PHP], [test "$BIND_PHP" = "yes"])
+ echo "PHP binding: $BIND_PHP"
+-AM_CONDITIONAL([BIND_PYTHON], [test "$BIND_PYTHON" == "yes"])
++AM_CONDITIONAL([BIND_PYTHON], [test "$BIND_PYTHON" = "yes"])
+ echo "Python binding: $BIND_PYTHON"
+-AM_CONDITIONAL([BIND_TCL], [test "$BIND_TCL" == "yes"])
++AM_CONDITIONAL([BIND_TCL], [test "$BIND_TCL" = "yes"])
+ echo "TCL binding: $BIND_TCL"
+
+ AC_OUTPUT([\
diff --git a/package/linux-gpib/Config.in b/package/linux-gpib/Config.in
index 789daa8..a117883 100644
--- a/package/linux-gpib/Config.in
+++ b/package/linux-gpib/Config.in
@@ -1,4 +1,4 @@
-config BR2_PACKAGE_LINUX_GPIB
+menuconfig BR2_PACKAGE_LINUX_GPIB
  bool "linux-gpib"
  depends on BR2_LINUX_KERNEL
  select BR2_LINUX_NEEDS_MODULES
@@ -9,3 +9,15 @@ config BR2_PACKAGE_LINUX_GPIB
   to be compatible with National Instrument's GPIB library.

   http://linux-gpib.sourceforge.net
+
+if BR2_PACKAGE_LINUX_GPIB
+
+config BR2_PACKAGE_LINUX_GPIB_PYTHON
+ bool "Python support for linux-gpib"
+ depends on BR2_PACKAGE_PYTHON3
+ help
+  Adds python support for linux-gpib.
+
+  http://linux-gpib.sourceforge.net
+
+endif
diff --git a/package/linux-gpib/linux-gpib.mk b/package/linux-gpib/linux-gpib.mk
index 7796967..611908e 100644
--- a/package/linux-gpib/linux-gpib.mk
+++ b/package/linux-gpib/linux-gpib.mk
@@ -17,12 +17,24 @@ LINUX_GPIB_CONF_OPTS = \
  --disable-guile-binding \
  --disable-perl-binding \
  --disable-php-binding \
- --disable-python-binding \
  --disable-tcl-binding \
  --disable-driver \
  --disable-isa \
  --with-linux-srcdir=$(LINUX_DIR)

+define LINUX_GPIB_INSTALL_PYTHON_MODULES
+ #$(INSTALL) -m 755 util/templates/gpib.conf $(TARGET_DIR)/etc/gpib.conf
+endef
+
+ifeq ($(BR2_PACKAGE_LINUX_GPIB_PYTHON),y)
+ LINUX_GPIB_DEPENDENCIES += python3
+ LINUX_GPIB_POST_INSTALL_TARGET_HOOKS += \
+ LINUX_GPIB_INSTALL_PYTHON_MODULES
+else
+ LINUX_GPIB_CONF_OPTS += \
+ --disable-python-binding
+endif
+
 define LINUX_GPIB_INCLUDE_SYMLINK
  ln -s . $(@D)/drivers/gpib/include/gpib
 endef


On Thu, Jul 14, 2016 at 2:07 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Mike, All,
>
> [Please, keep the list in Cc: when you reply]
>
> On 2016-07-14 02:11 -0400, Mike King spake thusly:
>> Buildroot can now build and install the package minus the drivers of
>> course.  Thanks again!
>
> So, I've done some work to build the kernel modules, too. It works now,
> but it was far from being easy.
>
> linux-gpib uses such a weird, deviously-twisted buildsystem, that
> building the kernel modules, especially in cross-compilation, is not
> trivial:
>
>   - they forget to pass correct include paths;
>
>   - they override standard kernel headers because they want to provide
>     legacy handling (but even fail at that).
>
> I've done a few patches to fix that (and the rest of the install
> procedure, btw) so that linux-gpib now should work, except for the
> language bindings, that are yet another challenge to address... :-/
>
> You'll find my branch updated there:
>
>     https://github.com/yann-morin-1998/buildroot/commits/yem/linux-gpib
>
> Regards,
> Yann E. MORIN.
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-15  1:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 19:06 [Buildroot] help please Mike King
2016-07-12 20:44 ` Yann E. MORIN
     [not found]   ` <CAAfO8NykMv=DCdn=rV6tCFOfRvZQf84V82ZrKgtJW-422F9nfQ@mail.gmail.com>
2016-07-13 18:21     ` Yann E. MORIN
     [not found]       ` <CAAfO8NwwwFGA-gCeFnOYs0HAbDAAnKs6nHnWusA-LzWpTWQ8ag@mail.gmail.com>
2016-07-14 18:07         ` Yann E. MORIN
2016-07-15  1:26           ` Mike King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.