Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --enable-libgap to build system #2526

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ doc/gapmacrodoc.idx
/hpcgap/ward

/builds/

#libGAP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space after #

libgap.la
.libs

3 changes: 3 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ADDGUARDS2 = @ADDGUARDS2@
# garbage collector source files
GC_SOURCES = @GC_SOURCES@

# Dynamic library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic -> dynamic (to match rest of the file)

BUILD_LIBGAP = @BUILD_LIBGAP@

# compatibility mode
COMPAT_MODE = @COMPAT_MODE@
GAPARCH = @GAPARCH@
Expand Down
6 changes: 5 additions & 1 deletion Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
all: gap$(EXEEXT) gac
.PHONY: all

libgap: libgap.la
libgap: libgap.la sysinfo.gap symlinks
.PHONY: libgap

# Backwards compatibility: add "default" target as alias for "all"
Expand Down Expand Up @@ -412,6 +412,10 @@ gap$(EXEEXT): $(OBJS) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS

endif

ifeq ($(BUILD_LIBGAP),yes)
libgap.so: $(OBJS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic. First off, .so is not quite portable; e.g. on macOS, it should be .dylib, and on Windows .dll

Anyway, we already do generated a shared library (see libgap.la) using libtool, in a fully portable fashion, including setting rpaths etc. -- so can't we just use that? I guess I don't quite know how you "use" libgap later on, so it's a bit difficult for me to evaluate.

$(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) -shared $(OBJS) $(GAP_LIBS) -o $@
endif

########################################################################
# The "docomp" target regenerates the various src/c_*.c files, and
Expand Down
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ AS_CASE([$with_gc],
)
AC_MSG_RESULT([$with_gc])

dnl
dnl User setting: dynamic library mode (off by default)
dnl
AC_ARG_ENABLE([libgap],
[AS_HELP_STRING([--enable-libgap], [enable building of dynamic library])],
[AC_DEFINE([BUILD_LIBGAP], [1], [define if building libgap])],
[enable_libgap=no]
)
AC_MSG_CHECKING([whether to enable dynamic library mode])
AC_MSG_RESULT([$enable_libgap])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With PR #2528 we may not even need this anymore, nor BUILD_LIBGAP


dnl
dnl User setting: Debug mode (off by default)
dnl
Expand Down