Ticket #65628: patch-cgx-build.diff
File patch-cgx-build.diff, 10.2 KB (added by mbrethen, 2 years ago) |
---|
-
src/Makefile
diff -ur cgx_2.18.orig/src/Makefile cgx_2.18/src/Makefile
old new 1 CFLAGS = -O2 -Wall -Wno-narrowing \1 CFLAGS += -O2 -Wall -Wno-narrowing \ 2 2 -I./ \ 3 -I /usr/include \4 -I /usr/include/GL \3 -I@PREFIX@/include \ 4 -I@PREFIX@/include/GL \ 5 5 -I../../libSNL/src \ 6 -I../../glut-3.5/src \ 7 -I/usr/X11/include 6 -I../../glut-3.5/src 8 7 9 LFLAGS = \ 10 -L/usr/lib64 -lGL -lGLU \ 11 -L/usr/X11R6/lib64 -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \ 12 -lm -lpthread -lrt 8 LFLAGS += \ 9 -lGL -lGLU -lglut \ 10 -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \ 11 -lm -lpthread 12 13 CXXFLAGS += 13 14 14 15 15 16 # on 32bit systems change lib64 to lib … … 22 23 userFunction.c 23 24 24 25 SUTIL = \ 25 ../../glut-3.5/src/layerutil.c \26 ../../glut-3.5/src/glut_dials.c \27 ../../glut-3.5/src/glut_ext.c \28 ../../glut-3.5/src/glut_mesa.c \29 ../../glut-3.5/src/glut_menu.c \30 ../../glut-3.5/src/glut_modifier.c \31 ../../glut-3.5/src/glut_space.c \32 ../../glut-3.5/src/glut_shapes.c \33 ../../glut-3.5/src/glut_tablet.c \34 ../../glut-3.5/src/glut_warp.c \35 ../../glut-3.5/src/glut_8x13.c \36 ../../glut-3.5/src/glut_9x15.c \37 ../../glut-3.5/src/glut_hel10.c \38 ../../glut-3.5/src/glut_hel18.c \39 ../../glut-3.5/src/glut_hel12.c \40 ../../glut-3.5/src/glut_tr10.c \41 ../../glut-3.5/src/glut_tr24.c \42 ../../glut-3.5/src/glut_bitmap.c \43 ../../glut-3.5/src/glut_cursor.c \44 ../../glut-3.5/src/glut_event.c \45 ../../glut-3.5/src/glut_get.c \46 ../../glut-3.5/src/glut_overlay.c \47 ../../glut-3.5/src/glut_input.c \48 ../../glut-3.5/src/glut_stroke.c \49 ../../glut-3.5/src/glut_teapot.c \50 ../../glut-3.5/src/glut_winmisc.c \51 ../../glut-3.5/src/glut_fullscrn.c \52 ../../glut-3.5/src/glut_cindex.c \53 ../../glut-3.5/src/glut_roman.c \54 ../../glut-3.5/src/glut_mroman.c \55 ../../glut-3.5/src/glut_swidth.c \56 ../../glut-3.5/src/glut_bwidth.c \57 ../../glut-3.5/src/glut_win.c \58 ../../glut-3.5/src/glut_init.c \59 ../../glut-3.5/src/glut_util.c \60 26 uselibSNL.cpp \ 61 27 generateTet.cpp \ 62 28 ../../libSNL/src/*.cpp … … 66 32 OUTIL = $(SUTIL:.c=.o) 67 33 68 34 cgx: $(OLIB) $(OUTIL) $(OULIB) 69 g++ $(OULIB) $(OLIB) $(OUTIL) $(CFLAGS) $(LFLAGS) -o $@35 $(CXX) $(OULIB) $(OLIB) $(OUTIL) $(CFLAGS) $(LFLAGS) $(CXXFLAGS) -o $@ 70 36 71 37 72 38 -
src/cgx.h
diff -ur cgx_2.18.orig/src/cgx.h cgx_2.18/src/cgx.h
old new 25 25 #include "extUtil.h" 26 26 #include "trackball.h" 27 27 28 /* change from sem_init to sem_open */ 29 #define sem_n *nptr 30 #define sem_g *gptr 31 #define sem_rep *rptr 32 #define sem_stn *sptr 33 #define sem_map3d *mptr 34 #define sem_cute *cptr 28 35 29 36 /* factors for the geometric tolerance for merging */ 30 37 /* the space used by all lines will be multiplied with this value to calculate the default */ … … 88 88 /* default tet mesher, 0:Netgen ng_vol, 1:tetgen */ 89 89 #define TETMESHER 1 90 90 #else 91 #define HELPFILE {" /usr/local/CalculiX/cgx_2.18/doc/cgx/cgx.html",\92 " /usr/local/CalculiX/ccx_2.18/doc/ccx/ccx.html"}91 #define HELPFILE {"@PREFIX@/share/doc/CalculiX/cgx/cgx.html",\ 92 "@PREFIX@/share/doc/CalculiX/ccx/ccx.html"} 93 93 /* default tet mesher, 0:Netgen ng_vol, 1:tetgen */ 94 94 #define TETMESHER 1 95 95 #endif … … 105 105 #else 106 106 /* #define BROWSER {"netscape"} */ 107 107 /* #define BROWSER {"mozilla"} */ 108 #define BROWSER {" firefox"}108 #define BROWSER {"openbrowser"} 109 109 /* #define PSVIEWER {"ghostview"} */ 110 #define PSVIEWER {" gv"}110 #define PSVIEWER {"open"} 111 111 #define ALLOW_SYS_FLAG 0 112 112 #endif 113 113 -
src/cgx.c
diff -ur cgx_2.18.orig/src/cgx.c cgx_2.18/src/cgx.c
old new 854 854 while( access( "0__.tga", F_OK ) != 0 ); 855 855 while( access( "1__.tga", F_OK ) != 0 ); 856 856 while( access( "2__.tga", F_OK ) != 0 ); 857 //sprintf( buffer, "composite -compose atop -gravity SouthWest -geometry +1+1 2__.tga 1__.tga 3__.tga"); 857 sprintf(buffer, "mogrify -auto-orient 0__.tga"); 858 system(buffer); 859 sprintf(buffer, "mogrify -auto-orient 1__.tga"); 860 system(buffer); 861 sprintf(buffer, "mogrify -auto-orient 2__.tga"); 862 system(buffer); 863 858 864 sprintf( buffer, "composite -gravity SouthWest -geometry +1+1 2__.tga 1__.tga 3__.tga"); 859 865 system (buffer); 860 866 while( access( "3__.tga", F_OK ) != 0 ); 867 sprintf(buffer, "mogrify -auto-orient 3__.tga"); 868 system(buffer); 861 869 //sprintf( buffer, "composite -compose atop -gravity NorthWest -geometry +%d+%d 3__.tga 0__.tga hcpy_%d.tga", 862 870 sprintf( buffer, "composite -alpha off -gravity NorthWest -geometry +%d+%d 3__.tga 0__.tga hcpy_%d.tga", 863 871 (GLint)width_menu*19/20, (GLint)height_menu/10, nr); 864 872 system (buffer); 873 sprintf(buffer, "mogrify -auto-orient hcpy_%d.tga", nr); 874 system(buffer); 865 875 //printf("%s",buffer); 866 876 sprintf( buffer, "rm -f *__.tga %s",DEV_NULL); 867 877 system (buffer); … … 906 916 getTGAScreenShot(psNr); 907 917 /* on some systems PS has to be changed to PS2 */ 908 918 //sprintf( buffer, "convert -density %dx%d -page +49+196 -gamma %lf hcpy_%d.tga PS:hcpy_%d.ps ", (int)((double)(PS_DENSITY*width_w0)/(double)(INI_SCREEN+INI_MENU_WIDTH)),(int)((double)(PS_DENSITY*width_w0)/(double)(INI_SCREEN+INI_MENU_WIDTH)) , GAMMA, psNr, psNr); 909 sprintf( buffer, "convert hcpy_%d.tga - page A4 %s", psNr, fileName);919 sprintf( buffer, "convert hcpy_%d.tga -auto-orient -page A4 %s", psNr, fileName); 910 920 system (buffer); 911 921 printf("%s\n", buffer); 912 922 sprintf( buffer, "rm -f hcpy_%d.tga %s",psNr,DEV_NULL); … … 939 949 getTGAScreenShot(0); 940 950 while( access( "hcpy_0.tga", F_OK ) != 0 ); 941 951 gifNr++; 942 sprintf( buffer, "convert hcpy_0.tga _%d.gif",gifNr);952 sprintf( buffer, "convert hcpy_0.tga -auto-orient _%d.gif",gifNr); 943 953 printf("%s\n",buffer); 944 954 system (buffer); 945 955 if((movieFrames)&&(gifNr>=movieFrames)) … … 963 973 if(filePtr!=NULL) sprintf(fileName,"%s.gif",filePtr); else sprintf(fileName,"hcpy_%d.gif",gifNr); 964 974 printf("create %s\n ",fileName); 965 975 getTGAScreenShot(gifNr); 966 sprintf( buffer, "convert hcpy_%d.tga %s", gifNr, fileName);976 sprintf( buffer, "convert hcpy_%d.tga -auto-orient %s", gifNr, fileName); 967 977 system (buffer); 968 978 sprintf( buffer, "rm -f hcpy_%d.tga %s",gifNr,DEV_NULL); 969 979 system (buffer); … … 978 988 if(filePtr!=NULL) sprintf(fileName,"%s.png",filePtr); else sprintf(fileName,"hcpy_%d.png",pngNr); 979 989 printf("create %s\n ",fileName); 980 990 getTGAScreenShot(pngNr); 981 sprintf( buffer, "convert hcpy_%d.tga %s", pngNr, fileName);991 sprintf( buffer, "convert hcpy_%d.tga -auto-orient %s", pngNr, fileName); 982 992 system (buffer); 983 993 sprintf( buffer, "rm -f hcpy_%d.tga %s",pngNr,DEV_NULL); 984 994 system (buffer); … … 6473 6475 6474 6476 setall=seto( "all" ); 6475 6477 6476 if(sem_init(&sem_n, 0, 1) < 0) printf("Error in:sem_init\n"); 6477 if(sem_init(&sem_g, 0, 1) < 0) printf("Error in:sem_init\n"); 6478 if(sem_init(&sem_rep, 0, 1) < 0) printf("Error in:sem_init\n"); 6479 if(sem_init(&sem_stn, 0, 1) < 0) printf("Error in:sem_init\n"); 6478 nptr = sem_open("/sem_n", O_CREAT, 0644, 1); 6479 sem_unlink("/sem_n"); 6480 if((nptr == SEM_FAILED)) printf("Error in:sem_open\n"); 6481 gptr = sem_open("/sem_g", O_CREAT, 0644, 1); 6482 sem_unlink("/sem_g"); 6483 if((gptr == SEM_FAILED)) printf("Error in:sem_open\n"); 6484 rptr = sem_open("/sem_rep", O_CREAT, 0644, 1); 6485 sem_unlink("/sem_rep"); 6486 if((rptr == SEM_FAILED)) printf("Error in:sem_open\n"); 6487 sptr = sem_open("/sem_stn", O_CREAT, 0644, 1); 6488 sem_unlink("/sem_stn"); 6489 if((sptr == SEM_FAILED)) printf("Error in:sem_open\n"); 6480 6490 6481 6491 if( (parameter= (char **)malloc( MAX_STACK_PARAMS*sizeof(char *))) == NULL ) 6482 6492 printf("\n\n ERROR: malloc failed\n\n") ; -
src/parser.c
diff -ur cgx_2.18.orig/src/parser.c cgx_2.18/src/parser.c
old new 1 #include < extUtil.h>1 #include <cgx.h> 2 2 3 3 -
src/pickFunktions.c
diff -ur cgx_2.18.orig/src/pickFunktions.c cgx_2.18/src/pickFunktions.c
old new void moveLineEndPoint(int lineNr, int pntNr, double ll 4594 4594 else 4595 4595 { 4596 4596 printf("ERROR: selected point:%s is no line endpoint\n", point[pntNr].name); 4597 return (-1);4597 return; 4598 4598 } 4599 4599 u=flag*llength; 4600 4600 u/=scale->w; … … 7535 7537 /* daten der geschnittenen elemente */ 7536 7538 if ((cutParam=(CutParam *)malloc((anz->emax+1)*sizeof(CutParam)) ) == NULL ) { printf(" ERROR: malloc failure\n\n"); return;} 7537 7539 7538 if(sem_init(&sem_cute, 0, 1) < 0) printf("Error in:sem_init\n"); 7540 cptr = sem_open("/sem_cute", O_CREAT, 0644, 1); 7541 sem_unlink("/sem_cute"); 7542 if((cptr = SEM_FAILED)) printf("Error in:sem_open\n"); 7539 7543 if(threads>anz->e) { nlocalThreads=anz->e; } 7540 7544 else nlocalThreads=threads; 7541 7545 //nlocalThreads=1; … … 7563 7566 glob_cutElement=0; 7564 7567 free(tid); tid=NULL; 7565 7568 free(targ); targ=NULL; 7566 if(sem_ destroy(&sem_cute) < 0) printf("Error in:sem_init\n");7569 if(sem_close(cptr) < 0) printf("Error in:sem_open\n"); 7567 7570 7568 7571 for(e=1; e<anz_e; e++) 7569 7572 { -
src/setFunktions.c
diff -ur cgx_2.18.orig/src/setFunktions.c cgx_2.18/src/setFunktions.c
old new 12087 12088 12088 12089 #else 12089 12090 12090 if(sem_init(&sem_map3d, 0, 1) < 0) printf("Error in:sem_init\n"); 12091 mptr = sem_open("/sem_map3d", O_CREAT, 0644, 1); 12092 sem_unlink("/sem_map3d"); 12093 if((mptr = SEM_FAILED)) printf("Error in:sem_open\n"); 12091 12094 if(threads>set[set1].anz_n) { nlocalThreads=set[set1].anz_n; } 12092 12095 else nlocalThreads=threads; 12093 12096 //nlocalThreads=1; … … 12137 12139 glob_map3d=0; 12138 12140 free(tid); tid=NULL; 12139 12141 free(targ); targ=NULL; 12140 if(sem_ destroy(&sem_map3d) < 0) printf("Error in:sem_init\n");12142 if(sem_close(mptr) < 0) printf("Error in:sem_open\n"); 12141 12143 #endif 12142 12144 12143 12145 if(rsort) free(rsort);