summaryrefslogtreecommitdiffstats
path: root/pki/base/symkey/m4/jss.m4
blob: 9d30a29fabb2fbdc5476d64ed353d73580f0946c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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/libjss4.so
          then
            AC_MSG_RESULT([using system JSS])
            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/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
      ;;
    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