mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 19:52:20 +00:00
Eliminate LDFLAGS hack to compile on certain OSs
Instead, we now link to the libm system math library where needed by adding -lm to the relevant compile commands in the Mamfiles. This is not needed on every system but never does any harm. (This adds more custom edits to the Mamfiles, which were originally generated from the nmake Makefiles. This takes us further from restoring nmake, but that already wasn't going to happen anyway, due to its many problems... the path forward will be to translate the Mamfiles to some other, current make system such as GNU make.) bin/package, src/cmd/INIT/package.sh: - Remove LDFLAGS=-lm hack for DragonFly BSD, NetBSD and Solaris. src/cmd/builtin/Mamfile, src/cmd/ksh93/Mamfile, src/lib/libdll/Mamfile: - Add -lm where linking failed on any of the three mentioned OSs. src/lib/libdll/features/dll: - In the output test program, add missing #include <math.h>, fixing unknown identifier errors on NetBSD (ldexp, ldexpl). src/cmd/builtin/features/pty: - Add missing #include <stdio.h> to make printf work on all systems (this is just a feature test, no need to bother with sfio here). src/lib/libast/features/stdio: - Undef __FILE_T to avoid interference from system headers on QNX. (There are still other problems preventing a build on QNX 6.5.0. The shipped version of gcc seems to be broken.)
This commit is contained in:
parent
5f6371f078
commit
dd0d03b973
8 changed files with 7 additions and 30 deletions
13
bin/package
13
bin/package
|
@ -1405,19 +1405,6 @@ case $ksh_relflags in
|
||||||
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
|
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Hack to build on some systems that need an explicit link with libm due to a bug in the build system
|
|
||||||
case `uname` in
|
|
||||||
NetBSD | SunOS | DragonFly)
|
|
||||||
case " $LDFLAGS " in
|
|
||||||
*" -m "*)
|
|
||||||
;;
|
|
||||||
*) LDFLAGS="-lm${LDFLAGS:+ $LDFLAGS}"
|
|
||||||
export LDFLAGS
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# grab action specific args
|
# grab action specific args
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
|
|
|
@ -1404,19 +1404,6 @@ case $ksh_relflags in
|
||||||
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
|
assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Hack to build on some systems that need an explicit link with libm due to a bug in the build system
|
|
||||||
case `uname` in
|
|
||||||
NetBSD | SunOS | DragonFly)
|
|
||||||
case " $LDFLAGS " in
|
|
||||||
*" -m "*)
|
|
||||||
;;
|
|
||||||
*) LDFLAGS="-lm${LDFLAGS:+ $LDFLAGS}"
|
|
||||||
export LDFLAGS
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# grab action specific args
|
# grab action specific args
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
|
|
|
@ -56,7 +56,7 @@ make FEATURE/pty implicit
|
||||||
meta FEATURE/pty features/%>FEATURE/% features/pty pty
|
meta FEATURE/pty features/%>FEATURE/% features/pty pty
|
||||||
make features/pty
|
make features/pty
|
||||||
done features/pty
|
done features/pty
|
||||||
exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
|
exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
|
||||||
done FEATURE/pty generated
|
done FEATURE/pty generated
|
||||||
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
|
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
|
||||||
done ${PACKAGE_ast_INCLUDE}/ast_time.h
|
done ${PACKAGE_ast_INCLUDE}/ast_time.h
|
||||||
|
@ -77,7 +77,7 @@ exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCL
|
||||||
done pty.o generated
|
done pty.o generated
|
||||||
bind -lutil dontcare
|
bind -lutil dontcare
|
||||||
setv CMD_STANDALONE -DCMD_STANDALONE="b_pty"
|
setv CMD_STANDALONE -DCMD_STANDALONE="b_pty"
|
||||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd}
|
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd}
|
||||||
done pty generated
|
done pty generated
|
||||||
make ${INSTALLROOT}/bin
|
make ${INSTALLROOT}/bin
|
||||||
exec - if silent test ! -d ${INSTALLROOT}/bin
|
exec - if silent test ! -d ${INSTALLROOT}/bin
|
||||||
|
|
|
@ -13,6 +13,7 @@ lib openpty,_getpty,ptsname -lutil
|
||||||
lib grantpt,unlockpt,posix_openpt stdlib.h
|
lib grantpt,unlockpt,posix_openpt stdlib.h
|
||||||
|
|
||||||
tst - output{
|
tst - output{
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#if _lib_ptsname && _npt_ptsname
|
#if _lib_ptsname && _npt_ptsname
|
||||||
|
|
|
@ -1364,7 +1364,7 @@ prev +li
|
||||||
prev ${mam_libsocket}
|
prev ${mam_libsocket}
|
||||||
prev ${mam_libsecdb}
|
prev ${mam_libsecdb}
|
||||||
setv CC.DLL -UCC.DLL
|
setv CC.DLL -UCC.DLL
|
||||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast}
|
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast}
|
||||||
done suid_exec generated
|
done suid_exec generated
|
||||||
make shell
|
make shell
|
||||||
prev libshell.a archive
|
prev libshell.a archive
|
||||||
|
|
|
@ -15,6 +15,7 @@ cat{
|
||||||
|
|
||||||
#undef FILE
|
#undef FILE
|
||||||
#undef _FILE
|
#undef _FILE
|
||||||
|
#undef __FILE_T
|
||||||
#undef fpos_t
|
#undef fpos_t
|
||||||
#undef fpos64_t
|
#undef fpos64_t
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ make features/dll
|
||||||
done features/dll
|
done features/dll
|
||||||
bind -ldl dontcare
|
bind -ldl dontcare
|
||||||
bind -last
|
bind -last
|
||||||
exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll
|
exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll
|
||||||
done FEATURE/dll generated
|
done FEATURE/dll generated
|
||||||
exec - cmp 2>/dev/null -s FEATURE/dll dlldefs.h || { rm -f dlldefs.h; silent test -d . || mkdir .; cp FEATURE/dll dlldefs.h; }
|
exec - cmp 2>/dev/null -s FEATURE/dll dlldefs.h || { rm -f dlldefs.h; silent test -d . || mkdir .; cp FEATURE/dll dlldefs.h; }
|
||||||
done dlldefs.h generated
|
done dlldefs.h generated
|
||||||
|
|
|
@ -75,6 +75,7 @@ tst run{
|
||||||
echo "#define _DLL_NEXT_PATH \"$lib\""
|
echo "#define _DLL_NEXT_PATH \"$lib\""
|
||||||
}end
|
}end
|
||||||
tst - output{
|
tst - output{
|
||||||
|
#include <math.h>
|
||||||
#if defined(__MVS__) && !defined(__SUSV3)
|
#if defined(__MVS__) && !defined(__SUSV3)
|
||||||
#define __SUSV3 1
|
#define __SUSV3 1
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue