fix compilation on Mac OS X

Bug #362878 reported by Ximin Luo
2
Affects Status Importance Assigned to Milestone
DC++
Fix Released
Low
Steven Sheehy
LinuxDC++
Fix Committed
Low
Steven Sheehy

Bug Description

linuxdcpp does not compile on Mac OS X (MacPorts with a custom Portfile, which can be supplied on demand):

dcpp/QueueManager.cpp: In static member function 'static std::string dcpp::QueueManager::checkTarget(const std::string&, int64_t)':
dcpp/QueueManager.cpp:508: error: 'PATH_MAX' was not declared in this scope
scons: *** [build/dcpp/QueueManager.o] Error 1
scons: building terminated because of errors.

this is due to limits.h not defining PATH_MAX in Mac OS X; sys/syslimits.h is used instead.

when this is fixed (see patch), this error occurs:

g++ -o linuxdcpp -L/usr/lib -Wl,-framework,CoreServices,-framework,ApplicationServices build/dcpp/libdcpp.a build/gui/bookentry.o build/gui/dialogentry.o build/gui/downloadqueue.o build/gui/entry.o build/gui/favoritehubs.o build/gui/finishedtransfers.o build/gui/hashdialog.o build/gui/hub.o build/gui/mainwindow.o build/gui/privatemessage.o build/gui/publichubs.o build/gui/search.o build/gui/settingsdialog.o build/gui/settingsmanager.o build/gui/sharebrowser.o build/gui/treeview.o build/gui/UserCommandMenu.o build/gui/wulfor.o build/gui/wulformanager.o build/gui/WulforUtil.o -L/opt/local/lib -L/usr/X11/lib -Lbuild/dcpp -Ldcpp -ldcpp -lbz2 -lcrypto -lssl -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lpthread -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lSM -lICE -lpangoft2-1.0 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lfreetype -lz -lfontconfig -lexpat -lpng12 -lXrender -lX11 -lpixman-1 -lgthread-2.0 -lglib-2.0 -lintl -liconv
Undefined symbols:
  "_RSA_generate_key_ex", referenced from:
      dcpp::CryptoManager::generateCertificate() in libdcpp.a(CryptoManager.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
scons: *** [linuxdcpp] Error 1

this is due to a redundant library path being supplied in SConstruct. it "locks" the build to use the standard system libraries rather than the compiler-chosen ones. for a non-default (non-system) compiler (eg. MacPorts gcc), the latter is necessary.

when the entire patch is applied, the compile succeeds.

Related branches

Revision history for this message
Ximin Luo (infinity0) wrote :
Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Thanks for the patch. The PATH_MAX change seems reasonable, but I'm unsure about the other change. A previous patch submitter had us make that change to add -L/usr/lib so that it would compile on Mac OS X. Would your change break it for users like him?

https://lists.berlios.de/pipermail/linuxdcpp-developers/2007-November/000597.html

Revision history for this message
Ximin Luo (infinity0) wrote :

/usr/lib should be included in a system compiler's library path already. my first thought is that the previous submitter was mixing a custom compiler and system libraries. if you do that, then you should be prepared to add flags in yourself, rather than adding it into the automatic build scripts.

two of my friends have compiled it separately, one using fink gcc with fink libs, one using macports gcc with macports libs, and both of them needed that line to be removed.

Changed in linuxdcpp:
assignee: nobody → steven-sheehy
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Committed fix to dcpp core and to linuxdcpp's SConstruct. However, dcpp core fix will not be present in linuxdcpp until dcpp makes its next stable release and linuxdcpp syncs its core with it.

Changed in dcplusplus:
assignee: nobody → Steven Sheehy (steven-sheehy)
importance: Undecided → Low
status: New → Fix Committed
Changed in linuxdcpp:
status: Confirmed → Fix Committed
Revision history for this message
poy (poy) wrote :

Fixed in version 0.760.

Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.