You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

gen_config_h.c 743 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main(int argc, char**argv) {
  5. FILE *fp;
  6. char line[100];
  7. char line2[80];
  8. char *s;
  9. int i;
  10. fprintf(stdout,"#ifndef OPENBLAS_CONFIG_H\n");
  11. fprintf(stdout,"#define OPENBLAS_CONFIG_H\n");
  12. fp=fopen(argv[1],"r");
  13. do{
  14. s=fgets(line,80,fp);
  15. if (s== NULL) break;
  16. memset(line2,0,80);
  17. i=sscanf(line,"#define %70c",line2);
  18. if (i!=0) {
  19. fprintf(stdout,"#define OPENBLAS_%s",line2);
  20. } else {
  21. fprintf(stdout,"\n");
  22. }
  23. } while (1);
  24. fclose(fp);
  25. fprintf(stdout,"#define OPENBLAS_VERSION \"OpenBLAS %s\"\n", VERSION);
  26. fp=fopen(argv[2],"r");
  27. do{
  28. s=fgets(line,100,fp);
  29. if (s== NULL) break;
  30. fprintf(stdout,"%s",line);
  31. } while(1);
  32. fclose(fp);
  33. fprintf(stdout,"#endif /* OPENBLAS_CONFIG_H */\n");
  34. exit(0);
  35. }