From owner-freebsd-questions Wed Jan 25 21:29:34 1995 Return-Path: questions-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id VAA16219 for questions-outgoing; Wed, 25 Jan 1995 21:29:34 -0800 Received: from zen.khoros.unm.edu (zen.khoros.unm.edu [198.59.155.24]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id VAA16213 for ; Wed, 25 Jan 1995 21:29:32 -0800 Received: by zen.khoros.unm.edu (5.0/VISION/14Apr88/C) id AA25036; Wed, 25 Jan 1995 22:29:29 +0700 Posted-Date: Wed, 25 Jan 1995 22:29:29 MST Message-Id: <9501260529.AA25036@zen.khoros.unm.edu> From: steve@khoros.unm.edu (Steven Jorgensen) Date: Wed, 25 Jan 1995 22:29:29 MST X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: questions@FreeBSD.org Subject: Share vs Static library questions content-length: 1418 Sender: questions-owner@FreeBSD.org Precedence: bulk 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/ -------------------------------------------------------------