[cpp-log4shib] 01/17: The old style config script was obsoleted by pkg-config

Scott Cantor cantor.2 at osu.edu
Mon Jun 25 10:18:12 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-log4shib.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-log4shib.git;a=commit;h=a1c9456d58324327419ff9324cb37efe0c64321e

commit a1c9456d58324327419ff9324cb37efe0c64321e
Author: Ferenc Wágner <wferi at niif.hu>
AuthorDate: Sun Apr 3 21:49:11 2016 +0200

    The old style config script was obsoleted by pkg-config
---
 Makefile.am                  |   8 +-
 configure.ac                 |   2 -
 log4shib-config.in           | 246 ---------------------------------
 log4shib.m4                  | 165 ----------------------
 m4/ac_config_libconfig_in.m4 | 319 -------------------------------------------
 5 files changed, 1 insertion(+), 739 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4bc2558..e464d36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,18 +9,12 @@ endif
 
 DIST_SUBDIRS = config src include doc tests
 
-bin_SCRIPTS = log4shib-config
-
-m4datadir = $(datadir)/aclocal
-m4data_DATA = log4shib.m4
-
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = log4shib.pc
 
 EXTRA_DIST = \
 	log4shib.spec.in \
 	log4shib.spec \
-	log4shib.m4 \
 	Portfile.in \
 	Portfile \
 	debian \
@@ -30,7 +24,7 @@ EXTRA_DIST = \
 .PHONY: check rpm docs doc-dist
 
 distclean-local:
-	$(RM) CONTENTS TAGS log4shib-config
+	$(RM) CONTENTS TAGS
 
 CONTENTS::
 	find $(top_srcdir) \( ! -type l -a -name '*.cpp' -o -name '*.hh' -o -name Makefile.am \) > $@
diff --git a/configure.ac b/configure.ac
index a05d080..98958d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,14 +149,12 @@ PETI_PEDANTIC_GCC
 # Create files
 # ----------------------------------------------------------------------------
 
-AC_CONFIG_LIBCONFIG_IN([log4shib])
 AC_CONFIG_PKGCONFIG_IN([log4shib], [C++ library for flexible logging, modeled after Log4j])
 
 AC_CONFIG_FILES([
 Makefile
 log4shib.spec
 log4shib.pc
-log4shib-config
 Portfile
 config/Makefile
 doc/Makefile
diff --git a/log4shib-config.in b/log4shib-config.in
deleted file mode 100644
index c04a9ef..0000000
--- a/log4shib-config.in
+++ /dev/null
@@ -1,246 +0,0 @@
-#! /bin/sh
-# log4shib-config library configuration script
-# generated by ac_config_libconfig_in.m4
- 
-template_version="1.0.0"
- 
-package="@PACKAGE@"
- 
-# usage instructions if no options given
-if test "$#" -eq 0; then
-   cat <<EOF
-Usage: log4shib-config [OPTIONS]
-Options:
-        [--prefix[=DIR]]
-        [--exec-prefix[=DIR]]
-        [--package]
-        [--version]
-        [--cflags]
-        [--libs]
-        [--help]
-EOF
-fi
- 
-# parse options
-o=""
-h=""
-for i in $@; do
-  case $i in
-    --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;
-    --exec-prefix=*) exec_prefix=`echo $i | sed -e "s/--exec-prefix=//"` ;;
-    --eprefix=*) exec_prefix=`echo $i | sed -e "s/--eprefix=//"` ;;
-    --prefix) echo_prefix="yes" ;;
-    --exec-prefix) echo_exec_prefix="yes" ;;
-    --eprefix) echo_eprefix="yes" ;;
-    --package) echo_package="yes" ;;
-    --version) echo_version="yes" ;;
-    --cflags) echo_cflags="yes" ;;
-    --libs) echo_libs="yes" ;;
-    --bindir) echo_bindir="yes" ;;
-    --sbindir) echo_sbindir="yes" ;;
-    --libexecdir) echo_libexecdir="yes" ;;
-    --datadir) echo_datadir="yes" ;;
-    --sysconfdir) echo_sysconfdir="yes" ;;
-    --sharedstatedir) echo_sharedstatedir="yes" ;;
-    --localstatedir) echo_localstatedir="yes" ;;
-    --libdir) echo_libdir="yes" ;;
-    --infodir) echo_infodir="yes" ;;
-    --mandir) echo_mandir="yes" ;;
-    --target) echo_target="yes" ;;
-    --host) echo_host="yes" ;;
-    --build) echo_build="yes" ;;
-    --pkgdatadir) echo_pkgdatadir="yes" ;;
-    --pkglibdir) echo_pkglibdir="yes" ;;
-    --pkgincludedir) echo_pkgincludedir="yes" ;;
-    --template-version) echo_template_version="yes" ;;
-    --help) echo_help="yes" ;;
-    //*|/*//*|./*//*)        echo_extra="yes" ;;
-    *) eval "echo Unknown option: $i" ; exit 1 ;;
-  esac
-done
- 
-# defaults from configure; set only if not set previously
-if test -z "$prefix" ; then
-  prefix="@prefix@"
-fi
-if test -z "$exec_prefix" ; then
-  exec_prefix="@exec_prefix@"
-fi
-if test -z "$bindir" ; then
-  bindir="@bindir@"
-fi
-if test -z "$sbindir" ; then
-  sbindir="@sbindir@"
-fi
-if test -z "$libexecdir" ; then
-  libexecdir="@libexecdir@"
-fi
-if test -z "$datadir" ; then
-  datadir="@datadir@"
-fi
-if test -z "$sysconfdir" ; then
-  sysconfdir="@sysconfdir@"
-fi
-if test -z "$sharedstatedir" ; then
-  sharedstatedir="@sharedstatedir@"
-fi
-if test -z "$localstatedir" ; then
-  localstatedir="@localstatedir@"
-fi
-if test -z "$libdir" ; then
-  libdir="@libdir@"
-fi
-if test -z "$infodir" ; then
-  infodir="@infodir@"
-fi
-if test -z "$mandir" ; then
-  mandir="@mandir@"
-fi
-if test -z "$includedir" ; then
-  includedir="@includedir@"
-fi
-if test -z "$target" ; then
-  target="@target@"
-fi
-if test -z "$host" ; then
-  host="@host@"
-fi
-if test -z "$build" ; then
-  build="@build@"
-fi
- 
-# generate output
-if test x$echo_module != xyes ; then
-  echo_module_log4shib="yes"
-fi
-if test x$echo_module_log4shib = xyes ; then
-  cflags="$cflags @log4shib_cflags@"
-  libs="$libs @log4shib_libs@"
-  version="$version @LOG4SHIB_VERSION@"
-fi
-if test x$echo_prefix = xyes ; then
-  o=" $prefix"
-fi
-if test x$echo_exec_prefix = xyes ; then
-  o="$o $exec_prefix"
-fi
-if test x$echo_eprefix = xyes ; then
-  o="$o $exec_prefix"
-fi
-if test x$echo_package = xyes ; then
-  o=" $package"
-fi
-if test x$echo_version = xyes ; then
-  o=" $version"
-fi
-if test x$echo_cflags = xyes ; then
-  i=`eval echo "$includedir"`
-  i=`eval echo "$i"`
-  if test "_$i" != "_/usr/include" ; then
-    o="$o -I$includedir"
-  fi
-  o="$o $cflags"
-fi
-if test x$echo_libs = xyes ; then
-  o="$o -L$libdir $libs"
-fi
-if test x$echo_bindir = xyes ; then
-  o=" $bindir"
-fi
-if test x$echo_sbindir = xyes ; then
-  o=" $sbindir"
-fi
-if test x$echo_libexecdir = xyes ; then
-  o=" $libexecdir"
-fi
-if test x$echo_datadir = xyes ; then
-  o=" $datadir"
-fi
-if test x$echo_sysconfdir = xyes ; then
-  o=" $sysconfdir"
-fi
-if test x$echo_sharedstatedir = xyes ; then
-  o=" $sharedstatedir"
-fi
-if test x$echo_localstatedir = xyes ; then
-  o=" $localstatedir"
-fi
-if test x$echo_libdir = xyes ; then
-  o=" $libdir"
-fi
-if test x$echo_infodir = xyes ; then
-  o=" $infodir"
-fi
-if test x$echo_mandir = xyes ; then
-  o=" $mandir"
-fi
-if test x$echo_target = xyes ; then
-  o=" $target"
-fi
-if test x$echo_host = xyes ; then
-  o=" $host"
-fi
-if test x$echo_build = xyes ; then
-  o=" $build"
-fi
-if test x$echo_pkgdatadir = xyes ; then
-  o=" ${datadir}/${package}"
-fi
-if test x$echo_pkglibdir = xyes ; then
-  o=" ${libdir}/${package}"
-fi
-if test x$echo_pkgincludedir = xyes ; then
-  o=" ${includedir}/${package}"
-fi
-if test x$echo_template_version = xyes ; then
-  o="$o $template_version"
-fi
-if test x$echo_help = xyes ; then
-  h="1"
-fi
-if test x$echo_extra = xyes ; then
-  v=`echo $i | sed -e s://:\$:g`
-  v=`eval "echo $v"`
-  o="$o $v"
-fi
- 
-# output data
-o=`eval "echo $o"`
-o=`eval "echo $o"`
-if test -n "$o" ; then 
-  eval "echo $o"
-fi
- 
-# help text
-if test ! -z "$h" ; then 
-  cat <<EOF
-All available options:
-  --prefix=DIR and   change \$prefix and \$exec-prefix
-  --exec-prefix=DIR  (affects all other options)
-  --prefix           \$prefix        $prefix
-  --exec_prefix  or... 
-  --eprefix          \$exec_prefix   $exec_prefix
-  --version          \$version       $version
-  --cflags           -I\$includedir  unless it is /usr/include
-  --libs             -L\$libdir \$LIBS $libs
-  --package          \$package       $package
-  --bindir           \$bindir        $bindir
-  --sbindir          \$sbindir       $sbindir
-  --libexecdir       \$libexecdir    $libexecdir
-  --datadir          \$datadir       $datadir
-  --sysconfdir       \$sysconfdir    $sysconfdir
-  --sharedstatedir   \$sharedstatedir$sharedstatedir
-  --localstatedir    \$localstatedir $localstatedir
-  --libdir           \$libdir        $libdir
-  --infodir          \$infodir       $infodir
-  --mandir           \$mandir        $mandir
-  --target           \$target        $target
-  --host             \$host          $host
-  --build            \$build         $build
-  --pkgdatadir       \$datadir/\$package    ${datadir}/${package}
-  --pkglibdir        \$libdir/\$package     ${libdir}/${package}
-  --pkgincludedir    \$includedir/\$package ${includedir}/${package}
-  --template-version \$template_version     $template_version
-  --help
-EOF
-fi
diff --git a/log4shib.m4 b/log4shib.m4
deleted file mode 100644
index d1f6101..0000000
--- a/log4shib.m4
+++ /dev/null
@@ -1,165 +0,0 @@
-# Configure paths for LOG4SHIB
-# Owen Taylor     97-11-3
-
-dnl AM_PATH_LOG4SHIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for LOG4SHIB, and define LOG4SHIB_CFLAGS and LOG4SHIB_LIBS
-dnl
-AC_DEFUN([AM_PATH_LOG4SHIB],
-[dnl 
-dnl Get the cflags and libraries from the log4shib-config script
-dnl
-AC_ARG_WITH(log4shib-prefix,[  --with-log4shib-prefix=PFX   Prefix where LOG4SHIB is installed (optional)],
-            log4shib_config_prefix="$withval", log4shib_config_prefix="")
-AC_ARG_WITH(log4shib-exec-prefix,[  --with-log4shib-exec-prefix=PFX Exec prefix where LOG4SHIB is installed (optional)],
-            log4shib_config_exec_prefix="$withval", log4shib_config_exec_prefix="")
-AC_ARG_ENABLE(log4shibtest, [  --disable-log4shibtest       Do not try to compile and run a test LOG4SHIB program],
-		    , enable_log4shibtest=yes)
-
-  if test x$log4shib_config_exec_prefix != x ; then
-     log4shib_config_args="$log4shib_config_args --exec-prefix=$log4shib_config_exec_prefix"
-     if test x${LOG4SHIB_CONFIG+set} != xset ; then
-        LOG4SHIB_CONFIG=$log4shib_config_exec_prefix/bin/log4shib-config
-     fi
-  fi
-  if test x$log4shib_config_prefix != x ; then
-     log4shib_config_args="$log4shib_config_args --prefix=$log4shib_config_prefix"
-     if test x${LOG4SHIB_CONFIG+set} != xset ; then
-        LOG4SHIB_CONFIG=$log4shib_config_prefix/bin/log4shib-config
-     fi
-  fi
-
-  AC_PATH_PROG(LOG4SHIB_CONFIG, log4shib-config, no)
-  min_log4shib_version=ifelse([$1], ,0.99.7,$1)
-  AC_MSG_CHECKING(for LOG4SHIB - version >= $min_log4shib_version)
-  no_log4shib=""
-  if test "$LOG4SHIB_CONFIG" = "no" ; then
-    no_log4shib=yes
-  else
-    LOG4SHIB_CFLAGS=`$LOG4SHIB_CONFIG $log4shib_config_args --cflags`
-    LOG4SHIB_LIBS=`$LOG4SHIB_CONFIG $log4shib_config_args --libs`
-    log4shib_config_major_version=`$LOG4SHIB_CONFIG $log4shib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    log4shib_config_minor_version=`$LOG4SHIB_CONFIG $log4shib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    log4shib_config_micro_version=`$LOG4SHIB_CONFIG $log4shib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_log4shibtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_CXXFLAGS="$CXXFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $LOG4SHIB_CFLAGS"
-      CXXFLAGS="$CXXFLAGS $LOG4SHIB_CFLAGS"
-      LIBS="$LOG4SHIB_LIBS $LIBS"
-dnl
-dnl Now check if the installed LOG4SHIB is sufficiently new. (Also sanity
-dnl checks the results of log4shib-config to some extent
-dnl
-      rm -f conf.log4shibtest
-      AC_TRY_RUN([
-#include <log4shib/Category.hh>
-#include <stdio.h>
-#include <stdlib.h>
-
-int 
-main ()
-{
-  int log4shib_major, log4shib_minor, log4shib_micro;
-  int major, minor, micro;
-  char *tmp_version;
-  char *tmp_log4shib_version;
-
-  system ("touch conf.log4shibtest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = strdup("$min_log4shib_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_log4shib_version");
-     exit(1);
-   }
-
-   /* HP/UX 9 (%@#!) writes to sscanf strings */
-   tmp_log4shib_version = strdup(LOG4SHIB_VERSION);
-   if (sscanf(tmp_log4shib_version, "%d.%d.%d", &log4shib_major, &log4shib_minor, &log4shib_micro) != 3) {
-     printf("%s, bad log4shib version string\n", LOG4SHIB_VERSION);
-     exit(1);
-   }
-
-   if ((log4shib_major > major) ||
-      ((log4shib_major == major) && (log4shib_minor > minor)) ||
-      ((log4shib_major == major) && (log4shib_minor == minor) && (log4shib_micro >= micro)))
-   {
-        return 0;
-   }
-   else
-   {
-        printf("\n*** An old version of LOG4SHIB (%d.%d.%d) was found.\n",
-               log4shib_major, log4shib_minor, log4shib_micro);
-        printf("*** You need a version of LOG4SHIB newer than %d.%d.%d. The latest version of\n",
-	       major, minor, micro);
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the log4shib-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LOG4SHIB, but you can also set the LOG4SHIB_CONFIG environment to point to the\n");
-        printf("*** correct copy of log4shib-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-   }
-
-   log4shib::Category& log = log4shib::Category::getRoot();
-   return 1;
-}
-],, no_log4shib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       CXXFLAGS="$ac_save_CXXFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_log4shib" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-if test "$LOG4SHIB_CONFIG" = "no" ; then
-echo "*** The log4shib-config script installed by LOG4SHIB could not be found"
-       echo "*** If LOG4SHIB was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the LOG4SHIB_CONFIG environment variable to the"
-       echo "*** full path to log4shib-config."
-     else
-       if test -f conf.log4shibtest ; then
-        :
-       else
-          echo "*** Could not run LOG4SHIB test program, checking why..."
-          CFLAGS="$CFLAGS $LOG4SHIB_CFLAGS"
-          CXXFLAGS="$CXXFLAGS $LOG4SHIB_CFLAGS"
-          LIBS="$LIBS $LOG4SHIB_LIBS"
-          AC_TRY_LINK([
-#include <log4shib/Category.hh>
-],      [ log4shib::Category::getRoot(); return 0; ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LOG4SHIB or finding the wrong"
-          echo "*** version of LOG4SHIB. If it is not finding LOG4SHIB, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LOG4SHIB was incorrectly installed"
-          echo "*** or that you have moved LOG4SHIB since it was installed. In the latter case, you"
-          echo "*** may want to edit the log4shib-config script: $LOG4SHIB_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          CXXFLAGS="$ac_save_CXXFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     LOG4SHIB_CFLAGS=""
-     LOG4SHIB_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(LOG4SHIB_CFLAGS)
-  AC_SUBST(LOG4SHIB_LIBS)
-  rm -f conf.log4shibtest
-])
diff --git a/m4/ac_config_libconfig_in.m4 b/m4/ac_config_libconfig_in.m4
deleted file mode 100644
index 8284e61..0000000
--- a/m4/ac_config_libconfig_in.m4
+++ /dev/null
@@ -1,319 +0,0 @@
-dnl @synopsis AC_CONFIG_LIBCONFIG_IN [(LIBRARY [, DESTINATION [, MODULES]])]
-dnl
-dnl Creates a custom LIBRARY-config script.  The script supports
-dnl --cflags, --libs and --version options, as well as all of the
-dnl standard configure variables e.g. --libdir and --sysconfdir.
-dnl --prefix and --exec-prefix may be specified to override the
-dnl defaults.  --help gives a complete list of available options.
-dnl Modules allow multiple sets of --libs, --cflags and --version
-dnl options to be used, and combined together.
-dnl
-dnl This macro saves you all the typing for a library-config.in script;
-dnl you don't even need to distribute one along. Place this macro
-dnl in your configure.ac, et voila, you got one that you want to install.
-dnl
-dnl The options:
-dnl
-dnl  $1 = LIBRARY       e.g. gtk, ncurses
-dnl  $2 = DESTINATION   Directory path, e.g. src/scripts
-dnl  $3 = MODULES       Additional library modules, not including the
-dnl                     default ($1).
-dnl
-dnl It is suggested that the following CFLAGS and LIBS variables are
-dnl used in your configure.in.  library_libs is *essential*.
-dnl library_cflags is important, but not always needed.  If they do not
-dnl exist, defaults will be taken from LIBRARY_CFLAGS, LIBRARY_LIBS
-dnl (should be -llibrary *only*) and LIBRARY_LIBDEPS (-l options for
-dnl libraries your library depends upon.
-dnl LIBLIBRARY_LIBS is simply $LIBRARY_LIBS $LIBRARY_LIBDEPS.
-dnl NB. LIBRARY and library are the name of your library, in upper and
-dnl lower case repectively e.g. GTK, gtk.
-dnl
-dnl  LIBRARY_CFLAGS:    cflags for compiling libraries and example progs
-dnl  LIBRARY_LIBS:      libraries for linking programs
-dnl  LIBRARY_LIBDEPS*:  libraries for linking libraries against (needed
-dnl                     to link -static
-dnl  library_cflags*:   cflags to store in library-config
-dnl  library_libs*:     libs to store in library-config
-dnl  LIBLIBRARY_LIBS:   libs to link programs IN THIS PACKAGE ONLY against
-dnl  LIBRARY_VERSION*:  the version of your library (x.y.z recommended)
-dnl    *=required if you want sensible output, otherwise they will be
-dnl      *guessed* (DWIM)
-dnl
-dnl Support for pkg-config is available by default.  libs, cflags and
-dnl version information will be obtained from the pkg-config metadata
-dnl file library.pc if it exists in the pkgconfig data directory.
-dnl The above information still needs to be specified, as it will still
-dnl be used if pkg-config is not found on the host system at configure
-dnl time.
-dnl
-dnl -I and -L flags will be obtained from *both* pkgconfig and the script.
-dnl AC_CONFIG_LIBCONFIG_IN_PKGCONFIG enables pkg-config support (default)
-dnl AC_CONFIG_LIBCONFIG_IN_STATIC disables pkg-config support
-dnl
-dnl There is also an AC_SUBST(LIBRARY_CONFIG) that will be set to
-dnl the name of the file that we output in this macro. Use as:
-dnl
-dnl  install-exec-local: install-config
-dnl  install-config:
-dnl     $(mkinstalldirs) $(DESTDIR)$(bindir)
-dnl     $(INSTALL_EXEC) @LIBRARY_CONFIG@ $(DESTDIR)$(bindir)
-dnl
-dnl Or, if using automake:
-dnl
-dnl  bin_SCRIPTS = @LIBRARY_CONFIG@
-dnl
-dnl Based upon AC_CREATE_GENERIC_CONFIG (ac_create_generic_config.m4)
-dnl by Guido Draheim <guidod at gmx.de> and gtk-config by Owen Taylor.
-dnl
-dnl @version $Id: ac_config_libconfig_in.m4,v 1.2 2002/09/12 21:53:35 guidod Exp $
-dnl @author Roger Leigh <roger at whinlatter.uklinux.net>
-dnl
-# AC_CONFIG_LIBCONFIG_IN(LIBRARY, DESTINATION, MODULES)
-# -----------------------------------------------------
-# Generate a custom LIBRARY-config script.  Create the script in the
-# DESTINATION directory, including support for MODULES.
-AC_DEFUN([AC_CONFIG_LIBCONFIG_IN],
-[# create a custom library-config file ($1-config)
-m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
-      [AC_PATH_PROG(PKG_CONFIG, pkg-config)])
-pushdef([LIBCONFIG_DIR], [m4_if([$2], , , [$2/])])
-LIBCONFIG_FILE="LIBCONFIG_DIR[]$1-config.in"
-AC_SUBST(target)dnl
-AC_SUBST(host)dnl
-AC_SUBST(build)dnl
-dnl create directory if it does not preexist
-m4_if([$2], , , [AS_MKDIR_P([$2])])
-AC_MSG_NOTICE([creating $LIBCONFIG_FILE])
-echo '#! /bin/sh' >$LIBCONFIG_FILE
-echo "# $1-config library configuration script" >>$LIBCONFIG_FILE
-echo '# generated by ac_config_libconfig_in.m4' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-echo 'template_version="1.0.0"' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-echo 'package="@PACKAGE@"' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-echo '# usage instructions if no options given' >>$LIBCONFIG_FILE
-echo 'if test "'"\$""#"'" -eq 0; then' >>$LIBCONFIG_FILE
-echo '   cat <<EOF' >>$LIBCONFIG_FILE
-m4_if($3, ,
-      [echo 'Usage: $1-config [[OPTIONS]]' >>$LIBCONFIG_FILE],
-      [echo 'Usage: $1-config [[OPTIONS]] [[LIBRARIES]]' >>$LIBCONFIG_FILE])
-echo 'Options:' >>$LIBCONFIG_FILE
-echo '        [[--prefix[=DIR]]]' >>$LIBCONFIG_FILE
-echo '        [[--exec-prefix[=DIR]]]' >>$LIBCONFIG_FILE
-echo '        [[--package]]' >>$LIBCONFIG_FILE
-echo '        [[--version]]' >>$LIBCONFIG_FILE
-echo '        [[--cflags]]' >>$LIBCONFIG_FILE
-echo '        [[--libs]]' >>$LIBCONFIG_FILE
-echo '        [[--help]]' >>$LIBCONFIG_FILE
-m4_if($3, , ,
-      [echo 'Libraries:' >>$LIBCONFIG_FILE
-       for module in $1 $3 ; do
-         echo "        $module" >>$LIBCONFIG_FILE ;
-       done])
-echo 'EOF' >>$LIBCONFIG_FILE
-echo 'fi' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-echo '# parse options' >>$LIBCONFIG_FILE
-echo 'o=""' >>$LIBCONFIG_FILE
-echo 'h=""' >>$LIBCONFIG_FILE
-echo 'for i in $''@; do' >>$LIBCONFIG_FILE
-echo '  case $i in' >>$LIBCONFIG_FILE
-options="prefix exec-prefix eprefix package version cflags libs bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir target host build pkgdatadir pkglibdir pkgincludedir template-version help"
-echo '    --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$LIBCONFIG_FILE
-echo '    --exec-prefix=*) exec_prefix=`echo $i | sed -e "s/--exec-prefix=//"` ;;' >>$LIBCONFIG_FILE
-echo '    --eprefix=*) exec_prefix=`echo $i | sed -e "s/--eprefix=//"` ;;' >>$LIBCONFIG_FILE
-for option in $options ; do
-  case $option in
-    exec-prefix)  echo "    --$option) echo_exec_prefix=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
-    template-version)  echo "    --$option) echo_template_version=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
-    *)  echo "    --$option) echo_$option=\"yes\" ;;" >>$LIBCONFIG_FILE ;;
-  esac
-done
-m4_if($3, , ,
-      [for module in $1 $3 ; do
-         echo "  $module) echo_module_$module=\"yes\" ;" >>$LIBCONFIG_FILE ;
-         echo '    echo_module="yes" ;;' >>$LIBCONFIG_FILE ;
-       done])
-echo '    //*|/*//*|./*//*)        echo_extra="yes" ;;' >>$LIBCONFIG_FILE
-echo '    *) eval "echo Unknown option: $i" ; exit 1 ;;' >>$LIBCONFIG_FILE
-echo '  esac' >>$LIBCONFIG_FILE
-echo 'done' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-# in the order of occurence a standard automake Makefile
-echo '# defaults from configure; set only if not set previously' >>$LIBCONFIG_FILE
-vars="prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir infodir mandir includedir target host build"
-for var in $vars ; do
-  echo "if test -z \"\$$var\" ; then" >>$LIBCONFIG_FILE
-  echo "  $var=\"@$var@\"" >>$LIBCONFIG_FILE
-  echo 'fi' >>$LIBCONFIG_FILE
-done
-echo ' ' >>$LIBCONFIG_FILE
-echo '# generate output' >>$LIBCONFIG_FILE
-echo 'if test x$echo_module != xyes ; then' >>$LIBCONFIG_FILE
-echo '  echo_module_$1="yes"' >>$LIBCONFIG_FILE
-echo 'fi' >>$LIBCONFIG_FILE
-AC_CONFIG_LIBCONFIG_IN_MODULES(m4_if([$3], , [$1], [m4_translit([$1 $3], [ ], [,])]))dnl
-for option in $options extra; do
-  case $option in
-    exec-prefix)  echo "if test x\$echo_exec_prefix = xyes ; then" >>$LIBCONFIG_FILE ;;
-    template-version)  echo "if test x\$echo_template_version = xyes ; then" >>$LIBCONFIG_FILE ;;
-    *)  echo "if test x\$echo_$option = xyes ; then" >>$LIBCONFIG_FILE ;;
-  esac
-  case $option in
-    exec-prefix | eprefix)  echo '  o="$o $exec_prefix"' >>$LIBCONFIG_FILE ;;
-    template-version)  echo '  o="$o $template_version"' >>$LIBCONFIG_FILE ;;
-    cflags)
-      echo '  i=`eval echo "$includedir"`' >>$LIBCONFIG_FILE ;
-      echo '  i=`eval echo "$i"`' >>$LIBCONFIG_FILE ;
-      echo '  if test "_$i" != "_/usr/include" ; then' >>$LIBCONFIG_FILE ;
-      echo '    o="$o -I$includedir"' >>$LIBCONFIG_FILE ;
-      echo '  fi' >>$LIBCONFIG_FILE ;
-      echo '  o="$o $cflags"' >>$LIBCONFIG_FILE ;;
-    libs)  echo '  o="$o -L$libdir $libs"' >>$LIBCONFIG_FILE ;;
-    help)  echo '  h="1"' >>$LIBCONFIG_FILE ;;
-    pkgdatadir)  echo "  o=\"$o \${datadir}/\${package}\"" >>$LIBCONFIG_FILE ;;
-    pkglibdir)  echo "  o=\"$o \${libdir}/\${package}\"" >>$LIBCONFIG_FILE ;;
-    pkgincludedir)  echo "  o=\"$o \${includedir}/\${package}\"" >>$LIBCONFIG_FILE ;;
-    extra)
-      echo '  v=`echo $i | sed -e s://:\$:g`' >>$LIBCONFIG_FILE ;
-      echo '  v=`eval "echo $v"`' >>$LIBCONFIG_FILE ;
-      echo '  o="$o $v"' >>$LIBCONFIG_FILE ;;
-    *)  echo "  o=\"$o \$$option\"" >>$LIBCONFIG_FILE
-  esac
-  echo 'fi' >>$LIBCONFIG_FILE
-done
-echo ' ' >>$LIBCONFIG_FILE
-echo '# output data' >>$LIBCONFIG_FILE
-echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
-echo 'o=`eval "echo $o"`' >>$LIBCONFIG_FILE
-echo 'if test -n "$o" ; then ' >>$LIBCONFIG_FILE
-echo '  eval "echo $o"' >>$LIBCONFIG_FILE
-echo 'fi' >>$LIBCONFIG_FILE
-echo ' ' >>$LIBCONFIG_FILE
-echo '# help text' >>$LIBCONFIG_FILE
-echo 'if test ! -z "$h" ; then ' >>$LIBCONFIG_FILE
-echo '  cat <<EOF' >>$LIBCONFIG_FILE
-echo 'All available options:' >>$LIBCONFIG_FILE
-echo '  --prefix=DIR and   change \$prefix and \$exec-prefix' >>$LIBCONFIG_FILE
-echo '  --exec-prefix=DIR  (affects all other options)' >>$LIBCONFIG_FILE
-echo '  --prefix           \$prefix        $prefix' >>$LIBCONFIG_FILE
-echo '  --exec_prefix  or... ' >>$LIBCONFIG_FILE
-echo '  --eprefix          \$exec_prefix   $exec_prefix' >>$LIBCONFIG_FILE
-echo '  --version          \$version       $version' >>$LIBCONFIG_FILE
-echo '  --cflags           -I\$includedir  unless it is /usr/include' >>$LIBCONFIG_FILE
-echo '  --libs             -L\$libdir \$LIBS $libs' >>$LIBCONFIG_FILE
-echo '  --package          \$package       $package' >>$LIBCONFIG_FILE
-echo '  --bindir           \$bindir        $bindir' >>$LIBCONFIG_FILE
-echo '  --sbindir          \$sbindir       $sbindir' >>$LIBCONFIG_FILE
-echo '  --libexecdir       \$libexecdir    $libexecdir' >>$LIBCONFIG_FILE
-echo '  --datadir          \$datadir       $datadir' >>$LIBCONFIG_FILE
-echo '  --sysconfdir       \$sysconfdir    $sysconfdir' >>$LIBCONFIG_FILE
-echo '  --sharedstatedir   \$sharedstatedir$sharedstatedir' >>$LIBCONFIG_FILE
-echo '  --localstatedir    \$localstatedir $localstatedir' >>$LIBCONFIG_FILE
-echo '  --libdir           \$libdir        $libdir' >>$LIBCONFIG_FILE
-echo '  --infodir          \$infodir       $infodir' >>$LIBCONFIG_FILE
-echo '  --mandir           \$mandir        $mandir' >>$LIBCONFIG_FILE
-echo '  --target           \$target        $target' >>$LIBCONFIG_FILE
-echo '  --host             \$host          $host' >>$LIBCONFIG_FILE
-echo '  --build            \$build         $build' >>$LIBCONFIG_FILE
-echo '  --pkgdatadir       \$datadir/\$package    ${datadir}/${package}'    >>$LIBCONFIG_FILE
-echo '  --pkglibdir        \$libdir/\$package     ${libdir}/${package}' >>$LIBCONFIG_FILE
-echo '  --pkgincludedir    \$includedir/\$package ${includedir}/${package}' >>$LIBCONFIG_FILE
-echo '  --template-version \$template_version     $template_version' >>$LIBCONFIG_FILE
-echo '  --help' >>$LIBCONFIG_FILE
-echo 'EOF' >>$LIBCONFIG_FILE
-echo 'fi' >>$LIBCONFIG_FILE
-m4_pushdef([LIBCONFIG_UP], [m4_translit([$1], [a-z], [A-Z])])dnl
-LIBCONFIG_UP[]_CONFIG="LIBCONFIG_DIR[]$1-config"
-AC_SUBST(LIBCONFIG_UP[]_CONFIG)
-dnl AC_CONFIG_FILES(LIBCONFIG_DIR[]$1[-config], [chmod +x ]LIBCONFIG_DIR[]$1[-config])
-m4_popdef([LIBCONFIG_DIR])
-m4_popdef([LIBCONFIG_UP])
-])
-
-
-# AC_CONFIG_LIBCONFIG_IN_MODULES [(MODULE1 [, MODULE2 [, ...]])]
-# --------------------------------------------------------------
-#Output shell script using custom module variables.
-AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES],
-[m4_if([$1], , ,
-       [# create module definition for $1
-dnl we're going to need uppercase, lowercase and user-friendly versions of the
-dnl string `MODULE'
-m4_pushdef([MODULE_UP], m4_translit([$1], [a-z], [A-Z]))dnl
-m4_pushdef([MODULE_DOWN], m4_translit([$1], [A-Z], [a-z]))dnl
-if test -z "$MODULE_DOWN[]_cflags" ; then
-  if test -n "$MODULE_UP[]_CFLAGS" ; then
-      MODULE_DOWN[]_cflags="$MODULE_UP[]_CFLAGS"
-  else
-dnl    AC_MSG_WARN([variable `MODULE_DOWN[]_cflags' undefined])
-    MODULE_DOWN[]_cflags=''
-  fi
-fi
-AC_SUBST(MODULE_DOWN[]_cflags)dnl
-if test -z "$MODULE_DOWN[]_libs" ; then
-  if test -n "$MODULE_UP[]_LIBS" ; then
-    MODULE_DOWN[]_libs="$MODULE_UP[]_LIBS"
-  else
-    AC_MSG_WARN([variable `MODULE_DOWN[]_libs' and `MODULE_UP[]_LIBS' undefined])
-    MODULE_DOWN[]_libs='-l$1'
-  fi
-  if test -n "$MODULE_UP[]_LIBDEPS" ; then
-    MODULE_DOWN[]_libs="$MODULE_DOWN[]_libs $MODULE_UP[]_LIBDEPS"
-  fi
-fi
-AC_SUBST(MODULE_DOWN[]_libs)dnl
-if test -z "$MODULE_UP[]_VERSION" ; then
-  AC_MSG_WARN([variable `MODULE_UP[]_VERSION' undefined])
-  MODULE_UP[]_VERSION="$VERSION"
-fi
-AC_SUBST(MODULE_UP[]_VERSION)dnl
-echo 'if test x$echo_module_$1 = xyes ; then' >>$LIBCONFIG_FILE
-AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([cflags], [MODULE_DOWN[]_cflags], [cflags])
-AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([libs], [MODULE_DOWN[]_libs], [libs])
-AC_CONFIG_LIBCONFIG_IN_MODULES_VARS([version], [MODULE_UP[]_VERSION], [modversion])
-echo 'fi' >>$LIBCONFIG_FILE
-m4_popdef([MODULE_UP])dnl
-m4_popdef([MODULE_DOWN])dnl
-AC_CONFIG_LIBCONFIG_IN_MODULES(m4_shift($@))])dnl
-])
-
-
-# AC_CONFIG_LIBCONFIG_IN_MODULES_VARS [(VAR, SUBSTITUTION,
-# PKGCONFIG_ARGS)]
-# --------------------------------------------------------
-# Output AC_CONFIG_LIBCONFIG_IN_MODULES variables.
-#   VAR = variable to set
-#   SUBSTITUTION = set if pkg-config is not available
-#   PKGCONFIG_ARGS = args for pkg-config
-AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_MODULES_VARS],
-[m4_if(AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG, [true],
-[
-echo 'if test -x "`which pkg-config`" ; then' >>$LIBCONFIG_FILE
-echo '  if pkg-config --atleast-pkgconfig-version=0.7 --exists "MODULE_DOWN"; then' >>$LIBCONFIG_FILE
-echo '    $1="@S|@$1 `pkg-config --$3 MODULE_DOWN`"' >>$LIBCONFIG_FILE
-echo '  fi' >>$LIBCONFIG_FILE
-echo 'else' >>$LIBCONFIG_FILE
-echo '  $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
-echo 'fi' >>$LIBCONFIG_FILE
-],
-[echo '  $1="@S|@$1 @$2@"' >>$LIBCONFIG_FILE
-])])
-
-
-# AC_CONFIG_LIBCONFIG_IN_PKGCONFIG
-# --------------------------------
-# Enable pkgconfig support in libconfig script (default)
-AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_PKGCONFIG],
-[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [true])
-])dnl
-
-
-# AC_CONFIG_LIBCONFIG_IN_STATIC
-# -----------------------------
-# Disable pkgconfig support in libconfig script
-AC_DEFUN([AC_CONFIG_LIBCONFIG_IN_STATIC],
-[m4_define([AC_CONFIG_LIBCONFIG_IN_USEPKGCONFIG], [false])
-])dnl

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list