Hide Forgot
Description of Problem: It is impossible to compile any "pwlib" app. #include <ptlib.h> produces infinite loop Version-Release number of selected component (if applicable): pwlib-devel-1.3.3-2 pwlib-1.3.3-2 How Reproducible: Try to compile any "pwlib" app Steps to Reproduce: 1. Install pwlib-devel-1.3.3-2 pwlib-1.3.3-2 2. Tiny "pwlib" app: "a.cxx" ==== #include <ptlib.h> main (){}; ==== 3. "pwlib-style" Makefile ==== PROG = a SOURCES = a.cxx include $(PWLIBDIR)/make/ptlib.mak ==== 4. $ export PWLIBDIR=/usr/share/pwlib 5. $ make opt Actual Results: It goes into infinite include loop: [root@monitor a]# make opt g++ -Wall -DP_LINUX -mcpu=i686 -D_REENTRANT -DP_HAS_SEMAPHORES -DP_SSL - I/usr/include/include -I/usr/include/crypto -DP_EXPAT -DP_PTHREADS - DPHAS_TEMPLATES -DPBYTE_ORDER=PLITTLE_ENDIAN - I/usr/share/pwlib/include/ptlib/unix -I/usr/share/pwlib/include -O3 -DNDEBUG - c a.cxx -o obj_linux_x86_r/a.o In file included from /usr/include/ptlib/ptime.h:634, from /usr/include/ptlib/ptime.h:634, from /usr/include/ptlib/ptime.h:634, from /usr/include/ptlib/ptime.h:634, ...................... ...................... from /usr/include/ptlib/ptime.h:634, from /usr/include/ptlib/ptime.h:634, from /usr/include/ptlib.h:142, from a.cxx:1: /usr/include/ptlib/ptime.h:126:18: #include nested too deeply /usr/include/ptlib/ptime.h:634:25: #include nested too deeply In file included from /usr/include/ptlib/timeint.h:455, from /usr/include/ptlib/timeint.h:455, from /usr/include/ptlib/timeint.h:455, from /usr/include/ptlib/timeint.h:455, Expected Results: Should compile Additional Information: See next post
Pay attention to files included in "/usr/include/ptlib.h" For example line 142: #include <ptlib/ptime.h> This file ""/usr/include/ptlib/ptime.h" RECURSIVELY calls himself. Look at the end : // Include platform dependent part of class #include <ptlib/ptime.h> This line should call PLATFORM DEPENDENT .h !!! #include <ptlib/unix/ptlib/ptime.h>
There is another way : to do full set of symlinks in PWLIBDIR directory. Changed pwlib.spec (I've added -m644 permission for include/*.h) ======================================= %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT/usr/include/ptclib mkdir -p $RPM_BUILD_ROOT/usr/include/ptlib/unix/ptlib mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/make cp -d lib/*so* $RPM_BUILD_ROOT/usr/lib install -m 644 include/ptlib.h $RPM_BUILD_ROOT/usr/include install -m 644 include/ptlib/*.h $RPM_BUILD_ROOT/usr/include/ptlib/ install -m 644 include/ptlib/*.inl $RPM_BUILD_ROOT/usr/include/ptlib/ install -m 644 include/ptlib/unix/ptlib/*.h $RPM_BUILD_ROOT/usr/include/ptlib/unix/ptli b install -m 644 include/ptlib/unix/ptlib/*.inl $RPM_BUILD_ROOT/usr/include/ptlib/unix/pt lib install -m 644 include/ptclib/*.h $RPM_BUILD_ROOT/usr/include/ptclib/ install tools/asnparser/obj_linux_*/asnparser $RPM_BUILD_ROOT/usr/bin ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/include /usr/include ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/lib /usr/lib ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/bin /usr/bin mkdir $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools ln -s $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools/asnparser /usr/bin
Sorry, ln -s src dst ..... ln -s /usr/include $RPM_BUILD_ROOT/%{_datadir}/%{name}/include ln -s /usr/lib $RPM_BUILD_ROOT/%{_datadir}/%{name}/lib ln -s /usr/bin $RPM_BUILD_ROOT/%{_datadir}/%{name}/bin mkdir $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools ln -s /usr/bin $RPM_BUILD_ROOT/%{_datadir}/%{name}/tools/asnparser
Due to stupid naming on the part of the pwlib team you need to list -I/usr/include/ptlib/unix/ before /usr/include (which is last by default). "g++ -I/usr/include/ptlib/unix/ a.cxx" works for me.