slang-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] minor build problem under Cygwin


Pete Flugstad <pete.flugstad@xxxxxxxxx> wrote:
>  I was building Slang (so I could build Jed) under Cygwin on a
>Windows XP box.
>
>  Basically, it built without a problem, other than that Makefile in
>the modules directory couldn't find libslang.  Some minor tweaks to
>that Makefile and that was fixed.
>
>  Is this a known problem?  Should I post what I changed?

Mike Noble sent me a patch for this that will be included in 2.0.7.
Here is his patch that will appear in the next release.  Thanks, --John

diff -ur slang-2.0.6/autoconf/aclocal.m4 slang-2.0.6-cygwin/autoconf/aclocal.m4
--- slang-2.0.6/autoconf/aclocal.m4	2006-02-05 15:47:31.000000000 -0500
+++ slang-2.0.6-cygwin/autoconf/aclocal.m4	2006-02-23 09:46:56.483955000 -0500
@@ -637,6 +637,18 @@
     ELF_DEP_LIBS="\$(DL_LIB) -lm"
     CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC"
     ;;
+  *cygwin* )
+    DYNAMIC_LINK_FLAGS=""
+    ELF_CC="\$(CC)"
+    ELF_CFLAGS="\$(CFLAGS) "
+    DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a"
+    ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import"
+    ELF_DEP_LIBS="\$(DL_LIB) -lm"
+    CC_SHARED="\$(CC) \$(CFLAGS) -shared"
+    dnl CYGWIN prohibits undefined symbols when linking shared libs
+    SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang"
+    ;;
+
   * )
     echo "Note: ELF compiler for host_os=$host_os may be wrong"
     ELF_CC="\$(CC)"
@@ -656,6 +668,8 @@
 AC_SUBST(ELFLIB)
 AC_SUBST(ELFLIB_MAJOR)
 AC_SUBST(ELFLIB_MAJOR_MINOR)
+AC_SUBST(SLANG_LIB_FOR_MODULES)
+AC_SUBST(DLL_IMPLIB_NAME)
 ])
 
 
diff -ur slang-2.0.6/configure slang-2.0.6-cygwin/configure
--- slang-2.0.6/configure	2006-02-05 15:47:31.000000000 -0500
+++ slang-2.0.6-cygwin/configure	2006-02-23 11:03:36.459890000 -0500
@@ -311,7 +311,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='RPATH SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CONFIG_DIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DYNAMIC_LINK_LIB ELF_CC ELF_CFLAGS ELF_LINK ELF_LINK_CMD ELF_DEP_LIBS DYNAMIC_LINK_FLAGS CC_SHARED ELFLIB ELFLIB_MAJOR ELFLIB_MAJOR_MINOR TERMCAP MISC_TERMINFO_DIRS SRCDIR OBJDIR ELFDIR PCRE_LIB PCRE_INC PCRE_MODULE PNG_LIB PNG_INC PNG_MODULE GNU_READLINE LIB_READLINE PROGRAM_OFILES PROGRAM_CFILES PROGRAM_HFILES PROGRAM_OBJECTS PROGRAM_ELFOBJECTS slang_major_version slang_minor_version slang_version LIBOBJS LTLIBOBJS'
+ac_subst_vars='RPATH SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CONFIG_DIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DYNAMIC_LINK_LIB ELF_CC ELF_CFLAGS ELF_LINK ELF_LINK_CMD ELF_DEP_LIBS DYNAMIC_LINK_FLAGS CC_SHARED ELFLIB ELFLIB_MAJOR ELFLIB_MAJOR_MINOR SLANG_LIB_FOR_MODULES DLL_IMPLIB_NAME TERMCAP MISC_TERMINFO_DIRS SRCDIR OBJDIR ELFDIR PCRE_LIB PCRE_INC PCRE_MODULE PNG_LIB PNG_INC PNG_MODULE GNU_READLINE LIB_READLINE PROGRAM_OFILES PROGRAM_CFILES PROGRAM_HFILES PROGRAM_OBJECTS PROGRAM_ELFOBJECTS slang_major_version slang_minor_ver!
 sion slang_version LIBOBJS LTLIBOB
JS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -5206,6 +5206,17 @@
     ELF_DEP_LIBS="\$(DL_LIB) -lm"
     CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC"
     ;;
+  *cygwin* )
+    DYNAMIC_LINK_FLAGS=""
+    ELF_CC="\$(CC)"
+    ELF_CFLAGS="\$(CFLAGS) "
+    DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a"
+    ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import"
+    ELF_DEP_LIBS="\$(DL_LIB) -lm"
+    CC_SHARED="\$(CC) \$(CFLAGS) -shared"
+        SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang"
+    ;;
+
   * )
     echo "Note: ELF compiler for host_os=$host_os may be wrong"
     ELF_CC="\$(CC)"
@@ -5227,6 +5238,8 @@
 
 
 
+
+
 case "$host_cpu" in
   *alpha* )
     if test "$GCC" = yes
@@ -10103,6 +10116,8 @@
 s,@ELFLIB@,$ELFLIB,;t t
 s,@ELFLIB_MAJOR@,$ELFLIB_MAJOR,;t t
 s,@ELFLIB_MAJOR_MINOR@,$ELFLIB_MAJOR_MINOR,;t t
+s,@SLANG_LIB_FOR_MODULES@,$SLANG_LIB_FOR_MODULES,;t t
+s,@DLL_IMPLIB_NAME@,$DLL_IMPLIB_NAME,;t t
 s,@TERMCAP@,$TERMCAP,;t t
 s,@MISC_TERMINFO_DIRS@,$MISC_TERMINFO_DIRS,;t t
 s,@SRCDIR@,$SRCDIR,;t t
diff -ur slang-2.0.6/modules/Makefile.in slang-2.0.6-cygwin/modules/Makefile.in
--- slang-2.0.6/modules/Makefile.in	2006-02-05 15:47:31.000000000 -0500
+++ slang-2.0.6-cygwin/modules/Makefile.in	2006-02-23 12:08:00.625851000 -0500
@@ -14,7 +14,9 @@
 exec_prefix 	= @exec_prefix@
 SLANG_INC	= -I../src#-I@includedir@
 #SLANG_INC	= #-I@includedir@
-#SLANG_LIB	= #-L@libdir@ -lslang
+ELFDIR		= @ELFDIR@
+SLANG_LIB	= @SLANG_LIB_FOR_MODULES@
+DLL_IMPLIB_NAME = @DLL_IMPLIB_NAME@
 
 #---------------------------------------------------------------------------
 # If building the PCRE module, you may need to set these
@@ -47,8 +49,8 @@
 #---------------------------------------------------------------------------
 RPATH = @RPATH@
 
-#LIBS = $(RPATH) $(SLANG_LIB) $(DL_LIB) -lm
-LIBS = $(RPATH) $(DL_LIB) -lm
+LIBS = $(RPATH) $(SLANG_LIB) $(DL_LIB) -lm
+#LIBS = $(RPATH) $(DL_LIB) -lm
 INCS = $(SLANG_INC)
 
 all: $(MODULES)
@@ -73,13 +75,20 @@
 png-module.so: png-module.c config.h
 	$(CC_SHARED) $(INCS) $(PNG_INC) png-module.c -o png-module.so $(PNG_LIB) $(LIBS)
 
+# Note that Windows/Cygwin modules need execute permissions
 install: all
 	-$(MKINSDIR) $(DEST_MODULEDIR)
 	@for i in $(MODULES); \
 	do \
-		echo $(INSTALL_DATA) $$i $(DEST_MODULEDIR); \
-		$(INSTALL_DATA) $$i $(DEST_MODULEDIR); \
+		if test -n "$(DLL_IMPLIB_NAME)" ; then \
+		   echo $(INSTALL) $$i $(DEST_MODULEDIR); \
+		   $(INSTALL) $$i $(DEST_MODULEDIR); \
+		else \
+		   echo $(INSTALL_DATA) $$i $(DEST_MODULEDIR); \
+		   $(INSTALL_DATA) $$i $(DEST_MODULEDIR); \
+		fi ; \
 	done
+
 	-$(MKINSDIR) $(DEST_SLSH_DIR)
 	@for i in $(SLFILES); \
 	do \
@@ -101,4 +110,5 @@
 clean:
 	-/bin/rm -f $(MODULES) *~
 distclean: clean
+	-/bin/rm -f Makefile
 
diff -ur slang-2.0.6/src/Makefile.in slang-2.0.6-cygwin/src/Makefile.in
--- slang-2.0.6/src/Makefile.in	2006-02-05 15:47:31.000000000 -0500
+++ slang-2.0.6-cygwin/src/Makefile.in	2006-02-23 11:06:14.113923000 -0500
@@ -38,6 +38,7 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 install_lib_dir = @libdir@
+install_bin_dir = @bindir@
 install_include_dir = @includedir@
 install_doc_dir = $(prefix)/share/doc/slang/v@slang_major_version@
 DOC_FILES = ../changes.txt ../COPY* ../doc/slangdoc.html ../doc/text/*.txt
@@ -49,6 +50,7 @@
 DEST_LIBDIR = $(DESTDIR)$(install_lib_dir)
 DEST_DOCDIR = $(DESTDIR)$(install_doc_dir)
 DEST_INCDIR = $(DESTDIR)$(install_include_dir)
+DEST_BINDIR = $(DESTDIR)$(install_bin_dir)
 
 #---------------------------------------------------------------------------
 # Misc commands (safe to leave these untouched)
@@ -69,6 +71,7 @@
 # There should be no need to change anything below here.
 #---------------------------------------------------------------------------
 THIS_LIB		= slang#
+DLL_IMPLIB_NAME		= @DLL_IMPLIB_NAME@
 OTHERSTUFF 		= 
 THIS_LIB_DEFINES	= -DSLANG
 ELF_MAJOR_VERSION	= @slang_major_version@#
@@ -92,6 +95,7 @@
 ELFLIB_MAJOR_MINOR = @ELFLIB_MAJOR_MINOR@
 
 ELFDIR_ELF_LIB = $(ELFDIR)/$(ELFLIB_MAJOR_MINOR)#
+ELFDIR_DLL_LIB = $(ELFDIR)/$(DLL_IMPLIB_NAME)#
 
 EXECLIBS = -L$(OBJDIR) -lslang -lm $(TCAPLIB) $(DL_LIB)
 EXECDEPS = $(OBJDIR_NORMAL_LIB)
@@ -166,6 +170,7 @@
 	$(MKINSDIR) $(DEST_INCDIR)
 $(DEST_LIBDIR):
 	$(MKINSDIR) $(DEST_LIBDIR)
+
 install-elf: elf install
 	-$(RM) $(DEST_LIBDIR)/$(ELFLIB)
 	-$(RM) $(DEST_LIBDIR)/$(ELFLIB_MAJOR)
@@ -177,6 +182,11 @@
 	@echo ""
 	@echo $(ELFLIB_MAJOR_MINOR) created in $(DEST_LIBDIR).
 	@echo The links $(ELFLIB) and $(ELFLIB_MAJOR) to $(ELFLIB_MAJOR_MINOR) were also created.
+	if test -n "$(DLL_IMPLIB_NAME)" ; then \
+	   $(INSTALL_DATA) $(ELFDIR_DLL_LIB) $(DEST_LIBDIR) ; \
+	   $(MKINSDIR) $(DEST_BINDIR) ; \
+	   $(INSTALL) $(ELFDIR_ELF_LIB) $(DEST_BINDIR) ; \
+	fi
 	@echo ""
 install-links:
 	-$(RM) $(DEST_LIBDIR)/$(ELFLIB)

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]