From a8acadcb5f0ab2e07d792a6926711034eac42197 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 23 Jan 2022 00:07:22 +0100 Subject: [PATCH] WIP: change gac to not use libtool --- Makefile.rules | 265 ++++++++++++++++++++++++++++++-------------- cnf/gac.in | 57 +++------- configure.ac | 1 - etc/Makefile.gappkg | 16 +-- 4 files changed, 207 insertions(+), 132 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index 150bc6af096..734c8b098a8 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -20,6 +20,18 @@ all: gap$(EXEEXT) gac libgap.la CITATION doc/versiondata default: all .PHONY: default +# GAP_BIN_DIR is either the directory in which GAP is built (if GAP is +# not yet installed), or else the directory into which the `gap` executable, +# the `gac` script and `sysinfo.gap` are installed +# containing `sysinfo.gap` +GAP_BIN_DIR = $(abs_builddir) + +# GAP_LIBRARY_DIR is the directory which contains the GAP library code, i.e., the +# directories `doc`, `grp`, `lib` (the one with *.gd and *.gi files, not the +# one containing shared libraries and such) +GAP_LIBRARY_DIR = $(abs_srcdir) +GAP_LIBRARY_DIR_INSTALLED = $(datarootdir)/gap + ######################################################################## # Source files @@ -153,31 +165,39 @@ SOURCES_ALL += src/compstat_empty.c # GAP_CPPFLAGS is for the GAP build system, while GAP_PKG_CPPFLAGS is # for use by gac, and for package build systems. The latter does not # contain warning flags, and uses absolute include paths. +# Finally, GAP_INSTALL_CPPFLAGS is like GAP_PKG_CPPFLAGS but is what +# is put into sysinfo.gap by `make install`. ######################################################################## -GAP_CPPFLAGS = -GAP_PKG_CPPFLAGS = +# Common flags: user provided flags plus GAP_DEFINES (from autoconf, contains -D flags) +GAP_COMMON_CPPFLAGS = $(GAP_DEFINES) $(CPPFLAGS) + +# Add common flags +GAP_CPPFLAGS = $(GAP_COMMON_CPPFLAGS) +GAP_PKG_CPPFLAGS = $(GAP_COMMON_CPPFLAGS) +GAP_INSTALL_CPPFLAGS = $(GAP_COMMON_CPPFLAGS) -# First add include paths +# Add include paths # The "build/" directory contains generated header files and thus is # placed into the list of include directories. +# When GAP is installed, this is merged into the $includedir GAP_CPPFLAGS += -I$(builddir)/build GAP_PKG_CPPFLAGS += -I$(abs_builddir)/build # The other source files are relative to the srcdir GAP_CPPFLAGS += -I$(srcdir)/src GAP_PKG_CPPFLAGS += -I$(abs_srcdir)/src +GAP_INSTALL_CPPFLAGS += -I${includedir}/gap # For backwards compatibility with certain packages and their kernel -# extensions, also add the root of the srcdir to the package CPPFLAGS +# extensions, also add the root of the srcdir to the package CPPFLAGS. When +# GAP is installed, this is instead achieved by a symlink named `src` inside +# ${includedir}/gap which points pack to its parent. GAP_PKG_CPPFLAGS += -I$(abs_srcdir) -# Add GAP_DEFINES (from autoconf, contains -D flags) -GAP_CPPFLAGS += $(GAP_DEFINES) -GAP_PKG_CPPFLAGS += $(GAP_DEFINES) -# Add flags for dependencies +# Add flags for build dependencies GAP_CPPFLAGS += $(GMP_CPPFLAGS) GAP_CPPFLAGS += $(ZLIB_CPPFLAGS) GAP_CPPFLAGS += $(READLINE_CPPFLAGS) @@ -185,16 +205,6 @@ GAP_CPPFLAGS += $(JULIA_CPPFLAGS) GAP_CPPFLAGS += $(BOEHM_GC_CPPFLAGS) GAP_CPPFLAGS += $(LIBATOMIC_OPS_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(GMP_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(ZLIB_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(READLINE_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(JULIA_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(BOEHM_GC_CPPFLAGS) -GAP_PKG_CPPFLAGS += $(LIBATOMIC_OPS_CPPFLAGS) - -# Finally add user provided flags -GAP_CPPFLAGS += $(CPPFLAGS) -GAP_PKG_CPPFLAGS += $(CPPFLAGS) ######################################################################## @@ -226,9 +236,48 @@ GAP_CXXFLAGS += $(CXXFLAGS) ######################################################################## # Linker flags ######################################################################## -GAP_LDFLAGS = $(ABI_CFLAGS) -# Add flags for dependencies + +# +# Determine flags for building kernel extensions for use in GAC +# +# For now we basically support GCC and clang, on Linux/macOS/Windows, +# and as a side effect also some other systems such as FreeBSD. +# Support for other compilers or operating systems will require some +# extra tweaks. +# +ifneq (,$(findstring cygwin,$(host_os))) + GAC_CFLAGS = + GAC_LDFLAGS = -shared -Wl,PATH-TO/gap.dll # TODO fix path + # also add this, from GAP's LDFLAGS???? + # -Wl,--stack -Wl,16777216 -Wl,--allow-multiple-definition + +# gcc -shared src/*.o +# -Wl,/home/appveyor/gap/bin/x86_64-pc-cygwin-default64-kv8/gap.dll +# -o bin/x86_64-pc-cygwin-default64-kv8/.libs/datastructures.dll +# -Wl,--enable-auto-image-base +# -Wl,--out-implib,bin/x86_64-pc-cygwin-default64-kv8/.libs/datastructures.dll +# .a + +else + ifneq (,$(findstring darwin,$(host_os))) + GAC_CFLAGS = -fno-common + GAC_LDFLAGS = -bundle -bundle_loader $(GAP_BIN_DIR)/gap + # TODO: could also add '-bundle_loader ${gap_bin}/gap' to give better link time feedback about missing symbols + else + GAC_CFLAGS = -fPIC + GAC_LDFLAGS = -shared + endif +endif + + +GAP_COMMON_LDFLAGS = $(ABI_CFLAGS) $(LDFLAGS) + +GAP_LDFLAGS := $(GAP_COMMON_LDFLAGS) +GAP_PKG_LDFLAGS := $(GAP_COMMON_LDFLAGS) +GAP_INSTALL_LDFLAGS := $(GAP_COMMON_LDFLAGS) + +# Add flags for build dependencies GAP_LDFLAGS += $(GMP_LDFLAGS) GAP_LDFLAGS += $(ZLIB_LDFLAGS) GAP_LDFLAGS += $(READLINE_LDFLAGS) @@ -240,8 +289,13 @@ ifeq ($(HPCGAP),yes) GAP_LDFLAGS += $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) endif -# Finally add user provided flags -GAP_LDFLAGS += $(LDFLAGS) +# linker paths +GAP_PKG_LDFLAGS += -L$(abs_builddir) +GAP_INSTALL_LDFLAGS += -L$(libdir) + +# dynamic linker settings for loadable modules +#GAP_PKG_LDFLAGS += $(GAC_LDFLAGS) +#GAP_INSTALL_LDFLAGS += $(GAC_LDFLAGS) # libs @@ -392,7 +446,7 @@ GAP_LDFLAGS += -Wl,--stack,16777216 GAP_LDFLAGS += -Wl,--allow-multiple-definition # Special build rules for CYGWIN / Windows: In order to allow kernel -# extensions, we employ a trick: GAP itself is compiled into DLL, in which +# extensions, we employ a trick: GAP itself is compiled into DLL, in which # GAP's standard main function is renamed. And gap.exe is a tiny binary which # loads that DLL and calls the renamed main function. all: bin/$(GAPARCH)/gap.dll @@ -486,78 +540,107 @@ clean: ######################################################################## # Rules for 'make install' +# +# +# WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING +# +# The following code is incomplete. Parts of it may already be useful +# for people who want to package GAP for their favorite software +# distribution. This is why install-bin etc. are exposed as separate +# targets. However, these have not yet been tested very extensively, so +# use at your own peril -- that said, if you find any issues with them +# NOT COVERED BELOW or have suggestions for improvements, please contact +# us. +# +# Among the things that are known to be missing (no need to inform us +# about it) are: +# - installing the `gac` script +# - installing packages (this one is a bit tricky, depending on what +# assumptions you are willing to make or require) +# - the install sysinfo.gap is not yet fully adapted, some FLAGS in it +# still need to be adjusted to not contain build paths ######################################################################## LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL) -install: - @echo "Error, 'make install' has not yet been implemented" - exit 1 +install: install-bin install-sysinfo install-doc install-gaproot install-headers install-libgap + @echo "+-----------------------------------------------------------------------+" + @echo "| WARNING, 'make install' support is incomplete! Use at your own peril! |" + @echo "+-----------------------------------------------------------------------+" # the following is wrapper script which is installed by the install-bin target define gap_wrapper #!/bin/sh -exec "$(bindir)/gap.real" -l "$(datarootdir)/gap" "$$@" +exec "$(libdir)/gap/gap" -l "$(libdir)/gap;$(datarootdir)/gap" "$$@" endef export gap_wrapper -install-bin: - @echo "Warning, 'make install-bin' is incomplete" +install-bin: gap gac + $(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)/gap + $(INSTALL) -m 0755 gap $(DESTDIR)$(libdir)/gap + # TODO: put gac-for-install.sh into a tempdir + sed -e "s;@abs_top_builddir@;$(libdir)/gap;" < $(srcdir)/cnf/gac.in > gac-for-install.sh + $(INSTALL) -m 0755 gac-for-install.sh $(DESTDIR)$(libdir)/gap/gac + + $(INSTALL) -d -m 0755 $(DESTDIR)$(bindir) - $(INSTALL) -m 0755 gap $(DESTDIR)$(bindir)/gap.real + # TODO: put gap-wrapper.sh into a tempdir echo "$$gap_wrapper" > gap-wrapper.sh $(INSTALL) -m 0755 gap-wrapper.sh $(DESTDIR)$(bindir)/gap - # TODO: make gac installable; this requires adjusting path in it, and - # installing the libtool script generated by configure somewhere; and then - # putting that path to it into gac) - #$(INSTALL) gac $(DESTDIR)$(bindir) - -install-gaproot: - @echo "Warning, 'make install-gaproot' is incomplete" - $(INSTALL) -d -m 0755 $(DESTDIR)$(datarootdir)/gap - # TODO: update paths and FLAGS in sysinfo.gap - $(INSTALL) -m 0644 sysinfo.gap $(DESTDIR)$(datarootdir)/gap + +# the following lines adjust variables for the installed sysinfo.gap +install-sysinfo: GAP_BIN_DIR = $(libdir)/gap +install-sysinfo: GAP_LIBRARY_DIR = $(GAP_LIBRARY_DIR_INSTALLED) +install-sysinfo: GAP_PKG_CPPFLAGS = $(GAP_INSTALL_CPPFLAGS) +install-sysinfo: GAP_PKG_LDFLAGS = $(GAP_INSTALL_LDFLAGS) +install-sysinfo: + $(INSTALL) -d -m 0755 $(DESTDIR)$(GAP_BIN_DIR) + $(INSTALL) -m 0644 sysinfo.gap $(DESTDIR)$(GAP_BIN_DIR) + @echo "$$sysinfo_gap" >$(DESTDIR)$(GAP_BIN_DIR)/sysinfo.gap + +install-doc: + # TODO: should this depend on the 'doc' target? but that target is phony + # and will re-run each time it is invoked, which is not really what we want. + # TODO: Perhaps the following should be moved to a separate script `doc/install-doc`? + $(INSTALL) -d -m 0755 $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED)/doc + for book in ref tut hpc dev ; do \ + $(INSTALL) -d -m 0755 $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED)/doc/$$book ; \ + for ext in css html js txt pdf six lab; do \ + $(INSTALL) -m 0644 $(srcdir)/doc/$$book/*.$$ext $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED)/doc/$$book/ ; \ + done \ + done + +install-gaproot: CITATION + $(INSTALL) -d -m 0755 $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) # the following lines should not use `cp -r`, which is not quite portable, # and which also may not deal with file permissions correctly - cp -r $(srcdir)/doc $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` - cp -r $(srcdir)/grp $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` - cp -r $(srcdir)/lib $(DESTDIR)$(datarootdir)/gap/ # FIXME: don't use `cp -r` - # TODO: what about CITATION, CONTRIBUTING.md, COPYRIGHT, INSTALL.md, - # LICENSE, README* ? Copy them also here? Or into some other path? + cp -r $(srcdir)/grp $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED)/ + cp -r $(srcdir)/lib $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED)/ + + $(INSTALL) -m 0644 CITATION $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) + $(INSTALL) -m 0644 $(srcdir)/COPYRIGHT $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) + $(INSTALL) -m 0644 $(srcdir)/LICENSE $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) + $(INSTALL) -m 0644 $(srcdir)/CONTRIBUTING.md $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) + $(INSTALL) -m 0644 $(srcdir)/INSTALL.md $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) + $(INSTALL) -m 0644 $(srcdir)/README.md $(DESTDIR)$(GAP_LIBRARY_DIR_INSTALLED) # TODO: also copy bin/BuildPackage.sh, as it is very useful? -install-pkg: - @echo "Warning, 'make install-pkg' is incomplete" - # TODO: should we try to compiled packages? perhaps better not, leave it - # to the packagers, as they also need to consider build dependencies ?! If - # we do try it, then we may need to deal with adjusting paths and so on... - # we can't really install packages by any other means that copying their - # whole directory... One strategy to overcome this: in the future, we - # demand that packages which must be built using `make` also support - # `make install prefix=DIR DESTDIR=dir` - # and/or allow packages to have a `Install(prefix, destdir)` field in - # their `PackageInfo.g` which contains a function that takes care of - # installation (e.g. by running `make install`, or by any other means). - # This could also be used by the PackageManager package (or perhaps we - # should just use PackageManager ourselves, and/or recommend it to - # packagers). - -install-headers: - @echo "Warning, 'make install-headers' is incomplete" +install-headers: build/version.h build/ffdata.h $(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap $(INSTALL) -m 0644 $(srcdir)/src/*.h $(DESTDIR)$(includedir)/gap - # TODO: run the following only if HPC-GAP is enabled? + $(INSTALL) -m 0644 $(srcdir)/build/ffdata.h $(DESTDIR)$(includedir)/gap + $(INSTALL) -m 0644 $(srcdir)/build/version.h $(DESTDIR)$(includedir)/gap $(INSTALL) -d -m 0755 $(DESTDIR)$(includedir)/gap/hpc $(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/hpc - # TODO: take care of config.h, this is difficult + # HACK: create a symlink to support packages which still do `#include "src/compiled.h"` + ln -sfh . $(DESTDIR)$(includedir)/gap/src install-libgap: libgap.la @echo "Warning, 'make install-libgap' is incomplete" $(INSTALL) -d -m 0755 $(DESTDIR)$(libdir) $(LTINSTALL) libgap.la $(DESTDIR)$(libdir) - -.PHONY: install install-bin install-gaproot install-headers install-libgap +.PHONY: install install-bin install-doc install-sysinfo install-gaproot install-headers install-libgap ######################################################################## # Building subprojects @@ -733,35 +816,37 @@ ifeq ($(HPCGAP),yes) $(SOURCES): $(EXTERN_FILES) endif - # regenerate sysinfo.gap if necessary +# +# Note that "GAP_BIN_DIR" and "GAP_LIB_DIR" are in there for backwards +# compatibility with some packages define sysinfo_gap # This file has been generated by the GAP build system, # do not edit manually! GAParch=$(GAPARCH) +GAPARCH=$(GAPARCH) GAP_ABI=$(ABI) GAP_HPCGAP=$(HPCGAP) GAP_VERSION="$(GAP_VERSION)" GAP_BUILD_VERSION="$(GAP_BUILD_VERSION)" -GAP_LIBTOOL_CURRENT=$(GAP_LIBTOOL_CURRENT) -GAP_LIBTOOL_AGE=$(GAP_LIBTOOL_AGE) GAP_KERNEL_MAJOR_VERSION=$(GAP_KERNEL_MAJOR_VERSION) GAP_KERNEL_MINOR_VERSION=$(GAP_KERNEL_MINOR_VERSION) -GAP_BIN_DIR="$(abs_builddir)" -GAP_LIB_DIR="$(abs_srcdir)" +GAP_BIN_DIR="$(GAP_BIN_DIR)" +GAP_LIB_DIR="$(GAP_LIBRARY_DIR)" +GAP_LIBRARY_DIR="$(GAP_LIBRARY_DIR)" -GAP="$(abs_builddir)/bin/gap.sh" -GAC="$(abs_builddir)/gac" +GAP="$(GAP_BIN_DIR)/gap" +GAC="$(GAP_BIN_DIR)/gac" GAP_CC="$(CC)" GAP_CXX="$(CXX)" -GAP_CFLAGS="$(GAP_CFLAGS)" -GAP_CXXFLAGS="$(GAP_CXXFLAGS)" +GAP_CFLAGS="$(GAP_CFLAGS) $(GAC_CFLAGS)" +GAP_CXXFLAGS="$(GAP_CXXFLAGS) $(GAC_CFLAGS)" GAP_CPPFLAGS="$(GAP_PKG_CPPFLAGS)" -GAP_LDFLAGS="$(GAP_LDFLAGS)" -GAP_LIBS="$(GAP_LIBS)" +GAP_LDFLAGS="$(GAP_PKG_LDFLAGS) $(GAC_LDFLAGS)" +GAP_PKG_LIBS="$(GAP_PKG_LIBS)" JULIA="$(JULIA)" JULIA_CPPFLAGS="$(JULIA_CPPFLAGS)" @@ -770,6 +855,23 @@ JULIA_LIBS="$(JULIA_LIBS)" endef export sysinfo_gap +# FIXME: sysinfo.gap refactoring: +# - split GAP_CPPFLAGS and move parts of them to GAP_INCLUDE_FLAGS, +# to make them easier to adjust for installation? +# - get rid of GAP_OBJS by removing the "static link" feature from gac; +# i.e., retain comp_static but don't let it go till linking +# - rename GAParch (but keep it for backwards compat) +# - because of GAParch, we can't actually install sysinfo.gap into $prefix/lib +# it seems we may need at least two root dirs for installations, too; +# one which contains "sysinfo.gap" and other arch dependent files, and +# which is where one points configure scripts at; and one which contains +# the stuff which is portable; say +# GAP_BIN_DIR=$prefix/lib/gap/ contains sysinfo.gap, gap, gac +# GAP_LIBRARY_DIR=$prefix/share/gap/ contains doc, grp, lib, ... +# Note how "lib" means two different things above... +# +# So far, we can still "model" this quite well with sysinfo.gap; but I +# wonder if one day we might need to add provisions for more than two GAPROOTs ? all: sysinfo.gap sysinfo.gap: config.status $(srcdir)/Makefile.rules cnf/GAP-CFLAGS cnf/GAP-CPPFLAGS cnf/GAP-CXXFLAGS cnf/GAP-LDFLAGS cnf/GAP-LIBS @rm -f sysinfo.gap # in case this is a symlink created by an older version of the build system @@ -1346,7 +1448,7 @@ build/stamp-h: $(srcdir)/src/config.h.in config.status echo > $@ ifneq ($(MAINTAINER_MODE),no) -$(srcdir)/src/config.h.in: $(configure_deps) +$(srcdir)/src/config.h.in: $(configure_deps) @if command -v autoheader >/dev/null 2>&1 ; then \ echo "running autoheader" ; \ cd $(srcdir) && autoheader ; \ @@ -1366,8 +1468,9 @@ doc/make_doc: $(srcdir)/doc/make_doc.in config.status CITATION: $(srcdir)/CITATION.in config.status @$(SHELL) ./config.status $@ -gac: $(srcdir)/cnf/gac.in config.status - @$(SHELL) ./config.status $@ +gac: $(srcdir)/cnf/gac.in + sed -e "s;@abs_top_builddir@;$(GAP_BIN_DIR);" < $< > $@ + chmod a+x $@ GNUmakefile: $(srcdir)/GNUmakefile.in config.status $(SHELL) ./config.status $@ diff --git a/cnf/gac.in b/cnf/gac.in index 92b78135c50..e30c3be7ec1 100644 --- a/cnf/gac.in +++ b/cnf/gac.in @@ -50,35 +50,18 @@ ## # absolute path of the directory in which GAP was compiled -abs_top_builddir="@abs_top_builddir@" +GAPROOT="@abs_top_builddir@" -# -libdir="@libdir@" +# read sysinfo.gap, which sets GAP_CFLAGS, GAP_CPPFLAGS, etc. +. "${GAPROOT}/sysinfo.gap" -# path to the GAP executable -gap_compiler="${abs_top_builddir}/gap" - -libtool="@SHELL@ ${abs_top_builddir}/libtool" - -# read sysinfo.gap, which should set GAP_CFLAGS, GAP_CPPFLAGS, etc. -. "${abs_top_builddir}/sysinfo.gap" - -# These three should be filled in by the standard autoconf procedures -c_compiler="$libtool --mode=compile $GAP_CC" -cxx_compiler="$libtool --mode=compile $GAP_CXX" - -# These will need special care -c_dyn_linker="$libtool --mode=link $GAP_CC -module -avoid-version -rpath $libdir" +# Extract sysinfo settings... +gap_compiler="${GAP}" +c_compiler="${GAP_CC}" +cxx_compiler="${GAP_CXX}" +c_dyn_linker="${GAP_CC} ${GAC_DYN_LDFLAGS}" c_addlibs="" -SYS_IS_CYGWIN32=@SYS_IS_CYGWIN32@ -if [ X"$SYS_IS_CYGWIN32" = X"yes" ] ; then - c_dyn_linker="$c_dyn_linker -no-undefined -version-info 0:0:0" - # FIXME: use correct DLL path (also after "make install") - c_dyn_linker="$c_dyn_linker -Wl,${abs_top_builddir}/bin/${GAParch}/gap.dll" -fi - - ############################################################################# ## #F gap_compile @@ -119,17 +102,7 @@ cxx_compile () { c_link_dyn () { mkdir -p $(dirname $1) echo ${c_dyn_linker} ${GAP_LDFLAGS} -o $1 $2 ${c_addlibs} - output_la=${1%.so}.la - output_dir=$(dirname $1) - ${c_dyn_linker} ${GAP_LDFLAGS} -o "$output_la" $2 ${c_addlibs} || exit 1 - if [ X"$SYS_IS_CYGWIN32" = X"yes" ] ; then - # GAP assumes shared libraries end in .so - for dllfile in $(cd $output_dir/.libs; ls *.dll); do - cp $output_dir/.libs/$dllfile $output_dir/${dllfile%.dll}.so - done - else - cp $output_dir/.libs/*.so $output_dir - fi; + ${c_dyn_linker} ${GAP_LDFLAGS} -o $1 $2 ${c_addlibs} || exit 1 } @@ -164,12 +137,12 @@ process_c_file () { c_file=$2 if [ $comp_howfar != "object" ]; then - o_file=${gactmp}/$$_${name}.lo + o_file=${gactmp}/$$_${name}.o temps_o="${temps_o} ${o_file}" elif [ "X$output" != "X" ]; then o_file=$output else - o_file=${name}.lo + o_file=${name}.o fi c_compile $o_file $c_file if [ $comp_howfar = "link" ]; then @@ -189,12 +162,12 @@ process_cxx_file () { cxx_file=$2 if [ $comp_howfar != "object" ]; then - o_file=${gactmp}/$$_${name}.lo + o_file=${gactmp}/$$_${name}.o temps_o="${temps_o} ${o_file}" elif [ "X$output" != "X" ]; then o_file=$output else - o_file=${name}.lo + o_file=${name}.o fi cxx_compile $o_file $cxx_file if [ $comp_howfar = "link" ]; then @@ -360,7 +333,7 @@ for input in ${inputs}; do name=$(basename ${input} .o) process_o_file $name $input;; - *.lo) # look over '.lo' source files + *.lo) # look over '.lo' source files (for backwards compatibility) name=$(basename ${input} .lo) process_o_file $name $input;; esac @@ -374,7 +347,7 @@ if [ $comp_howfar = "link" ]; then exit 1 fi - if [ "X${output}" = "X" ]; then output="${name}.la"; fi + if [ "X${output}" = "X" ]; then output="${name}.so"; fi c_link_dyn ${output} "${objects}" if [ "$savetemps" = "true" ]; then diff --git a/configure.ac b/configure.ac index a24f9cbf785..142a902e127 100644 --- a/configure.ac +++ b/configure.ac @@ -993,5 +993,4 @@ AC_CONFIG_FILES([GNUmakefile]) AC_CONFIG_FILES([CITATION]) AC_CONFIG_FILES([doc/make_doc], [chmod +x doc/make_doc]) AC_CONFIG_FILES([doc/versiondata]) -AC_CONFIG_FILES([gac:cnf/gac.in], [chmod +x gac]) AC_OUTPUT diff --git a/etc/Makefile.gappkg b/etc/Makefile.gappkg index 09e86f32f81..fa48258ea4f 100644 --- a/etc/Makefile.gappkg +++ b/etc/Makefile.gappkg @@ -67,12 +67,12 @@ all: $(KEXT_SO) ######################################################################## # Object files -# For each file FOO.c in SOURCES, add gen/FOO.lo to KEXT_OBJS; similar +# For each file FOO.c in SOURCES, add gen/FOO.o to KEXT_OBJS; similar # for .cc files ######################################################################## -KEXT_OBJS = $(patsubst %.s,gen/%.lo, \ - $(patsubst %.cc,gen/%.lo, \ - $(patsubst %.c,gen/%.lo, \ +KEXT_OBJS = $(patsubst %.s,gen/%.o, \ + $(patsubst %.cc,gen/%.o, \ + $(patsubst %.c,gen/%.o, \ $(KEXT_SOURCES)))) ######################################################################## @@ -93,7 +93,7 @@ endif ######################################################################## # List of all (potential) dependency files, derived from KEXT_OBJS -KEXT_DEPFILES = $(patsubst %.lo,%.d,$(KEXT_OBJS)) +KEXT_DEPFILES = $(patsubst %.o,%.d,$(KEXT_OBJS)) # Include the dependency tracking files -include $(KEXT_DEPFILES) @@ -110,19 +110,19 @@ KEXT_DEPFLAGS = -MQ "$@" -MMD -MP -MF $(@D)/$(*F).d # build rule for C code # The dependency on Makefile ensures that re-running configure recompiles everything -gen/%.lo: %.c Makefile +gen/%.o: %.c Makefile @mkdir -p $(@D) $(QUIET_GAC)$(GAC) -d -p "$(KEXT_DEPFLAGS)" -p "$(KEXT_CFLAGS)" -p "$(CFLAGS)" -c $< -o $@ # build rule for C++ code # The dependency on Makefile ensures that re-running configure recompiles everything -gen/%.lo: %.cc Makefile +gen/%.o: %.cc Makefile @mkdir -p $(@D) $(QUIET_GAC)$(GAC) -d -p "$(KEXT_DEPFLAGS)" -p "$(KEXT_CXXFLAGS)" -p "$(CXXFLAGS)" -c $< -o $@ # build rule for assembler code # The dependency on Makefile ensures that re-running configure recompiles everything -gen/%.lo: %.s Makefile +gen/%.o: %.s Makefile @mkdir -p $(@D) $(QUIET_GAC)$(GAC) -d -p "$(KEXT_DEPFLAGS)" -p "$(KEXT_CFLAGS)" -p "$(CFLAGS)" -c $< -o $@