Commit 5a9f1bba authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Initial build system

At least, it seems to work on Linux. We still need to install data
files though.
parent dabd0fcf
install.js *.cache
npvlc_rc.rc *.lo
vlc.r *.log
install.rdf *.la
manifest.json .deps
.libs
aclocal.m4
autotools
configure
config.*
INSTALL
libtool
m4
Makefile
Makefile.in
stamp-*
See git-log.
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = \
1.11 \
-Wall \
check-news \
dist-xz \
no-dist-gzip
SUBDIRS = share src
#! /bin/sh
set -xe
autoreconf -sfi
dnl Autoconf settings for mozilla-plugin-vlc
AC_COPYRIGHT([Copyright 2002-2010 the VideoLAN team])
AC_INIT(mozilla-plugin-vlc, 1.2.0-git)
VERSION_MAJOR="1"
AC_SUBST(VERSION_MAJOR)
VERSION_MINOR="2"
AC_SUBST(VERSION_MINOR)
VERSION_REVISION="0"
AC_SUBST(VERSION_REVISION)
VERSION_EXTRA="-git"
AC_SUBST(VERSION_EXTRA)
COPYRIGHT_YEARS="1996-2010"
AC_CONFIG_SRCDIR(src/vlcplugin.cpp)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_MACRO_DIR(m4)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_PRESERVE_HELP_ORDER
AM_INIT_AUTOMAKE(tar-ustar color-tests)
AM_CONFIG_HEADER(config.h)
# Disable with "./configure --disable-silent-rules" or "make V=1"
AM_SILENT_RULES([yes])
dnl
dnl Check for tools
dnl
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to '2' to get glibc warnings.])
AC_PROG_CXX
AC_DISABLE_STATIC
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
AC_CHECK_TOOL(DLLTOOL, dlltool, :)
dnl Check for compiler properties
AC_C_CONST
dnl
dnl Check the operating system
dnl
case "${host_os}" in
darwin*)
SYS=darwin
dnl Force gcc "-arch" flag
ARCH_flag=""
case "${host}" in
i386*)
ARCH_flag="-arch i386"
;;
ppc64*)
ARCH_flag="-arch ppc64"
;;
ppc*)
ARCH_flag="-arch ppc"
;;
x86_64*)
ARCH_flag="-arch x86_64"
;;
esac
CFLAGS_save="${CFLAGS_save} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="${CXXFLAGS_save} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"; CXXFLAGS="${CXXFLAGS_save}"
CPPFLAGS_save="${CPPFLAGS_save} ${ARCH_flag}"; CPPFLAGS="${CPPFLAGS_save}"
LDFLAGS_save="${LDFLAGS_save} -Wl,-headerpad_max_install_names ${ARCH_flag}"; LDFLAGS="${LDFLAGS_save}"
;;
*mingw32*)
SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :)
AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0501' for Windows XP APIs.])
;;
esac
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
dnl
dnl Buggy glibc prevention. Purposedly not cached.
dnl See sourceware.org bugs 5058 and 5443.
dnl Ubuntu alone has 20 bug numbers for this...
dnl
AC_MSG_CHECKING(for buggy GNU/libc versions)
AC_PREPROC_IFELSE([
#include <limits.h>
#if defined (__GLIBC__) && (__GLIBC__ == 2) \
&& (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
# error GNU/libc with dcgettext killer bug!
#endif
], [
AC_MSG_RESULT([not present])
], [
AC_MSG_RESULT([found])
AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
work-around for this. Check with your distribution vendor on how to update the
glibc run-time.])
])
AC_PATH_XTRA
PKG_CHECK_MODULES([LIBVLC], [libvlc >= 1.2.0])
AC_ARG_WITH(mozilla-sdk-path,
[ --with-mozilla-sdk-path=PATH path to mozilla sdk])
AC_ARG_WITH(mozilla-pkg,
[ --with-mozilla-pkg=PKG look for PKG.pc to build the mozilla plugin.])
AC_ARG_VAR([MOZILLA_CFLAGS], [C compiler flags for Mozilla, overriding pkg-config])
AC_ARG_VAR([MOZILLA_LIBS], [linker flags for Mozilla, overriding pkg-config])
AC_LANG_PUSH(C++)
dnl pkg-config
dnl As we want to do a loop due to the number of name possible for the .pc
dnl we can't use the pkg-config macros.
AC_MSG_NOTICE([Checking for Mozilla])
AS_IF([test "${with_mozilla_sdk_path}" = "" -o "${with_mozilla_sdk_path}" = "no"], [
found=0
if test -n "$MOZILLA_CFLAGS" -o -n "$MOZILLA_LIBS"
then
found=1
else
if test -n "$PKG_CONFIG"; then
for i in "${with_mozilla_pkg}" libxul {seamonkey,iceape,xulrunner,firefox,iceweasel,mozilla}-plugin; do
if test -n "$i"; then
echo "Trying to find $i package" >&AS_MESSAGE_LOG_FD
AC_MSG_CHECKING([for $i >= 1.9.2])
if $PKG_CONFIG --exists --print-errors "$i >= 1.9.2" 2>&AS_MESSAGE_LOG_FD
then
echo "Using $i pkg-config package." >&AS_MESSAGE_LOG_FD
echo "Using $i package." >&AS_MESSAGE_FD
found=1
MOZILLA_CFLAGS=$(eval $PKG_CONFIG --cflags "$i" )
MOZILLA_LIBS=$(eval $PKG_CONFIG --libs "$i" )
AC_MSG_RESULT([yes])
break
fi
AC_MSG_RESULT([no])
fi
done
fi
fi
AS_IF( [test $found = 1],[
CPPFLAGS="${CPPFLAGS_save} ${MOZILLA_CFLAGS}"
MOZILLA_REQUIRED_HEADERS=1
AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
[#if HAVE_NPAPI_H
# include <npapi.h>
#endif
])
if test "${MOZILLA_REQUIRED_HEADERS}" = "0"; then
AC_MSG_ERROR([Please install the Firefox development tools; plugin/npapi.h and/or plugin/npruntime.h were not found.])
fi
MOZILLA_REQUIRED_HEADERS=
mozilla=:
AS_IF([ test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"],[
PKG_CHECK_MODULES(XPM, [xpm xt],, [
AC_MSG_ERROR([Please install the libXpm and libXt development files.])
])
])
], [
AC_MSG_ERROR([Please install the Mozilla development tools (version 1.9.2 or higher).])
])
dnl End of moz_sdk = ""
], [
dnl special case for mingw32
AS_IF([test "${SYS}" = "mingw32"], [
AC_CHECK_TOOL(CYGPATH, cygpath, "")
dnl latest gecko sdk does not have an xpcom directory
AS_IF([test -d "${with_mozilla_sdk_path}/xpcom"], [
mozilla_sdk_xpcom="/xpcom"
])
])
real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
CPPFLAGS="${CPPFLAGS_save} -I${real_mozilla_sdk}/include"
MOZILLA_REQUIRED_HEADERS=1
AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
[#if HAVE_NPAPI_H
#include <npapi.h>
#endif
])
AS_IF([test "${MOZILLA_REQUIRED_HEADERS}" = "0"], [
AC_MSG_ERROR([Please install the Mozilla development tools, required headers were not found.])
])
])
AC_LANG_POP(C++)
AC_CONFIG_FILES([
Makefile
src/Makefile
share/Makefile
src/install.js
src/install.rdf
src/manifest.json
])
AM_COND_IF([HAVE_WIN32], [
AC_CONFIG_FILES([
src/npvlc_rc.rc
])
])
AM_COND_IF([HAVE_DARWIN], [
AC_CONFIG_FILES([
src/vlc.r
])
])
AC_OUTPUT
install.js
npvlc_rc.rc
vlc.r
install.rdf
manifest.json
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
# Building the Mozilla plugin # Building the Mozilla plugin
############################################################################### ###############################################################################
EXTRA_DIST = npvlc_rc.rc.in npvlc.dll.manifest
MOSTLYCLEANFILES = MOSTLYCLEANFILES =
CLEANFILES = $(BUILT_SOURCES) CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = $(DIST_sources) npvlc_rc.rc.in COPYING npvlc.dll.manifest npvlcdir = $(libdir)/mozilla/plugins
AM_CPPFLAGS = $(LIBVLC_CFLAGS)
SOURCES_mozilla_common = \ libvlcplugin_la_SOURCES = \
vlcshell.cpp \ vlcshell.cpp \
vlcshell.h \ vlcshell.h \
vlcplugin.cpp \ vlcplugin.cpp \
...@@ -16,17 +19,40 @@ SOURCES_mozilla_common = \ ...@@ -16,17 +19,40 @@ SOURCES_mozilla_common = \
control/nporuntime.cpp \ control/nporuntime.cpp \
control/nporuntime.h \ control/nporuntime.h \
control/position.h \ control/position.h \
support/classinfo.h support/classinfo.h \
$(SOURCES_support)
DIST_sources = $(SOURCES_mozilla_common) \ EXTRA_libvlcplugin_la_SOURCES = \
support/npwin.cpp support/npmac.cpp support/npunix.c support/npwin.cpp support/npmac.cpp support/npunix.c
libvlcplugin_la_DEPENDENCIES =
libvlcplugin_la_LIBADD = $(LIBVLC_LIBS)
libvlcplugin_la_LDFLAGS = \
-module -avoid-version \
-no-undefined
if BUILD_MOZILLA npvlc_la_SOURCES = $(libvlcplugin_la_SOURCES)
npvlc_la_DEPENDENCIES = $(libvlcplugin_la_DEPENDENCIES)
npvlc_la_LIBADD = $(libvlcplugin_la_LIBADD)
npvlc_la_LDFLAGS = $(libvlcplugin_la_LDFLAGS)
LIBRARIES_libvlc = $(top_builddir)/src/libvlc.la \ if !HAVE_DARWIN
$(top_builddir)/src/libvlccore.la if !HAVE_WIN32
if HAVE_WIN32 #
# UNIX/Others platforms
#
AM_CPPFLAGS += -DXP_UNIX $(X_CFLAGS) \
$(XPM_CFLAGS) \
-DDATA_PATH=\"$(pkgdatadir)\"
libvlcplugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIBS) \
$(XT_LIBS) -lX11 -lSM -lICE -lXpm \
$(XPM_LIBS) $(MOZILLA_LIBS)
npvlc_LTLIBRARIES = libvlcplugin.la
SOURCES_support = support/npunix.c
else
# Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
# the common naming scheme is lib******plugin.so. Also, we need npwin.cpp # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
...@@ -34,27 +60,20 @@ if HAVE_WIN32 ...@@ -34,27 +60,20 @@ if HAVE_WIN32
# #
lib_LTLIBRARIES = npvlc.la lib_LTLIBRARIES = npvlc.la
AM_CPPFLAGS += -DXP_WIN -DXP_WIN32 \
-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
SOURCES_support = support/npwin.cpp SOURCES_support = support/npwin.cpp
CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32 libvlcplugin_la_DEPENDENCIES += $(DATA_npvlc_rc)
LDFLAGS_mozilla_EXTRA = -no-undefined -Wl,--kill-at -Wl,$(DATA_npvlc_rc) libvlcplugin_la_LDFLAGS += -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
libvlcplugin_la_LIBADD += -lgdi32
npvlc_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support) noinst_DATA = npvlc_rc.$(OBJEXT)
npvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_extra)
npvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_extra)
npvlc_la_DEPENDENCIES = $(DATA_npvlc_rc) $(LIBRARIES_libvlc)
npvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version \
$(LDFLAGS_mozilla_EXTRA)
npvlc_la_LIBADD = `$(VLC_CONFIG) -libs mozilla` $(LIBRARIES_libvlc)
DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
noinst_npvlc_rcdir =
npvlc_rc.$(OBJEXT): npvlc_rc.rc npvlc_rc.$(OBJEXT): npvlc_rc.rc
$(WINDRES) --include-dir $(srcdir) -i $< -o $@ $(WINDRES) --include-dir $(srcdir) -i $< -o $@
endif
else else
if HAVE_DARWIN
# #
# MacOS X # MacOS X
...@@ -62,23 +81,19 @@ if HAVE_DARWIN ...@@ -62,23 +81,19 @@ if HAVE_DARWIN
lib_LTLIBRARIES = npvlc.la lib_LTLIBRARIES = npvlc.la
SOURCES_support = support/npmac.cpp AM_CPPFLAGS += -I. -I$(top_builddir) -c \
CPPFLAGS_mozilla_EXTRA = -I. -I$(top_builddir) -I$(srcdir)/../include -c \ -F/System/Library/Frameworks/CoreFoundation.framework \
-F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) \
-I/Developer/Headers/FlatCarbon -fno-common -fpascal-strings \ -I/Developer/Headers/FlatCarbon -fno-common -fpascal-strings \
-Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 \ -Wmost -Wno-four-char-constants -Wno-unknown-pragmas \
-DXP_UNIX -DXP_MACOSX=1 \
-DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0
LDFLAGS_mozilla_EXTRA = -no-undefined -bundle -Wl,-read_only_relocs -Wl,suppress \
-Wl,-headerpad_max_install_names -shrext $(LIBEXT) -Wl,-framework,Carbon -Wl,-framework,System
npvlc_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support)
npvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
npvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
npvlc_la_DEPENDENCIES = $(LIBRARIES_libvlc)
npvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version \
$(LDFLAGS_mozilla_EXTRA)
npvlc_la_LIBADD = `$(VLC_CONFIG) -libs mozilla` $(LIBRARIES_libvlc)
SOURCES_support = support/npmac.cpp
libvlcplugin_la_LDFLAGS += \
-bundle -Wl,-read_only_relocs -Wl,suppress \
-Wl,-headerpad_max_install_names \
-Wl,-framework,Carbon -Wl,-framework,System \
-shrext $(LIBEXT)
noinst_DATA = npvlc.rsrc VLC\ Plugin.plugin noinst_DATA = npvlc.rsrc VLC\ Plugin.plugin
MOSTLYCLEANFILES += npvlc.rsrc MOSTLYCLEANFILES += npvlc.rsrc
...@@ -107,7 +122,7 @@ VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES) ...@@ -107,7 +122,7 @@ VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES)
rm -Rf "$@" rm -Rf "$@"
$(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib" $(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib"
$(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources" $(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources"
ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/projects/macosx/framework/Pre-Compile.sh" ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/project/macosx/framework/Pre-Compile.sh"
$(INSTALL) npvlc.rsrc "VLC-Plugin.plugin/Contents/Resources/VLC Plugin.rsrc" $(INSTALL) npvlc.rsrc "VLC-Plugin.plugin/Contents/Resources/VLC Plugin.rsrc"
$(INSTALL) "$(top_builddir)/extras/package/macosx/plugin/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist" $(INSTALL) "$(top_builddir)/extras/package/macosx/plugin/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist"
mv "VLC-Plugin.plugin" "VLC Plugin.plugin" mv "VLC-Plugin.plugin" "VLC Plugin.plugin"
...@@ -123,28 +138,4 @@ VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES) ...@@ -123,28 +138,4 @@ VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES)
# done ; \ # done ; \
# fi # fi
else
#
# UNIX/Others platforms
#
CPPFLAGS_mozilla_EXTRA = -DDATA_PATH=\"$(pkgdatadir)\"
npvlc_LTLIBRARIES = libvlcplugin.la
npvlc = libvlcplugin$(LIBEXT)
npvlcdir = $(libdir)/mozilla/plugins
SOURCES_support = support/npunix.c
libvlcplugin_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support)
libvlcplugin_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
libvlcplugin_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
libvlcplugin_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version -shrext $(LIBEXT)
libvlcplugin_la_LIBADD = $(LIBRARIES_libvlc) `$(VLC_CONFIG) -libs mozilla`
# automake gets confused by the ../..
libvlcplugin_la_DEPENDENCIES = $(AM_LIBADD)
endif
endif endif
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment