Compile and link liarc objects as shared with no fatal warnings.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 8 Jan 2019 06:28:02 +0000 (06:28 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 9 Jan 2019 03:56:35 +0000 (03:56 +0000)
src/microcode/configure.ac
src/microcode/liarc-cc.in
src/microcode/liarc-ld.in

index 18c2288e8438b104ce9cafda2d815baee1ffe684..ed078bc93838ed607c42beb9182e190a5514400e 100644 (file)
@@ -162,6 +162,9 @@ OPTIONAL_SOURCES=
 OPTIONAL_OBJECTS=
 SCHEME_DEFS=-DMIT_SCHEME
 SCHEME_LDFLAGS=
+LIARC_CFLAGS=
+LIARC_LDFLAGS=
+LIARC_LOADER='${SCHEME_EXE}'
 LIARC_VARS=/dev/null
 LIARC_RULES=/dev/null
 AUX_PROGRAMS=
@@ -216,6 +219,7 @@ if test x"${GCC}" = xyes; then
        LDFLAGS="${LDFLAGS} -g"
     fi
     CFLAGS_WERROR=-Werror
+    CFLAGS_WNOERROR=-Wno-error
 
     for flag in \
        -frounding-math \
@@ -355,6 +359,7 @@ darwin*)
     CFLAGS="${CFLAGS} ${MACOS_CFLAGS}"
     LDFLAGS="${LDFLAGS} ${MACOS_CFLAGS} -Wl,-syslibroot,${MACOS_SYSROOT}"
     LDFLAGS="${LDFLAGS} -framework CoreFoundation"
+    LIARC_LDFLAGS="${LIARC_LDFLAGS} -bundle -bundle_loader ${LIARC_LOADER}"
     AUX_PROGRAMS="${AUX_PROGRAMS} macosx-starter"
     ;;
 netbsd*)
@@ -380,6 +385,8 @@ if test "${DO_GCC_TESTS}" = yes; then
     if test "${GNU_LD}" = yes; then
        SCHEME_LDFLAGS="${SCHEME_LDFLAGS} -Wl,-export-dynamic"
     fi
+    LIARC_CFLAGS="${LIARC_CFLAGS} -fPIC"
+    LIARC_LDFLAGS="${LIARC_LDFLAGS} -shared -fPIC"
     AC_MSG_CHECKING([for ELF binaries])
     AC_EGREP_CPP([yes],
        [
@@ -900,6 +907,7 @@ for base in ${OPTIONAL_BASES}; do
 done
 
 CFLAGS="${CFLAGS} ${CFLAGS_WERROR}"
+LIARC_CFLAGS="${LIARC_CFLAGS} ${CFLAGS_WNOERROR}"
 
 AC_SUBST([AS_FLAGS])
 AC_SUBST([GC_HEAD_FILES])
@@ -909,6 +917,9 @@ AC_SUBST([OPTIONAL_SOURCES])
 AC_SUBST([OPTIONAL_OBJECTS])
 AC_SUBST([SCHEME_DEFS])
 AC_SUBST([SCHEME_LDFLAGS])
+AC_SUBST([LIARC_CFLAGS])
+AC_SUBST([LIARC_LDFLAGS])
+AC_SUBST([LIARC_LOADER])
 AC_SUBST_FILE([LIARC_VARS])
 AC_SUBST_FILE([LIARC_RULES])
 AC_SUBST([AUX_PROGRAMS])
index f23342dc97927431031e0d9c1464eaa1fc9983ea..117294fa13bf73ce39f49411085180ee38aae850 100755 (executable)
@@ -35,7 +35,7 @@ shift
 IN=${1}
 shift
 
-CMD="@CC@ @DEFS@ @SCHEME_DEFS@ @CPPFLAGS@ @CFLAGS@"
+CMD="@CC@ @DEFS@ @SCHEME_DEFS@ @CPPFLAGS@ @CFLAGS@ @LIARC_CFLAGS@"
 CMD="${CMD} ${@} -o ${OUT} -c ${IN}"
 echo "${CMD}"
 eval "${CMD}"
index 1a3edc9e5b6f5ced3df9f9575ca72f97a6962db8..17699f162a4593226713a9e0c655f5620de6fedf 100644 (file)
@@ -35,6 +35,6 @@ shift
 
 SCHEME_EXE=`dirname ${0}`/scheme
 
-CMD="@CCLD@ @LDFLAGS@ -o ${OUT} ${@}"
+CMD="@CCLD@ @LDFLAGS@ @LIARC_LDFLAGS@ -o ${OUT} ${@}"
 echo "${CMD}"
 eval "${CMD}"