netsnmp: handle libnl dependency properly
[buildroot-gz.git] / package / slang / 0003-Disable-module-support-in-the-statically-linked-version-of-slsh.patch
blob4bc8f768bef3eacd47fc5634bdfe04ced71dc36e
1 Disable module support in the statically linked version of slsh
3 Adapt an upstream patch to make it apply on 2.3.0. Unnecessary changes
4 have been ignored.
6 Repository: git://git.jedsoft.org/git/slang.git
7 Commit ID: 997c85f5cdb19802a5c97afe44e366a60f94a069
8 Author: John E. Davis <jed@jedsoft.org>
10 Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
11 ---
12 diff -rup a/slsh/Makefile.in b/slsh/Makefile.in
13 --- a/slsh/Makefile.in 2014-12-09 10:04:44.084899944 +0000
14 +++ b/slsh/Makefile.in 2014-12-09 10:16:11.545897275 +0000
15 @@ -1,9 +1,11 @@
16 #-*-sh-*-
17 CC = @CC@
18 CFLAGS = @CFLAGS@ @SLANG_DLL_CFLAGS@
19 -LDFLAGS = @LDFLAGS@ @DYNAMIC_LINK_FLAGS@
20 +LDFLAGS = @LDFLAGS@
21 +DLINK_FLAGS = @DYNAMIC_LINK_FLAGS@
22 CONFIG_DIR = @CONFIG_DIR@
23 OBJDIR = $(ARCH)objs
24 +SOBJDIR = static_objs
25 SRCDIR = $(CONFIG_DIR)/slsh
26 #---------------------------------------------------------------------------
27 # Installation location of the slang library
28 @@ -19,7 +21,8 @@ SLANG_SRCINC = -I@SRCDIR@
29 SLANG_ELFLIB = -L@ELFDIR@# for dynamically linked
30 SLANG_OBJLIB = -L@OBJDIR@# for statically linked
31 #---------------------------------------------------------------------------
32 -OTHER_LIBS = @TERMCAP@ @DYNAMIC_LINK_LIB@ @LIBS@ @M_LIB@
33 +DYNAMIC_LIBS = @TERMCAP@ @DYNAMIC_LINK_LIB@ @LIBS@ @M_LIB@
34 +STATIC_LIBS = @TERMCAP@ @LIBS@ @M_LIB@
35 RPATH = @RPATH@
36 #----------------------------------------------------------------------------
37 INSTALL = @INSTALL@
38 @@ -69,29 +72,37 @@ DEST_SLSH_DOC_DIR= $(DESTDIR)$(SLSH_DOC_
39 #----------------------------------------------------------------------------
40 @SET_MAKE@
41 SHELL = /bin/sh
42 -#INST_LIBS = $(RPATH) $(SLANG_INST_LIB) $(DEST_LIB_DIR) -lslang $(READLINE_LIB) $(OTHER_LIBS)
43 -INST_LIBS = $(DEST_LIB_DIR) $(RPATH) $(SLANG_INST_LIB) -lslang $(READLINE_LIB) $(OTHER_LIBS)
44 +INST_LIBS = $(DEST_LIB_DIR) $(RPATH) $(SLANG_INST_LIB) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
45 DEFS = -DSLSH_CONF_DIR='"$(SLSH_CONF_DIR)"' -DSLSH_PATH='"$(SLSH_LIB_DIR)"' \
46 -DSLSH_CONF_DIR_ENV='$(SLSH_CONF_DIR_ENV)' -DSLSH_LIB_DIR_ENV='$(SLSH_LIB_DIR_ENV)' \
47 -DSLSH_PATH_ENV='$(SLSH_PATH_ENV)'
48 -SRC_LIBS = $(SLANG_ELFLIB) -lslang $(READLINE_LIB) $(OTHER_LIBS)
49 -STATIC_SRC_LIBS = $(SLANG_OBJLIB) -lslang $(READLINE_LIB) $(OTHER_LIBS)
50 +SDEFS = $(DEFS) -DSLSH_STATIC
51 +SRC_LIBS = $(SLANG_ELFLIB) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
52 +STATIC_SRC_LIBS = $(SLANG_OBJLIB) -lslang $(READLINE_LIB) $(STATIC_LIBS)
54 all: $(OBJDIR)/slsh_exe
55 slsh: $(OBJDIR)/slsh
56 -static: $(OBJDIR)/slsh_static
57 $(OBJDIR)/slsh_exe: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
58 - $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh_exe $(LDFLAGS) $(SRC_LIBS)
59 + $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh_exe $(LDFLAGS) $(DLINK_FLAGS) $(SRC_LIBS)
60 $(OBJDIR)/slsh: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
61 - $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(SRC_LIBS)
62 + $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(DLINK_FLAGS) $(SRC_LIBS)
63 $(OBJDIR)/slsh.o: $(OBJDIR) slsh.c slsh.h config.h Makefile
64 cd $(OBJDIR) && $(CC) $(SLANG_SRCINC) $(CFLAGS) -c $(DEFS) $(SRCDIR)/slsh.c
65 $(OBJDIR)/readline.o: $(OBJDIR) readline.c slsh.h config.h Makefile
66 cd $(OBJDIR) && $(CC) $(SLANG_SRCINC) $(CFLAGS) -c $(DEFS) -DUSE_GNU_READLINE=$(GNU_READLINE) $(SRCDIR)/readline.c
67 -$(OBJDIR)/slsh_static: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
68 - $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh_static $(LDFLAGS) $(STATIC_SRC_LIBS)
69 $(OBJDIR):
70 -$(MKINSDIR) $(OBJDIR)
72 +static: $(SOBJDIR)/slsh
73 +$(SOBJDIR)/slsh: $(SOBJDIR)/slsh.o $(SOBJDIR)/readline.o
74 + $(CC) $(CFLAGS) $(SOBJDIR)/slsh.o $(SOBJDIR)/readline.o -o $(SOBJDIR)/slsh $(LDFLAGS) $(STATIC_SRC_LIBS)
75 +$(SOBJDIR)/slsh.o: $(SOBJDIR) slsh.c slsh.h config.h Makefile
76 + cd $(SOBJDIR) && $(CC) $(SLANG_SRCINC) $(CFLAGS) -c $(SDEFS) $(SRCDIR)/slsh.c
77 +$(SOBJDIR)/readline.o: $(SOBJDIR) readline.c slsh.h config.h Makefile
78 + cd $(SOBJDIR) && $(CC) $(SLANG_SRCINC) $(CFLAGS) -c $(SDEFS) -DUSE_GNU_READLINE=$(GNU_READLINE) $(SRCDIR)/readline.c
79 +$(SOBJDIR):
80 + -$(MKINSDIR) $(SOBJDIR)
82 config.h: ../src/config.h
83 cp ../src/config.h .
84 install_directories:
85 @@ -158,7 +169,7 @@ install: slsh install_directories instal
86 $(INSTALL_DATA) doc/man/slsh.1 $(DEST_MAN_DIR)/
87 install-static: static install_directories install_lib_files install_rline_files \
88 install_scripts install_help install_docs
89 - $(INSTALL) $(OBJDIR)/slsh_static $(DEST_BIN_DIR)/slsh
90 + $(INSTALL) $(SOBJDIR)/slsh $(DEST_BIN_DIR)/
91 $(INSTALL_DATA) etc/slsh.rc $(DEST_SLSH_CONF_DIR)/
92 echo 'prepend_to_slang_load_path("$(SLSH_LOCALLIB_DIR)");' >> $(DEST_SLSH_CONF_DIR)/slsh.rc
93 $(INSTALL_DATA) doc/man/slsh.1 $(DEST_MAN_DIR)/
94 @@ -167,6 +178,7 @@ install-static: static install_directori
95 #---------------------------------------------------------------------------
96 clean:
97 -/bin/rm -f *~ $(OBJDIR)/slsh.o $(OBJDIR)/readline.o $(OBJDIR)/slsh $(OBJDIR)/slsh_exe scripts/*~ lib/*~
98 + -/bin/rm -f $(SOBJDIR)/slsh.o $(SOBJDIR)/readline.o $(SOBJDIR)/slsh $(SOBJDIR)/slsh_exe
99 distclean: clean
100 -/bin/rm -f Makefile config.h
102 diff -rup a/slsh/slsh.c b/slsh/slsh.c
103 --- a/slsh/slsh.c 2014-09-18 04:02:24.000000000 +0100
104 +++ b/slsh/slsh.c 2014-12-09 10:17:04.602824146 +0000
105 @@ -514,7 +514,9 @@ int main (int argc, char **argv)
107 if ((-1 == SLang_init_all ())
108 || (-1 == SLang_init_array_extra ())
109 +#ifndef SLSH_STATIC
110 || (-1 == SLang_init_import ()) /* dynamic linking */
111 +#endif
112 || (-1 == SLadd_intrin_fun_table (Intrinsics, NULL))
113 || (-1 == slsh_init_readline_intrinsics ()))