Skip to content
Browse files

cygwin build hacks

build .dll and .dll.a, instead of .so
install .dll in BINDIR not LIBDIR
  • Loading branch information...
1 parent e6b83a8 commit ead90e01ae026f9ef05a1c38ee6cee51a305ce0d Ed Rosten committed Oct 18, 2012
Showing with 74 additions and 11 deletions.
  1. +64 −11 Makefile.in
  2. +6 −0 configure
  3. +4 −0 configure.in
View
75 Makefile.in
@@ -128,6 +128,18 @@ ifeq (@osx_hacks@,yes)
dsoname2=libcvd_debug-@major@.@minor@.dylib
shared=-dynamiclib
+ install_so=install-libs-so
+ install_so_debug=install-libs-debug-so
+else
+ifeq (@cygwin_hacks@,yes)
+ dllname=cygcvd.dll
+ dllimportname=libcvd.dll.a
+
+ ddllname=cygcvd_debug.dll
+ ddllimportname=libcvd_debug.dll.a
+
+ install_so=install-libs-dll
+ install_so_debug=install-libs-debug-dll
else
soname=libcvd.so
soname1=libcvd.so.@major@
@@ -141,6 +153,9 @@ else
set_dsoname=-Wl,-soname,libcvd_debug.so.@major@
shared=-shared
+ install_so=install-libs-so
+ install_so_debug=install-libs-debug-so
+endif
endif
OBJS=$(CVD_OBJS)
@@ -152,14 +167,18 @@ dsos= $(dsoname) $(dsoname1) $(dsoname2)
ifeq (@debug_build@,yes)
- DTARGETS=libcvd_debug.a $(dsoname)
+ DTARGETS=libcvd_debug.a $(dsoname) $(ddllname)
endif
-all: libcvd.a $(soname) progs $(DTARGETS)
+all: libcvd.a $(soname) $(dllname) progs $(DTARGETS)
+
+
+cyg%.dll lib%.dll.a: lib%.a
+ $(LD) -shared -o cyg$*.dll -Wl,--out-implib=lib$*.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive lib$*.a -Wl,--no-whole-archive $(LDFLAGS) $(LOADLIBES)
$(soname): $(OBJS)
rm -f $(sos)
- $(LD) $(shared) -o $(soname2) $(OBJS) $(LDFLAGS) $(LOADLIBES) $(sed_soname)
+ $(LD) $(shared) -o $(soname2) $(OBJS) $(LDFLAGS) $(LOADLIBES) $(set_soname)
ln -s $(soname2) $(soname1)
ln -s $(soname1) $(soname)
@@ -234,30 +253,64 @@ install-headers:
mkdir -p $(DESTDIR)$(includedir)
cp -r cvd $(DESTDIR)$(includedir)
+
+
+
+
+
+install-libs-dll:$(dllname) $(dllimportname)
+ mkdir -p $(DESTDIR)$(bindir)
+ cp $(dllname) $(DESTDIR)$(bindir)
+ mkdir -p $(DESTDIR)$(libdir)
+ cp $(dllimportname) $(DESTDIR)$(libdir)
+
+install-libs-debug-dll:$(ddllname) $(ddllimportname)
+ mkdir -p $(DESTDIR)$(bindir)
+ cp $(ddllname) $(DESTDIR)$(bindir)
+ mkdir -p $(DESTDIR)$(libdir)
+ cp $(ddllimportname) $(DESTDIR)$(libdir)
+
+
+
+
+
+
+
install-libs-so:$(soname)
mkdir -p $(DESTDIR)$(libdir)
rm -f $(DESTDIR)$(libdir)/$(soname2) $(DESTDIR)$(libdir)/$(soname1) $(DESTDIR)$(libdir)/$(soname)
cp $(soname2) $(DESTDIR)$(libdir)
ln -s $(libdir)/$(soname2) $(DESTDIR)$(libdir)/$(soname1)
ln -s $(libdir)/$(soname1) $(DESTDIR)$(libdir)/$(soname)
+install-libs-so-debug:$(dsoname)
+ rm -f $(DESTDIR)$(libdir)/$(dsoname2) $(DESTDIR)$(libdir)/$(dsoname1) $(DESTDIR)$(libdir)/$(dsoname)
+ cp $(dsoname2) $(DESTDIR)$(libdir)
+ ln -s $(libdir)/$(dsoname2) $(DESTDIR)$(libdir)/$(dsoname1)
+ ln -s $(libdir)/$(dsoname1) $(DESTDIR)$(libdir)/$(dsoname)
+
+
+
+
+
+
install-libs-a:libcvd.a
mkdir -p $(DESTDIR)$(libdir)
cp libcvd.a $(DESTDIR)$(libdir)
-install-libs:install-libs-so install-libs-a
-
-install-libs-debug:$(dsoname) libcvd_debug.a
+install-libs-debug-a:libcvd_debug.a
mkdir -p $(DESTDIR)$(libdir)
- rm -f $(DESTDIR)$(libdir)/$(dsoname2) $(DESTDIR)$(libdir)/$(dsoname1) $(DESTDIR)$(libdir)/$(dsoname)
- cp $(dsoname2) $(DESTDIR)$(libdir)
- ln -s $(libdir)/$(dsoname2) $(DESTDIR)$(libdir)/$(dsoname1)
- ln -s $(libdir)/$(dsoname1) $(DESTDIR)$(libdir)/$(dsoname)
cp libcvd_debug.a $(DESTDIR)$(libdir)
+
+
+
+install-libs:$(install_so) install-libs-a
+install-libs-debug:$(install_so_debug) install-libs-debug-a
+
clean:
- /bin/rm -f tmp libcvd.a $(sos) libcvd_debug.a $(dsos)
+ /bin/rm -f tmp libcvd.a $(sos) libcvd_debug.a $(dsos) $(dllname) $(ddllname) $(dllimportname) $(ddllimportname)
find . -name '*.o' | xargs rm -f
find progs/ -perm +0100 -type f | xargs rm -f
rm -rf html man
View
6 configure
@@ -634,6 +634,7 @@ have_sched_yield
have_pthread
have_posix_rt
have_qtbuffer
+cygwin_hacks
have_windows
have_v4l1buffer
have_v4l2buffer
@@ -6266,6 +6267,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
have_windows=yes
;;
+ *cygwin*)
+ cygwin_hacks=yes
+
+ ;;
+
esac
View
4 configure.in
@@ -461,6 +461,10 @@ case "$host" in
*windows*)
AC_SUBST(have_windows, yes)
;;
+ *cygwin*)
+ AC_SUBST(cygwin_hacks,yes)
+ ;;
+
esac

0 comments on commit ead90e0

Please sign in to comment.
Something went wrong with that request. Please try again.