[pisa-src] r1566 - in trunk: Makefile.am configure.ac openwrt/package/pisa/Makefile pisacd/cdmain.c pisasd/sdmain.c tools/subversion/pisa_runautobuild

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Sat, 07 Nov 2009 17:59:38 +0100

Author: biurrun
Date: Sat Nov  7 17:59:38 2009
New Revision: 1566

Log:
Get rid of --enable-force-shlib configure option.

This option reimplements badly what can be achieved with the standard
--enable-shared and --disable-static options that every autoconf
configure script has available.

As a positive sideeffect, this allows getting rid of some more build system
hacks:
- Instead of manually figuring out whether to link to shared or static
  versions of libpisa, we can just declare a dependency on the libtool library
  archive and let libtool figure out the correct library variant to use.
- Now that we have correct library dependencies, we can drop the fake libpisa
  dependency hack.
- The same applies to libperformance.

There is one small drawback, but its effects are negligible: The static
library variant will get installed even though there is not strictly a
need for it to be installed.

Modified:
   trunk/Makefile.am
   trunk/configure.ac
   trunk/openwrt/package/pisa/Makefile
   trunk/pisacd/cdmain.c
   trunk/pisasd/sdmain.c
   trunk/tools/subversion/pisa_runautobuild

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am   Sat Nov  7 16:25:29 2009        (r1565)
+++ trunk/Makefile.am   Sat Nov  7 17:59:38 2009        (r1566)
@@ -149,42 +149,23 @@
 pairing_send_CFLAGS   = -DSEND
 pairing_accept_CFLAGS = -DACCEPT
 
-if PISA_FORCE_SHLIB
-  community_operator_co_client_LDADD = -Llibpisa -lpisa
-  community_operator_co_server_LDADD = -Llibpisa -lpisa
-  pairing_accept_LDADD               = -Llibpisa -lpisa
-  pairing_management_LDADD           = -Llibpisa -lpisa
-  pairing_send_LDADD                 = -Llibpisa -lpisa
-  pisacd_pisacd_LDADD                = -Llibpisa -lpisa
-  pisacd_pisacdconf_LDADD            = -Llibpisa -lpisa
-  pisasd_pisasd_LDADD                = -Llibpisa -lpisa
-  pisasd_pisasdconf_LDADD            = -Llibpisa -lpisa
-  test_checkhipd_LDADD               = -Llibpisa -lpisa
-  test_getns_LDADD                   = -Llibpisa -lpisa
-else
-  community_operator_co_client_LDADD = @PISA_LIBPISA_LIB_STATIC@
-  community_operator_co_server_LDADD = @PISA_LIBPISA_LIB_STATIC@
-  pairing_accept_LDADD               = @PISA_LIBPISA_LIB_STATIC@
-  pairing_management_LDADD           = @PISA_LIBPISA_LIB_STATIC@
-  pairing_send_LDADD                 = @PISA_LIBPISA_LIB_STATIC@
-  pisacd_pisacd_LDADD                = @PISA_LIBPISA_LIB_STATIC@
-  pisacd_pisacdconf_LDADD            = @PISA_LIBPISA_LIB_STATIC@
-  pisasd_pisasd_LDADD                = @PISA_LIBPISA_LIB_STATIC@
-  pisasd_pisasdconf_LDADD            = @PISA_LIBPISA_LIB_STATIC@
-  test_checkhipd_LDADD               = @PISA_LIBPISA_LIB_STATIC@
-  test_getns_LDADD                   = @PISA_LIBPISA_LIB_STATIC@
-endif
+community_operator_co_client_LDADD = libpisa/libpisa.la
+community_operator_co_server_LDADD = libpisa/libpisa.la
+pairing_accept_LDADD               = libpisa/libpisa.la
+pairing_management_LDADD           = libpisa/libpisa.la
+pairing_send_LDADD                 = libpisa/libpisa.la
+pisacd_pisacd_LDADD                = libpisa/libpisa.la
+pisacd_pisacdconf_LDADD            = libpisa/libpisa.la
+pisasd_pisasd_LDADD                = libpisa/libpisa.la
+pisasd_pisasdconf_LDADD            = libpisa/libpisa.la
+test_checkhipd_LDADD               = libpisa/libpisa.la
+test_getns_LDADD                   = libpisa/libpisa.la
 
 if PISA_PERFORMANCE
-  lib_LTLIBRARIES += performance/libperformance.la
-  pisacd_pisacd_LDADD += @PISA_PERFORMANCE_LIB_STATIC@
-  pisasd_pisasd_LDADD += @PISA_PERFORMANCE_LIB_STATIC@
-  pisacd/pisacd pisasd/pisasd: performance/libperformance.la
+lib_LTLIBRARIES += performance/libperformance.la
+pisacd_pisacd_LDADD += performance/libperformance.la
+pisasd_pisasd_LDADD += performance/libperformance.la
 endif
 
-# Make sure that libpisa is built first. The dependency is partially fake,
-# but should do no harm apart from potentially slowing down parallel builds.
-$(bin_PROGRAMS) $(sbin_PROGRAMS): libpisa/libpisa.la
-
 deb rpm:
        tools/packaging/create-package.sh $@

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac  Sat Nov  7 16:25:29 2009        (r1565)
+++ trunk/configure.ac  Sat Nov  7 17:59:38 2009        (r1566)
@@ -79,18 +79,6 @@
 fi
 AM_CONDITIONAL(PISA_LOGGING, test x"$ac_cv_use_logging" = x"yes")
 
-AC_ARG_ENABLE(force-shlib,
-             AC_HELP_STRING([--enable-force-shlib],
-                            [force linking to shared libraries (default=no)]),
-             [ac_cv_use_force_shlib=$enableval], [ac_cv_use_force_shlib=no])
-AC_CACHE_CHECK([whether to force linking to shared libraries],
-               [ac_cv_use_force_shlib], [ac_cv_use_force_shlib=no])
-if test x"$ac_cv_use_force_shlib" = x"yes"; then
-        AC_DEFINE(CONFIG_PISA_FORCE_SHLIB, AC_PREREQ(2.53))
-        AH_TEMPLATE(CONFIG_PISA_FORCE_SHLIB)
-fi
-AM_CONDITIONAL(PISA_FORCE_SHLIB, test x"$ac_cv_use_force_shlib" = x"yes")
-
 AC_ARG_ENABLE(openwrt,
              AC_HELP_STRING([--enable-openwrt],
                             [enable building of OpenWRT supporting parts 
(default=no)]),
@@ -107,17 +95,9 @@
 
 AC_PREFIX_DEFAULT("/usr/local")
 
-AC_SUBST(TOPSRC, `pwd`)
-
 # Set default AM_CFLAGS for the complete project.
 AC_SUBST(AM_CFLAGS, "-std=gnu99 -Wall -Wextra -Wredundant-decls 
-Wstrict-prototypes -Wdisabled-optimization -Wpointer-arith -Wundef -Winline 
-Wno-deprecated-declarations -Wmissing-prototypes -Wwrite-strings -Wcast-qual 
-Wshadow -Werror")
 
-AC_SUBST(PISA_LIBPISA_LIB_STATIC, "$TOPSRC/libpisa/.libs/libpisa.a")
-AC_SUBST(PISA_LIBPISA_LIB_DYNAMIC, "$TOPSRC/libpisa/.libs/libpisa.so")
-
-AC_SUBST(PISA_PERFORMANCE_LIB_STATIC, 
"$TOPSRC/performance/.libs/libperformance.a")
-AC_SUBST(PISA_PERFORMANCE_LIB_DYNAMIC, 
"$TOPSRC/performance/.libs/libperformance.so")
-
 # If no --prefix option is passed to configure, $prefix is empty. But we want
 # to expand $sysconfdir, which defaults to ${prefix}/etc. So set $prefix.
 if test "x$prefix" = "xNONE"; then

Modified: trunk/openwrt/package/pisa/Makefile
==============================================================================
--- trunk/openwrt/package/pisa/Makefile Sat Nov  7 16:25:29 2009        (r1565)
+++ trunk/openwrt/package/pisa/Makefile Sat Nov  7 17:59:38 2009        (r1566)
@@ -39,7 +39,6 @@
 
        $(call Build/Configure/Default, \
                --host=$(GNU_TARGET_NAME) --target=$(GNU_TARGET_NAME) \
-               --enable-force-shlib \
                --enable-openwrt \
        );
 endef

Modified: trunk/pisacd/cdmain.c
==============================================================================
--- trunk/pisacd/cdmain.c       Sat Nov  7 16:25:29 2009        (r1565)
+++ trunk/pisacd/cdmain.c       Sat Nov  7 17:59:38 2009        (r1566)
@@ -218,12 +218,6 @@
        fprintf(stderr, " -OPENWRT");
 #endif /* CONFIG_PISA_OPENWRT */
 
-#ifdef CONFIG_PISA_FORCE_SHLIB
-       fprintf(stderr, " +FORCE_SHLIB");
-#else
-       fprintf(stderr, " -FORCE_SHLIB");
-#endif /* CONFIG_PISA_FORCE_SHLIB */
-
        fprintf(stderr, "\n");
 
        exit(EXIT_FAILURE);

Modified: trunk/pisasd/sdmain.c
==============================================================================
--- trunk/pisasd/sdmain.c       Sat Nov  7 16:25:29 2009        (r1565)
+++ trunk/pisasd/sdmain.c       Sat Nov  7 17:59:38 2009        (r1566)
@@ -213,12 +213,6 @@
        fprintf(stderr, " -OPENWRT");
 #endif /* CONFIG_PISA_OPENWRT */
 
-#ifdef CONFIG_PISA_FORCE_SHLIB
-       fprintf(stderr, " +FORCE_SHLIB");
-#else
-       fprintf(stderr, " -FORCE_SHLIB");
-#endif /* CONFIG_PISA_FORCE_SHLIB */
-
        fprintf(stderr, "\n");
 
        exit(EXIT_FAILURE);

Modified: trunk/tools/subversion/pisa_runautobuild
==============================================================================
--- trunk/tools/subversion/pisa_runautobuild    Sat Nov  7 16:25:29 2009        
(r1565)
+++ trunk/tools/subversion/pisa_runautobuild    Sat Nov  7 17:59:38 2009        
(r1566)
@@ -48,7 +48,6 @@
 # Compile PISA in different configurations
 compile_pisa
 compile_pisa --disable-debug
-compile_pisa --enable-force-shlib
 compile_pisa --enable-logging
 compile_pisa --enable-openwrt
 compile_pisa --enable-performance

Other related posts: