Changes in m4/libgnutls.m4 [8df5b25:9d9b093] in mod_gnutls


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/libgnutls.m4

    r8df5b25 r9d9b093  
    1 dnl Autoconf macros for libgnutls
     1dnl Autoconf macros for libgnutls-extra
    22dnl $id$
    33
    4 # Modified for LIBGNUTLS -- nmav
     4# Modified for LIBGNUTLS_EXTRA -- nmav
    55# Configure paths for LIBGCRYPT
    66# Shamelessly stolen from the one of XDELTA by Owen Taylor
    77# Werner Koch   99-12-09
    88
    9 dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
    10 dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
     9dnl AM_PATH_LIBGNUTLS_EXTRA([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
     10dnl Test for libgnutls-extra, and define LIBGNUTLS_EXTRA_CFLAGS and LIBGNUTLS_EXTRA_LIBS
    1111dnl
    12 AC_DEFUN([AM_PATH_LIBGNUTLS],
     12AC_DEFUN([AM_PATH_LIBGNUTLS_EXTRA],
    1313[dnl
    14 dnl Get the cflags and libraries from the libgnutls-config script
     14dnl Get the cflags and libraries from the libgnutls-extra-config script
    1515dnl
    16 AC_ARG_WITH(libgnutls-prefix,
    17           [  --with-libgnutls-prefix=PFX   Prefix where libgnutls is installed (optional)],
    18           libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
     16AC_ARG_WITH(libgnutls-extra-prefix,
     17          [  --with-libgnutls-extra-prefix=PFX   Prefix where libgnutls-extra is installed (optional)],
     18          libgnutls_extra_config_prefix="$withval", libgnutls_extra_config_prefix="")
    1919
    20   if test x$libgnutls_config_prefix != x ; then
    21      if test x${LIBGNUTLS_CONFIG+set} != xset ; then
    22         LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
     20  if test x$libgnutls_extra_config_prefix != x ; then
     21     if test x${LIBGNUTLS_EXTRA_CONFIG+set} != xset ; then
     22        LIBGNUTLS_EXTRA_CONFIG=$libgnutls_extra_config_prefix/bin/libgnutls-extra-config
    2323     fi
    2424  fi
    2525
    26   AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
     26  AC_PATH_PROG(LIBGNUTLS_EXTRA_CONFIG, libgnutls-extra-config, no)
    2727  min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
    2828  AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
    2929  no_libgnutls=""
    30   if test "$LIBGNUTLS_CONFIG" = "no" ; then
     30  if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then
    3131    no_libgnutls=yes
    3232  else
    33     LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
    34     LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
    35     libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
     33    LIBGNUTLS_EXTRA_CFLAGS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --cflags`
     34    LIBGNUTLS_EXTRA_LIBS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --libs`
     35    libgnutls_extra_config_version=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version`
    3636
    3737
    3838      ac_save_CFLAGS="$CFLAGS"
    3939      ac_save_LIBS="$LIBS"
    40       CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
    41       LIBS="$LIBS $LIBGNUTLS_LIBS"
     40      CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS"
     41      LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS"
    4242dnl
    4343dnl Now check if the installed libgnutls is sufficiently new. Also sanity
    44 dnl checks the results of libgnutls-config to some extent
     44dnl checks the results of libgnutls-extra-config to some extent
    4545dnl
    4646      rm -f conf.libgnutlstest
     
    4949#include <stdlib.h>
    5050#include <string.h>
    51 #include <gnutls/gnutls.h>
     51#include <gnutls/extra.h>
    5252
    5353int
     
    5656    system ("touch conf.libgnutlstest");
    5757
    58     if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
     58    if( strcmp( gnutls_extra_check_version(NULL), "$libgnutls_extra_config_version" ) )
    5959    {
    60       printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
    61              "$libgnutls_config_version", gnutls_check_version(NULL) );
    62       printf("*** was found! If libgnutls-config was correct, then it is best\n");
    63       printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
     60      printf("\n*** 'libgnutls-extra-config --version' returned %s, but LIBGNUTLS_EXTRA (%s)\n",
     61             "$libgnutls_extra_config_version", gnutls_extra_check_version(NULL) );
     62      printf("*** was found! If libgnutls-extra-config was correct, then it is best\n");
     63      printf("*** to remove the old version of LIBGNUTLS_EXTRA. You may also be able to fix the error\n");
    6464      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
    6565      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
    6666      printf("*** required on your system.\n");
    67       printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
    68       printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
     67      printf("*** If libgnutls-extra-config was wrong, set the environment variable LIBGNUTLS_EXTRA_CONFIG\n");
     68      printf("*** to point to the correct copy of libgnutls-extra-config, and remove the file config.cache\n");
    6969      printf("*** before re-running configure\n");
    7070    }
    71     else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
     71    else if ( strcmp(gnutls_extra_check_version(NULL), LIBGNUTLS_EXTRA_VERSION ) )
    7272    {
    73       printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
    74       printf("*** library (version %s)\n", gnutls_check_version(NULL) );
     73      printf("\n*** LIBGNUTLS_EXTRA header file (version %s) does not match\n", LIBGNUTLS_EXTRA_VERSION);
     74      printf("*** library (version %s). This is may be due to a different version of gnutls\n", gnutls_extra_check_version(NULL) );
     75      printf("*** and gnutls-extra.\n");
    7576    }
    7677    else
    7778    {
    78       if ( gnutls_check_version( "$min_libgnutls_version" ) )
     79      if ( gnutls_extra_check_version( "$min_libgnutls_version" ) )
    7980      {
    8081        return 0;
     
    8283     else
    8384      {
    84         printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
    85                 gnutls_check_version(NULL) );
    86         printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
     85        printf("no\n*** An old version of LIBGNUTLS_EXTRA (%s) was found.\n",
     86                gnutls_extra_check_version(NULL) );
     87        printf("*** You need a version of LIBGNUTLS_EXTRA newer than %s. The latest version of\n",
    8788               "$min_libgnutls_version" );
    88         printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
     89        printf("*** LIBGNUTLS_EXTRA is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
    8990        printf("*** \n");
    9091        printf("*** If you have already installed a sufficiently new version, this error\n");
    91         printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
     92        printf("*** probably means that the wrong copy of the libgnutls-extra-config shell script is\n");
    9293        printf("*** being found. The easiest way to fix this is to remove the old version\n");
    93         printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
    94         printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
     94        printf("*** of LIBGNUTLS_EXTRA, but you can also set the LIBGNUTLS_EXTRA_CONFIG environment to point to the\n");
     95        printf("*** correct copy of libgnutls-extra-config. (In this case, you will have to\n");
    9596        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
    9697        printf("*** so that the correct libraries are found at run-time))\n");
     
    113114        AC_MSG_RESULT(no)
    114115     fi
    115      if test "$LIBGNUTLS_CONFIG" = "no" ; then
    116        echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
    117        echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
    118        echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
    119        echo "*** full path to libgnutls-config."
     116     if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then
     117       echo "*** The libgnutls-extra-config script installed by LIBGNUTLS_EXTRA could not be found"
     118       echo "*** If LIBGNUTLS_EXTRA was installed in PREFIX, make sure PREFIX/bin is in"
     119       echo "*** your path, or set the LIBGNUTLS_EXTRA_CONFIG environment variable to the"
     120       echo "*** full path to libgnutls-extra-config."
    120121     else
    121122       if test -f conf.libgnutlstest ; then
     
    123124       else
    124125          echo "*** Could not run libgnutls test program, checking why..."
    125           CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
    126           LIBS="$LIBS $LIBGNUTLS_LIBS"
     126          CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS"
     127          LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS"
    127128          AC_TRY_LINK([
    128129#include <stdio.h>
    129130#include <stdlib.h>
    130131#include <string.h>
    131 #include <gnutls/gnutls.h>
    132 ],      [ return !!gnutls_check_version(NULL); ],
     132#include <gnutls/extra.h>
     133],      [ return !!gnutls_extra_check_version(NULL); ],
    133134        [ echo "*** The test program compiled, but did not run. This usually means"
    134           echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
    135           echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
     135          echo "*** that the run-time linker is not finding LIBGNUTLS_EXTRA or finding the wrong"
     136          echo "*** version of LIBGNUTLS_EXTRA. If it is not finding LIBGNUTLS_EXTRA, you'll need to set your"
    136137          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
    137138          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
     
    142143          echo "***" ],
    143144        [ echo "*** The test program failed to compile or link. See the file config.log for the"
    144           echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
    145           echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
    146           echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
     145          echo "*** exact error that occured. This usually means LIBGNUTLS_EXTRA was incorrectly installed"
     146          echo "*** or that you have moved LIBGNUTLS_EXTRA since it was installed. In the latter case, you"
     147          echo "*** may want to edit the libgnutls-extra-config script: $LIBGNUTLS_EXTRA_CONFIG" ])
    147148          CFLAGS="$ac_save_CFLAGS"
    148149          LIBS="$ac_save_LIBS"
    149150       fi
    150151     fi
    151      LIBGNUTLS_CFLAGS=""
    152      LIBGNUTLS_LIBS=""
     152     LIBGNUTLS_EXTRA_CFLAGS=""
     153     LIBGNUTLS_EXTRA_LIBS=""
    153154     ifelse([$3], , :, [$3])
    154155  fi
    155156  rm -f conf.libgnutlstest
    156   AC_SUBST(LIBGNUTLS_CFLAGS)
    157   AC_SUBST(LIBGNUTLS_LIBS)
     157  AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
     158  AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
    158159
    159   LIBGNUTLS_VERSION=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
    160   LIBGNUTLS_PREFIX="`$LIBGNUTLS_CONFIG $libgnutls_config_args --prefix`"
     160  LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS
     161  LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS
     162  LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version`
     163  LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`"
    161164  GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool"
    162165
     
    166169  AC_SUBST(LIBGNUTLS_PREFIX)
    167170  AC_SUBST(LIBGNUTLS_CERTTOOL)
    168 
     171 
    169172])
    170173
Note: See TracChangeset for help on using the changeset viewer.