# -*- ksh -*- # See also perl 5. AC_DEFUN(AC_SYS_SHAREDLIB, [AC_REQUIRE([AC_PROG_CC])dnl AC_MSG_CHECKING(for shared library support) sharedlib_extension=so # right for almost everything sharedlib_suffix='.$(sharedlib_version)' sharedlib_cflags= sharedlib_buildflags= sharedlib_buildflags_gcc= sharedlib_linkflags= sharedlib_linkflags_gcc= sharedlib_postinstall= # We'll be changing some settings if gcc, below, # but let's do the uname patterns only once. case `(uname -a 2>&1) 2>/dev/null` in FreeBSD*) # xx right uname? # xx really need -DPIC in cflags? # xx extension must be .so? sharedlib_buildflags_gcc=-Wl,-Bshareable # xx must run ld? ;; HP-UX*) sharedlib_extension=sl sharedlib_suffix= sharedlib_cflags=+z sharedlib_buildflags=-Wl,-b # xx must run ld? sharedlib_postinstall="chmod a+x" ;; IRIX*) sharedlib_buildflags='-shared -no_unresolved \ -set_version sgi$(sharedlib_version) -soname $(sharedlib)' sharedlib_linkflags='-rpath $(libdir)' sharedlib_linkflags_gcc='-Wl,-rpath,$(libdir)' ;; Linux*) # sharedlib_buildflags_gcc='-shared -Wl,-soname,$(sharedlib)' sharedlib_postinstall='ldconfig #' sharedlib_linkflags='-Wl,-rpath,$(libdir)' ;; OSF1*) # xx run ld? link with -lc? # version stuff not right, since old versions should also be # passed to -set_version. sharedlib_buildflags='-Wl,shared -set_version $(sharedlib_version)' sharedlib_linkflags='-Wl,-rpath,$(libdir)' ;; SunOS*4.*) sharedlib_cflags=-PIC sharedlib_linkflags='-L$(libdir)' ;; SunOS*5.*) sharedlib_cflags="-K pic" sharedlib_buildflags='-G -z text -h $(sharedlib)' sharedlib_linkflags='-R$(libdir)' ;; esac # If GCC, things are usually simpler. if test "$GCC" = yes; then sharedlib_cflags=-fPIC # should we ever use -fpic? if test -n "$sharedlib_buildflags_gcc"; then sharedlib_buildflags=$sharedlib_buildflags_gcc else sharedlib_buildflags=-shared fi if test -n "$sharedlib_linkflags_gcc"; then sharedlib_linkflags=$sharedlib_linkflags_gcc fi fi test -z "$sharedlib_postinstall" && sharedlib_postinstall=: AC_MSG_RESULT($sharedlib_cflags/$sharedlib_buildflags/$sharedlib_linkflags) AC_SUBST(sharedlib_extension)dnl AC_SUBST(sharedlib_suffix)dnl AC_SUBST(sharedlib_cflags)dnl AC_SUBST(sharedlib_buildflags)dnl AC_SUBST(sharedlib_linkflags)dnl AC_SUBST(sharedlib_postinstall)dnl ])