OpenBSD portability enhancements (bug 1002)
[asterisk/asterisk.git] / channels / h323 / Makefile
1 # include the Makefile of OpenH323 
2
3 ifndef OPENH323DIR
4 OPENH323DIR=$(HOME)/openh323
5 endif
6
7 ifndef PWLIBDIR
8 PWLIBDIR=$(HOME)/pwlib
9 endif
10
11 ifndef ASTERISKDIR
12 ASTERISKDIR= /usr/lib/asterisk/modules
13 endif
14
15 ifndef ASTETCDIR
16 ASTETCDIR=/etc/asterisk
17 endif
18
19 #
20 # This needs to be updated to deal with more than just little endian machines
21 #
22 CFLAGS += -march=$(shell uname -m) -DPBYTE_ORDER=PLITTLE_ENDIAN
23
24
25 #############################################
26 #
27 # Only change below if you know WTF your doing
28 #
29 OSARCH=$(shell uname -s)
30 CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
31 CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations 
32 CFLAGS += -D_REENTRANT -D_GNU_SOURCE
33 ifeq (${OSARCH},OpenBSD)
34 CFLAGS += -DP_OPENBSD=200311
35 else
36 CFLAGS += -DP_LINUX
37 endif
38 CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
39 CFLAGS += -DPHAS_TEMPLATES -DPTRACING -DP_USE_PRAGMA
40 CFLAGS += -I../../include
41 CFLAGS += -I$(PWLIBDIR)/include/ptlib/unix -I$(PWLIBDIR)/include 
42 CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
43
44
45 all:    libchanh323.a
46
47 samples: 
48         if [ -f $(ASTETCDIR)/h323.conf ]; then \
49                 mv -f $(ASTETCDIR)/h323.conf $(ASTETCDIR)/h323.conf.old ; \
50         fi ; 
51         install h323.conf.sample $(ASTETCDIR)/h323.conf
52  
53
54 ast_h323.o:     ast_h323.cpp
55         g++ -g -c -o $@ $(CFLAGS) $<
56
57 libchanh323.a:  ast_h323.o
58         ar cr libchanh323.a ast_h323.o
59
60 chan_h323.so:   
61         g++  -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
62
63 chan_h323_d.so: chan_h323.o ast_h323.o
64         g++  -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
65
66 chan_h323_s.so: chan_h323.o ast_h323.o
67         g++  -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib  -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib -lpthread -ldl -lcrypto -lssl -lexpat
68 clean:
69         rm -f *.o *.so core.* libchanh323.a
70
71