Do unlink/delete test properly.
Replace HO_VMS tests with VMS.
This commit is contained in:
parent
39836432f8
commit
b9419dd224
8 changed files with 55 additions and 95 deletions
|
@ -9,6 +9,10 @@ Tue Sep 13 16:45:08 1994 Steve Chamberlain (sac@jonny.cygnus.com)
|
|||
|
||||
Tue Sep 13 16:20:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* flonum-konst.c: Change preprocessor tests of HO_VMS to just VMS.
|
||||
* hex-value.c: Ditto.
|
||||
* config/obj-vms.c: Ditto.
|
||||
|
||||
* config/tc-sparc.c (sparc_ip): Replace as_bad/exit sequence with
|
||||
a call to as_fatal.
|
||||
* config/tc-i860.c (i860_ip): Ditto.
|
||||
|
@ -39,11 +43,9 @@ Tue Sep 13 16:20:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
|||
* Makefile.in (*_FOR_TARGET, INSTALL_XFORM, install, uninstall):
|
||||
Rewrite handling of program_transform_name.
|
||||
|
||||
* configure.in: Test for "unlink" and "delete", define
|
||||
USE_DELETE_FOR_UNLINK if only the latter is found. Not expected
|
||||
to be triggered on UNIX/POSIX systems.
|
||||
* acconfig.h (USE_DELETE_FOR_UNLINK): Undef here, provide
|
||||
comments.
|
||||
* configure.in: Test for functions unlink and delete.
|
||||
* as.h: If unlink isn't available but delete is, define unlink to
|
||||
be delete.
|
||||
|
||||
Update for autoconf 1.118:
|
||||
* gdbinit.in: New file, created from old .gdbinit.
|
||||
|
|
|
@ -41,8 +41,3 @@
|
|||
|
||||
/* Needed only for sparc configuration */
|
||||
#undef sparcv9
|
||||
|
||||
/* VMS does not provide an "unlink" function, but "delete" is provided.
|
||||
Autoconf will never set this (at least until we have an "autovms"),
|
||||
but this provides a halfway reasonable machine-independent hook. */
|
||||
#undef USE_DELETE_FOR_UNLINK
|
||||
|
|
3
gas/as.h
3
gas/as.h
|
@ -134,7 +134,8 @@ extern PTR realloc ();
|
|||
extern void free ();
|
||||
#endif
|
||||
|
||||
#ifdef USE_DELETE_FOR_UNLINK
|
||||
/* This is needed for VMS. */
|
||||
#if ! defined (HAVE_UNLINK) && defined (HAVE_DELETE)
|
||||
#define unlink delete
|
||||
#endif
|
||||
|
||||
|
|
|
@ -66,10 +66,11 @@
|
|||
/* Needed only for sparc configuration */
|
||||
#undef sparcv9
|
||||
|
||||
/* VMS does not provide an "unlink" function, but "delete" is provided.
|
||||
Autoconf will never set this (at least until we have an "autovms"),
|
||||
but this provides a halfway reasonable machine-independent hook. */
|
||||
#undef USE_DELETE_FOR_UNLINK
|
||||
/* Define if you have the delete function. */
|
||||
#undef HAVE_DELETE
|
||||
|
||||
/* Define if you have the unlink function. */
|
||||
#undef HAVE_UNLINK
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
|
|
@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
/* What we do if there is a goof. */
|
||||
#define error as_fatal
|
||||
|
||||
#ifdef HO_VMS /* These are of no use if we are cross assembling. */
|
||||
#ifdef VMS /* These are of no use if we are cross assembling. */
|
||||
#include <fab.h> /* Define File Access Block */
|
||||
#include <nam.h> /* Define NAM Block */
|
||||
#include <xab.h> /* Define XAB - all different types*/
|
||||
|
@ -241,7 +241,7 @@ static int Current_Object_Record_Type; /* Type of record in above */
|
|||
/*
|
||||
* Macros for moving data around. Must work on big-endian systems.
|
||||
*/
|
||||
#ifdef HO_VMS /* These are more efficient for VMS->VMS systems */
|
||||
#ifdef VMS /* These are more efficient for VMS->VMS systems */
|
||||
#define COPY_LONG(dest,val) {*(long *) dest = val; }
|
||||
#define COPY_SHORT(dest,val) {*(short *) dest = val; }
|
||||
#else
|
||||
|
@ -446,7 +446,7 @@ obj_crawl_symbol_chain (headers)
|
|||
static
|
||||
Create_VMS_Object_File ()
|
||||
{
|
||||
#if defined(eunice) || !defined(HO_VMS)
|
||||
#if defined(eunice) || !defined(VMS)
|
||||
VMS_Object_File_FD = creat (out_file_name, 0777, "var");
|
||||
#else /* eunice */
|
||||
VMS_Object_File_FD = creat (out_file_name, 0, "rfm=var",
|
||||
|
@ -488,22 +488,22 @@ Flush_VMS_Object_Record_Buffer ()
|
|||
/*
|
||||
* Write the data to the file
|
||||
*/
|
||||
#ifndef HO_VMS /* For cross-assembly purposes. */
|
||||
#ifndef VMS /* For cross-assembly purposes. */
|
||||
md_number_to_chars((char *) &RecLen, Object_Record_Offset, 2);
|
||||
i = write (VMS_Object_File_FD, &RecLen, 2);
|
||||
#endif /* not HO_VMS */
|
||||
#endif /* not VMS */
|
||||
i = write (VMS_Object_File_FD,
|
||||
Object_Record_Buffer,
|
||||
Object_Record_Offset);
|
||||
if (i != Object_Record_Offset)
|
||||
error ("I/O error writing VMS object file");
|
||||
#ifndef HO_VMS /* When cross-assembling, we need to pad the record to an even
|
||||
#ifndef VMS /* When cross-assembling, we need to pad the record to an even
|
||||
number of bytes. */
|
||||
/* pad it if needed */
|
||||
zero = 0;
|
||||
if (Object_Record_Offset & 1 != 0)
|
||||
write (VMS_Object_File_FD, &zero, 1);
|
||||
#endif /* not HO_VMS */
|
||||
#endif /* not VMS */
|
||||
/*
|
||||
* The buffer is now empty
|
||||
*/
|
||||
|
@ -545,10 +545,10 @@ Close_VMS_Object_File ()
|
|||
/* @@ This should not be here!! The same would presumably be needed
|
||||
if we were writing vax-bsd a.out files on a vms system. Put it
|
||||
someplace else! */
|
||||
#ifndef HO_VMS /* For cross-assembly purposes. */
|
||||
#ifndef VMS /* For cross-assembly purposes. */
|
||||
/* Write a 0xffff into the file, which means "End of File" */
|
||||
write (VMS_Object_File_FD, &m_one, 2);
|
||||
#endif /* not HO_VMS */
|
||||
#endif /* not VMS */
|
||||
close (VMS_Object_File_FD);
|
||||
}
|
||||
|
||||
|
@ -1205,9 +1205,9 @@ VMS_TBT_Source_File (Filename, ID_Number)
|
|||
register char *cp, *cp1;
|
||||
int Status, i;
|
||||
char Local[512];
|
||||
#ifndef HO_VMS /* Used for cross-assembly */
|
||||
#ifndef VMS /* Used for cross-assembly */
|
||||
i = strlen (Filename);
|
||||
#else /* HO_VMS */
|
||||
#else /* VMS */
|
||||
static struct FAB Fab;
|
||||
static struct NAM Nam;
|
||||
static struct XABDAT Date_Xab;
|
||||
|
@ -1256,7 +1256,7 @@ VMS_TBT_Source_File (Filename, ID_Number)
|
|||
* Calculate the size of the resultant string
|
||||
*/
|
||||
i = Nam.nam$b_rsl;
|
||||
#endif /* HO_VMS */
|
||||
#endif /* VMS */
|
||||
/*
|
||||
* Size of record
|
||||
*/
|
||||
|
@ -1284,7 +1284,7 @@ VMS_TBT_Source_File (Filename, ID_Number)
|
|||
*/
|
||||
COPY_SHORT (cp, ID_Number);
|
||||
cp += sizeof (short);
|
||||
#ifndef HO_VMS
|
||||
#ifndef VMS
|
||||
/*
|
||||
* Creation Date. Unknown, so we fill with zeroes.
|
||||
*/
|
||||
|
@ -1338,7 +1338,7 @@ VMS_TBT_Source_File (Filename, ID_Number)
|
|||
*/
|
||||
*cp++ = i;
|
||||
cp1 = Rs_String;
|
||||
#endif /* HO_VMS */
|
||||
#endif /* VMS */
|
||||
while (--i >= 0)
|
||||
*cp++ = *cp1++;
|
||||
/*
|
||||
|
@ -2957,7 +2957,7 @@ VMS_DBG_Define_Routine (symbolP, Curr_Routine, Txt_Psect)
|
|||
|
||||
|
||||
|
||||
#ifndef HO_VMS
|
||||
#ifndef VMS
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
|
@ -2977,7 +2977,7 @@ get_VMS_time_on_unix (Now)
|
|||
sprintf (Now, "%2s-%3s-%s %s", pnt + 8, pnt + 4, pnt + 20, pnt + 11);
|
||||
}
|
||||
|
||||
#endif /* not HO_VMS */
|
||||
#endif /* not VMS */
|
||||
/*
|
||||
* Write the MHD (Module Header) records
|
||||
*/
|
||||
|
@ -3052,13 +3052,13 @@ Write_VMS_MHD_Records ()
|
|||
/*
|
||||
* Creation time is "now" (17 chars of time string)
|
||||
*/
|
||||
#ifndef HO_VMS
|
||||
#ifndef VMS
|
||||
get_VMS_time_on_unix (&Now[0]);
|
||||
#else /* HO_VMS */
|
||||
#else /* VMS */
|
||||
Descriptor.Size = 17;
|
||||
Descriptor.Ptr = Now;
|
||||
sys$asctim (0, &Descriptor, 0, 0);
|
||||
#endif /* HO_VMS */
|
||||
#endif /* VMS */
|
||||
for (i = 0; i < 17; i++)
|
||||
PUT_CHAR (Now[i]);
|
||||
/*
|
||||
|
|
77
gas/configure
vendored
77
gas/configure
vendored
|
@ -1346,12 +1346,14 @@ fi
|
|||
|
||||
|
||||
# VMS needs this.
|
||||
echo $ac_n "checking for unlink""... $ac_c" 1>&4
|
||||
if eval "test \"`echo '${'ac_cv_func_unlink'+set}'`\" = set"; then
|
||||
for ac_func in unlink delete
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
|
||||
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1355 "configure"
|
||||
#line 1357 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
|
||||
int main() { return 0; }
|
||||
|
@ -1360,75 +1362,36 @@ int t() {
|
|||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_unlink) || defined (__stub___unlink)
|
||||
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
|
||||
choke me
|
||||
#else
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
char unlink(); unlink();
|
||||
char $ac_func(); $ac_func();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_unlink=yes"
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_unlink=no"
|
||||
eval "ac_cv_func_$ac_func=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_func_'unlink`\" = yes"; then
|
||||
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&4
|
||||
:
|
||||
ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_func 1
|
||||
EOF
|
||||
break
|
||||
else
|
||||
echo "$ac_t""no" 1>&4
|
||||
echo $ac_n "checking for delete""... $ac_c" 1>&4
|
||||
if eval "test \"`echo '${'ac_cv_func_delete'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1393 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_delete) || defined (__stub___delete)
|
||||
choke me
|
||||
#else
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
char delete(); delete();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_delete=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_delete=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_func_'delete`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&4
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define USE_DELETE_FOR_UNLINK 1
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "$ac_t""no" 1>&4
|
||||
{ echo "configure: No unlink or delete function available on this system." 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Some non-ANSI preprocessors botch requoting inside strings. That's bad
|
||||
|
@ -1439,7 +1402,7 @@ if eval "test \"`echo '${'gas_cv_assert_ok'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1443 "configure"
|
||||
#line 1406 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1496,7 +1459,7 @@ if eval "test \"`echo '${'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1500 "configure"
|
||||
#line 1463 "configure"
|
||||
#include "confdefs.h"
|
||||
$gas_test_headers
|
||||
int main() { return 0; }
|
||||
|
@ -1532,7 +1495,7 @@ if eval "test \"`echo '${'gas_cv_decl_needed_free'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1536 "configure"
|
||||
#line 1499 "configure"
|
||||
#include "confdefs.h"
|
||||
$gas_test_headers
|
||||
int main() { return 0; }
|
||||
|
@ -1571,7 +1534,7 @@ if eval "test \"`echo '${'gas_cv_decl_needed_errno'+set}'`\" = set"; then
|
|||
echo $ac_n "(cached) $ac_c" 1>&4
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1575 "configure"
|
||||
#line 1538 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
|
|
|
@ -309,9 +309,7 @@ AC_FUNC_ALLOCA
|
|||
AC_C_INLINE
|
||||
|
||||
# VMS needs this.
|
||||
AC_CHECK_FUNC(unlink,,
|
||||
AC_CHECK_FUNC(delete,AC_DEFINE(USE_DELETE_FOR_UNLINK),
|
||||
AC_MSG_ERROR(No unlink or delete function available on this system.)))
|
||||
AC_CHECK_FUNCS(unlink delete, break)
|
||||
|
||||
# Some non-ANSI preprocessors botch requoting inside strings. That's bad
|
||||
# enough, but on some of those systems, the assert macro relies on requoting
|
||||
|
|
|
@ -52,7 +52,7 @@ const char
|
|||
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __
|
||||
};
|
||||
|
||||
#ifdef HO_VMS
|
||||
#ifdef VMS
|
||||
dummy2 ()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue