From: Jens Rehsack <jr_extern@vfnet.de>
To: ofono@ofono.org
Subject: [PATCH] configure/make basics
Date: Mon, 27 Feb 2012 16:17:32 +0100 [thread overview]
Message-ID: <4F4B9E8C.3080809@vfnet.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 823 bytes --]
Hi,
while hacking on a plugin for mmsd to deal with supl push
messages, I ran into a few "not so nice" solved things
in configure.ac / Makefile.am
1) libtool handling
libtool configuration is meanwhile done using LT_INIT(options)
instead of AC_PROC_LIBTOOL and alike
==> because of libtool stores some of the configuration
in the generated libtool shell script, it's reasonable
to run LT_INIT as late as possible (painfully learned
while writing and porting c++ software for many OS)
2) additional libraries
do no require explicit libraries (like -lresolv), always
let a devop in doubt invoke configure with
LIBS="-lmyspecialwrapper" to wrap between available
libs/functions and requirements
See pkgsrc's nbcompat library for example
Best regards,
Jens
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-changing-depreciated-libtool-initialization-to-moder.patch --]
[-- Type: text/x-patch, Size: 1649 bytes --]
>From f2f5c911c0ac71ae0cdb0d7f54bbc0232ca001a1 Mon Sep 17 00:00:00 2001
From: Jens Rehsack <jr_extern@vfnet.de>
Date: Mon, 27 Feb 2012 15:41:34 +0100
Subject: [PATCH 2/3] changing depreciated libtool initialization to modern
one
---
Makefile.am | 4 ++++
configure.ac | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c3a4486..bebcb90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,10 @@
AM_MAKEFLAGS = --no-print-directory
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status libtool
+
gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
gdbus/object.c gdbus/polkit.c
diff --git a/configure.ac b/configure.ac
index 34cc526..d82569b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,8 @@ AC_PROG_INSTALL
m4_define([_LT_AC_TAGCONFIG], [])
m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+dnl AC_DISABLE_STATIC
+dnl AC_PROG_LIBTOOL
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
[disable code optimization through compiler]), [
@@ -58,6 +58,12 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
fi
])
+dnl LT_INIT should be invoked after all compiler flags checks, because
+dnl of LT_INIT remembers the RPATH stored in test targets which might
+dnl be different for different compiler flags (known issue on AIX)
+LT_INIT([dlopen,disable-static])
+AC_SUBST([LIBTOOL_DEPS])
+
AC_CHECK_HEADERS(resolv.h, dummy=yes,
AC_MSG_ERROR(resolver header files are required))
AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
--
1.7.9.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0003-let-configure-find-required-libs.patch --]
[-- Type: text/x-patch, Size: 2413 bytes --]
>From 47383148c76675da9965a4d54e0e1b985da22a6a Mon Sep 17 00:00:00 2001
From: Jens Rehsack <jr_extern@vfnet.de>
Date: Mon, 27 Feb 2012 16:07:18 +0100
Subject: [PATCH 3/3] let configure find required libs
---
Makefile.am | 2 +-
configure.ac | 24 +++++++++++++++++-------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index bebcb90..178def4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,7 +28,7 @@ src_mmsd_SOURCES = $(gdbus_sources) $(gweb_sources) $(builtin_sources) \
src/push.h src/push.c src/store.h src/store.c \
src/wsputil.h src/wsputil.c src/mmsutil.h src/mmsutil.c
-src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -lresolv -ldl
+src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@
src_mmsd_LDFLAGS = -Wl,--export-dynamic
diff --git a/configure.ac b/configure.ac
index d82569b..883b59c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,15 +64,25 @@ dnl be different for different compiler flags (known issue on AIX)
LT_INIT([dlopen,disable-static])
AC_SUBST([LIBTOOL_DEPS])
+dnl check how we can use the resolver. while resolv.h comes with bind,
+dnl it's probably reasonable to use a combined search macro like
+dnl smart-snmpd's ACX_CHECK_LIB_FLAGS
AC_CHECK_HEADERS(resolv.h, dummy=yes,
AC_MSG_ERROR(resolver header files are required))
-AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
- AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
- AC_MSG_ERROR(resolver library support is required))
-])
-
-AC_CHECK_LIB(dl, dlopen, dummy=yes,
- AC_MSG_ERROR(dynamic linking loader is required))
+dnl ns_initparse is libresolv internal use only - limited usage intended?
+AC_SEARCH_LIBS(ns_initparse, resolv, ,
+ AC_MSG_ERROR(resolver support is required))
+dnl AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+dnl AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
+dnl AC_MSG_ERROR(resolver library support is required))
+dnl ])
+
+dnl search how we can load dynamic libraries
+dnl TODO use libltdl, which would work on BeOS (Haiku), Darwin (MacOS X) or
+dnl for debugging purposes with libtool's dlpreopen
+AC_SEARCH_LIBS(dlopen, dl, , AC_MSG_ERROR(dynamic linking loader is required))
+dnl AC_CHECK_LIB(dl, dlopen, dummy=yes,
+dnl AC_MSG_ERROR(dynamic linking loader is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GLib >= 2.16 is required))
--
1.7.9.1
next reply other threads:[~2012-02-27 15:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 15:17 Jens Rehsack [this message]
2012-02-27 17:23 ` [PATCH] configure/make basics Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F4B9E8C.3080809@vfnet.de \
--to=jr_extern@vfnet.de \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.