Skip to content

Commit

Permalink
Fix perl build
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Mar 31, 2017
1 parent c0745a2 commit d087700
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion perl/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
makefiles = local.mk

GLOBAL_CXXFLAGS += -std=c++11 -g -Wall
GLOBAL_CXXFLAGS += -std=c++14 -g -Wall -include nix/config.h

-include Makefile.config

Expand Down
1 change: 0 additions & 1 deletion perl/Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ perl = @perl@
perllibdir = @perllibdir@
nixstoredir = @nixstoredir@
nixsysconfdir = @nixsysconfdir@
perlbindings = @perlbindings@
2 changes: 0 additions & 2 deletions perl/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ AC_SUBST(nixlocalstatedir)
AC_SUBST(nixsysconfdir)
AC_SUBST(nixstoredir)

AC_SUBST(perlbindings, "yes")

# Expand all variables in config.status.
test "$prefix" = NONE && prefix=$ac_default_prefix
test "$exec_prefix" = NONE && exec_prefix='${prefix}'
Expand Down
42 changes: 19 additions & 23 deletions perl/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,34 @@ nix_perl_modules := $(nix_perl_sources:.in=)

$(foreach x, $(nix_perl_modules), $(eval $(call install-data-in, $(x), $(perllibdir)/Nix)))

ifeq ($(perlbindings), yes)

lib/Nix/Store.cc: lib/Nix/Store.xs
lib/Nix/Store.cc: lib/Nix/Store.xs
$(trace-gen) xsubpp $^ -output $@

libraries += Store

Store_DIR := lib/Nix
libraries += Store

Store_SOURCES := $(Store_DIR)/Store.cc
Store_DIR := lib/Nix

Store_CXXFLAGS = \
-I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \
-D_FILE_OFFSET_BITS=64 \
-Wno-unknown-warning-option -Wno-unused-variable -Wno-literal-suffix \
-Wno-reserved-user-defined-literal -Wno-duplicate-decl-specifier -Wno-pointer-bool-conversion \
$(NIX_CFLAGS)
Store_SOURCES := $(Store_DIR)/Store.cc

Store_LDFLAGS := $(SODIUM_LIBS) $(NIX_LIBS)
Store_CXXFLAGS = \
-I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \
-D_FILE_OFFSET_BITS=64 \
-Wno-unknown-warning-option -Wno-unused-variable -Wno-literal-suffix \
-Wno-reserved-user-defined-literal -Wno-duplicate-decl-specifier -Wno-pointer-bool-conversion \
$(NIX_CFLAGS)

ifeq (CYGWIN,$(findstring CYGWIN,$(OS)))
archlib = $(shell perl -E 'use Config; print $$Config{archlib};')
libperl = $(shell perl -E 'use Config; print $$Config{libperl};')
Store_LDFLAGS += $(shell find ${archlib} -name ${libperl})
endif
Store_LDFLAGS := $(SODIUM_LIBS) $(NIX_LIBS)

Store_ALLOW_UNDEFINED = 1
ifeq (CYGWIN,$(findstring CYGWIN,$(OS)))
archlib = $(shell perl -E 'use Config; print $$Config{archlib};')
libperl = $(shell perl -E 'use Config; print $$Config{libperl};')
Store_LDFLAGS += $(shell find ${archlib} -name ${libperl})
endif

Store_FORCE_INSTALL = 1
Store_ALLOW_UNDEFINED = 1

Store_INSTALL_DIR = $(perllibdir)/auto/Nix/Store
Store_FORCE_INSTALL = 1

endif
Store_INSTALL_DIR = $(perllibdir)/auto/Nix/Store

clean-files += lib/Nix/Config.pm lib/Nix/Store.cc Makefile.config

0 comments on commit d087700

Please sign in to comment.