* shlib.conf: Fix hpux to deal with building shared libs with gcc.
authorTom Yu <tlyu@mit.edu>
Wed, 9 Jan 2002 00:46:52 +0000 (00:46 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 9 Jan 2002 00:46:52 +0000 (00:46 +0000)
Patch from Doug Engert; fixes krb5-build/1021.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14096 dc483132-0cff-0310-8789-dd5450dbe970

src/config/ChangeLog
src/config/shlib.conf

index 2f6902d99fffec81ae7084a4d70e3fc9089b9248..1cd7396d9f5e4f26b35bcbbf71f78c34873ca508 100644 (file)
@@ -5,6 +5,11 @@
 
        * libobj.in (config.status): Depend on shlib.conf.
 
+2001-12-18  Tom Yu  <tlyu@mit.edu>
+
+       * shlib.conf: Fix hpux to deal with building shared libs with gcc.
+       Patch from Doug Engert; fixes krb5-build/1021.
+
 2001-10-20  Ken Raeburn  <raeburn@mit.edu>
 
        * post.in (DEPLIBOBJNAMEFIX): New variable.
index 2b94ad77cc9d360bdba8c64210c26acbca489bcc..d730d69a7da18446655e5bfff3c3b1a7cf1fe37f 100644 (file)
@@ -50,13 +50,22 @@ alpha*-dec-osf*)
 # (compiled-in or SHLIB_PATH) will be searched first.
 #
 *-*-hpux*)
-       PICFLAGS=+z
+       if test "$krb5_cv_prog_gcc" = yes; then
+               PICFLAGS=-fPIC
+       else
+               PICFLAGS=+z
+       fi
        INSTALL_SHLIB='$(INSTALL)'
        SHLIBEXT=.sl
        SHLIBVEXT='.$(LIBMAJOR).$(LIBMINOR)'
        SHLIBSEXT='.$(LIBMAJOR)'
-       SHLIB_EXPFLAGS='+s +b $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       LDCOMBINE='ld -b +h lib$(LIB)$(SHLIBSEXT)'
+       if test "$krb5_cv_prog_gcc" = yes; then
+               SHLIB_EXPFLAGS='-Wl,+s -Wl,+b,$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
+               LDCOMBINE='gcc -fPIC -shared -Wl,+h,lib$(LIB)$(SHLIBSEXT)'
+       else
+               SHLIB_EXPFLAGS='+s +b $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
+               LDCOMBINE='ld -b +h lib$(LIB)$(SHLIBSEXT)'
+       fi
        CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,+s -Wl,+b,$(PROG_RPATH)'
        CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
        RUN_ENV='SHLIB_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export SHLIB_PATH;'