Changeset 2418


Ignore:
Timestamp:
Jan 30, 2011, 4:43:08 AM (11 years ago)
Author:
Peter
Message:

fixes #655. add a helper script, gen-yat-pc.sh, that generates yat.pc. Variables are now kept implicit if possible, for example, exec_prefix=${prefix} and similar for includedir and libdir which are defined via ${prefix} and ${exec_prefix}, respectively. Added yat-pc-check that is called within maintainer-check to check that generation of yat.pc is correct with different combinations of arguments to configure and make.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.am

    r2417 r2418  
    4949## Some targets useful for the maintainer
    5050##
    51 MAINTAINER_CHECK_LOCAL = maintainer-check-local
     51MAINTAINER_CHECK_LOCAL = maintainer-check-local yat-pc-check
    5252RELEASE_LOCAL = ltversion-check
    5353
     
    7171  && cd test && $(MAKE) $(AM_MAKEFLAGS) prefix=$$mcl_install yat_check_yat_test
    7272
     73# check that yat.pc is correctly generated with different combinations
     74# of ./configure; make. This target is typically used within
     75# mainatiner-check; if used outside mainatiner-check, please not that
     76# the target callc configure possibly with other arguments, so it's
     77# probably a good a idea to re-configure afterwards.
     78yat-pc-check:
     79  $(SHELL) $(srcdir)/configure $(DISTCHECK_CONFIGURE_FLAGS) \
     80  && cd build_support \
     81  && rm yat.pc && make \
     82  && $(GREP) '^prefix=/usr/local' yat.pc \
     83  && $(GREP) '^exec_prefix=$${prefix}' yat.pc \
     84  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     85  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     86  && rm yat.pc && make prefix=foo \
     87  && $(GREP) '^prefix=foo' yat.pc \
     88  && $(GREP) '^exec_prefix=$${prefix}' yat.pc \
     89  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     90  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     91  && rm yat.pc && make prefix=foo exec_prefix=bar \
     92  && $(GREP) '^prefix=foo' yat.pc \
     93  && $(GREP) '^exec_prefix=bar' yat.pc \
     94  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     95  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     96  && rm yat.pc && make prefix=foo exec_prefix=bar libdir=baz includedir=quz\
     97  && $(GREP) '^prefix=foo' yat.pc \
     98  && $(GREP) '^exec_prefix=bar' yat.pc \
     99  && $(GREP) '^libdir=baz' yat.pc \
     100  && $(GREP) '^includedir=quz' yat.pc \
     101  && cd .. \
     102  && $(SHELL) $(srcdir)/configure $(DISTCHECK_CONFIGURE_FLAGS) exec_prefix=/t \
     103  && cd build_support \
     104  && rm yat.pc && make \
     105  && $(GREP) '^prefix=/usr/local' yat.pc \
     106  && $(GREP) '^exec_prefix=/t' yat.pc \
     107  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     108  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     109  && rm yat.pc && make prefix=foo \
     110  && $(GREP) '^prefix=foo' yat.pc \
     111  && $(GREP) '^exec_prefix=/t' yat.pc \
     112  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     113  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     114  && rm yat.pc && make prefix=foo exec_prefix=bar \
     115  && $(GREP) '^prefix=foo' yat.pc \
     116  && $(GREP) '^exec_prefix=bar' yat.pc \
     117  && $(GREP) '^libdir=$${exec_prefix}/lib' yat.pc \
     118  && $(GREP) '^includedir=$${prefix}/include' yat.pc \
     119  && rm yat.pc && make prefix=foo exec_prefix=bar libdir=baz includedir=quz\
     120  && $(GREP) '^prefix=foo' yat.pc \
     121  && $(GREP) '^exec_prefix=bar' yat.pc \
     122  && $(GREP) '^libdir=baz' yat.pc \
     123  && $(GREP) '^includedir=quz' yat.pc 
     124
     125
    73126include $(srcdir)/am/maintainer.am
  • trunk/build_support/Makefile.am

    r2328 r2418  
    33## $Id$
    44
    5 # Copyright (C) 2008, 2009, 2010 Peter Johansson
     5# Copyright (C) 2008, 2009, 2010, 2011 Peter Johansson
    66#
    77# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2828
    2929EXTRA_DIST =  move-if-change yat-config.in yat.pc.in
    30 
    31 
    3230
    3331edit = $(SED) \
     
    7371  @echo creating $@
    7472
    75 yat.pc: Makefile $(srcdir)/yat.pc.in
    76   @rm -f $@ $@.tmp
    77   @echo "# $@ generated by make from yat.pc.in" > $@.tmp
    78   @$(edit) '$(srcdir)/$@.in' >>$@.tmp
    79   @chmod a-w $@.tmp
    80   @mv $@.tmp $@
    81   @echo creating $@
     73yat.pc: $(srcdir)/yat.pc.in gen_yat_pc.sh Makefile
     74  @$(SHELL) gen_yat_pc.sh --prefix="$(prefix)" --exec-prefix="$(exec_prefix)" \
     75  --libdir="$(libdir)" --includedir="$(includedir)" \
     76  --input="$(srcdir)/yat.pc.in" > $@-t && mv $@-t $@
     77
    8278
    8379install-exec-hook:
  • trunk/configure.ac

    r2354 r2418  
    88# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
    99# Copyright (C) 2009 Jari Häkkinen, Peter Johansson
    10 # Copyright (C) 2010 Peter Johansson
     10# Copyright (C) 2010, 2011 Peter Johansson
    1111#
    1212# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    264264
    265265AC_CONFIG_FILES([test/create_yathello.sh], [chmod +x test/create_yathello.sh])
     266AC_CONFIG_FILES([build_support/gen_yat_pc.sh],
     267                [chmod +x build_support/gen_yat_pc.sh])
    266268AC_CONFIG_FILES([Makefile
    267269     build_support/Makefile
Note: See TracChangeset for help on using the changeset viewer.