Sponsored Content
Top Forums Shell Programming and Scripting How to change a Makefile from building static library to shared library? Post 302347532 by cpthk on Wednesday 26th of August 2009 01:15:59 AM
Old 08-26-2009
How to change a Makefile from building static library to shared library?

Hi:

I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library)

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

building a 64-bit archive library

I'm trying to build an archive library using the following script. It builds fine on 32-bit architectures, but when I try to build on a computer with 64-bit architecture I get this error message: /usr/bin/ld: warning: i386 architecture of input file `../lpdlib/lpdlib_byteswapio.a(system.o)' is... (1 Reply)
Discussion started by: echorak
1 Replies

2. Programming

Makefile shared library g++

I'm having trouble with my makefile, I'm trying to code a shared library to be used by another program *EDIT* Found the solution: CC = g++ MODULES= readconfig.o ReadConfigLib.o OBJECTS= RCLOBJECTS= ReadConfigLib.cpp readconfig.cpp configDefinitions.h readconfig.h ReadConfigLib.h... (0 Replies)
Discussion started by: james2432
0 Replies

3. Programming

Adding a Static Library (libtimer.a) to the Makefile

Hi, The following is my Makefile, I wanted to add a staic library named libtimer.a. I'm using the following Makefile. Please let me know how to add this static library: Makefile:- It produces "usbserial" executable. Thanks, S (1 Reply)
Discussion started by: suryaemlinux
1 Replies

4. Linux

Could static library include static library?

I have some static library(libxxx.a libyyy.a). And I want to generate my library(libzzz.a), libzzz.a will use libxxx.a and libyyy.a I wan't my application only use libzzz.a, (means libzzz.a had include libxxx.a, libyyy.a), how can I do that? Thank you. example: I have zzz.c. I do ... (4 Replies)
Discussion started by: freemagic
4 Replies

5. Programming

Static and Shared Library in Makefile

I am having a devil of a time with a very simple make file. The program needs two shared and one static library. If I link the shared libraries only like below the mysql test app works ... (1 Reply)
Discussion started by: jadsys
1 Replies

6. Programming

Even the Static cURL Library Isn't Static

I'm writing a program which uses curl to be run on Linux PCs which will be used by a number of different users. I cannot make the users all install curl on their individual machines, so I have tried to link curl in statically, rather than using libcurl.so. I downloaded the source and created a... (8 Replies)
Discussion started by: BrandonShw
8 Replies

7. UNIX for Dummies Questions & Answers

Shared static library

Hello Please what does mean shared static library and LD-Preload? Thank you (3 Replies)
Discussion started by: chercheur857
3 Replies

8. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

9. HP-UX

How to use chatr to change static library path in binary?

I have solved this but now cannot recall the syntax. I want to strip or change the hard wired library paths on binaries I download from a repository. I do not have root and just want a personal install, but would rather not build every tool. I even posted the solution here once for others, but... (2 Replies)
Discussion started by: DGPickett
2 Replies

10. AIX

Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message. add shr4.o shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a add shr.o shared members from /usr/lib/libiconv.a to ... (5 Replies)
Discussion started by: kneemoe
5 Replies
Module::Build::Compat(3pm)				 Perl Programmers Reference Guide				Module::Build::Compat(3pm)

NAME
Module::Build::Compat - Compatibility with ExtUtils::MakeMaker SYNOPSIS
# In a Build.PL : use Module::Build; my $build = Module::Build->new ( module_name => 'Foo::Bar', license => 'perl', create_makefile_pl => 'traditional' ); ... DESCRIPTION
Because "ExtUtils::MakeMaker" has been the standard way to distribute modules for a long time, many tools (CPAN.pm, or your system administrator) may expect to find a working Makefile.PL in every distribution they download from CPAN. If you want to throw them a bone, you can use "Module::Build::Compat" to automatically generate a Makefile.PL for you, in one of several different styles. "Module::Build::Compat" also provides some code that helps out the Makefile.PL at runtime. METHODS
create_makefile_pl($style, $build) Creates a Makefile.PL in the current directory in one of several styles, based on the supplied "Module::Build" object $build. This is typically controlled by passing the desired style as the "create_makefile_pl" parameter to "Module::Build"'s "new()" method; the Makefile.PL will then be automatically created during the "distdir" action. The currently supported styles are: traditional A Makefile.PL will be created in the "traditional" style, i.e. it will use "ExtUtils::MakeMaker" and won't rely on "Module::Build" at all. In order to create the Makefile.PL, we'll include the "requires" and "build_requires" dependencies as the "PREREQ_PM" parameter. You don't want to use this style if during the "perl Build.PL" stage you ask the user questions, or do some auto-sensing about the user's environment, or if you subclass "Module::Build" to do some customization, because the vanilla Makefile.PL won't do any of that. small A small Makefile.PL will be created that passes all functionality through to the Build.PL script in the same directory. The user must already have "Module::Build" installed in order to use this, or else they'll get a module-not-found error. passthrough (DEPRECATED) This is just like the "small" option above, but if "Module::Build" is not already installed on the user's system, the script will offer to use "CPAN.pm" to download it and install it before continuing with the build. This option has been deprecated and may be removed in a future version of Module::Build. Modern CPAN.pm and CPANPLUS will recognize the "configure_requires" metadata property and install Module::Build before running Build.PL if Module::Build is listed and Module::Build now adds itself to configure_requires by default. Perl 5.10.1 includes "configure_requires" support. In the future, when "configure_requires" support is deemed sufficiently widespread, the "passthrough" style will be removed. run_build_pl(args => @ARGV) This method runs the Build.PL script, passing it any arguments the user may have supplied to the "perl Makefile.PL" command. Because "ExtUtils::MakeMaker" and "Module::Build" accept different arguments, this method also performs some translation between the two. "run_build_pl()" accepts the following named parameters: args The "args" parameter specifies the parameters that would usually appear on the command line of the "perl Makefile.PL" command - typically you'll just pass a reference to @ARGV. script This is the filename of the script to run - it defaults to "Build.PL". write_makefile() This method writes a 'dummy' Makefile that will pass all commands through to the corresponding "Module::Build" actions. "write_makefile()" accepts the following named parameters: makefile The name of the file to write - defaults to the string "Makefile". SCENARIOS
So, some common scenarios are: 1. Just include a Build.PL script (without a Makefile.PL script), and give installation directions in a README or INSTALL document explaining how to install the module. In particular, explain that the user must install "Module::Build" before installing your module. Note that if you do this, you may make things easier for yourself, but harder for people with older versions of CPAN or CPANPLUS on their system, because those tools generally only understand the Makefile.PL/"ExtUtils::MakeMaker" way of doing things. 2. Include a Build.PL script and a "traditional" Makefile.PL, created either manually or with "create_makefile_pl()". Users won't ever have to install "Module::Build" if they use the Makefile.PL, but they won't get to take advantage of "Module::Build"'s extra features either. For good measure, of course, test both the Makefile.PL and the Build.PL before shipping. 3. Include a Build.PL script and a "pass-through" Makefile.PL built using "Module::Build::Compat". This will mean that people can continue to use the "old" installation commands, and they may never notice that it's actually doing something else behind the scenes. It will also mean that your installation process is compatible with older versions of tools like CPAN and CPANPLUS. AUTHOR
Ken Williams <kwilliams@cpan.org> COPYRIGHT
Copyright (c) 2001-2006 Ken Williams. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Module::Build(3), ExtUtils::MakeMaker(3) perl v5.18.2 2014-01-06 Module::Build::Compat(3pm)
All times are GMT -4. The time now is 08:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy