483
469
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
484
470
# extensions. An empty string means we don't know how
485
471
# to use shared libraries on this platform.
486
# GRASS_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS
487
# for the build of Tcl and Tk, but not recorded in the
488
# tclConfig.sh, since they are only used for the build
490
# Examples: MacOS X records the library version and
491
# compatibility version in the shared library. But
492
# of course the Tcl version of this is only used for Tcl.
493
# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
494
# in a static or shared library name, using the $LIB_VER variable
495
# to put the version in the right place. This is used
496
# by platforms that need non-standard library names.
497
# Examples: ${LIB_VER}.so.1.1 on NetBSD, since it needs
498
# to have a version after the .so, and ${LIB_VER}.a
499
# on AIX, since a shared library needs to have
500
# a .a extension whereas shared objects for loadable
501
# extensions have a .so extension. Defaults to
502
# ${LIB_VER}${SHLIB_SUFFIX}.
503
# GRASS_NEEDS_EXP_FILE -
504
# 1 means that an export file is needed to link to a
506
# GRASS_EXP_FILE - The name of the installed export / import file which
507
# should be used to link to the Tcl shared library.
508
# Empty if Tcl is unshared.
509
# GRASS_BUILD_EXP_FILE -
510
# The name of the built export / import file which
511
# should be used to link to the Tcl shared library.
512
# Empty if Tcl is unshared.
514
# Libs to use when linking Tcl shell or some other
515
# shell that includes Tcl libs.
517
# Flags used when running the compiler in debug mode
519
# Flags used when running the compiler in optimize mode
522
473
#--------------------------------------------------------------------
524
475
AC_DEFUN([SC_CONFIG_CFLAGS], [
526
# Step 0.a: Enable 64 bit support?
528
AC_MSG_CHECKING([if 64bit support is requested])
529
AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no")
531
if test "$enableval" = "yes"; then
536
AC_MSG_RESULT($do64bit)
538
# Step 0.b: Enable Solaris 64 bit VIS support?
540
AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
541
AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no")
543
if test "$enableval" = "yes"; then
544
# Force 64bit on with VIS
550
AC_MSG_RESULT($do64bitVIS)
552
# Step 1: set the variable "system" to hold the name and version number
553
# for the system. This can usually be done via the "uname" command, but
554
# there are a few systems, like Next, where this doesn't work.
556
AC_MSG_CHECKING([system version (for dynamic loading)])
557
if test -f /usr/lib/NextStep/software_version; then
558
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
560
system=`uname -s`-`uname -r`
561
if test "$?" -ne 0 ; then
562
AC_MSG_RESULT([unknown (can't find uname command)])
565
# Special check for weird MP-RAS system (uname returns weird
566
# results, and the version is kept in special file).
568
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
569
system=MP-RAS-`awk '{print $3}' /etc/.relid`
571
if test "`uname -s`" = "AIX" ; then
572
system=AIX-`uname -v`.`uname -r`
574
AC_MSG_RESULT($system)
578
# Step 2: check for existence of -ldl library. This is needed because
579
# Linux can use either -ldl or -ldld for dynamic loading.
581
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
583
# Require ranlib early so we can override it in special cases below.
585
AC_REQUIRE([AC_PROG_RANLIB])
587
# Step 3: set configuration options based on system name and version.
591
GRASS_EXPORT_FILE_SUFFIX=""
592
UNSHARED_LIB_SUFFIX=""
593
482
GRASS_TRIM_DOTS='`echo ${LIB_VER} | tr -d .`'
594
ECHO_VERSION='`echo ${LIB_VER}`'
595
483
GRASS_LIB_VERSIONS_OK=ok
598
if test "$GCC" = "yes" ; then
599
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
603
GRASS_NEEDS_EXP_FILE=0
604
GRASS_BUILD_EXP_FILE=""
606
dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
607
dnl AC_CHECK_TOOL(AR, ar)
608
AC_CHECK_PROG(AR, ar, ar)
609
if test "${AR}" = "" ; then
610
AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
613
486
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
617
if test "${GRASS_THREADS}" = "1" -a "$GCC" != "yes" ; then
618
# AIX requires the _r compiler when gcc isn't being used
619
if test "${CC}" != "cc_r" ; then
622
AC_MSG_RESULT(Using $CC for compiling with threads)
625
# AIX-5 uses ELF style dynamic libraries
627
# Note: need the LIBS below, otherwise Tk won't find Tcl's
628
# symbols when dynamically loaded into tclsh.
629
SHLIB_LD_LIBS='${LIBS}'
634
LD_LIBRARY_PATH_VAR="LIBPATH"
636
# Check to enable 64-bit flags for compiler/linker
637
if test "$do64bit" = "yes" ; then
638
if test "$GCC" = "yes" ; then
639
AC_MSG_WARN("64bit mode not supported with GCC on $system")
644
RANLIB="${RANLIB} -X64"
646
SHLIB_LD_FLAGS="-b64"
650
if test "`uname -m`" = "ia64" ; then
651
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
652
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
653
# AIX-5 has dl* in libc.so
654
if test "$GCC" = "yes" ; then
655
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
657
CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
659
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
661
#SHLIB_LD="${SRCDIR}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
662
SHLIB_LD="$CC -shared"
663
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
664
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
665
GRASS_NEEDS_EXP_FILE=1
666
GRASS_EXPORT_FILE_SUFFIX='${LIB_VER}.exp'
670
if test "${GRASS_THREADS}" = "1" -a "$GCC" != "yes" ; then
671
# AIX requires the _r compiler when gcc isn't being used
672
if test "${CC}" != "cc_r" ; then
675
AC_MSG_RESULT(Using $CC for compiling with threads)
679
SHLIB_LD_LIBS='${LIBS}'
682
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
683
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
684
LD_LIBRARY_PATH_VAR="LIBPATH"
685
GRASS_NEEDS_EXP_FILE=1
686
GRASS_EXPORT_FILE_SUFFIX='${LIB_VER}.exp'
688
# Check to enable 64-bit flags for compiler/linker
689
if test "$do64bit" = "yes" ; then
690
if test "$GCC" = "yes" ; then
691
AC_MSG_WARN("64bit mode not supported with GCC on $system")
696
RANLIB="${RANLIB} -X64"
698
SHLIB_LD_FLAGS="-b64"
701
#SHLIB_LD="${SRCDIR}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
702
SHLIB_LD="$CC -shared"
704
# On AIX <=v4 systems, libbsd.a has to be linked in to support
705
# non-blocking file IO. This library has to be linked in after
706
# the MATH_LIBS or it breaks the pow() function. The way to
707
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
708
# This library also supplies gettimeofday.
710
# AIX does not have a timezone field in struct tm. When the AIX
711
# bsd library is used, the timezone global and the gettimeofday
712
# methods are to be avoided for timezone deduction instead, we
713
# deduce the timezone by comparing the localtime result on a
716
AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
717
if test $libbsd = yes; then
718
MATH_LIBS="$MATH_LIBS -lbsd"
719
AC_DEFINE(USE_DELTA_FOR_TZ)
724
SHLIB_LD="${CC} -nostart"
725
SHLIB_LD_LIBS='${LIBS}'
729
#-----------------------------------------------------------
730
# Check for inet_ntoa in -lbind, for BeOS (which also needs
731
# -lsocket, even if the network functions are in -lnet which
732
# is always linked to, for compatibility.
733
#-----------------------------------------------------------
734
AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
736
BSD/OS-2.1*|BSD/OS-3*)
739
SHLIB_LD_LIBS='${LIBS}'
746
SHLIB_CFLAGS="-export-dynamic -fPIC"
747
SHLIB_LD="cc -shared"
748
SHLIB_LD_LIBS='${LIBS}'
750
LDFLAGS="-export-dynamic"
755
SHLIB_CFLAGS="-K PIC"
764
# Use updated header definitions where possible
765
AC_DEFINE(_XOPEN_SOURCE) # Use the XOPEN network library
766
AC_DEFINE(_XOPEN_SOURCE_EXTENDED) # Use the XOPEN network library
767
LIBS="$LIBS -lxnet" # Use the XOPEN network library
770
AC_CHECK_LIB(dld, shl_load, shared_ok=yes, shared_ok=no)
771
if test "$shared_ok" = yes; then
774
SHLIB_LD_LIBS='${LIBS}'
776
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
777
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
778
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
781
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
782
#EXTRA_CFLAGS="+DAportable"
784
# Check to enable 64-bit flags for compiler/linker
785
if test "$do64bit" = "yes" ; then
786
if test "$GCC" = "yes" ; then
787
hpux_arch=`gcc -dumpmachine`
790
# 64-bit gcc in use. Fix flags for GNU ld.
792
SHLIB_LD="gcc -shared"
798
AC_MSG_WARN("64bit mode not supported with GCC on $system")
803
if test "`uname -m`" = "ia64" ; then
805
LDFLAGS="+DD64 $LDFLAGS"
807
EXTRA_CFLAGS="+DA2.0W"
808
LDFLAGS="+DA2.0W $LDFLAGS"
813
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
815
AC_CHECK_LIB(dld, shl_load, shared_ok=yes, shared_ok=no)
816
if test "$shared_ok" = yes; then
821
CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
822
LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
823
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
829
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
830
SHLIB_LD_LIBS='${LIBS}'
831
LDFLAGS="-Wl,-D,08000000"
832
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
833
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
834
SHARED_LIB_SUFFIX='${LIB_VER}.a'
838
SHLIB_LD="ld -shared -rdata_shared"
839
SHLIB_LD_LIBS='${LIBS}'
841
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
842
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
848
SHLIB_LD="ld -shared -rdata_shared"
849
SHLIB_LD_LIBS='${LIBS}'
851
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
852
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
854
IRIX-6.*|IRIX64-6.5*)
856
SHLIB_LD="ld -n32 -shared -rdata_shared"
857
SHLIB_LD_LIBS='${LIBS}'
859
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
860
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
861
if test "$GCC" = "yes" ; then
862
EXTRA_CFLAGS="-mabi=n32"
867
# Use to build 6.2 compatible binaries on 6.3.
868
EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
879
SHLIB_LD="ld -n32 -shared -rdata_shared"
880
SHLIB_LD_LIBS='${LIBS}'
883
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
884
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
886
# Check to enable 64-bit flags for compiler/linker
888
if test "$do64bit" = "yes" ; then
889
if test "$GCC" = "yes" ; then
890
AC_MSG_WARN([64bit mode not supported by gcc])
893
SHLIB_LD="ld -64 -shared -rdata_shared"
901
SHLIB_LD_LIBS='${LIBS}'
905
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
906
# when you inline the string and math operations. Turn this off to
907
# get rid of the warnings.
908
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
910
if test "$have_dl" = yes; then
911
SHLIB_LD="${CC} -shared"
912
LDFLAGS="-Wl,--export-dynamic"
913
CC_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR}'
914
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
916
AC_CHECK_HEADER(dld.h, [
917
SHLIB_LD="ld -shared"
922
if test "`uname -m`" = "alpha" ; then
923
EXTRA_CFLAGS="-mieee"
926
# The combo of gcc + glibc has a bug related
927
# to inlining of functions like strtod(). The
928
# -fno-builtin flag should address this problem
929
# but it does not work. The -fno-inline flag
930
# is kind of overkill but it works.
931
# Disable inlining only when one of the
932
# files in compat/*.c is being linked in.
933
if test x"${USE_COMPAT}" != x ; then
934
EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
937
# XIM peeking works under XFree86.
938
AC_DEFINE(PEEK_XCLOSEIM)
943
SHLIB_LD_LIBS='${LIBS}'
946
if test "$have_dl" = yes; then
947
SHLIB_LD="${CC} -shared"
948
LDFLAGS="-Wl,--export-dynamic"
952
AC_CHECK_HEADER(dld.h, [
953
SHLIB_LD="ld -shared"
958
if test "`uname -m`" = "alpha" ; then
959
EXTRA_CFLAGS="-mieee"
964
SHLIB_LD_LIBS='${LIBS}'
489
*-linux-* | *-gnu* | *-kfreebsd*-gnu)
493
SHLIB_LD="${CC} -shared"
494
LDFLAGS="-Wl,--export-dynamic"
495
LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR}'
496
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
965
499
SHLIB_SUFFIX=".dll"
967
500
SHLIB_LD="${CC} -shared"
968
501
LDFLAGS="-Wl,--export-dynamic"
971
502
LD_LIBRARY_PATH_VAR="PATH"
975
SHLIB_LD_LIBS='${LIBS}'
504
*-pc-mingw32 | *-pc-msys)
976
505
SHLIB_SUFFIX=".dll"
978
506
SHLIB_LD="${CC} -shared"
979
507
LDFLAGS="-Wl,--export-dynamic,--enable-runtime-pseudo-reloc"
982
508
LD_LIBRARY_PATH_VAR="PATH"
985
SHLIB_CFLAGS="-K PIC"
994
SHLIB_CFLAGS="-K PIC"
998
LDFLAGS="-Wl,-Bexport"
511
SHLIB_CFLAGS="-fno-common"
512
SHLIB_SUFFIX=".dylib"
513
SHLIB_LD="cc -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}"
514
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
517
# Note: If _REENTRANT isn't defined, then Solaris
518
# won't define thread-safe library routines.
519
AC_DEFINE(_REENTRANT)
520
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
521
# Note: need the LIBS below, otherwise Tk won't find Tcl's
522
# symbols when dynamically loaded into tclsh.
523
if test "$GCC" = "yes" ; then
525
SHLIB_LD="$CC -shared"
526
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
529
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
530
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
533
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
536
# Note: Solaris is as of 2010 Oracle Solaris, not Sun Solaris
537
# Oracle Solaris derives from Solaris 2
538
# derives from SunOS 5
539
# derives from UNIX System V Release 4
540
# Note: If _REENTRANT isn't defined, then Solaris
541
# won't define thread-safe library routines.
542
AC_DEFINE(_REENTRANT)
543
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
544
# Note: need the LIBS below, otherwise Tk won't find Tcl's
545
# symbols when dynamically loaded into tclsh.
546
if test "$GCC" = "yes" ; then
548
SHLIB_LD="$CC -shared"
549
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
552
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
553
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
556
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
559
# NOTE: only FreeBSD 4+ is supported
560
# FreeBSD 3.* and greater have ELF.
562
#SHLIB_LD="ld -Bshareable -x"
563
SHLIB_LD="${CC} -shared"
565
LDFLAGS="-export-dynamic"
566
#LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
567
LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR}'
568
# TODO: add optional pthread support with any combination of:
569
# CFLAGS="$CFLAGS -pthread"
570
# LDFLAGS="$LDFLAGS -lpthread"
571
# AC_DEFINE(_REENTRANT)
572
# AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1003
575
# NetBSD has ELF.
1004
576
SHLIB_CFLAGS="-fPIC"
1005
SHLIB_LD="ld -Bshareable -x"
577
SHLIB_LD="${CC} -shared"
1006
578
SHLIB_LD_LIBS="${LIBS}"
1008
579
LDFLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic'
1009
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1010
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1011
if test "${GRASS_THREADS}" = "1" ; then
1012
# The -pthread needs to go in the CFLAGS, not LIBS
1013
LIBS=`echo $LIBS | sed s/-pthread//`
1014
EXTRA_CFLAGS="-pthread"
1015
LDFLAGS="$LDFLAGS -pthread"
1017
# NetBSD doesn't handle version numbers with dots.
1018
UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1019
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so',
1020
GRASS_LIB_VERSIONS_OK=nodots
1023
SHLIB_LD="${CC} -shared"
1024
SHLIB_LD_LIBS='${LIBS}'
1029
AC_MSG_CHECKING(for ELF)
1036
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'],
1038
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0']
1041
# OpenBSD doesn't do version numbers with dots.
1042
UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1043
GRASS_LIB_VERSIONS_OK=nodots
1046
# Not available on all versions: check for include file.
1047
AC_CHECK_HEADER(dlfcn.h, [
1048
SHLIB_CFLAGS="-fPIC"
1049
SHLIB_LD="ld -Bshareable -x"
1053
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1054
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
1055
AC_MSG_CHECKING(for ELF)
1062
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so',
1064
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
1068
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
1069
SHLIB_LD_LIBS='${LIBS}'
1072
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1073
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1074
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1076
UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1077
GRASS_LIB_VERSIONS_OK=nodots
1080
# FreeBSD 3.* and greater have ELF.
1081
SHLIB_CFLAGS="-fPIC"
1082
SHLIB_LD="ld -Bshareable -x"
1083
SHLIB_LD_LIBS='${LIBS}'
1085
LDFLAGS="-export-dynamic"
1086
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1087
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
1088
if test "${GRASS_THREADS}" = "1" ; then
1089
# The -pthread needs to go in the CFLAGS, not LIBS
1090
LIBS=`echo $LIBS | sed s/-pthread//`
1091
EXTRA_CFLAGS="-pthread"
1092
LDFLAGS="$LDFLAGS -pthread"
1096
# FreeBSD-3 doesn't handle version numbers with dots.
1097
UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1098
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so'
1099
GRASS_LIB_VERSIONS_OK=nodots
1103
Rhapsody-*|Darwin-*)
1104
SHLIB_CFLAGS="-fno-common"
1105
SHLIB_LD="cc -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}"
1106
GRASS_SHLIB_LD_EXTRAS=""
1107
SHLIB_LD_LIBS='${LIBS}'
1108
SHLIB_SUFFIX=".dylib"
1112
CFLAGS_OPTIMIZE="-Os"
1113
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
1114
# for compatibility with autoconf vers 2.13 :
1121
SHLIB_LD="cc -nostdlib -r"
1129
CFLAGS_OPTIMIZE="" # Optimizer is buggy
1130
AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
1132
OSF1-1.0|OSF1-1.1|OSF1-1.2)
1133
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
1135
# Hack: make package name same as library name
1136
SHLIB_LD='ld -R -export $@:'
1144
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
1145
SHLIB_CFLAGS="-fPIC"
1146
if test "$SHARED_BUILD" = "1" ; then
1147
SHLIB_LD="ld -shared"
1149
SHLIB_LD="ld -non_shared"
1160
if test "$SHARED_BUILD" = "1" ; then
1161
SHLIB_LD='ld -shared -expect_unresolved "*"'
1163
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
1168
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1169
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
1170
if test "$GCC" = "yes" ; then
1171
EXTRA_CFLAGS="-mieee"
1173
EXTRA_CFLAGS="-DHAVE_TZSET -std1 -ieee"
1175
# see pthread_intro(3) for pthread support on osf1, k.furukawa
1176
if test "${GRASS_THREADS}" = "1" ; then
1177
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
1178
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DGRASS_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
1179
LIBS=`echo $LIBS | sed s/-lpthreads//`
1180
if test "$GCC" = "yes" ; then
1181
LIBS="$LIBS -lpthread -lmach -lexc"
1183
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
1191
# This may work for all QNX, but it was only reported for v6.
1192
SHLIB_CFLAGS="-fPIC"
1193
SHLIB_LD="ld -Bshareable -x"
1202
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
1203
SHLIB_LD_LIBS='${LIBS}'
1205
LDFLAGS="-Wl,-D,08000000"
1206
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1207
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1210
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
1211
# this test works, since "uname -s" was non-standard in 3.2.4 and
1213
if test "$GCC" = "yes" ; then
1214
SHLIB_CFLAGS="-fPIC -melf"
1215
LDFLAGS="-melf -Wl,-Bexport"
1217
SHLIB_CFLAGS="-Kpic -belf"
1218
LDFLAGS="-belf -Wl,-Bexport"
1227
SHLIB_CFLAGS="-K PIC"
1241
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1242
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1244
# SunOS can't handle version numbers with dots in them in library
1245
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
1246
# requires an extra version number at the end of .so file names.
1247
# So, the library has to have a name like libtcl75.so.1.0
1249
SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
1250
UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
1251
GRASS_LIB_VERSIONS_OK=nodots
1255
# Note: If _REENTRANT isn't defined, then Solaris
1256
# won't define thread-safe library routines.
1258
AC_DEFINE(_REENTRANT)
1259
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1261
# Note: need the LIBS below, otherwise Tk won't find Tcl's
1262
# symbols when dynamically loaded into tclsh.
1264
SHLIB_LD_LIBS='${LIBS}'
1267
if test "$GCC" = "yes" ; then
1268
SHLIB_CFLAGS="-fPIC"
1269
SHLIB_LD="$CC -shared"
1270
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1271
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1273
SHLIB_CFLAGS="-KPIC"
1274
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1275
CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1276
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1281
# Note: If _REENTRANT isn't defined, then Solaris
1282
# won't define thread-safe library routines.
1284
AC_DEFINE(_REENTRANT)
1285
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
1289
# Check to enable 64-bit flags for compiler/linker
1290
if test "$do64bit" = "yes" ; then
1292
if test "$arch" = "sparcv9 sparc" ; then
1293
if test "$GCC" = "yes" ; then
1294
AC_MSG_WARN("64bit mode not supported with GCC on $system")
1296
SHLIB_CFLAGS="-KPIC"
1298
if test "$do64bitVIS" = "yes" ; then
1299
EXTRA_CFLAGS="-xarch=v9a"
1300
LDFLAGS="-xarch=v9a"
1302
EXTRA_CFLAGS="-xarch=v9"
1307
AC_MSG_WARN("64bit mode only supported sparcv9 system")
1311
# Note: need the LIBS below, otherwise Tk won't find Tcl's
1312
# symbols when dynamically loaded into tclsh.
1314
SHLIB_LD_LIBS='${LIBS}'
1316
if test "$GCC" = "yes" ; then
1317
SHLIB_CFLAGS="-fPIC"
1318
SHLIB_LD="$CC -shared"
1319
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1320
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1322
SHLIB_CFLAGS="-KPIC"
1323
SHLIB_LD="CC -G -z text"
1324
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1325
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1331
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
1332
SHLIB_LD_LIBS='${LIBS}'
1333
LDFLAGS="-Wl,-D,08000000"
1334
CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1335
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1336
if test "$GCC" != "yes" ; then
1337
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
1340
UNIX_SV* | UnixWare-5*)
1341
SHLIB_CFLAGS="-KPIC"
1345
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
1346
# that don't grok the -Bexport option. Test that it does.
1347
hold_ldflags=$LDFLAGS
1348
AC_MSG_CHECKING(for ld accepts -Bexport flag)
1349
LDFLAGS="${LDFLAGS} -Wl,-Bexport"
1350
AC_TRY_LINK(, [int i;], found=yes, found=no)
1351
LDFLAGS=$hold_ldflags
1352
AC_MSG_RESULT($found)
1353
if test $found = yes; then
1354
LDFLAGS="-Wl,-Bexport"
580
SHLIB_LD_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic'
581
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -L${LIB_RUNTIME_DIR}'
582
# some older NetBSD versions do not handle version numbers with dots.
583
#STLIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
584
#SHLIB_SUFFIX='${GRASS_TRIM_DOTS}.so'
585
#GRASS_LIB_VERSIONS_OK=nodots
586
# NetBSD 6 does handle version numbers with dots.
589
# TODO: add optional pthread support with any combination of:
590
# CFLAGS="$CFLAGS -pthread"
591
# LDFLAGS="$LDFLAGS -lpthread"
592
# AC_DEFINE(_REENTRANT)
593
# AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
596
# NOTE: do we need to support aix < 6 ?
600
if test "$GCC" = "yes" ; then
602
SHLIB_LD="$CC -shared"
603
LD_SEARCH_FLAGS='-Wl,-bsvr4,-R,${LIB_RUNTIME_DIR}'
606
SHLIB_CFLAGS="-qmkshrobj"
607
SHLIB_LD="$CC -shared"
608
LD_SEARCH_FLAGS='-Wl,-bsvr4,-R,${LIB_RUNTIME_DIR}'
611
LD_LIBRARY_PATH_VAR="LIBPATH"
612
GRASS_NEEDS_EXP_FILE=1
613
GRASS_EXPORT_FILE_SUFFIX='${LIB_VER}.exp'
616
AC_MSG_ERROR([***Unknown platform: $host***])
1363
# If we're running gcc, then change the C flags for compiling shared
1364
# libraries to the right flags for gcc, instead of those for the
1365
# standard manufacturer compiler.
1367
if test "$GCC" = "yes" ; then
1377
Rhapsody-*|Darwin-*)
1386
SHLIB_CFLAGS="-fPIC"
1391
if test "$SHARED_LIB_SUFFIX" = "" ; then
1392
SHARED_LIB_SUFFIX='${LIB_VER}${SHLIB_SUFFIX}'
1394
if test "$UNSHARED_LIB_SUFFIX" = "" ; then
1395
UNSHARED_LIB_SUFFIX='${LIB_VER}.a'
1398
if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
1399
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
1400
MAKE_LIB='${SHLIB_LD} -o [$]@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${GRASS_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
1401
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
1403
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
1405
if test "$RANLIB" = "" ; then
1406
MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}'
1407
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
1409
MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@'
1410
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
1413
dnl Not at all clear what this was doing in Tcl's configure.in
1414
dnl or why it was needed was needed. In any event, this sort of
1415
dnl things needs to be done in the big loop above.
1416
dnl REMOVE THIS BLOCK LATER! (mdejong)
1423
dnl SHLIB_LD_LIBS=""
1429
# Stub lib does not depend on shared/static configuration
1430
if test "$RANLIB" = "" ; then
1431
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}'
1432
INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
1434
MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@'
1435
INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
1440
AC_SUBST(CFLAGS_DEBUG)
1441
AC_SUBST(CFLAGS_OPTIMIZE)
1442
AC_SUBST(CFLAGS_WARNING)
1443
AC_SUBST(EXTRA_CFLAGS)
1445
620
AC_SUBST(LDFLAGS)
1446
AC_SUBST(LDFLAGS_DEBUG)
1447
AC_SUBST(LDFLAGS_OPTIMIZE)
1448
AC_SUBST(CC_SEARCH_FLAGS)
1449
621
AC_SUBST(LD_SEARCH_FLAGS)
1450
622
AC_SUBST(LD_LIBRARY_PATH_VAR)
1453
624
AC_SUBST(SHLIB_LD)
1454
AC_SUBST(GRASS_SHLIB_LD_EXTRAS)
1455
625
AC_SUBST(SHLIB_LD_FLAGS)
1456
AC_SUBST(SHLIB_LD_LIBS)
1457
626
AC_SUBST(SHLIB_CFLAGS)
1458
627
AC_SUBST(SHLIB_SUFFIX)
1461
AC_SUBST(MAKE_STUB_LIB)
1462
AC_SUBST(INSTALL_LIB)
1463
AC_SUBST(INSTALL_STUB_LIB)
630
AC_SUBST(STLIB_SUFFIX)