From: Ken Raeburn Date: Wed, 14 Sep 1994 00:54:00 +0000 (+0000) Subject: Do unlink/delete test properly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b9419dd224b83893a4a88f7fd34c0b7ed630b451;p=binutils-gdb.git Do unlink/delete test properly. Replace HO_VMS tests with VMS. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 70fae641b55..4a7f3988af6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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. diff --git a/gas/acconfig.h b/gas/acconfig.h index ea143b8459e..abae0b8091e 100644 --- a/gas/acconfig.h +++ b/gas/acconfig.h @@ -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 diff --git a/gas/as.h b/gas/as.h index f51a210cac7..5c2248880ec 100644 --- a/gas/as.h +++ b/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 diff --git a/gas/conf.in b/gas/conf.in index cdd97be0d2c..e0629b6c196 100644 --- a/gas/conf.in +++ b/gas/conf.in @@ -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 header file. */ #undef HAVE_ERRNO_H diff --git a/gas/config/obj-vms.c b/gas/config/obj-vms.c index fce7fc35bce..647067da5d0 100644 --- a/gas/config/obj-vms.c +++ b/gas/config/obj-vms.c @@ -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 /* Define File Access Block */ #include /* Define NAM Block */ #include /* 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 #include @@ -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]); /* diff --git a/gas/configure b/gas/configure index 1aef4321883..9cc5af38d27 100755 --- a/gas/configure +++ b/gas/configure @@ -1346,50 +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 - echo $ac_n "(cached) $ac_c" 1>&4 -else - cat > conftest.$ac_ext < /* 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_unlink) || defined (__stub___unlink) -choke me -#else -/* Override any gcc2 internal prototype to avoid an error. */ -char unlink(); unlink(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_unlink=yes" -else - rm -rf conftest* - eval "ac_cv_func_unlink=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'unlink`\" = yes"; then - echo "$ac_t""yes" 1>&4 - : -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 +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 < /* Arbitrary system header to define __stub macros. */ int main() { return 0; } @@ -1398,37 +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_delete) || defined (__stub___delete) +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else /* Override any gcc2 internal prototype to avoid an error. */ -char delete(); delete(); +char $ac_func(); $ac_func(); #endif ; return 0; } EOF if eval $ac_link; then rm -rf conftest* - eval "ac_cv_func_delete=yes" + eval "ac_cv_func_$ac_func=yes" else rm -rf conftest* - eval "ac_cv_func_delete=no" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'delete`\" = yes"; then +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&4 - cat >> confdefs.h <<\EOF -#define USE_DELETE_FOR_UNLINK 1 + ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` + cat >> confdefs.h <&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 < #include @@ -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 <&4 else cat > conftest.$ac_ext <&4 else cat > conftest.$ac_ext <