home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / sviluppo / mesa-aux / glue / parseversion.in < prev    next >
Text File  |  1999-07-05  |  2KB  |  74 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <string.h>
  4.  
  5. int main(int argc, char **argv)
  6. {
  7.   int major, minor, day, month, year;
  8.   char tmp[1024];
  9.   char *format;
  10.   
  11.   if (argc != 3)
  12.   {
  13.     fprintf(stderr, "Usage: parse_version <major> <minor>\n");
  14.     exit(2);
  15.   }
  16.   major = atoi(argv[1]);
  17.   minor = atoi(argv[2]);
  18.   year = 0;
  19.   month = 0;
  20.   day = 0;
  21.   format = "/*
  22.  * version.h file. Automatically generated by parse_version.
  23.  */
  24.  
  25. #ifndef __VERSION_H__
  26. #define __VERSION_H__
  27.  
  28. /* Commodities.h defines MesaGL@TARGET@_VERSION too, so wait for our defines
  29.    to come last, and undef the sucker now! */
  30. #undef MesaGL@TARGET@_VERSION
  31.  
  32. #define MesaGL@TARGET@_NAME        \"MesaGL@TARGET@.library\"
  33. #define MesaGL@TARGET@_IDSTRING    \"MesaGL@TARGET@ %d.%d [%s] (%d.%d.%d)\"
  34. #define MesaGL@TARGET@_VERSION    %d
  35. #define MesaGL@TARGET@_REVISION    %d
  36. #define MesaGL@TARGET@_PRIORITY    0
  37.  
  38. #endif
  39. ";
  40.  
  41.   tmp[0] = '\0';
  42.  
  43. #ifdef PROFILE
  44.   if (tmp[0])
  45.     strcat(tmp, ", ");
  46.   strcat(tmp, "profile");
  47. #endif
  48.  
  49.   if (tmp[0])
  50.     strcat(tmp, ", ");
  51.  
  52. #if defined(__mc68060__)
  53.   strcat(tmp, "68060");
  54. #elif defined(__mc68040__)
  55.   strcat(tmp, "68040");
  56. #elif defined(__mc68020__) || defined(__mc68030__)
  57.   strcat(tmp, "68020");
  58. #else
  59.   strcat(tmp, "68000");
  60. #endif
  61.  
  62. #if defined(__HAVE_68881__) || defined(__mc68881__) || defined(__mc68882__)
  63.   strcat(tmp, ", fpu");
  64. #else
  65.   strcat(tmp, ", soft-float");
  66. #endif
  67.  
  68.   strcat(tmp, ", amigaos");
  69.  
  70.   printf(format, major, minor, tmp, day, month, year,
  71.              major, minor, tmp, day, month, year, major, minor);
  72.   return 0;
  73. }
  74.