Skip to content

Commit

Permalink
generate libpd.def
Browse files Browse the repository at this point in the history
  • Loading branch information
umlaeute committed Feb 8, 2011
1 parent 44149b4 commit 82b232d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ AC_SUBST(EXTERNAL_EXTENSION)
AC_SUBST(EXTERNAL_CFLAGS)
AC_SUBST(EXTERNAL_LDFLAGS)

PD_LD_OUTPUT_DEF

dnl Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIBM
Expand Down
32 changes: 32 additions & 0 deletions m4/lib-msvc-compat.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ld-output-def.m4 serial 2
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl From Simon Josefsson
dnl see http://www.gnu.org/software/hello/manual/gnulib/Visual-Studio-Compatibility.html


# PD_LD_OUTPUT_DEF()
# -------------
# Check if linker supports -Wl,--output-def and define automake
# conditional HAVE_LD_OUTPUT_DEF if it is.
AC_DEFUN([PD_LD_OUTPUT_DEF],
[
AC_CACHE_CHECK([if gcc/ld supports -Wl,--output-def],
[pd_cv_ld_output_def],
[if test "$enable_shared" = no; then
pd_cv_ld_output_def="not needed, shared libraries are disabled"
else
pd_ldflags_save=$LDFLAGS
LDFLAGS="-Wl,--output-def,conftest.def"
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[pd_cv_ld_output_def=yes],
[pd_cv_ld_output_def=no])
rm -f conftest.def
LDFLAGS="$pd_ldflags_save"
fi])
AM_CONDITIONAL([HAVE_LD_OUTPUT_DEF], test "x$pd_cv_ld_output_def" = "xyes")
])

17 changes: 8 additions & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
AUTOMAKE_OPTIONS = foreign

# on windows we want the libpd to be installed, else we just do static linkeage
lib_LTLIBRARIES =
noinst_LTLIBRARIES =

if WINDOWS
lib_LTLIBRARIES += libpd.la
else
noinst_LTLIBRARIES += libpd.la
endif

pd_LDADD = libpd.la
pd_LDFLAGS =
pd_SOURCES = s_entry.c
nodist_EXTRA_pd_SOURCES =

noinst_LTLIBRARIES = libpd.la
libpd_la_CFLAGS = -DPD -DINSTALL_PREFIX=\"$(prefix)\"
libpd_la_LDFLAGS =

Expand Down Expand Up @@ -157,5 +149,12 @@ pdsend_CFLAGS += -DMSW #kludge, should use _WIN32
pdreceive_CFLAGS += -DMSW #kludge, should use _WIN32
endif


if HAVE_LD_OUTPUT_DEF
pd_LDFLAGS += -Wl,--output-def,pd.def
defexecdir = $(bindir)
defexec_DATA = pd.def
endif

etags: TAGS
etags --append --language=none --regex="/proc[ \t]+\([^ \t]+\)/\1/" *.tcl

0 comments on commit 82b232d

Please sign in to comment.