Date: Wed, 25 Jan 1995 22:29:29 MST From: steve@khoros.unm.edu (Steven Jorgensen) To: questions@FreeBSD.org Subject: Share vs Static library questions Message-ID: <9501260529.AA25036@zen.khoros.unm.edu>
next in thread | raw e-mail | index | archive | help
Hi.. I'm currently working on porting Khoros to FreeBSD 2.0, and have a couple of questions about how to compile our libraries so that both the *.a and the *.so file are created correctly. I have currently written the imake rules such that each *.c in a library is compiled twice. Once with the -fpic option, and once without. Then I use the *.o's with the -fpic option to compile the *.so library and the other *.o's to make a *.a library. This works perfectly, but it is annoying and time consuming to compile each *.c twice. So, my question is whether or not it is feasible to generate both a *.so and a *.a from one set of .o's. I tried generating a *.a from the .o's compiled with the -fpic option, and got an error while linking a program, so I know that doesn't work. Is there some option I'm missing? Am I stuck compiling this stuff twice? For reference, we are able to generate both shared and static libraries under OSF/1, SunOS, and Solaris. Any help appreciated. Steve -- ------------------------------------------------------------- Steven Jorgensen | Khoral Research Inc. steve@khoros.unm.edu | 6001 Indian School, Suite 200 (505) 837-6500 | Albuquerque, NM 87110 ------------------------+------------------------------------ This Space for Rent. | URL: http://www.khoros.unm.edu/ -------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9501260529.AA25036>