~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-12 15:04:52 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20051212150452-qcbqpbwx86cbo29a
Tags: upstream-7.15.1
ImportĀ upstreamĀ versionĀ 7.15.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl $Id: configure.ac,v 1.149 2005/05/13 21:19:21 bagder Exp $
 
1
dnl $Id: configure.ac,v 1.171 2005/11/29 16:17:53 bagder Exp $
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
4
AC_PREREQ(2.57)
122
122
  *-*-mingw*)
123
123
    AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
124
124
    AC_MSG_RESULT(yes)
125
 
 ļæ½ ļæ½AC_MSG_CHECKING([if we need CURL_STATICLIB])
 
125
    AC_MSG_CHECKING([if we need CURL_STATICLIB])
126
126
    if test "X$enable_shared" = "Xno"
127
127
    then
128
128
      AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
129
129
      AC_MSG_RESULT(yes)
130
 
 ļæ½ ļæ½else
131
 
 ļæ½ ļæ½ ļæ½AC_MSG_RESULT(no)
 
130
    else
 
131
      AC_MSG_RESULT(no)
132
132
    fi
133
133
    ;;
134
134
  *)
251
251
  esac ],
252
252
       AC_MSG_RESULT(yes)
253
253
)
 
254
AC_MSG_CHECKING([whether to support tftp])
 
255
AC_ARG_ENABLE(tftp,
 
256
AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
 
257
AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
 
258
[ case "$enableval" in
 
259
  no)
 
260
       AC_MSG_RESULT(no)
 
261
       AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
 
262
       AC_SUBST(CURL_DISABLE_TFTP, [1])
 
263
       ;;
 
264
  *)   AC_MSG_RESULT(yes)
 
265
       ;;
 
266
  esac ],
 
267
       AC_MSG_RESULT(yes)
 
268
)
254
269
 
255
270
dnl **********************************************************************
256
271
dnl Check for built-in manual
567
582
AC_ARG_WITH(krb4,dnl
568
583
AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
569
584
  OPT_KRB4="$withval"
570
 
  if test X"$OPT_KRB4" != Xyes
571
 
  then
572
 
    LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
573
 
    KRB4LIB="$OPT_KRB4/lib$libsuff"
574
 
    CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
575
 
    KRB4INC="$OPT_KRB4/include"
 
585
  if test X"$OPT_KRB4" != Xno; then
 
586
    want_krb4="yes"
 
587
    if test X"$OPT_KRB4" != Xyes; then
 
588
      LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
 
589
      KRB4LIB="$OPT_KRB4/lib$libsuff"
 
590
      CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
 
591
      KRB4INC="$OPT_KRB4/include"
 
592
    fi
576
593
  fi
577
 
  want_krb4="yes"
578
594
 ])
579
595
 
580
596
AC_MSG_CHECKING([if Kerberos4 support is requested])
643
659
 
644
660
AC_ARG_WITH(spnego,
645
661
  AC_HELP_STRING([--with-spnego=DIR],
646
 
                 [Specify location of SPNEGO library fbopenssl]),
647
 
  [ SPNEGO_ROOT="$withval"
648
 
    want_spnego="yes" ]
649
 
)
 
662
                 [Specify location of SPNEGO library fbopenssl]), [
 
663
  SPNEGO_ROOT="$withval"
 
664
  if test x"$SPNEGO_ROOT" != xno; then
 
665
    want_spnego="yes"
 
666
  fi
 
667
])
 
668
 
650
669
AC_MSG_CHECKING([if SPNEGO support is requested])
651
670
if test x"$want_spnego" = xyes; then
652
671
 
683
702
AC_ARG_WITH(gssapi-libs,
684
703
  AC_HELP_STRING([--with-gssapi-libs=DIR],
685
704
                 [Specify location of GSSAPI libs]),
686
 
  [ GSSAPI_LIBS="-L$withval -lgssapi"
 
705
  [ GSSAPI_LIBS="-L$withval"
687
706
    want_gss="yes" ]
688
707
)
689
708
 
690
709
AC_ARG_WITH(gssapi,
691
710
  AC_HELP_STRING([--with-gssapi=DIR],
692
 
                 [Where to look for GSSAPI]),
693
 
  [ GSSAPI_ROOT="$withval"
694
 
    want_gss="yes" ]
695
 
)
 
711
                 [Where to look for GSSAPI]), [
 
712
  GSSAPI_ROOT="$withval"
 
713
  if test x"$GSSAPI_ROOT" != xno; then
 
714
    want_gss="yes" 
 
715
  fi
 
716
])
696
717
 
 
718
save_CPPFLAGS="$CPPFLAGS"
697
719
AC_MSG_CHECKING([if GSSAPI support is requested])
698
720
if test x"$want_gss" = xyes; then
 
721
  AC_MSG_RESULT(yes)
 
722
 
699
723
  if test -z "$GSSAPI_INCS"; then
700
724
     if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
701
725
        GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
704
728
     fi
705
729
  fi
706
730
  CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
707
 
  
708
 
  if test -z "$GSSAPI_LIB_DIR"; then
 
731
 
 
732
  AC_CHECK_HEADER(gss.h,
 
733
    [
 
734
      dnl found in the given dirs
 
735
      AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
 
736
      gnu_gss=yes
 
737
    ],
 
738
    [
 
739
      dnl not found, check Heimdal
 
740
      AC_CHECK_HEADER(gssapi.h,
 
741
        [
 
742
          dnl found in the given dirs
 
743
          AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
 
744
        ],
 
745
        [
 
746
          dnl not found, check in gssapi/ subdir 
 
747
          AC_CHECK_HEADER(gssapi/gssapi.h,
 
748
            [
 
749
              dnl found 
 
750
              AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
 
751
            ],
 
752
            [
 
753
              dnl no header found, disabling GSS
 
754
              want_gss=no
 
755
              AC_MSG_WARN(disabling GSSAPI since no header files was found)
 
756
            ]
 
757
          )
 
758
        ]
 
759
      )        
 
760
    ]
 
761
  )
 
762
else
 
763
  AC_MSG_RESULT(no)
 
764
fi
 
765
if test x"$want_gss" = xyes; then
 
766
  AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
 
767
 
 
768
  curl_gss_msg="enabled (MIT/Heimdal)"
 
769
 
 
770
  if test -n "$gnu_gss"; then
 
771
    curl_gss_msg="enabled (GNU GSS)"
 
772
    LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgss"
 
773
  elif test -z "$GSSAPI_LIB_DIR"; then
709
774
     if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
710
775
        gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
711
776
        LDFLAGS="$LDFLAGS $gss_ldflags"
715
780
        LDFLAGS="$LDFLAGS -lgssapi"
716
781
     fi
717
782
  else
718
 
     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
 
783
     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgssapi"
719
784
  fi
720
 
 
721
 
  AC_MSG_RESULT(yes)
722
 
  AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
723
 
 
724
 
  curl_gss_msg="enabled"
725
 
 
726
 
  AC_CHECK_HEADER(gssapi.h,
727
 
    [
728
 
       dnl found in the given dirs
729
 
      AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
730
 
    ],
731
 
    [
732
 
      dnl not found, check in gssapi/ subdir 
733
 
      AC_CHECK_HEADER(gssapi/gssapi.h,
734
 
        dnl found 
735
 
        AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
736
 
      )
737
 
      
738
 
    ]
739
 
  )
740
 
 
741
785
else
742
 
  AC_MSG_RESULT(no)
 
786
  CPPFLAGS="$save_CPPFLAGS"
743
787
fi
744
788
  
745
789
dnl **********************************************************************
768
812
      dnl only do pkg-config magic when not cross-compiling
769
813
      PKGTEST="yes"
770
814
    fi
771
 
    EXTRA_SSL=/usr/local/ssl ;;
 
815
    PREFIX_OPENSSL=/usr/local/ssl
 
816
    LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
 
817
    ;;
772
818
  off)
773
819
    dnl no --with-ssl option given, just check default places
774
820
    if test x$cross_compiling != xyes; then
775
821
      dnl only do pkg-config magic when not cross-compiling
776
822
      PKGTEST="yes"
777
823
    fi
778
 
    EXTRA_SSL= ;;
 
824
    PREFIX_OPENSSL=
 
825
    ;;
779
826
  *)
780
827
    dnl check the given --with-ssl spot
781
828
    PKGTEST="no"
782
 
    EXTRA_SSL=$OPT_SSL
783
 
    LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
784
 
    CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
 
829
    PREFIX_OPENSSL=$OPT_SSL
 
830
    LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
 
831
    LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
 
832
    CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
785
833
    ;;
786
834
  esac
787
835
 
803
851
        SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
804
852
        SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
805
853
 
 
854
        LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
 
855
 
806
856
        dnl use the values pkg-config reported
807
857
        LIBS="$LIBS $SSL_LIBS"
808
858
        CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
832
882
     HAVECRYPTO="yes"
833
883
     LIBS="-lcrypto $LIBS"
834
884
     ],[
835
 
     LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
836
 
     CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
 
885
     LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
 
886
     CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
837
887
     AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
838
888
       HAVECRYPTO="yes"
839
889
       LIBS="-lcrypto $LIBS"], [
918
968
  fi
919
969
 
920
970
  if test "$OPENSSL_ENABLED" = "1"; then
921
 
    dnl when the ssl shared libs were found in a path that the run-time linker
922
 
    dnl doesn't search through, we need to add it to LD_LIBRARY_PATH to
923
 
    dnl prevent further configure tests to fail due to this
924
 
    LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$EXTRA_SSL/lib$libsuff"
925
 
    export LD_LIBRARY_PATH
 
971
    if test -n "$LIB_OPENSSL"; then
 
972
       dnl when the ssl shared libs were found in a path that the run-time
 
973
       dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
 
974
       dnl to prevent further configure tests to fail due to this
 
975
 
 
976
       LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
 
977
       export LD_LIBRARY_PATH
 
978
       AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
 
979
    fi
926
980
  fi
927
981
 
928
982
fi
964
1018
dnl ----------------------------------------------------
965
1019
 
966
1020
dnl Default to compiler & linker defaults for GnuTLS files & libraries.
967
 
OPT_GNUTLS=off
 
1021
OPT_GNUTLS=no
968
1022
 
969
1023
AC_ARG_WITH(gnutls,dnl
970
1024
AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
973
1027
 
974
1028
if test "$OPENSSL_ENABLED" != "1"; then
975
1029
 
976
 
  if test X"$OPT_GNUTLS" != Xoff; then
 
1030
  if test X"$OPT_GNUTLS" != Xno; then
977
1031
    if test "x$OPT_GNUTLS" = "xyes"; then
978
1032
     check=`libgnutls-config --version 2>/dev/null`
979
1033
     if test -n "$check"; then
1023
1077
 
1024
1078
        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
1025
1079
        export LD_LIBRARY_PATH
 
1080
        AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
1026
1081
      fi
1027
1082
 
1028
1083
    fi
1168
1223
       dnl if there is a given path, check that FIRST
1169
1224
       if test -n "$LIBIDN"; then
1170
1225
         if test "x$LIBIDN" != "xyes"; then
1171
 
            AC_MSG_WARN([moo moo $LIBIDN])
1172
1226
            oldLDFLAGS=$LDFLAGS
1173
1227
            oldCPPFLAGS=$CPPFLAGS
1174
1228
            LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
1254
1308
  dnl is there a strerror_r()
1255
1309
  CURL_CHECK_STRERROR_R()
1256
1310
 
1257
 
  AC_CHECK_FUNCS( gmtime_r )
 
1311
  checkfor_gmtime_r="yes"
1258
1312
fi
1259
1313
 
1260
1314
dnl for recent AIX versions, we skip all the thread-safe checks above since
1290
1344
  dnl is there a strerror_r()
1291
1345
  CURL_CHECK_STRERROR_R()
1292
1346
 
1293
 
  AC_CHECK_FUNCS( gmtime_r )
 
1347
  checkfor_gmtime_r="yes"
 
1348
fi
 
1349
 
 
1350
if test x$cross_compiling != xyes; then
 
1351
 
 
1352
  if test x$checkfor_gmtime_r = xyes; then
 
1353
 
 
1354
    dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX
 
1355
    dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
 
1356
    dnl it.
 
1357
 
 
1358
    AC_MSG_CHECKING([if gmtime_r exists and works])
 
1359
    AC_RUN_IFELSE([[
 
1360
    #include <time.h>
 
1361
    int main(void)
 
1362
    {
 
1363
    time_t local = 1170352587;
 
1364
    struct tm *gmt;
 
1365
    struct tm keeper;
 
1366
    putenv("TZ=CST6CDT");
 
1367
    tzset();
 
1368
    gmt = gmtime_r(&local, &keeper);
 
1369
    if(gmt) {
 
1370
      return 0;
 
1371
    }
 
1372
    return 1; /* failure */
 
1373
    }
 
1374
     ]],
 
1375
     dnl success, do nothing
 
1376
     AC_MSG_RESULT(yes)
 
1377
     AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
 
1378
     ,
 
1379
     dnl failure, now disable the function
 
1380
     AC_MSG_RESULT(no)
 
1381
    ,
 
1382
    dnl not invoked when crosscompiling)
 
1383
    ])
 
1384
  fi
 
1385
else
 
1386
  dnl and for crosscompilings
 
1387
  AC_CHECK_FUNCS(gmtime_r)
1294
1388
fi
1295
1389
 
1296
1390
 
1340
1434
        libgen.h \
1341
1435
        locale.h \
1342
1436
        errno.h \
 
1437
        arpa/tftp.h \
 
1438
        sys/filio.h \
1343
1439
        setjmp.h,
1344
1440
dnl to do if not found
1345
1441
[],
1408
1504
dnl AC_PROG_GCC_TRADITIONAL
1409
1505
AC_TYPE_SIGNAL
1410
1506
dnl AC_FUNC_VPRINTF
 
1507
case $host in
 
1508
  *msdosdjgpp)
 
1509
     ac_cv_func_pipe=no
 
1510
     skipcheck_pipe=yes
 
1511
     AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
 
1512
    ;;
 
1513
esac
1411
1514
AC_CHECK_FUNCS( strtoll \
1412
1515
                socket \
1413
1516
                select \
1445
1548
dnl if found
1446
1549
[],
1447
1550
dnl if not found, $ac_func is the name we check for
1448
 
  func="$ac_func"
 
1551
func="$ac_func"
 
1552
eval skipcheck=\$skipcheck_$func
 
1553
if test "x$skipcheck" != "xyes"; then
1449
1554
  AC_MSG_CHECKING([deeper for $func])
1450
1555
  AC_TRY_LINK( [],
1451
1556
               [ $func ();],
1455
1560
               AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
1456
1561
               AC_MSG_RESULT(but still no)
1457
1562
               )
1458
 
 
 
1563
fi
1459
1564
)
1460
1565
 
1461
1566
dnl For some reason, the check above doesn't properly detect select() with
1493
1598
#ifdef HAVE_LIBGEN_H
1494
1599
#include <libgen.h>
1495
1600
#endif
 
1601
#ifdef HAVE_UNISTD_H
 
1602
#include <unistd.h>
 
1603
#endif
 
1604
)
 
1605
 
 
1606
AC_CHECK_DECL(inet_pton, ,
 
1607
              AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
 
1608
                        [Defined if no inet_pton() prototype available]),
 
1609
[
 
1610
#ifdef HAVE_ARPA_INET_H
 
1611
#include <arpa/inet.h>
 
1612
#endif
 
1613
]
1496
1614
)
1497
1615
 
1498
1616
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
1594
1712
  *)   AC_MSG_RESULT(yes)
1595
1713
 
1596
1714
       if test "x$IPV6_ENABLED" = "x1"; then
1597
 
         AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
 
1715
         AC_MSG_NOTICE([ares may not work properly with ipv6])
1598
1716
       fi
1599
1717
 
1600
1718
       AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
1603
1721
       AC_SUBST(HAVE_ARES)
1604
1722
       curl_ares_msg="enabled"
1605
1723
 
1606
 
       LIBS="$LIBS -lcares"
 
1724
       LIBS="-lcares $LIBS"
1607
1725
 
1608
1726
       dnl For backwards compatibility default to includes/lib in srcdir/ares
1609
1727
       dnl If a value is specified it is assumed that the libs are in $val/lib
1688
1806
       AC_MSG_RESULT(yes)
1689
1807
       AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1690
1808
       AC_SUBST(USE_WINDOWS_SSPI)
1691
 
       LIBS="$LIBS -lsecur32"
1692
1809
       curl_sspi_msg="yes"
1693
1810
       ;;
1694
1811
  *)