Update build scripts

Fix OS X universal flags
Change to a a more portable way of linking hamlib statically
pull/2/head
Stelios Bounanos 2008-08-29 12:06:20 +01:00
rodzic dd548b244d
commit 6561c6e31f
4 zmienionych plików z 34 dodań i 42 usunięć

Wyświetl plik

@ -33,7 +33,7 @@ if test "x$target_darwin" = "xyes" && test "x$ac_cv_mac_universal" = "xyes"; the
;;
esac
MAC_UNIVERSAL_CFLAGS="$mac_arches $mac_sysroot $mac_minversion"
MAC_UNIVERSAL_LDFLAGS="-dynamiclib"
MAC_UNIVERSAL_LDFLAGS="$mac_arches"
fi
AC_SUBST([MAC_UNIVERSAL_CFLAGS])
AC_SUBST([MAC_UNIVERSAL_LDFLAGS])

Wyświetl plik

@ -55,18 +55,15 @@ set -e
cd "$build"
if test "x$STRIP" = "x0"; then
INSTALL_PROGRAM_CMD="$INSTALL_STRIP_PROGRAM"
else
INSTALL_PROGRAM_CMD="$INSTALL_PROGRAM"
fi
# bundle the binary
appname="${PACKAGE_TARNAME}-${PACKAGE_VERSION}.app"
echo "Creating ${build}/$bundle_dir/$appname"
echo "creating ${build}/$bundle_dir/$appname"
$mkinstalldirs "$bundle_dir/$appname/Contents/MacOS" "$bundle_dir/$appname/Contents/Resources"
cd "$bundle_dir"
$INSTALL_PROGRAM_CMD "${build}/$binary" "$appname/Contents/MacOS"
$INSTALL_PROGRAM "${build}/$binary" "$appname/Contents/MacOS"
if test "x$STRIP" != "x0"; then
strip -S "$appname/Contents/MacOS/$binary"
fi
$INSTALL_DATA "$icon" "$appname/Contents/Resources"
echo "APPL${signature}" > "$appname/Contents/PkgInfo"
sed -e "s!%%IDENTIFIER%%!${identifier}!g; s!%%NAME%%!${name}!g;\
@ -79,7 +76,7 @@ fi
# bundle the binary and its non-standard dependencies
echo "Creating ${build}/$static_bundle_dir/$appname"
echo "creating ${build}/$static_bundle_dir/$appname"
cd ..
$mkinstalldirs "$static_bundle_dir"
cp -pR "$bundle_dir/$appname" "$static_bundle_dir"
@ -107,5 +104,7 @@ while test "x$list" != "x"; do
done
cd "$build"
hdiutil create -srcfolder "$bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "$PACKAGE_TARNAME-$PACKAGE_VERSION-nolibs.dmg"
hdiutil create -srcfolder "$static_bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "$PACKAGE_TARNAME-$PACKAGE_VERSION.dmg"
echo $ECHO_N "creating disk image"
hdiutil create -ov -srcfolder "$bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "$PACKAGE_TARNAME-$PACKAGE_VERSION-nolibs.dmg"
echo $ECHO_N "creating disk image"
hdiutil create -ov -srcfolder "$static_bundle_dir" -format UDZO -tgtimagekey zlib-level=9 "$PACKAGE_TARNAME-$PACKAGE_VERSION.dmg"

Wyświetl plik

@ -1,23 +1,13 @@
#!/bin/sh
# This script must be run by make
set -e
if [ $# -ne 1 ]; then
echo "Syntax: $0 obj-dir" >&2
exit 1
fi
tmp="$1"
binary="fldigi"
if ! test -r "$binary"; then
echo "E: $binary not found"
exit 1
fi
if test "x$PKG_CONFIG" != "x"; then
hamlib_dir="$($PKG_CONFIG --variable=libdir hamlib)"
if test "x$hamlib_dir" = "x"; then
echo "E: Could not determine hamlib \$libdir"
echo "E: Could not determine hamlib \$libdir" >&2
exit 1
fi
else
@ -28,20 +18,24 @@ else
fi
fi
rm -rf $tmp
mkdir -p $tmp
cd $tmp
for i in "$hamlib_dir"/hamlib-*.a; do
ar x $i
done
cd ..
case "$target_os" in
*cygwin*)
AM_LDFLAGS="$AM_LDFLAGS -Wl,--export-all-symbols"
*linux*)
AM_LDFLAGS="$AM_LDFLAGS -Wl,--whole-archive $hamlib_dir/hamlib-*.a -Wl,--no-whole-archive"
;;
*darwin*)
# Apple's ld isn't quite up to this task: there is no way to specify -all_load for
# only a subset of the libraries that we must link with. For this reason we resort
# to using the "dangerous" -m flag, which turns "multiply defined symbol" errors
# into warnings. This will probably not work for ppc64 and x86_64 universal binaries.
AM_LDFLAGS="$AM_LDFLAGS -Wl,-all_load -Wl,-m $hamlib_dir/hamlib-*.a"
;;
*cygwin*)
AM_LDFLAGS="$AM_LDFLAGS -Wl,--export-all-symbols -Wl,--whole-archive $hamlib_dir/hamlib-*.a -Wl,--no-whole-archive"
;;
*)
echo "E: This script does not support $target_os" >&2
exit 1
;;
esac
$CXX -o ${binary}${EXEEXT} $AM_CXXFLAGS $CXXFLAGS $AM_LDFLAGS $LDFLAGS $fldigi_OBJECTS $tmp/*.${OBJEXT} $fldigi_LDADD
rm -rf $tmp
$CXX -o ${1}${EXEEXT} $AM_CXXFLAGS $CXXFLAGS $AM_LDFLAGS $LDFLAGS $fldigi_OBJECTS $fldigi_LDADD

Wyświetl plik

@ -90,7 +90,7 @@ flgen: $(srcdir)/dialogs/confdialog.fl $(srcdir)/rigcontrol/rigdialog.fl
endif
if DARWIN
appbundle:
appbundle: fldigi
sh $(srcdir)/../scripts/mkappbundle.sh "$(srcdir)/../data" . \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-bundle-nolibs \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-bundle
@ -100,9 +100,8 @@ CLEAN_LOCAL_FILES += $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-bundle-nolibs \
endif
if ENABLE_HAMLIB
hamlib-static:
sh $(srcdir)/../scripts/mkhamlibstatic.sh hls-tmp
CLEAN_LOCAL_FILES += hls-tmp
hamlib-static: $(fldigi_OBJECTS)
sh $(srcdir)/../scripts/mkhamlibstatic.sh fldigi
endif
clean-local: