comparison configure @ 253:5cfe4322c500

- improved support for older OS versions for dynloads dlGetLibraryPath
author Tassilo Philipp
date Mon, 15 May 2017 02:50:03 +0200
parents 700c67984c08
children 7520e2260097
comparison
equal deleted inserted replaced
252:047d2829bdf6 253:5cfe4322c500
61 ;; 61 ;;
62 esac 62 esac
63 done 63 done
64 printf "PREFIX=${PREFIX:=/usr/local}\n" >>$C 64 printf "PREFIX=${PREFIX:=/usr/local}\n" >>$C
65 case ${TARGET:=`uname`} in 65 case ${TARGET:=`uname`} in
66 Linux) 66 Linux|GNU/kFreeBSD)
67 if [ -z "${CFLAGS}" ]; then 67 if [ -z "${CFLAGS}" ]; then
68 printf "CFLAGS=-fPIC\n" >>$C 68 printf "CFLAGS=-fPIC\n" >>$C
69 fi 69 fi
70 printf "LDLIBS=-lm -ldl\n" >>$C 70 printf "LDLIBS=-lm -ldl\n" >>$C
71 ;; 71 ;;
72 OpenBSD) 72 OpenBSD)
73 if [ -z "${CFLAGS}" ]; then
74 # dl_iterate_phdr() got introduced in 3.7, so for older versions force DL_DLADDR_TO_LIBPATH
75 if (uname -r | grep '^\([0-2]\.\|3\.[0-6]\)' > /dev/null); then
76 printf "CFLAGS=-fPIC -DDL_DLADDR_TO_LIBPATH\n" >>$C
77 else
78 printf "CFLAGS=-fPIC\n" >>$C
79 fi
80 fi
73 printf "LDLIBS=-lm\n" >>$C 81 printf "LDLIBS=-lm\n" >>$C
74 ;; 82 ;;
75 DragonFly|NetBSD) 83 NetBSD|DragonFly)
76 if [ -z "${CFLAGS}" ]; then 84 if [ -z "${CFLAGS}" ]; then
77 printf "CFLAGS=-fPIC\n" >>$C 85 printf "CFLAGS=-fPIC\n" >>$C
78 fi 86 fi
79 printf "LDLIBS=-lm\n" >>$C 87 printf "LDLIBS=-lm\n" >>$C
80 ;; 88 ;;
82 if [ -z "${CFLAGS}" ]; then 90 if [ -z "${CFLAGS}" ]; then
83 printf "CFLAGS=-fPIC\n" >>$C 91 printf "CFLAGS=-fPIC\n" >>$C
84 fi 92 fi
85 printf "LDLIBS=-lm\n" >>$C 93 printf "LDLIBS=-lm\n" >>$C
86 printf "RM=rm -f\n" >>$C 94 printf "RM=rm -f\n" >>$C
87 ;;
88 GNU/kFreeBSD)
89 if [ -z "${CFLAGS}" ]; then
90 printf "CFLAGS=-fPIC\n" >>$C
91 fi
92 printf "LDLIBS=-lm -ldl\n" >>$C
93 ;; 95 ;;
94 MacOSX|Darwin) 96 MacOSX|Darwin)
95 # if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended 97 # if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended
96 # to replace ar(5) and ranlib", use it - if it is shadowed by some install of GNU's libtool assume that a foreign environment is 98 # to replace ar(5) and ranlib", use it - if it is shadowed by some install of GNU's libtool assume that a foreign environment is
97 # intentionally used, and fall back to using 'ar rs' (the equivalent to 'libtool -static'), for compatibility: 99 # intentionally used, and fall back to using 'ar rs' (the equivalent to 'libtool -static'), for compatibility:
166 SunOS) 168 SunOS)
167 # open distributions often don't come with default cc and CC, check for common alternatives. 169 # open distributions often don't come with default cc and CC, check for common alternatives.
168 printf "CC=` (which cc gcc clang ) | grep -v '^no ' | head -1`\n" >>$C 170 printf "CC=` (which cc gcc clang ) | grep -v '^no ' | head -1`\n" >>$C
169 printf "CXX=`(which CC g++ clang++) | grep -v '^no ' | head -1`\n" >>$C # C++ compiler traditionally named CC 171 printf "CXX=`(which CC g++ clang++) | grep -v '^no ' | head -1`\n" >>$C # C++ compiler traditionally named CC
170 printf "CCC=\${CXX}\n" >>$C # Sun make's rules use CCC for c++ compiler 172 printf "CCC=\${CXX}\n" >>$C # Sun make's rules use CCC for c++ compiler
171 printf "LDLIBS=-lm\n" >>$C 173 printf "LDLIBS=-lm -ldl\n" >>$C
172 ;; 174 ;;
173 Minix) 175 Minix)
174 printf "CC=gcc\n" >>$C 176 printf "CC=gcc\n" >>$C
175 printf "CXX=g++\n">>$C 177 printf "CXX=g++\n">>$C
176 printf "AR=ar\n" >>$C 178 printf "AR=ar\n" >>$C