Added notes about portability.
authorviric@llimona
Tue, 10 Apr 2007 23:44:19 +0200
changeset 121 7a42c36de0d0
parent 120 790bc4cecd3b
child 122 e6d6ca823d78
Added notes about portability.
Makefile
PORTABILITY
--- a/Makefile	Tue Apr 10 23:31:21 2007 +0200
+++ b/Makefile	Tue Apr 10 23:44:19 2007 +0200
@@ -1,6 +1,6 @@
 PREFIX?=/usr/local
-GLIBCFLAGS=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D__STRICT_ANSI__
-CFLAGS=-pedantic -ansi -Wall -g -O0 ${GLIBCFLAGS}
+GLIBCFLAGS=-D_XOPEN_SOURCE=500 -D__STRICT_ANSI__
+CFLAGS=-pedantic -ansi -Wall -g -O0
 OBJECTS=main.o \
 	server.o \
 	server_start.o \
@@ -19,7 +19,10 @@
 all: ts
 
 ts: $(OBJECTS)
-	gcc -o ts $^
+	$(CC) $(LDFLAGS) -o ts $^
+
+.c.o:
+	$(CC) $(CFLAGS) $(GLIBCFLAGS) -c $<
 
 # Dependencies
 main.o: main.c main.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PORTABILITY	Tue Apr 10 23:44:19 2007 +0200
@@ -0,0 +1,19 @@
+ANSI C and POSIX
+-------------------------
+The code should compile without any warning in a system providing an ANSI C
+compiler and a Single Unix Specification rev 5 library. I tried only with glibc.
+
+If you find any inconsistency between the code and this statement, please let
+know the auther.
+
+Compilers
+-------------------------
+(Lluís) I could compile easily with gcc.
+I could also compile with tcc 0.9.22 if I change the features to
+-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D__STRICT_ANSI__
+But the linking didn't work with tcc.
+
+HP-UX 10.2 in PA-RISC
+-------------------------
+(Lluís) I could compile changing the #include for sys/select.h in server.c to
+sys/time.h. I also had to use gcc instead of the system's cc.