security/nss/tests/pkcs11/netscape/trivial/configure.in

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/tests/pkcs11/netscape/trivial/configure.in	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,150 @@
     1.4 +dnl
     1.5 +dnl This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 +
     1.9 +AC_INIT(trivial.c)
    1.10 +AC_CONFIG_HEADER(config.h)
    1.11 +AC_PROG_MAKE_SET
    1.12 +
    1.13 +AC_ARG_WITH(nspr, [  --with-nspr[=path]      specify location of NSPR],
    1.14 +[ case "$withval" in
    1.15 +  no)
    1.16 +    AC_MSG_ERROR(NSPR is required);;
    1.17 +  yes)
    1.18 +    NSPR_INCLUDE="$includedir"
    1.19 +    NSPR_LIBPATH="$libdir"
    1.20 +    ;;
    1.21 +  *)
    1.22 +    NSPR_INCLUDE="$withval/include"
    1.23 +    NSPR_LIBPATH="$withval/lib"
    1.24 +    ;;
    1.25 +  esac ],
    1.26 +[ NSPR_INCLUDE="$includedir"
    1.27 +  NSPR_LIBPATH="$libdir" ]
    1.28 +)
    1.29 +
    1.30 +NSPR_CFLAGS="-I$NSPR_INCLUDE"
    1.31 +NSPR_LDFLAGS="-L$NSPR_LIBPATH -lnspr4 -lplc4 -lplds4"
    1.32 +
    1.33 +dnl This isn't optimum, but the mozilla build system and autoconf don't really mesh well..
    1.34 +
    1.35 +AC_ARG_WITH(nss-dist,    [  --with-nss-dist[=path]  specify path to NSS dist directory],
    1.36 +[ case "$withval" in
    1.37 +  no)
    1.38 +    NSS_CFLAGS=""
    1.39 +    nss="0"
    1.40 +    ;;
    1.41 +  yes)
    1.42 +    AC_MSG_ERROR(You have to specify a path for --with-nss-dist)
    1.43 +    ;;
    1.44 +  *)
    1.45 +    NSS_CFLAGS="-I$withval/private/security -I$withval/public/security"
    1.46 +    nss="1"
    1.47 +    ;;
    1.48 +  esac ])
    1.49 +
    1.50 +AC_ARG_WITH(nss-hdrs, [  --with-nss-hdrs[=path]  or, specify path to installed NSS headers],
    1.51 +[ if test "x$nss" != "x"; then
    1.52 +    AC_MSG_ERROR(Only specify --with-nss-hdrs or --with-nss-dist, not both)
    1.53 +  fi
    1.54 +  case "$withval" in
    1.55 +  no)
    1.56 +    NSS_CFLAGS=""
    1.57 +    nss="0"
    1.58 +    ;;
    1.59 +  yes)
    1.60 +    NSS_CFLAGS="-I$includedir"
    1.61 +    nss="1"
    1.62 +    ;;
    1.63 +  *)
    1.64 +    NSS_CFLAGS="-I$withval"
    1.65 +    nss="1"
    1.66 +    ;;
    1.67 +  esac ])
    1.68 +
    1.69 +AC_ARG_WITH(rsa-hdrs, [  --with-rsa-hdrs[=path]  if not using NSS, specify path to RSA headers],
    1.70 +[ if test "x$nss" != "x"; then
    1.71 +    AC_MSG_ERROR(Only specify --with-nss-{hdrs,dist} or --with-rsa-hdrs, not both)
    1.72 +  fi
    1.73 +  case "$withval" in
    1.74 +  no)
    1.75 +    rsa="0"
    1.76 +    ;;
    1.77 +  yes)
    1.78 +    RSA_INCLUDE="$includedir"
    1.79 +    rsa="1"
    1.80 +    ;;
    1.81 +  *)
    1.82 +    RSA_INCLUDE="$withval"
    1.83 +    rsa="1"
    1.84 +    ;;
    1.85 +  esac ])
    1.86 +
    1.87 +if test "x$nss" = "x"; then
    1.88 +  if test "x$rsa" = "x"; then
    1.89 +    RSA_INCLUDE="$includedir"
    1.90 +  fi
    1.91 +  RSA_CFLAGS="-I$RSA_INCLUDE"
    1.92 +fi
    1.93 +
    1.94 +if test "x$nss" = "x1"; then
    1.95 +  AC_DEFINE(WITH_NSS,1)
    1.96 +fi
    1.97 +
    1.98 +AC_SUBST(WITH_NSS)
    1.99 +
   1.100 +if test "x$rsa" = "x1"; then
   1.101 +  RSA_CFLAGS-"-I$RSA_INCLUDE"
   1.102 +fi
   1.103 +
   1.104 +AC_ARG_ENABLE(debug, [  --disable-debug         default is enabled],
   1.105 +[ case "$enableval" in
   1.106 +  no)
   1.107 +    DEBUG_CFLAGS="";;
   1.108 +  yes)
   1.109 +    DEBUG_CFLAGS="-DDEBUG";;
   1.110 +  *)
   1.111 +    DEBUG_CFLAGS="-DDEBUG";;
   1.112 +  esac ], DEBUG_CFLAGS="-DDEBUG")
   1.113 +
   1.114 +dnl Checks for programs.
   1.115 +AC_PROG_CC
   1.116 +AC_PROG_CPP
   1.117 +AC_PROG_INSTALL
   1.118 +AC_PROG_RANLIB
   1.119 +AC_CHECK_PROG(AR, ar, ar)
   1.120 +AC_CHECK_PROG(LD, ld, ld)
   1.121 +AC_CHECK_PROG(RM, rm, rm)
   1.122 +AC_CHECK_PROG(TAR, tar, tar)
   1.123 +AC_SUBST(CC INSTALL RANLIB AR LD RM TAR)
   1.124 +
   1.125 +CPPFLAGS="$CFLAGS $NSPR_CFLAGS $NSS_CFLAGS $RSA_CFLAGS $DEBUG_CFLAGS"
   1.126 +LIBS="$NSPR_LDFLAGS $LIBS"
   1.127 +
   1.128 +AC_SUBST(CFLAGS)
   1.129 +
   1.130 +dnl Checks for libraries.
   1.131 +AC_CHECK_LIB(nspr4, PR_Init)
   1.132 +
   1.133 +dnl Checks for header files.
   1.134 +AC_CHECK_HEADERS(nspr.h)
   1.135 +AC_SUBST(HAVE_NSPR_H)
   1.136 +
   1.137 +if test "x$nss" = "x1"; then
   1.138 +  AC_CHECK_HEADERS(ck.h)
   1.139 +fi
   1.140 +
   1.141 +if test "x$rsa" = "x1"; then
   1.142 +  AC_CHECK_HEADERS(pkcs11t.h pkcs11.h)
   1.143 +fi
   1.144 +
   1.145 +AC_SUBST(HAVE_CK_H HAVE_PKCS11T_H HAVE_PKCS11_H)
   1.146 +
   1.147 +dnl Checks for typedefs, structures, and compiler characteristics.
   1.148 +AC_C_CONST
   1.149 +AC_SUBST(const)
   1.150 +
   1.151 +AC_CHECK_FUNCS(memset strlen)
   1.152 +AC_SUBST(HAVE_MEMSET HAVE_STRLEN)
   1.153 +AC_OUTPUT(Makefile, [echo timestamp > stamp-h])

mercurial