@@ -205,6 +205,32 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
205
205
fi
206
206
] )
207
207
208
+ # ###############################################################################
209
+ # This will make a path absolute. Assumes it's already a unix path. Also
210
+ # resolves ~ to homedir.
211
+ AC_DEFUN ( [ BASIC_ABSOLUTE_PATH] ,
212
+ [
213
+ if test "x[ $] $1 " != x; then
214
+ new_path="[ $] $1 "
215
+
216
+ if [ [ [ "$new_path" = ~* ] ] ] ; then
217
+ # Use eval to expand a potential ~
218
+ eval new_path="$new_path"
219
+ if test ! -f "$new_path" && test ! -d "$new_path"; then
220
+ AC_MSG_ERROR ( [ The new_path of $1 , which resolves as "$new_path", is not found.] )
221
+ fi
222
+ fi
223
+
224
+ if test -d "$new_path"; then
225
+ $1 ="`cd "$new_path"; $THEPWDCMD -L`"
226
+ else
227
+ dir="`$DIRNAME "$new_path"`"
228
+ base="`$BASENAME "$new_path"`"
229
+ $1 ="`cd "$dir"; $THEPWDCMD -L`/$base"
230
+ fi
231
+ fi
232
+ ] )
233
+
208
234
# ##############################################################################
209
235
# This will make sure the given variable points to a full and proper
210
236
# path. This means:
@@ -217,7 +243,6 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
217
243
AC_DEFUN ( [ BASIC_FIXUP_PATH] ,
218
244
[
219
245
# Only process if variable expands to non-empty
220
-
221
246
if test "x[ $] $1 " != x; then
222
247
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
223
248
BASIC_FIXUP_PATH_CYGWIN($1 )
@@ -234,19 +259,8 @@ AC_DEFUN([BASIC_FIXUP_PATH],
234
259
AC_MSG_ERROR ( [ Spaces are not allowed in this path.] )
235
260
fi
236
261
237
- # Use eval to expand a potential ~
238
- eval path="$path"
239
- if test ! -f "$path" && test ! -d "$path"; then
240
- AC_MSG_ERROR ( [ The path of $1 , which resolves as "$path", is not found.] )
241
- fi
242
-
243
- if test -d "$path"; then
244
- $1 ="`cd "$path"; $THEPWDCMD -L`"
245
- else
246
- dir="`$DIRNAME "$path"`"
247
- base="`$BASENAME "$path"`"
248
- $1 ="`cd "$dir"; $THEPWDCMD -L`/$base"
249
- fi
262
+ BASIC_ABSOLUTE_PATH(path)
263
+ $1 ="$path"
250
264
fi
251
265
fi
252
266
] )
0 commit comments