BlinkenLib v.0.6.2 (2009-02-23)
Christian Heimke

Christian Heimke commited on 2011-07-15 09:09:13
Showing 22 changed files, with 170 additions and 114 deletions.

... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -106,9 +106,9 @@ int main( int argCnt, char * * args )
106 106
 
107 107
   //print info
108 108
   printf( "BlinkenLib - BlinkenConv\n"
109
-          "version 0.6.1 date 2008-07-22\n"
109
+          "version 0.6.2 date 2009-02-23\n"
110 110
           "config "BLINKENLIB_CONFIG"\n"
111
-          "Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>\n"
111
+          "Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>\n"
112 112
           "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
113 113
           "a blinkenarea.org project\n\n" );
114 114
 
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,8 +1,10 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6
+ *
7
+ * OS X support by Manfred Wuits <manfred@werkzeugH.at>
6 8
  */
7 9
 
8 10
 #include <errno.h>
... ...
@@ -22,27 +24,27 @@
22 24
 #include <BlinkenLib/BlinkenLib.h>
23 25
 
24 26
 //get serial settings from text
25
-static int serial_settings_parse( char * str, int * settings )
27
+static int serial_settings_parse( char * str, int * settings, int * speed )
26 28
 {
27 29
   int baud, data, stop;
28 30
   char parity;
29
-  int set = 0;
31
+  int set = 0, sp = 0;
30 32
 
31 33
   //split and parse settings string
32 34
   if( sscanf( str, "%i,%c,%i,%i", &baud, &parity, &data, &stop ) != 4 )
33 35
     return 0;
34 36
 
35 37
   //baud rate
36
-  if( baud == 300 ) set |= B300;
37
-  else if( baud == 600 ) set |= B600;
38
-  else if( baud == 1200 ) set |= B1200;
39
-  else if( baud == 2400 ) set |= B2400;
40
-  else if( baud == 4800 ) set |= B4800;
41
-  else if( baud == 9600 ) set |= B9600;
42
-  else if( baud == 19200 ) set |= B19200;
43
-  else if( baud == 38400 ) set |= B38400;
44
-  else if( baud == 57600 ) set |= B57600;
45
-  else if( baud == 115200 ) set |= B115200;
38
+  if( baud == 300 ) sp = B300;
39
+  else if( baud == 600 ) sp = B600;
40
+  else if( baud == 1200 ) sp = B1200;
41
+  else if( baud == 2400 ) sp = B2400;
42
+  else if( baud == 4800 ) sp = B4800;
43
+  else if( baud == 9600 ) sp = B9600;
44
+  else if( baud == 19200 ) sp = B19200;
45
+  else if( baud == 38400 ) sp = B38400;
46
+  else if( baud == 57600 ) sp = B57600;
47
+  else if( baud == 115200 ) sp = B115200;
46 48
   else
47 49
   {
48 50
     printf( "illegal baudrate: %d\n", baud );
... ...
@@ -81,6 +83,7 @@ static int serial_settings_parse( char * str, int * settings )
81 83
 
82 84
   //success
83 85
   *settings = set;
86
+  *speed = sp;
84 87
   return 1;
85 88
 }
86 89
 
... ...
@@ -124,7 +127,7 @@ static void serial_settings_to_str( int settings, char * buf, unsigned int maxle
124 127
 }
125 128
 
126 129
 //set serial settings for fd
127
-static int serial_settings_set( int fd, int settings )
130
+static int serial_settings_set( int fd, int settings, int speed )
128 131
 {
129 132
   struct termios tio;
130 133
 
... ...
@@ -136,6 +139,17 @@ static int serial_settings_set( int fd, int settings )
136 139
   tio.c_lflag = 0;
137 140
   tio.c_cc[VTIME] = 10; //1 sec timeout
138 141
   tio.c_cc[VMIN] = 0; //return on single char read
142
+
143
+#if BLINKENLIB_CFG_OSX
144
+  if( cfsetspeed( &tio, speed ) == - 1 )
145
+  {
146
+    printf( "cfsetspeed: error: %s\n", strerror( errno ) );
147
+    return 0;
148
+  }
149
+#else //#if BLINKENLIB_CFG_OSX
150
+  tio.c_cflag |= speed;
151
+#endif //#if BLINKENLIB_CFG_OSX
152
+
139 153
   if( tcsetattr( fd, TCSANOW, &tio ) == -1 )
140 154
   {
141 155
     printf( "tcsetattr: error: %s\n", strerror( errno ) );
... ...
@@ -301,7 +315,7 @@ static int recv_and_out( SOCKET udpSocket, int dev_fd,
301 315
 //returns error code (not for device-errors, 0 for success)
302 316
 static int open_and_output( SOCKET udpSocket, char * device,
303 317
                             int * p_device_output_active,
304
-                            int serial_settings_change, int serial_settings,
318
+                            int serial_settings_change, int serial_settings, int serial_speed,
305 319
                             unsigned int format_change,
306 320
                             unsigned int format_height, unsigned int format_width,
307 321
                             unsigned int format_channels, unsigned int format_colors,
... ...
@@ -322,7 +336,7 @@ static int open_and_output( SOCKET udpSocket, char * device,
322 336
   //setup serial port
323 337
   if( serial_settings_change )
324 338
   {
325
-    if( ! serial_settings_set( dev_fd, serial_settings ) )
339
+    if( ! serial_settings_set( dev_fd, serial_settings, serial_speed ) )
326 340
     {
327 341
       if( *p_device_output_active )
328 342
       {
... ...
@@ -348,7 +362,7 @@ static int open_and_output( SOCKET udpSocket, char * device,
348 362
 //open device and output frames in a loop
349 363
 //returns error code (not for device-errors, 0 for success)
350 364
 static int open_and_output_loop( SOCKET udpSocket, char * device,
351
-                                 int serial_settings_change, int serial_settings,
365
+                                 int serial_settings_change, int serial_settings, int serial_speed,
352 366
                                  int reopen_device, unsigned int reopen_device_ms,
353 367
                                  unsigned int format_change,
354 368
                                  unsigned int format_height, unsigned int format_width,
... ...
@@ -366,7 +380,7 @@ static int open_and_output_loop( SOCKET udpSocket, char * device,
366 380
     //try to open device and output frames
367 381
     err = open_and_output( udpSocket, device,
368 382
                            &device_output_active,
369
-                           serial_settings_change, serial_settings,
383
+                           serial_settings_change, serial_settings, serial_speed,
370 384
                            format_change, format_height, format_width, format_channels, format_colors,
371 385
                            proto );
372 386
     if( err != 0 || ! reopen_device )
... ...
@@ -396,7 +410,7 @@ static int open_and_output_loop( SOCKET udpSocket, char * device,
396 410
 
397 411
 int main( int argCnt, char * * args )
398 412
 {
399
-  int i, bound, serial_settings;
413
+  int i, bound, serial_settings, serial_speed;
400 414
   SOCKET udpSocket;
401 415
   etBlinkenProto proto;
402 416
   unsigned int format_change, format_height, format_width, format_channels, format_colors;
... ...
@@ -409,9 +423,9 @@ int main( int argCnt, char * * args )
409 423
 
410 424
   //print info
411 425
   printf( "BlinkenLib - BlinkenOutput\n"
412
-          "version 0.6.1 date 2008-07-22\n"
426
+          "version 0.6.2 date 2009-02-23\n"
413 427
           "config "BLINKENLIB_CONFIG"\n"
414
-          "Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>\n"
428
+          "Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>\n"
415 429
           "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
416 430
           "a blinkenarea.org project\n\n" );
417 431
 
... ...
@@ -458,6 +472,7 @@ int main( int argCnt, char * * args )
458 472
   format_colors = 0;
459 473
   device = "/dev/null";
460 474
   serial_settings = 0;
475
+  serial_speed = 0;
461 476
   serial_settings_change = 0;
462 477
   reopen_device = 0;
463 478
   for( i = 1; i < argCnt; i++ )
... ...
@@ -585,7 +600,7 @@ int main( int argCnt, char * * args )
585 600
       if( i + 1 < argCnt )
586 601
       {
587 602
         i++;
588
-        if( serial_settings_parse( args[i], &serial_settings ) )
603
+        if( serial_settings_parse( args[i], &serial_settings, &serial_speed ) )
589 604
         {
590 605
           serial_settings_change = 1;
591 606
         }
... ...
@@ -637,7 +652,7 @@ int main( int argCnt, char * * args )
637 652
 
638 653
   //open device and output frames in a loop
639 654
   open_and_output_loop( udpSocket, device,
640
-                        serial_settings_change, serial_settings,
655
+                        serial_settings_change, serial_settings, serial_speed,
641 656
                         reopen_device, reopen_device_ms,
642 657
                         format_change, format_height, format_width, format_channels, format_colors,
643 658
                         proto );
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -351,7 +351,7 @@ int main( int argCnt, char * * args )
351 351
   //print info
352 352
   printf( "BlinkenLib - BlinkenOutput\n"
353 353
           "version 0.6.0 date 2008-05-15"
354
-          "Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>\n"
354
+          "Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>\n"
355 355
           "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
356 356
           "a blinkenarea.org project\n\n" );
357 357
 
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -32,9 +32,9 @@ int main( int argCnt, char * * args )
32 32
 
33 33
   //print info
34 34
   printf( "BlinkenLib - BlinkenRecv\n"
35
-          "version 0.6.1 date 2008-07-22\n"
35
+          "version 0.6.2 date 2009-02-23\n"
36 36
           "config "BLINKENLIB_CONFIG"\n"
37
-          "Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>\n"
37
+          "Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>\n"
38 38
           "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
39 39
           "a blinkenarea.org project\n\n" );
40 40
 
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -35,9 +35,9 @@ int main( int argCnt, char * * args )
35 35
 
36 36
   //print info
37 37
   printf( "BlinkenLib - BlinkenSend\n"
38
-          "version 0.6.1 date 2008-07-22\n"
38
+          "version 0.6.2 date 2009-02-23\n"
39 39
           "config "BLINKENLIB_CONFIG"\n"
40
-          "Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>\n"
40
+          "Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>\n"
41 41
           "Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
42 42
           "a blinkenarea.org project\n\n" );
43 43
 
... ...
@@ -1,6 +1,6 @@
1 1
 # BlinkenLib
2
-# version 0.6.1 date 2008-07-22
3
-# Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+# version 0.6.2 date 2009-02-23
3
+# Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
 # Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
 # a blinkenarea.org project
6 6
 
... ...
@@ -12,11 +12,17 @@ RANLIB=ranlib
12 12
 
13 13
 VERSION_MAJOR=0
14 14
 VERSION_MINOR=6
15
-VERSION_REVISION=1
15
+VERSION_REVISION=2
16 16
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
17 17
 
18 18
 include ../config/config.mk
19 19
 
20
+ifeq ($(BLINKENLIB_CFG_OSX),1)
21
+SHLIBEXT=dylib
22
+else
23
+SHLIBEXT=so
24
+endif
25
+
20 26
 ifeq ($(BLINKENLIB_CFG_MNG),1)
21 27
 BLINKEN_MNG_H=BlinkenMng.h
22 28
 BLINKEN_MNG_O=BlinkenMng.o
... ...
@@ -27,7 +33,7 @@ LIB_OBJS=BlinkenColorizer.o BlinkenFrame.o BlinkenMovie.o $(BLINKEN_MNG_O) Tools
27 33
 
28 34
 .phony: all clean
29 35
 
30
-all: libBlinkenLib.a libBlinkenLib.so.$(VERSION_MAJOR) libBlinkenLib.so.$(VERSION) libBlinkenLib.so BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput
36
+all: libBlinkenLib.a libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR) libBlinkenLib.$(SHLIBEXT).$(VERSION) libBlinkenLib.$(SHLIBEXT) BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput
31 37
 
32 38
 config.h: ../config/config.h
33 39
 	cp $< $@
... ...
@@ -51,41 +57,41 @@ libBlinkenLib.a: $(LIB_OBJS)
51 57
 	$(AR) cr $@ $+
52 58
 	$(RANLIB) $@
53 59
 
54
-libBlinkenLib.so.$(VERSION): $(LIB_OBJS)
55
-	$(CC) -shared -Wl,-soname,libBlinkenLib.so.$(VERSION_MAJOR) -o $@ $+ $(LMNG)
60
+libBlinkenLib.$(SHLIBEXT).$(VERSION): $(LIB_OBJS)
61
+	$(CC) -shared -Wl,-soname,libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR) -o $@ $+ $(LMNG)
56 62
 
57
-libBlinkenLib.so.$(VERSION_MAJOR): libBlinkenLib.so.$(VERSION)
63
+libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR): libBlinkenLib.$(SHLIBEXT).$(VERSION)
58 64
 	rm -f $@
59 65
 	ln -s $< $@
60 66
 
61
-libBlinkenLib.so: libBlinkenLib.so.$(VERSION_MAJOR)
67
+libBlinkenLib.$(SHLIBEXT): libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR)
62 68
 	rm -f $@
63 69
 	ln -s $< $@
64 70
 
65 71
 BlinkenConv.o: BlinkenConv.c BlinkenLib.h config.h BlinkenColorizer.h BlinkenFrame.h BlinkenMovie.h
66 72
 	$(CC) $(CFLAGS) -c -o $@ $<
67 73
 
68
-BlinkenConv: BlinkenConv.o libBlinkenLib.so
74
+BlinkenConv: BlinkenConv.o libBlinkenLib.$(SHLIBEXT)
69 75
 	$(CC) $(LFLAGS) -o $@ $< -lBlinkenLib
70 76
 
71 77
 BlinkenSend.o: BlinkenSend.c BlinkenLib.h config.h BlinkenColorizer.h BlinkenFrame.h BlinkenMovie.h
72 78
 	$(CC) $(CFLAGS) -c -o $@ $<
73 79
 
74
-BlinkenSend: BlinkenSend.o libBlinkenLib.so
80
+BlinkenSend: BlinkenSend.o libBlinkenLib.$(SHLIBEXT)
75 81
 	$(CC) $(LFLAGS) -o $@ $< -lBlinkenLib
76 82
 
77 83
 BlinkenRecv.o: BlinkenRecv.c BlinkenLib.h config.h BlinkenColorizer.h BlinkenFrame.h BlinkenMovie.h
78 84
 	$(CC) $(CFLAGS) -c -o $@ $<
79 85
 
80
-BlinkenRecv: BlinkenRecv.o libBlinkenLib.so
86
+BlinkenRecv: BlinkenRecv.o libBlinkenLib.$(SHLIBEXT)
81 87
 	$(CC) $(LFLAGS) -o $@ $< -lBlinkenLib
82 88
 
83 89
 BlinkenOutput.o: BlinkenOutput.c BlinkenLib.h config.h BlinkenColorizer.h BlinkenFrame.h BlinkenMovie.h
84 90
 	$(CC) $(CFLAGS) -c -o $@ $<
85 91
 
86
-BlinkenOutput: BlinkenOutput.o libBlinkenLib.so
92
+BlinkenOutput: BlinkenOutput.o libBlinkenLib.$(SHLIBEXT)
87 93
 	$(CC) $(LFLAGS) -o $@ $< -lBlinkenLib
88 94
 
89 95
 clean:
90
-	rm -f BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput libBlinkenLib.so* libBlinkenLib.a *.o config.h
96
+	rm -f BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput libBlinkenLib.$(SHLIBEXT)* libBlinkenLib.a *.o config.h
91 97
 
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,6 +1,6 @@
1 1
 /* BlinkenLib
2
- * version 0.6.1 date 2008-07-22
3
- * Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+ * version 0.6.2 date 2009-02-23
3
+ * Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
  * a blinkenarea.org project
6 6
  */
... ...
@@ -1,3 +1,7 @@
1
+0.6.2 2009-02-23
2
+----------------
3
+added OS X support (patch by Manfred Wuits <manfred@werkzeugH.at>)
4
+
1 5
 0.6.1 2008-07-22
2 6
 ----------------
3 7
 added test movie generation to BlinkenConv
... ...
@@ -1,34 +1,14 @@
1 1
 # BlinkenLib
2
-# version 0.6.1 date 2008-07-22
3
-# Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
2
+# version 0.6.2 date 2009-02-23
3
+# Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4 4
 # Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
 # a blinkenarea.org project
6 6
 
7
-INSTALL=install
8
-
9 7
 VERSION_MAJOR=0
10 8
 VERSION_MINOR=6
11
-VERSION_REVISION=1
9
+VERSION_REVISION=2
12 10
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
13 11
 
14
-ENV_PREFIX=$(shell echo $$PREFIX)
15
-STOW_DIR=/usr/local/stow
16
-STOW_PREFIX=$(STOW_DIR)/BlinkenLib-$(VERSION)
17
-DEF_PREFIX=/usr/local
18
-ifneq ($(ENV_PREFIX),)
19
-  PREFIX=$(ENV_PREFIX)
20
-else
21
-  ifeq ($(shell if [ -d $(STOW_DIR) ]; then echo stow; fi),stow)
22
-    PREFIX=$(STOW_PREFIX)
23
-  else
24
-    PREFIX=$(DEF_PREFIX)
25
-  endif
26
-endif
27
-
28
-HEADERS=BlinkenLib.h BlinkenMovie.h BlinkenFrame.h BlinkenColorizer.h config.h
29
-LIBS=libBlinkenLib.a libBlinkenLib.so.$(VERSION)
30
-EXECS=BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput
31
-
32 12
 .phony: all conf clean distclean install uninstall
33 13
 
34 14
 all: conf
... ...
@@ -44,19 +24,8 @@ distclean: clean
44 24
 	$(MAKE) -C config clean
45 25
 
46 26
 install: all
47
-	$(INSTALL) -d $(PREFIX)/include/BlinkenLib
48
-	$(INSTALL) -t $(PREFIX)/include/BlinkenLib $(addprefix BlinkenLib/, $(HEADERS))
49
-	$(INSTALL) -d $(PREFIX)/lib
50
-	$(INSTALL) -t $(PREFIX)/lib $(addprefix BlinkenLib/, $(LIBS))
51
-	ln -sf libBlinkenLib.so.$(VERSION) $(PREFIX)/lib/libBlinkenLib.so.$(VERSION_MAJOR)
52
-	ln -sf libBlinkenLib.so.$(VERSION_MAJOR) $(PREFIX)/lib/libBlinkenLib.so
53
-	$(INSTALL) -d $(PREFIX)/bin
54
-	$(INSTALL) -t $(PREFIX)/bin $(addprefix BlinkenLib/, $(EXECS))
27
+	$(MAKE) -C install install
55 28
 
56 29
 uninstall:
57
-	rm -f $(addprefix $(PREFIX)/bin/, $(EXECS))
58
-	rm -f $(PREFIX)/lib/libBlinkenLib.so
59
-	rm -f $(PREFIX)/lib/libBlinkenLib.so.$(VERSION_MAJOR)
60
-	rm -f $(addprefix $(PREFIX)/lib/, $(LIBS))
61
-	rm -rf $(PREFIX)/include/BlinkenLib
30
+	$(MAKE) -C install uninstall
62 31
 
... ...
@@ -1,5 +1,5 @@
1 1
 # BlinkenLib
2
-# version 0.6.1 date 2008-07-22
2
+# version 0.6.2 date 2009-02-23
3 3
 # Copyright 2004-2008 Stefan Schuermans <stefan@blinkenarea.org>
4 4
 # Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5 5
 # a blinkenarea.org project
... ...
@@ -10,12 +10,16 @@ CC=gcc
10 10
 
11 11
 all: config.cfg config.mk config.h
12 12
 
13
+osx.cfg:
14
+	echo -n "OSX=" >osx.cfg
15
+	(if [ "$$(uname -s)" == "Darwin" ]; then echo "1"; else echo "0"; fi) >>osx.cfg
16
+
13 17
 mng.cfg:
14 18
 	echo -n "MNG=" >mng.cfg
15 19
 	(($(CC) -o mng mng.c -lmng && ./mng && echo "1") || echo "0") >>mng.cfg
16 20
 	rm -f mng
17 21
 
18
-config.cfg: mng.cfg
22
+config.cfg: osx.cfg mng.cfg
19 23
 	cat $+ >config.cfg
20 24
 
21 25
 config.mk: config.cfg
... ...
@@ -0,0 +1,58 @@
1
+# BlinkenLib
2
+# version 0.6.2 date 2009-02-23
3
+# Copyright 2004-2009 Stefan Schuermans <stefan@blinkenarea.org>
4
+# Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
5
+# a blinkenarea.org project
6
+
7
+INSTALL=install
8
+
9
+VERSION_MAJOR=0
10
+VERSION_MINOR=6
11
+VERSION_REVISION=2
12
+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
13
+
14
+include ../config/config.mk
15
+
16
+ifeq ($(BLINKENLIB_CFG_OSX),1)
17
+SHLIBEXT=dylib
18
+else
19
+SHLIBEXT=so
20
+endif
21
+
22
+ENV_PREFIX=$(shell echo $$PREFIX)
23
+STOW_DIR=/usr/local/stow
24
+STOW_PREFIX=$(STOW_DIR)/BlinkenLib-$(VERSION)
25
+DEF_PREFIX=/usr/local
26
+ifneq ($(ENV_PREFIX),)
27
+  PREFIX=$(ENV_PREFIX)
28
+else
29
+  ifeq ($(shell if [ -d $(STOW_DIR) ]; then echo stow; fi),stow)
30
+    PREFIX=$(STOW_PREFIX)
31
+  else
32
+    PREFIX=$(DEF_PREFIX)
33
+  endif
34
+endif
35
+
36
+HEADERS=BlinkenLib.h BlinkenMovie.h BlinkenFrame.h BlinkenColorizer.h config.h
37
+LIBS=libBlinkenLib.a libBlinkenLib.$(SHLIBEXT).$(VERSION)
38
+EXECS=BlinkenConv BlinkenSend BlinkenRecv BlinkenOutput
39
+
40
+.phony: install uninstall
41
+
42
+install:
43
+	$(INSTALL) -d $(PREFIX)/include/BlinkenLib
44
+	$(INSTALL) -t $(PREFIX)/include/BlinkenLib $(addprefix ../BlinkenLib/, $(HEADERS))
45
+	$(INSTALL) -d $(PREFIX)/lib
46
+	$(INSTALL) -t $(PREFIX)/lib $(addprefix ../BlinkenLib/, $(LIBS))
47
+	ln -sf libBlinkenLib.$(SHLIBEXT).$(VERSION) $(PREFIX)/lib/libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR)
48
+	ln -sf libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR) $(PREFIX)/lib/libBlinkenLib.$(SHLIBEXT)
49
+	$(INSTALL) -d $(PREFIX)/bin
50
+	$(INSTALL) -t $(PREFIX)/bin $(addprefix ../BlinkenLib/, $(EXECS))
51
+
52
+uninstall:
53
+	rm -f $(addprefix $(PREFIX)/bin/, $(EXECS))
54
+	rm -f $(PREFIX)/lib/libBlinkenLib.$(SHLIBEXT)
55
+	rm -f $(PREFIX)/lib/libBlinkenLib.$(SHLIBEXT).$(VERSION_MAJOR)
56
+	rm -f $(addprefix $(PREFIX)/lib/, $(LIBS))
57
+	rm -rf $(PREFIX)/include/BlinkenLib
58
+
0 59