Skip to contentSkip to conversation

fix cross-compile when libtirpc is used

PATCH Waldemar Brodkorb 2 participants 3 messages Jun 27, 2017 – Jun 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I would like to suggest following patch, which uses pkg-config to find libtirpc headers and libraries.
This allows to cross-compile autofs. The patch was suggested on the buildroot mailinglist, too.

Best regards
Waldemar

From 7582cb88121d1ca4431def9175469e1590e9c29f Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <[email protected]>
Date: Tue, 27 Jun 2017 18:11:56 +0200
Subject: [PATCH] use pkg-config to search for libtirpc to fix
cross-compilation

---
 Makefile.conf.in |  3 ++-
 Makefile.rules   |  2 +-
 aclocal.m4       | 48 ------------------------------------------------
 configure.in     | 11 +++++++++--
 4 files changed, 12 insertions(+), 52 deletions(-)
Makefile.conf.in +2 -1
index 2bc3202..f879e26 100644
@@ -64,7 +64,8 @@ RPCGEN = @PATH_RPCGEN@
 RANLIB = @PATH_RANLIB@
 
 # Use libtirpc if requested and available
-TIRPCLIB = @TIRPCLIB@
+TIRPCLIB = @TIRPC_LIBS@
+TIRPCCFLAGS = @TIRPC_CFLAGS@
 
 # Use dmalloc for memory debuging
 DMALLOCLIB = @DMALLOCLIB@
Makefile.rules +1 -1
index 7d1af2e..0edf9bf 100644
@@ -46,7 +46,7 @@ CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
 LIBS += -lpthread
 
 ifdef TIRPCLIB
-CFLAGS += -I/usr/include/tirpc
+CFLAGS += $(TIRPCCFLAGS)
 LIBS += $(TIRPCLIB)
 endif
 
aclocal.m4 +0 -48

51 lines not on this page · raw message

configure.in +9 -2
index 0521252..43a2776 100644
@@ -11,6 +11,9 @@ define([AC_CACHE_LOAD], )dnl
 define([AC_CACHE_SAVE], )dnl
 AC_INIT(.autofs-5.1.3)
 
+# for pkg-config/pkconf
+m4_include([pkg.m4])
+
 #
 # autofs installs by default in /usr
 #
@@ -124,8 +127,12 @@ AC_SUBST(flagdir)
 #
 # Use libtirpc
 #
-AF_WITH_LIBTIRPC()
-AC_SUBST(TIRPCLIB)
+PKG_PROG_PKG_CONFIG()
+
+AC_ARG_WITH([libtirpc], AS_HELP_STRING([--with-libtirpc], [Build with the TIRPC library]))
+if test "x$with_libtirpc" = "xyes"; then
+  PKG_CHECK_MODULES([TIRPC],[libtirpc])
+fi
 
 #
 # Optional include dmalloc
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 6 lines · Waldemar Brodkorb

Hi,

I would like to suggest following patch, which uses pkg-config to find libtirpc headers and libraries.
This allows to cross-compile autofs. The patch was suggested on the buildroot mailinglist, too.

Where is the patch description?
What happens if a pkg config package is not installed?

And how are WITH_LIBTIRPC and TIRPC_WORKAROUND defined?

Ian
--
To unsubscribe from this list: send the line "unsubscribe autofs" in

maintainer
#2 lore raw
Quoted 8 lines · Ian Kent
Quoted 6 lines · Waldemar Brodkorb

Hi,

I would like to suggest following patch, which uses pkg-config to find libtirpc headers and libraries.
This allows to cross-compile autofs. The patch was suggested on the buildroot mailinglist, too.

Quoted 4 lines

Where is the patch description?
What happens if a pkg config package is not installed?

And how are WITH_LIBTIRPC and TIRPC_WORKAROUND defined?

And another small detail.

[raven@pluto autofs-dev.git]$ make configure
autoconf
/usr/bin/m4:configure.in:15: cannot open `pkg.m4': No such file or directory
autom4te: /usr/bin/m4 failed with exit status: 1
Makefile:52: recipe for target 'configure' failed
make: *** [configure] Error 1

--
To unsubscribe from this list: send the line "unsubscribe autofs" in