diff options
Diffstat (limited to 'pki/base/symkey/m4')
-rw-r--r-- | pki/base/symkey/m4/jss.m4 | 228 | ||||
-rw-r--r-- | pki/base/symkey/m4/nspr.m4 | 92 | ||||
-rw-r--r-- | pki/base/symkey/m4/nss.m4 | 92 | ||||
-rw-r--r-- | pki/base/symkey/m4/symkey.m4 | 149 |
4 files changed, 561 insertions, 0 deletions
diff --git a/pki/base/symkey/m4/jss.m4 b/pki/base/symkey/m4/jss.m4 new file mode 100644 index 000000000..d496dcd04 --- /dev/null +++ b/pki/base/symkey/m4/jss.m4 @@ -0,0 +1,228 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for JSS) + +# check for --with-jss +AC_MSG_CHECKING(for --with-jss) +AC_ARG_WITH(jss, [ --with-jss=PATH JSS directory], +[ + if test -f "$withval"/jars/jss4.jar -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + JSSDIR=$withval + jss_jars="$JSSDIR/jars/jss4.jar" + jss_lib="-L$JSSDIR/lib" + jss_libdir="$JSSDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-jss-jars +AC_MSG_CHECKING(for --with-jss-jars) +AC_ARG_WITH(jss-jars, [ --with-jss-jars=PATH JSS jars directory], +[ + if test -f "$withval"/jss4.jar + then + AC_MSG_RESULT([using $withval]) + jss_jars="$withval/jss4.jar" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-jss-lib +AC_MSG_CHECKING(for --with-jss-lib) +AC_ARG_WITH(jss-lib, [ --with-jss-lib=PATH JSS library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + jss_lib="-L$withval" + jss_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for JSS jar file and library in well-known locations +AC_MSG_CHECKING(for jss jar file and library in well-known locations) +if test -z "$jss_jars" -o -z "$jss_lib" -o -z "$jss_libdir" +then + case $host in + *-*-linux*) + if test -n "$USE_64" + then + if test -f /usr/lib/java/jss4.jar + then + jss_jars="/usr/lib/java/jss4.jar" + if test -f /usr/lib64/jss/libjss4.so + then + AC_MSG_RESULT([using system JSS]) + jss_lib="-L/usr/lib64/jss" + jss_libdir="/usr/lib64/jss" + elif test -f /usr/lib64/libjss4.so + then + AC_MSG_RESULT([using system JSS, original location]) + jss_lib="-L/usr/lib64" + jss_libdir="/usr/lib64" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + elif test -f /usr/lib/java/dirsec/jss4.jar + then + jss_jars="/usr/lib/java/dirsec/jss4.jar" + if test -f /usr/lib64/dirsec/libjss4.so + then + AC_MSG_RESULT([using system dirsec JSS]) + jss_lib="-L/usr/lib64/dirsec" + jss_libdir="/usr/lib64/dirsec" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + if test -f /usr/lib/java/jss4.jar + then + jss_jars="/usr/lib/java/jss4.jar" + if test -f /usr/lib/jss/libjss4.so + then + AC_MSG_RESULT([using system JSS]) + jss_lib="-L/usr/lib/jss" + jss_libdir="/usr/lib/jss" + elif test -f /usr/lib/libjss4.so + then + AC_MSG_RESULT([using system JSS, original location]) + jss_lib="-L/usr/lib" + jss_libdir="/usr/lib" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + elif test -f /usr/lib/java/dirsec/jss4.jar + then + jss_jars="/usr/lib/java/dirsec/jss4.jar" + if test -f /usr/lib/dirsec/libjss4.so + then + AC_MSG_RESULT([using system dirsec JSS]) + jss_lib="-L/usr/lib/dirsec" + jss_libdir="/usr/lib/dirsec" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + fi + ;; + sparc-sun-solaris*) + if test -n "$USE_64" + then + if test -f /usr/lib/sparcv9/java/jss4.jar + then + jss_jars="/usr/lib/sparcv9/java/jss4.jar" + if test -f /usr/lib/sparcv9/libjss4.so + then + AC_MSG_RESULT([using system JSS]) + jss_lib="-L/usr/lib/sparcv9" + jss_libdir="/usr/lib/sparcv9" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + elif test -f /usr/lib/sparcv9/java/dirsec/jss4.jar + then + jss_jars="/usr/lib/sparcv9/java/dirsec/jss4.jar" + if test -f /usr/lib/sparcv9/dirsec/libjss4.so + then + AC_MSG_RESULT([using system dirsec JSS]) + jss_lib="-L/usr/lib/sparcv9/dirsec" + jss_libdir="/usr/lib/sparcv9/dirsec" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + if test -f /usr/lib/java/jss4.jar + then + jss_jars="/usr/lib/java/jss4.jar" + if test -f /usr/lib/libjss4.so + then + AC_MSG_RESULT([using system JSS]) + jss_lib="-L/usr/lib" + jss_libdir="/usr/lib" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + elif test -f /usr/lib/java/dirsec/jss4.jar + then + jss_jars="/usr/lib/java/dirsec/jss4.jar" + if test -f /usr/lib/dirsec/libjss4.so + then + AC_MSG_RESULT([using system dirsec JSS]) + jss_lib="-L/usr/lib/dirsec" + jss_libdir="/usr/lib/dirsec" + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + else + echo + AC_MSG_ERROR([JSS not found, specify with --with-jss.]) + fi + fi + ;; + *) + AC_MSG_ERROR([unconfigured platform $host]) + ;; + esac +else + AC_MSG_RESULT(no) +fi + +# if JSS has not been found, print an error and exit +if test -z "$jss_jars" +then + echo + AC_MSG_ERROR([JSS jars directory not found, specify with --with-jss.]) +fi +if test -z "$jss_lib" -o -z "$jss_libdir" +then + echo + AC_MSG_ERROR([JSS library directory not found, specify with --with-jss.]) +fi diff --git a/pki/base/symkey/m4/nspr.m4 b/pki/base/symkey/m4/nspr.m4 new file mode 100644 index 000000000..f9bc46409 --- /dev/null +++ b/pki/base/symkey/m4/nspr.m4 @@ -0,0 +1,92 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for NSPR) + +# check for --with-nspr +AC_MSG_CHECKING(for --with-nspr) +AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory], +[ + if test -e "$withval"/include/nspr.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSPRDIR=$withval + nspr_inc="-I$NSPRDIR/include" + nspr_lib="-L$NSPRDIR/lib" + nspr_libdir="$NSPRDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-inc +AC_MSG_CHECKING(for --with-nspr-inc) +AC_ARG_WITH(nspr-inc, [ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory], +[ + if test -e "$withval"/nspr.h + then + AC_MSG_RESULT([using $withval]) + nspr_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-lib +AC_MSG_CHECKING(for --with-nspr-lib) +AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nspr_lib="-L$withval" + nspr_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSPR is not found yet, try pkg-config + +# last resort +if test -z "$nspr_inc" -o -z "$nspr_lib" -o -z "$nspr_libdir"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for nspr with pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L nspr | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system NSPR]) + elif $PKG_CONFIG --exists dirsec-nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I dirsec-nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L dirsec-nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L dirsec-nspr | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system dirsec NSPR]) + else + AC_MSG_ERROR([NSPR not found, specify with --with-nspr.]) + fi + fi +fi diff --git a/pki/base/symkey/m4/nss.m4 b/pki/base/symkey/m4/nss.m4 new file mode 100644 index 000000000..40664b465 --- /dev/null +++ b/pki/base/symkey/m4/nss.m4 @@ -0,0 +1,92 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for NSS) + +# check for --with-nss +AC_MSG_CHECKING(for --with-nss) +AC_ARG_WITH(nss, [ --with-nss=PATH Network Security Services (NSS) directory], +[ + if test -e "$withval"/include/nss.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSSDIR=$withval + nss_inc="-I$NSSDIR/include" + nss_lib="-L$NSSDIR/lib" + nss_libdir="$NSSDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-inc +AC_MSG_CHECKING(for --with-nss-inc) +AC_ARG_WITH(nss-inc, [ --with-nss-inc=PATH Network Security Services (NSS) include directory], +[ + if test -e "$withval"/nss.h + then + AC_MSG_RESULT([using $withval]) + nss_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-lib +AC_MSG_CHECKING(for --with-nss-lib) +AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Network Security Services (NSS) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nss_lib="-L$withval" + nss_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSS is not found yet, try pkg-config + +# last resort +if test -z "$nss_inc" -o -z "$nss_lib" -o -z "$nss_libdir"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for nss with pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I nss` + nss_lib=`$PKG_CONFIG --libs-only-L nss` + nss_libdir=`$PKG_CONFIG --libs-only-L nss | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system NSS]) + elif $PKG_CONFIG --exists dirsec-nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I dirsec-nss` + nss_lib=`$PKG_CONFIG --libs-only-L dirsec-nss` + nss_libdir=`$PKG_CONFIG --libs-only-L dirsec-nss | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system dirsec NSS]) + else + AC_MSG_ERROR([NSS not found, specify with --with-nss.]) + fi + fi +fi diff --git a/pki/base/symkey/m4/symkey.m4 b/pki/base/symkey/m4/symkey.m4 new file mode 100644 index 000000000..c1026d211 --- /dev/null +++ b/pki/base/symkey/m4/symkey.m4 @@ -0,0 +1,149 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for pre-built Ant SYMKEY JNI Headers and Jars) + +# check for --with-symkey +AC_MSG_CHECKING(for --with-symkey) +AC_ARG_WITH(symkey, [ --with-symkey=PATH SYMKEY directory], +[ + if test -f "$withval"/include/com_netscape_symkey_SessionKey.h -a -f "$withval"/jars/symkey.jar + then + AC_MSG_RESULT([using $withval]) + SYMKEYDIR=$withval + symkey_inc="-I$SYMKEYDIR/include" + symkey_jars="$SYMKEYDIR/jars/symkey.jar" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-symkey-inc +AC_MSG_CHECKING(for --with-symkey-inc) +AC_ARG_WITH(symkey-inc, [ --with-symkey-inc=PATH SYMKEY (Generated JNI Headers) include file directory], +[ + if test -f "$withval"/com_netscape_symkey_SessionKey.h + then + AC_MSG_RESULT([using $withval]) + symkey_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-symkey-jars +AC_MSG_CHECKING(for --with-symkey-jars) +AC_ARG_WITH(symkey-jars, [ --with-symkey-jars=PATH SYMKEY (Jars) jars directory], +[ + if test -f "$withval"/symkey.jar + then + AC_MSG_RESULT([using $withval]) + symkey_jars="$withval/symkey.jar" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-jni-inc (insure use of appropriate jni.h) +AC_MSG_CHECKING(for --with-jni-inc) +AC_ARG_WITH(jni-inc, [ --with-jni-inc=PATH SYMKEY jni.h header path], +[ + if test -f "$withval"/jni.h + then + AC_MSG_RESULT([using $withval]) + jni_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +[case $host in + *-*-linux*) + javac_exe=`/usr/sbin/alternatives --display javac | grep link | cut -c27-` + jni_path=`dirname $javac_exe`/../include + jni_inc="-I$jni_path -I$jni_path/linux" + if test -f "$jni_path"/jni.h + then + AC_MSG_RESULT([using $jni_inc]) + else + echo + AC_MSG_ERROR([$jni_inc not found]) + fi + ;; + sparc-sun-solaris*) + jni_path="/usr/java/include" + jni_inc="-I$jni_path -I$jni_path/solaris" + if test -f "$jni_path"/jni.h + then + AC_MSG_RESULT([using $jni_inc]) + else + echo + AC_MSG_ERROR([$jni_inc not found]) + fi + ;; + *) + AC_MSG_ERROR([unconfigured platform $host]) + ;; +esac]) + +# check for SYMKEY generated headers and jar file in well-known locations +AC_MSG_CHECKING(for symkey JNI headers and jars in well-known locations) +if test -z "$symkey_inc" -o -z "$symkey_jars" +then + if test -f $srcdir/build/include/com_netscape_symkey_SessionKey.h + then + symkey_inc="-I$srcdir/build/include" + else + echo + AC_MSG_ERROR([use Ant to create $srcdir/build/include/com_netscape_symkey_SessionKey.h first]) + fi + if test -f $srcdir/build/jars/symkey.jar + then + symkey_jars="$srcdir/build/jars/symkey.jar" + else + echo + AC_MSG_ERROR([use Ant to create $srcdir/build/jars/symkey.jar first]) + fi + if test -d $srcdir/build/include -a -f $symkey_jars + then + AC_MSG_RESULT([using pre-built Ant symkey JNI generated headers and Jar file]) + else + AC_MSG_RESULT(no) + fi +else + AC_MSG_RESULT(no) +fi + +# if symkey Java portions have not been found, print an error and exit +if test -z "$symkey_inc" +then + echo + AC_MSG_ERROR([SYMKEY generated JNI headers include file directory not found, specify with --with-symkey.]) +fi +if test -z "$symkey_jars" +then + echo + AC_MSG_ERROR([SYMKEY jars directory not found, specify with --with-symkey.]) +fi |