RE: Makefile for lib64 libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: [email protected] [mailto:fedora-list-
> [email protected]] On Behalf Of Steve Searle
> Sent: Thursday, December 03, 2009 10:03 PM
> To: Fedora List
> Subject: Makefile for lib64 libraries
> 
> I have just upgraded to 64-bit Fedora, and have a mysql appliation
> where the build fails with:
> 
> /usr/bin/ld: cannot find -lmysqlclient
> 
> I know that this is because the library is in lib64, and my Makefile.am
> contains:
> 
> bin_PROGRAMS = scraperes
> scraperes_SOURCES = main.cpp ...
> AM_CPPFLAGS = -I/usr/include/mysql
> AM_LDFLAGS = -L/usr/lib/mysql -lmysqlclient
> 
> I know I can edit this to have lib64, but what can I do to make it work
> for both 64-bit and 32-bit operating systems?

Here's one way to do it:

LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
   AM_LDFLAGS = -L/usr/lib64/mysql -lmysqlclient
else
   AM_LDFLAGS = -L/usr/lib/mysql -lmysqlclient
Endif

Regards,

Sanya

********************
Nedbank Limited Reg No 1951/000009/06. The following link displays the names of the Nedbank Board of Directors and Company Secretary. [ http://www.nedbank.co.za/terms/DirectorsNedbank.htm ]
This email is confidential and is intended for the addressee only. The following link will take you to Nedbank's legal notice. [ http://www.nedbank.co.za/terms/EmailDisclaimer.htm ]
********************


-- 
fedora-list mailing list
[email protected]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux