Changeset 155

Show
Ignore:
Timestamp:
01/18/06 16:21:39 (18 years ago)
Author:
wagi
Message:

2006-01-19 Daniel Wagner <wagi@monom.org>

  • This patch cleans up the external dependency detection for
    libfreebob. At present, building libfreebob is not possible
    if libraries are outside the system include/library paths
    (ie /usr/ and /usr/local). Use the results of pkg-config to
    specify the correct paths to the automake system.

Becuase we're using pkgconfig, there's no real need to use
AC_CHECK_LIB or AC_CHECK_HEADERS. However, these could
potentially be reinstated, but need to be fixed to check in
the locations specified by pkgconfig.

  • It is not currently possible to build freebob in a directory
    outside the source dir (ie, builddir != srcdir). This patch
    fixes the include paths to allow this. (it's handy for keeping
    the source tree clean, or when building on multiple architectures
  • I use a build dir of $srcdir/obj-$arch-$os)

Both patches are written by Jeremy Kerr <jk@ozlabs.org>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libfreebob/ChangeLog

    r154 r155  
     12006-01-19  Daniel Wagner  <wagi@monom.org> 
     2 
     3        * This patch cleans up the external dependency detection for  
     4        libfreebob. At present, building libfreebob is not possible  
     5        if libraries are outside the system include/library paths  
     6        (ie /usr/ and /usr/local). Use the results of pkg-config to  
     7        specify the correct paths to the automake system. 
     8 
     9        Becuase we're using pkgconfig, there's no real need to use  
     10        AC_CHECK_LIB or AC_CHECK_HEADERS. However, these could  
     11        potentially be reinstated, but need to be fixed to check in  
     12        the locations specified by pkgconfig. 
     13 
     14        * It is not currently possible to build freebob in a directory  
     15        outside the source dir (ie, builddir != srcdir). This patch  
     16        fixes the include paths to allow this. (it's handy for keeping  
     17        the source tree clean, or when building on multiple architectures  
     18        - I use a build dir of $srcdir/obj-$arch-$os) 
     19 
     20        Both patches are written by Jeremy Kerr <jk@ozlabs.org> 
     21 
    1222006-01-12  Daniel Wagner  <wagi@monom.org> 
    223 
  • trunk/libfreebob/config.h.in

    r125 r155  
    1313#undef HAVE_DLFCN_H 
    1414 
    15 /* Wheter or not execinfo.h is present */ 
    16 #undef HAVE_EXECINFO_H 
    17  
    1815/* Define to 1 if you have the <inttypes.h> header file. */ 
    1916#undef HAVE_INTTYPES_H 
    2017 
    21 /* Define to 1 if you have the `avc1394' library (-lavc1394). */ 
    22 #undef HAVE_LIBAVC1394 
    23  
    2418/* Define to 1 if you have the `pthread' library (-lpthread). */ 
    2519#undef HAVE_LIBPTHREAD 
    26  
    27 /* Define to 1 if you have the `raw1394' library (-lraw1394). */ 
    28 #undef HAVE_LIBRAW1394 
    29  
    30 /* Define to 1 if you have the <libraw1394/raw1394.h> header file. */ 
    31 #undef HAVE_LIBRAW1394_RAW1394_H 
    3220 
    3321/* Define to 1 if you have the <memory.h> header file. */ 
  • trunk/libfreebob/configure.ac

    r151 r155  
    8383AC_PROG_LIBTOOL 
    8484 
     85# Checks for typedefs, structures, and compiler characteristics. 
     86AC_CANONICAL_HOST 
     87AC_C_CONST 
     88AC_C_VOLATILE 
     89AC_TYPE_SIZE_T 
     90 
    8591# XXX Debian specific hack: 
    8692# by Marcelo Magallon <mmagallo@efis.ucr.ac.cr> 
     
    97103esac 
    98104 
    99 AC_CHECK_LIB(raw1394, raw1394_new_handle, , 
    100             [AC_MSG_ERROR([Unable to link with libraw1394. Check that you have libraw1394 installed])]) 
    101  
    102 AC_CHECK_LIB(avc1394, avc1394_vcr_record, , 
    103              [AC_MSG_ERROR([Unable to link with libavc1394. Check that you have libavc1394 installed and that the version is 0.5.1 or newer])]) 
    104  
    105105AC_CHECK_LIB(pthread, pthread_create,, 
    106106[ 
     
    108108]) 
    109109 
    110 # Checks for header files. 
    111 AC_CHECK_HEADERS([libraw1394/raw1394.h], , 
    112     [AC_MSG_ERROR([raw1394.h not found install libraw1394-devel]) 
    113 ]) 
    114  
    115 AC_CHECK_HEADER([libavc1394/avc1394.h], , 
    116         [AC_MSG_ERROR([avc1394.h not found, install libavc1394-devel]) 
    117 ]) 
    118 AC_CHECK_HEADER(execinfo.h, [AC_DEFINE(HAVE_EXECINFO_H, 1, Wheter or not execinfo.h is present) 
    119         EXTRA_LIBS="$EXTRA_LIBS -rdynamic"]) 
    120  
    121 # Check for libXML2 
     110# Check for dependencies 
     111PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0) 
     112PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.1.0) 
     113PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.2) 
     114PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0) 
    122115PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0) 
    123 AC_SUBST([LIBXML_LIBS]) 
    124 AC_SUBST([LIBXML_CFLAGS]) 
    125          
    126 # Checks for typedefs, structures, and compiler characteristics. 
    127 AC_CANONICAL_HOST 
    128 AC_C_CONST 
    129 AC_C_VOLATILE 
    130 AC_TYPE_SIZE_T 
    131116 
    132117# Setup CFLAGS and CXXFLAGS 
     
    157142AC_ENABLE_SHARED(yes) 
    158143 
    159 # Create links for header file. 
    160  
    161 # Checks for library functions. 
    162 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0) 
    163 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.1.0) 
    164  
    165 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0) 
    166  
    167144AC_SUBST([LIBSIGC_CFLAGS]) 
    168145AC_SUBST([LIBSIGC_LIBS]) 
     146AC_SUBST([ALSA_CFLAGS]) 
     147AC_SUBST([ALSA_LIBS]) 
    169148AC_SUBST([LIBRAW1394_CFLAGS]) 
    170149AC_SUBST([LIBRAW1394_LIBS]) 
    171150AC_SUBST([LIBIEC61883_CFLAGS]) 
    172151AC_SUBST([LIBIEC61883_LIBS]) 
    173 AC_SUBST([ALSA_CFLAGS]) 
    174 AC_SUBST([ALSA_LIBS]) 
    175 LIBAVC_LIBS="-lrom1394 -lavc1394" 
    176 AC_SUBST([LIBAVC_LIBS]) 
     152AC_SUBST([LIBAVC1394_CFLAGS]) 
     153AC_SUBST([LIBAVC1394_LIBS]) 
     154AC_SUBST([LIBXML_LIBS]) 
     155AC_SUBST([LIBXML_CFLAGS]) 
    177156 
    178157AC_CONFIG_FILES([Makefile 
  • trunk/libfreebob/INSTALL

    r138 r155  
    1 Installation Instructions 
    2 ************************* 
    3  
    4 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 
    5 Software Foundation, Inc. 
    6  
    7 This file is free documentation; the Free Software Foundation gives 
     1Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software 
     2Foundation, Inc. 
     3 
     4   This file is free documentation; the Free Software Foundation gives 
    85unlimited permission to copy, distribute and modify it. 
    96 
     
    118================== 
    129 
    13 These are generic installation instructions. 
     10   These are generic installation instructions. 
    1411 
    1512   The `configure' shell script attempts to guess correct values for 
     
    7168===================== 
    7269 
    73 Some systems require unusual options for compilation or linking that the 
    74 `configure' script does not know about.  Run `./configure --help' for 
    75 details on some of the pertinent environment variables. 
     70   Some systems require unusual options for compilation or linking that 
     71the `configure' script does not know about.  Run `./configure --help' 
     72for details on some of the pertinent environment variables. 
    7673 
    7774   You can give `configure' initial values for configuration parameters 
     
    8683==================================== 
    8784 
    88 You can compile the package for more than one kind of computer at the 
     85   You can compile the package for more than one kind of computer at the 
    8986same time, by placing the object files for each architecture in their 
    9087own directory.  To do this, you must use a version of `make' that 
     
    103100================== 
    104101 
    105 By default, `make install' will install the package's files in 
     102   By default, `make install' will install the package's files in 
    106103`/usr/local/bin', `/usr/local/man', etc.  You can specify an 
    107104installation prefix other than `/usr/local' by giving `configure' the 
    108 option `--prefix=PREFIX'. 
     105option `--prefix=PATH'. 
    109106 
    110107   You can specify separate installation prefixes for 
    111108architecture-specific files and architecture-independent files.  If you 
    112 give `configure' the option `--exec-prefix=PREFIX', the package will 
    113 use PREFIX as the prefix for installing programs and libraries. 
     109give `configure' the option `--exec-prefix=PATH', the package will use 
     110PATH as the prefix for installing programs and libraries. 
    114111Documentation and other data files will still use the regular prefix. 
    115112 
    116113   In addition, if you use an unusual directory layout you can give 
    117 options like `--bindir=DIR' to specify different values for particular 
     114options like `--bindir=PATH' to specify different values for particular 
    118115kinds of files.  Run `configure --help' for a list of the directories 
    119116you can set and what kinds of files go in them. 
     
    126123================= 
    127124 
    128 Some packages pay attention to `--enable-FEATURE' options to 
     125   Some packages pay attention to `--enable-FEATURE' options to 
    129126`configure', where FEATURE indicates an optional part of the package. 
    130127They may also pay attention to `--with-PACKAGE' options, where PACKAGE 
     
    141138========================== 
    142139 
    143 There may be some features `configure' cannot figure out automatically, 
    144 but needs to determine by the type of machine the package will run on. 
    145 Usually, assuming the package is built to be run on the _same_ 
    146 architectures, `configure' can figure that out, but if it prints a 
    147 message saying it cannot guess the machine type, give it the 
     140   There may be some features `configure' cannot figure out 
     141automatically, but needs to determine by the type of machine the package 
     142will run on.  Usually, assuming the package is built to be run on the 
     143_same_ architectures, `configure' can figure that out, but if it prints 
     144a message saying it cannot guess the machine type, give it the 
    148145`--build=TYPE' option.  TYPE can either be a short name for the system 
    149146type, such as `sun4', or a canonical name which has the form: 
     
    171168================ 
    172169 
    173 If you want to set default values for `configure' scripts to share, you 
    174 can create a site shell script called `config.site' that gives default 
    175 values for variables like `CC', `cache_file', and `prefix'. 
     170   If you want to set default values for `configure' scripts to share, 
     171you can create a site shell script called `config.site' that gives 
     172default values for variables like `CC', `cache_file', and `prefix'. 
    176173`configure' looks for `PREFIX/share/config.site' if it exists, then 
    177174`PREFIX/etc/config.site' if it exists.  Or, you can set the 
     
    182179================== 
    183180 
    184 Variables not defined in a site shell script can be set in the 
     181   Variables not defined in a site shell script can be set in the 
    185182environment passed to `configure'.  However, some packages may run 
    186183configure again during the build, and the customized values of these 
     
    190187     ./configure CC=/usr/local2/bin/gcc 
    191188 
    192 causes the specified `gcc' to be used as the C compiler (unless it is 
    193 overridden in the site shell script).  Here is a another example: 
    194  
    195      /bin/bash ./configure CONFIG_SHELL=/bin/bash 
    196  
    197 Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 
    198 configuration-related scripts to be executed by `/bin/bash'. 
     189will cause the specified gcc to be used as the C compiler (unless it is 
     190overridden in the site shell script). 
    199191 
    200192`configure' Invocation 
    201193====================== 
    202194 
    203 `configure' recognizes the following options to control how it operates. 
     195   `configure' recognizes the following options to control how it 
     196operates. 
    204197 
    205198`--help' 
  • trunk/libfreebob/src/libfreebobavc/ieee1394service.h

    r125 r155  
    2222#define FREEBOBIEEE1394SERVICE_H 
    2323 
    24 #include "src/fbtypes.h" 
     24#include "fbtypes.h" 
    2525 
    2626#include <libraw1394/raw1394.h> 
  • trunk/libfreebob/src/libfreebobavc/Makefile.am

    r125 r155  
    4444                ieee1394service.cpp 
    4545 
    46 INCLUDES = $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) 
    47 libfreebobavc_la_LIBADD  = $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC_LIBS) 
     46INCLUDES = $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) $(LIBAVC1394_CFLAGS) \ 
     47        -I$(top_srcdir)/src 
     48libfreebobavc_la_LIBADD  = $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) \ 
     49        $(LIBAVC1394_LIBS) 
    4850 
    4951MAINTAINERCLEANFILES = Makefile.in 
  • trunk/libfreebob/src/Makefile.am

    r125 r155  
    1818SUBDIRS = debugmodule libfreebobavc 
    1919 
    20 INCLUDES = $(LIBSIGC_CFLAGS) $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) $(LIBAVC_CFLAGS) $(LIBLO_CFLAGS) $(LIBXML_CFLAGS) 
     20INCLUDES = $(LIBSIGC_CFLAGS) $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) \ 
     21        $(LIBAVC1394_CFLAGS) $(LIBLO_CFLAGS) $(LIBXML_CFLAGS) \ 
     22        -I$(top_srcdir) -I$(top_srcdir)/src 
    2123 
    2224lib_LTLIBRARIES = libfreebob.la 
     
    3941        fbtypes.h 
    4042 
    41 libfreebob_la_LDFLAGS = -version-info $(LT_VERSION) -lpthread $(LIBSIGC_LIBS) $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC_LIBS) $(LIBLO_LIBS) $(LIBXML_LIBS) debugmodule/libdebugmodule.la libfreebobavc/libfreebobavc.la -safe-temps 
     43libfreebob_la_LDFLAGS = -version-info $(LT_VERSION) -lpthread $(LIBSIGC_LIBS) \ 
     44        $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC1394_LIBS) \ 
     45        $(LIBLO_LIBS) $(LIBXML_LIBS) debugmodule/libdebugmodule.la \ 
     46        libfreebobavc/libfreebobavc.la -safe-temps 
    4247 
  • trunk/libfreebob/tests/Makefile.am

    r125 r155  
    1616# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1717 
    18 AM_CFLAGS = -I@top_srcdir@libfreebob -I@top_builddir@/libfreebob $(LIBXML_CFLAGS)  
     18INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src $(LIBXML_CFLAGS) \ 
     19        $(LIBAVC1394_CFLAGS) 
    1920 
    2021noinst_PROGRAMS = test-freebob test-extplugcmd 
     
    2223 
    2324test_freebob_SOURCES = test-freebob.c 
    24 test_freebob_LDADD   = @top_builddir@src/libfreebob.la $(LIBXML_LIBS)  
     25test_freebob_LDADD   = $(top_builddir)/src/libfreebob.la $(LIBXML_LIBS) 
    2526 
    2627test_extplugcmd_SOURCES = test-extplugcmd.cpp 
    27 test_extplugcmd_LDADD = @top_builddir@src/libfreebobavc/libfreebobavc.la 
     28test_extplugcmd_LDADD = $(top_builddir)/src/libfreebobavc/libfreebobavc.la 
    2829 
    2930#TESTS_ENVIRONMENT 
  • trunk/libfreebob/tests/test-extplugcmd.cpp

    r142 r155  
    1919 */ 
    2020 
    21 #include "src/libfreebobavc/avc_extended_plug_info.h" 
    22 #include "src/libfreebobavc/avc_plug_info.h" 
    23 #include "src/libfreebobavc/serialize.h" 
    24 #include "src/libfreebobavc/ieee1394service.h" 
     21#include "libfreebobavc/avc_extended_plug_info.h" 
     22#include "libfreebobavc/avc_plug_info.h" 
     23#include "libfreebobavc/serialize.h" 
     24#include "libfreebobavc/ieee1394service.h" 
    2525 
    2626#include <argp.h>