Changeset 955a2b in git for modules


Ignore:
Timestamp:
Jun 26, 2002, 2:03:16 PM (22 years ago)
Author:
Anne Frühbis-Krüger <anne@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
a3b38303c6c8160d0fbe955295aec7ba0ea21e02
Parents:
c8eee9110b7b2234fec0cf21ccd25f1f35b280f3
Message:
*anne: changes to module generarator


git-svn-id: file:///usr/local/Singular/svn/trunk@6170 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/modgen
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • modules/modgen/creat_top.cc

    rc8eee9 r955a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: creat_top.cc,v 1.14 2002-06-18 15:09:15 anne Exp $ */
     4/* $Id: creat_top.cc,v 1.15 2002-06-26 12:03:16 anne Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    5151  fprintf(fp, "  idhdl h;\n");
    5252  fprintf(fp, "\n");
    53   fprintf(fp, "  h=enterid(omStrDup(name),0, t, &(basePack->idroot), TRUE/*FALSE*/);\n");
     53  fprintf(fp, "  h=enterid(omStrDup(name),0, t, &(currPack->idroot), TRUE/*FALSE*/);\n");
    5454  fprintf(fp, "  if(h!=NULL) {\n");
    5555  fprintf(fp, "     switch(t) {\n");
     
    7070/*========================================================================*/
    7171/* SINGULAR procedures sollen nicht in modules geladen werden!!
    72    DAS HIER FLIEGT RAUS
    73 void write_add_singular_proc(FILE *fp)
    74 {
    75   fprintf(fp, "\nidhdl add_singular_proc(char *procname, int line,\n");
    76   fprintf(fp, "                       long pos, long end, BOOLEAN pstatic)\n");
    77   fprintf(fp, "{\n");
    78   fprintf(fp, "  idhdl h;\n");
    79   fprintf(fp, "  procinfov pi;\n\n");
    80   fprintf(fp, "  h = enter_id(procname, NULL, PROC_CMD);\n");
    81   fprintf(fp, "  if(h == NULL) return NULL;\n");
    82   fprintf(fp, "\n");
    83   fprintf(fp, "  IDDATA(h)=(char *) pi;\n");
    84   fprintf(fp, "\n");
    85 //  fprintf(fp, "  pi->libname = omStrDup(libname);\n");
    86   fprintf(fp, "  pi->procname = omStrDup(procname);\n");
    87   fprintf(fp, "  pi->language = LANG_SINGULAR;\n");
    88   fprintf(fp, "  pi->ref = 1;\n");
    89   fprintf(fp, "  pi->is_static = pstatic;\n");
    90   fprintf(fp, "  pi->data.s.proc_start = pos;\n");
    91   fprintf(fp, "  pi->data.s.def_end    = pos;\n");
    92   fprintf(fp, "  pi->data.s.help_start = 0L;\n");
    93   fprintf(fp, "  pi->data.s.help_end   = 0L;\n");
    94   fprintf(fp, "  pi->data.s.body_start = pos;\n");
    95   fprintf(fp, "  pi->data.s.body_end   = end;\n");
    96   fprintf(fp, "  pi->data.s.proc_end   = end;\n");
    97   fprintf(fp, "  pi->data.s.example_start = 0L;\n");
    98   fprintf(fp, "  pi->data.s.proc_lineno = line;\n");
    99   fprintf(fp, "  pi->data.s.body_lineno = line;\n");
    100   fprintf(fp, "  pi->data.s.example_lineno = 0;\n");
    101   fprintf(fp, "  pi->data.s.body = NULL;\n");
    102   fprintf(fp, "  pi->data.s.help_chksum = 0;\n");
    103   fprintf(fp, "  \n");
    104   fprintf(fp, "  return(h);\n");
    105   fprintf(fp, "}\n");
    106   modlineno+=30;
    107 }
    108   BIS HIERHIN FLIEGT ES RAUS
     72*  Dieser code wird daher momentan nicht benoetigt
     73* void write_add_singular_proc(FILE *fp)
     74* {
     75*   fprintf(fp, "\nidhdl add_singular_proc(char *procname, int line,\n");
     76*   fprintf(fp, "                       long pos, long end, BOOLEAN pstatic)\n");
     77*   fprintf(fp, "{\n");
     78*   fprintf(fp, "  idhdl h;\n");
     79*   fprintf(fp, "  procinfov pi;\n\n");
     80*   fprintf(fp, "  h = enter_id(procname, NULL, PROC_CMD);\n");
     81*   fprintf(fp, "  if(h == NULL) return NULL;\n");
     82*   fprintf(fp, "\n");
     83*   fprintf(fp, "  IDDATA(h)=(char *) pi;\n");
     84*   fprintf(fp, "\n");
     85* //  fprintf(fp, "  pi->libname = omStrDup(libname);\n");
     86*   fprintf(fp, "  pi->procname = omStrDup(procname);\n");
     87*   fprintf(fp, "  pi->language = LANG_SINGULAR;\n");
     88*   fprintf(fp, "  pi->ref = 1;\n");
     89*   fprintf(fp, "  pi->is_static = pstatic;\n");
     90*   fprintf(fp, "  pi->data.s.proc_start = pos;\n");
     91*   fprintf(fp, "  pi->data.s.def_end    = pos;\n");
     92*   fprintf(fp, "  pi->data.s.help_start = 0L;\n");
     93*   fprintf(fp, "  pi->data.s.help_end   = 0L;\n");
     94*   fprintf(fp, "  pi->data.s.body_start = pos;\n");
     95*   fprintf(fp, "  pi->data.s.body_end   = end;\n");
     96*   fprintf(fp, "  pi->data.s.proc_end   = end;\n");
     97*   fprintf(fp, "  pi->data.s.example_start = 0L;\n");
     98*   fprintf(fp, "  pi->data.s.proc_lineno = line;\n");
     99*   fprintf(fp, "  pi->data.s.body_lineno = line;\n");
     100*   fprintf(fp, "  pi->data.s.example_lineno = 0;\n");
     101*   fprintf(fp, "  pi->data.s.body = NULL;\n");
     102*   fprintf(fp, "  pi->data.s.help_chksum = 0;\n");
     103*   fprintf(fp, "  \n");
     104*   fprintf(fp, "  return(h);\n");
     105*   fprintf(fp, "}\n");
     106*   modlineno+=30;
     107* }
    109108*/
    110109
  • modules/modgen/main.cc

    rc8eee9 r955a2b  
    6969int trace = 0;
    7070int do_create_makefile = 1;
     71char* inst_dir = ".";
    7172
    7273static struct option long_options[] =
     
    7576  {"verbose", 0, 0, 'v'},
    7677  {"nocreate-makefile", 0, 0, 'm'},
     78  {"install-dir",1,0,'i'},
    7779  {"help", 0, 0, '?'},
    7880  {0, 0, 0, 0}
     
    8486  printf("usage: %s [args] filename\n", name);
    8587  for(i=0; long_options[i].name != NULL; i++)
    86     printf("\t-%c (--%s) %s\n", long_options[i].val,
    87            long_options[i].name, "");
    88  
     88  {
     89    if(long_options[i].has_arg!=0)
     90    {
     91      switch(long_options[i].val) {
     92         case 'i':
     93                   printf("\t-%c (--%s) %s\n", long_options[i].val,
     94                      long_options[i].name, "<destination-dir>");
     95                   break;
     96         default:
     97                   printf("\t-%c (--%s) %s\n", long_options[i].val,
     98                      long_options[i].name, "<argument>");
     99      }
     100    } else
     101    {
     102      printf("\t-%c (--%s) %s\n", long_options[i].val,
     103                 long_options[i].name, "");
     104    }
     105  }
    89106}
    90107
     
    95112  int option_index = 0;
    96113
    97   while( (c=getopt_long (argc, argv, "dmv",
     114  while( (c=getopt_long (argc, argv, "dmvi:",
    98115                         long_options, &option_index))>=0) {
    99116    switch (c)
     
    102119        case 'v' : trace=1; break;
    103120        case 'm' : do_create_makefile = 0; break;
     121        case 'i' : inst_dir=optarg; break;
    104122         
    105123        case '?' : usage(argv[0]);
  • modules/modgen/makefile.cc

    rc8eee9 r955a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: makefile.cc,v 1.8 2001-02-01 13:05:03 krueger Exp $ */
     4/* $Id: makefile.cc,v 1.9 2002-06-26 12:03:16 anne Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    2727#include "pathnames.h"
    2828
     29extern char* inst_dir;
     30
    2931extern void mod_create_makefile(moddefv module);
    3032extern void build_head_section(FILE *fp, moddefv module);
     
    8789  fprintf(fp, "CC\t= gcc\n");
    8890  fprintf(fp, "CXX\t= gcc\n");
    89   fprintf(fp, "CFLAGS\t= -DNDEBUG -DBUILD_MODULE -I. -I../../include\n");
    90   fprintf(fp, "DCFLAGS\t= -DBUILD_MODULE -I. -I../../include\n");
     91  fprintf(fp, "CFLAGS\t= -DNDEBUG -DBUILD_MODULE -I. -I%s/include\n",TOPSRCDIR);
     92  fprintf(fp, "DCFLAGS\t= -DBUILD_MODULE -I. -I%s/include\n",TOPSRCDIR);
    9193  fprintf(fp, "#LD\t=\n");
    9294  fprintf(fp, "\n");
    93   fprintf(fp, "libdir          = %s\n", LIBDIR);
     95  fprintf(fp, "instdir          = %s\n", inst_dir );
    9496  fprintf(fp, "INSTALL\t\t= %s/Singular/install-sh -c\n", TOPSRCDIR);
    9597  fprintf(fp, "INSTALL_PROGRAM\t= ${INSTALL}\n");
     
    117119{
    118120  fprintf(fp, "install:\n");
    119   fprintf(fp, "\t${MKINSTALLDIRS} ${bindir}\n");
    120   fprintf(fp, "\t${INSTALL_PROGRAM} %s.so ${libdir}/%s.so\n",
     121  fprintf(fp, "\t${MKINSTALLDIRS} ${instdir}\n");
     122  fprintf(fp, "\t${MKINSTALLDIRS} ${instdir}/modules\n");
     123  fprintf(fp, "\t${INSTALL_PROGRAM} %s.so ${instdir}/modules/%s.so\n",
    121124          module->name, module->name);
    122125}
  • modules/modgen/misc.cc

    rc8eee9 r955a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: misc.cc,v 1.14 2002-06-18 15:09:16 anne Exp $ */
     4/* $Id: misc.cc,v 1.15 2002-06-26 12:03:16 anne Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    482482    fprintf(fp, "\n");    modlineno+=1;
    483483    fprintf(fp, "#line %d \"%s.cc\"\n", modlineno++, module);
    484 /* DAS HIER FLIEGT RAUS
    485     write_add_singular_proc(fp);
     484/* Laden von SINGULAR proceduren innerhalb eines moduls derzeit nicht vorgesehen
     485*    write_add_singular_proc(fp);
     486*/
    486487    fprintf(fp, "\n");
    487    BIS HIER HIN
    488 */
    489488   
    490489/* HIER FEHLT ZUARBEIT VON HANS
Note: See TracChangeset for help on using the changeset viewer.