aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet1996-11-04 12:53:03 +0000
committerlecoanet1996-11-04 12:53:03 +0000
commit541a86f7465039751b751ecfb022caf558ef4429 (patch)
tree4dfea26f409bfff6ef06ea750b0abd2ce00bfef2
parentb6c7be865adfbdb51525d4b82055263206351ed4 (diff)
downloadtkzinc-541a86f7465039751b751ecfb022caf558ef4429.zip
tkzinc-541a86f7465039751b751ecfb022caf558ef4429.tar.gz
tkzinc-541a86f7465039751b751ecfb022caf558ef4429.tar.bz2
tkzinc-541a86f7465039751b751ecfb022caf558ef4429.tar.xz
Macros autoconf du module
-rw-r--r--acaux.m481
1 files changed, 81 insertions, 0 deletions
diff --git a/acaux.m4 b/acaux.m4
new file mode 100644
index 0000000..906b50b
--- /dev/null
+++ b/acaux.m4
@@ -0,0 +1,81 @@
+# -*- 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
+])